Added a new logging system that can be used for various things in the game (such as the singularity engine, AI interactions, anything-else that may be suggested to me :P).

At the moment it only logs some singularity things. Please let me know if there are any important methods of singulo-grief which I may have missed.

The "Investigate" verb is available to everyone of rank "Admin observer" and upwards. Just type "Investigate" and select the subject you'd like to see logs for. Typing "Investigate singulo" will also work as a shortcut.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3679 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
elly1989@rocketmail.com
2012-05-27 01:31:57 +00:00
parent 6b9895ecb4
commit d7c9e72a29
14 changed files with 100 additions and 32 deletions
+1 -1
View File
@@ -33,6 +33,7 @@
toggle_power()
user.visible_message("[user.name] turns the [src.name] [active? "on":"off"].", \
"You turn the [src.name] [active? "on":"off"].")
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [user.key]. [P?"It contains [P]":"It is empty"].","singulo")
return
else
user << "\red The controls are locked!"
@@ -135,7 +136,6 @@
if(active)
icon_state = "ca_on"
flick("ca_active", src)
else
icon_state = "ca"
flick("ca_deactive", src)
@@ -37,6 +37,9 @@
..()
return
Del()
investigate_log("<font color='red'>deleted</font> at ([x],[y],[z])","singulo")
..()
update_icon()
if (active && !(stat & (NOPOWER|BROKEN)))
@@ -53,12 +56,14 @@
src.active = 0
user << "You turn off the [src]."
src.use_power = 1
investigate_log("turned <font color='red'>off</font> by [user.key]","singulo")
else
src.active = 1
user << "You turn on the [src]."
src.shot_number = 0
src.fire_delay = 100
src.use_power = 2
investigate_log("turned <font color='green'>on</font> by [user.key]","singulo")
update_icon()
else
user << "\red The controls are locked!"
@@ -87,6 +87,8 @@ field_generator power level display
"You turn on the [src.name].", \
"You hear heavy droning")
turn_on()
investigate_log("<font color='green'>activated</font> by [user.key].","singulo")
src.add_fingerprint(user)
else
user << "The [src] needs to be firmly secured to the floor first."
@@ -214,6 +216,7 @@ field_generator power level display
for(var/mob/M in viewers(src))
M.show_message("\red The [src.name] shuts down!")
turn_off()
investigate_log("ran out of power and <font color='red'>deactivated</font>","singulo")
src.power = 0
return 0
@@ -344,4 +347,5 @@ field_generator power level display
if((world.time - O.last_warning) > 50) //to stop message-spam
temp = 0
message_admins("A singulo exists and a containment field has failed.",1)
investigate_log("has <font color='red'>failed</font> whilst a singulo exists.","singulo")
O.last_warning = world.time
@@ -0,0 +1,4 @@
/area/engine/engineering/poweralert(var/state, var/source)
if (state != poweralm)
investigate_log("has a power alarm!","singulo")
..()
@@ -152,6 +152,12 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
return
Move()
..()
if(master && master.active)
master.toggle_power()
investigate_log("was moved whilst active; it <font color='red'>powered down</font>.","singulo")
ex_act(severity)
switch(severity)
if(1.0)
@@ -182,9 +188,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
update_icon()
switch(construction_state)
if(0)
icon_state="[reference]"
if(1)
if(0,1)
icon_state="[reference]"
if(2)
icon_state="[reference]w"
@@ -376,7 +380,6 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
del(src)
return
proc
update_state()
return 0
@@ -49,7 +49,6 @@
if(use_power)
icon_state = "[reference]p"
else
icon_state = "[reference]c"
switch(construction_state)
if(0)
icon_state = "[reference]"
@@ -57,7 +56,7 @@
icon_state = "[reference]"
if(2)
icon_state = "[reference]w"
if(3)
else
icon_state = "[reference]c"
return
@@ -79,28 +78,28 @@
return
if(href_list["togglep"])
src.toggle_power()
if(href_list["scan"])
investigate_log("turned [active?"<font color='red'>ON</font>":"<font color='green'>OFF</font>"] by [usr.key]","singulo") else if(href_list["scan"])
src.part_scan()
if(href_list["strengthup"])
src.strength++
else if(href_list["strengthup"])
strength++
if(strength > 2)
strength = 2
else
investigate_log("increased to <font color='red'>[strength]</font> by [usr.key]","singulo")
strength = min(2,strength+1)
for(var/obj/structure/particle_accelerator/part in connected_parts)
part.strength++
part.strength = strength
part.update_icon()
if(src.strength > 2)
src.strength = 2
for(var/obj/structure/particle_accelerator/part in connected_parts)
part.strength = 2
part.update_icon()
if(href_list["strengthdown"])
src.strength--
else if(href_list["strengthdown"])
strength++
if(strength < 0)
strength = 0
else
investigate_log("decreased to <font color='green'>[strength]</font> by [usr.key]","singulo")
for(var/obj/structure/particle_accelerator/part in connected_parts)
part.strength--
part.strength = strength
part.update_icon()
if(src.strength < 0)
src.strength = 0
for(var/obj/structure/particle_accelerator/part in connected_parts)
part.strength = 0
part.update_icon()
src.updateDialog()
src.update_icon()
return
@@ -118,14 +117,15 @@
process()
if(src.active)
//a part is missing!
if( length(connected_parts) < 6 )
investigate_log("lost a connected part; It <font color='red'>powered down</font>.","singulo")
src.toggle_power()
return
//emit some particles
for(var/obj/structure/particle_accelerator/particle_emitter/PE in connected_parts)
if(PE)
PE.emit_particle(src.strength)
// for(var/obj/structure/particle_accelerator/fuel_chamber/PF in connected_parts)
// PF.doshit()
// for(var/obj/structure/particle_accelerator/power_box/PB in connected_parts)
// PB.doshit()
//finish up putting the fuel run and power use things in here
return
@@ -40,6 +40,7 @@ var/global/list/uneatable = list(
count = 1
break
if(!count) message_admins("A singulo has been created without containment fields active ([x],[y],[z])",1)
investigate_log("was created. [count?"":"<font color='red'>No containment fields were active</font>"]","singulo")
src.energy = starting_energy
if(temp)