diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index a2e8542b825..f59774142bd 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -249,8 +249,8 @@ Proc for attack log creation, because really why not 6 is whether the attack should be logged to the log file and shown to admins */ -proc/add_logs(mob/user, mob/target, what_done, var/object=null, var/addition=null, var/admin=1) - var/list/ignore=list("shaked","CPRed","grabbed","punched") +proc/add_logs(mob/user, mob/target, what_done, var/object=null, var/addition=null, var/admin=1, var/print_attack_log = 1)//print_attack_log notifies admins with attack logs on + var/list/ignore=list("shaked", "CPRed", "grabbed", "punched", "disarmed") if(!user) return if(ismob(user)) @@ -259,10 +259,13 @@ proc/add_logs(mob/user, mob/target, what_done, var/object=null, var/addition=nul target.attack_log += text("\[[time_stamp()]\] Has been [what_done] by [key_name(user)][object ? " with [object]" : " "][addition]") if(admin) log_attack("[key_name(user)] [what_done] [key_name(target)][object ? " with [object]" : " "][addition]") - if(istype(target) && (target.client || target.player_logged)) - if(what_done in ignore) return - if(target == user)return - if(!admin) return + if(istype(target) && (target.key)) + if(what_done in ignore) + return + if(target == user) + return + if(!print_attack_log) + return msg_admin_attack("[key_name_admin(user)] [what_done] [key_name_admin(target)][object ? " with [object]" : " "][addition]") /proc/do_mob(var/mob/user, var/mob/target, var/time = 30, var/uninterruptible = 0, progress = 1) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 1077e2fde8a..20a04b5278e 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -65,8 +65,7 @@ ///////////////////////// user.lastattacked = M M.lastattacker = user - - add_logs(user, M, "attacked", name, "(INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])") + add_logs(user, M, "attacked", name, "(INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])", print_attack_log = (force > 0))//print it if stuff deals damage if(!iscarbon(user)) M.LAssailant = null diff --git a/code/defines/procs/admin.dm b/code/defines/procs/admin.dm index c05819995ec..fb9bc232e12 100644 --- a/code/defines/procs/admin.dm +++ b/code/defines/procs/admin.dm @@ -45,7 +45,7 @@ return . /proc/key_name_admin(var/whom, var/include_name = 1) - var/message = "[key_name(whom, 1, include_name)](?)[isAntag(whom) ? "(A)" : ""][isLivingSSD(whom) ? "(SSD!)" : ""] ([admin_jump_link(whom)])" + var/message = "[key_name(whom, 1, include_name)](?)[isAntag(whom) ? "(A)" : ""][isLivingSSD(whom) ? "(SSD!)" : ""] ([admin_jump_link(whom)])" return message /proc/log_and_message_admins(var/message as text) diff --git a/code/game/machinery/poolcontroller.dm b/code/game/machinery/poolcontroller.dm index db60adb5c9a..f9f1f40264d 100644 --- a/code/game/machinery/poolcontroller.dm +++ b/code/game/machinery/poolcontroller.dm @@ -103,13 +103,12 @@ if(drownee.losebreath > 20) //You've probably got bigger problems than drowning at this point, so we won't add to it until you get that under control. return + add_logs(src, drownee, "drowned", null, null, 0) //log it to their VV, but don't spam the admins' chats with the logs if(drownee.stat) //Mob is in critical. drownee.AdjustLoseBreath(3, bound_lower = 0, bound_upper = 20) - add_logs(src, drownee, "drowned", null, null, 0) //log it to their VV, but don't spam the admins' chats with the logs drownee.visible_message("\The [drownee] appears to be drowning!","You're quickly drowning!") //inform them that they are fucked. else drownee.AdjustLoseBreath(2, bound_lower = 0, bound_upper = 20) //For every time you drown, you miss 2 breath attempts. Hope you catch on quick! - add_logs(src, drownee, "drowned", null, null, 0) //log it to their VV, but don't spam the admins' chats with the logs if(prob(35)) //35% chance to tell them what is going on. They should probably figure it out before then. drownee.visible_message("\The [drownee] flails, almost like they are drowning!","You're lacking air!") //*gasp* *gasp* *gasp* *gasp* *gasp* diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm index da5824b6f17..362f69c2a4c 100644 --- a/code/game/machinery/turrets.dm +++ b/code/game/machinery/turrets.dm @@ -329,7 +329,7 @@ if(M.melee_damage_upper == 0) return if(!(stat & BROKEN)) visible_message("[M] [M.attacktext] [src]!") - add_logs(src, M, "attacked", admin=0) + add_logs(src, M, "attacked", admin=0, print_attack_log = 0) //src.attack_log += text("\[[time_stamp()]\] was attacked by [M.name] ([M.ckey])") src.health -= M.melee_damage_upper if(src.health <= 0) diff --git a/code/modules/mob/living/carbon/alien/alien_defenses.dm b/code/modules/mob/living/carbon/alien/alien_defenses.dm index c6e2bcc510d..c1ce34bf8e7 100644 --- a/code/modules/mob/living/carbon/alien/alien_defenses.dm +++ b/code/modules/mob/living/carbon/alien/alien_defenses.dm @@ -35,7 +35,7 @@ In all, this is a lot like the monkey code. /N visible_message("[M.name] bites [src]!", \ "[M.name] bites [src]!") adjustBruteLoss(damage) - add_logs(M, src, "attacked", admin=0) + add_logs(M, src, "attacked", admin=0, print_attack_log = 0) updatehealth() else to_chat(M, "[name] is too injured for that.") diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index c7c8c1cefa8..a78ab9c4c77 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -116,7 +116,7 @@ "[M] [M.attacktext] [src]!") var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) adjustBruteLoss(damage) - add_logs(M, src, "attacked", admin=0) + add_logs(M, src, "attacked", admin=0, print_attack_log = 0) updatehealth() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index cd0e9d751c9..b429c34f734 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -805,10 +805,12 @@ unEquip(pocket_item) if(thief_mode) usr.put_in_hands(pocket_item) + add_logs(usr, src, "stripped", addition="of [pocket_item]", print_attack_log = isLivingSSD(src)) else if(place_item) usr.unEquip(place_item) equip_to_slot_if_possible(place_item, pocket_id, 0, 1) + add_logs(usr, src, "equipped", addition="with [pocket_item]", print_attack_log = isLivingSSD(src)) // Update strip window if(usr.machine == src && in_range(src, usr)) @@ -817,6 +819,7 @@ // Display a warning if the user mocks up if they don't have pickpocket gloves. if(!thief_mode) to_chat(src, "You feel your [pocket_side] pocket being fumbled with!") + add_logs(usr, src, "attempted to strip", addition="of [pocket_item]", print_attack_log = isLivingSSD(src)) if(href_list["set_sensor"]) if(istype(w_uniform, /obj/item/clothing/under)) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 0ceabc84bfe..232fd1fefb6 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -340,8 +340,7 @@ emp_act if(M) src.attack_log += text("\[[time_stamp()]\] Has been hit with a [I], thrown by [key_name(M)]") M.attack_log += text("\[[time_stamp()]\] Hit [key_name(src)] with a thrown [I]") - if(!istype(src,/mob/living/simple_animal/mouse)) - msg_admin_attack("[key_name_admin(src)] was hit by a [I], thrown by [key_name_admin(M)]") + msg_admin_attack("[key_name_admin(src)] was hit by a [I], thrown by [key_name_admin(M)]", print_attack_log = I.throwforce) //thrown weapon embedded object code. if(dtype == BRUTE && istype(I)) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 02013cdc8b5..ca56e78323d 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -642,7 +642,7 @@ who.unEquip(what) if(silent) put_in_hands(what) - add_logs(src, who, "stripped", addition="of [what]") + add_logs(src, who, "stripped", addition="of [what]", print_attack_log = isLivingSSD(who)) // 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) @@ -661,7 +661,7 @@ if(what && Adjacent(who)) unEquip(what) who.equip_to_slot_if_possible(what, where, 0, 1) - add_logs(src, who, "equipped", what) + add_logs(src, who, "equipped", what, print_attack_log = isLivingSSD(who)) /mob/living/singularity_act() diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 6b577e17f65..774223c0870 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -142,7 +142,7 @@ else step_away(src,M) - add_logs(M.occupant, src, "pushed", object=M, admin=0) + add_logs(M.occupant, src, "pushed", object=M, admin=0, print_attack_log = 0) M.occupant_message("You push [src] out of the way.") visible_message("[M] pushes [src] out of the way.") return diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 00a141f60f8..710f8d8dff1 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -603,7 +603,7 @@ var/list/ai_verbs_default = list( if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) visible_message("[M] [M.attacktext] [src]!") - add_logs(M, src, "attacked", admin=0) + add_logs(M, src, "attacked", admin=0, print_attack_log = 0) var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) adjustBruteLoss(damage) updatehealth() diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 02d3401c080..64b6da638c0 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -920,7 +920,7 @@ var/list/robot_verbs_default = list( if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) visible_message("[M] [M.attacktext] [src]!") - add_logs(M, src, "attacked", admin=0) + add_logs(M, src, "attacked", admin=0, print_attack_log = 0) var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) switch(M.melee_damage_type) if(BRUTE) @@ -1467,4 +1467,4 @@ var/list/robot_verbs_default = list( borked_part.installed = 1 borked_part.wrapped = new borked_part.external_type borked_part.heal_damage(brute,burn) - borked_part.install() \ No newline at end of file + borked_part.install() diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 48f75ede66d..ffd3f91cf5c 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -254,7 +254,7 @@ return apply_damage(M.melee_damage_upper, BRUTE) visible_message("[M] has [M.attacktext] [src]!") - add_logs(M, src, "attacked", admin=0) + add_logs(M, src, "attacked", admin=0, print_attack_log = 0) if(prob(10)) new /obj/effect/decal/cleanable/blood/oil(loc) @@ -1010,4 +1010,4 @@ Pass a positive integer as an argument to override a bot's default speed. throw_alert("temp", /obj/screen/alert/cold/robot, 2) /mob/living/simple_animal/bot/is_mechanical() - return 1 \ No newline at end of file + return 1 diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 24ad47a16cb..eae08eb4d0c 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -297,7 +297,7 @@ playsound(loc, M.attack_sound, 50, 1, 1) visible_message("\The [M] [M.attacktext] [src]!", \ "\The [M] [M.attacktext] [src]!") - add_logs(M, src, "attacked", admin=0) + add_logs(M, src, "attacked", admin=0, print_attack_log = 0) var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) attack_threshold_check(damage,M.melee_damage_type) diff --git a/code/modules/mob/living/stat_states.dm b/code/modules/mob/living/stat_states.dm index f04196f9fc9..58c4221504d 100644 --- a/code/modules/mob/living/stat_states.dm +++ b/code/modules/mob/living/stat_states.dm @@ -6,7 +6,7 @@ return 0 else if(stat == UNCONSCIOUS) return 0 - add_logs(src, null, "fallen unconscious at [atom_loc_line(get_turf(src))]", admin=0) + add_logs(src, null, "fallen unconscious at [atom_loc_line(get_turf(src))]", admin=0, print_attack_log = 0) stat = UNCONSCIOUS if(updating) // update_blind_effects() @@ -19,7 +19,7 @@ return 0 else if(stat == CONSCIOUS) return 0 - add_logs(src, null, "woken up at [atom_loc_line(get_turf(src))]", admin=0) + add_logs(src, null, "woken up at [atom_loc_line(get_turf(src))]", admin=0, print_attack_log = 0) stat = CONSCIOUS if(updating) // update_blind_effects() @@ -40,7 +40,7 @@ return if(!can_be_revived()) return - add_logs(src, null, "came back to life at [atom_loc_line(get_turf(src))]", admin=0) + add_logs(src, null, "came back to life at [atom_loc_line(get_turf(src))]", admin=0, print_attack_log = 0) stat = CONSCIOUS dead_mob_list -= src living_mob_list += src diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 6692e493f79..7d6f629aa4c 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -51,6 +51,8 @@ var/embed = 0 // whether or not the projectile can embed itself in the mob var/forcedodge = 0 //to pass through everything + var/log = 1 //whether print to admin attack logs or just keep it in the diary + /obj/item/projectile/New() permutated = list() return ..() @@ -87,7 +89,7 @@ for(var/datum/reagent/R in reagents.reagent_list) reagent_note += R.id + " (" reagent_note += num2text(R.volume) + ") " - add_logs(firer, L, "shot", src, reagent_note) + add_logs(firer, L, "shot", src, reagent_note, print_attack_log = log) return L.apply_effects(stun, weaken, paralyze, irradiate, slur, stutter, eyeblur, drowsy, blocked, stamina, jitter) /obj/item/projectile/proc/vol_by_damage() diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm index d9cf8360d2a..872ee7c3f26 100644 --- a/code/modules/projectiles/projectile/beams.dm +++ b/code/modules/projectiles/projectile/beams.dm @@ -20,6 +20,7 @@ name = "practice laser" damage = 0 nodamage = 1 + log = 0 /obj/item/projectile/beam/scatter name = "laser pellet" @@ -74,6 +75,7 @@ damage_type = STAMINA flag = "laser" var/suit_types = list(/obj/item/clothing/suit/redtag, /obj/item/clothing/suit/bluetag) + log = 0 /obj/item/projectile/beam/lasertag/on_hit(atom/target, blocked = 0) . = ..() diff --git a/code/modules/projectiles/projectile/reusable.dm b/code/modules/projectiles/projectile/reusable.dm index 12e7b30c759..17aaad71a2a 100644 --- a/code/modules/projectiles/projectile/reusable.dm +++ b/code/modules/projectiles/projectile/reusable.dm @@ -37,6 +37,7 @@ var/obj/item/weapon/pen/pen = null edge = 0 embed = 0 + log = 0//it won't log even when there's a pen inside, but since the damage will be so low, I don't think there's any point in making it any more complex /obj/item/projectile/bullet/reusable/foam_dart/handle_drop() if(dropped) @@ -64,3 +65,4 @@ icon_state = "foamdart_riot" ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot stamina = 25 + log = 1