From 61039d3aa98974c8c0f23caed5ce99b9d6bcebf5 Mon Sep 17 00:00:00 2001 From: MistakeNot4892 Date: Thu, 24 Dec 2020 18:15:22 +1100 Subject: [PATCH 1/2] Merge pull request #1054 from NataKilar/wall-damage-fixes Reworks wall attacking --- code/game/turfs/simulated/wall_attacks.dm | 33 +++++++++++++---------- code/game/turfs/simulated/walls.dm | 2 +- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index 06d352fcb8a..e6eb3a32533 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -339,7 +339,7 @@ return TRUE // Attack the wall with items - if(istype(W,/obj/item/rcd) || !istype(W, /obj/item/chems)) + if(istype(W,/obj/item/rcd) || istype(W, /obj/item/chems)) return if(!W.force) return @@ -347,18 +347,23 @@ var/mob/living/L = user if(L.a_intent == I_HELP) return - var/dam_threshhold = material.integrity - if(reinf_material) - dam_threshhold = ceil(max(dam_threshhold,reinf_material.integrity)/2) - var/dam_prob = min(100,material.hardness*1.5) - if(dam_prob < 100 && W.force > (dam_threshhold/10)) - playsound(src, 'sound/effects/metalhit.ogg', 50, 1) - if(!prob(dam_prob)) - visible_message("\The [user] attacks \the [src] with \the [W] and it [material.destruction_desc]!") - dismantle_wall(1) - else - visible_message("\The [user] attacks \the [src] with \the [W]!") - else - visible_message("\The [user] attacks \the [src] with \the [W], but it bounces off!") + + user.do_attack_animation(src) + if(W.force < 5) + visible_message(SPAN_DANGER("\The [user] [pick(W.attack_verb)] \the [src] with \the [W], but it had no effect!")) playsound(src, hitsound, 25, 1) + return + // Check for a glancing blow. + var/dam_prob = max(0, 100 - material.hardness + W.force) + if(!prob(dam_prob)) + visible_message(SPAN_DANGER("\The [user] [pick(W.attack_verb)] \the [src] with \the [W], but it bounced off!")) + playsound(src, hitsound, 25, 1) + if(user.skill_fail_prob(SKILL_HAULING, 40, SKILL_ADEPT)) + user.Weaken(2) + visible_message(SPAN_DANGER("\The [user] is knocked back by the force of the blow!")) + return + + playsound(src, 'sound/effects/metalhit.ogg', 50, 1) + visible_message(SPAN_DANGER("\The [user] [pick(W.attack_verb)] \the [src] with \the [W]!")) + take_damage(10) return TRUE \ No newline at end of file diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index edfb05efda3..f9788063edc 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -198,7 +198,7 @@ var/list/wall_noblend_objects = list( cap = cap / 10 if(damage >= cap) - dismantle_wall() + dismantle_wall(1) else update_icon() From 81be4c141576dd376d91f4bbe4fbe1015f7969c4 Mon Sep 17 00:00:00 2001 From: SkyratBot Date: Thu, 24 Dec 2020 02:16:22 -0500 Subject: [PATCH 2/2] Reworks wall attacking