From bd4fef32669ded2c54f5538b95ea2db55e448e34 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 9 Mar 2022 07:12:37 +0100 Subject: [PATCH] [MIRROR] Machinery attack_paw() gives feedback for no damage attacks [MDB IGNORE] (#11974) * Machinery attack_paw() gives feedback for no damage attacks (#65306) * Machinery attack_paw gives feedback for no damage attacks * I am growing stronger * Makes messages consistent and read better - Cleans up shitty code * hmm * Adds it to hulk object attack message * Machinery attack_paw() gives feedback for no damage attacks Co-authored-by: cacogen <25089914+cacogen@users.noreply.github.com> --- code/_onclick/item_attack.dm | 8 +++----- code/datums/components/pellet_cloud.dm | 12 ++++++------ code/game/machinery/_machinery.dm | 4 ++-- code/game/objects/obj_defense.dm | 12 ++++++------ 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 0a9ace90a31..bc3d802e481 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -232,13 +232,11 @@ if(!attacking_item.force) return - var/no_damage = TRUE - if(take_damage(attacking_item.force, attacking_item.damtype, MELEE, 1)) - no_damage = FALSE + var/damage = take_damage(attacking_item.force, attacking_item.damtype, MELEE, 1) //only witnesses close by and the victim see a hit message. + user.visible_message(span_danger("[user] hits [src] with [attacking_item][damage ? "." : ", without leaving a mark!"]"), \ + span_danger("You hit [src] with [attacking_item][damage ? "." : ", without leaving a mark!"]"), null, COMBAT_MESSAGE_RANGE) log_combat(user, src, "attacked", attacking_item) - user.visible_message(span_danger("[user] hits [src] with [attacking_item][no_damage ? ", which doesn't leave a mark" : ""]!"), \ - span_danger("You hit [src] with [attacking_item][no_damage ? ", which doesn't leave a mark" : ""]!"), null, COMBAT_MESSAGE_RANGE) /area/attacked_by(obj/item/attacking_item, mob/living/user) CRASH("areas are NOT supposed to have attacked_by() called on them!") diff --git a/code/datums/components/pellet_cloud.dm b/code/datums/components/pellet_cloud.dm index 15bd6a62111..7888d705e23 100644 --- a/code/datums/components/pellet_cloud.dm +++ b/code/datums/components/pellet_cloud.dm @@ -235,7 +235,7 @@ terminated++ hits++ var/obj/item/bodypart/hit_part - var/no_damage = FALSE + var/damage = TRUE if(iscarbon(target) && hit_zone) var/mob/living/carbon/hit_carbon = target hit_part = hit_carbon.get_bodypart(hit_zone) @@ -253,10 +253,10 @@ else if(isobj(target)) var/obj/hit_object = target if(hit_object.damage_deflection > P.damage || !P.damage) - no_damage = TRUE + damage = FALSE LAZYADDASSOC(targets_hit[target], "hits", 1) - LAZYSET(targets_hit[target], "no damage", no_damage) + LAZYSET(targets_hit[target], "damage", damage) if(targets_hit[target]["hits"] == 1) RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/on_target_qdel, override=TRUE) UnregisterSignal(P, list(COMSIG_PARENT_QDELETING, COMSIG_PROJECTILE_RANGE_OUT, COMSIG_PROJECTILE_SELF_ON_HIT)) @@ -298,7 +298,7 @@ for(var/atom/target in targets_hit) var/num_hits = targets_hit[target]["hits"] - var/did_damage = targets_hit[target]["no damage"] + var/damage = targets_hit[target]["damage"] UnregisterSignal(target, COMSIG_PARENT_QDELETING) var/obj/item/bodypart/hit_part if(isbodypart(target)) @@ -313,10 +313,10 @@ hit_part.painless_wound_roll(wound_type, damage_dealt, w_bonus, bw_bonus, initial(P.sharpness)) if(num_hits > 1) - target.visible_message(span_danger("[target] is hit by [num_hits] [proj_name][plural_s(proj_name)][hit_part ? " in the [hit_part.name]" : ""][did_damage ? ", which don't leave a mark" : ""]!"), null, null, COMBAT_MESSAGE_RANGE, target) + target.visible_message(span_danger("[target] is hit by [num_hits] [proj_name][plural_s(proj_name)][hit_part ? " in the [hit_part.name]" : ""][damage ? "" : ", without leaving a mark"]!"), null, null, COMBAT_MESSAGE_RANGE, target) to_chat(target, span_userdanger("You're hit by [num_hits] [proj_name]s[hit_part ? " in the [hit_part.name]" : ""]!")) else - target.visible_message(span_danger("[target] is hit by a [proj_name][hit_part ? " in the [hit_part.name]" : ""][did_damage ? ", which doesn't leave a mark" : ""]!"), null, null, COMBAT_MESSAGE_RANGE, target) + target.visible_message(span_danger("[target] is hit by a [proj_name][hit_part ? " in the [hit_part.name]" : ""][damage ? "" : ", without leaving a mark"]!"), null, null, COMBAT_MESSAGE_RANGE, target) to_chat(target, span_userdanger("You're hit by a [proj_name][hit_part ? " in the [hit_part.name]" : ""]!")) for(var/M in purple_hearts) diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index 7a4ca3e0c1f..41696106693 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -607,8 +607,8 @@ return attack_hand(user) user.changeNext_move(CLICK_CD_MELEE) user.do_attack_animation(src, ATTACK_EFFECT_PUNCH) - user.visible_message(span_danger("[user.name] smashes against \the [src.name] with its paws."), null, null, COMBAT_MESSAGE_RANGE) - take_damage(4, BRUTE, MELEE, 1) + var/damage = take_damage(4, BRUTE, MELEE, 1) + user.visible_message(span_danger("[user] smashes [src] with [user.p_their()] paws[damage ? "." : ", without leaving a mark!"]"), null, null, COMBAT_MESSAGE_RANGE) /obj/machinery/attack_hulk(mob/living/carbon/user) . = ..() diff --git a/code/game/objects/obj_defense.dm b/code/game/objects/obj_defense.dm index 2c406c72fa6..b2aa3aa711d 100644 --- a/code/game/objects/obj_defense.dm +++ b/code/game/objects/obj_defense.dm @@ -24,20 +24,20 @@ /obj/bullet_act(obj/projectile/P) . = ..() playsound(src, P.hitsound, 50, TRUE) - var/no_damage = FALSE - if(!QDELETED(src) && !take_damage(P.damage, P.damage_type, P.flag, 0, turn(P.dir, 180), P.armour_penetration)) //Bullet on_hit effect might have already destroyed this object - no_damage = TRUE + var/damage + if(!QDELETED(src)) //Bullet on_hit effect might have already destroyed this object + damage = take_damage(P.damage, P.damage_type, P.flag, 0, turn(P.dir, 180), P.armour_penetration) if(P.suppressed != SUPPRESSED_VERY) - visible_message(span_danger("[src] is hit by \a [P][no_damage ? ", which doesn't leave a mark" : ""]!"), null, null, COMBAT_MESSAGE_RANGE) + visible_message(span_danger("[src] is hit by \a [P][damage ? "" : ", without leaving a mark"]!"), null, null, COMBAT_MESSAGE_RANGE) /obj/attack_hulk(mob/living/carbon/human/user) ..() - user.visible_message(span_danger("[user] smashes [src]!"), span_danger("You smash [src]!"), null, COMBAT_MESSAGE_RANGE) if(density) playsound(src, 'sound/effects/meteorimpact.ogg', 100, TRUE) else playsound(src, 'sound/effects/bang.ogg', 50, TRUE) - take_damage(hulk_damage(), BRUTE, MELEE, 0, get_dir(src, user)) + var/damage = take_damage(hulk_damage(), BRUTE, MELEE, 0, get_dir(src, user)) + user.visible_message(span_danger("[user] smashes [src][damage ? "" : ", without leaving a mark"]!"), span_danger("You smash [src][damage ? "" : ", without leaving a mark"]!"), null, COMBAT_MESSAGE_RANGE) return TRUE /obj/blob_act(obj/structure/blob/B)