Files
vgstation13/code/modules/assembly/infrared.dm
mport2004@gmail.com 62e28c2abf Organs:
Moved into their own folder and got split into three files.
Damage  zones have been regrouped slightly to make it easier to deal with them. Currently the organ groups are head, l/r leg, l/r arm, and head.

Attacking:
Armor is properly checked.
Currently aiming for the chest gives a higher chance to stun whereas the head will stun for longer.
Stungloves/Disarm now show up in the attack log.
Stungloves ignore intent.

Silicon:
AI units can now move between cams that are not on the ss13 network.
Cyborg's alert screen should not longer pop up every time they get an alert if they have opened it once during the round.
Robot vision now uses the standard amount of energy.

Gamemodes:
Added Deuryn's unrev message.
Runes can only be examined if you are close to them.
Moved the Loyalty implants to the HoS' locker at the request of HerpA.
Nuke agents now come with explosive implants that will activate upon death.

Projectiles:
Once again went though the gun code and cleaned things up, it is much better now.
Bullet_act fixed up and most mobs now use the one in living, just overload it if they need to do something diff.
Freeze /caplaser/xbow no longer have an infinite loop.
Shotguns have to be pumped manually.

Went though the latest runtime log.

Power cells now use return on their give/use procs

Assemblies have been reworked and are nearly finished, just need to finish up the special assembly code, redo the signalers, and add one or two new assembly items.
Laying down will now only take 3 ticks to get up, from 5.

You can no longer punch people on the spawn screen.

This is a big one and was cleared by two heads, TK will only allow you to pick up items.  If you have an item in your hand it will act normal.

This revision got much larger than originally intended my tests show everything is working fine, but you never know.  Ill likely do more mob teaks in the next few days.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2333 316c924e-a436-60f5-8080-3fe189b3f50e
2011-10-08 10:38:01 +00:00

267 lines
5.9 KiB
Plaintext

/obj/item/device/assembly/infra
name = "Infrared Beam"
desc = "Emits a visible or invisible beam and is triggered when the beam is interrupted."
icon_state = "infrared_old"
m_amt = 1000
g_amt = 500
w_amt = 100
origin_tech = "magnets=2"
secured = 0
small_icon_state_left = "infrared_left"
small_icon_state_right = "infrared_right"
var
scanning = 0
visible = 0
obj/effect/beam/i_beam/first = null
proc
trigger_beam()
activate()
if(!..()) return 0//Cooldown check
src.scanning = !src.scanning
update_icon()
return 1
toggle_secure()
secured = !secured
if(secured)
processing_objects.Add(src)
else
scanning = 0
if(src.first) del(src.first)
processing_objects.Remove(src)
update_icon()
return secured
update_icon()
src.overlays = null
src.small_icon_state_overlays = list()
if(scanning)
src.overlays += text("infrared_old2")
src.small_icon_state_overlays += text("infrared_on")
if(holder)
holder.update_icon()
return
process()//Old code
if(!scanning)
if(src.first)
del(src.first)
return
if((!( src.first ) && (src.secured && (istype(src.loc, /turf) || (src.holder && istype(src.holder.loc, /turf))))))
var/obj/effect/beam/i_beam/I = new /obj/effect/beam/i_beam( (src.holder ? src.holder.loc : src.loc) )
I.master = src
I.density = 1
I.dir = src.dir
step(I, I.dir)
if (I)
I.density = 0
src.first = I
I.vis_spread(src.visible)
spawn( 0 )
if (I)
//world << "infra: setting limit"
I.limit = 8
//world << "infra: processing beam \ref[I]"
I.process()
return
return
attack_hand()
del(src.first)
..()
return
Move()
var/t = src.dir
..()
src.dir = t
del(src.first)
return
holder_movement()
if(!holder) return 0
// src.dir = holder.dir
del(src.first)
return 1
trigger_beam()
if((!secured)||(!scanning)||(cooldown > 0)) return 0
pulse(0)
for(var/mob/O in hearers(null, null))
O.show_message(text("\icon[] *beep* *beep*", src), 3, "*beep* *beep*", 2)
cooldown = 2
spawn(10)
process_cooldown()
return
interact(mob/user as mob)//TODO: change this this to the wire control panel
if(!secured) return
user.machine = src
var/dat = text("<TT><B>Infrared Laser</B>\n<B>Status</B>: []<BR>\n<B>Visibility</B>: []<BR>\n</TT>", (src.scanning ? text("<A href='?src=\ref[];state=0'>On</A>", src) : text("<A href='?src=\ref[];state=1'>Off</A>", src)), (src.visible ? text("<A href='?src=\ref[];visible=0'>Visible</A>", src) : text("<A href='?src=\ref[];visible=1'>Invisible</A>", src)))
dat += "<BR><BR><A href='?src=\ref[src];refresh=1'>Refresh</A>"
dat += "<BR><BR><A href='?src=\ref[src];close=1'>Close</A>"
user << browse(dat, "window=infra")
onclose(user, "infra")
return
Topic(href, href_list)
..()
if(get_dist(src, usr) > 1)
usr << browse(null, "window=infra")
onclose(usr, "infra")
return
if (href_list["state"])
src.scanning = !(src.scanning)
update_icon()
if (href_list["visible"])
src.visible = !(src.visible)
spawn( 0 )
if(src.first)
src.first.vis_spread(src.visible)
if (href_list["close"])
usr << browse(null, "window=infra")
return
if(usr)
src.attack_self(usr)
return
verb/rotate()//This could likely be better
set name = "Rotate Infrared Laser"
set category = "Object"
set src in usr
src.dir = turn(src.dir, 90)
return
/***************************IBeam*********************************/
/obj/effect/beam/i_beam
name = "i beam"
icon = 'projectiles.dmi'
icon_state = "ibeam"
var/obj/effect/beam/i_beam/next = null
var/obj/item/device/assembly/infra/master = null
var/limit = null
var/visible = 0.0
var/left = null
anchored = 1.0
flags = TABLEPASS
/obj/effect/beam/i_beam/proc/hit()
//world << "beam \ref[src]: hit"
if(src.master)
//world << "beam hit \ref[src]: calling master \ref[master].hit"
src.master.trigger_beam()
del(src)
return
/obj/effect/beam/i_beam/proc/vis_spread(v)
//world << "i_beam \ref[src] : vis_spread"
src.visible = v
spawn(0)
if(src.next)
//world << "i_beam \ref[src] : is next [next.type] \ref[next], calling spread"
src.next.vis_spread(v)
return
return
/obj/effect/beam/i_beam/process()
//world << "i_beam \ref[src] : process"
if((src.loc.density || !( src.master )))
//SN src = null
// world << "beam hit loc [loc] or no master [master], deleting"
del(src)
return
//world << "proccess: [src.left] left"
if(src.left > 0)
src.left--
if(src.left < 1)
if(!( src.visible ))
src.invisibility = 101
else
src.invisibility = 0
else
src.invisibility = 0
//world << "now [src.left] left"
var/obj/effect/beam/i_beam/I = new /obj/effect/beam/i_beam( src.loc )
I.master = src.master
I.density = 1
I.dir = src.dir
//world << "created new beam \ref[I] at [I.x] [I.y] [I.z]"
step(I, I.dir)
if(I)
//world << "step worked, now at [I.x] [I.y] [I.z]"
if (!( src.next ))
//world << "no src.next"
I.density = 0
//world << "spreading"
I.vis_spread(src.visible)
src.next = I
spawn( 0 )
//world << "limit = [src.limit] "
if ((I && src.limit > 0))
I.limit = src.limit - 1
//world << "calling next process"
I.process()
return
else
//world << "is a next: \ref[next], deleting beam \ref[I]"
del(I)
else
//world << "step failed, deleting \ref[src.next]"
del(src.next)
spawn(10)
src.process()
return
return
/obj/effect/beam/i_beam/Bump()
del(src)
return
/obj/effect/beam/i_beam/Bumped()
src.hit()
return
/obj/effect/beam/i_beam/HasEntered(atom/movable/AM as mob|obj)
if(istype(AM, /obj/effect/beam))
return
spawn( 0 )
src.hit()
return
return
/obj/effect/beam/i_beam/Del()
del(src.next)
..()
return