mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 12:05:59 +01:00
[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>
This commit is contained in:
@@ -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!")
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
. = ..()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user