From 4efb343d77cbae48cc650694738af5e7bb461e8b Mon Sep 17 00:00:00 2001 From: phil235 Date: Fri, 29 Apr 2016 18:21:53 +0200 Subject: [PATCH] * Admins can now bypass the vote creation cooldown. * Messages in a mob's say_log var are now timestamped and include the coordinates of the mob at the time. * Fix oil slime extract explosion reaction not being logged. * Fixes lack of log for reagent explosion. * Mob's attack_log now show when the mob was electrocuted. Doors get an electrification log when electrified (including via an EMP). * Fixes gibself admin log showing null instead of the key. --- code/controllers/subsystem/voting.dm | 2 +- code/datums/diseases/_disease.dm | 2 +- .../gamemodes/malfunction/Malf_Modules.dm | 1 + code/game/machinery/airlock_control.dm | 1 - code/game/machinery/doors/airlock.dm | 6 +++--- code/game/machinery/doors/door.dm | 2 ++ code/modules/admin/verbs/randomverbs.dm | 6 +----- code/modules/assembly/doorcontrol.dm | 7 ++++++- code/modules/mob/living/say.dm | 8 ++++++-- code/modules/power/power.dm | 2 ++ .../chemistry/recipes/pyrotechnics.dm | 20 ++++++++++++++----- .../chemistry/recipes/slime_extracts.dm | 7 +++++++ 12 files changed, 45 insertions(+), 19 deletions(-) diff --git a/code/controllers/subsystem/voting.dm b/code/controllers/subsystem/voting.dm index 0549457940e..52ca70ce5dd 100644 --- a/code/controllers/subsystem/voting.dm +++ b/code/controllers/subsystem/voting.dm @@ -147,7 +147,7 @@ var/datum/subsystem/vote/SSvote if(!mode) if(started_time != null) var/next_allowed_time = (started_time + config.vote_delay) - if(next_allowed_time > world.time) + if(next_allowed_time > world.time && !check_rights_for(usr.client,R_ADMIN)) return 0 reset() diff --git a/code/datums/diseases/_disease.dm b/code/datums/diseases/_disease.dm index e96b40ca822..f2bfbfb9bff 100644 --- a/code/datums/diseases/_disease.dm +++ b/code/datums/diseases/_disease.dm @@ -155,7 +155,7 @@ var/list/diseases = subtypesof(/datum/disease) if(disease_flags & CAN_RESIST) if(!(type in affected_mob.resistances)) affected_mob.resistances += type - remove_virus() + remove_virus() qdel(src) diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index 307b26857ae..2374d6382de 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -163,6 +163,7 @@ AL.close() AL.bolt() //Bolt it! AL.secondsElectrified = -1 //Shock it! + AL.shockedby += "\[[time_stamp()]\][src](ckey:[src.ckey])" else if(!D.stat) //So that only powered doors are closed. D.close() //Close ALL the doors! diff --git a/code/game/machinery/airlock_control.dm b/code/game/machinery/airlock_control.dm index 13426cbbdfe..7c5abe61c07 100644 --- a/code/game/machinery/airlock_control.dm +++ b/code/game/machinery/airlock_control.dm @@ -4,7 +4,6 @@ /obj/machinery/door/airlock var/id_tag var/frequency - var/shockedby = list() var/datum/radio_frequency/radio_connection diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 66c2510e0ae..95c633ddecf 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -724,8 +724,8 @@ var/list/airlock_overlays = list() else if(src.secondsElectrified!=0) usr << text("The door is already electrified. You can't re-electrify it while it's already electrified.
\n") else - shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])") - add_logs(usr, src, "electrified", addition="at [x],[y],[z]") + shockedby += "\[[time_stamp()]\][usr](ckey:[usr.ckey])" + add_logs(usr, src, "electrified") src.secondsElectrified = 30 spawn(10) while (src.secondsElectrified>0) @@ -744,7 +744,7 @@ var/list/airlock_overlays = list() usr << text("The door is already electrified. You can't re-electrify it while it's already electrified.
\n") else shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])") - add_logs(usr, src, "electrified", addition="at [x],[y],[z]") + add_logs(usr, src, "electrified") src.secondsElectrified = -1 if (8) // Not in order >.> diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 09e955a44d3..3f666e197f5 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -10,6 +10,7 @@ power_channel = ENVIRON var/secondsElectrified = 0 + var/shockedby = list() var/visible = 1 var/operating = 0 var/glass = 0 @@ -191,6 +192,7 @@ obj/machinery/door/proc/try_to_crowbar(obj/item/I, mob/user) if(prob(40/severity)) if(secondsElectrified == 0) secondsElectrified = -1 + shockedby += "\[[time_stamp()]\]EM Pulse" spawn(300) secondsElectrified = 0 ..() diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index b8824da0bbd..ab377e9b37a 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -608,14 +608,10 @@ Traitors and the like can also be revived with the previous role mostly intact. var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No") if(confirm == "Yes") - if (istype(mob, /mob/dead/observer)) // so they don't spam gibs everywhere - return - else - mob.gib(no_brain = 1) - log_admin("[key_name(usr)] used gibself.") message_admins("[key_name_admin(usr)] used gibself.") feedback_add_details("admin_verb","GIBS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + mob.gib(no_brain = 1) /client/proc/cmd_admin_check_contents(mob/living/M in mob_list) set category = "Special Verbs" diff --git a/code/modules/assembly/doorcontrol.dm b/code/modules/assembly/doorcontrol.dm index a4cd973559c..5725bf78a32 100644 --- a/code/modules/assembly/doorcontrol.dm +++ b/code/modules/assembly/doorcontrol.dm @@ -60,7 +60,12 @@ D.locked = !D.locked D.update_icon() if(specialfunctions & SHOCK) - D.secondsElectrified = D.secondsElectrified ? 0 : -1 + if(D.secondsElectrified) + D.secondsElectrified = -1 + D.shockedby += "\[[time_stamp()]\][usr](ckey:[usr.ckey])" + add_logs(usr, D, "electrified") + else + D.secondsElectrified = 0 if(specialfunctions & SAFE) D.safe = !D.safe sleep(10) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index e90b7cb8188..c6874cd7354 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -98,8 +98,13 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) if(!message) return + var/turf/T = get_turf(src) + + var/logged_msg = "\[[time_stamp()]\] [message]" + if(T) + logged_msg += " ([T.x], [T.y], [T.z])" //Log of what we've said, plain message, no spans or junk - say_log += message + say_log += logged_msg var/message_range = 7 var/radio_return = radio(message, message_mode, spans) @@ -111,7 +116,6 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) message_range = 1 //No screams in space, unless you're next to someone. - var/turf/T = get_turf(src) var/datum/gas_mixture/environment = T.return_air() var/pressure = (environment)? environment.return_pressure() : 0 if(pressure < SOUND_MINIMUM_PRESSURE) diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index 2b19c42327b..3d2a726adc4 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -327,6 +327,8 @@ power_source = cell shock_damage = cell_damage var/drained_hp = M.electrocute_act(shock_damage, source, siemens_coeff) //zzzzzzap! + add_logs(source, M, "electrocuted") + var/drained_energy = drained_hp*20 if (source_area) diff --git a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm index 37dd3e62787..64b8792a454 100644 --- a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm +++ b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm @@ -6,9 +6,20 @@ var/modifier = 0 /datum/chemical_reaction/reagent_explosion/on_reaction(datum/reagents/holder, created_volume) - var/location = get_turf(holder.my_atom) + var/turf/T = get_turf(holder.my_atom) + var/inside_msg + if(ismob(holder.my_atom)) + var/mob/M = holder.my_atom + inside_msg = " inside [key_name_admin(M)]" + var/lastkey = holder.my_atom.fingerprintslast + var/touch_msg = "N/A" + if(lastkey) + var/mob/toucher = get_mob_by_key(lastkey) + touch_msg = "[key_name_admin(lastkey)]? (FLW)" + message_admins("Reagent explosion reaction occured at [T.loc.name] (JMP)[inside_msg]. Last Fingerprint: [touch_msg].") + log_game("Reagent explosion reaction occured at [T.loc.name] ([T.x],[T.y],[T.z]). Last Fingerprint: [lastkey ? lastkey : "N/A"]." ) var/datum/effect_system/reagents_explosion/e = new() - e.set_up(modifier + round(created_volume/strengthdiv, 1), location, 0, 0) + e.set_up(modifier + round(created_volume/strengthdiv, 1), T, 0, 0) e.start() holder.clear_reagents() @@ -66,9 +77,8 @@ C.Weaken(2) C.adjust_fire_stacks(5) C.IgniteMob() - ..() - else - ..() + ..() + /datum/chemical_reaction/blackpowder name = "Black Powder" diff --git a/code/modules/reagents/chemistry/recipes/slime_extracts.dm b/code/modules/reagents/chemistry/recipes/slime_extracts.dm index e57b5736abd..eceb9be7e61 100644 --- a/code/modules/reagents/chemistry/recipes/slime_extracts.dm +++ b/code/modules/reagents/chemistry/recipes/slime_extracts.dm @@ -494,6 +494,13 @@ /datum/chemical_reaction/slimeexplosion/on_reaction(datum/reagents/holder) feedback_add_details("slime_cores_used","[type]") var/turf/T = get_turf(holder.my_atom) + var/lastkey = holder.my_atom.fingerprintslast + var/touch_msg = "N/A" + if(lastkey) + var/mob/toucher = get_mob_by_key(lastkey) + touch_msg = "[key_name_admin(lastkey)]?(FLW)." + message_admins("Slime Explosion reaction started at [T.loc.name] (JMP). Last Fingerprint: [touch_msg]") + log_game("Slime Explosion reaction started at [T.loc.name] ([T.x],[T.y],[T.z]). Last Fingerprint: [lastkey ? lastkey : "N/A"].") T.visible_message("The slime extract begins to vibrate violently !") spawn(50) if(holder && holder.my_atom)