Improved bomb logging

-Logging added for activating timers attached to transfer valves
-A quick link to the Signallers list has been added to bomb logs involving signallers
This commit is contained in:
ikarrus
2014-05-19 22:25:10 -06:00
parent da5cc3f77f
commit e1998e621b
2 changed files with 106 additions and 91 deletions
@@ -77,8 +77,9 @@
<BR> <B> Valve attachment:</B> [attached_device ? "<A href='?src=\ref[src];device=1'>[attached_device]</A>" : "None"] [attached_device ? "<A href='?src=\ref[src];rem_device=1'>Remove</A>" : ""]
<BR> <B> Valve status: </B> [ valve_open ? "<A href='?src=\ref[src];open=1'>Closed</A> <B>Open</B>" : "<B>Closed</B> <A href='?src=\ref[src];open=1'>Open</A>"]"}
user << browse(dat, "window=trans_valve;size=600x300")
onclose(user, "trans_valve")
var/datum/browser/popup = new(user, "trans_valve", name)
popup.set_content(dat)
popup.open()
return
/obj/item/device/transfer_valve/Topic(href, href_list)
@@ -169,6 +170,13 @@
var/turf/bombturf = get_turf(src)
var/area/A = get_area(bombturf)
var/attachment = "no device"
if(attached_device)
if(istype(attached_device, /obj/item/device/assembly/signaler))
attachment = "<A HREF='?_src_=holder;secretsadmin=list_signalers'>[attached_device]</A>"
else
attachment = attached_device
var/attacher_name = ""
if(!attacher)
attacher_name = "Unknown"
@@ -176,7 +184,7 @@
attacher_name = "[attacher.name]([attacher.ckey])"
var/log_str1 = "Bomb valve opened in "
var/log_str2 = "with [attached_device ? attached_device : "no device"] attacher: [attacher_name]"
var/log_str2 = "with [attachment] attacher: [attacher_name]"
var/log_attacher = ""
if(attacher)
@@ -184,14 +192,16 @@
var/mob/mob = get_mob_by_key(src.fingerprintslast)
var/last_touch_info = ""
if(mob)
last_touch_info = "(<A HREF='?_src_=holder;adminmoreinfo=\ref[mob]'>?</A>)"
var/log_str3 = " Last touched by: [src.fingerprintslast]"
bombers += "[log_str1] <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name]</a> [log_str2][log_attacher] [log_str3][last_touch_info]"
message_admins("[log_str1] <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name]</a> [log_str2][log_attacher] [log_str3][last_touch_info]", 0, 1)
var/bomb_message = "[log_str1] <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name]</a> [log_str2][log_attacher] [log_str3][last_touch_info]"
bombers += bomb_message
message_admins(bomb_message, 0, 1)
log_game("[log_str1] [A.name]([A.x],[A.y],[A.z]) [log_str2] [log_str3]")
merge_gases()
spawn(20) // In case one tank bursts
+90 -85
View File
@@ -11,98 +11,103 @@
var/timing = 0
var/time = 5
proc
timer_end()
describe()
if(timing)
return "The timer is counting down from [time]!"
return "The timer is set for [time] seconds."
activate()
if(!..()) return 0//Cooldown check
timing = !timing
update_icon()
return 0
toggle_secure()
secured = !secured
if(secured)
processing_objects.Add(src)
else
timing = 0
processing_objects.Remove(src)
update_icon()
return secured
timer_end()
if((!secured)||(cooldown > 0)) return 0
pulse(0)
visible_message("\icon[src] *beep* *beep*", "*beep* *beep*")
cooldown = 2
spawn(10)
process_cooldown()
return
process()
if(timing && (time > 0))
time--
if(timing && time <= 0)
timing = 0
timer_end()
time = initial(time)
return
/obj/item/device/assembly/timer/describe()
if(timing)
return "The timer is counting down from [time]!"
return "The timer is set for [time] seconds."
/obj/item/device/assembly/timer/activate()
if(!..()) return 0//Cooldown check
timing = !timing
update_icon()
overlays.Cut()
attached_overlays = list()
if(timing)
overlays += "timer_timing"
attached_overlays += "timer_timing"
if(holder)
holder.update_icon()
return 0
/obj/item/device/assembly/timer/toggle_secure()
secured = !secured
if(secured)
processing_objects.Add(src)
else
timing = 0
processing_objects.Remove(src)
update_icon()
return secured
/obj/item/device/assembly/timer/proc/timer_end()
if((!secured)||(cooldown > 0)) return 0
pulse(0)
visible_message("\icon[src] *beep* *beep*", "*beep* *beep*")
cooldown = 2
spawn(10)
process_cooldown()
return
/obj/item/device/assembly/timer/process()
if(timing && (time > 0))
time--
if(timing && time <= 0)
timing = 0
timer_end()
time = initial(time)
return
/obj/item/device/assembly/timer/update_icon()
overlays.Cut()
attached_overlays = list()
if(timing)
overlays += "timer_timing"
attached_overlays += "timer_timing"
if(holder)
holder.update_icon()
return
/obj/item/device/assembly/timer/interact(mob/user as mob)//TODO: Have this use the wires
if(!secured)
user.show_message("\red The [name] is unsecured!")
return 0
var/second = time % 60
var/minute = (time - second) / 60
var/dat = text("<TT><B>Timing Unit</B>\n[] []:[]\n<A href='?src=\ref[];tp=-30'>-</A> <A href='?src=\ref[];tp=-1'>-</A> <A href='?src=\ref[];tp=1'>+</A> <A href='?src=\ref[];tp=30'>+</A>\n</TT>", (timing ? text("<A href='?src=\ref[];time=0'>Timing</A>", src) : text("<A href='?src=\ref[];time=1'>Not Timing</A>", src)), minute, second, src, src, src, 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>"
var/datum/browser/popup = new(user, "timer", name)
popup.set_content(dat)
popup.open()
return
/obj/item/device/assembly/timer/Topic(href, href_list)
..()
if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
usr << browse(null, "window=timer")
onclose(usr, "timer")
return
if(href_list["time"])
timing = text2num(href_list["time"])
if(timing && istype(holder, /obj/item/device/transfer_valve))
var/timer_message = "[key_name_admin(usr)](<A HREF='?_src_=holder;adminmoreinfo=\ref[usr]'>?</A>) activated [src] attachment on [holder]."
message_admins(timer_message)
bombers += timer_message
log_game("[key_name(usr)] activated [src] attachment for [loc]")
update_icon()
interact(mob/user as mob)//TODO: Have this use the wires
if(!secured)
user.show_message("\red The [name] is unsecured!")
return 0
var/second = time % 60
var/minute = (time - second) / 60
var/dat = text("<TT><B>Timing Unit</B>\n[] []:[]\n<A href='?src=\ref[];tp=-30'>-</A> <A href='?src=\ref[];tp=-1'>-</A> <A href='?src=\ref[];tp=1'>+</A> <A href='?src=\ref[];tp=30'>+</A>\n</TT>", (timing ? text("<A href='?src=\ref[];time=0'>Timing</A>", src) : text("<A href='?src=\ref[];time=1'>Not Timing</A>", src)), minute, second, src, src, src, 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=timer")
onclose(user, "timer")
if(href_list["tp"])
var/tp = text2num(href_list["tp"])
time += tp
time = min(max(round(time), 1), 600)
if(href_list["close"])
usr << browse(null, "window=timer")
return
if(usr)
attack_self(usr)
Topic(href, href_list)
..()
if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
usr << browse(null, "window=timer")
onclose(usr, "timer")
return
if(href_list["time"])
timing = text2num(href_list["time"])
update_icon()
if(href_list["tp"])
var/tp = text2num(href_list["tp"])
time += tp
time = min(max(round(time), 1), 600)
if(href_list["close"])
usr << browse(null, "window=timer")
return
if(usr)
attack_self(usr)
return
return