diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index a9e6d1f68aa6..2d847f39b57c 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 9fed8a9f2f47..e932e9dfa848 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 b66a8cbc11c1..f679b36daec9 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 b49cb41c78b9..06ecdce7709f 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 3959f6cb32cf..7039bf2c4882 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) @@ -64,7 +65,6 @@ var/global/list/emote_list = list() else user.visible_message(msg) log_emote("[key_name(user)] : [msg]") - user.emote_log += "\[[time_stamp()]\] [msg]" /datum/emote/proc/select_message_type(mob/user) . = message diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 369260467d2d..7bb88022fcd1 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 c0feab272cb9..5ed20c46c38c 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 8d6709b1e2a0..916ba1ba34ea 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 be32c62fab19..72af1264dd94 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 5a81e67fa243..4acf1fc00329 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 d743f96ea563..44691f65c294 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 a47e980a9c5c..d8758d393494 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 795acbc7c166..7672ae2d0a85 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/verbs/indidivual_loggings.dm b/code/modules/admin/verbs/indidivual_loggings.dm index 3bdfd54e66d3..650793d4d6a5 100644 --- a/code/modules/admin/verbs/indidivual_loggings.dm +++ b/code/modules/admin/verbs/indidivual_loggings.dm @@ -1,30 +1,27 @@ -/proc/show_individual_logging_panel(mob/M, type = "attack") +/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 | " + var/dat = "
Attack log | " + dat += "Say log | " + dat += "Emote log | " + dat += "OOC log | " + dat += "Show all | " dat += "Refresh
" dat += "
" - switch(type) - if("attack") - dat += "
Attack logs of [key_name(M)]

" - for(var/entry in M.attack_log) - dat += "[entry]

" - if("say") - dat += "
Say logs of [key_name(M)]

" - for(var/entry in M.say_log) - dat += "[entry] [M.say_log[entry]]

" - if("emote") - dat += "
Emote logs of [key_name(M)]

" - for(var/entry in M.emote_log) - dat += "[entry]

" - if("ooc") - dat += "
OOC logs of [key_name(M)]

" - for(var/entry in M.ooc_log) - dat += "[entry]

" + if((type in M.logging) && type != INDIVIDUAL_SHOW_ALL_LOG) + dat += "
[type] of [key_name(M)]

" + for(var/entry in M.logging[type]) + dat += "[entry]: [M.logging[type][entry]]
" + + else 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 += "
" + 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 d698862f1441..db9d9d04fcba 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 adaff6db0fb1..8a53d5a76495 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -52,7 +52,7 @@ return log_ooc("[mob.name]/[key] : [raw_msg]") - mob.ooc_log += "\[[time_stamp()]\] [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 0774aaaeb4d8..3d86ed6e2f66 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 202dee5a13be..a52f0993b8ce 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 fcb1100f1c79..3c4999d0c37f 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 546f5c8c255c..767723b13937 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 a6a267ba40f9..8aa390f79da3 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/say.dm b/code/modules/mob/living/say.dm index 9f3bf171c499..1ec81ffad5a2 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 3250be1b5722..ab6053b9927b 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -970,9 +970,9 @@ var/next_mob_id = 0 .["Toggle Build Mode"] = "?_src_=vars;build_mode=\ref[src]" .["Assume Direct Control"] = "?_src_=vars;direct_control=\ref[src]" .["Offer Control to Ghosts"] = "?_src_=vars;offer_control=\ref[src]" - +/* /mob/vv_get_var(var_name) switch(var_name) if ("attack_log") return debug_variable(var_name, attack_log, 0, src, FALSE) - . = ..() \ No newline at end of file + . = ..()*/ \ No newline at end of file diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 94dddb381aad..25992568a2cd 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -26,10 +26,7 @@ var/computer_id = null var/lastattacker = null var/lastattacked = null - var/list/attack_log = list() - var/list/say_log = list() //a log of what we've said, with a timestamp as the key for each message - var/list/ooc_log = list() - var/list/emote_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 a42cc4a5d0f2..346c24789aba 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 65fe93fdf638..cf59dcbeb15e 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 a86a9abf0a4e..eb6a94db30fe 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 e63ea7aa4062..7199eb880f44 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 d3b3f6140478..301786074b19 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 cc2761fd8c78..f731fadd6bca 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 9db089f90beb..4b327ea4495f 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 e0e5dcba18a7..e2b5c5b139c7 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -14,7 +14,7 @@ // BEGIN_INCLUDE #include "_maps\__MAP_DEFINES.dm" -#include "_maps\runtimestation.dm" +#include "_maps\tgstation2.dm" #include "code\_compile_options.dm" #include "code\world.dm" #include "code\__DATASTRUCTURES\heap.dm"