diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index a9e6d1f68aa..2d847f39b57 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -101,3 +101,10 @@ #define SNPC_STEALTH 2 #define SNPC_MARTYR 3 #define SNPC_PSYCHO 4 + +//Individual logging defines +#define INDIVIDUAL_ATTACK_LOG "Attack log" +#define INDIVIDUAL_SAY_LOG "Say log" +#define INDIVIDUAL_EMOTE_LOG "Emote log" +#define INDIVIDUAL_OOC_LOG "OOC log" +#define INDIVIDUAL_SHOW_ALL_LOG "All logs" \ No newline at end of file diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 9fed8a9f2f4..e932e9dfa84 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -181,16 +181,12 @@ Proc for attack log creation, because really why not living_target = target if(is_mob_user) - var/message = "\[[time_stamp()]\] [user ? "[user.name][(user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] has [what_done] [target ? "[target.name][(is_mob_target && target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][(living_target) ? " (NEWHP: [living_target.health])" : ""][(attack_location) ? "([attack_location.x],[attack_location.y],[attack_location.z])" : ""]" - user.attack_log += message - if(user.mind) - user.mind.attack_log += message + var/message = "has [what_done] [target ? "[target.name][(is_mob_target && target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][(living_target) ? " (NEWHP: [living_target.health])" : ""][(attack_location) ? "([attack_location.x],[attack_location.y],[attack_location.z])" : ""]" + user.log_message(message, INDIVIDUAL_ATTACK_LOG) if(is_mob_target) - var/message = "\[[time_stamp()]\] [target ? "[target.name][(target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] has been [what_done] by [user ? "[user.name][(is_mob_user && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][(living_target) ? " (NEWHP: [living_target.health])" : ""][(attack_location) ? "([attack_location.x],[attack_location.y],[attack_location.z])" : ""]" - target.attack_log += message - if(target.mind) - target.mind.attack_log += message + var/message = "has been [what_done] by [user ? "[user.name][(is_mob_user && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][(living_target) ? " (NEWHP: [living_target.health])" : ""][(attack_location) ? "([attack_location.x],[attack_location.y],[attack_location.z])" : ""]" + target.log_message(message, INDIVIDUAL_ATTACK_LOG) log_attack("[user ? "[user.name][(is_mob_user && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] [what_done] [target ? "[target.name][(is_mob_target && target.ckey)? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][(living_target) ? " (NEWHP: [living_target.health])" : ""][(attack_location) ? "([attack_location.x],[attack_location.y],[attack_location.z])" : ""]") diff --git a/code/datums/antagonists/datum_clockcult.dm b/code/datums/antagonists/datum_clockcult.dm index b66a8cbc11c..f679b36daec 100644 --- a/code/datums/antagonists/datum_clockcult.dm +++ b/code/datums/antagonists/datum_clockcult.dm @@ -43,7 +43,7 @@ INVOKE_ASYNC(ticker.mode, /datum/game_mode.proc/replace_jobbaned_player, owner, ROLE_SERVANT_OF_RATVAR, ROLE_SERVANT_OF_RATVAR) if(owner.mind) owner.mind.special_role = "Servant of Ratvar" - owner.attack_log += "\[[time_stamp()]\] Has been converted to the cult of Ratvar!" + owner.log_message("Has been converted to the cult of Ratvar!", INDIVIDUAL_ATTACK_LOG) if(issilicon(owner)) var/mob/living/silicon/S = owner if(iscyborg(S) && !silent_update) @@ -154,7 +154,7 @@ if(owner.mind) owner.mind.wipe_memory() owner.mind.special_role = null - owner.attack_log += "\[[time_stamp()]\] Has renounced the cult of Ratvar!" + owner.log_message("Has renounced the cult of Ratvar!", INDIVIDUAL_ATTACK_LOG) if(iscyborg(owner)) owner << "Despite your freedom from Ratvar's influence, you are still irreparably damaged and no longer possess certain functions such as AI linking." ..() diff --git a/code/datums/antagonists/datum_cult.dm b/code/datums/antagonists/datum_cult.dm index b49cb41c78b..06ecdce7709 100644 --- a/code/datums/antagonists/datum_cult.dm +++ b/code/datums/antagonists/datum_cult.dm @@ -23,7 +23,7 @@ INVOKE_ASYNC(ticker.mode, /datum/game_mode.proc/replace_jobbaned_player, owner, ROLE_CULTIST, ROLE_CULTIST) if(owner.mind) owner.mind.special_role = "Cultist" - owner.attack_log += "\[[time_stamp()]\] Has been converted to the cult of Nar'Sie!" + owner.log_message("Has been converted to the cult of Nar'Sie!", INDIVIDUAL_ATTACK_LOG) ..() /datum/antagonist/cultist/apply_innate_effects() @@ -44,7 +44,7 @@ ticker.mode.cult -= owner.mind ticker.mode.update_cult_icons_removed(owner.mind) owner << "An unfamiliar white light flashes through your mind, cleansing the taint of the Dark One and all your memories as its servant." - owner.attack_log += "\[[time_stamp()]\] Has renounced the cult of Nar'Sie!" + owner.log_message("Has renounced the cult of Nar'Sie!", INDIVIDUAL_ATTACK_LOG) if(!silent_update) owner.visible_message("[owner] looks like [owner.p_they()] just reverted to their old faith!") ..() diff --git a/code/datums/emotes.dm b/code/datums/emotes.dm index 1f17abbae1c..7039bf2c488 100644 --- a/code/datums/emotes.dm +++ b/code/datums/emotes.dm @@ -50,6 +50,7 @@ var/global/list/emote_list = list() if(!msg) return FALSE + user.log_message(msg, INDIVIDUAL_EMOTE_LOG) msg = "[user] " + msg for(var/mob/M in dead_mob_list) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 369260467d2..7bb88022fcd 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -36,7 +36,6 @@ var/active = 0 var/memory - var/attack_log var/assigned_role var/special_role diff --git a/code/game/gamemodes/changeling/powers/absorb.dm b/code/game/gamemodes/changeling/powers/absorb.dm index c0feab272cb..5ed20c46c38 100644 --- a/code/game/gamemodes/changeling/powers/absorb.dm +++ b/code/game/gamemodes/changeling/powers/absorb.dm @@ -65,13 +65,15 @@ //Recent as opposed to all because rounds tend to have a LOT of text. var/list/recent_speech = list() - if(target.say_log.len > LING_ABSORB_RECENT_SPEECH) - recent_speech = target.say_log.Copy(target.say_log.len-LING_ABSORB_RECENT_SPEECH+1,0) //0 so len-LING_ARS+1 to end of list + var/list/say_log = target.logging[INDIVIDUAL_SAY_LOG] + + if(say_log.len > LING_ABSORB_RECENT_SPEECH) + recent_speech = say_log.Copy(say_log.len-LING_ABSORB_RECENT_SPEECH+1,0) //0 so len-LING_ARS+1 to end of list else - for(var/spoken_memory in target.say_log) + for(var/spoken_memory in say_log) if(recent_speech.len >= LING_ABSORB_RECENT_SPEECH) break - recent_speech[spoken_memory] = target.say_log[spoken_memory] + recent_speech[spoken_memory] = say_log[spoken_memory] if(recent_speech.len) user.mind.store_memory("Some of [target]'s speech patterns, we should study these to better impersonate them!") diff --git a/code/game/gamemodes/gang/gang.dm b/code/game/gamemodes/gang/gang.dm index 8d6709b1e2a..916ba1ba34e 100644 --- a/code/game/gamemodes/gang/gang.dm +++ b/code/game/gamemodes/gang/gang.dm @@ -174,7 +174,7 @@ var/list/gang_colors_pool = list("red","orange","yellow","green","blue","purple" gangster_mind.current << "Their ultimate objective is to take over the station with a Dominator machine." gangster_mind.current << "You can identify your bosses by their large, bright [G.color] \[G\] icon." gangster_mind.store_memory("You are a member of the [G.name] Gang!") - gangster_mind.current.attack_log += "\[[time_stamp()]\] Has been converted to the [G.name] Gang!" + gangster_mind.current.log_message("Has been converted to the [G.name] Gang!", INDIVIDUAL_ATTACK_LOG) gangster_mind.special_role = "[G.name] Gangster" G.add_gang_hud(gangster_mind) @@ -208,7 +208,7 @@ var/list/gang_colors_pool = list("red","orange","yellow","green","blue","purple" gangster_mind.gang_datum = null if(silent < 2) - gangster_mind.current.attack_log += "\[[time_stamp()]\] Has reformed and defected from the [gang.name] Gang!" + gangster_mind.current.log_message("Has reformed and defected from the [gang.name] Gang!", INDIVIDUAL_ATTACK_LOG) if(beingborged) if(!silent) diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index be32c62fab1..72af1264dd9 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -271,7 +271,7 @@ carbon_mob.flash_act(1, 1) rev_mind.current.Stun(5) rev_mind.current << " You are now a revolutionary! Help your cause. Do not harm your fellow freedom fighters. You can identify your comrades by the red \"R\" icons, and your leaders by the blue \"R\" icons. Help them kill the heads to win the revolution!" - rev_mind.current.attack_log += "\[[time_stamp()]\] Has been converted to the revolution!" + rev_mind.current.log_message("Has been converted to the revolution!", INDIVIDUAL_ATTACK_LOG) rev_mind.special_role = "Revolutionary" update_rev_icons_added(rev_mind) if(jobban_isbanned(rev_mind.current, ROLE_REV)) @@ -289,7 +289,7 @@ if((rev_mind in revolutionaries) || remove_head) revolutionaries -= rev_mind rev_mind.special_role = null - rev_mind.current.attack_log += "\[[time_stamp()]\] Has renounced the revolution!" + rev_mind.current.log_message("Has renounced the revolution!", INDIVIDUAL_ATTACK_LOG) if(beingborged) rev_mind.current << "The frame's firmware detects and deletes your neural reprogramming! You remember nothing[remove_head ? "." : " but the name of the one who flashed you."]" diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index 5a81e67fa24..4acf1fc0032 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -774,7 +774,7 @@ else user.mind.AddSpell(S) user <<"you rapidly read through the arcane book. Suddenly you realize you understand [spellname]!" - user.attack_log += text("\[[time_stamp()]\] [user.real_name] ([user.ckey]) learned the spell [spellname] ([S]).") + user.log_message("learned the spell [spellname] ([S]).", INDIVIDUAL_ATTACK_LOG) onlearned(user) /obj/item/weapon/spellbook/oneuse/proc/recoil(mob/user) diff --git a/code/game/objects/items/stacks/wrap.dm b/code/game/objects/items/stacks/wrap.dm index d743f96ea56..44691f65c29 100644 --- a/code/game/objects/items/stacks/wrap.dm +++ b/code/game/objects/items/stacks/wrap.dm @@ -97,7 +97,7 @@ return user.visible_message("[user] wraps [target].") - user.attack_log += text("\[[time_stamp()]\] Has used [name] on [target]") + user.log_message("Has used [name] on [target]", INDIVIDUAL_ATTACK_LOG) /obj/item/stack/packageWrap/Destroy() if(!amount) diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index a47e980a9c5..d8758d39349 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -203,7 +203,7 @@ var/global/list/crematoriums = new/list() if (M.stat != DEAD) M.emote("scream") if(user) - user.attack_log +="\[[time_stamp()]\] Cremated [M]/[M.ckey]" + user.log_message("Cremated [M]/[M.ckey]", INDIVIDUAL_ATTACK_LOG) log_attack("\[[time_stamp()]\] [user]/[user.ckey] cremated [M]/[M.ckey]") else log_attack("\[[time_stamp()]\] UNKNOWN cremated [M]/[M.ckey]") diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm index 795acbc7c16..7672ae2d0a8 100644 --- a/code/game/turfs/open.dm +++ b/code/game/turfs/open.dm @@ -154,7 +154,7 @@ return 0 if(!(lube&SLIDE_ICE)) C << "You slipped[ O ? " on the [O.name]" : ""]!" - C.attack_log += "\[[time_stamp()]\] Slipped[O ? " on the [O.name]" : ""][(lube&SLIDE)? " (LUBE)" : ""]!" + C.log_message("Slipped[O ? " on the [O.name]" : ""][(lube&SLIDE)? " (LUBE)" : ""]!", INDIVIDUAL_ATTACK_LOG) if(!(lube&SLIDE_ICE)) playsound(C.loc, 'sound/misc/slip.ogg', 50, 1, -3) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 24ee7c1ae33..fb926931192 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -82,7 +82,8 @@ var/global/BSACooldown = 0 body += "

" body += "Traitor panel | " body += "Narrate to | " - body += "Subtle message" + body += "Subtle message | " + body += "Individual Round Logs" if (M.client) if(!isnewplayer(M)) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 389ed32aff9..7c4270b4eba 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1820,6 +1820,17 @@ var/mob/M = locate(href_list["subtlemessage"]) usr.client.cmd_admin_subtle_message(M) + else if(href_list["individuallog"]) + if(!check_rights(R_ADMIN)) + return + + var/mob/M = locate(href_list["individuallog"]) in mob_list + if(!ismob(M)) + usr << "This can only be used on instances of type /mob." + return + + show_individual_logging_panel(M, href_list["log_type"]) + else if(href_list["traitor"]) if(!check_rights(R_ADMIN)) return diff --git a/code/modules/admin/verbs/individual_logging.dm b/code/modules/admin/verbs/individual_logging.dm new file mode 100644 index 00000000000..8130f84ff07 --- /dev/null +++ b/code/modules/admin/verbs/individual_logging.dm @@ -0,0 +1,27 @@ +/proc/show_individual_logging_panel(mob/M, type = INDIVIDUAL_ATTACK_LOG) + if(!M || !ismob(M)) + return + var/dat = "
Attack log | " + dat += "Say log | " + dat += "Emote log | " + dat += "OOC log | " + dat += "Show all | " + dat += "Refresh
" + + dat += "
" + + + + if(type == INDIVIDUAL_SHOW_ALL_LOG) + dat += "
Displaying all logs of [key_name(M)]


" + for(var/log_type in M.logging) + dat += "
[log_type]

" + for(var/entry in M.logging[log_type]) + dat += "[entry]: [M.logging[log_type][entry]]
" + dat += "
" + else + dat += "
[type] of [key_name(M)]

" + for(var/entry in M.logging[type]) + dat += "[entry]: [M.logging[type][entry]]
" + + usr << browse(dat, "window=invidual_logging;size=600x480") \ No newline at end of file diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index d698862f144..db9d9d04fcb 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -664,16 +664,6 @@ Traitors and the like can also be revived with the previous role mostly intact. return -/client/proc/cmd_admin_attack_log(mob/M in mob_list) - set category = "Special Verbs" - set name = "Attack Log" - - usr << "Attack Log for [mob]" - for(var/t in M.attack_log) - usr << t - feedback_add_details("admin_verb","ATTL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - - /client/proc/everyone_random() set category = "Fun" set name = "Make Everyone Random" diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index bbbf67e9fe2..8a53d5a7649 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -52,6 +52,7 @@ return log_ooc("[mob.name]/[key] : [raw_msg]") + mob.log_message("[key]: [raw_msg]", INDIVIDUAL_OOC_LOG) var/keyname = key if(prefs.unlock_content) diff --git a/code/modules/events/wizard/departmentrevolt.dm b/code/modules/events/wizard/departmentrevolt.dm index 0774aaaeb4d..3d86ed6e2f6 100644 --- a/code/modules/events/wizard/departmentrevolt.dm +++ b/code/modules/events/wizard/departmentrevolt.dm @@ -44,7 +44,7 @@ citizens += H ticker.mode.traitors += M M.special_role = "separatist" - H.attack_log += "\[[time_stamp()]\] Was made into a separatist, long live [nation]!" + H.log_message("Was made into a separatist, long live [nation]!", INDIVIDUAL_ATTACK_LOG) H << "You are a separatist! [nation] forever! Protect the soverignty of your newfound land with your comrades in arms!" if(citizens.len) var/message diff --git a/code/modules/events/wizard/greentext.dm b/code/modules/events/wizard/greentext.dm index 202dee5a13b..a52f0993b8c 100644 --- a/code/modules/events/wizard/greentext.dm +++ b/code/modules/events/wizard/greentext.dm @@ -67,7 +67,7 @@ O.completed = 1 //YES! O.owner = new_holder.mind new_holder.mind.objectives += O - new_holder.attack_log += "\[[time_stamp()]\] Won with greentext!!!" + new_holder.log_message("Won with greentext!!!", INDIVIDUAL_ATTACK_LOG) color_altered_mobs -= new_holder resistance_flags |= ON_FIRE qdel(src) diff --git a/code/modules/events/wizard/imposter.dm b/code/modules/events/wizard/imposter.dm index fcb1100f1c7..3c4999d0c37 100644 --- a/code/modules/events/wizard/imposter.dm +++ b/code/modules/events/wizard/imposter.dm @@ -53,6 +53,6 @@ I.mind.objectives += protect_objective ticker.mode.update_wiz_icons_added(I.mind) - I.attack_log += "\[[time_stamp()]\] Is an imposter!" + I.log_message("Is an imposter!", INDIVIDUAL_ATTACK_LOG) I << "You are an imposter! Trick and confuse the crew to misdirect malice from your handsome original!" I << sound('sound/effects/magic.ogg') diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 546f5c8c255..767723b1393 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -76,7 +76,7 @@ var/list/image/ghost_images_simple = list() //this is a list of all ghost images var/turf/T if(ismob(body)) T = get_turf(body) //Where is the body located? - attack_log = body.attack_log //preserve our attack logs by copying them to our ghost + logging = body.logging //preserve our logs by copying them to our ghost gender = body.gender if(body.mind && body.mind.name) @@ -620,7 +620,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(O.key == expected_key) if(O.client) new /obj/screen/splash(O.client, TRUE) - break + break //this is a mob verb instead of atom for performance reasons //see /mob/verb/examinate() in mob.dm for more info diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 349a9b6dd97..4bca28c89d6 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -222,7 +222,7 @@ /mob/living/verb/succumb(whispered as null) set hidden = 1 if (InCritical()) - src.attack_log += "[src] has [whispered ? "whispered his final words" : "succumbed to death"] with [round(health, 0.1)] points of health!" + src.log_message("Has [whispered ? "whispered his final words" : "succumbed to death"] with [round(health, 0.1)] points of health!", INDIVIDUAL_ATTACK_LOG) src.adjustOxyLoss(src.health - HEALTH_THRESHOLD_DEAD) updatehealth() if(!whispered) diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 3d95b2bb756..3caabec5ff9 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -54,8 +54,6 @@ var/smoke_delay = 0 //used to prevent spam with smoke reagent reaction on mob. - var/list/say_log = list() //a log of what we've said, with a timestamp as the key for each message - var/bubble_icon = "default" //what icon the mob uses for speechbubbles var/last_bumped = 0 diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 9f3bf171c49..1ec81ffad5a 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -79,12 +79,12 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) message = copytext(message, 3) if(findtext(message, " ", 1, 2)) message = copytext(message, 2) - + if(message_mode == "admin") if(client) client.cmd_admin_say(message) return - + if(message_mode == "deadmin") if(client) client.dsay(message) @@ -116,7 +116,7 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) spans += get_spans() //Log what we've said with an associated timestamp, using the list's len for safety/to prevent overwriting messages - say_log["[LAZYLEN(say_log) + 1]\[[time_stamp()]\]"] = message + log_message(message, INDIVIDUAL_SAY_LOG) var/message_range = 7 var/radio_return = radio(message, message_mode, spans) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 48d1ce2fbad..365ac40e24b 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -975,6 +975,6 @@ var/next_mob_id = 0 /mob/vv_get_var(var_name) switch(var_name) - if ("attack_log") - return debug_variable(var_name, attack_log, 0, src, FALSE) + if("logging") + return debug_variable(var_name, logging, 0, src, FALSE) . = ..() \ No newline at end of file diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index b00302473dd..25992568a2c 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -26,7 +26,7 @@ var/computer_id = null var/lastattacker = null var/lastattacked = null - var/attack_log = list( ) + var/list/logging = list(INDIVIDUAL_ATTACK_LOG, INDIVIDUAL_SAY_LOG, INDIVIDUAL_EMOTE_LOG, INDIVIDUAL_OOC_LOG) var/obj/machinery/machine = null var/other_mobs = null var/disabilities = 0 //Carbon diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index a42cc4a5d0f..346c24789ab 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -479,7 +479,7 @@ var/static/regex/firstname = new("^\[^\\s-\]+") //First word before whitespace o else return 0 -mob/proc/click_random_mob() +/mob/proc/click_random_mob() var/list/nearby_mobs = list() for(var/mob/living/L in range(1, src)) if(L!=src) @@ -487,3 +487,14 @@ mob/proc/click_random_mob() if(nearby_mobs.len) var/mob/living/T = pick(nearby_mobs) ClickOn(T) + +/mob/proc/log_message(message, message_type) + if(!LAZYLEN(message) || !message_type) + return + + if(!islist(logging[message_type])) + logging[message_type] = list() + + var/list/timestamped_message = list("[LAZYLEN(logging[message_type]) + 1]\[[time_stamp()]\] [key_name(src)]" = message) + + logging[message_type] += timestamped_message \ No newline at end of file diff --git a/code/modules/projectiles/guns/magic/wand.dm b/code/modules/projectiles/guns/magic/wand.dm index 65fe93fdf63..cf59dcbeb15 100644 --- a/code/modules/projectiles/guns/magic/wand.dm +++ b/code/modules/projectiles/guns/magic/wand.dm @@ -50,7 +50,7 @@ /obj/item/weapon/gun/magic/wand/proc/zap_self(mob/living/user) user.visible_message("[user] zaps [user.p_them()]self with [src].") playsound(user, fire_sound, 50, 1) - user.attack_log += "\[[time_stamp()]\] [user]/[user.ckey] zapped [user.p_them()]self with a [src]" + user.log_message("zapped [user.p_them()]self with a [src]", INDIVIDUAL_ATTACK_LOG) ///////////////////////////////////// diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index a86a9abf0a4..eb6a94db30f 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -265,20 +265,19 @@ new_mob.languages_spoken |= HUMAN new_mob.languages_understood |= HUMAN - new_mob.attack_log = M.attack_log + new_mob.logging = M.logging // Some forms can still wear some items for(var/obj/item/W in contents) new_mob.equip_to_appropriate_slot(W) - M.attack_log += text("\[[time_stamp()]\] [M.real_name] ([M.ckey]) became [new_mob.real_name].") + M.log_message("became [new_mob.real_name].", INDIVIDUAL_ATTACK_LOG) new_mob.a_intent = INTENT_HARM M.wabbajack_act(new_mob) - new_mob << "Your form morphs into that of \ - a [randomize]." + new_mob << "Your form morphs into that of a [randomize]." qdel(M) return new_mob diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index e63ea7aa406..7199eb880f4 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -66,7 +66,7 @@ var/mob/living/carbon/monkey/M M = target M.retaliate(user) - + switch(mode) if(SYRINGE_DRAW) @@ -142,7 +142,7 @@ add_logs(user, L, "injected", src, addition="which had [contained]") else log_attack("[user.name] ([user.ckey]) injected [L.name] ([L.ckey]) with [src.name], which had [contained] (INTENT: [uppertext(user.a_intent)])") - L.attack_log += "\[[time_stamp()]\] Injected themselves ([contained]) with [src.name]." + L.log_message("Injected themselves ([contained]) with [src.name].", INDIVIDUAL_ATTACK_LOG) var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1) reagents.reaction(L, INJECT, fraction) diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm index d3b3f614047..301786074b1 100644 --- a/code/modules/reagents/reagent_dispenser.dm +++ b/code/modules/reagents/reagent_dispenser.dm @@ -89,9 +89,9 @@ var/boom_message = "[key_name_admin(P.firer)] triggered a fueltank explosion via projectile." bombers += boom_message message_admins(boom_message) - var/log_message = "[key_name(P.firer)] triggered a fueltank explosion via projectile." - P.firer.attack_log += "\[[time_stamp()]\] [log_message]" - log_attack(log_message) + var/log_message = "triggered a fueltank explosion via projectile." + P.firer.log_message(log_message, INDIVIDUAL_ATTACK_LOG) + log_attack("[key_name(P.firer)] [log_message]") boom() /obj/structure/reagent_dispensers/fueltank/attackby(obj/item/I, mob/living/user, params) @@ -113,9 +113,9 @@ var/message_admins = "[key_name_admin(user)] triggered a fueltank explosion via welding tool." bombers += message_admins message_admins(message_admins) - var/message_log = "[key_name(user)] triggered a fueltank explosion via welding tool." - user.attack_log += "\[[time_stamp()]\] [message_log]" - log_attack(message_log) + var/message_log = "triggered a fueltank explosion via welding tool." + user.log_message(message_log, INDIVIDUAL_ATTACK_LOG) + log_attack("[key_name(user)] [message_log]") boom() return return ..() diff --git a/code/modules/spells/spell.dm b/code/modules/spells/spell.dm index cc2761fd8c7..f731fadd6bc 100644 --- a/code/modules/spells/spell.dm +++ b/code/modules/spells/spell.dm @@ -255,7 +255,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin before_cast(targets) invocation(user) if(user && user.ckey) - user.attack_log += text("\[[time_stamp()]\] [user.real_name] ([user.ckey]) cast the spell [name].") + user.log_message("cast the spell [name].", INDIVIDUAL_ATTACK_LOG) spawn(0) if(charge_type == "recharge" && recharge) start_recharge() diff --git a/code/modules/spells/spell_types/rightandwrong.dm b/code/modules/spells/spell_types/rightandwrong.dm index 9db089f90be..4b327ea4495 100644 --- a/code/modules/spells/spell_types/rightandwrong.dm +++ b/code/modules/spells/spell_types/rightandwrong.dm @@ -30,7 +30,7 @@ var/datum/objective/survive/survive = new survive.owner = H.mind H.mind.objectives += survive - H.attack_log += "\[[time_stamp()]\] Was made into a survivalist, and trusts no one!" + H.log_message("Was made into a survivalist, and trusts no one!", INDIVIDUAL_ATTACK_LOG) H.mind.announce_objectives() var/randomizeguns = pick(gunslist) var/randomizemagic = pick(magiclist) diff --git a/tgstation.dme b/tgstation.dme index 72a3b13750c..314fd91e7ab 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -975,6 +975,7 @@ #include "code\modules\admin\verbs\diagnostics.dm" #include "code\modules\admin\verbs\fps.dm" #include "code\modules\admin\verbs\getlogs.dm" +#include "code\modules\admin\verbs\individual_logging.dm" #include "code\modules\admin\verbs\machine_upgrade.dm" #include "code\modules\admin\verbs\manipulate_organs.dm" #include "code\modules\admin\verbs\map_template_loadverb.dm"