From 706132899ed416792211adc95d14bc096cd46066 Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Sun, 8 Feb 2026 15:59:14 -0700 Subject: [PATCH] [MIRROR] Changes some elements of punch code and shredding (#12373) Co-authored-by: Olive <49600480+zeskorion@users.noreply.github.com> --- code/game/machinery/camera/camera.dm | 2 +- code/game/machinery/doors/windowdoor.dm | 2 +- code/game/mecha/mecha.dm | 15 ++++++++------- code/game/objects/structures.dm | 5 +++-- code/game/objects/structures/grille.dm | 2 +- code/game/objects/structures/window.dm | 5 +++-- .../living/carbon/human/species/species.dm | 19 ++++++++++++------- .../carbon/human/species/species_attack.dm | 4 ++-- .../modules/mob/living/silicon/robot/robot.dm | 5 +++-- code/modules/power/apc.dm | 3 ++- code/modules/power/lighting.dm | 2 +- 11 files changed, 37 insertions(+), 27 deletions(-) diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index f28bb5905b..7918bf8f55 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -138,7 +138,7 @@ if(!istype(user)) return - if(user.species.can_shred(user)) + if(user.species.can_shred(user, FALSE, 11)) set_status(0) user.do_attack_animation(src) user.setClickCooldown(user.get_attack_speed()) diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index c3a40867d6..caeae018a4 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -166,7 +166,7 @@ if(ishuman(user)) var/mob/living/carbon/human/H = user - if(H.species.can_shred(H)) + if(H.species.can_shred(H, FALSE, 15)) playsound(src, 'sound/effects/Glasshit.ogg', 75, 1) visible_message(span_danger("[user] smashes against the [src.name]."), 1) user.do_attack_animation(src) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index d48ee1101c..f7ca0f9305 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -1091,19 +1091,20 @@ if(ishuman(user)) var/mob/living/carbon/human/H = user - if(H.species.can_shred(user)) + var/shreddamage = H.species.can_shred(user, FALSE, 13) + if(shreddamage) if(!prob(temp_deflect_chance)) - src.take_damage(15) //The take_damage() proc handles armor values - if(prob(25)) //Why would they get free internal damage. At least make it a bit RNG. + src.take_damage(shreddamage) //The take_damage() proc handles armor values + if(prob(shreddamage)) //Why would they get free internal damage. At least make it a bit RNG. src.check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST)) playsound(src, 'sound/weapons/slash.ogg', 50, 1, -1) - to_chat(user, span_danger("You slash at the armored suit!")) - visible_message(span_danger("\The [user] slashes at [src.name]'s armor!")) + to_chat(user, span_danger("You attack the armored suit!")) + visible_message(span_danger("\The [user] attacks [src.name]'s armor!")) else src.log_append_to_last("Armor saved.") playsound(src, 'sound/weapons/slash.ogg', 50, 1, -1) - to_chat(user, span_danger("Your claws had no effect!")) - src.occupant_message(span_notice("\The [user]'s claws are stopped by the armor.")) + to_chat(user, span_danger("Your attack had no effect!")) + src.occupant_message(span_notice("\The [user]'s attack is stopped by the armor.")) visible_message(span_warning("\The [user] rebounds off [src.name]'s armor!")) else user.visible_message(span_danger("\The [user] hits \the [src]. Nothing happens."),span_danger("You hit \the [src] with no visible effect.")) diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index f193c93634..eeead760a3 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -24,8 +24,9 @@ attack_generic(user,1,"smashes") else if(ishuman(user)) var/mob/living/carbon/human/H = user - if(H.species.can_shred(user)) - attack_generic(user,1,"slices") + var/shreddamage = H.species.can_shred(user, FALSE, 11) + if(shreddamage) + attack_generic(user, shreddamage, "attacks") SEND_SIGNAL(src, COMSIG_CLIMBABLE_SHAKE_CLIMBERS, user) return ..() diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 9961199dcf..7ac6bc7525 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -34,7 +34,7 @@ var/attack_message = "kicks" if(ishuman(user)) var/mob/living/carbon/human/H = user - if(H.species.can_shred(H)) + if(H.species.can_shred(H, FALSE, 10)) attack_message = "mangles" damage_dealt = 5 diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index d4f490f488..ad4b062be8 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -201,8 +201,9 @@ if(ishuman(user)) var/mob/living/carbon/human/H = user - if(H.species.can_shred(H)) - attack_generic(H,25) + var/shreddamage = H.species.can_shred(H, FALSE, 15) + if(shreddamage) + attack_generic(H, shreddamage + 5, "attacks") return playsound(src, 'sound/effects/glassknock.ogg', 80, 1) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 122af1c197..65a31fd24a 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -634,20 +634,25 @@ /datum/species/proc/can_understand(var/mob/other) return -// Called when using the shredding behavior. -/datum/species/proc/can_shred(var/mob/living/carbon/human/H, var/ignore_intent) +// Called when using the shredding behavior, returning unarmed damage value +//CheckHighDamage returns the damage value of the attack if it meets at least the noted value +/datum/species/proc/can_shred(var/mob/living/carbon/human/H, var/ignore_intent, var/checkhighdamage = 0) if(!ignore_intent && H.a_intent != I_HURT) return 0 - if(shredding) - return 1 + + var/damage = 0 + var/shreds = (shredding * 5) + for(var/datum/unarmed_attack/attack in unarmed_attacks) if(!attack.is_usable(H)) continue + damage = max(damage, attack.get_unarmed_damage(H) + 5) if(attack.shredding) - return 1 - - return 0 + shreds = 5 + if((checkhighdamage && damage >= checkhighdamage) || shreds) + shreds += damage + return shreds // Called in life() when the mob has no client. /datum/species/proc/handle_npc(var/mob/living/carbon/human/H) diff --git a/code/modules/mob/living/carbon/human/species/species_attack.dm b/code/modules/mob/living/carbon/human/species/species_attack.dm index 3c31dd03d2..79760d5db2 100644 --- a/code/modules/mob/living/carbon/human/species/species_attack.dm +++ b/code/modules/mob/living/carbon/human/species/species_attack.dm @@ -170,12 +170,12 @@ /datum/unarmed_attack/claws/chimera/get_unarmed_damage(var/mob/living/carbon/human/user) if(HAS_TRAIT(user, TRAIT_NONLETHAL_BLOWS) && !user.get_feralness())//don't add extra species strength when pulling punches, but can't pull punches when feral return damage - return user.species.unarmed_bonus + (user.get_feralness()/5) + return user.species.unarmed_bonus + damage + min(user.get_feralness()/5, 40) /datum/unarmed_attack/claws/chimera/apply_effects(var/mob/living/carbon/human/user,var/mob/living/carbon/human/target,var/armour,var/attack_damage,var/zone) ..() if(user.get_feralness() && !(target == user)) - var/selfdamage = ((user.get_feralness()/10)-7.5) + var/selfdamage = (min((user.get_feralness()/10), 20)-7.5) if(selfdamage > 0) var/selfdamagezone = null if (user.hand) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 189e7fc5a2..edbd5adbc0 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -920,8 +920,9 @@ return if(I_HURT) H.do_attack_animation(src) - if(H.species.can_shred(H)) - attack_generic(H, rand(30,50), "slashed") + var/shreddamage = H.species.can_shred(H, FALSE, 15) + if(shreddamage) + attack_generic(H, shreddamage, "attacked") return else playsound(src.loc, 'sound/effects/bang.ogg', 10, 1) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index c8ff92470d..1cc944b921 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -738,10 +738,11 @@ GLOBAL_LIST_EMPTY(apcs) if(ishuman(user)) var/mob/living/carbon/human/H = user - if(H.species.can_shred(H)) + if(H.species.can_shred(H, FALSE, 14)) user.setClickCooldown(user.get_attack_speed()) user.visible_message(span_warning("[user.name] slashes at the [name]!"), span_notice("You slash at the [name]!")) playsound(src, 'sound/weapons/slash.ogg', 100, 1) + add_hiddenprint(H) var/allcut = wires.is_all_cut() diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index d48c55a4f0..e05d715e63 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -797,7 +797,7 @@ GLOBAL_LIST_EMPTY(light_type_cache) if(ishuman(user)) var/mob/living/carbon/human/H = user - if(H.species.can_shred(H)) + if(H.species.can_shred(H, FALSE, 10)) user.setClickCooldown(user.get_attack_speed()) for(var/mob/M in viewers(src)) M.show_message(span_red("[user.name] smashed the light!"), 3, "You hear a tinkle of breaking glass", 2)