diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index f891d865c9b..028dace01ef 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -207,11 +207,13 @@ /obj/attacked_by(obj/item/I, mob/living/user) if(I.force) - user.visible_message("[user] hits [src] with [I]!", \ - "You hit [src] with [I]!", null, COMBAT_MESSAGE_RANGE) + var/no_damage = TRUE + if(take_damage(I.force, I.damtype, MELEE, 1)) + no_damage = FALSE //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) + user.visible_message("[user] hits [src] with [I][no_damage ? ", which doesn't leave a mark" : ""]!", \ + "You hit [src] with [I][no_damage ? ", which doesn't leave a mark" : ""]!", null, COMBAT_MESSAGE_RANGE) /mob/living/attacked_by(obj/item/I, mob/living/user) send_item_attack_message(I, user) diff --git a/code/datums/components/pellet_cloud.dm b/code/datums/components/pellet_cloud.dm index bcd8becb53d..42014274855 100644 --- a/code/datums/components/pellet_cloud.dm +++ b/code/datums/components/pellet_cloud.dm @@ -234,6 +234,7 @@ terminated++ hits++ var/obj/item/bodypart/hit_part + var/no_damage = FALSE if(iscarbon(target) && hit_zone) var/mob/living/carbon/hit_carbon = target hit_part = hit_carbon.get_bodypart(hit_zone) @@ -248,9 +249,14 @@ wound_info_by_part[hit_part][CLOUD_POSITION_W_BONUS] += P.wound_bonus wound_info_by_part[hit_part][CLOUD_POSITION_BW_BONUS] += P.bare_wound_bonus P.wound_bonus = CANT_WOUND // actual wounding will be handled aggregate + else if(isobj(target)) + var/obj/hit_object = target + if(hit_object.damage_deflection > P.damage || !P.damage) + no_damage = TRUE - targets_hit[target]++ - if(targets_hit[target] == 1) + LAZYADDASSOC(targets_hit[target], "hits", 1) + LAZYSET(targets_hit[target], "no damage", no_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)) if(terminated == num_pellets) @@ -289,7 +295,8 @@ var/proj_name = initial(P.name) for(var/atom/target in targets_hit) - var/num_hits = targets_hit[target] + var/num_hits = targets_hit[target]["hits"] + var/did_damage = targets_hit[target]["no damage"] UnregisterSignal(target, COMSIG_PARENT_QDELETING) var/obj/item/bodypart/hit_part if(isbodypart(target)) @@ -304,10 +311,10 @@ hit_part.painless_wound_roll(wound_type, damage_dealt, w_bonus, bw_bonus, initial(P.sharpness)) if(num_hits > 1) - target.visible_message("[target] is hit by [num_hits] [proj_name]s[hit_part ? " in the [hit_part.name]" : ""]!", null, null, COMBAT_MESSAGE_RANGE, target) + target.visible_message("[target] is hit by [num_hits] [proj_name]s[hit_part ? " in the [hit_part.name]" : ""][did_damage ? ", which don't leave a mark" : ""]!", null, null, COMBAT_MESSAGE_RANGE, target) to_chat(target, "You're hit by [num_hits] [proj_name]s[hit_part ? " in the [hit_part.name]" : ""]!") else - target.visible_message("[target] is hit by a [proj_name][hit_part ? " in the [hit_part.name]" : ""]!", null, null, COMBAT_MESSAGE_RANGE, target) + target.visible_message("[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) to_chat(target, "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/objects/obj_defense.dm b/code/game/objects/obj_defense.dm index 95f67108db3..eb53491ab78 100644 --- a/code/game/objects/obj_defense.dm +++ b/code/game/objects/obj_defense.dm @@ -75,10 +75,11 @@ /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 if(P.suppressed != SUPPRESSED_VERY) - visible_message("[src] is hit by \a [P]!", null, null, COMBAT_MESSAGE_RANGE) - if(!QDELETED(src)) //Bullet on_hit effect might have already destroyed this object - take_damage(P.damage, P.damage_type, P.flag, 0, turn(P.dir, 180), P.armour_penetration) + visible_message("[src] is hit by \a [P][no_damage ? ", which doesn't leave a mark" : ""]!", null, null, COMBAT_MESSAGE_RANGE) ///Called to get the damage that hulks will deal to the obj. /obj/proc/hulk_damage()