diff --git a/code/__DEFINES/logging.dm b/code/__DEFINES/logging.dm index 485cfa65c1f..79ad2311617 100644 --- a/code/__DEFINES/logging.dm +++ b/code/__DEFINES/logging.dm @@ -16,12 +16,29 @@ #define INVESTIGATE_EXONET "exonet" #define INVESTIGATE_CIRCUIT "circuit" -//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_OWNERSHIP_LOG "Ownership log" -#define INDIVIDUAL_SHOW_ALL_LOG "All logs" +// Logging types for log_message() +#define LOG_ATTACK (1 << 0) +#define LOG_SAY (1 << 1) +#define LOG_WHISPER (1 << 2) +#define LOG_EMOTE (1 << 3) +#define LOG_DSAY (1 << 4) +#define LOG_PDA (1 << 5) +#define LOG_CHAT (1 << 6) +#define LOG_COMMENT (1 << 7) +#define LOG_TELECOMMS (1 << 8) +#define LOG_OOC (1 << 9) +#define LOG_ADMIN (1 << 10) +#define LOG_OWNERSHIP (1 << 11) +#define LOG_GAME (1 << 12) + +//Individual logging panel pages +#define INDIVIDUAL_ATTACK_LOG (LOG_ATTACK) +#define INDIVIDUAL_SAY_LOG (LOG_SAY | LOG_WHISPER | LOG_DSAY) +#define INDIVIDUAL_EMOTE_LOG (LOG_EMOTE) +#define INDIVIDUAL_COMMS_LOG (LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS) +#define INDIVIDUAL_OOC_LOG (LOG_OOC | LOG_ADMIN) +#define INDIVIDUAL_OWNERSHIP_LOG (LOG_OWNERSHIP) +#define INDIVIDUAL_SHOW_ALL_LOG (LOG_ATTACK | LOG_SAY | LOG_WHISPER | LOG_EMOTE | LOG_DSAY | LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS | LOG_OOC | LOG_ADMIN | LOG_OWNERSHIP | LOG_GAME) + #define LOGSRC_CLIENT "Client" #define LOGSRC_MOB "Mob" diff --git a/code/__DEFINES/say.dm b/code/__DEFINES/say.dm index c5708034fe0..102cc94face 100644 --- a/code/__DEFINES/say.dm +++ b/code/__DEFINES/say.dm @@ -42,17 +42,6 @@ #define TURF_LINK(alice, turfy) "(T)" #define FOLLOW_OR_TURF_LINK(alice, bob, turfy) "(F)" -#define LOGSAY "say" -#define LOGWHISPER "whisper" -#define LOGEMOTE "emote" -#define LOGDSAY "dsay" -#define LOGPDA "pda" -#define LOGCHAT "chat" -#define LOGASAY "adminsay" -#define LOGCOMMENT "comment" -#define LOGOOC "ooc" - - #define LINGHIVE_NONE 0 #define LINGHIVE_OUTSIDER 1 #define LINGHIVE_LING 2 diff --git a/code/__HELPERS/_logging.dm b/code/__HELPERS/_logging.dm index 9664f786efc..e5f45121244 100644 --- a/code/__HELPERS/_logging.dm +++ b/code/__HELPERS/_logging.dm @@ -162,19 +162,100 @@ /* Helper procs for building detailed log lines */ -/proc/datum_info_line(datum/D) - if(!istype(D)) - return - if(!ismob(D)) - return "[D] ([D.type])" - var/mob/M = D - return "[M] ([M.ckey]) ([M.type])" +/proc/key_name(whom, include_link = null, include_name = TRUE) + var/mob/M + var/client/C + var/key + var/ckey + var/fallback_name -/proc/atom_loc_line(atom/A) + if(!whom) + return "*null*" + if(istype(whom, /client)) + C = whom + M = C.mob + key = C.key + ckey = C.ckey + else if(ismob(whom)) + M = whom + C = M.client + key = M.key + ckey = M.ckey + else if(istext(whom)) + key = whom + ckey = ckey(whom) + C = GLOB.directory[ckey] + if(C) + M = C.mob + else if(istype(whom,/datum/mind)) + var/datum/mind/mind = whom + key = mind.key + ckey = ckey(key) + if(mind.current) + M = mind.current + if(M.client) + C = M.client + else + fallback_name = mind.name + else // Catch-all cases if none of the types above match + var/swhom = null + + if(istype(whom, /atom)) + var/atom/A = whom + swhom = "[A.name]" + else if(istype(whom, /datum)) + swhom = "[whom]" + + if(!swhom) + swhom = "*invalid*" + + return "\[[swhom]\]" + + . = "" + + if(!ckey) + include_link = FALSE + + if(key) + if(C && C.holder && C.holder.fakekey && !include_name) + if(include_link) + . += "" + . += "Administrator" + else + if(include_link) + . += "" + . += key + if(!C) + . += "\[DC\]" + + if(include_link) + . += "" + else + . += "*no key*" + + if(include_name) + if(M) + if(M.real_name) + . += "/([M.real_name])" + else if(M.name) + . += "/([M.name])" + else if(fallback_name) + . += "/([fallback_name])" + + return . + +/proc/key_name_admin(whom, include_name = TRUE) + return key_name(whom, TRUE, include_name) + +/proc/loc_name(atom/A) if(!istype(A)) - return - var/turf/T = get_turf(A) + return "(INVALID LOCATION)" + + var/turf/T = A + if (!istype(T)) + T = get_turf(A) + if(istype(T)) - return "[A.loc] [COORD(T)] ([A.loc.type])" + return "([AREACOORD(T)])" else if(A.loc) - return "[A.loc] (0, 0, 0) ([A.loc.type])" + return "(UNKNOWN (?, ?, ?))" diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 30fcf6b151e..edb80dc1b01 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -166,65 +166,6 @@ GLOBAL_LIST_EMPTY(species_list) else return "unknown" -/* -Proc for attack log creation, because really why not -1 argument is the actor -2 argument is the target of action -3 is the description of action(like punched, throwed, or any other verb) -4 is the tool with which the action was made(usually item) 4 and 5 are very similar(5 have "by " before it, that it) and are separated just to keep things in a bit more in order -5 is additional information, anything that needs to be added -*/ - -/proc/add_logs(mob/user, mob/target, what_done, object=null, addition=null) - var/turf/attack_location = get_turf(target) - - var/is_mob_user = user && ismob(user) - var/is_mob_target = target && ismob(target) - - var/mob/living/living_target - - if(target && isliving(target)) - living_target = target - - var/hp =" " - if(living_target) - hp = " (NEWHP: [living_target.health]) " - - var/starget = "NON-EXISTENT SUBJECT" - if(target) - if(is_mob_target && target.key) - starget = "[target.name]([target.key])" - else - starget = "[target.name]" - - var/ssource = "NON-EXISTENT USER" //How!? - if(user) - if(is_mob_user && user.key) - ssource = "[user.name]([user.key])" - else - ssource = "[user.name]" - - var/sobject = "" - if(object) - sobject = "[object]" - if(addition) - addition = " [addition]" - - var/sattackloc = "" - if(attack_location) - sattackloc = "([attack_location.x],[attack_location.y],[attack_location.z])" - - if(is_mob_user) - var/message = "has [what_done] [starget][(sobject||addition) ? " with ":""][sobject][addition][hp][sattackloc]" - user.log_message(message, INDIVIDUAL_ATTACK_LOG) - - if(is_mob_target) - var/message = "has been [what_done] by [ssource][(sobject||addition) ? " with ":""][sobject][addition][hp][sattackloc]" - target.log_message(message, INDIVIDUAL_ATTACK_LOG) - - log_attack("[ssource] [what_done] [starget][(sobject||addition) ? " with ":""][sobject][addition][hp][sattackloc]") - - /proc/do_mob(mob/user , mob/target, time = 30, uninterruptible = 0, progress = 1, datum/callback/extra_checks = null) if(!user || !target) return 0 @@ -473,41 +414,6 @@ Proc for attack log creation, because really why not else to_chat(M, message) - -/proc/log_talk(mob/user,message,logtype) - var/turf/say_turf = get_turf(user) - - var/sayloc = "" - if(say_turf) - sayloc = "([say_turf.x],[say_turf.y],[say_turf.z])" - - - var/logmessage = "[message] [sayloc]" - - switch(logtype) - - if(LOGDSAY) - log_dsay(logmessage) - if(LOGSAY) - log_say(logmessage) - if(LOGWHISPER) - log_whisper(logmessage) - if(LOGEMOTE) - log_emote(logmessage) - if(LOGPDA) - log_pda(logmessage) - if(LOGCHAT) - log_chat(logmessage) - if(LOGCOMMENT) - log_comment(logmessage) - if(LOGASAY) - log_adminsay(logmessage) - if(LOGOOC) - log_ooc(logmessage) - else - warning("Invalid speech logging type detected. [logtype]. Defaulting to say") - log_say(logmessage) - //Used in chemical_mob_spawn. Generates a random mob based on a given gold_core_spawnable value. /proc/create_random_mob(spawn_location, mob_class = HOSTILE_SPAWN) var/static/list/mob_spawn_meancritters = list() // list of possible hostile mobs diff --git a/code/__HELPERS/radiation.dm b/code/__HELPERS/radiation.dm index a09d2fab009..a570ab43bab 100644 --- a/code/__HELPERS/radiation.dm +++ b/code/__HELPERS/radiation.dm @@ -41,5 +41,5 @@ log = TRUE if(log) var/turf/_source_T = isturf(source) ? source : get_turf(source) - log_game("Radiation pulse with intensity: [intensity] and range modifier: [range_modifier] in [AREACOORD(_source_T)] ") + log_game("Radiation pulse with intensity: [intensity] and range modifier: [range_modifier] in [loc_name(_source_T)] ") return TRUE \ No newline at end of file diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index f7aac6123e8..8d0c43d4aef 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -372,80 +372,6 @@ Turf and target are separate in case you want to teleport some distance from a t return "[round(units * 0.000001, 0.001)] MJ" return "[round(units * 0.000000001, 0.0001)] GJ" -/proc/key_name(whom, include_link = null, include_name = 1) - var/mob/M - var/client/C - var/key - var/ckey - var/fallback_name - - if(!whom) - return "*null*" - if(istype(whom, /client)) - C = whom - M = C.mob - key = C.key - ckey = C.ckey - else if(ismob(whom)) - M = whom - C = M.client - key = M.key - ckey = M.ckey - else if(istext(whom)) - key = whom - ckey = ckey(whom) - C = GLOB.directory[ckey] - if(C) - M = C.mob - else if(istype(whom,/datum/mind)) - var/datum/mind/mind = whom - key = mind.key - ckey = ckey(key) - if(mind.current) - M = mind.current - if(M.client) - C = M.client - else - fallback_name = mind.name - else - return "*invalid*" - - . = "" - - if(!ckey) - include_link = 0 - - if(key) - if(C && C.holder && C.holder.fakekey && !include_name) - if(include_link) - . += "" - . += "Administrator" - else - if(include_link) - . += "" - . += key - if(!C) - . += "\[DC\]" - - if(include_link) - . += "" - else - . += "*no key*" - - if(include_name) - if(M) - if(M.real_name) - . += "/([M.real_name])" - else if(M.name) - . += "/([M.name])" - else if(fallback_name) - . += "/([fallback_name])" - - return . - -/proc/key_name_admin(whom, include_name = 1) - return key_name(whom, 1, include_name) - /proc/get_mob_by_ckey(key) if(!key) return diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 3a8a22923cb..2132c64d9f8 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -74,7 +74,7 @@ user.do_attack_animation(M) M.attacked_by(src, user) - add_logs(user, M, "attacked", src.name, "(INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])") + log_combat(user, M, "attacked", src.name, "(INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])") add_fingerprint(user) @@ -95,6 +95,7 @@ if(I.force) visible_message("[user] has hit [src] with [I]!", null, null, COMBAT_MESSAGE_RANGE) //only witnesses close by and the victim see a hit message. + log_combat(user, src, "attacked", I) take_damage(I.force, I.damtype, "melee", 1) /mob/living/attacked_by(obj/item/I, mob/living/user) diff --git a/code/controllers/subsystem/communications.dm b/code/controllers/subsystem/communications.dm index 5a791e28ef3..718357b8bb9 100644 --- a/code/controllers/subsystem/communications.dm +++ b/code/controllers/subsystem/communications.dm @@ -25,7 +25,7 @@ SUBSYSTEM_DEF(communications) else priority_announce(html_decode(user.treat_message(input)), null, 'sound/misc/announce.ogg', "Captain") nonsilicon_message_cooldown = world.time + COMMUNICATION_COOLDOWN - log_talk(user,"[key_name(user)] has made a priority announcement: [input]",LOGSAY) + user.log_talk(input, LOG_SAY, tag="priority announcement") message_admins("[ADMIN_LOOKUPFLW(user)] has made a priority announcement.") /datum/controller/subsystem/communications/proc/send_message(datum/comm_message/sending,print = TRUE,unique = FALSE) diff --git a/code/datums/brain_damage/imaginary_friend.dm b/code/datums/brain_damage/imaginary_friend.dm index d738645c22a..435a7a4dd82 100644 --- a/code/datums/brain_damage/imaginary_friend.dm +++ b/code/datums/brain_damage/imaginary_friend.dm @@ -146,7 +146,7 @@ if(!message) return - log_talk(src,"[key_name(src)] : [message]",LOGSAY) + src.log_talk(message, LOG_SAY, tag="imaginary friend") var/rendered = "[name] [say_quote(message)]" var/dead_rendered = "[name] (Imaginary friend of [owner]) [say_quote(message)]" diff --git a/code/datums/brain_damage/mild.dm b/code/datums/brain_damage/mild.dm index 4554c321b48..1ca07589e58 100644 --- a/code/datums/brain_damage/mild.dm +++ b/code/datums/brain_damage/mild.dm @@ -176,7 +176,7 @@ var/obj/item/I = owner.get_active_held_item() if(I) to_chat(owner, "Your fingers spasm!") - log_attack("[key_name(owner)] used [I] due to a Muscle Spasm.") + owner.log_message("used [I] due to a Muscle Spasm", LOG_ATTACK) I.attack_self(owner) if(3) var/prev_intent = owner.a_intent @@ -192,14 +192,14 @@ targets += M if(LAZYLEN(targets)) to_chat(owner, "Your arm spasms!") - log_attack("[key_name(owner)] attacked someone due to a Muscle Spasm.") //the following attack will log itself + owner.log_message(" attacked someone due to a Muscle Spasm") //the following attack will log itself owner.ClickOn(pick(targets)) owner.a_intent = prev_intent if(4) var/prev_intent = owner.a_intent owner.a_intent = INTENT_HARM to_chat(owner, "Your arm spasms!") - log_attack("[key_name(owner)] attacked himself to a Muscle Spasm.") + owner.log_message("attacked [owner.p_them()]self to a Muscle Spasm", LOG_ATTACK) owner.ClickOn(owner) owner.a_intent = prev_intent if(5) @@ -211,6 +211,6 @@ targets += T if(LAZYLEN(targets) && I) to_chat(owner, "Your arm spasms!") - log_attack("[key_name(owner)] threw [I] due to a Muscle Spasm.") + owner.log_message("threw [I] due to a Muscle Spasm", LOG_ATTACK) owner.throw_item(pick(targets)) ..() diff --git a/code/datums/components/stationloving.dm b/code/datums/components/stationloving.dm index 15f47dd8a54..216dfdc8d51 100644 --- a/code/datums/components/stationloving.dm +++ b/code/datums/components/stationloving.dm @@ -42,7 +42,7 @@ var/turf/currentturf = get_turf(src) to_chat(get(parent, /mob), "You can't help but feel that you just lost something back there...") var/turf/targetturf = relocate() - log_game("[parent] has been moved out of bounds in [AREACOORD(currentturf)]. Moving it to [AREACOORD(targetturf)].") + log_game("[parent] has been moved out of bounds in [loc_name(currentturf)]. Moving it to [loc_name(targetturf)].") if(inform_admins) message_admins("[parent] has been moved out of bounds in [ADMIN_VERBOSEJMP(currentturf)]. Moving it to [ADMIN_VERBOSEJMP(targetturf)].") @@ -71,11 +71,11 @@ if(inform_admins && force) message_admins("[parent] has been !!force deleted!! in [ADMIN_VERBOSEJMP(T)].") - log_game("[parent] has been !!force deleted!! in [AREACOORD(T)].") + log_game("[parent] has been !!force deleted!! in [loc_name(T)].") if(!force && !allow_death) var/turf/targetturf = relocate() - log_game("[parent] has been destroyed in [AREACOORD(T)]. Moving it to [AREACOORD(targetturf)].") + log_game("[parent] has been destroyed in [loc_name(T)]. Moving it to [loc_name(targetturf)].") if(inform_admins) message_admins("[parent] has been destroyed in [ADMIN_VERBOSEJMP(T)]. Moving it to [ADMIN_VERBOSEJMP(targetturf)].") return TRUE diff --git a/code/datums/components/storage/concrete/bag_of_holding.dm b/code/datums/components/storage/concrete/bag_of_holding.dm index 8a80434114a..f287b0c49b4 100644 --- a/code/datums/components/storage/concrete/bag_of_holding.dm +++ b/code/datums/components/storage/concrete/bag_of_holding.dm @@ -26,7 +26,7 @@ for (var/obj/structure/ladder/unbreakable/binary/ladder in GLOB.ladders) ladder.ActivateAlmonds() message_admins("[ADMIN_LOOKUPFLW(user)] detonated a bag of holding at [ADMIN_VERBOSEJMP(loccheck)].") - log_game("[key_name(user)] detonated a bag of holding at [AREACOORD(loccheck)].") + log_game("[key_name(user)] detonated a bag of holding at [loc_name(loccheck)].") qdel(A) return . = ..() diff --git a/code/datums/emotes.dm b/code/datums/emotes.dm index 4b93bb230b7..5e651f62a23 100644 --- a/code/datums/emotes.dm +++ b/code/datums/emotes.dm @@ -47,7 +47,7 @@ if(!msg) return - user.log_message(msg, INDIVIDUAL_EMOTE_LOG) + user.log_message(msg, LOG_EMOTE) msg = "[user] " + msg for(var/mob/M in GLOB.dead_mob_list) @@ -61,7 +61,6 @@ user.audible_message(msg) else user.visible_message(msg) - log_talk(user,"[key_name(user)] : [msg]",LOGEMOTE) /datum/emote/proc/replace_pronoun(mob/user, message) if(findtext(message, "their")) diff --git a/code/datums/explosion.dm b/code/datums/explosion.dm index 3ddd4f26688..0b3e431af68 100644 --- a/code/datums/explosion.dm +++ b/code/datums/explosion.dm @@ -86,7 +86,7 @@ GLOBAL_LIST_EMPTY(explosions) if(adminlog) message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) in [ADMIN_VERBOSEJMP(epicenter)]") - log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) in [AREACOORD(epicenter)]") + log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) in [loc_name(epicenter)]") var/x0 = epicenter.x var/y0 = epicenter.y diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index 4ef292d1b1c..4685b514b26 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -51,7 +51,7 @@ tele_play_specials(teleatom, curturf, effectin, asoundin) var/success = force_teleport ? teleatom.forceMove(destturf) : teleatom.Move(destturf) if (success) - log_game("[teleatom] ([key_name(teleatom)]) has teleported from [AREACOORD(curturf)] to [AREACOORD(destturf)]") + log_game("[key_name(teleatom)] has teleported from [loc_name(curturf)] to [loc_name(destturf)]") tele_play_specials(teleatom, destturf, effectout, asoundout) if(ismegafauna(teleatom)) message_admins("[teleatom] [ADMIN_FLW(teleatom)] has teleported from [ADMIN_VERBOSEJMP(curturf)] to [ADMIN_VERBOSEJMP(destturf)].") diff --git a/code/datums/martial.dm b/code/datums/martial.dm index c4b0eb7c609..2bc01e0bf61 100644 --- a/code/datums/martial.dm +++ b/code/datums/martial.dm @@ -55,7 +55,7 @@ playsound(D.loc, A.dna.species.miss_sound, 25, 1, -1) D.visible_message("[A] has attempted to [atk_verb] [D]!", \ "[A] has attempted to [atk_verb] [D]!", null, COMBAT_MESSAGE_RANGE) - add_logs(A, D, "attempted to [atk_verb]") + log_combat(A, D, "attempted to [atk_verb]") return 0 var/obj/item/bodypart/affecting = D.get_bodypart(ran_zone(A.zone_selected)) @@ -67,7 +67,7 @@ D.apply_damage(damage, BRUTE, affecting, armor_block) - add_logs(A, D, "punched") + log_combat(A, D, "punched") if((D.stat != DEAD) && damage >= A.dna.species.punchstunthreshold) D.visible_message("[A] has knocked [D] down!!", \ diff --git a/code/datums/martial/boxing.dm b/code/datums/martial/boxing.dm index 68b021bc7d4..96431fbe32b 100644 --- a/code/datums/martial/boxing.dm +++ b/code/datums/martial/boxing.dm @@ -20,7 +20,7 @@ playsound(D.loc, A.dna.species.miss_sound, 25, 1, -1) D.visible_message("[A] has attempted to [atk_verb] [D]!", \ "[A] has attempted to [atk_verb] [D]!", null, COMBAT_MESSAGE_RANGE) - add_logs(A, D, "attempted to hit", atk_verb) + log_combat(A, D, "attempted to hit", atk_verb) return 0 @@ -33,7 +33,7 @@ "[A] has [atk_verb]ed [D]!", null, COMBAT_MESSAGE_RANGE) D.apply_damage(damage, STAMINA, affecting, armor_block) - add_logs(A, D, "punched (boxing) ") + log_combat(A, D, "punched (boxing) ") if(D.getStaminaLoss() > 50) var/knockout_prob = D.getStaminaLoss() + rand(-15,15) if((D.stat != DEAD) && prob(knockout_prob)) @@ -42,7 +42,7 @@ D.apply_effect(200,EFFECT_KNOCKDOWN,armor_block) D.SetSleeping(100) D.forcesay(GLOB.hit_appends) - add_logs(A, D, "knocked out (boxing) ") + log_combat(A, D, "knocked out (boxing) ") else if(D.lying) D.forcesay(GLOB.hit_appends) return 1 diff --git a/code/datums/martial/cqc.dm b/code/datums/martial/cqc.dm index 4a51ac32517..55cd4a3f7aa 100644 --- a/code/datums/martial/cqc.dm +++ b/code/datums/martial/cqc.dm @@ -59,7 +59,7 @@ playsound(get_turf(A), 'sound/weapons/slam.ogg', 50, 1, -1) D.apply_damage(10, BRUTE) D.Knockdown(120) - add_logs(A, D, "cqc slammed") + log_combat(A, D, "slammed (CQC)") return TRUE /datum/martial_art/cqc/proc/Kick(mob/living/carbon/human/A, mob/living/carbon/human/D) @@ -72,7 +72,7 @@ var/atom/throw_target = get_edge_target_turf(D, A.dir) D.throw_at(throw_target, 1, 14, A) D.apply_damage(10, BRUTE) - add_logs(A, D, "cqc kicked") + log_combat(A, D, "kicked (CQC)") if(D.IsKnockdown() && !D.stat) D.visible_message("[A] kicks [D]'s head, knocking [D.p_them()] out!", \ "[A] kicks your head, knocking you out!") @@ -129,7 +129,7 @@ A.start_pulling(D, 1) if(A.pulling) D.stop_pulling() - add_logs(A, D, "grabbed", addition="aggressively") + log_combat(A, D, "grabbed", addition="aggressively") A.grab_state = GRAB_AGGRESSIVE //Instant aggressive grab return TRUE @@ -140,7 +140,7 @@ add_to_streak("H",D) if(check_streak(A,D)) return TRUE - add_logs(A, D, "CQC'd") + log_combat(A, D, "attacked (CQC)") A.do_attack_animation(D) var/picked_hit_type = pick("CQC'd", "Big Bossed") var/bonus_damage = 13 @@ -154,14 +154,14 @@ playsound(get_turf(D), 'sound/weapons/cqchit1.ogg', 50, 1, -1) D.visible_message("[A] [picked_hit_type] [D]!", \ "[A] [picked_hit_type] you!") - add_logs(A, D, "[picked_hit_type] with CQC") + log_combat(A, D, "[picked_hit_type] (CQC)") if(A.resting && !D.stat && !D.IsKnockdown()) D.visible_message("[A] leg sweeps [D]!", \ "[A] leg sweeps you!") playsound(get_turf(A), 'sound/effects/hit_kick.ogg', 50, 1, -1) D.apply_damage(10, BRUTE) D.Knockdown(60) - add_logs(A, D, "cqc sweeped") + log_combat(A, D, "sweeped (CQC)") return TRUE /datum/martial_art/cqc/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D) @@ -185,7 +185,7 @@ D.visible_message("[A] attempted to disarm [D]!", \ "[A] attempted to disarm [D]!") playsound(D, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - add_logs(A, D, "disarmed with CQC", "[I ? " grabbing \the [I]" : ""]") + log_combat(A, D, "disarmed (CQC)", "[I ? " grabbing \the [I]" : ""]") if(restraining && A.pulling == D) D.visible_message("[A] puts [D] into a chokehold!", \ "[A] puts you into a chokehold!") diff --git a/code/datums/martial/krav_maga.dm b/code/datums/martial/krav_maga.dm index 21a82c7b7e8..8a5f0f9439d 100644 --- a/code/datums/martial/krav_maga.dm +++ b/code/datums/martial/krav_maga.dm @@ -93,7 +93,7 @@ playsound(get_turf(A), 'sound/effects/hit_kick.ogg', 50, 1, -1) D.apply_damage(5, BRUTE) D.Knockdown(40) - add_logs(A, D, "leg sweeped") + log_combat(A, D, "leg sweeped") return 1 /datum/martial_art/krav_maga/proc/quick_choke(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)//is actually lung punch @@ -103,7 +103,7 @@ if(D.losebreath <= 10) D.losebreath = CLAMP(D.losebreath + 5, 0, 10) D.adjustOxyLoss(10) - add_logs(A, D, "quickchoked") + log_combat(A, D, "quickchoked") return 1 /datum/martial_art/krav_maga/proc/neck_chop(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) @@ -113,19 +113,19 @@ D.apply_damage(5, BRUTE) if(D.silent <= 10) D.silent = CLAMP(D.silent + 10, 0, 10) - add_logs(A, D, "neck chopped") + log_combat(A, D, "neck chopped") return 1 /datum/martial_art/krav_maga/grab_act(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) if(check_streak(A,D)) return 1 - add_logs(A, D, "grabbed with krav maga") + log_combat(A, D, "grabbed (Krav Maga)") ..() /datum/martial_art/krav_maga/harm_act(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) if(check_streak(A,D)) return 1 - add_logs(A, D, "punched") + log_combat(A, D, "punched") var/picked_hit_type = pick("punches", "kicks") var/bonus_damage = 10 if(D.IsKnockdown() || D.resting || D.lying) @@ -140,7 +140,7 @@ playsound(get_turf(D), 'sound/effects/hit_punch.ogg', 50, 1, -1) D.visible_message("[A] [picked_hit_type] [D]!", \ "[A] [picked_hit_type] you!") - add_logs(A, D, "[picked_hit_type] with [name]") + log_combat(A, D, "[picked_hit_type] with [name]") return 1 /datum/martial_art/krav_maga/disarm_act(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D) @@ -159,7 +159,7 @@ D.visible_message("[A] attempted to disarm [D]!", \ "[A] attempted to disarm [D]!") playsound(D, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - add_logs(A, D, "disarmed with krav maga", "[I ? " removing \the [I]" : ""]") + log_combat(A, D, "disarmed (Krav Maga)", "[I ? " removing \the [I]" : ""]") return 1 //Krav Maga Gloves diff --git a/code/datums/martial/mushpunch.dm b/code/datums/martial/mushpunch.dm index 7c99d4d8aaa..33d5bb51bf8 100644 --- a/code/datums/martial/mushpunch.dm +++ b/code/datums/martial/mushpunch.dm @@ -17,7 +17,7 @@ D.throw_at(throwtarget, 4, 2, A)//So stuff gets tossed around at the same time. D.Knockdown(20) if(atk_verb) - add_logs(A, D, "[atk_verb] (Mushroom Punch)") + log_combat(A, D, "[atk_verb] (Mushroom Punch)") return TRUE /obj/item/mushpunch diff --git a/code/datums/martial/plasma_fist.dm b/code/datums/martial/plasma_fist.dm index 0150a3695db..1b1c92413b9 100644 --- a/code/datums/martial/plasma_fist.dm +++ b/code/datums/martial/plasma_fist.dm @@ -39,7 +39,7 @@ for(var/turf/T in range(1,A)) turfs.Add(T) R.cast(turfs) - add_logs(A, D, "tornado sweeped(Plasma Fist)") + log_combat(A, D, "tornado sweeped(Plasma Fist)") return /datum/martial_art/plasma_fist/proc/Throwback(mob/living/carbon/human/A, mob/living/carbon/human/D) @@ -49,7 +49,7 @@ var/atom/throw_target = get_edge_target_turf(D, get_dir(D, get_step_away(D, A))) D.throw_at(throw_target, 200, 4,A) A.say("HYAH!") - add_logs(A, D, "threw back (Plasma Fist)") + log_combat(A, D, "threw back (Plasma Fist)") return /datum/martial_art/plasma_fist/proc/Plasma(mob/living/carbon/human/A, mob/living/carbon/human/D) @@ -59,7 +59,7 @@ D.visible_message("[A] has hit [D] with THE PLASMA FIST TECHNIQUE!", \ "[A] has hit [D] with THE PLASMA FIST TECHNIQUE!") D.gib() - add_logs(A, D, "gibbed (Plasma Fist)") + log_combat(A, D, "gibbed (Plasma Fist)") return /datum/martial_art/plasma_fist/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D) diff --git a/code/datums/martial/psychotic_brawl.dm b/code/datums/martial/psychotic_brawl.dm index f43af6c19ea..b17d52f4604 100644 --- a/code/datums/martial/psychotic_brawl.dm +++ b/code/datums/martial/psychotic_brawl.dm @@ -29,12 +29,12 @@ D.drop_all_held_items() D.stop_pulling() if(A.a_intent == INTENT_GRAB) - add_logs(A, D, "grabbed", addition="aggressively") + log_combat(A, D, "grabbed", addition="aggressively") D.visible_message("[A] violently grabs [D]!", \ "[A] violently grabs you!") A.grab_state = GRAB_AGGRESSIVE //Instant aggressive grab else - add_logs(A, D, "grabbed", addition="passively") + log_combat(A, D, "grabbed", addition="passively") A.grab_state = GRAB_PASSIVE if(4) A.do_attack_animation(D, ATTACK_EFFECT_PUNCH) @@ -62,5 +62,5 @@ basic_hit(A,D) if(atk_verb) - add_logs(A, D, "[atk_verb] (Psychotic Brawling)") + log_combat(A, D, "[atk_verb] (Psychotic Brawling)") return 1 \ No newline at end of file diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm index 6aa233c0a88..9b41e72d344 100644 --- a/code/datums/martial/sleeping_carp.dm +++ b/code/datums/martial/sleeping_carp.dm @@ -45,7 +45,7 @@ D.apply_damage(5, BRUTE, pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM)) D.Stun(60) return 1 - add_logs(A, D, "wrist wrenched (Sleeping Carp)") + log_combat(A, D, "wrist wrenched (Sleeping Carp)") return basic_hit(A,D) /datum/martial_art/the_sleeping_carp/proc/backKick(mob/living/carbon/human/A, mob/living/carbon/human/D) @@ -57,7 +57,7 @@ D.Knockdown(80) playsound(get_turf(D), 'sound/weapons/punch1.ogg', 50, 1, -1) return 1 - add_logs(A, D, "back-kicked (Sleeping Carp)") + log_combat(A, D, "back-kicked (Sleeping Carp)") return basic_hit(A,D) /datum/martial_art/the_sleeping_carp/proc/kneeStomach(mob/living/carbon/human/A, mob/living/carbon/human/D) @@ -70,7 +70,7 @@ D.Stun(40) playsound(get_turf(D), 'sound/weapons/punch1.ogg', 50, 1, -1) return 1 - add_logs(A, D, "stomach kneed (Sleeping Carp)") + log_combat(A, D, "stomach kneed (Sleeping Carp)") return basic_hit(A,D) /datum/martial_art/the_sleeping_carp/proc/headKick(mob/living/carbon/human/A, mob/living/carbon/human/D) @@ -83,7 +83,7 @@ playsound(get_turf(D), 'sound/weapons/punch1.ogg', 50, 1, -1) D.Stun(80) return 1 - add_logs(A, D, "head kicked (Sleeping Carp)") + log_combat(A, D, "head kicked (Sleeping Carp)") return basic_hit(A,D) /datum/martial_art/the_sleeping_carp/proc/elbowDrop(mob/living/carbon/human/A, mob/living/carbon/human/D) @@ -96,7 +96,7 @@ D.apply_damage(50, BRUTE, BODY_ZONE_CHEST) playsound(get_turf(D), 'sound/weapons/punch1.ogg', 75, 1, -1) return 1 - add_logs(A, D, "elbow dropped (Sleeping Carp)") + log_combat(A, D, "elbow dropped (Sleeping Carp)") return basic_hit(A,D) /datum/martial_art/the_sleeping_carp/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D) @@ -111,12 +111,12 @@ D.drop_all_held_items() D.stop_pulling() if(A.a_intent == INTENT_GRAB) - add_logs(A, D, "grabbed", addition="aggressively") + log_combat(A, D, "grabbed", addition="aggressively") D.visible_message("[A] violently grabs [D]!", \ "[A] violently grabs you!") A.grab_state = GRAB_AGGRESSIVE //Instant aggressive grab else - add_logs(A, D, "grabbed", addition="passively") + log_combat(A, D, "grabbed", addition="passively") A.grab_state = GRAB_PASSIVE return 1 @@ -133,7 +133,7 @@ if(prob(D.getBruteLoss()) && !D.lying) D.visible_message("[D] stumbles and falls!", "The blow sends you to the ground!") D.Knockdown(80) - add_logs(A, D, "[atk_verb] (Sleeping Carp)") + log_combat(A, D, "[atk_verb] (Sleeping Carp)") return 1 diff --git a/code/datums/martial/wrestling.dm b/code/datums/martial/wrestling.dm index 62a03af9337..e57edf9fb2f 100644 --- a/code/datums/martial/wrestling.dm +++ b/code/datums/martial/wrestling.dm @@ -121,7 +121,7 @@ /datum/martial_art/wrestling/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D) if(check_streak(A,D)) return 1 - add_logs(A, D, "punched with wrestling") + log_combat(A, D, "punched with wrestling") ..() /datum/martial_art/wrestling/proc/throw_wrassle(mob/living/carbon/human/A, mob/living/carbon/human/D) @@ -192,7 +192,7 @@ if (!D.stat) D.emote("scream") D.throw_at(T, 10, 4, A, TRUE, TRUE, callback = CALLBACK(D, /mob/living/carbon/human/.Knockdown, 20)) - add_logs(A, D, "has thrown with wrestling") + log_combat(A, D, "has thrown with wrestling") return 0 /datum/martial_art/wrestling/proc/FlipAnimation(mob/living/carbon/human/D) @@ -308,7 +308,7 @@ D.pixel_y = 0 - add_logs(A, D, "body-slammed") + log_combat(A, D, "body-slammed") return 0 /datum/martial_art/wrestling/proc/CheckStrikeTurf(mob/living/carbon/human/A, turf/T) @@ -330,7 +330,7 @@ D.adjustBruteLoss(rand(10,20)) playsound(A.loc, "swing_hit", 50, 1) D.Unconscious(20) - add_logs(A, D, "headbutted") + log_combat(A, D, "headbutted") /datum/martial_art/wrestling/proc/kick(mob/living/carbon/human/A, mob/living/carbon/human/D) if(!D) @@ -347,7 +347,7 @@ if (T && isturf(T)) D.Knockdown(20) D.throw_at(T, 3, 2) - add_logs(A, D, "roundhouse-kicked") + log_combat(A, D, "roundhouse-kicked") /datum/martial_art/wrestling/proc/drop(mob/living/carbon/human/A, mob/living/carbon/human/D) if(!D) @@ -420,13 +420,13 @@ else if (A) A.pixel_y = 0 - add_logs(A, D, "leg-dropped") + log_combat(A, D, "leg-dropped") return /datum/martial_art/wrestling/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D) if(check_streak(A,D)) return 1 - add_logs(A, D, "wrestling-disarmed") + log_combat(A, D, "wrestling-disarmed") ..() /datum/martial_art/wrestling/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D) @@ -438,7 +438,7 @@ D.visible_message("[A] gets [D] in a cinch!", \ "[A] gets [D] in a cinch!") D.Stun(rand(60,100)) - add_logs(A, D, "cinched") + log_combat(A, D, "cinched") return 1 /obj/item/storage/belt/champion/wrestling diff --git a/code/datums/saymode.dm b/code/datums/saymode.dm index 93f733439c0..ed6edd11abb 100644 --- a/code/datums/saymode.dm +++ b/code/datums/saymode.dm @@ -40,7 +40,7 @@ return FALSE var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) var/msg = "[changeling.changelingID]: [message]" - log_talk(user,"[changeling.changelingID]/[user.key] : [message]",LOGSAY) + user.log_talk(message, LOG_SAY, tag="changeling [changeling.changelingID]") for(var/_M in GLOB.player_list) var/mob/M = _M if(M in GLOB.dead_mob_list) @@ -129,7 +129,7 @@ if(!mind) return TRUE if(is_monkey_leader(mind) || (ismonkey(user) && is_monkey(mind))) - log_talk(user, "(MONKEY) [user]/[user.key]: [message]",LOGSAY) + user.log_talk(message, LOG_SAY, tag="monkey") if(prob(75) && ismonkey(user)) user.visible_message("\The [user] chimpers.") var/msg = "\[[is_monkey_leader(mind) ? "Monkey Leader" : "Monkey"]\] [user]: [message]" diff --git a/code/datums/status_effects/buffs.dm b/code/datums/status_effects/buffs.dm index 13c58c84298..04f9342fbc3 100644 --- a/code/datums/status_effects/buffs.dm +++ b/code/datums/status_effects/buffs.dm @@ -70,7 +70,7 @@ return ..() /datum/status_effect/vanguard_shield/on_apply() - owner.log_message("gained Vanguard stun immunity", INDIVIDUAL_ATTACK_LOG) + owner.log_message("gained Vanguard stun immunity", LOG_ATTACK) owner.add_stun_absorption("vanguard", INFINITY, 1, "'s yellow aura momentarily intensifies!", "Your ward absorbs the stun!", " radiating with a soft yellow light!") owner.visible_message("[owner] begins to faintly glow!", "You will absorb all stuns for the next twenty seconds.") owner.SetStun(0, FALSE) @@ -105,7 +105,7 @@ else stuns_blocked = 0 //so logging is correct in cases where there were stuns blocked but we didn't stun for other reasons owner.visible_message("[owner]'s glowing aura fades!", message_to_owner) - owner.log_message("lost Vanguard stun immunity[stuns_blocked ? "and was stunned for [stuns_blocked]":""]", INDIVIDUAL_ATTACK_LOG) + owner.log_message("lost Vanguard stun immunity[stuns_blocked ? "and was stunned for [stuns_blocked]":""]", LOG_ATTACK) /datum/status_effect/inathneqs_endowment @@ -120,7 +120,7 @@ alerttooltipstyle = "clockcult" /datum/status_effect/inathneqs_endowment/on_apply() - owner.log_message("gained Inath-neq's invulnerability", INDIVIDUAL_ATTACK_LOG) + owner.log_message("gained Inath-neq's invulnerability", LOG_ATTACK) owner.visible_message("[owner] shines with azure light!", "You feel Inath-neq's power flow through you! You're invincible!") var/oldcolor = owner.color owner.color = "#1E8CE1" @@ -133,7 +133,7 @@ return ..() /datum/status_effect/inathneqs_endowment/on_remove() - owner.log_message("lost Inath-neq's invulnerability", INDIVIDUAL_ATTACK_LOG) + owner.log_message("lost Inath-neq's invulnerability", LOG_ATTACK) owner.visible_message("The light around [owner] flickers and dissipates!", "You feel Inath-neq's power fade from your body!") owner.status_flags &= ~GODMODE playsound(owner, 'sound/magic/ethereal_exit.ogg', 50, 1) @@ -185,7 +185,7 @@ ..() /datum/status_effect/his_grace/on_apply() - owner.log_message("gained His Grace's stun immunity", INDIVIDUAL_ATTACK_LOG) + owner.log_message("gained His Grace's stun immunity", LOG_ATTACK) owner.add_stun_absorption("hisgrace", INFINITY, 3, null, "His Grace protects you from the stun!") return ..() @@ -209,7 +209,7 @@ owner.adjustCloneLoss(-grace_heal) /datum/status_effect/his_grace/on_remove() - owner.log_message("lost His Grace's stun immunity", INDIVIDUAL_ATTACK_LOG) + owner.log_message("lost His Grace's stun immunity", LOG_ATTACK) if(islist(owner.stun_absorption) && owner.stun_absorption["hisgrace"]) owner.stun_absorption -= "hisgrace" @@ -304,7 +304,7 @@ last_oxyloss = owner.getOxyLoss() last_cloneloss = owner.getCloneLoss() last_staminaloss = owner.getStaminaLoss() - owner.log_message("gained blood-drunk stun immunity", INDIVIDUAL_ATTACK_LOG) + owner.log_message("gained blood-drunk stun immunity", LOG_ATTACK) owner.add_stun_absorption("blooddrunk", INFINITY, 4) owner.playsound_local(get_turf(owner), 'sound/effects/singlebeat.ogg', 40, 1) @@ -380,7 +380,7 @@ owner.cloneloss *= 0.1 owner.staminaloss *= 0.1 owner.updatehealth() - owner.log_message("lost blood-drunk stun immunity", INDIVIDUAL_ATTACK_LOG) + owner.log_message("lost blood-drunk stun immunity", LOG_ATTACK) if(islist(owner.stun_absorption) && owner.stun_absorption["blooddrunk"]) owner.stun_absorption -= "blooddrunk" diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index a2a407b03a8..9904a28d846 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -224,7 +224,7 @@ if(is_eligible_servant(owner)) to_chat(owner, "\"[text2ratvar("You are mine and his, now.")]\"") if(add_servant_of_ratvar(owner)) - owner.log_message("Conversion was done with a Mania Motor.", INDIVIDUAL_ATTACK_LOG) + owner.log_message("conversion was done with a Mania Motor", LOG_ATTACK, color="#BE8700") owner.Unconscious(100) else if(prob(severity * 0.15)) diff --git a/code/datums/wires/airlock.dm b/code/datums/wires/airlock.dm index e6f79c67b0a..63140e6b25a 100644 --- a/code/datums/wires/airlock.dm +++ b/code/datums/wires/airlock.dm @@ -80,7 +80,7 @@ A.set_electrified(30) if(usr) LAZYADD(A.shockedby, text("\[[time_stamp()]\] [key_name(usr)]")) - add_logs(usr, A, "electrified") + log_combat(usr, A, "electrified") if(WIRE_SAFETY) A.safe = !A.safe if(!A.density) @@ -135,7 +135,7 @@ A.set_electrified(-1) if(usr) LAZYADD(A.shockedby, text("\[[time_stamp()]\] [key_name(usr)]")) - add_logs(usr, A, "electrified") + log_combat(usr, A, "electrified") if(WIRE_SAFETY) // Cut to disable safeties, mend to re-enable. A.safe = mend if(WIRE_TIMING) // Cut to disable auto-close, mend to re-enable. diff --git a/code/game/atoms.dm b/code/game/atoms.dm index f11c0515a36..b85cdb9b3bd 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -157,7 +157,7 @@ SEND_SIGNAL(src, COMSIG_ATOM_HULK_ATTACK, user) if(does_attack_animation) user.changeNext_move(CLICK_CD_MELEE) - add_logs(user, src, "punched", "hulk powers") + log_combat(user, src, "punched", "hulk powers") user.do_attack_animation(src, ATTACK_EFFECT_SMASH) /atom/proc/CheckParts(list/parts_list) @@ -586,6 +586,90 @@ /atom/proc/GenerateTag() return +// Generic logging helper +/atom/proc/log_message(message, message_type, color=null, log_globally=TRUE) + if(!log_globally) + return + + var/log_text = "[key_name(src)] [message] [loc_name(src)]" + switch(message_type) + if(LOG_ATTACK) + log_attack(log_text) + if(LOG_SAY) + log_say(log_text) + if(LOG_WHISPER) + log_whisper(log_text) + if(LOG_EMOTE) + log_emote(log_text) + if(LOG_DSAY) + log_dsay(log_text) + if(LOG_PDA) + log_pda(log_text) + if(LOG_CHAT) + log_chat(log_text) + if(LOG_COMMENT) + log_comment(log_text) + if(LOG_TELECOMMS) + log_telecomms(log_text) + if(LOG_OOC) + log_ooc(log_text) + if(LOG_ADMIN) + log_admin(log_text) + if(LOG_OWNERSHIP) + log_game(log_text) + if(LOG_GAME) + log_game(log_text) + else + stack_trace("Invalid individual logging type: [message_type]. Defaulting to [LOG_GAME] (LOG_GAME).") + log_game(log_text) + +// Helper for logging chat messages or other logs wiht arbitrary inputs (e.g. announcements) +/atom/proc/log_talk(message, message_type, tag=null, log_globally=TRUE) + var/prefix = tag ? "([tag]) " : "" + log_message("[prefix]\"[message]\"", message_type, log_globally=log_globally) + +// Helper for logging of messages with only one sender and receiver +/proc/log_directed_talk(atom/source, atom/target, message, message_type, tag) + if(!tag) + stack_trace("Unspecified tag for private message") + tag = "UNKNOWN" + + source.log_talk(message, message_type, tag="[tag] to [key_name(target)]") + if(source != target) + target.log_talk(message, message_type, tag="[tag] from [key_name(source)]", log_globally=FALSE) + +/* +Proc for attack log creation, because really why not +1 argument is the actor performing the action +2 argument is the target of the action +3 is a verb describing the action (e.g. punched, throwed, kicked, etc.) +4 is a tool with which the action was made (usually an item) +5 is any additional text, which will be appended to the rest of the log line +*/ + +/proc/log_combat(atom/user, atom/target, what_done, atom/object=null, addition=null) + var/ssource = key_name(user) + var/starget = key_name(target) + + var/mob/living/living_target = target + var/hp = istype(living_target) ? " (NEWHP: [living_target.health]) " : "" + + var/sobject = "" + if(object) + sobject = " with [key_name(object)]" + var/saddition = "" + if(addition) + saddition = " [addition]" + + var/postfix = "[sobject][saddition][hp]" + + var/message = "has [what_done] [starget][postfix]" + user.log_message(message, LOG_ATTACK, color="red") + + if(user != target) + var/reverse_message = "has been [what_done] by [ssource][postfix]" + target.log_message(reverse_message, LOG_ATTACK, color="orange", log_globally=FALSE) + // Filter stuff /atom/movable/proc/add_filter(name,priority,list/params) if(!filter_data) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 38b7724ace4..847192fc0e7 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -88,14 +88,14 @@ return TRUE stop_pulling() if(AM.pulledby) - add_logs(AM, AM.pulledby, "pulled from", src) + log_combat(AM, AM.pulledby, "pulled from", src) AM.pulledby.stop_pulling() //an object can't be pulled by two mobs at once. pulling = AM AM.pulledby = src grab_state = gs if(ismob(AM)) var/mob/M = AM - add_logs(src, M, "grabbed", addition="passive grab") + log_combat(src, M, "grabbed", addition="passive grab") visible_message("[src] has grabbed [M] passively!") return TRUE diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 5872802b064..57a9bf6df93 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -184,7 +184,7 @@ if((chem in available_chems) && chem_allowed(chem)) occupant.reagents.add_reagent(chem_buttons[chem], 10) //emag effect kicks in here so that the "intended" chem is used for all checks, for extra FUUU if(user) - add_logs(user, occupant, "injected [chem] into", addition = "via [src]") + log_combat(user, occupant, "injected [chem] into", addition = "via [src]") return TRUE /obj/machinery/sleeper/proc/chem_allowed(chem) diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index fa1d586ff62..1b07c223254 100755 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -146,7 +146,7 @@ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) send2otherserver("[station_name()]", input,"Comms_Console") minor_announce(input, title = "Outgoing message to allied station") - log_talk(usr,"[key_name(usr)] has sent a message to the other server: [input]",LOGSAY) + usr.log_talk(input, LOG_SAY, tag="message to the other server") message_admins("[ADMIN_LOOKUPFLW(usr)] has sent a message to the other server.") deadchat_broadcast("[usr.real_name] has sent an outgoing message to the other station(s).", usr) CM.lastTimeUsed = world.time @@ -290,7 +290,7 @@ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) CentCom_announce(input, usr) to_chat(usr, "Message transmitted to Central Command.") - log_talk(usr,"[key_name(usr)] has made a CentCom announcement: [input]",LOGSAY) + usr.log_talk(input, LOG_SAY, tag="CentCom announcement") deadchat_broadcast("[usr.real_name] has messaged CentCom, \"[input]\" at [get_area_name(usr, TRUE)].", usr) CM.lastTimeUsed = world.time @@ -307,7 +307,7 @@ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) Syndicate_announce(input, usr) to_chat(usr, "SYSERR @l(19833)of(transmit.dm): !@$ MESSAGE TRANSMITTED TO SYNDICATE COMMAND.") - log_talk(usr,"[key_name(usr)] has made a Syndicate announcement: [input]",LOGSAY) + usr.log_talk(input, LOG_SAY, tag="Syndicate announcement") deadchat_broadcast("[usr.real_name] has messaged the Syndicate, \"[input]\" at [get_area_name(usr, TRUE)].", usr) CM.lastTimeUsed = world.time @@ -327,7 +327,7 @@ return Nuke_request(input, usr) to_chat(usr, "Request sent.") - log_talk(usr,"[key_name(usr)] has requested the nuclear codes from CentCom",LOGSAY) + usr.log_message("has requested the nuclear codes from CentCom", LOG_SAY) priority_announce("The codes for the on-station nuclear self-destruct have been requested by [usr]. Confirmation or denial of this request will be sent shortly.", "Nuclear Self Destruct Codes Requested",'sound/ai/commandreport.ogg') CM.lastTimeUsed = world.time diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index 1c1944e73ee..798b0e4c650 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -136,7 +136,7 @@ if(I && istype(I) && I.imp_in) var/mob/living/R = I.imp_in to_chat(R, "You hear a voice in your head saying: '[warning]'") - log_talk(usr,"[key_name(usr)] sent an implant message to [key_name(R)]: '[warning]'",LOGSAY) + log_directed_talk(usr, R, warning, LOG_SAY, "implant message") src.add_fingerprint(usr) src.updateUsrDialog() diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 5e5db86780b..144c3dd169d 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1550,7 +1550,7 @@ to_chat(user, "The electrification wire has been cut") else LAZYADD(shockedby, "\[[time_stamp()]\] [key_name(user)]") - add_logs(user, src, "electrified") + log_combat(user, src, "electrified") set_electrified(AI_ELECTRIFY_DOOR_TIME) /obj/machinery/door/airlock/proc/shock_perm(mob/user) @@ -1560,7 +1560,7 @@ to_chat(user, "The electrification wire has been cut") else LAZYADD(shockedby, text("\[[time_stamp()]\] [key_name(user)]")) - add_logs(user, src, "electrified") + log_combat(user, src, "electrified") set_electrified(ELECTRIFIED_PERMANENT) /obj/machinery/door/airlock/proc/emergency_on(mob/user) diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 3fe68255dd6..07f8448ef23 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -698,7 +698,7 @@ GLOBAL_LIST_EMPTY(allCasters) FC.body = cominput FC.time_stamp = station_time_timestamp() FM.comments += FC - log_talk(usr,"[key_name(usr)] as [scanned_user] commented on message [FM.returnBody(-1)] -- [FC.body]",LOGCOMMENT) + usr.log_message("(as [scanned_user]) commented on message [FM.returnBody(-1)] -- [FC.body]", LOG_COMMENT) updateUsrDialog() else if(href_list["del_comment"]) var/datum/newscaster/feed_comment/FC = locate(href_list["del_comment"]) diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm index 1ab426384c2..d01ec621973 100644 --- a/code/game/machinery/porta_turret/portable_turret.dm +++ b/code/game/machinery/porta_turret/portable_turret.dm @@ -621,7 +621,7 @@ if(!can_interact(caller)) remove_control() return FALSE - add_logs(caller,A,"fired with manual turret control at") + log_combat(caller,A,"fired with manual turret control at") target(A) return TRUE diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index 2cbf29642f7..f2c216ca986 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -302,7 +302,7 @@ GLOBAL_LIST_EMPTY(allConsoles) message = L.treat_message(message) minor_announce(message, "[department] Announcement:") GLOB.news_network.SubmitArticle(message, department, "Station Announcements", null) - log_talk(usr,"[key_name(usr)] has made a station announcement from [src] at [AREACOORD(usr)]: [message]",LOGSAY) + usr.log_talk(message, LOG_SAY, tag="station announcement from [src]") message_admins("[ADMIN_LOOKUPFLW(usr)] has made a station announcement from [src] at [AREACOORD(usr)].") announceAuth = FALSE message = "" diff --git a/code/game/machinery/telecomms/broadcasting.dm b/code/game/machinery/telecomms/broadcasting.dm index e4694997904..0771963b071 100644 --- a/code/game/machinery/telecomms/broadcasting.dm +++ b/code/game/machinery/telecomms/broadcasting.dm @@ -192,13 +192,18 @@ var/spans_part = "" if(length(spans)) - spans_part = "(" + spans_part = "(spans:" for(var/S in spans) spans_part = "[spans_part] [S]" spans_part = "[spans_part] ) " var/lang_name = data["language"] + var/log_text = "\[[get_radio_name(frequency)]\] [spans_part]\"[message]\" (language: [lang_name])" - log_telecomms("[datum_info_line(virt.source)] : \[[get_radio_name(frequency)]\] [spans_part]\"[message]\" language: [lang_name] at [atom_loc_line(get_turf(src.source))]") + var/mob/source_mob = virt.source + if(istype(source_mob)) + source_mob.log_message(log_text, LOG_TELECOMMS) + else + log_telecomms("[virt.source] [log_text] [loc_name(get_turf(virt.source))]") QDEL_IN(virt, 50) // Make extra sure the virtualspeaker gets qdeleted diff --git a/code/game/machinery/telecomms/computers/message.dm b/code/game/machinery/telecomms/computers/message.dm index 5996bcea6b4..b11c6c102d3 100644 --- a/code/game/machinery/telecomms/computers/message.dm +++ b/code/game/machinery/telecomms/computers/message.dm @@ -423,7 +423,7 @@ )) // this will log the signal and transmit it to the target linkedServer.receive_information(signal, null) - log_talk(usr, "[key_name(usr)] (PDA: [name]) sent \"[custommessage]\" to [signal.format_target()]", LOGPDA) + usr.log_message("(PDA: [name]) sent \"[custommessage]\" to [signal.format_target()]", LOG_PDA) //Request Console Logs - KEY REQUIRED diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm index e434daa38d0..066920a6df7 100644 --- a/code/game/mecha/equipment/mecha_equipment.dm +++ b/code/game/mecha/equipment/mecha_equipment.dm @@ -43,7 +43,7 @@ /obj/item/mecha_parts/mecha_equipment/proc/critfail() if(chassis) - log_message("Critical failure",1) + log_message("Critical failure", color="red") /obj/item/mecha_parts/mecha_equipment/proc/get_equip_info() if(!chassis) @@ -147,9 +147,11 @@ chassis.occupant_message("[icon2html(src, chassis.occupant)] [message]") return -/obj/item/mecha_parts/mecha_equipment/proc/log_message(message) +/obj/item/mecha_parts/mecha_equipment/log_message(message, message_type=LOG_GAME, color=null) if(chassis) - chassis.log_message("[src]: [message]") + chassis.log_message("([src]) [message]", message_type, color) + else + ..() return diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm index 3ede481c604..99baad11ae2 100644 --- a/code/game/mecha/equipment/tools/medical_tools.dm +++ b/code/game/mecha/equipment/tools/medical_tools.dm @@ -194,7 +194,7 @@ if(to_inject && patient.reagents.get_reagent_amount(R.id) + to_inject <= inject_amount*2) occupant_message("Injecting [patient] with [to_inject] units of [R.name].") log_message("Injecting [patient] with [to_inject] units of [R.name].") - add_logs(chassis.occupant, patient, "injected", "[name] ([R] - [to_inject] units)") + log_combat(chassis.occupant, patient, "injected", "[name] ([R] - [to_inject] units)") SG.reagents.trans_id_to(patient,R.id,to_inject) update_equip_info() return @@ -338,7 +338,7 @@ mechsyringe.reagents.reaction(M, INJECT) mechsyringe.reagents.trans_to(M, mechsyringe.reagents.total_volume) M.take_bodypart_damage(2) - add_logs(originaloccupant, M, "shot", "syringegun") + log_combat(originaloccupant, M, "shot", "syringegun") break else if(mechsyringe.loc == trg) mechsyringe.icon_state = initial(mechsyringe.icon_state) diff --git a/code/game/mecha/equipment/tools/mining_tools.dm b/code/game/mecha/equipment/tools/mining_tools.dm index de19c28ef65..b82c7c36170 100644 --- a/code/game/mecha/equipment/tools/mining_tools.dm +++ b/code/game/mecha/equipment/tools/mining_tools.dm @@ -111,9 +111,9 @@ /obj/item/mecha_parts/mecha_equipment/drill/proc/drill_mob(mob/living/target, mob/user) target.visible_message("[chassis] is drilling [target] with [src]!", \ "[chassis] is drilling you with [src]!") - add_logs(user, target, "drilled", "[name]", "(INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])") + log_combat(user, target, "drilled", "[name]", "(INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])") if(target.stat == DEAD && target.getBruteLoss() >= 200) - add_logs(user, target, "gibbed", name) + log_combat(user, target, "gibbed", name) if(LAZYLEN(target.butcher_results) || LAZYLEN(target.guaranteed_butcher_results)) GET_COMPONENT_FROM(butchering, /datum/component/butchering, src) butchering.Butcher(chassis, target) diff --git a/code/game/mecha/equipment/tools/work_tools.dm b/code/game/mecha/equipment/tools/work_tools.dm index bc781d1f079..094f042bf45 100644 --- a/code/game/mecha/equipment/tools/work_tools.dm +++ b/code/game/mecha/equipment/tools/work_tools.dm @@ -64,7 +64,7 @@ target.visible_message("[chassis] squeezes [target].", \ "[chassis] squeezes [target].",\ "You hear something crack.") - add_logs(chassis.occupant, M, "attacked", "[name]", "(INTENT: [uppertext(chassis.occupant.a_intent)]) (DAMTYE: [uppertext(damtype)])") + log_combat(chassis.occupant, M, "attacked", "[name]", "(INTENT: [uppertext(chassis.occupant.a_intent)]) (DAMTYE: [uppertext(damtype)])") else step_away(M,chassis) occupant_message("You push [target] out of the way.") @@ -124,7 +124,7 @@ M.updatehealth() target.visible_message("[chassis] destroys [target] in an unholy fury.", \ "[chassis] destroys [target] in an unholy fury.") - add_logs(chassis.occupant, M, "attacked", "[name]", "(INTENT: [uppertext(chassis.occupant.a_intent)]) (DAMTYE: [uppertext(damtype)])") + log_combat(chassis.occupant, M, "attacked", "[name]", "(INTENT: [uppertext(chassis.occupant.a_intent)]) (DAMTYE: [uppertext(damtype)])") else target.visible_message("[chassis] destroys [target] in an unholy fury.", \ "[chassis] destroys [target] in an unholy fury.") @@ -147,7 +147,7 @@ playsound(src, get_dismember_sound(), 80, TRUE) target.visible_message("[chassis] rips [target]'s arms off.", \ "[chassis] rips [target]'s arms off.") - add_logs(chassis.occupant, M, "dismembered of[limbs_gone],", "[name]", "(INTENT: [uppertext(chassis.occupant.a_intent)]) (DAMTYE: [uppertext(damtype)])") + log_combat(chassis.occupant, M, "dismembered of[limbs_gone],", "[name]", "(INTENT: [uppertext(chassis.occupant.a_intent)]) (DAMTYE: [uppertext(damtype)])") else target.visible_message("[chassis] rips [target]'s arms off.", \ "[chassis] rips [target]'s arms off.") diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 1b03efc62e4..80b6f7de120 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -1014,9 +1014,10 @@ to_chat(occupant, "[icon2html(src, occupant)] [message]") return -/obj/mecha/proc/log_message(message as text,red=null) +/obj/mecha/log_message(message as text, message_type=LOG_GAME, color=null) log.len++ - log[log.len] = list("time"="[station_time_timestamp()]","date","year"="[GLOB.year_integer+540]","message"="[red?"":null][message][red?"":null]") + log[log.len] = list("time"="[station_time_timestamp()]","date","year"="[GLOB.year_integer+540]","message"="[color?"":null][message][color?"":null]") + ..() return log.len /obj/mecha/proc/log_append_to_last(message as text,red=null) diff --git a/code/game/mecha/mecha_defense.dm b/code/game/mecha/mecha_defense.dm index a5fbb6cbde2..367c7507879 100644 --- a/code/game/mecha/mecha_defense.dm +++ b/code/game/mecha/mecha_defense.dm @@ -62,7 +62,7 @@ user.do_attack_animation(src, ATTACK_EFFECT_PUNCH) playsound(loc, 'sound/weapons/tap.ogg', 40, 1, -1) user.visible_message("[user] hits [name]. Nothing happens", null, null, COMBAT_MESSAGE_RANGE) - log_message("Attack by hand/paw. Attacker - [user].",1) + log_message("Attack by hand/paw. Attacker - [user].", color="red") log_append_to_last("Armor saved.") /obj/mecha/attack_paw(mob/user as mob) @@ -70,12 +70,12 @@ /obj/mecha/attack_alien(mob/living/user) - log_message("Attack by alien. Attacker - [user].",1) + log_message("Attack by alien. Attacker - [user].", color="red") playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1) attack_generic(user, 15, BRUTE, "melee", 0) /obj/mecha/attack_animal(mob/living/simple_animal/user) - log_message("Attack by simple animal. Attacker - [user].",1) + log_message("Attack by simple animal. Attacker - [user].", color="red") if(!user.melee_damage_upper && !user.obj_damage) user.emote("custom", message = "[user.friendly] [src].") return 0 @@ -89,7 +89,7 @@ animal_damage = user.obj_damage animal_damage = min(animal_damage, 20*user.environment_smash) attack_generic(user, animal_damage, user.melee_damage_type, "melee", play_soundeffect) - add_logs(user, src, "attacked") + log_combat(user, src, "attacked") return 1 @@ -99,8 +99,8 @@ /obj/mecha/attack_hulk(mob/living/carbon/human/user) . = ..() if(.) - log_message("Attack by hulk. Attacker - [user].",1) - add_logs(user, src, "punched", "hulk powers") + log_message("Attack by hulk. Attacker - [user].", color="red") + log_combat(user, src, "punched", "hulk powers") /obj/mecha/blob_act(obj/structure/blob/B) take_damage(30, BRUTE, "melee", 0, get_dir(src, B)) @@ -109,16 +109,16 @@ return /obj/mecha/hitby(atom/movable/A as mob|obj) //wrapper - log_message("Hit by [A].",1) + log_message("Hit by [A].", color="red") . = ..() /obj/mecha/bullet_act(obj/item/projectile/Proj) //wrapper - log_message("Hit by projectile. Type: [Proj.name]([Proj.flag]).",1) + log_message("Hit by projectile. Type: [Proj.name]([Proj.flag]).", color="red") . = ..() /obj/mecha/ex_act(severity, target) - log_message("Affected by explosion of severity: [severity].",1) + log_message("Affected by explosion of severity: [severity].", color="red") if(prob(deflect_chance)) severity++ log_append_to_last("Armor saved, changing severity to [severity].") @@ -148,12 +148,12 @@ if(get_charge()) use_power((cell.charge/3)/(severity*2)) take_damage(30 / severity, BURN, "energy", 1) - log_message("EMP detected",1) + log_message("EMP detected", color="red") check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_CONTROL_LOST,MECHA_INT_SHORT_CIRCUIT),1) /obj/mecha/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) if(exposed_temperature>max_temperature) - log_message("Exposed to dangerous temperature.",1) + log_message("Exposed to dangerous temperature.", color="red") take_damage(5, BURN, 0, 1) /obj/mecha/attackby(obj/item/W as obj, mob/user as mob, params) @@ -290,7 +290,7 @@ return 0 use_power(melee_energy_drain) if(M.damtype == BRUTE || M.damtype == BURN) - add_logs(M.occupant, src, "attacked", M, "(INTENT: [uppertext(M.occupant.a_intent)]) (DAMTYPE: [uppertext(M.damtype)])") + log_combat(M.occupant, src, "attacked", M, "(INTENT: [uppertext(M.occupant.a_intent)]) (DAMTYPE: [uppertext(M.damtype)])") . = ..() /obj/mecha/proc/full_repair(charge_cell) diff --git a/code/game/mecha/mecha_topic.dm b/code/game/mecha/mecha_topic.dm index 4f5c6feb448..79ee7435e40 100644 --- a/code/game/mecha/mecha_topic.dm +++ b/code/game/mecha/mecha_topic.dm @@ -350,5 +350,5 @@ log_message("Recalibration of coordination system finished with 0 errors.") else occupant_message("Recalibration failed!") - log_message("Recalibration of coordination system failed with 1 error.",1) + log_message("Recalibration of coordination system failed with 1 error.", color="red") diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm index 4bca817e735..12a72685bb3 100644 --- a/code/game/objects/effects/mines.dm +++ b/code/game/objects/effects/mines.dm @@ -129,7 +129,7 @@ new /datum/hallucination/delusion(victim, TRUE, "demon",duration,0) var/obj/item/twohanded/required/chainsaw/doomslayer/chainsaw = new(victim.loc) - add_logs(victim, null, "entered a blood frenzy") + victim.log_message("entered a blood frenzy", LOG_ATTACK) chainsaw.item_flags |= NODROP victim.drop_all_held_items() @@ -146,7 +146,7 @@ sleep(duration) to_chat(victim, "Your bloodlust seeps back into the bog of your subconscious and you regain self control.") qdel(chainsaw) - add_logs(victim, null, "exited a blood frenzy") + victim.log_message("exited a blood frenzy", LOG_ATTACK) qdel(src) /obj/effect/mine/pickup/healing diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 7604d4074b9..2540f148504 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -476,7 +476,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "eye_stab", /datum/mood_event/eye_stab) - add_logs(user, M, "attacked", "[src.name]", "(INTENT: [uppertext(user.a_intent)])") + log_combat(user, M, "attacked", "[src.name]", "(INTENT: [uppertext(user.a_intent)])") M.adjust_blurriness(3) M.adjust_eye_damage(rand(2,4)) diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index 9400535889a..2351cc03211 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -460,7 +460,7 @@ M.updatehealth() //forces health update before next life tick playsound(src, 'sound/machines/defib_zap.ogg', 50, 1, -1) M.emote("gasp") - add_logs(user, M, "stunned", src) + log_combat(user, M, "stunned", src) if(req_defib) defib.deductcharge(revivecost) cooldown = TRUE @@ -511,7 +511,7 @@ "You feel a horrible agony in your chest!") H.set_heartattack(TRUE) H.apply_damage(50, BURN, BODY_ZONE_CHEST) - add_logs(user, H, "overloaded the heart of", defib) + log_combat(user, H, "overloaded the heart of", defib) H.Knockdown(100) H.Jitter(100) if(req_defib) @@ -599,7 +599,7 @@ H.Jitter(100) if(tplus > tloss) H.adjustBrainLoss( max(0, min(99, ((tlimit - tplus) / tlimit * 100))), 150) - add_logs(user, H, "revived", defib) + log_combat(user, H, "revived", defib) if(req_defib) defib.deductcharge(revivecost) cooldown = 1 diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index de912f4ca4c..dfb1ce6ad9e 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -649,7 +649,7 @@ GLOBAL_LIST_EMPTY(PDAs) if(isobserver(M) && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTPDA)) to_chat(M, "[FOLLOW_LINK(M, user)] [ghost_message]") // Log in the talk log - log_talk(user, "[key_name(user)] (PDA: [initial(name)]) sent \"[message]\" to [target_text]", LOGPDA) + user.log_talk(message, LOG_PDA, tag="PDA: [initial(name)] to [target_text]") to_chat(user, "Message sent to [target_text]: \"[message]\"") // Reset the photo picture = null @@ -711,7 +711,7 @@ GLOBAL_LIST_EMPTY(PDAs) /obj/item/pda/verb/verb_toggle_light() set category = "Object" set name = "Toggle Flashlight" - + toggle_light() /obj/item/pda/verb/verb_remove_id() diff --git a/code/game/objects/items/devices/PDA/virus_cart.dm b/code/game/objects/items/devices/PDA/virus_cart.dm index 2544cc01542..13d653a4fe3 100644 --- a/code/game/objects/items/devices/PDA/virus_cart.dm +++ b/code/game/objects/items/devices/PDA/virus_cart.dm @@ -76,10 +76,8 @@ U.show_message("An error flashes on your [src].", 1) else message_admins("[!is_special_character(U) ? "Non-antag " : ""][ADMIN_LOOKUPFLW(U)] triggered a PDA explosion on [target.name] at [ADMIN_VERBOSEJMP(target)].") - var/message_log = "triggered a PDA explosion on [target.name] at at [AREACOORD(target)]." - U.log_message(message_log, INDIVIDUAL_ATTACK_LOG) - log_game("[key_name(U)] [message_log]") - log_attack("[key_name(U)] [message_log]") + var/message_log = "triggered a PDA explosion on [target.name] at [AREACOORD(target)]." + U.log_message(message_log, LOG_ATTACK) U.show_message("Success!", 1) target.explode() else diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm index 5177cb2159d..089411b2ad7 100644 --- a/code/game/objects/items/devices/aicard.dm +++ b/code/game/objects/items/devices/aicard.dm @@ -22,7 +22,7 @@ return if(AI) //AI is on the card, implies user wants to upload it. target.transfer_ai(AI_TRANS_FROM_CARD, user, AI, src) - add_logs(user, AI, "carded", src) + log_combat(user, AI, "carded", src) else //No AI on the card, therefore the user wants to download one. target.transfer_ai(AI_TRANS_TO_CARD, user, null, src) update_icon() //Whatever happened, update the card's state (icon, name) to match. diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 0a6c3b4e421..0c98ae59951 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -389,7 +389,7 @@ if(ismob(A)) var/mob/M = A - add_logs(user, M, "attacked", "EMP-light") + log_combat(user, M, "attacked", "EMP-light") M.visible_message("[user] blinks \the [src] at \the [A].", \ "[user] blinks \the [src] at you.") else diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index b00cff95cb1..632c2c4221e 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -92,7 +92,7 @@ if(iscarbon(target)) var/mob/living/carbon/C = target if(user.zone_selected == BODY_ZONE_PRECISE_EYES) - add_logs(user, C, "shone in the eyes", src) + log_combat(user, C, "shone in the eyes", src) var/severity = 1 if(prob(33)) @@ -109,7 +109,7 @@ //robots else if(iscyborg(target)) var/mob/living/silicon/S = target - add_logs(user, S, "shone in the sensors", src) + log_combat(user, S, "shone in the sensors", src) //chance to actually hit the eyes depends on internal component if(prob(effectchance * diode.rating)) S.flash_act(affect_silicon = 1) @@ -125,7 +125,7 @@ if(prob(effectchance * diode.rating)) C.emp_act(EMP_HEAVY) outmsg = "You hit the lens of [C] with [src], temporarily disabling the camera!" - add_logs(user, C, "EMPed", src) + log_combat(user, C, "EMPed", src) else outmsg = "You miss the lens of [C] with [src]!" @@ -138,7 +138,7 @@ if(prob(effectchance)) H.visible_message("[H] makes a grab for the light!","LIGHT!") H.Move(targloc) - add_logs(user, H, "moved with a laser pointer",src) + log_combat(user, H, "moved with a laser pointer",src) else H.visible_message("[H] looks briefly distracted by the light."," You're briefly tempted by the shiny light... ") else diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index c3720f7ac41..2c234a59ba2 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -39,7 +39,7 @@ effective or pretty fucking useless. to_chat(user, "The mind batterer has been burnt out!") return - add_logs(user, null, "knocked down people in the area", src) + log_combat(user, null, "knocked down people in the area", src) for(var/mob/living/carbon/human/M in urange(10, user, 1)) if(prob(50)) @@ -82,7 +82,7 @@ effective or pretty fucking useless. if(!irradiate) return if(!used) - add_logs(user, M, "irradiated", src) + log_combat(user, M, "irradiated", src) var/cooldown = GetCooldown() used = 1 icon_state = "health1" diff --git a/code/game/objects/items/dna_injector.dm b/code/game/objects/items/dna_injector.dm index 502cd33e55e..d5ac5d9c523 100644 --- a/code/game/objects/items/dna_injector.dm +++ b/code/game/objects/items/dna_injector.dm @@ -50,7 +50,7 @@ if(fields["UI"]) //UI+UE M.dna.uni_identity = merge_text(M.dna.uni_identity, fields["UI"]) M.updateappearance(mutations_overlay_update=1) - log_attack(log_msg) + log_attack("[log_msg] [loc_name(user)]") return TRUE return FALSE @@ -65,7 +65,7 @@ var/mob/living/carbon/human/humantarget = target if (!humantarget.can_inject(user, 1)) return - add_logs(user, target, "attempted to inject", src) + log_combat(user, target, "attempted to inject", src) if(target != user) target.visible_message("[user] is trying to inject [target] with [src]!", "[user] is trying to inject [target] with [src]!") @@ -77,7 +77,7 @@ else to_chat(user, "You inject yourself with [src].") - add_logs(user, target, "injected", src) + log_combat(user, target, "injected", src) if(!inject(target, user)) //Now we actually do the heavy lifting. to_chat(user, "It appears that [target] does not have compatible DNA.") @@ -353,7 +353,7 @@ M.dna.uni_identity = merge_text(M.dna.uni_identity, fields["UI"]) M.updateappearance(mutations_overlay_update=1) M.dna.temporary_mutations[UI_CHANGED] = endtime - log_attack(log_msg) + log_attack("[log_msg] [loc_name(user)]") return TRUE else return FALSE diff --git a/code/game/objects/items/flamethrower.dm b/code/game/objects/items/flamethrower.dm index 116d0d34cae..2635955a159 100644 --- a/code/game/objects/items/flamethrower.dm +++ b/code/game/objects/items/flamethrower.dm @@ -76,7 +76,7 @@ var/turf/target_turf = get_turf(target) if(target_turf) var/turflist = getline(user, target_turf) - add_logs(user, target, "flamethrowered", src) + log_combat(user, target, "flamethrowered", src) flame_turf(turflist) /obj/item/flamethrower/attackby(obj/item/W, mob/user, params) diff --git a/code/game/objects/items/granters.dm b/code/game/objects/items/granters.dm index 3699545b41e..8d0d8d020ed 100644 --- a/code/game/objects/items/granters.dm +++ b/code/game/objects/items/granters.dm @@ -122,7 +122,7 @@ if(do_after(user,50, user)) to_chat(user, "You feel like you've experienced enough to cast [spellname]!") user.mind.AddSpell(S) - user.log_message("learned the spell [spellname] ([S]).", INDIVIDUAL_ATTACK_LOG) + user.log_message("learned the spell [spellname] ([S])", LOG_ATTACK, color="orange") onlearned(user) reading = FALSE @@ -330,7 +330,7 @@ if(do_after(user,50, user)) to_chat(user, "[greet]") MA.teach(user) - user.log_message("learned the martial art [martialname] ([MA]).", INDIVIDUAL_ATTACK_LOG) + user.log_message("learned the martial art [martialname] ([MA])", LOG_ATTACK, color="orange") onlearned(user) reading = FALSE diff --git a/code/game/objects/items/grenades/chem_grenade.dm b/code/game/objects/items/grenades/chem_grenade.dm index c04e8471bd5..5e30962450c 100644 --- a/code/game/objects/items/grenades/chem_grenade.dm +++ b/code/game/objects/items/grenades/chem_grenade.dm @@ -77,8 +77,7 @@ to_chat(user, "You add [I] to the [initial(name)] assembly.") beakers += I var/reagent_list = pretty_string_from_reagent_list(I.reagents) - add_logs(user, src, "inserted [I]", addition = "[reagent_list] inside.") - log_game("[key_name(user)] inserted [I] into [src] containing [reagent_list] ") + user.log_message("inserted [I] ([reagent_list]) into [src]") else to_chat(user, "[I] is empty!") @@ -118,8 +117,7 @@ if(!O.reagents) continue var/reagent_list = pretty_string_from_reagent_list(O.reagents) - add_logs(user, src, "removed [O]", addition = "[reagent_list] inside.") - log_game("[key_name(user)] removed [O] from [src] containing [reagent_list]") + user.log_message("removed [O] ([reagent_list]) from [src]") beakers = list() to_chat(user, "You open the [initial(name)] assembly and remove the payload.") return // First use of the wrench remove beakers, then use the wrench to remove the activation mechanism. @@ -175,8 +173,7 @@ var/message = "[src] primed by [user] at [ADMIN_VERBOSEJMP(T)] contained [reagent_string]." GLOB.bombers += message message_admins(message) - log_game("[src] primed by [user] at [AREACOORD(T)] contained [reagent_string].") - add_logs(user, src, "primed", addition = "[reagent_string] inside.") + user.log_message("primed [src] ([reagent_string])") /obj/item/grenade/chem_grenade/prime() if(stage != READY) diff --git a/code/game/objects/items/handcuffs.dm b/code/game/objects/items/handcuffs.dm index ce359d7c0c7..8a2e5d12925 100644 --- a/code/game/objects/items/handcuffs.dm +++ b/code/game/objects/items/handcuffs.dm @@ -69,7 +69,7 @@ to_chat(user, "You handcuff [C].") SSblackbox.record_feedback("tally", "handcuffs", 1, type) - add_logs(user, C, "handcuffed") + log_combat(user, C, "handcuffed") else to_chat(user, "You fail to handcuff [C]!") else diff --git a/code/game/objects/items/hot_potato.dm b/code/game/objects/items/hot_potato.dm index c24a84a6236..db7f38ddf33 100644 --- a/code/game/objects/items/hot_potato.dm +++ b/code/game/objects/items/hot_potato.dm @@ -117,11 +117,11 @@ else . = TRUE if(.) - add_logs(user, victim, "forced a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto") + log_combat(user, victim, "forced a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto") user.visible_message("[user] forces [src] onto [victim]!", "You force [src] onto [victim]!", "You hear a mechanical click and a beep.") colorize(null) else - add_logs(user, victim, "tried to force a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto") + log_combat(user, victim, "tried to force a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto") user.visible_message("[user] tried to force [src] onto [victim], but it could not attach!", "You try to force [src] onto [victim], but it is unable to attach!", "You hear a mechanical click and two buzzes.") user.put_in_hands(src) diff --git a/code/game/objects/items/implants/implant.dm b/code/game/objects/items/implants/implant.dm index 7184b956f54..482cfb0d8e8 100644 --- a/code/game/objects/items/implants/implant.dm +++ b/code/game/objects/items/implants/implant.dm @@ -59,7 +59,7 @@ if(flags & COMPONENT_STOP_IMPLANTING) UNSETEMPTY(target.implants) return FALSE - + if(istype(imp_e, type)) if(!allow_multiple) if(imp_e.uses < initial(imp_e.uses)*2) @@ -84,7 +84,7 @@ H.sec_hud_set_implants() if(user) - add_logs(user, target, "implanted", "\a [name]") + log_combat(user, target, "implanted", "\a [name]") return TRUE diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm index 19814af7920..1565c2f0968 100644 --- a/code/game/objects/items/melee/misc.dm +++ b/code/game/objects/items/melee/misc.dm @@ -181,7 +181,7 @@ return playsound(get_turf(src), 'sound/effects/woodhit.ogg', 75, 1, -1) target.Knockdown(60) - add_logs(user, target, "stunned", src) + log_combat(user, target, "stunned", src) src.add_fingerprint(user) target.visible_message("[user] has knocked down [target] with [src]!", \ "[user] has knocked down [target] with [src]!") diff --git a/code/game/objects/items/pneumaticCannon.dm b/code/game/objects/items/pneumaticCannon.dm index a3846979a2f..2ca2840ee3f 100644 --- a/code/game/objects/items/pneumaticCannon.dm +++ b/code/game/objects/items/pneumaticCannon.dm @@ -163,7 +163,7 @@ if(!discharge) user.visible_message("[user] fires \the [src]!", \ "You fire \the [src]!") - add_logs(user, target, "fired at", src) + log_combat(user, target, "fired at", src) var/turf/T = get_target(target, get_turf(src)) playsound(src, 'sound/weapons/sonic_jackhammer.ogg', 50, 1) fire_items(T, user) diff --git a/code/game/objects/items/powerfist.dm b/code/game/objects/items/powerfist.dm index 5346d6e9cc0..f02e92bb3c3 100644 --- a/code/game/objects/items/powerfist.dm +++ b/code/game/objects/items/powerfist.dm @@ -89,7 +89,7 @@ target.throw_at(throw_target, 5 * fisto_setting, 0.2) - add_logs(user, target, "power fisted", src) + log_combat(user, target, "power fisted", src) user.changeNext_move(CLICK_CD_MELEE * click_delay) diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index e98b7984943..d7f0b03837b 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -30,7 +30,7 @@ playsound(loc, 'sound/weapons/egloves.ogg', 50, 1, -1) - add_logs(user, M, "stunned", src, "(INTENT: [uppertext(user.a_intent)])") + log_combat(user, M, "stunned", src, "(INTENT: [uppertext(user.a_intent)])") /obj/item/borg/cyborghug name = "hugging module" diff --git a/code/game/objects/items/stacks/wrap.dm b/code/game/objects/items/stacks/wrap.dm index 1225998a2cd..b438c863a80 100644 --- a/code/game/objects/items/stacks/wrap.dm +++ b/code/game/objects/items/stacks/wrap.dm @@ -112,7 +112,7 @@ return user.visible_message("[user] wraps [target].") - user.log_message("Has used [name] on [target]", INDIVIDUAL_ATTACK_LOG) + user.log_message("has used [name] on [key_name(target)]", LOG_ATTACK, color="blue") /obj/item/stack/packageWrap/use(used, transfer = FALSE) var/turf/T = get_turf(src) diff --git a/code/game/objects/items/storage/book.dm b/code/game/objects/items/storage/book.dm index 50e943fe1e6..9431b18df45 100644 --- a/code/game/objects/items/storage/book.dm +++ b/code/game/objects/items/storage/book.dm @@ -146,7 +146,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible", M.visible_message("[user] beats [M] over the head with [src]!", \ "[user] beats [M] over the head with [src]!") playsound(src.loc, "punch", 25, 1, -1) - add_logs(user, M, "attacked", src) + log_combat(user, M, "attacked", src) else M.visible_message("[user] smacks [M]'s lifeless corpse with [src].") diff --git a/code/game/objects/items/stunbaton.dm b/code/game/objects/items/stunbaton.dm index d6859d1dba3..820a5446f63 100644 --- a/code/game/objects/items/stunbaton.dm +++ b/code/game/objects/items/stunbaton.dm @@ -164,7 +164,7 @@ L.lastattackerckey = user.ckey L.visible_message("[user] has stunned [L] with [src]!", \ "[user] has stunned you with [src]!") - add_logs(user, L, "stunned") + log_combat(user, L, "stunned") playsound(loc, 'sound/weapons/egloves.ogg', 50, 1, -1) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index fd41b80bdb9..ca7b87c5b59 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -1367,8 +1367,11 @@ to_chat(user, "You name the dummy as \"[doll_name]\"") name = "[initial(name)] - [doll_name]" -/obj/item/toy/dummy/talk_into(atom/movable/M, message, channel, list/spans, datum/language/language) - log_talk(M,"[key_name(M)] : through dummy : [message]",LOGSAY) +/obj/item/toy/dummy/talk_into(atom/movable/A, message, channel, list/spans, datum/language/language) + var/mob/M = A + if (istype(M)) + M.log_talk(message, LOG_SAY, tag="dummy toy") + say(message, language) return NOPASS diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index dab6e463950..68c4ffeee87 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -79,7 +79,7 @@ if(do_climb(user)) user.visible_message("[user] climbs onto [src].", \ "You climb onto [src].") - add_logs(user, src, "climbed onto") + log_combat(user, src, "climbed onto") if(climb_stun) user.Stun(climb_stun) . = 1 diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index 734b645880a..bcb025d14b1 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -20,7 +20,7 @@ /obj/structure/displaycase/Initialize() . = ..() - if(start_showpieces.len && !start_showpiece_type) + if(start_showpieces.len && !start_showpiece_type) var/list/showpiece_entry = pick(start_showpieces) if (showpiece_entry && showpiece_entry["type"]) start_showpiece_type = showpiece_entry["type"] @@ -164,6 +164,7 @@ user.changeNext_move(CLICK_CD_MELEE) if (showpiece && (broken || open)) to_chat(user, "You deactivate the hover field built into the case.") + log_combat(user, src, "deactivates the hover field of") dump() src.add_fingerprint(user) update_icon() @@ -173,6 +174,7 @@ if (!Adjacent(user)) return user.visible_message("[user] kicks the display case.", null, null, COMBAT_MESSAGE_RANGE) + log_combat(user, src, "kicks") user.do_attack_animation(src, ATTACK_EFFECT_KICK) take_damage(2) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 231d02f3752..dc5219b9ec9 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -109,6 +109,7 @@ user.changeNext_move(CLICK_CD_MELEE) user.do_attack_animation(src, ATTACK_EFFECT_KICK) user.visible_message("[user] hits [src].", null, null, COMBAT_MESSAGE_RANGE) + log_combat(user, src, "hit") if(!shock(user, 70)) take_damage(rand(5,10), BRUTE, "melee", 1) diff --git a/code/game/objects/structures/guillotine.dm b/code/game/objects/structures/guillotine.dm index beb7a927ca0..0a7b641a8a6 100644 --- a/code/game/objects/structures/guillotine.dm +++ b/code/game/objects/structures/guillotine.dm @@ -118,7 +118,7 @@ playsound(src, 'sound/weapons/bladeslice.ogg', 100, 1) if (blade_sharpness >= GUILLOTINE_DECAP_MIN_SHARP || head.brute_dam >= 100) head.dismember() - add_logs(user, H, "beheaded", src) + log_combat(user, H, "beheaded", src) H.regenerate_icons() unbuckle_all_mobs() kill_count += 1 @@ -144,7 +144,7 @@ delay_offset++ else H.apply_damage(15 * blade_sharpness, BRUTE, head) - add_logs(user, H, "dropped the blade on", src, " non-fatally") + log_combat(user, H, "dropped the blade on", src, " non-fatally") H.emote("scream") if (blade_sharpness > 1) diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 111ce3ccca3..ea89371699d 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -256,10 +256,10 @@ GLOBAL_LIST_EMPTY(crematoriums) if (M.stat != DEAD) M.emote("scream") if(user) - user.log_message("Cremated [key_name(M)]", INDIVIDUAL_ATTACK_LOG) - log_attack("[key_name(user)] cremated [key_name(M)]") + log_combat(user, M, "cremated") else - log_attack("UNKNOWN cremated [key_name(M)]") + M.log_message("was cremated", LOG_ATTACK) + M.death(1) if(M) //some animals get automatically deleted on death. M.ghostize() diff --git a/code/game/objects/structures/spirit_board.dm b/code/game/objects/structures/spirit_board.dm index 104d02858dd..c35d16ab738 100644 --- a/code/game/objects/structures/spirit_board.dm +++ b/code/game/objects/structures/spirit_board.dm @@ -37,7 +37,7 @@ planchette = input("Choose the letter.", "Seance!") as null|anything in list("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z") if(!planchette || !Adjacent(M) || next_use > world.time) return - add_logs(M, src, "picked a letter on", " which was \"[planchette]\".") + M.log_message("picked a letter on [src], which was \"[planchette]\".") next_use = world.time + rand(30,50) lastuser = M.ckey //blind message is the same because not everyone brings night vision to seances diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index da5eeb8dcd9..2fad0c4b150 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -112,14 +112,14 @@ pushed_mob.update_canmove() pushed_mob.visible_message("[user] places [pushed_mob] onto [src].", \ "[user] places [pushed_mob] onto [src].") - add_logs(user, pushed_mob, "placed") + log_combat(user, pushed_mob, "placed") /obj/structure/table/proc/tablepush(mob/living/user, mob/living/pushed_mob) pushed_mob.forceMove(src.loc) pushed_mob.Knockdown(40) pushed_mob.visible_message("[user] pushes [pushed_mob] onto [src].", \ "[user] pushes [pushed_mob] onto [src].") - add_logs(user, pushed_mob, "pushed") + log_combat(user, pushed_mob, "pushed") if(!ishuman(pushed_mob)) return var/mob/living/carbon/human/H = pushed_mob diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm index cc8c630bd66..411b3b9c89e 100644 --- a/code/modules/admin/verbs/adminsay.dm +++ b/code/modules/admin/verbs/adminsay.dm @@ -9,7 +9,8 @@ if(!msg) return - log_talk(mob,"[key_name(src)] : [msg]",LOGASAY) + mob.log_talk(msg, LOG_ADMIN) + msg = keywords_lookup(msg) msg = "ADMIN: [key_name(usr, 1)] [ADMIN_FLW(mob)]: [msg]" to_chat(GLOB.admins, msg) diff --git a/code/modules/admin/verbs/deadsay.dm b/code/modules/admin/verbs/deadsay.dm index e89a067cdd0..30afa659f50 100644 --- a/code/modules/admin/verbs/deadsay.dm +++ b/code/modules/admin/verbs/deadsay.dm @@ -15,7 +15,7 @@ return msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN) - log_talk(mob,"[key_name(src)] : [msg]",LOGDSAY) + mob.log_talk(msg, LOG_DSAY) if (!msg) return diff --git a/code/modules/admin/verbs/individual_logging.dm b/code/modules/admin/verbs/individual_logging.dm index df151cfef9e..7fe4c070d2d 100644 --- a/code/modules/admin/verbs/individual_logging.dm +++ b/code/modules/admin/verbs/individual_logging.dm @@ -1,29 +1,45 @@ /proc/show_individual_logging_panel(mob/M, source = LOGSRC_CLIENT, type = INDIVIDUAL_ATTACK_LOG) if(!M || !ismob(M)) return - + + var/ntype = text2num(type) + //Add client links var/dat = "" - if(M.client) - dat += "

Client

" - dat += "
Attack log | " - dat += "Say log | " - dat += "Emote log | " - dat += "OOC log | " - dat += "Show all | " - dat += "Refresh
" + if(M.client) + dat += "

Client

" + dat += "
" + dat += individual_logging_panel_link(M, INDIVIDUAL_ATTACK_LOG, LOGSRC_CLIENT, "Attack Log", source, ntype) + dat += " | " + dat += individual_logging_panel_link(M, INDIVIDUAL_SAY_LOG, LOGSRC_CLIENT, "Say Log", source, ntype) + dat += " | " + dat += individual_logging_panel_link(M, INDIVIDUAL_EMOTE_LOG, LOGSRC_CLIENT, "Emote Log", source, ntype) + dat += " | " + dat += individual_logging_panel_link(M, INDIVIDUAL_COMMS_LOG, LOGSRC_CLIENT, "Comms Log", source, ntype) + dat += " | " + dat += individual_logging_panel_link(M, INDIVIDUAL_OOC_LOG, LOGSRC_CLIENT, "OOC Log", source, ntype) + dat += " | " + dat += individual_logging_panel_link(M, INDIVIDUAL_SHOW_ALL_LOG, LOGSRC_CLIENT, "Show All", source, ntype) + dat += "
" else dat += "

No client attached to mob

" dat += "
" - dat += "

Mob

" + dat += "

Mob

" //Add the links for the mob specific log - dat += "
Attack log | " - dat += "Say log | " - dat += "Emote log | " - dat += "OOC log | " - dat += "Show all | " - dat += "Refresh
" + dat += "
" + dat += individual_logging_panel_link(M, INDIVIDUAL_ATTACK_LOG, LOGSRC_MOB, "Attack Log", source, ntype) + dat += " | " + dat += individual_logging_panel_link(M, INDIVIDUAL_SAY_LOG, LOGSRC_MOB, "Say Log", source, ntype) + dat += " | " + dat += individual_logging_panel_link(M, INDIVIDUAL_EMOTE_LOG, LOGSRC_MOB, "Emote Log", source, ntype) + dat += " | " + dat += individual_logging_panel_link(M, INDIVIDUAL_COMMS_LOG, LOGSRC_MOB, "Comms Log", source, ntype) + dat += " | " + dat += individual_logging_panel_link(M, INDIVIDUAL_OOC_LOG, LOGSRC_MOB, "OOC Log", source, ntype) + dat += " | " + dat += individual_logging_panel_link(M, INDIVIDUAL_SHOW_ALL_LOG, LOGSRC_MOB, "Show All", source, ntype) + dat += "
" dat += "
" @@ -31,22 +47,21 @@ if(source == LOGSRC_CLIENT && M.client) //if client doesn't exist just fall back to the mob log log_source = M.client.player_details.logging //should exist, if it doesn't that's a bug, don't check for it not existing - if(type == INDIVIDUAL_SHOW_ALL_LOG) - dat += "
Displaying all [source] logs of [key_name(M)]


" - for(var/log_type in log_source) - dat += "
[log_type]

" + for(var/log_type in log_source) + var/nlog_type = text2num(log_type) + if(nlog_type & ntype) var/list/reversed = log_source[log_type] if(islist(reversed)) reversed = reverseRange(reversed.Copy()) for(var/entry in reversed) - dat += "[entry]: [reversed[entry]]
" + dat += "[entry]
[reversed[entry]]

" dat += "
" - else - dat += "
[source] [type] of [key_name(M)]

" - var/list/reversed = log_source[type] - if(reversed) - reversed = reverseRange(reversed.Copy()) - for(var/entry in reversed) - dat += "[entry]: [reversed[entry]]
" usr << browse(dat, "window=invidual_logging_[key_name(M)];size=600x480") + +/proc/individual_logging_panel_link(mob/M, log_type, log_src, label, selected_src, selected_type) + var/slabel = label + if(selected_type == log_type && selected_src == log_src) + slabel = "\[[label]\]" + + return "[slabel]" \ No newline at end of file diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index f52a1aefc01..7a1a30df50d 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -75,7 +75,7 @@ message_admins("[key_name_admin(src)] decided not to answer [key_name_admin(H)]'s [sender] request.") return - log_admin("[key_name(src)] replied to [key_name(H)]'s [sender] message with the message [input].") + log_directed_talk(src, H, input, LOG_ADMIN, "reply") message_admins("[key_name_admin(src)] replied to [key_name_admin(H)]'s [sender] message with: \"[input]\"") to_chat(H, "You hear something crackle in your ears for a moment before a voice speaks. \"Please stand by for a message from [sender == "Syndicate" ? "your benefactor" : "Central Command"]. Message as follows[sender == "Syndicate" ? ", agent." : ":"] [input]. Message ends.\"") diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm index 331fb8d4bf9..e7186fa2295 100644 --- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm +++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm @@ -362,7 +362,7 @@ to_chat(L, "You hear a voice in your head saying: [message]") to_chat(user, "You send the message to your target.") - log_talk(user,"[key_name(user)] sent an abductor mind message to [key_name(L)]: '[message]'", LOGSAY) + log_directed_talk(user, L, message, LOG_SAY, "abductor whisper") /obj/item/firing_pin/abductor @@ -514,7 +514,7 @@ Congratulations! You are now trained for invasive xenobiology research!"} var/mob/living/carbon/human/H = L H.forcesay(GLOB.hit_appends) - add_logs(user, L, "stunned") + log_combat(user, L, "stunned") /obj/item/abductor_baton/proc/SleepAttack(mob/living/L,mob/living/user) if(L.incapacitated(TRUE, TRUE)) @@ -528,7 +528,7 @@ Congratulations! You are now trained for invasive xenobiology research!"} "You suddenly feel very drowsy!") playsound(loc, 'sound/weapons/egloves.ogg', 50, 1, -1) L.Sleeping(1200) - add_logs(user, L, "put to sleep") + log_combat(user, L, "put to sleep") else if(istype(L.get_item_by_slot(SLOT_HEAD), /obj/item/clothing/head/foilhat)) to_chat(user, "The specimen's protective headgear is completely blocking our sleep inducement methods!") @@ -554,7 +554,7 @@ Congratulations! You are now trained for invasive xenobiology research!"} C.handcuffed = new /obj/item/restraints/handcuffs/energy/used(C) C.update_handcuffed() to_chat(user, "You restrain [C].") - add_logs(user, C, "handcuffed") + log_combat(user, C, "handcuffed") else to_chat(user, "You fail to restrain [C].") else diff --git a/code/modules/antagonists/blob/blob/overmind.dm b/code/modules/antagonists/blob/blob/overmind.dm index 7cf03466d20..58268d92074 100644 --- a/code/modules/antagonists/blob/blob/overmind.dm +++ b/code/modules/antagonists/blob/blob/overmind.dm @@ -208,7 +208,7 @@ GLOBAL_LIST_EMPTY(blob_nodes) if (!message) return - log_talk(src,"[key_name(src)] : [message]",LOGSAY) + src.log_talk(message, LOG_SAY) var/message_a = say_quote(message, get_spans()) var/rendered = "\[Blob Telepathy\] [name]([blob_reagent_datum.name]) [message_a]" diff --git a/code/modules/antagonists/changeling/powers/absorb.dm b/code/modules/antagonists/changeling/powers/absorb.dm index a8bec727718..2f8fc6943f7 100644 --- a/code/modules/antagonists/changeling/powers/absorb.dm +++ b/code/modules/antagonists/changeling/powers/absorb.dm @@ -68,7 +68,7 @@ //Recent as opposed to all because rounds tend to have a LOT of text. var/list/recent_speech = list() - var/list/say_log = target.logging[INDIVIDUAL_SAY_LOG] + var/list/say_log = target.logging[LOG_SAY] if(LAZYLEN(say_log) > 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 diff --git a/code/modules/antagonists/changeling/powers/tiny_prick.dm b/code/modules/antagonists/changeling/powers/tiny_prick.dm index 757d69a3848..9bf4a76454f 100644 --- a/code/modules/antagonists/changeling/powers/tiny_prick.dm +++ b/code/modules/antagonists/changeling/powers/tiny_prick.dm @@ -93,7 +93,7 @@ return 1 /obj/effect/proc_holder/changeling/sting/transformation/sting_action(mob/user, mob/target) - add_logs(user, target, "stung", "transformation sting", " new identity is [selected_dna.dna.real_name]") + log_combat(user, target, "stung", "transformation sting", " new identity is '[selected_dna.dna.real_name]'") var/datum/dna/NewDNA = selected_dna.dna if(ismonkey(target)) to_chat(user, "Our genes cry out as we sting [target.name]!") @@ -132,7 +132,7 @@ return 1 /obj/effect/proc_holder/changeling/sting/false_armblade/sting_action(mob/user, mob/target) - add_logs(user, target, "stung", object="false armblade sting") + log_combat(user, target, "stung", object="false armblade sting") var/obj/item/held = target.get_active_held_item() if(held && !target.dropItemToGround(held)) @@ -174,7 +174,7 @@ return changeling.can_absorb_dna(target) /obj/effect/proc_holder/changeling/sting/extract_dna/sting_action(mob/user, mob/living/carbon/human/target) - add_logs(user, target, "stung", "extraction sting") + log_combat(user, target, "stung", "extraction sting") var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) if(!(changeling.has_dna(target.dna))) changeling.add_new_profile(target) @@ -189,7 +189,7 @@ dna_cost = 2 /obj/effect/proc_holder/changeling/sting/mute/sting_action(mob/user, mob/living/carbon/target) - add_logs(user, target, "stung", "mute sting") + log_combat(user, target, "stung", "mute sting") target.silent += 30 return TRUE @@ -202,7 +202,7 @@ dna_cost = 1 /obj/effect/proc_holder/changeling/sting/blind/sting_action(mob/user, mob/living/carbon/target) - add_logs(user, target, "stung", "blind sting") + log_combat(user, target, "stung", "blind sting") to_chat(target, "Your eyes burn horrifically!") target.become_nearsighted(EYE_DAMAGE) target.blind_eyes(20) @@ -218,7 +218,7 @@ dna_cost = 1 /obj/effect/proc_holder/changeling/sting/LSD/sting_action(mob/user, mob/living/carbon/target) - add_logs(user, target, "stung", "LSD sting") + log_combat(user, target, "stung", "LSD sting") addtimer(CALLBACK(src, .proc/hallucination_time, target), rand(100,200)) return TRUE @@ -235,7 +235,7 @@ dna_cost = 2 /obj/effect/proc_holder/changeling/sting/cryo/sting_action(mob/user, mob/target) - add_logs(user, target, "stung", "cryo sting") + log_combat(user, target, "stung", "cryo sting") if(target.reagents) target.reagents.add_reagent("frostoil", 30) return TRUE diff --git a/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm b/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm index b06a6ef3d89..99f20ceaa7e 100644 --- a/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm +++ b/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm @@ -143,7 +143,7 @@ GLOB.application_scripture_unlocked = TRUE hierophant_message("With the conversion of a new servant the Ark's power grows. Application scriptures are now available.") if(add_servant_of_ratvar(L)) - L.log_message("Conversion was done with a [sigil_name].", INDIVIDUAL_ATTACK_LOG) + L.log_message("conversion was done with a [sigil_name]", LOG_ATTACK, color="BE8700") if(iscarbon(L)) var/mob/living/carbon/M = L M.uncuff() diff --git a/code/modules/antagonists/clockcult/clock_helpers/hierophant_network.dm b/code/modules/antagonists/clockcult/clock_helpers/hierophant_network.dm index 4c1789c50d7..37f6f0b2d77 100644 --- a/code/modules/antagonists/clockcult/clock_helpers/hierophant_network.dm +++ b/code/modules/antagonists/clockcult/clock_helpers/hierophant_network.dm @@ -46,5 +46,5 @@ return if(ishuman(owner)) clockwork_say(owner, "[text2ratvar("Servants, hear my words: [input]")]", TRUE) - log_talk(owner,"CLOCK:[key_name(owner)] : [input]",LOGSAY) + owner.log_talk(input, LOG_SAY, tag="clockwork") titled_hierophant_message(owner, input, span_for_name, span_for_message, title) diff --git a/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm b/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm index aaeb871e5d4..ad83d5f4d20 100644 --- a/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm +++ b/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm @@ -53,7 +53,7 @@ L.handcuffed = new/obj/item/restraints/handcuffs/clockwork(L) L.update_handcuffed() to_chat(ranged_ability_user, "You shackle [L].") - add_logs(ranged_ability_user, L, "handcuffed") + log_combat(ranged_ability_user, L, "handcuffed") else to_chat(ranged_ability_user, "You fail to shackle [L].") @@ -117,12 +117,12 @@ L.adjustOxyLoss(-oxydamage) L.adjustToxLoss(totaldamage * 0.5, TRUE, TRUE) clockwork_say(ranged_ability_user, text2ratvar("[has_holy_water ? "Heal tainted" : "Mend wounded"] flesh!")) - add_logs(ranged_ability_user, L, "healed with Sentinel's Compromise") + log_combat(ranged_ability_user, L, "healed with Sentinel's Compromise") L.visible_message("A blue light washes over [L], [has_holy_water ? "causing [L.p_them()] to briefly glow as it mends" : " mending"] [L.p_their()] bruises and burns!", \ "You feel Inath-neq's power healing your wounds[has_holy_water ? " and purging the darkness within you" : ""], but a deep nausea overcomes you!") else clockwork_say(ranged_ability_user, text2ratvar("Purge foul darkness!")) - add_logs(ranged_ability_user, L, "purged of holy water with Sentinel's Compromise") + log_combat(ranged_ability_user, L, "purged of holy water with Sentinel's Compromise") L.visible_message("A blue light washes over [L], causing [L.p_them()] to briefly glow!", \ "You feel Inath-neq's power purging the darkness within you!") playsound(targetturf, 'sound/magic/staff_healing.ogg', 50, 1) @@ -153,7 +153,7 @@ var/turf/U = get_turf(target) to_chat(ranged_ability_user, "You release the light of Ratvar!") clockwork_say(ranged_ability_user, text2ratvar("Purge all untruths and honor Engine!")) - add_logs(ranged_ability_user, U, "fired at with Kindle") + log_combat(ranged_ability_user, U, "fired at with Kindle") playsound(ranged_ability_user, 'sound/magic/blink.ogg', 50, TRUE, frequency = 0.5) var/obj/item/projectile/kindle/A = new(T) A.preparePixelProjectile(target, caller, params) @@ -265,7 +265,7 @@ "You direct the judicial force to [target].") var/turf/targetturf = get_turf(target) new/obj/effect/clockwork/judicial_marker(targetturf, ranged_ability_user) - add_logs(ranged_ability_user, targetturf, "created a judicial marker") + log_combat(ranged_ability_user, targetturf, "created a judicial marker") remove_ranged_ability() return TRUE diff --git a/code/modules/antagonists/clockcult/clock_items/judicial_visor.dm b/code/modules/antagonists/clockcult/clock_items/judicial_visor.dm index f54d88fc49a..f44f67e9cb6 100644 --- a/code/modules/antagonists/clockcult/clock_items/judicial_visor.dm +++ b/code/modules/antagonists/clockcult/clock_items/judicial_visor.dm @@ -136,7 +136,7 @@ ranged_ability_user.visible_message("[ranged_ability_user]'s judicial visor fires a stream of energy at [target], creating a strange mark!", "You direct [visor]'s power to [target]. You must wait for some time before doing this again.") var/turf/targetturf = get_turf(target) new/obj/effect/clockwork/judicial_marker(targetturf, ranged_ability_user) - add_logs(ranged_ability_user, targetturf, "created a judicial marker") + log_combat(ranged_ability_user, targetturf, "created a judicial marker") ranged_ability_user.update_action_buttons_icon() ranged_ability_user.update_inv_glasses() addtimer(CALLBACK(visor, /obj/item/clothing/glasses/judicial_visor.proc/recharge_visor, ranged_ability_user), GLOB.ratvar_awakens ? visor.recharge_cooldown*0.1 : visor.recharge_cooldown)//Cooldown is reduced by 10x if Ratvar is up @@ -209,7 +209,7 @@ targetsjudged++ if(!QDELETED(L)) L.adjustBruteLoss(20) //does a decent amount of damage - add_logs(user, L, "struck with a judicial blast") + log_combat(user, L, "struck with a judicial blast") to_chat(user, "[targetsjudged ? "Successfully judged [targetsjudged]":"Judged no"] heretic[targetsjudged == 1 ? "":"s"].") sleep(3) //so the animation completes properly qdel(src) diff --git a/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm b/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm index 262910346e9..aae32f66f5f 100644 --- a/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm +++ b/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm @@ -33,12 +33,12 @@ T.visible_message("[T] suddenly emits a ringing sound!", null, null, null, src) playsound(T, 'sound/machines/clockcult/ark_damage.ogg', 75, FALSE) last_failed_turf = T - if((world.time - lastWarning) >= 30) + if((world.time - lastWarning) >= 30) lastWarning = world.time to_chat(src, "This turf is consecrated and can't be crossed!") return if(istype(get_area(T), /area/chapel)) - if((world.time - lastWarning) >= 30) + if((world.time - lastWarning) >= 30) lastWarning = world.time to_chat(src, "The Chapel is hallowed ground under a heretical deity, and can't be accessed!") return @@ -86,7 +86,7 @@ message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) if(!message) return - log_talk(src, "[key_name(src)] : [message]", LOGSAY) + src.log_talk(message, LOG_SAY, tag="clockwork eminence") if(GLOB.ratvar_awakens) visible_message("You feel light slam into your mind and form words: \"[capitalize(message)]\"") playsound(src, 'sound/machines/clockcult/ark_scream.ogg', 50, FALSE) diff --git a/code/modules/antagonists/clockcult/clockcult.dm b/code/modules/antagonists/clockcult/clockcult.dm index f2c0518cc28..d68e9b594db 100644 --- a/code/modules/antagonists/clockcult/clockcult.dm +++ b/code/modules/antagonists/clockcult/clockcult.dm @@ -53,7 +53,7 @@ SSticker.mode.servants_of_ratvar += owner SSticker.mode.update_servant_icons_added(owner) owner.special_role = ROLE_SERVANT_OF_RATVAR - owner.current.log_message("Has been converted to the cult of Ratvar!", INDIVIDUAL_ATTACK_LOG) + owner.current.log_message("has been converted to the cult of Ratvar!", LOG_ATTACK, color="#BE8700") if(issilicon(current)) if(iscyborg(current) && !silent) var/mob/living/silicon/robot/R = current @@ -161,7 +161,7 @@ if(!silent) owner.current.visible_message("[owner.current] seems to have remembered [owner.current.p_their()] true allegiance!", null, null, null, owner.current) to_chat(owner, "A cold, cold darkness flows through your mind, extinguishing the Justiciar's light and all of your memories as his servant.") - owner.current.log_message("Has renounced the cult of Ratvar!", INDIVIDUAL_ATTACK_LOG) + owner.current.log_message("has renounced the cult of Ratvar!", LOG_ATTACK, color="#BE8700") owner.special_role = null if(iscyborg(owner.current)) to_chat(owner.current, "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/modules/antagonists/cult/blood_magic.dm b/code/modules/antagonists/cult/blood_magic.dm index 3dec58540ac..960bfcba1cd 100644 --- a/code/modules/antagonists/cult/blood_magic.dm +++ b/code/modules/antagonists/cult/blood_magic.dm @@ -378,7 +378,7 @@ uses = 0 qdel(src) return - add_logs(user, M, "used a cult spell on", source.name, "") + log_combat(user, M, "used a cult spell on", source.name, "") M.lastattacker = user.real_name M.lastattackerckey = user.ckey @@ -507,7 +507,7 @@ C.update_handcuffed() C.silent += 5 to_chat(user, "You shackle [C].") - add_logs(user, C, "shackled") + log_combat(user, C, "shackled") uses-- else to_chat(user, "[C] is already bound.") diff --git a/code/modules/antagonists/cult/cult.dm b/code/modules/antagonists/cult/cult.dm index 8ea391d2caf..c14cd9ecd93 100644 --- a/code/modules/antagonists/cult/cult.dm +++ b/code/modules/antagonists/cult/cult.dm @@ -60,7 +60,7 @@ equip_cultist(TRUE) SSticker.mode.cult += owner // Only add after they've been given objectives SSticker.mode.update_cult_icons_added(owner) - current.log_message("Has been converted to the cult of Nar'Sie!", INDIVIDUAL_ATTACK_LOG) + current.log_message("has been converted to the cult of Nar'Sie!", LOG_ATTACK, color="#960000") if(cult_team.blood_target && cult_team.blood_target_image && current.client) current.client.images += cult_team.blood_target_image @@ -130,7 +130,7 @@ if(!silent) owner.current.visible_message("[owner.current] looks like [owner.current.p_theyve()] just reverted to [owner.current.p_their()] old faith!", null, null, null, owner.current) to_chat(owner.current, "An unfamiliar white light flashes through your mind, cleansing the taint of the Geometer and all your memories as her servant.") - owner.current.log_message("Has renounced the cult of Nar'Sie!", INDIVIDUAL_ATTACK_LOG) + owner.current.log_message("has renounced the cult of Nar'Sie!", LOG_ATTACK, color="#960000") if(cult_team.blood_target && cult_team.blood_target_image && owner.current.client) owner.current.client.images -= cult_team.blood_target_image . = ..() diff --git a/code/modules/antagonists/cult/cult_comms.dm b/code/modules/antagonists/cult/cult_comms.dm index e2f57a82e35..fd6e40639a0 100644 --- a/code/modules/antagonists/cult/cult_comms.dm +++ b/code/modules/antagonists/cult/cult_comms.dm @@ -45,7 +45,7 @@ var/link = FOLLOW_LINK(M, user) to_chat(M, "[link] [my_message]") - log_talk(user,"CULT:[key_name(user)] : [message]",LOGSAY) + user.log_talk(message, LOG_SAY, tag="cult") /datum/action/innate/cult/comm/spirit name = "Spiritual Communion" diff --git a/code/modules/antagonists/cult/ritual.dm b/code/modules/antagonists/cult/ritual.dm index 3f1bc1b04ab..c623b2646a0 100644 --- a/code/modules/antagonists/cult/ritual.dm +++ b/code/modules/antagonists/cult/ritual.dm @@ -29,7 +29,7 @@ This file contains the cult dagger and rune list code var/holy2unholy = M.reagents.get_reagent_amount("holywater") M.reagents.del_reagent("holywater") M.reagents.add_reagent("unholywater",holy2unholy) - add_logs(user, M, "smacked", src, " removing the holy water from them") + log_combat(user, M, "smacked", src, " removing the holy water from them") return FALSE . = ..() diff --git a/code/modules/antagonists/devil/true_devil/_true_devil.dm b/code/modules/antagonists/devil/true_devil/_true_devil.dm index 551c31ab979..923a224b811 100644 --- a/code/modules/antagonists/devil/true_devil/_true_devil.dm +++ b/code/modules/antagonists/devil/true_devil/_true_devil.dm @@ -173,14 +173,14 @@ visible_message("[M] has punched [src]!", \ "[M] has punched [src]!") adjustBruteLoss(damage) - add_logs(M, src, "attacked") + log_combat(M, src, "attacked") updatehealth() if ("disarm") if (!lying && !ascended) //No stealing the arch devil's pitchfork. if (prob(5)) Unconscious(40) playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - add_logs(M, src, "pushed") + log_combat(M, src, "pushed") visible_message("[M] has pushed down [src]!", \ "[M] has pushed down [src]!") else diff --git a/code/modules/antagonists/revenant/revenant.dm b/code/modules/antagonists/revenant/revenant.dm index 09371a74567..c88f6f0828e 100644 --- a/code/modules/antagonists/revenant/revenant.dm +++ b/code/modules/antagonists/revenant/revenant.dm @@ -147,7 +147,7 @@ /mob/living/simple_animal/revenant/say(message) if(!message) return - log_talk(src,"[key_name(src)] : [message]",LOGSAY) + src.log_talk(message, LOG_SAY) var/rendered = "[src] says, \"[message]\"" for(var/mob/M in GLOB.mob_list) if(isrevenant(M)) diff --git a/code/modules/antagonists/revenant/revenant_abilities.dm b/code/modules/antagonists/revenant/revenant_abilities.dm index 0736af1dc09..4056ac1ceae 100644 --- a/code/modules/antagonists/revenant/revenant_abilities.dm +++ b/code/modules/antagonists/revenant/revenant_abilities.dm @@ -114,7 +114,7 @@ if(!msg) charge_counter = charge_max return - log_talk(user,"RevenantTransmit: [key_name(user)]->[key_name(M)] : [msg]",LOGSAY) + log_directed_talk(user, M, msg, LOG_SAY, "revenant whisper") to_chat(user, "You transmit to [M]: [msg]") if(!M.anti_magic_check(FALSE, TRUE)) //hear no evil to_chat(M, "You hear something behind you talking... [msg]") diff --git a/code/modules/antagonists/revolution/revolution.dm b/code/modules/antagonists/revolution/revolution.dm index a454a9a9649..2bed058dc89 100644 --- a/code/modules/antagonists/revolution/revolution.dm +++ b/code/modules/antagonists/revolution/revolution.dm @@ -35,7 +35,7 @@ . = ..() create_objectives() equip_rev() - owner.current.log_message("Has been converted to the revolution!", INDIVIDUAL_ATTACK_LOG) + owner.current.log_message("has been converted to the revolution!", LOG_ATTACK, color="red") /datum/antagonist/rev/on_removal() remove_objectives() @@ -209,7 +209,7 @@ //blunt trauma deconversions call this through species.dm spec_attacked_by() /datum/antagonist/rev/proc/remove_revolutionary(borged, deconverter) - log_attack("[owner.current] (Key: [key_name(owner.current)]) has been deconverted from the revolution by [deconverter] (Key: [key_name(deconverter)])!") + log_attack("[key_name(owner.current)] has been deconverted from the revolution by [key_name(deconverter)]!") if(borged) message_admins("[ADMIN_LOOKUPFLW(owner.current)] has been borged while being a [name]") owner.special_role = null diff --git a/code/modules/antagonists/swarmer/swarmer.dm b/code/modules/antagonists/swarmer/swarmer.dm index cd0ebeea2c3..a51b80b5675 100644 --- a/code/modules/antagonists/swarmer/swarmer.dm +++ b/code/modules/antagonists/swarmer/swarmer.dm @@ -483,7 +483,7 @@ if(ishuman(target) && (!H.handcuffed)) H.handcuffed = new /obj/item/restraints/handcuffs/energy/used(H) H.update_handcuffed() - add_logs(src, H, "handcuffed") + log_combat(src, H, "handcuffed") var/datum/effect_system/spark_spread/S = new S.set_up(4,0,get_turf(target)) diff --git a/code/modules/antagonists/wizard/equipment/soulstone.dm b/code/modules/antagonists/wizard/equipment/soulstone.dm index 50bc4f54a40..40551ae2fc7 100644 --- a/code/modules/antagonists/wizard/equipment/soulstone.dm +++ b/code/modules/antagonists/wizard/equipment/soulstone.dm @@ -66,7 +66,7 @@ if(iscultist(user)) to_chat(user, "\"Come now, do not capture your bretheren's soul.\"") return - add_logs(user, M, "captured [M.name]'s soul", src) + log_combat(user, M, "captured [M.name]'s soul", src) transfer_soul("VICTIM", M, user) ///////////////////Options for using captured souls/////////////////////////////////////// diff --git a/code/modules/assembly/doorcontrol.dm b/code/modules/assembly/doorcontrol.dm index 51b0be95b64..aa1ee8adbc4 100644 --- a/code/modules/assembly/doorcontrol.dm +++ b/code/modules/assembly/doorcontrol.dm @@ -56,7 +56,7 @@ if(D.secondsElectrified) D.secondsElectrified = -1 LAZYADD(D.shockedby, "\[[time_stamp()]\] [key_name(usr)]") - add_logs(usr, D, "electrified") + log_combat(usr, D, "electrified") else D.secondsElectrified = 0 if(specialfunctions & SAFE) diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm index b89a3f876df..f9b6c5402c1 100644 --- a/code/modules/assembly/flash.dm +++ b/code/modules/assembly/flash.dm @@ -104,7 +104,7 @@ /obj/item/assembly/flash/proc/flash_carbon(mob/living/carbon/M, mob/user, power = 15, targeted = TRUE, generic_message = FALSE) if(!istype(M)) return - add_logs(user, M, "[targeted? "flashed(targeted)" : "flashed(AOE)"]", src) + log_combat(user, M, "[targeted? "flashed(targeted)" : "flashed(AOE)"]", src) if(generic_message && M != user) to_chat(M, "[src] emits a blinding light!") if(targeted) @@ -139,7 +139,7 @@ return TRUE else if(issilicon(M)) var/mob/living/silicon/robot/R = M - add_logs(user, R, "flashed", src) + log_combat(user, R, "flashed", src) update_icon(1) R.Knockdown(rand(80,120)) var/diff = 5 * CONFUSION_STACK_MAX_MULTIPLIER - M.confused diff --git a/code/modules/client/player_details.dm b/code/modules/client/player_details.dm index ebe9ba91144..ac5a14a5555 100644 --- a/code/modules/client/player_details.dm +++ b/code/modules/client/player_details.dm @@ -1,4 +1,4 @@ /datum/player_details var/list/player_actions = list() - var/list/logging = list(INDIVIDUAL_ATTACK_LOG, INDIVIDUAL_SAY_LOG, INDIVIDUAL_EMOTE_LOG, INDIVIDUAL_OOC_LOG) + var/list/logging = list() var/byond_version = "Unknown" \ No newline at end of file diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index 2f4922fddf0..bc163b1781b 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -50,9 +50,7 @@ to_chat(src, "You have OOC muted.") return - - log_talk(mob,"[key_name(src)] : [raw_msg]",LOGOOC) - mob.log_message("[key]: [raw_msg]", INDIVIDUAL_OOC_LOG) + mob.log_talk(raw_msg, LOG_OOC) var/keyname = key if(prefs.unlock_content) diff --git a/code/modules/detectivework/footprints_and_rag.dm b/code/modules/detectivework/footprints_and_rag.dm index 6c684c4ecad..9f1f2bf3806 100644 --- a/code/modules/detectivework/footprints_and_rag.dm +++ b/code/modules/detectivework/footprints_and_rag.dm @@ -30,18 +30,17 @@ if(iscarbon(A) && A.reagents && reagents.total_volume) var/mob/living/carbon/C = A var/reagentlist = pretty_string_from_reagent_list(reagents) + var/log_object = "a damp rag containing [reagentlist]" if(user.a_intent == INTENT_HARM && !C.is_mouth_covered()) reagents.reaction(C, INGEST) reagents.trans_to(C, reagents.total_volume) C.visible_message("[user] has smothered \the [C] with \the [src]!", "[user] has smothered you with \the [src]!", "You hear some struggling and muffled cries of surprise.") - log_game("[key_name(user)] smothered [key_name(A)] with a damp rag containing [reagentlist]") - log_attack("[key_name(user)] smothered [key_name(A)] with a damp rag containing [reagentlist]") + log_combat(user, C, "smothered", log_object) else reagents.reaction(C, TOUCH) reagents.clear_reagents() - log_game("[key_name(user)] touched [key_name(A)] with a damp rag containing [reagentlist]") - log_attack("[key_name(user)] touched [key_name(A)] with a damp rag containing [reagentlist]") C.visible_message("[user] has touched \the [C] with \the [src].") + log_combat(user, C, "touched", log_object) else if(istype(A) && src in user) user.visible_message("[user] starts to wipe down [A] with [src]!", "You start to wipe down [A] with [src]...") diff --git a/code/modules/error_handler/error_handler.dm b/code/modules/error_handler/error_handler.dm index e9f5ecb988b..280cf87f6e9 100644 --- a/code/modules/error_handler/error_handler.dm +++ b/code/modules/error_handler/error_handler.dm @@ -7,11 +7,11 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0) /world/Error(exception/E, datum/e_src) GLOB.total_runtimes++ - + if(!istype(E)) //Something threw an unusual exception log_world("uncaught runtime error: [E]") return ..() - + //this is snowflake because of a byond bug (ID:2306577), do not attempt to call non-builtin procs in this if if(copytext(E.name,1,32) == "Maximum recursion level reached") //log to world while intentionally triggering the byond bug. @@ -86,8 +86,8 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0) var/list/usrinfo = null var/locinfo if(istype(usr)) - usrinfo = list(" usr: [datum_info_line(usr)]") - locinfo = atom_loc_line(usr) + usrinfo = list(" usr: [key_name(usr)]") + locinfo = loc_name(usr) if(locinfo) usrinfo += " usr.loc: [locinfo]" // The proceeding mess will almost definitely break if error messages are ever changed diff --git a/code/modules/events/wizard/departmentrevolt.dm b/code/modules/events/wizard/departmentrevolt.dm index 9a8c70c5042..f37b7470fb3 100644 --- a/code/modules/events/wizard/departmentrevolt.dm +++ b/code/modules/events/wizard/departmentrevolt.dm @@ -46,8 +46,8 @@ if(M.assigned_role == job) citizens += H M.add_antag_datum(/datum/antagonist/separatist,nation) - H.log_message("Was made into a separatist, long live [nation_name]!", INDIVIDUAL_ATTACK_LOG) - + H.log_message("Was made into a separatist, long live [nation_name]!", LOG_ATTACK, color="red") + if(citizens.len) var/message for(var/job in jobs_to_revolt) diff --git a/code/modules/events/wizard/greentext.dm b/code/modules/events/wizard/greentext.dm index 3dee7404360..356e83757fa 100644 --- a/code/modules/events/wizard/greentext.dm +++ b/code/modules/events/wizard/greentext.dm @@ -63,11 +63,11 @@ /obj/item/greentext/proc/check_winner() if(!new_holder) return - + if(is_centcom_level(new_holder.z))//you're winner! to_chat(new_holder, "At last it feels like victory is assured!") new_holder.mind.add_antag_datum(/datum/antagonist/greentext) - new_holder.log_message("Won with greentext!!!", INDIVIDUAL_ATTACK_LOG) + new_holder.log_message("won with greentext!!!", LOG_ATTACK, color="green") 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 c2bf0d52547..1c8ef95baae 100644 --- a/code/modules/events/wizard/imposter.dm +++ b/code/modules/events/wizard/imposter.dm @@ -36,5 +36,5 @@ SSticker.mode.apprentices += I.mind I.mind.special_role = "imposter" // - I.log_message("Is an imposter!", INDIVIDUAL_ATTACK_LOG) //? + I.log_message("is an imposter!", LOG_ATTACK, color="red") //? SEND_SOUND(I, sound('sound/effects/magic.ogg')) diff --git a/code/modules/food_and_drinks/drinks/drinks.dm b/code/modules/food_and_drinks/drinks/drinks.dm index 38e78d16bc6..9256f5bdd1e 100644 --- a/code/modules/food_and_drinks/drinks/drinks.dm +++ b/code/modules/food_and_drinks/drinks/drinks.dm @@ -46,7 +46,7 @@ if(!reagents || !reagents.total_volume) return // The drink might be empty after the delay, such as by spam-feeding M.visible_message("[user] feeds the contents of [src] to [M].", "[user] feeds the contents of [src] to [M].") - add_logs(user, M, "fed", reagents.log_list()) + log_combat(user, M, "fed", reagents.log_list()) var/fraction = min(gulp_size/reagents.total_volume, 1) checkLiked(fraction, M) diff --git a/code/modules/food_and_drinks/drinks/drinks/bottle.dm b/code/modules/food_and_drinks/drinks/drinks/bottle.dm index f35bd6f9379..3bc7443a9bc 100644 --- a/code/modules/food_and_drinks/drinks/drinks/bottle.dm +++ b/code/modules/food_and_drinks/drinks/drinks/bottle.dm @@ -105,7 +105,7 @@ "[target] hits [target.p_them()]self with a bottle of [src.name][head_attack_message]!") //Attack logs - add_logs(user, target, "attacked", src) + log_combat(user, target, "attacked", src) //The reagents in the bottle splash all over the target, thanks for the idea Nodrak SplashReagents(target) diff --git a/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm b/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm index 927cd3d36c0..c24b22ce712 100644 --- a/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm +++ b/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm @@ -108,7 +108,7 @@ if(user.a_intent == INTENT_HARM && ismob(target) && target.reagents && reagents.total_volume) target.visible_message("[user] splashes the contents of [src] onto [target]!", \ "[user] splashes the contents of [src] onto [target]!") - add_logs(user, target, "splashed", src) + log_combat(user, target, "splashed", src) reagents.reaction(target, TOUCH) reagents.clear_reagents() return diff --git a/code/modules/food_and_drinks/food/condiment.dm b/code/modules/food_and_drinks/food/condiment.dm index dff175e9e71..d6d744f4dbb 100644 --- a/code/modules/food_and_drinks/food/condiment.dm +++ b/code/modules/food_and_drinks/food/condiment.dm @@ -49,7 +49,7 @@ if(!reagents || !reagents.total_volume) return // The condiment might be empty after the delay. user.visible_message("[user] feeds [M] from [src].") - add_logs(user, M, "fed", reagents.log_list()) + log_combat(user, M, "fed", reagents.log_list()) var/fraction = min(10/reagents.total_volume, 1) reagents.reaction(M, INGEST, fraction) diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm index c9d0189719e..de3a4e730cd 100644 --- a/code/modules/food_and_drinks/food/snacks.dm +++ b/code/modules/food_and_drinks/food/snacks.dm @@ -96,7 +96,7 @@ if(!do_mob(user, M)) return - add_logs(user, M, "fed", reagents.log_list()) + log_combat(user, M, "fed", reagents.log_list()) M.visible_message("[user] forces [M] to eat [src].", \ "[user] forces [M] to eat [src].") diff --git a/code/modules/food_and_drinks/food/snacks_meat.dm b/code/modules/food_and_drinks/food/snacks_meat.dm index bd1dbc4f8e3..c77242e69d3 100644 --- a/code/modules/food_and_drinks/food/snacks_meat.dm +++ b/code/modules/food_and_drinks/food/snacks_meat.dm @@ -189,7 +189,7 @@ var/mob/living/carbon/monkey/bananas = new(drop_location(), TRUE, spammer) if (!QDELETED(bananas)) visible_message("[src] expands!") - bananas.log_message("Spawned via [src] at [AREACOORD(src)], Last attached mob: [key_name(spammer)].", INDIVIDUAL_ATTACK_LOG) + bananas.log_message("Spawned via [src] at [AREACOORD(src)], Last attached mob: [key_name(spammer)].", LOG_ATTACK) else if (!spammer) // Visible message in case there are no fingerprints visible_message("[src] fails to expand!") qdel(src) diff --git a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm index 870fa3e9381..d8d4e843dc3 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm @@ -98,7 +98,7 @@ /obj/machinery/gibber/attackby(obj/item/P, mob/user, params) if(default_deconstruction_screwdriver(user, "grinder_open", "grinder", P)) return - + else if(default_pry_open(P)) return @@ -184,7 +184,7 @@ if(typeofskin) skin = new typeofskin - add_logs(user, occupant, "gibbed") + log_combat(user, occupant, "gibbed") mob_occupant.death(1) mob_occupant.ghostize() qdel(src.occupant) diff --git a/code/modules/hydroponics/grown/nettle.dm b/code/modules/hydroponics/grown/nettle.dm index 962fa86d4d1..cf238024f2a 100644 --- a/code/modules/hydroponics/grown/nettle.dm +++ b/code/modules/hydroponics/grown/nettle.dm @@ -107,7 +107,7 @@ return if(isliving(M)) to_chat(M, "You are stunned by the powerful acid of the Deathnettle!") - add_logs(user, M, "attacked", src) + log_combat(user, M, "attacked", src) M.adjust_blurriness(force/7) if(prob(20)) diff --git a/code/modules/integrated_electronics/subtypes/reagents.dm b/code/modules/integrated_electronics/subtypes/reagents.dm index bae45729f3e..7943ffbbe7b 100644 --- a/code/modules/integrated_electronics/subtypes/reagents.dm +++ b/code/modules/integrated_electronics/subtypes/reagents.dm @@ -133,7 +133,7 @@ //Always log attemped injections for admins var/contained = reagents.log_list() - add_logs(src, L, "attempted to inject", addition="which had [contained]") + log_combat(src, L, "attempted to inject", addition="which had [contained]") L.visible_message("[acting_object] is trying to inject [L]!", \ "[acting_object] is trying to inject you!") busy = TRUE @@ -141,7 +141,7 @@ var/fraction = min(transfer_amount/reagents.total_volume, 1) reagents.reaction(L, INJECT, fraction) reagents.trans_to(L, transfer_amount) - add_logs(src, L, "injected", addition="which had [contained]") + log_combat(src, L, "injected", addition="which had [contained]") L.visible_message("[acting_object] injects [L] with its needle!", \ "[acting_object] injects you with its needle!") else diff --git a/code/modules/mining/equipment/resonator.dm b/code/modules/mining/equipment/resonator.dm index 57efc0f7f5e..e23c3deb58e 100644 --- a/code/modules/mining/equipment/resonator.dm +++ b/code/modules/mining/equipment/resonator.dm @@ -100,7 +100,7 @@ playsound(T,'sound/weapons/resonator_blast.ogg',50,1) for(var/mob/living/L in T) if(creator) - add_logs(creator, L, "used a resonator field on", "resonator") + log_combat(creator, L, "used a resonator field on", "resonator") to_chat(L, "[src] ruptured with you in it!") L.apply_damage(resonance_damage, BRUTE) qdel(src) diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index 0113c55ed13..66e457c079a 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -975,7 +975,7 @@ to_chat(user, "You shatter the bottle!") playsound(user.loc, 'sound/effects/glassbr1.ogg', 100, 1) message_admins("[ADMIN_LOOKUPFLW(user)] has activated a bottle of mayhem!") - add_logs(user, null, "activated a bottle of mayhem", src) + log_combat(user, null, "activated a bottle of mayhem", src) qdel(src) /obj/item/blood_contract @@ -1019,7 +1019,7 @@ var/datum/objective/survive/survive = new survive.owner = L.mind L.mind.objectives += survive - add_logs(user, L, "took out a blood contract on", src) + log_combat(user, L, "took out a blood contract on", src) to_chat(L, "You've been marked for death! Don't let the demons get you! KILL THEM ALL!") L.add_atom_colour("#FF0000", ADMIN_COLOUR_PRIORITY) var/obj/effect/mine/pickup/bloodbath/B = new(L) @@ -1105,7 +1105,7 @@ timer = world.time + CLICK_CD_MELEE //by default, melee attacks only cause melee blasts, and have an accordingly short cooldown if(proximity_flag) INVOKE_ASYNC(src, .proc/aoe_burst, T, user) - add_logs(user, target, "fired 3x3 blast at", src) + log_combat(user, target, "fired 3x3 blast at", src) else if(ismineralturf(target) && get_dist(user, target) < 6) //target is minerals, we can hit it(even if we can't see it) INVOKE_ASYNC(src, .proc/cardinal_blasts, T, user) @@ -1117,10 +1117,10 @@ var/obj/effect/temp_visual/hierophant/chaser/C = new(get_turf(user), user, target, chaser_speed, friendly_fire_check) C.damage = 30 C.monster_damage_boost = FALSE - add_logs(user, target, "fired a chaser at", src) + log_combat(user, target, "fired a chaser at", src) else INVOKE_ASYNC(src, .proc/cardinal_blasts, T, user) //otherwise, just do cardinal blast - add_logs(user, target, "fired cardinal blast at", src) + log_combat(user, target, "fired cardinal blast at", src) else to_chat(user, "That target is out of range!" ) timer = world.time @@ -1232,7 +1232,7 @@ INVOKE_ASYNC(src, .proc/prepare_icon_update) beacon.icon_state = "hierophant_tele_off" return - add_logs(user, beacon, "teleported self from [AREACOORD(source)] to") + user.log_message("teleported self from [AREACOORD(source)] to [beacon]") new /obj/effect/temp_visual/hierophant/telegraph/teleport(T, user) new /obj/effect/temp_visual/hierophant/telegraph/teleport(source, user) for(var/t in RANGE_TURFS(1, T)) @@ -1279,7 +1279,7 @@ return M.visible_message("[M] fades in!") if(user != M) - add_logs(user, M, "teleported", null, "from [AREACOORD(source)]") + log_combat(user, M, "teleported", null, "from [AREACOORD(source)]") /obj/item/hierophant_club/proc/cardinal_blasts(turf/T, mob/living/user) //fire cardinal cross blasts with a delay if(!T) diff --git a/code/modules/mob/dead/observer/say.dm b/code/modules/mob/dead/observer/say.dm index 7e8a493f7a7..cd2be5efd46 100644 --- a/code/modules/mob/dead/observer/say.dm +++ b/code/modules/mob/dead/observer/say.dm @@ -15,7 +15,7 @@ client.dsay(message) return - log_talk(src,"Ghost/[src.key] : [message]", LOGSAY) + src.log_talk(message, LOG_SAY, tag="ghost") if(check_emote(message)) return diff --git a/code/modules/mob/living/carbon/alien/alien_defense.dm b/code/modules/mob/living/carbon/alien/alien_defense.dm index b55abb11f0f..6d59bc052a5 100644 --- a/code/modules/mob/living/carbon/alien/alien_defense.dm +++ b/code/modules/mob/living/carbon/alien/alien_defense.dm @@ -38,7 +38,7 @@ In all, this is a lot like the monkey code. /N visible_message("[M.name] bites [src]!", \ "[M.name] bites [src]!", null, COMBAT_MESSAGE_RANGE) adjustBruteLoss(1) - add_logs(M, src, "attacked") + log_combat(M, src, "attacked") updatehealth() else to_chat(M, "[name] is too injured for that.") @@ -97,7 +97,7 @@ In all, this is a lot like the monkey code. /N if(M.is_adult) damage = rand(10, 40) adjustBruteLoss(damage) - add_logs(M, src, "attacked") + log_combat(M, src, "attacked") updatehealth() /mob/living/carbon/alien/ex_act(severity, target, origin) diff --git a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm index 631a640d586..323bd408cf5 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm @@ -97,7 +97,7 @@ Doesn't work on other aliens/AI.*/ return 0 var/msg = sanitize(input("Message:", "Alien Whisper") as text|null) if(msg) - log_talk(user,"AlienWhisper: [key_name(user)]->[key_name(M)] : [msg]",LOGSAY) + log_directed_talk(user, M, msg, LOG_SAY, tag="alien whisper") to_chat(M, "You hear a strange, alien voice in your head...[msg]") to_chat(user, "You said: \"[msg]\" to [M]") for(var/ded in GLOB.dead_mob_list) diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm index 6c42e687a9c..b3839a6033f 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm @@ -35,7 +35,7 @@ "[M] has knocked [src] down!") var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected)) apply_damage(damage, BRUTE, affecting) - add_logs(M, src, "attacked") + log_combat(M, src, "attacked") else playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) visible_message("[M] has attempted to punch [src]!", \ @@ -46,7 +46,7 @@ if (prob(5)) Unconscious(40) playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - add_logs(M, src, "pushed") + log_combat(M, src, "pushed") visible_message("[M] has pushed down [src]!", \ "[M] has pushed down [src]!") else diff --git a/code/modules/mob/living/carbon/alien/larva/larva_defense.dm b/code/modules/mob/living/carbon/alien/larva/larva_defense.dm index c3cee567a24..69c1be707d8 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva_defense.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva_defense.dm @@ -5,7 +5,7 @@ var/damage = rand(1, 9) if (prob(90)) playsound(loc, "punch", 25, 1, -1) - add_logs(M, src, "attacked") + log_combat(M, src, "attacked") visible_message("[M] has kicked [src]!", \ "[M] has kicked [src]!", null, COMBAT_MESSAGE_RANGE) if ((stat != DEAD) && (damage > 4.9)) diff --git a/code/modules/mob/living/carbon/alien/say.dm b/code/modules/mob/living/carbon/alien/say.dm index 1d35a2c1342..b921aea67e0 100644 --- a/code/modules/mob/living/carbon/alien/say.dm +++ b/code/modules/mob/living/carbon/alien/say.dm @@ -1,5 +1,5 @@ /mob/living/proc/alien_talk(message, shown_name = real_name) - log_talk(src,"[key_name(src)] : [message]",LOGSAY) + src.log_talk(message, LOG_SAY) message = trim(message) if(!message) return diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index e25f68a5eaa..f85053fa9bd 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -162,7 +162,7 @@ var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors var/turf/end_T = get_turf(target) if(start_T && end_T) - add_logs(src, throwable_mob, "thrown", addition="grab from tile in [AREACOORD(start_T)] towards tile at [AREACOORD(end_T)]") + log_combat(src, throwable_mob, "thrown", addition="grab from tile in [AREACOORD(start_T)] towards tile at [AREACOORD(end_T)]") else if(!(I.item_flags & (NODROP | ABSTRACT))) thrown_thing = I @@ -174,7 +174,7 @@ if(thrown_thing) visible_message("[src] has thrown [thrown_thing].") - add_logs(src, thrown_thing, "thrown") + src.log_message("has thrown [thrown_thing]", LOG_ATTACK) newtonian_move(get_dir(target, src)) thrown_thing.throw_at(target, thrown_thing.throw_range, thrown_thing.throw_speed, src) @@ -826,7 +826,7 @@ "[src] devours you!") C.forceMove(src) stomach_contents.Add(C) - add_logs(src, C, "devoured") + log_combat(src, C, "devoured") /mob/living/carbon/proc/create_bodyparts() var/l_arm_index_next = -1 diff --git a/code/modules/mob/living/carbon/carbon_movement.dm b/code/modules/mob/living/carbon/carbon_movement.dm index ca664ebb1e4..f4e39e16e0e 100644 --- a/code/modules/mob/living/carbon/carbon_movement.dm +++ b/code/modules/mob/living/carbon/carbon_movement.dm @@ -14,7 +14,7 @@ if(movement_type & FLYING) return 0 if(!(lube&SLIDE_ICE)) - add_logs(src, (O ? O : get_turf(src)), "slipped on the", null, ((lube & SLIDE) ? "(LUBE)" : null)) + log_combat(src, (O ? O : get_turf(src)), "slipped on the", null, ((lube & SLIDE) ? "(LUBE)" : null)) return loc.handle_slip(src, knockdown_amount, O, lube) /mob/living/carbon/Process_Spacemove(movement_dir = 0) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index adae11bf690..78950d3be26 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -662,7 +662,7 @@ src.visible_message("[src] performs CPR on [C.name]!", "You perform CPR on [C.name].") SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "perform_cpr", /datum/mood_event/perform_cpr) C.cpr_time = world.time - add_logs(src, C, "CPRed") + log_combat(src, C, "CPRed") if(they_breathe && they_lung) var/suff = min(C.getOxyLoss(), 7) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index a784009aa33..cb37723c47b 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -220,7 +220,7 @@ else if(!M.client || prob(5)) // only natural monkeys get to stun reliably, (they only do it occasionaly) playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1) Knockdown(100) - add_logs(M, src, "tackled") + log_combat(M, src, "tackled") visible_message("[M] has tackled down [src]!", \ "[M] has tackled down [src]!") @@ -259,7 +259,7 @@ playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1) visible_message("[M] has slashed at [src]!", \ "[M] has slashed at [src]!") - add_logs(M, src, "attacked") + log_combat(M, src, "attacked") if(!dismembering_strike(M, M.zone_selected)) //Dismemberment successful return 1 apply_damage(damage, BRUTE, affecting, armor_block) @@ -273,7 +273,7 @@ else playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1) Knockdown(100) - add_logs(M, src, "tackled") + log_combat(M, src, "tackled") visible_message("[M] has tackled down [src]!", \ "[M] has tackled down [src]!") @@ -357,7 +357,7 @@ visible_message("[M.name] has hit [src]!", \ "[M.name] has hit [src]!", null, COMBAT_MESSAGE_RANGE) - add_logs(M.occupant, src, "attacked", M, "(INTENT: [uppertext(M.occupant.a_intent)]) (DAMTYPE: [uppertext(M.damtype)])") + log_combat(M.occupant, src, "attacked", M, "(INTENT: [uppertext(M.occupant.a_intent)]) (DAMTYPE: [uppertext(M.damtype)])") else ..() diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index b5eca50ca65..8b76d4675a3 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1148,7 +1148,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(target.health >= 0 && !(target.has_trait(TRAIT_FAKEDEATH))) target.help_shake_act(user) if(target != user) - add_logs(user, target, "shaked") + log_combat(user, target, "shaked") return 1 else var/we_breathe = !user.has_trait(TRAIT_NOBREATH) @@ -1221,7 +1221,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(user.limb_destroyer) target.dismembering_strike(user, affecting.body_zone) target.apply_damage(damage, BRUTE, affecting, armor_block) - add_logs(user, target, "punched") + log_combat(user, target, "punched") if((target.stat != DEAD) && damage >= user.dna.species.punchstunthreshold) target.visible_message("[user] has knocked [target] down!", \ "[user] has knocked [target] down!", null, COMBAT_MESSAGE_RANGE) @@ -1251,7 +1251,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) "[user] has pushed [target]!", null, COMBAT_MESSAGE_RANGE) target.apply_effect(40, EFFECT_KNOCKDOWN, target.run_armor_check(affecting, "melee", "Your armor prevents your fall!", "Your armor softens your fall!")) target.forcesay(GLOB.hit_appends) - add_logs(user, target, "pushed over") + log_combat(user, target, "pushed over") return if(randn <= 60) @@ -1267,14 +1267,14 @@ GLOBAL_LIST_EMPTY(roundstart_races) else I = null playsound(target, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - add_logs(user, target, "disarmed", "[I ? " removing \the [I]" : ""]") + log_combat(user, target, "disarmed", "[I ? " removing \the [I]" : ""]") return playsound(target, 'sound/weapons/punchmiss.ogg', 25, 1, -1) target.visible_message("[user] attempted to disarm [target]!", \ "[user] attemped to disarm [target]!", null, COMBAT_MESSAGE_RANGE) - add_logs(user, target, "attempted to disarm") + log_combat(user, target, "attempted to disarm") /datum/species/proc/spec_hitby(atom/movable/AM, mob/living/carbon/human/H) @@ -1291,7 +1291,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(M.mind) attacker_style = M.mind.martial_art if((M != H) && M.a_intent != INTENT_HELP && H.check_shields(M, 0, M.name, attack_type = UNARMED_ATTACK)) - add_logs(M, H, "attempted to touch") + log_combat(M, H, "attempted to touch") H.visible_message("[M] attempted to touch [H]!") return 0 switch(M.a_intent) diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index a94a5dceb28..432b7bde7dc 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -640,7 +640,7 @@ if(message) var/msg = "\[[species.slimelink_owner.real_name]'s Slime Link\] [H]: [message]" - log_talk(H,"SlimeLink: [key_name(H)] : [msg]",LOGSAY) + log_directed_talk(H, species.slimelink_owner, msg, LOG_SAY, "slime link") for(var/X in species.linked_mobs) var/mob/living/M = X if(QDELETED(M) || M.stat == DEAD) @@ -677,7 +677,7 @@ var/msg = sanitize(input("Message:", "Telepathy") as text|null) if(msg) - log_talk(H,"SlimeTelepathy: [key_name(H)]->[key_name(M)] : [msg]",LOGSAY) + log_directed_talk(H, M, msg, LOG_SAY, "slime telepathy") to_chat(M, "You hear an alien voice in your head... [msg]") to_chat(H, "You telepathically said: \"[msg]\" to [M]") for(var/dead in GLOB.dead_mob_list) diff --git a/code/modules/mob/living/carbon/monkey/monkey_defense.dm b/code/modules/mob/living/carbon/monkey/monkey_defense.dm index f6b8e19468b..df90dd56fd7 100644 --- a/code/modules/mob/living/carbon/monkey/monkey_defense.dm +++ b/code/modules/mob/living/carbon/monkey/monkey_defense.dm @@ -54,7 +54,7 @@ if(!affecting) affecting = get_bodypart(BODY_ZONE_CHEST) apply_damage(damage, BRUTE, affecting) - add_logs(M, src, "attacked") + log_combat(M, src, "attacked") else playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) @@ -66,7 +66,7 @@ if (prob(25)) Knockdown(40) playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - add_logs(M, src, "pushed") + log_combat(M, src, "pushed") visible_message("[M] has pushed down [src]!", \ "[M] has pushed down [src]!", null, COMBAT_MESSAGE_RANGE) else if(dropItemToGround(get_active_held_item())) @@ -90,7 +90,7 @@ "[M] has slashed [name]!", null, COMBAT_MESSAGE_RANGE) var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected)) - add_logs(M, src, "attacked") + log_combat(M, src, "attacked") if(!affecting) affecting = get_bodypart(BODY_ZONE_CHEST) if(!dismembering_strike(M, affecting.body_zone)) //Dismemberment successful @@ -115,7 +115,7 @@ visible_message("[M] has disarmed [name]!", "[M] has disarmed [name]!", null, COMBAT_MESSAGE_RANGE) else I = null - add_logs(M, src, "disarmed", "[I ? " removing \the [I]" : ""]") + log_combat(M, src, "disarmed", "[I ? " removing \the [I]" : ""]") updatehealth() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 0d08fdfb1a2..552a347051d 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -219,7 +219,7 @@ if(AM.pulledby) if(!supress_message) visible_message("[src] has pulled [AM] from [AM.pulledby]'s grip.") - add_logs(AM, AM.pulledby, "pulled from", src) + log_combat(AM, AM.pulledby, "pulled from", src) AM.pulledby.stop_pulling() //an object can't be pulled by two mobs at once. pulling = AM @@ -231,7 +231,7 @@ if(ismob(AM)) var/mob/M = AM - add_logs(src, M, "grabbed", addition="passive grab") + log_combat(src, M, "grabbed", addition="passive grab") if(!supress_message) visible_message("[src] has grabbed [M] passively!") if(!iscarbon(src)) @@ -285,7 +285,7 @@ /mob/living/verb/succumb(whispered as null) set hidden = TRUE if (InCritical()) - log_message("Has [whispered ? "whispered his final words" : "succumbed to death"] while in [InFullCritical() ? "hard":"soft"] critical with [round(health, 0.1)] points of health!", INDIVIDUAL_ATTACK_LOG) + log_message("Has [whispered ? "whispered his final words" : "succumbed to death"] while in [InFullCritical() ? "hard":"soft"] critical with [round(health, 0.1)] points of health!", LOG_ATTACK) adjustOxyLoss(health - HEALTH_THRESHOLD_DEAD) updatehealth() if(!whispered) @@ -578,8 +578,8 @@ //resisting grabs (as if it helps anyone...) if(!restrained(ignore_grab = 1) && pulledby) visible_message("[src] resists against [pulledby]'s grip!") + log_combat(src, pulledby, "resisted grab") resist_grab() - add_logs(pulledby, src, "resisted grab") return //unbuckling yourself @@ -606,7 +606,7 @@ if(pulledby.grab_state) if(prob(30/pulledby.grab_state)) visible_message("[src] has broken free of [pulledby]'s grip!") - add_logs(pulledby, src, "broke grab") + log_combat(pulledby, src, "broke grab") pulledby.stop_pulling() return 0 if(moving_resist && client) //we resisted by trying to move @@ -673,10 +673,10 @@ var/list/L = where if(what == who.get_item_for_held_index(L[2])) if(who.dropItemToGround(what)) - add_logs(src, who, "stripped [what] off") + log_combat(src, who, "stripped [what] off") if(what == who.get_item_by_slot(where)) if(who.dropItemToGround(what)) - add_logs(src, who, "stripped [what] off") + log_combat(src, who, "stripped [what] off") // The src mob is trying to place an item on someone // Override if a certain mob should be behave differently when placing items (can't, for example) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 0d4258491d3..8075917dfdd 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -88,7 +88,7 @@ var/armor = run_armor_check(zone, "melee", "Your armor has protected your [parse_zone(zone)].", "Your armor has softened hit to your [parse_zone(zone)].",I.armour_penetration) apply_damage(I.throwforce, dtype, zone, armor) if(I.thrownby) - add_logs(I.thrownby, src, "threw and hit", I) + log_combat(I.thrownby, src, "threw and hit", I) else return 1 else @@ -116,10 +116,10 @@ updatehealth() visible_message("[M.name] has hit [src]!", \ "[M.name] has hit [src]!", null, COMBAT_MESSAGE_RANGE) - add_logs(M.occupant, src, "attacked", M, "(INTENT: [uppertext(M.occupant.a_intent)]) (DAMTYPE: [uppertext(M.damtype)])") + log_combat(M.occupant, src, "attacked", M, "(INTENT: [uppertext(M.occupant.a_intent)]) (DAMTYPE: [uppertext(M.damtype)])") else step_away(src,M) - add_logs(M.occupant, src, "pushed", M) + log_combat(M.occupant, src, "pushed", M) visible_message("[M] pushes [src] out of the way.", null, null, 5) /mob/living/fire_act() @@ -156,9 +156,9 @@ "[user] starts to tighten [user.p_their()] grip on you!") switch(user.grab_state) if(GRAB_AGGRESSIVE) - add_logs(user, src, "attempted to neck grab", addition="neck grab") + log_combat(user, src, "attempted to neck grab", addition="neck grab") if(GRAB_NECK) - add_logs(user, src, "attempted to strangle", addition="kill grab") + log_combat(user, src, "attempted to strangle", addition="kill grab") if(!do_mob(user, src, grab_upgrade_time)) return 0 if(!user.pulling || user.pulling != src || user.grab_state != old_grab_state || user.a_intent != INTENT_GRAB) @@ -166,20 +166,20 @@ user.grab_state++ switch(user.grab_state) if(GRAB_AGGRESSIVE) - add_logs(user, src, "grabbed", addition="aggressive grab") + log_combat(user, src, "grabbed", addition="aggressive grab") visible_message("[user] has grabbed [src] aggressively!", \ "[user] has grabbed [src] aggressively!") drop_all_held_items() stop_pulling() if(GRAB_NECK) - add_logs(user, src, "grabbed", addition="neck grab") + log_combat(user, src, "grabbed", addition="neck grab") visible_message("[user] has grabbed [src] by the neck!",\ "[user] has grabbed you by the neck!") update_canmove() //we fall down if(!buckled && !density) Move(user.loc) if(GRAB_KILL) - add_logs(user, src, "strangled", addition="kill grab") + log_combat(user, src, "strangled", addition="kill grab") visible_message("[user] is strangling [src]!", \ "[user] is strangling you!") update_canmove() //we fall down @@ -203,7 +203,7 @@ return FALSE if (stat != DEAD) - add_logs(M, src, "attacked") + log_combat(M, src, "attacked") M.do_attack_animation(src) visible_message("The [M.name] glomps [src]!", \ "The [M.name] glomps [src]!", null, COMBAT_MESSAGE_RANGE) @@ -224,7 +224,7 @@ M.do_attack_animation(src) visible_message("\The [M] [M.attacktext] [src]!", \ "\The [M] [M.attacktext] [src]!", null, COMBAT_MESSAGE_RANGE) - add_logs(M, src, "attacked") + log_combat(M, src, "attacked") return TRUE @@ -243,7 +243,7 @@ return FALSE M.do_attack_animation(src, ATTACK_EFFECT_BITE) if (prob(75)) - add_logs(M, src, "attacked") + log_combat(M, src, "attacked") playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) visible_message("[M.name] bites [src]!", \ "[M.name] bites [src]!", null, COMBAT_MESSAGE_RANGE) @@ -266,7 +266,7 @@ L.do_attack_animation(src) if(prob(90)) - add_logs(L, src, "attacked") + log_combat(L, src, "attacked") visible_message("[L.name] bites [src]!", \ "[L.name] bites [src]!", null, COMBAT_MESSAGE_RANGE) playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 6db29381cd0..817e1b3e46b 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -163,7 +163,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list( if((InCritical() && !fullcrit) || message_mode == MODE_WHISPER) message_range = 1 message_mode = MODE_WHISPER - log_talk(src,"[key_name(src)] : [message]",LOGWHISPER) + src.log_talk(message, LOG_WHISPER) if(fullcrit) var/health_diff = round(-HEALTH_THRESHOLD_DEAD + health) // If we cut our message short, abruptly end it with a-.. @@ -174,7 +174,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list( message_mode = MODE_WHISPER_CRIT succumbed = TRUE else - log_talk(src,"[name]/[key] : [message]",LOGSAY) + src.log_talk(message, LOG_SAY) message = treat_message(message) if(!message) @@ -186,9 +186,6 @@ GLOBAL_LIST_INIT(department_radio_keys, list( var/datum/language/L = GLOB.language_datum_instances[language] spans |= L.spans - //Log what we've said with an associated timestamp, using the list's len for safety/to prevent overwriting messages - log_message(message, INDIVIDUAL_SAY_LOG) - var/radio_return = radio(message, message_mode, spans, language) if(radio_return & ITALICS) spans |= SPAN_ITALICS diff --git a/code/modules/mob/living/silicon/ai/say.dm b/code/modules/mob/living/silicon/ai/say.dm index c5820eb8c17..ae361ecd0f9 100644 --- a/code/modules/mob/living/silicon/ai/say.dm +++ b/code/modules/mob/living/silicon/ai/say.dm @@ -48,7 +48,7 @@ padloc = AREACOORD(padturf) else padloc = "(UNKNOWN)" - log_talk(src,"HOLOPAD in [padloc]: [key_name(src)] : [message]", LOGSAY) + src.log_talk(message, LOG_SAY, tag="HOLOPAD in [padloc]") send_speech(message, 7, T, "robot", get_spans(), language) to_chat(src, "Holopad transmitted, [real_name] \"[message]\"") else diff --git a/code/modules/mob/living/silicon/robot/robot_defense.dm b/code/modules/mob/living/silicon/robot/robot_defense.dm index 4907e467515..c90c719e8a8 100644 --- a/code/modules/mob/living/silicon/robot/robot_defense.dm +++ b/code/modules/mob/living/silicon/robot/robot_defense.dm @@ -22,11 +22,11 @@ uneq_active() visible_message("[M] disarmed [src]!", \ "[M] has disabled [src]'s active module!", null, COMBAT_MESSAGE_RANGE) - add_logs(M, src, "disarmed", "[I ? " removing \the [I]" : ""]") + log_combat(M, src, "disarmed", "[I ? " removing \the [I]" : ""]") else Stun(40) step(src,get_dir(M,src)) - add_logs(M, src, "pushed") + log_combat(M, src, "pushed") visible_message("[M] has forced back [src]!", \ "[M] has forced back [src]!", null, COMBAT_MESSAGE_RANGE) playsound(loc, 'sound/weapons/pierce.ogg', 50, 1, -1) diff --git a/code/modules/mob/living/silicon/say.dm b/code/modules/mob/living/silicon/say.dm index 785d55e5f40..aca35762def 100644 --- a/code/modules/mob/living/silicon/say.dm +++ b/code/modules/mob/living/silicon/say.dm @@ -3,8 +3,7 @@ return ..() | SPAN_ROBOT /mob/living/proc/robot_talk(message) - log_talk(src,"[key_name(src)] : [message]",LOGSAY) - log_message(message, INDIVIDUAL_SAY_LOG) + log_talk(message, LOG_SAY) var/desig = "Default Cyborg" //ezmode for taters if(issilicon(src)) var/mob/living/silicon/S = src diff --git a/code/modules/mob/living/silicon/silicon_defense.dm b/code/modules/mob/living/silicon/silicon_defense.dm index 647039e123e..82e4d2455d5 100644 --- a/code/modules/mob/living/silicon/silicon_defense.dm +++ b/code/modules/mob/living/silicon/silicon_defense.dm @@ -9,13 +9,13 @@ if(..()) //if harm or disarm intent var/damage = 20 if (prob(90)) - add_logs(M, src, "attacked") + log_combat(M, src, "attacked") playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1) visible_message("[M] has slashed at [src]!", \ "[M] has slashed at [src]!") if(prob(8)) flash_act(affect_silicon = 1) - add_logs(M, src, "attacked") + log_combat(M, src, "attacked") adjustBruteLoss(damage) updatehealth() else diff --git a/code/modules/mob/living/simple_animal/animal_defense.dm b/code/modules/mob/living/simple_animal/animal_defense.dm index 2d9e0a17929..a00373c7d78 100644 --- a/code/modules/mob/living/simple_animal/animal_defense.dm +++ b/code/modules/mob/living/simple_animal/animal_defense.dm @@ -20,7 +20,7 @@ "[M] [response_harm] [src]!", null, COMBAT_MESSAGE_RANGE) playsound(loc, attacked_sound, 25, 1, -1) attack_threshold_check(harm_intent_damage) - add_logs(M, src, "attacked") + log_combat(M, src, "attacked") updatehealth() return TRUE @@ -54,14 +54,14 @@ playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1) visible_message("[M] [response_disarm] [name]!", \ "[M] [response_disarm] [name]!", null, COMBAT_MESSAGE_RANGE) - add_logs(M, src, "disarmed") + log_combat(M, src, "disarmed") else var/damage = rand(15, 30) visible_message("[M] has slashed at [src]!", \ "[M] has slashed at [src]!", null, COMBAT_MESSAGE_RANGE) playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1) attack_threshold_check(damage) - add_logs(M, src, "attacked") + log_combat(M, src, "attacked") return 1 /mob/living/simple_animal/attack_larva(mob/living/carbon/alien/larva/L) diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index be66732dbce..d2cfdb88e39 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -196,7 +196,7 @@ bot_reset() turn_on() //The bot automatically turns on when emagged, unless recently hit with EMP. to_chat(src, "(#$*#$^^( OVERRIDE DETECTED") - add_logs(user, src, "emagged") + log_combat(user, src, "emagged") return else //Bot is unlocked, but the maint panel has not been opened with a screwdriver yet. to_chat(user, "You need to open maintenance panel first!") @@ -900,7 +900,7 @@ Pass a positive integer as an argument to override a bot's default speed. name = paicard.pai.name faction = user.faction.Copy() language_holder = paicard.pai.language_holder.copy(src) - add_logs(user, paicard.pai, "uploaded to [bot_name],") + log_combat(user, paicard.pai, "uploaded to [bot_name],") return TRUE else to_chat(user, "[card] is inactive.") @@ -920,9 +920,9 @@ Pass a positive integer as an argument to override a bot's default speed. key = null paicard.forceMove(loc) if(user) - add_logs(user, paicard.pai, "ejected from [src.bot_name],") + log_combat(user, paicard.pai, "ejected from [src.bot_name],") else - add_logs(src, paicard.pai, "ejected") + log_combat(src, paicard.pai, "ejected") if(announce) to_chat(paicard.pai, "You feel your control fade as [paicard] ejects from [bot_name].") paicard = null diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm index 550bc78f383..e092a411dbc 100644 --- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm +++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm @@ -549,7 +549,7 @@ Auto Patrol[]"}, var/mob/living/carbon/human/H = C var/judgement_criteria = judgement_criteria() threat = H.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons)) - add_logs(src,C,"stunned") + log_combat(src,C,"stunned") if(declare_arrests) var/area/location = get_area(src) speak("[arrest_type ? "Detaining" : "Arresting"] level [threat] scumbag [C] in [location].", radio_channel) diff --git a/code/modules/mob/living/simple_animal/bot/honkbot.dm b/code/modules/mob/living/simple_animal/bot/honkbot.dm index 697d0b249d9..bf66a9c9895 100644 --- a/code/modules/mob/living/simple_animal/bot/honkbot.dm +++ b/code/modules/mob/living/simple_animal/bot/honkbot.dm @@ -210,7 +210,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"}, threatlevel = 6 // will never let you go addtimer(CALLBACK(src, .proc/spam_flag_false), cooldowntime) - add_logs(src,C,"honked") + log_combat(src,C,"honked") C.visible_message("[src] has honked [C]!",\ "[src] has honked you!") diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index f300555539d..c45d435253c 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -631,7 +631,7 @@ visible_message("[src] bumps into [L]!") else if(!paicard) - add_logs(src, L, "knocked down") + log_combat(src, L, "knocked down") visible_message("[src] knocks over [L]!") L.Knockdown(160) return ..() @@ -639,7 +639,7 @@ // called from mob/living/carbon/human/Crossed() // when mulebot is in the same loc /mob/living/simple_animal/bot/mulebot/proc/RunOver(mob/living/carbon/human/H) - add_logs(src, H, "run over", null, "(DAMTYPE: [uppertext(BRUTE)])") + log_combat(src, H, "run over", null, "(DAMTYPE: [uppertext(BRUTE)])") H.visible_message("[src] drives over [H]!", \ "[src] drives over you!") playsound(loc, 'sound/effects/splat.ogg', 50, 1) diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index dfcd6ae9910..862435fde7a 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -261,7 +261,7 @@ Auto Patrol: []"}, C.stuttering = 5 threat = C.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons)) - add_logs(src,C,"stunned") + log_combat(src,C,"stunned") if(declare_arrests) var/area/location = get_area(src) speak("[arrest_type ? "Detaining" : "Arresting"] level [threat] scumbag [C] in [location].", radio_channel) diff --git a/code/modules/mob/living/simple_animal/guardian/guardian.dm b/code/modules/mob/living/simple_animal/guardian/guardian.dm index f5584ea1215..701e244f897 100644 --- a/code/modules/mob/living/simple_animal/guardian/guardian.dm +++ b/code/modules/mob/living/simple_animal/guardian/guardian.dm @@ -371,7 +371,7 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians var/link = FOLLOW_LINK(M, src) to_chat(M, "[link] [my_message]") - log_talk(src,"GUARDIAN:[key_name(src)]: [input]",LOGSAY) + src.log_talk(input, LOG_SAY, tag="guardian") /mob/living/proc/guardian_comm() set name = "Communicate" @@ -393,7 +393,7 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians var/link = FOLLOW_LINK(M, src) to_chat(M, "[link] [my_message]") - log_talk(src,"GUARDIAN:[key_name(src)]: [input]",LOGSAY) + src.log_talk(input, LOG_SAY, tag="guardian") //FORCE RECALL/RESET diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index 1df30537152..77c3b7b8213 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -520,7 +520,7 @@ for(var/M in GLOB.dead_mob_list) var/link = FOLLOW_LINK(M, user) to_chat(M, "[link] [my_message]") - log_talk(user, "SPIDERCOMMAND: [key_name(user)] : [message]",LOGSAY) + usr.log_talk(message, LOG_SAY, tag="spider command") /mob/living/simple_animal/hostile/poison/giant_spider/handle_temperature_damage() if(bodytemperature < minbodytemp) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index bc873e68e74..63b18ad82db 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -641,7 +641,7 @@ Difficulty: Hard H.Goto(get_turf(caster), H.move_to_delay, 3) if(monster_damage_boost && (ismegafauna(L) || istype(L, /mob/living/simple_animal/hostile/asteroid))) L.adjustBruteLoss(damage) - add_logs(caster, L, "struck with a [name]") + log_combat(caster, L, "struck with a [name]") for(var/obj/mecha/M in T.contents - hit_things) //also damage mechs. hit_things += M if(M.occupant) diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 9def2a759fb..09662406ab4 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -49,4 +49,4 @@ for(var/datum/action/A in client.player_details.player_actions) A.Grant(src) - log_message("Client [key_name(src)] has taken ownership of mob [src]", INDIVIDUAL_OWNERSHIP_LOG) + log_message("Client [key_name(src)] has taken ownership of mob [src]", LOG_OWNERSHIP) diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index fbd29e86a5e..3e265131261 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -1,5 +1,5 @@ /mob/Logout() - log_message("[key_name(src)] is no longer owning mob [src]", INDIVIDUAL_OWNERSHIP_LOG) + log_message("[key_name(src)] is no longer owning mob [src]", LOG_OWNERSHIP) SStgui.on_logout(src) unset_machine() GLOB.player_list -= src diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 3d55ff43172..035db484bb3 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -796,7 +796,7 @@ //This will update a mob's name, real_name, mind.name, GLOB.data_core records, pda, id and traitor text //Calling this proc without an oldname will only update the mob and skip updating the pda, id and records ~Carn /mob/proc/fully_replace_character_name(oldname,newname) - log_message("[src] name changed from [oldname] to [newname]", INDIVIDUAL_OWNERSHIP_LOG) + log_message("[src] name changed from [oldname] to [newname]", LOG_OWNERSHIP) if(!newname) return 0 real_name = newname diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 0dbb8f59517..24eeac3d21b 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -25,7 +25,7 @@ var/zone_selected = null var/computer_id = null - var/list/logging = list(INDIVIDUAL_ATTACK_LOG, INDIVIDUAL_SAY_LOG, INDIVIDUAL_EMOTE_LOG, INDIVIDUAL_OOC_LOG) + var/list/logging = list() var/obj/machinery/machine = null var/next_move = null diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 2accb65e36d..b7286831f36 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -475,22 +475,37 @@ It's fairly easy to fix if dealing with single letters but not so much with comp var/mob/living/T = pick(nearby_mobs) ClickOn(T) -/mob/proc/log_message(message, message_type) - if(!LAZYLEN(message) || !message_type) +// Logs a message in a mob's individual log, and in the global logs as well if log_globally is true +/mob/log_message(message, message_type, color=null, log_globally = TRUE) + if(!LAZYLEN(message)) + stack_trace("Empty message") return + // Cannot use the list as a map if the key is a number, so we stringify it (thank you BYOND) + var/smessage_type = num2text(message_type) + if(client) - if(!islist(client.player_details.logging[message_type])) - client.player_details.logging[message_type] = list() + if(!islist(client.player_details.logging[smessage_type])) + client.player_details.logging[smessage_type] = list() - if(!islist(logging[message_type])) - logging[message_type] = list() + if(!islist(logging[smessage_type])) + logging[smessage_type] = list() - var/list/timestamped_message = list("[LAZYLEN(logging[message_type]) + 1]\[[time_stamp()]\] [key_name(src)]" = message) + var/colored_message = message + if(color) + if(color[1] == "#") + colored_message = "[message]" + else + colored_message = "[message]" + + var/list/timestamped_message = list("[LAZYLEN(logging[smessage_type]) + 1]\[[time_stamp()]\] [key_name(src)] [loc_name(src)]" = colored_message) + + logging[smessage_type] += timestamped_message - logging[message_type] += timestamped_message if(client) - client.player_details.logging[message_type] += timestamped_message + client.player_details.logging[smessage_type] += timestamped_message + + ..() /mob/proc/can_hear() . = TRUE diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index f9576a3ecb3..35abde0a7ac 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -47,7 +47,7 @@ if(jb) to_chat(src, "You have been banned from deadchat.") return - + if (src.client) @@ -74,9 +74,9 @@ if(key) K = src.key - message = src.say_quote(message, get_spans()) - var/rendered = "DEAD: [name][alt_name] [emoji_parse(message)]" - log_message("DEAD: [message]", INDIVIDUAL_SAY_LOG) + var/spanned = src.say_quote(message, get_spans()) + var/rendered = "DEAD: [name][alt_name] [emoji_parse(spanned)]" + log_talk(message, LOG_SAY, tag="DEAD") deadchat_broadcast(rendered, follow_target = src, speaker_key = K) /mob/proc/check_emote(message) diff --git a/code/modules/modular_computers/file_system/programs/ntnrc_client.dm b/code/modules/modular_computers/file_system/programs/ntnrc_client.dm index 813a3f47e75..29a1df9ebe0 100644 --- a/code/modules/modular_computers/file_system/programs/ntnrc_client.dm +++ b/code/modules/modular_computers/file_system/programs/ntnrc_client.dm @@ -34,7 +34,7 @@ if(!message || !channel) return channel.add_message(message, username) - log_talk(user,"[key_name(user)] as [username] sent to [channel.title]: [message]",LOGCHAT) + user.log_talk(message, LOG_CHAT, tag="as [username] to channel [channel.title]") if("PRG_joinchannel") . = 1 diff --git a/code/modules/paperwork/contract.dm b/code/modules/paperwork/contract.dm index ac3e24030f1..71eb5ba922f 100644 --- a/code/modules/paperwork/contract.dm +++ b/code/modules/paperwork/contract.dm @@ -235,7 +235,7 @@ response = tgalert(target.current, "A devil is offering you another chance at life, at the price of your soul, do you accept?", "Infernal Resurrection", "Yes", "No", "Never for this round", 0, 200) if(response == "Yes") H.revive(1,0) - add_logs(user, H, "infernally revived via contract") + log_combat(user, H, "infernally revived via contract") user.visible_message("With a sudden blaze, [H] stands back up.") H.fakefire() fulfillContract(H, 1)//Revival contracts are always signed in blood diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index 4bc006efbd0..c99b094ab0f 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -117,7 +117,7 @@ to_chat(M, "You feel a tiny prick!") . = 1 - add_logs(user, M, "stabbed", src) + log_combat(user, M, "stabbed", src) else . = ..() diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index 0bd230a1666..f4d7f9e099e 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -330,7 +330,7 @@ power_source = cell shock_damage = cell_damage var/drained_hp = M.electrocute_act(shock_damage, source, siemens_coeff) //zzzzzzap! - add_logs(source, M, "electrocuted") + log_combat(source, M, "electrocuted") var/drained_energy = drained_hp*20 diff --git a/code/modules/projectiles/guns/magic/wand.dm b/code/modules/projectiles/guns/magic/wand.dm index ae20720a440..e3724fdf312 100644 --- a/code/modules/projectiles/guns/magic/wand.dm +++ b/code/modules/projectiles/guns/magic/wand.dm @@ -50,7 +50,7 @@ /obj/item/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.log_message("zapped [user.p_them()]self with a [src]", INDIVIDUAL_ATTACK_LOG) + user.log_message("zapped [user.p_them()]self with a [src]", LOG_ATTACK) ///////////////////////////////////// diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 44fca82f765..bf885240ff0 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -191,7 +191,7 @@ reagent_note += R.id + " (" reagent_note += num2text(R.volume) + ") " - add_logs(firer, L, "shot", src, reagent_note) + log_combat(firer, L, "shot", src, reagent_note) return L.apply_effects(stun, knockdown, unconscious, irradiate, slur, stutter, eyeblur, drowsy, blocked, stamina, jitter) /obj/item/projectile/proc/vol_by_damage() @@ -335,7 +335,7 @@ /obj/item/projectile/proc/fire(angle, atom/direct_target) //If no angle needs to resolve it from xo/yo! if(!log_override && firer && original) - add_logs(firer, original, "fired at", src, "from [get_area_name(src, TRUE)]") + log_combat(firer, original, "fired at", src, "from [get_area_name(src, TRUE)]") if(direct_target) if(prehit(direct_target)) direct_target.bullet_act(src, def_zone) diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index b14d14d9060..cc9c7a35311 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -236,7 +236,7 @@ for(var/obj/item/W in contents) new_mob.equip_to_appropriate_slot(W) - M.log_message("became [new_mob.real_name].", INDIVIDUAL_ATTACK_LOG) + M.log_message("became [new_mob.real_name]", LOG_ATTACK, color="orange") new_mob.a_intent = INTENT_HARM diff --git a/code/modules/reagents/chemistry/machinery/smoke_machine.dm b/code/modules/reagents/chemistry/machinery/smoke_machine.dm index a8b09199066..4d60655488c 100644 --- a/code/modules/reagents/chemistry/machinery/smoke_machine.dm +++ b/code/modules/reagents/chemistry/machinery/smoke_machine.dm @@ -85,7 +85,7 @@ var/units = RC.reagents.trans_to(src, RC.amount_per_transfer_from_this) if(units) to_chat(user, "You transfer [units] units of the solution to [src].") - add_logs(usr, src, "has added [english_list(RC.reagents.reagent_list)] to [src]") + log_combat(usr, src, "has added [english_list(RC.reagents.reagent_list)] to [src]") return if(default_unfasten_wrench(user, I, 40)) on = FALSE @@ -144,7 +144,7 @@ if(on) message_admins("[ADMIN_LOOKUPFLW(usr)] activated a smoke machine that contains [english_list(reagents.reagent_list)] at [ADMIN_VERBOSEJMP(src)].") log_game("[key_name(usr)] activated a smoke machine that contains [english_list(reagents.reagent_list)] at [AREACOORD(src)].") - add_logs(usr, src, "has activated [src] which contains [english_list(reagents.reagent_list)] at [AREACOORD(src)].") + log_combat(usr, src, "has activated [src] which contains [english_list(reagents.reagent_list)] at [AREACOORD(src)].") if("goScreen") screen = params["screen"] . = TRUE diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 250e259ae9d..734194e708f 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -803,7 +803,7 @@ M.updatehealth() if(M.revive()) M.emote("gasp") - add_logs(M, M, "revived", src) + log_combat(M, M, "revived", src) ..() /datum/reagent/medicine/strange_reagent/on_mob_life(mob/living/carbon/M) diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index ca09fc21d50..57a2808173b 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -627,7 +627,7 @@ /datum/reagent/toxin/amanitin/on_mob_delete(mob/living/M) var/toxdamage = current_cycle*3*REM - M.log_message("has taken [toxdamage] toxin damage from amanitin toxin", INDIVIDUAL_ATTACK_LOG) + M.log_message("has taken [toxdamage] toxin damage from amanitin toxin", LOG_ATTACK) M.adjustToxLoss(toxdamage) ..() diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index fc2fed3a21b..85868f18956 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -98,7 +98,7 @@ R += num2text(A.volume) + ")," if(thrownby) - add_logs(thrownby, M, "splashed", R) + log_combat(thrownby, M, "splashed", R) reagents.reaction(target, TOUCH) else if(bartender_check(target) && thrown) @@ -107,7 +107,7 @@ else if(isturf(target) && reagents.reagent_list.len && thrownby) - add_logs(thrownby, target, "splashed (thrown) [english_list(reagents.reagent_list)]", "in [AREACOORD(target)]") + log_combat(thrownby, target, "splashed (thrown) [english_list(reagents.reagent_list)]", "in [AREACOORD(target)]") log_game("[key_name(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] in [AREACOORD(target)].") message_admins("[ADMIN_LOOKUPFLW(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] in [ADMIN_VERBOSEJMP(target)].") visible_message("[src] spills its contents all over [target].") diff --git a/code/modules/reagents/reagent_containers/borghydro.dm b/code/modules/reagents/reagent_containers/borghydro.dm index 61ed1ef61e6..fbbc81b974f 100644 --- a/code/modules/reagents/reagent_containers/borghydro.dm +++ b/code/modules/reagents/reagent_containers/borghydro.dm @@ -111,7 +111,7 @@ Borg Hypospray var/list/injected = list() for(var/datum/reagent/RG in R.reagent_list) injected += RG.name - add_logs(user, M, "injected", src, "(CHEMICALS: [english_list(injected)])") + log_combat(user, M, "injected", src, "(CHEMICALS: [english_list(injected)])") /obj/item/reagent_containers/borghypo/attack_self(mob/user) var/chosen_reagent = modes[input(user, "What reagent do you want to dispense?") as null|anything in reagent_ids] diff --git a/code/modules/reagents/reagent_containers/dropper.dm b/code/modules/reagents/reagent_containers/dropper.dm index 092a89a6851..5907c9e5349 100644 --- a/code/modules/reagents/reagent_containers/dropper.dm +++ b/code/modules/reagents/reagent_containers/dropper.dm @@ -69,7 +69,7 @@ for(var/datum/reagent/A in src.reagents.reagent_list) R += A.id + " (" R += num2text(A.volume) + ")," - add_logs(user, M, "squirted", R) + log_combat(user, M, "squirted", R) trans = src.reagents.trans_to(target, amount_per_transfer_from_this) to_chat(user, "You transfer [trans] unit\s of the solution.") diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 3b978889043..c352c8536ef 100755 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -29,11 +29,10 @@ R += A.id + " (" R += num2text(A.volume) + ")," if(isturf(target) && reagents.reagent_list.len && thrownby) - add_logs(thrownby, target, "splashed (thrown) [english_list(reagents.reagent_list)]", "in [AREACOORD(target)]") - log_game("[key_name(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] in [AREACOORD(target)].") + log_combat(thrownby, target, "splashed (thrown) [english_list(reagents.reagent_list)]") message_admins("[ADMIN_LOOKUPFLW(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] at [ADMIN_VERBOSEJMP(target)].") reagents.reaction(M, TOUCH) - add_logs(user, M, "splashed", R) + log_combat(user, M, "splashed", R) reagents.clear_reagents() else if(M != user) @@ -44,7 +43,7 @@ if(!reagents || !reagents.total_volume) return // The drink might be empty after the delay, such as by spam-feeding M.visible_message("[user] feeds something to [M].", "[user] feeds something to you.") - add_logs(user, M, "fed", reagents.log_list()) + log_combat(user, M, "fed", reagents.log_list()) else to_chat(user, "You swallow a gulp of [src].") var/fraction = min(5/reagents.total_volume, 1) diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm index 8d4e2d88f96..f7591b4db20 100644 --- a/code/modules/reagents/reagent_containers/hypospray.dm +++ b/code/modules/reagents/reagent_containers/hypospray.dm @@ -30,7 +30,7 @@ for(var/datum/reagent/R in reagents.reagent_list) injected += R.name var/contained = english_list(injected) - add_logs(user, M, "attempted to inject", src, "([contained])") + log_combat(user, M, "attempted to inject", src, "([contained])") if(reagents.total_volume && (ignore_flags || M.can_inject(user, 1))) // Ignore flag should be checked first or there will be an error message. to_chat(M, "You feel a tiny prick!") @@ -48,7 +48,7 @@ to_chat(user, "[trans] unit\s injected. [reagents.total_volume] unit\s remaining in [src].") - add_logs(user, M, "injected", src, "([contained])") + log_combat(user, M, "injected", src, "([contained])") /obj/item/reagent_containers/hypospray/CMO list_reagents = list("omnizine" = 30) diff --git a/code/modules/reagents/reagent_containers/medspray.dm b/code/modules/reagents/reagent_containers/medspray.dm index fdb6a608947..8631c14ac01 100644 --- a/code/modules/reagents/reagent_containers/medspray.dm +++ b/code/modules/reagents/reagent_containers/medspray.dm @@ -46,7 +46,7 @@ to_chat(M, "You [apply_method] yourself with [src].") else - add_logs(user, M, "attempted to apply", src, reagents.log_list()) + log_combat(user, M, "attempted to apply", src, reagents.log_list()) M.visible_message("[user] attempts to [apply_method] [src] on [M].", \ "[user] attempts to [apply_method] [src] on [M].") if(!do_mob(user, M)) @@ -60,7 +60,7 @@ return else - add_logs(user, M, "applied", src, reagents.log_list()) + log_combat(user, M, "applied", src, reagents.log_list()) playsound(src, 'sound/effects/spray2.ogg', 50, 1, -6) var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1) reagents.reaction(M, apply_type, fraction) diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm index 61a60d0d285..89417242742 100644 --- a/code/modules/reagents/reagent_containers/pill.dm +++ b/code/modules/reagents/reagent_containers/pill.dm @@ -47,7 +47,7 @@ "[user] forces [M] to [apply_method] [src].") - add_logs(user, M, "fed", reagents.log_list()) + log_combat(user, M, "fed", reagents.log_list()) if(reagents.total_volume) reagents.reaction(M, apply_type) reagents.trans_to(M, reagents.total_volume) @@ -195,4 +195,4 @@ name = pick(names) if(prob(20)) desc = pick(descs) - + diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 1092e63376c..5c1451f5e03 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -111,7 +111,7 @@ if(SYRINGE_INJECT) // Always log attemped injections for admins var/contained = reagents.log_list() - add_logs(user, L, "attemped to inject", src, addition="which had [contained]") + log_combat(user, L, "attemped to inject", src, addition="which had [contained]") if(!reagents.total_volume) to_chat(user, "[src] is empty.") @@ -141,11 +141,9 @@ "[user] injects [L] with the syringe!") if(L != user) - add_logs(user, L, "injected", src, addition="which had [contained]") + log_combat(user, L, "injected", src, addition="which had [contained]") else - log_attack("[key_name(user)] injected [key_name(L)] with [src.name], which had [contained] (INTENT: [uppertext(user.a_intent)])") - L.log_message("Injected themselves ([contained]) with [src.name].", INDIVIDUAL_ATTACK_LOG) - + L.log_message("injected themselves ([contained]) with [src.name]", LOG_ATTACK, color="orange") var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1) reagents.reaction(L, INJECT, fraction) reagents.trans_to(target, amount_per_transfer_from_this) diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm index 072c1b051ff..45154a70f4f 100644 --- a/code/modules/reagents/reagent_dispenser.dm +++ b/code/modules/reagents/reagent_dispenser.dm @@ -88,9 +88,7 @@ var/boom_message = "[ADMIN_LOOKUPFLW(P.firer)] triggered a fueltank explosion via projectile." GLOB.bombers += boom_message message_admins(boom_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]") + P.firer.log_message("triggered a fueltank explosion via projectile.", LOG_ATTACK) boom() /obj/structure/reagent_dispensers/fueltank/attackby(obj/item/I, mob/living/user, params) @@ -110,13 +108,12 @@ else var/turf/T = get_turf(src) user.visible_message("[user] catastrophically fails at refilling [user.p_their()] [W.name]!", "That was stupid of you.") + var/message_admins = "[ADMIN_LOOKUPFLW(user)] triggered a fueltank explosion via welding tool at [ADMIN_VERBOSEJMP(T)]." GLOB.bombers += message_admins message_admins(message_admins) - var/message_log = "triggered a fueltank explosion via welding tool at [AREACOORD(T)]." - user.log_message(message_log, INDIVIDUAL_ATTACK_LOG) - log_game("[key_name(user)] [message_log]") - log_attack("[key_name(user)] [message_log]") + + user.log_message("triggered a fueltank explosion via welding tool.", LOG_ATTACK) boom() return return ..() diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm index d5fcdb3976e..fd98c54b81c 100644 --- a/code/modules/recycling/disposal/bin.dm +++ b/code/modules/recycling/disposal/bin.dm @@ -136,7 +136,7 @@ user.visible_message("[user] climbs into [src].", "You climb into [src].") else target.visible_message("[user] has placed [target] in [src].", "[user] has placed [target] in [src].") - add_logs(user, target, "stuffed", addition="into [src]") + log_combat(user, target, "stuffed", addition="into [src]") target.LAssailant = user update_icon() diff --git a/code/modules/spells/spell.dm b/code/modules/spells/spell.dm index 4e6ef7ed9b2..e7466a390e1 100644 --- a/code/modules/spells/spell.dm +++ b/code/modules/spells/spell.dm @@ -289,7 +289,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th before_cast(targets) invocation(user) if(user && user.ckey) - user.log_message("cast the spell [name].", INDIVIDUAL_ATTACK_LOG) + user.log_message("cast the spell [name].", LOG_ATTACK) if(recharge) recharging = TRUE if(sound) diff --git a/code/modules/spells/spell_types/rightandwrong.dm b/code/modules/spells/spell_types/rightandwrong.dm index 414aa109335..bc1fc980bb7 100644 --- a/code/modules/spells/spell_types/rightandwrong.dm +++ b/code/modules/spells/spell_types/rightandwrong.dm @@ -96,7 +96,7 @@ GLOBAL_VAR_INIT(summon_magic_triggered, FALSE) SSticker.mode.traitors += H.mind H.mind.add_antag_datum(/datum/antagonist/survivalist/guns) - H.log_message("Was made into a survivalist, and trusts no one!", INDIVIDUAL_ATTACK_LOG) + H.log_message("was made into a survivalist, and trusts no one!", LOG_ATTACK, color="red") var/gun_type = pick(GLOB.summoned_guns) var/obj/item/gun/G = new gun_type(get_turf(H)) @@ -116,7 +116,7 @@ GLOBAL_VAR_INIT(summon_magic_triggered, FALSE) if(prob(GLOB.summon_magic_triggered) && !(H.mind.has_antag_datum(/datum/antagonist))) H.mind.add_antag_datum(/datum/antagonist/survivalist/magic) - H.log_message("Was made into a survivalist, and trusts no one!", INDIVIDUAL_ATTACK_LOG) + H.log_message("was made into a survivalist, and trusts no one!", LOG_ATTACK, color="red") var/magic_type = pick(GLOB.summoned_magic) var/lucky = FALSE diff --git a/code/modules/spells/spell_types/summonitem.dm b/code/modules/spells/spell_types/summonitem.dm index 0bb79eba21b..2bc347b1852 100644 --- a/code/modules/spells/spell_types/summonitem.dm +++ b/code/modules/spells/spell_types/summonitem.dm @@ -57,7 +57,7 @@ var/obj/item/organ/organ = item_to_retrieve if(organ.owner) // If this code ever runs I will be happy - add_logs(L, organ.owner, "magically removed [organ.name] from", addition="INTENT: [uppertext(L.a_intent)]") + log_combat(L, organ.owner, "magically removed [organ.name] from", addition="INTENT: [uppertext(L.a_intent)]") organ.Remove(organ.owner) else while(!isturf(item_to_retrieve.loc) && infinite_recursion < 10) //if it's in something you get the whole thing. diff --git a/code/modules/surgery/dental_implant.dm b/code/modules/surgery/dental_implant.dm index 4e1d8eb7433..87e6d096b39 100644 --- a/code/modules/surgery/dental_implant.dm +++ b/code/modules/surgery/dental_implant.dm @@ -32,7 +32,7 @@ if(!..()) return 0 to_chat(owner, "You grit your teeth and burst the implanted [target.name]!") - add_logs(owner, null, "swallowed an implanted pill", target) + log_combat(owner, null, "swallowed an implanted pill", target) if(target.reagents.total_volume) target.reagents.reaction(owner, INGEST) target.reagents.trans_to(owner, target.reagents.total_volume) diff --git a/code/modules/surgery/helpers.dm b/code/modules/surgery/helpers.dm index d74d7b66912..59440cc3ee1 100644 --- a/code/modules/surgery/helpers.dm +++ b/code/modules/surgery/helpers.dm @@ -68,7 +68,7 @@ user.visible_message("[user] drapes [I] over [M]'s [parse_zone(selected_zone)] to prepare for \an [procedure.name].", \ "You drape [I] over [M]'s [parse_zone(selected_zone)] to prepare for \an [procedure.name].") - add_logs(user, M, "operated on", null, "(OPERATION TYPE: [procedure.name]) (TARGET AREA: [selected_zone])") + log_combat(user, M, "operated on", null, "(OPERATION TYPE: [procedure.name]) (TARGET AREA: [selected_zone])") else to_chat(user, "You need to expose [M]'s [parse_zone(selected_zone)] first!") diff --git a/code/modules/surgery/limb_augmentation.dm b/code/modules/surgery/limb_augmentation.dm index 43531d5d653..baab94e0d5f 100644 --- a/code/modules/surgery/limb_augmentation.dm +++ b/code/modules/surgery/limb_augmentation.dm @@ -59,7 +59,7 @@ if(istype(tool) && user.temporarilyRemoveItemFromInventory(tool)) tool.replace_limb(target) user.visible_message("[user] successfully augments [target]'s [parse_zone(target_zone)]!", "You successfully augment [target]'s [parse_zone(target_zone)].") - add_logs(user, target, "augmented", addition="by giving him new [parse_zone(target_zone)] INTENT: [uppertext(user.a_intent)]") + log_combat(user, target, "augmented", addition="by giving him new [parse_zone(target_zone)] INTENT: [uppertext(user.a_intent)]") else to_chat(user, "[target] has no organic [parse_zone(target_zone)] there!") return TRUE diff --git a/code/modules/surgery/organ_manipulation.dm b/code/modules/surgery/organ_manipulation.dm index 3b260017d38..553de45c60d 100644 --- a/code/modules/surgery/organ_manipulation.dm +++ b/code/modules/surgery/organ_manipulation.dm @@ -141,7 +141,7 @@ if(I && I.owner == target) user.visible_message("[user] successfully extracts [I] from [target]'s [parse_zone(target_zone)]!", "You successfully extract [I] from [target]'s [parse_zone(target_zone)].") - add_logs(user, target, "surgically removed [I.name] from", addition="INTENT: [uppertext(user.a_intent)]") + log_combat(user, target, "surgically removed [I.name] from", addition="INTENT: [uppertext(user.a_intent)]") I.Remove(target) I.forceMove(get_turf(target)) else diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm index 59db1fb8041..d5b2d16e674 100644 --- a/code/modules/surgery/organs/tongue.dm +++ b/code/modules/surgery/organs/tongue.dm @@ -83,7 +83,7 @@ //Hacks var/mob/living/carbon/human/user = usr var/rendered = "[user.name]: [message]" - log_talk(user,"ABDUCTOR:[key_name(user)] : [rendered]",LOGSAY) + user.log_talk(message, LOG_SAY, tag="abductor") for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) var/obj/item/organ/tongue/T = H.getorganslot(ORGAN_SLOT_TONGUE) if(!T || T.type != type)