diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 04315b731a9..cfbe81c2d7d 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -55,6 +55,9 @@ return /obj/attacked_by(obj/item/I, mob/living/user) + if(I.force) + visible_message("[user] has hit [src] with [I]!", null, null, 2, user) + //only witnesses close by and the victim see a hit message. take_damage(I.force, I.damtype, "melee", 1) /mob/living/attacked_by(obj/item/I, mob/living/user) @@ -101,6 +104,7 @@ var/attack_message = "[src] has been [message_verb][message_hit_area] with [I]." if(user in viewers(src, null)) attack_message = "[user] has [message_verb] [src][message_hit_area] with [I]!" - src << "[attack_message]" + visible_message("[attack_message]", \ + "[attack_message]", null, 2,user) return 1 diff --git a/code/datums/martial.dm b/code/datums/martial.dm index 630dfddb440..1f14904d96f 100644 --- a/code/datums/martial.dm +++ b/code/datums/martial.dm @@ -46,7 +46,8 @@ if(!damage) playsound(D.loc, A.dna.species.miss_sound, 25, 1, -1) - D << "[A] has attempted to [atk_verb] [D]!" + D.visible_message("[A] has attempted to [atk_verb] [D]!", \ + "[A] has attempted to [atk_verb] [D]!", null, 2, A) add_logs(A, D, "attempted to [atk_verb]") return 0 @@ -54,7 +55,8 @@ var/armor_block = D.run_armor_check(affecting, "melee") playsound(D.loc, A.dna.species.attack_sound, 25, 1, -1) - D << "[A] has [atk_verb]ed [D]!" + D.visible_message("[A] has [atk_verb]ed [D]!", \ + "[A] has [atk_verb]ed [D]!", null, 2, A) D.apply_damage(damage, BRUTE, affecting, armor_block) @@ -105,7 +107,8 @@ var/damage = rand(5, 8) + A.dna.species.punchdamagelow if(!damage) playsound(D.loc, A.dna.species.miss_sound, 25, 1, -1) - D << "[A] has attempted to hit [D] with a [atk_verb]!" + D.visible_message("[A] has attempted to [atk_verb] [D]!", \ + "[A] has attempted to [atk_verb] [D]!", null, 2, A) add_logs(A, D, "attempted to hit", atk_verb) return 0 @@ -115,7 +118,8 @@ playsound(D.loc, A.dna.species.attack_sound, 25, 1, -1) - D << "[A] has hit [D] with a [atk_verb]!" + D.visible_message("[A] has [atk_verb]ed [D]!", \ + "[A] has [atk_verb]ed [D]!", null, 2, A) D.apply_damage(damage, STAMINA, affecting, armor_block) add_logs(A, D, "punched (boxing) ") diff --git a/code/game/gamemodes/devil/true_devil/_true_devil.dm b/code/game/gamemodes/devil/true_devil/_true_devil.dm index d9166fe452d..0ba2a3ccb90 100644 --- a/code/game/gamemodes/devil/true_devil/_true_devil.dm +++ b/code/game/gamemodes/devil/true_devil/_true_devil.dm @@ -129,7 +129,8 @@ if(user in viewers(src, null)) attack_message = "[user] has [message_verb] [src] with [I]!" if(message_verb) - src << "[attack_message]" + visible_message("[attack_message]", + "[attack_message]", null, 2, user) return TRUE /mob/living/carbon/true_devil/Process_Spacemove(movement_dir = 0) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index cc1f6020262..d5f97bf27d9 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -247,6 +247,7 @@ Class Procs: else user.changeNext_move(CLICK_CD_MELEE) user.do_attack_animation(src, ATTACK_EFFECT_PUNCH) + user.visible_message("[user.name] smashes against \the [src.name] with its paws.", null, null, 2, user) take_damage(4, BRUTE, "melee", 1) diff --git a/code/game/mecha/mecha_defense.dm b/code/game/mecha/mecha_defense.dm index 49ac7e4a1c7..c1220c8c750 100644 --- a/code/game/mecha/mecha_defense.dm +++ b/code/game/mecha/mecha_defense.dm @@ -56,6 +56,7 @@ user.changeNext_move(CLICK_CD_MELEE) // Ugh. Ideally we shouldn't be setting cooldowns outside of click code. 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, 2, user) log_message("Attack by hand/paw. Attacker - [user].",1) log_append_to_last("Armor saved.") @@ -93,6 +94,7 @@ log_message("Attack by hulk. Attacker - [user].",1) user.changeNext_move(CLICK_CD_MELEE) add_logs(user, src, "punched", "hulk powers") + user.visible_message("[user] hits [name]. The metal creaks and bends.", null, null, 2, user) user.do_attack_animation(src, ATTACK_EFFECT_SMASH) take_damage(15, BRUTE, "melee", 0, get_dir(src, user)) return 1 diff --git a/code/game/objects/obj_defense.dm b/code/game/objects/obj_defense.dm index ac7b93063cd..4f5d3b4dfe5 100644 --- a/code/game/objects/obj_defense.dm +++ b/code/game/objects/obj_defense.dm @@ -63,12 +63,14 @@ /obj/bullet_act(obj/item/projectile/P) . = ..() playsound(src, P.hitsound, 50, 1) + visible_message("[src] is hit by \a [P]!", null, null, 2) take_damage(P.damage, P.damage_type, P.flag, 0, turn(P.dir, 180)) /obj/attack_hulk(mob/living/carbon/human/user, does_attack_animation = 0) if(user.a_intent == "harm") ..(user, 1) + visible_message("[user] smashes [src]!", null, null, 2, user) if(density) playsound(src, 'sound/effects/meteorimpact.ogg', 100, 1) user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) @@ -132,6 +134,7 @@ return 0 else return 0 + visible_message("[M.name] has hit [src].", null, null, 2, M.occupant) return take_damage(M.force*3, mech_damtype, "melee", play_soundeffect, get_dir(src, M)) // multiplied by 3 so we can hit objs hard but not be overpowered against mobs. /obj/singularity_act() diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index 07fb31a87ea..71a7e618cb3 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -161,6 +161,7 @@ //prevents remote "kicks" with TK if (!Adjacent(user)) return + user.visible_message("[user] kicks the display case.", null, null, 2, user) 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 59964410001..7204319e7ff 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -43,12 +43,14 @@ /obj/structure/grille/attack_hand(mob/living/user) user.changeNext_move(CLICK_CD_MELEE) user.do_attack_animation(src, ATTACK_EFFECT_KICK) + user.visible_message("[user] hits [src].", null, null, 2, user) if(!shock(user, 70)) take_damage(rand(5,10), BRUTE, "melee", 1) /obj/structure/grille/attack_alien(mob/living/user) user.do_attack_animation(src) user.changeNext_move(CLICK_CD_MELEE) + user.visible_message("[user] mangles [src].", null, null, 2, user) if(!shock(user, 70)) take_damage(20, BRUTE, "melee", 1) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index a5c8dea83c6..51aefb3d5b0 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -439,6 +439,7 @@ /obj/structure/rack/attack_hand(mob/living/user) user.changeNext_move(CLICK_CD_MELEE) user.do_attack_animation(src, ATTACK_EFFECT_KICK) + user.visible_message("[user] kicks [src].", null, null, 2, user) take_damage(rand(4,8), BRUTE, "melee", 1) diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 0c6b9c1efeb..09cf1e2776f 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -89,6 +89,7 @@ switch(M.damtype) if(BRUTE) playsound(src, 'sound/weapons/punch4.ogg', 50, 1) + visible_message("[M.name] has hit [src]!", null, null, 2, M.occupant) if(prob(hardness + M.force) && M.force > 20) dismantle_wall(1) playsound(src, 'sound/effects/meteorimpact.ogg', 100, 1) diff --git a/code/modules/client/verbs/suicide.dm b/code/modules/client/verbs/suicide.dm index 659fe3f3c8d..92221f35b11 100644 --- a/code/modules/client/verbs/suicide.dm +++ b/code/modules/client/verbs/suicide.dm @@ -120,7 +120,8 @@ if(answer == "Yes") card.removePersonality() var/turf/T = get_turf(src.loc) - T.visible_message("[src] flashes a message across its screen, \"Wiping core files. Please acquire a new personality to continue using pAI device functions.\"", "[src] bleeps electronically.") + T.visible_message("[src] flashes a message across its screen, \"Wiping core files. Please acquire a new personality to continue using pAI device functions.\"", null, \ + "[src] bleeps electronically.") death(0) else src << "Aborting suicide attempt." diff --git a/code/modules/mob/living/carbon/alien/alien_defense.dm b/code/modules/mob/living/carbon/alien/alien_defense.dm index 7008abfa589..3505974d7a4 100644 --- a/code/modules/mob/living/carbon/alien/alien_defense.dm +++ b/code/modules/mob/living/carbon/alien/alien_defense.dm @@ -35,7 +35,8 @@ In all, this is a lot like the monkey code. /N if (health > 0) M.do_attack_animation(src, ATTACK_EFFECT_BITE) playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) - src << "[M.name] bites [src]!" + visible_message("[M.name] bites [src]!", \ + "[M.name] bites [src]!", null, 2, M) adjustBruteLoss(1) add_logs(M, src, "attacked") updatehealth() 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 fe7a468229c..9511129b725 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm @@ -17,7 +17,7 @@ hitverb = "slammed" playsound(loc, "punch", 25, 1, -1) visible_message("[user] has [hitverb] [src]!", \ - "[user] has [hitverb] [src]!") + "[user] has [hitverb] [src]!", null, 2, user) return 1 /mob/living/carbon/alien/humanoid/attack_hand(mob/living/carbon/human/M) @@ -27,7 +27,8 @@ var/damage = rand(1, 9) if (prob(90)) playsound(loc, "punch", 25, 1, -1) - src << "[M] has punched [src]!" + visible_message("[M] has punched [src]!", \ + "[M] has punched [src]!", null, 2, M) if ((stat != DEAD) && (damage > 9 || prob(5)))//Regular humans have a very small chance of weakening an alien. Paralyse(2) visible_message("[M] has weakened [src]!", \ @@ -37,7 +38,8 @@ add_logs(M, src, "attacked") else playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - src << "[M] has attempted to punch [src]!" + visible_message("[M] has attempted to punch [src]!", \ + "[M] has attempted to punch [src]!", null, 2, M) if ("disarm") if (!lying) @@ -51,10 +53,12 @@ if (prob(50)) drop_item() playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - src << "[M] has disarmed [src]!" + visible_message("[M] has disarmed [src]!", \ + "[M] has disarmed [src]!", null, 2, M) else playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - src << "[M] has attempted to disarm [src]!" + visible_message("[M] has attempted to disarm [src]!",\ + "[M] has attempted to disarm [src]!", null, 2, M) 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 e9bd2125dab..36b685e9a58 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva_defense.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva_defense.dm @@ -6,7 +6,8 @@ if (prob(90)) playsound(loc, "punch", 25, 1, -1) add_logs(M, src, "attacked") - src << "[M] has kicked [src]!" + visible_message("[M] has kicked [src]!", \ + "[M] has kicked [src]!", null, 2, M) if ((stat != DEAD) && (damage > 4.9)) Paralyse(rand(5,10)) @@ -14,7 +15,8 @@ apply_damage(damage, BRUTE, affecting) else playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - src << "[M] has attempted to kick [src]!" + visible_message("[M] has attempted to kick [src]!", \ + "[M] has attempted to kick [src]!", null, 2, M) /mob/living/carbon/alien/larva/attack_hulk(mob/living/carbon/human/user, does_attack_animation = 0) if(user.a_intent == "harm") diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 94845d3193e..ec5fe0b66d3 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -331,7 +331,8 @@ update_damage_overlays() updatehealth() - src << "[M.name] has hit [src]!" + visible_message("[M.name] has hit [src]!", \ + "[M.name] has hit [src]!", null, 2, M.occupant) add_logs(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 c9f2703fbbf..d5df66b01dc 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -985,7 +985,8 @@ if(!damage || !affecting) playsound(target.loc, user.dna.species.miss_sound, 25, 1, -1) - target << "[user] has attempted to [atk_verb] [target]!" + target.visible_message("[user] has attempted to [atk_verb] [target]!",\ + "[user] has attempted to [atk_verb] [target]!", null, 2, user) return 0 @@ -993,7 +994,8 @@ playsound(target.loc, user.dna.species.attack_sound, 25, 1, -1) - target << "[user] has [atk_verb]ed [target]!" + target.visible_message("[user] has [atk_verb]ed [target]!", \ + "[user] has [atk_verb]ed [target]!", null, 2, user) if(user.limb_destroyer) target.dismembering_strike(user, affecting.body_zone) @@ -1020,7 +1022,8 @@ var/randn = rand(1, 100) if(randn <= 25) playsound(target, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - target << "[user] has pushed [target]!" + target.visible_message("[user] has pushed [target]!", + "[user] has pushed [target]!", null, 2, user) target.apply_effect(2, WEAKEN, target.run_armor_check(affecting, "melee", "Your armor prevents your fall!", "Your armor softens your fall!")) target.forcesay(hit_appends) return @@ -1037,13 +1040,15 @@ if(!talked) //BubbleWrap if(target.drop_item()) - target << "[user] has disarmed [target]!" + target.visible_message("[user] has disarmed [target]!", \ + "[user] has disarmed [target]!", null, 2, user) playsound(target, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) return playsound(target, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - target << "[user] attemped to disarm [target]!" + target.visible_message("[user] attempted to disarm [target]!", \ + "[user] attemped to disarm [target]!", null, 2, user) /datum/species/proc/spec_attack_hand(mob/living/carbon/human/M, mob/living/carbon/human/H, datum/martial_art/attacker_style = M.martial_art) diff --git a/code/modules/mob/living/carbon/monkey/monkey_defense.dm b/code/modules/mob/living/carbon/monkey/monkey_defense.dm index 11118c6b0cb..4a7df016824 100644 --- a/code/modules/mob/living/carbon/monkey/monkey_defense.dm +++ b/code/modules/mob/living/carbon/monkey/monkey_defense.dm @@ -51,7 +51,8 @@ if("harm") M.do_attack_animation(src, ATTACK_EFFECT_PUNCH) if (prob(75)) - src << "[M] has punched [name]!" + visible_message("[M] has punched [name]!", \ + "[M] has punched [name]!", null, 2, M) playsound(loc, "punch", 25, 1, -1) var/damage = rand(5, 10) @@ -60,7 +61,7 @@ if ( (paralysis < 5) && (health > 0) ) Paralyse(rand(10, 15)) visible_message("[M] has knocked out [name]!", \ - "[M] has knocked out [name]!") + "[M] has knocked out [name]!", null, 5) var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected)) if(!affecting) affecting = get_bodypart("chest") @@ -70,7 +71,8 @@ else playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - src << "[M] has attempted to punch [name]!" + visible_message("[M] has attempted to punch [name]!", \ + "[M] has attempted to punch [name]!", null, 2, M) if("disarm") if (!paralysis) M.do_attack_animation(src, ATTACK_EFFECT_DISARM) @@ -78,11 +80,13 @@ Paralyse(2) playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) add_logs(M, src, "pushed") - src << "[M] has pushed down [src]!" + visible_message("[M] has pushed down [src]!", \ + "[M] has pushed down [src]!", null, 2, M) else if(drop_item()) playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - src << "[M] has disarmed [src]!" + visible_message("[M] has disarmed [src]!", \ + "[M] has disarmed [src]!", null, 2, M) /mob/living/carbon/monkey/attack_alien(mob/living/carbon/alien/humanoid/M) if(..()) //if harm or disarm intent. @@ -94,9 +98,11 @@ damage = rand(20, 40) if (paralysis < 15) Paralyse(rand(10, 15)) - src << "[M] has wounded [name]!" + visible_message("[M] has wounded [name]!", \ + "[M] has wounded [name]!", null, 2, M) else - src << "[M] has slashed [name]!" + visible_message("[M] has slashed [name]!", \ + "[M] has slashed [name]!", null, 2, M) var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected)) add_logs(M, src, "attacked") @@ -109,16 +115,19 @@ else playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1) - src << "[M] has attempted to lunge at [name]!" + visible_message("[M] has attempted to lunge at [name]!", \ + "[M] has attempted to lunge at [name]!", null, 2, M) if (M.a_intent == "disarm") playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1) if(prob(95)) Weaken(10) - src << "[M] has tackled down [name]!" + visible_message("[M] has tackled down [name]!", \ + "[M] has tackled down [name]!", null, 2, M) else if(drop_item()) - src << "[M] has disarmed [name]!" + visible_message("[M] has disarmed [name]!", \ + "[M] has disarmed [name]!", null, 2, M) add_logs(M, src, "disarmed") updatehealth() diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index bf761aade55..430a93a1784 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -109,12 +109,13 @@ else return updatehealth() - src << "[M.name] has hit [src]!" + visible_message("[M.name] has hit [src]!", \ + "[M.name] has hit [src]!", null, 2, M.occupant) add_logs(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) - visible_message("[M] pushes [src] out of the way.") + visible_message("[M] pushes [src] out of the way.", null, null, 5) /mob/living/fire_act() adjust_fire_stacks(3) @@ -183,7 +184,8 @@ if (stat != DEAD) add_logs(M, src, "attacked") M.do_attack_animation(src) - src << "The [M.name] glomps [src]!" + visible_message("The [M.name] glomps [src]!", \ + "The [M.name] glomps [src]!", null, 2, M) return 1 /mob/living/attack_animal(mob/living/simple_animal/M) @@ -195,7 +197,8 @@ if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) M.do_attack_animation(src) - src << "\The [M] [M.attacktext] [src]!" + visible_message("\The [M] [M.attacktext] [src]!", \ + "\The [M] [M.attacktext] [src]!", null, 2, M) add_logs(M, src, "attacked") return 1 @@ -213,10 +216,12 @@ if (prob(75)) add_logs(M, src, "attacked") playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) - src << "[M.name] bites [src]!" + visible_message("[M.name] bites [src]!", \ + "[M.name] bites [src]!", null, 2, M) return 1 else - src << "[M.name] has attempted to bite [src]!" + visible_message("[M.name] has attempted to bite [src]!", \ + "[M.name] has attempted to bite [src]!", null, 2, M) return 0 /mob/living/attack_larva(mob/living/carbon/alien/larva/L) @@ -229,11 +234,13 @@ L.do_attack_animation(src) if(prob(90)) add_logs(L, src, "attacked") - src << "[L.name] bites [src]!" + visible_message("[L.name] bites [src]!", \ + "[L.name] bites [src]!", null, 2, L) playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) return 1 else - src << "[L.name] has attempted to bite [src]!" + visible_message("[L.name] has attempted to bite [src]!", \ + "[L.name] has attempted to bite [src]!", null, 2, L) return 0 /mob/living/attack_alien(mob/living/carbon/alien/humanoid/M) diff --git a/code/modules/mob/living/silicon/robot/robot_defense.dm b/code/modules/mob/living/silicon/robot/robot_defense.dm index da1d483765c..b4468d6b6eb 100644 --- a/code/modules/mob/living/silicon/robot/robot_defense.dm +++ b/code/modules/mob/living/silicon/robot/robot_defense.dm @@ -11,13 +11,15 @@ M.do_attack_animation(src, ATTACK_EFFECT_DISARM) if(get_active_held_item()) uneq_active() - src << "[M] has disabled [src]'s active module!" + visible_message("[M] disarmed [src]!", \ + "[M] has disabled [src]'s active module!", null, 2, M) add_logs(M, src, "disarmed") else Stun(2) step(src,get_dir(M,src)) add_logs(M, src, "pushed") - src << "[M] has forced back [src]!" + visible_message("[M] has forced back [src]!", \ + "[M] has forced back [src]!", null, 2, M) playsound(loc, 'sound/weapons/pierce.ogg', 50, 1, -1) else ..() diff --git a/code/modules/mob/living/silicon/silicon_defense.dm b/code/modules/mob/living/silicon/silicon_defense.dm index 77e3fb980be..d6803b16150 100644 --- a/code/modules/mob/living/silicon/silicon_defense.dm +++ b/code/modules/mob/living/silicon/silicon_defense.dm @@ -68,7 +68,8 @@ else M.do_attack_animation(src, ATTACK_EFFECT_PUNCH) playsound(src.loc, 'sound/effects/bang.ogg', 10, 1) - src << "[M] punches [src], but doesn't leave a dent." + visible_message("[M] punches [src], but doesn't leave a dent.", \ + "[M] punches [src], but doesn't leave a dent.", null, 2, M) return 0 /mob/living/silicon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0) diff --git a/code/modules/mob/living/simple_animal/animal_defense.dm b/code/modules/mob/living/simple_animal/animal_defense.dm index 066f2dd3e5b..088599ee399 100644 --- a/code/modules/mob/living/simple_animal/animal_defense.dm +++ b/code/modules/mob/living/simple_animal/animal_defense.dm @@ -14,7 +14,8 @@ if("harm", "disarm") M.do_attack_animation(src, ATTACK_EFFECT_PUNCH) - src << "[M] [response_harm] [src]!" + visible_message("[M] [response_harm] [src]!",\ + "[M] [response_harm] [src]!", null, 2, M) playsound(loc, attacked_sound, 25, 1, -1) attack_threshold_check(harm_intent_damage) add_logs(M, src, "attacked") @@ -25,7 +26,8 @@ if(user.a_intent == "harm") ..(user, 1) playsound(loc, "punch", 25, 1, -1) - src << "[user] has punched [src]!" + visible_message("[user] has punched [src]!", \ + "[user] has punched [src]!", null, 2, user) adjustBruteLoss(15) return 1 @@ -45,11 +47,13 @@ if(..()) //if harm or disarm intent. if(M.a_intent == "disarm") playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1) - src << "[M] [response_disarm] [name]!" + visible_message("[M] [response_disarm] [name]!", \ + "[M] [response_disarm] [name]!", null, 2, M) add_logs(M, src, "disarmed") else var/damage = rand(15, 30) - src << "[M] has slashed at [src]!" + visible_message("[M] has slashed at [src]!", \ + "[M] has slashed at [src]!", null, 2, M) playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1) attack_threshold_check(damage) add_logs(M, src, "attacked") diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index e6a735b39a9..50a98fb9e3a 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -83,63 +83,45 @@ var/next_mob_id = 0 else src << msg -// Show a message the src mob and to all player mobs who sees the src mob -// This would be for visible actions by the src mob -// message is the message output to anyone who can see e.g. "[src] does something!" +// Show a message to all player mobs who sees this atom +// Show a message to the src mob (if the src is a mob) +// Use for atoms performing visible actions +// message is output to anyone who can see, e.g. "The [src] does something!" // self_message (optional) is what the src mob sees e.g. "You do something!" // blind_message (optional) is what blind people will hear e.g. "You hear something!" +// vision_distance (optional) define how many tiles away the message can be seen. +// ignored_mob (optional) doesn't show any message to a given mob if TRUE. -/mob/visible_message(message, self_message, blind_message) +/atom/proc/visible_message(message, self_message, blind_message, vision_distance, ignored_mob) var/turf/T = get_turf(src) if(!T) return - for(var/mob/M in get_hearers_in_view(7, src)) + var/range = 7 + if(vision_distance) + range = vision_distance + for(var/mob/M in get_hearers_in_view(range, src)) if(!M.client) continue + if(M == ignored_mob) + continue var/msg = message if(M == src) //the src always see the main message or self message if(self_message) msg = self_message else - if(M.see_invisible\The [AM] slams into \the [src] inducing a resonance... \his body starts to glow and catch flame before flashing into ash.",\ "You slam into \the [src] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\"",\ "You hear an unearthly noise as a wave of heat washes over you.") else if(isobj(AM) && !istype(AM, /obj/effect)) - AM.visible_message("\The [AM] smacks into \the [src] and rapidly flashes to ash.",\ + AM.visible_message("\The [AM] smacks into \the [src] and rapidly flashes to ash.", null,\ "You hear a loud crack as you are washed with a wave of heat.") else return diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 7508b530737..6fab2ac2fa1 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -77,7 +77,7 @@ G.loc = loc qdel(G.pin) G.pin = null - visible_message("[G] can now fit a new pin, but old one was destroyed in the process.") + visible_message("[G] can now fit a new pin, but old one was destroyed in the process.", null, null, 3) qdel(src) /obj/item/weapon/gun/examine(mob/user) @@ -113,8 +113,11 @@ playsound(user, fire_sound, 10, 1) else playsound(user, fire_sound, 50, 1) - if(!message) - return + if(message) + if(pointblank) + user.visible_message("[user] fires [src] point blank at [pbtarget]!", null, null, 2, user) + else + user.visible_message("[user] fires [src]!", null, null, 2, user) if(weapon_weight >= WEAPON_MEDIUM) if(user.get_inactive_held_item()) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index e0261614cdc..78866b40e0f 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -106,7 +106,8 @@ if(hitsound) var/volume = vol_by_damage() playsound(loc, hitsound, volume, 1, -1) - L << "[L] is hit by \a [src][organ_hit_text]!" + L.visible_message("[L] is hit by \a [src][organ_hit_text]!", \ + "[L] is hit by \a [src][organ_hit_text]!", null, 2) L.on_hit(type) var/reagent_note diff --git a/icons/effects/effects.dmi b/icons/effects/effects.dmi index e47c12aefa7..eb49d01877e 100644 Binary files a/icons/effects/effects.dmi and b/icons/effects/effects.dmi differ