Sayu grenade and assembly update

This commit is contained in:
ZomgPonies
2013-11-04 14:31:58 -05:00
parent cc437cbd4b
commit 13985d2f4f
18 changed files with 1520 additions and 463 deletions
+31 -9
View File
@@ -6,10 +6,9 @@
icon_state = "infrared"
m_amt = 1000
g_amt = 500
w_amt = 100
origin_tech = "magnets=2"
wires = WIRE_PULSE
bomb_name = "tripwire mine"
secured = 0
@@ -20,6 +19,8 @@
proc
trigger_beam()
describe()
return "The infrared trigger is [on?"on":"off"]."
activate()
if(!..()) return 0//Cooldown check
@@ -57,9 +58,19 @@
if(first)
del(first)
return
if((!(first) && (secured && (istype(loc, /turf) || (holder && istype(holder.loc, /turf))))))
var/obj/effect/beam/i_beam/I = new /obj/effect/beam/i_beam((holder ? holder.loc : loc) )
if(first || !secured) return
var/turf/T = null
if(istype(loc,/turf))
T = loc
else if (holder)
if (istype(holder.loc,/turf))
T = holder.loc
else if (holder.master && istype(holder.master.loc,/turf)) //for onetankbombs and other tertiary builds with assemblies
T = holder.loc.loc
else if(istype(loc,/obj/item/weapon/grenade) && istype(loc.loc,/turf))
T = loc.loc
if(T)
var/obj/effect/beam/i_beam/I = new /obj/effect/beam/i_beam(T)
I.master = src
I.density = 1
I.dir = dir
@@ -94,7 +105,6 @@
holder_movement()
if(!holder) return 0
// dir = holder.dir
del(first)
return 1
@@ -102,8 +112,7 @@
trigger_beam()
if((!secured)||(!on)||(cooldown > 0)) return 0
pulse(0)
if(!holder)
visible_message("\icon[src] *beep* *beep*")
visible_message("\icon[src] *beep* *beep*")
cooldown = 2
spawn(10)
process_cooldown()
@@ -114,6 +123,8 @@
if(!secured) return
user.set_machine(src)
var/dat = text("<TT><B>Infrared Laser</B>\n<B>Status</B>: []<BR>\n<B>Visibility</B>: []<BR>\n</TT>", (on ? 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)))
if(holder)
dat += "<BR>Beam direction: [dir2text(dir)] <A href='?src=\ref[src];rotate=-1'>Counter-clockwise</A> | <A href='?src=\ref[src];rotate=1'>Clockwise</A>"
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")
@@ -128,6 +139,17 @@
onclose(usr, "infra")
return
if(href_list["rotate"])
switch(href_list["rotate"])
if("-1")
dir = turn(dir,90)
update_icon()
del(first)
if("1")
dir = turn(dir,-90)
update_icon()
del(first)
if(href_list["state"])
on = !(on)
update_icon()
@@ -170,7 +192,7 @@
var/visible = 0.0
var/left = null
anchored = 1.0
flags = TABLEPASS
flags = 0
/obj/effect/beam/i_beam/proc/hit()