diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm index d2dea3c502..a6e85fadb8 100644 --- a/code/game/objects/items/melee/misc.dm +++ b/code/game/objects/items/melee/misc.dm @@ -260,6 +260,8 @@ var/stam_dmg = 30 var/cooldown_check = 0 // Used internally, you don't want to modify var/cooldown = 13 // Default wait time until can stun again. + /// block mitigation needed to prevent knockdown/disarms + var/block_percent_to_counter = 50 var/stun_time_silicon = 60 // How long it stuns silicons for - 6 seconds. var/affect_silicon = FALSE // Does it stun silicons. var/on_sound // "On" sound, played when switching between able to stun or not. @@ -354,7 +356,8 @@ if(cooldown_check < world.time) if(!UseStaminaBufferStandard(user, STAM_COST_BATON_MOB_MULT, warn = TRUE)) return DISCARD_LAST_ACTION - if(target.mob_run_block(src, 0, "[user]'s [name]", ATTACK_TYPE_MELEE, 0, user, null, null) & BLOCK_SUCCESS) + var/list/block_return = list() + if(target.mob_run_block(src, 0, "[user]'s [name]", ATTACK_TYPE_MELEE, 0, user, null, block_return) & BLOCK_SUCCESS) playsound(target, 'sound/weapons/genhit.ogg', 50, 1) return if(ishuman(target)) @@ -365,7 +368,8 @@ if(stun_animation) user.do_attack_animation(target) playsound(get_turf(src), on_stun_sound, 75, 1, -1) - target.DefaultCombatKnockdown(softstun_ds, TRUE, FALSE, hardstun_ds, stam_dmg) + var/countered = block_return[BLOCK_RETURN_MITIGATION_PERCENT] > block_percent_to_counter + target.DefaultCombatKnockdown(softstun_ds, TRUE, FALSE, countered? 0 : hardstun_ds, stam_dmg, !countered) additional_effects_carbon(target, user) log_combat(user, target, "stunned", src) add_fingerprint(user) diff --git a/code/game/objects/items/stunbaton.dm b/code/game/objects/items/stunbaton.dm index 11c8716bc2..862b2c8c3e 100644 --- a/code/game/objects/items/stunbaton.dm +++ b/code/game/objects/items/stunbaton.dm @@ -20,7 +20,7 @@ var/turned_on = FALSE var/knockdown = TRUE /// block percent needed to prevent knockdown/disarm - var/block_percent_to_counter = 60 + var/block_percent_to_counter = 50 var/obj/item/stock_parts/cell/cell var/hitcost = 750 var/throw_hit_chance = 35 @@ -204,7 +204,7 @@ if(!disarming) if(knockdown && !countered) - L.DefaultCombatKnockdown(50, override_stamdmg = 0) //knockdown + L.DefaultCombatKnockdown(50, override_stamdmg = 0, knocktofloor = !countered) //knockdown L.adjustStaminaLoss(stunpwr) else if(!countered) L.drop_all_held_items() //no knockdown/stamina damage, instead disarm. @@ -314,7 +314,7 @@ force = 3 throwforce = 5 stamforce = 35 - block_percent_to_counter = 45 + block_percent_to_counter = 30 hitcost = 1000 throw_hit_chance = 10 slot_flags = ITEM_SLOT_BACK diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 87fd0cf609..389f5ee5b5 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -4,7 +4,8 @@ // ignore_castun = same logic as Paralyze() in general // override_duration = If this is set, does Paralyze() for this duration. // override_stam = If this is set, does this amount of stamina damage. -/mob/living/proc/DefaultCombatKnockdown(amount, updating = TRUE, ignore_canknockdown = FALSE, override_hardstun, override_stamdmg) +// knocktofloor - whether to knock them to the ground +/mob/living/proc/DefaultCombatKnockdown(amount, updating = TRUE, ignore_canknockdown = FALSE, override_hardstun, override_stamdmg, knocktofloor = TRUE) if(!iscarbon(src)) return Paralyze(amount, updating, ignore_canknockdown) if(!ignore_canknockdown && !(status_flags & CANKNOCKDOWN)) @@ -13,7 +14,8 @@ buckled.unbuckle_mob(src) var/drop_items = amount > 80 //80 is cutoff for old item dropping behavior var/stamdmg = isnull(override_stamdmg)? (amount * 0.25) : override_stamdmg - KnockToFloor(drop_items, TRUE, updating) + if(knocktofloor) + KnockToFloor(drop_items, TRUE, updating) adjustStaminaLoss(stamdmg) if(!isnull(override_hardstun)) Paralyze(override_hardstun)