From 722979b2881dcb781641ff66890e70767f3a8772 Mon Sep 17 00:00:00 2001 From: VoiceInYourHead Date: Wed, 29 May 2024 13:21:58 +0300 Subject: [PATCH] Combat stances FIX --- mods/_fd/combat_stances/code/item.dm | 4 +++- mods/_fd/combat_stances/code/weapons.dm | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/mods/_fd/combat_stances/code/item.dm b/mods/_fd/combat_stances/code/item.dm index 76709f7555fe2..cdf7429a3f755 100644 --- a/mods/_fd/combat_stances/code/item.dm +++ b/mods/_fd/combat_stances/code/item.dm @@ -19,7 +19,9 @@ /obj/item/attack_self(mob/living/carbon/user) . = ..() - if(melee_strikes) + var/obj/item/melee/I + + if(melee_strikes && !istype(I, /obj/item/melee/energy/)) swap_stances(user) /obj/item/proc/swap_stances(mob/user) diff --git a/mods/_fd/combat_stances/code/weapons.dm b/mods/_fd/combat_stances/code/weapons.dm index d5d007b11e9a2..93ed7ccd30e7e 100644 --- a/mods/_fd/combat_stances/code/weapons.dm +++ b/mods/_fd/combat_stances/code/weapons.dm @@ -2,6 +2,12 @@ melee_strikes = list(/singleton/combo_strike/swipe_strike/sword_slashes, /singleton/combo_strike/swipe_strike/mixed_combo) lunge_dist = 4 +/obj/item/material/armblade/resolve_attackby(atom/atom, mob/living/user, click_params) + if(!isnull(melee_strike) && !user.skill_check(SKILL_COMBAT, SKILL_EXPERIENCED) && prob(src.fail_chance)) + return 1 + + ..() + /obj/item/material/armblade/claws melee_strikes = list(/singleton/combo_strike/precise_strike/fast_attacks) @@ -18,6 +24,12 @@ fail_chance = 30 lunge_dist = 2 +/obj/item/melee/baton/cattleprod/AltClick(mob/user) + if(melee_strikes) + swap_stances(user) + + ..() + /obj/item/melee/cultblade melee_strikes = list(/singleton/combo_strike/swipe_strike/sword_slashes, /singleton/combo_strike/swipe_strike/mixed_combo) lunge_dist = 3 @@ -26,11 +38,23 @@ melee_strikes = list(/singleton/combo_strike/swipe_strike/sword_slashes, /singleton/combo_strike/swipe_strike/mixed_combo) fail_chance = 40 +/obj/item/melee/energy/sword/AltClick(mob/user) + if(melee_strikes) + swap_stances(user) + + ..() + /obj/item/melee/energy/blade melee_strikes = list(/singleton/combo_strike/swipe_strike/sword_slashes, /singleton/combo_strike/swipe_strike/mixed_combo) fail_chance = 60 lunge_dist = 4 +/obj/item/melee/energy/blade/AltClick(mob/user) + if(melee_strikes) + swap_stances(user) + + ..() + /obj/item/material/harpoon melee_strikes = list(/singleton/combo_strike/swipe_strike/polearm_mixed)