Skip to content

Commit

Permalink
Fixes an issue with limited martial arts (ParadiseSS13#24187)
Browse files Browse the repository at this point in the history
* GDNNNNNNNN

* This too
  • Loading branch information
Contrabang authored Feb 16, 2024
1 parent a2a3d84 commit 22728cf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/martial_arts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define MARTIAL_COMBO_DONE_CLEAR_COMBOS 5 // If the combo should do a basic hit after it's done

#define MARTIAL_ARTS_CANNOT_USE -1
#define MARTIAL_ARTS_ACT_SUCCESS 1

#define MARTIAL_COMBO_STEP_HARM "Harm"
#define MARTIAL_COMBO_STEP_DISARM "Disarm"
Expand Down
8 changes: 4 additions & 4 deletions code/modules/martial_arts/martial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,19 @@
if(MARTIAL_COMBO_FAIL)
current_combos -= MC
if(MARTIAL_COMBO_DONE_NO_CLEAR)
. = TRUE
. = MARTIAL_ARTS_ACT_SUCCESS
current_combos -= MC
if(MARTIAL_COMBO_DONE)
reset_combos()
return TRUE
return MARTIAL_ARTS_ACT_SUCCESS
if(MARTIAL_COMBO_DONE_BASIC_HIT)
basic_hit(user, target)
reset_combos()
return TRUE
return MARTIAL_ARTS_ACT_SUCCESS
if(MARTIAL_COMBO_DONE_CLEAR_COMBOS)
combos.Cut()
reset_combos()
return TRUE
return MARTIAL_ARTS_ACT_SUCCESS
if(!LAZYLEN(current_combos))
reset_combos()
if(HAS_COMBOS && could_start_new_combo)
Expand Down
8 changes: 4 additions & 4 deletions code/modules/mob/living/carbon/human/species/_species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@
return

/datum/species/proc/help(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style)
if(attacker_style && attacker_style.help_act(user, target))//adminfu only...
if(attacker_style && attacker_style.help_act(user, target) == MARTIAL_ARTS_ACT_SUCCESS)//adminfu only...
return TRUE
if(target.on_fire)
user.pat_out(target)
Expand All @@ -500,7 +500,7 @@
if(target.check_block())
target.visible_message("<span class='warning'>[target] blocks [user]'s grab attempt!</span>")
return FALSE
if(attacker_style && attacker_style.grab_act(user, target))
if(attacker_style && attacker_style.grab_act(user, target) == MARTIAL_ARTS_ACT_SUCCESS)
return TRUE
else
target.grabbedby(user)
Expand Down Expand Up @@ -532,7 +532,7 @@
return FALSE
if(SEND_SIGNAL(target, COMSIG_HUMAN_ATTACKED, user) & COMPONENT_CANCEL_ATTACK_CHAIN)
return FALSE
if(attacker_style && attacker_style.harm_act(user, target))
if(attacker_style && attacker_style.harm_act(user, target) == MARTIAL_ARTS_ACT_SUCCESS)
return TRUE
else
var/datum/unarmed_attack/attack = user.dna.species.unarmed
Expand Down Expand Up @@ -587,7 +587,7 @@
user.do_attack_animation(target, ATTACK_EFFECT_DISARM)
playsound(target.loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
return FALSE
if(attacker_style && attacker_style.disarm_act(user, target))
if(attacker_style && attacker_style.disarm_act(user, target) == MARTIAL_ARTS_ACT_SUCCESS)
return TRUE
user.do_attack_animation(target, ATTACK_EFFECT_DISARM)
if(target.move_resist > user.pull_force)
Expand Down

0 comments on commit 22728cf

Please sign in to comment.