Adds a cancel combo button for krav maga (#15543)

* pew pew

* uhhh yes

* tumblr moment

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
This commit is contained in:
hal9000PR
2021-03-14 13:03:30 +00:00
committed by GitHub
co-authored by AffectedArc07
parent 829bbd802b
commit 181d282848
5 changed files with 24 additions and 2 deletions
@@ -11,4 +11,5 @@
target.apply_damage(5, BRUTE)
target.Weaken(2)
add_attack_logs(user, target, "Melee attacked with martial-art [src] : Leg Sweep", ATKLOG_ALL)
user.mind.martial_art.in_stance = FALSE
return MARTIAL_COMBO_DONE_CLEAR_COMBOS
@@ -9,4 +9,5 @@
target.AdjustLoseBreath(5)
target.adjustOxyLoss(10)
add_attack_logs(user, target, "Melee attacked with martial-art [src] : Lung Punch", ATKLOG_ALL)
user.mind.martial_art.in_stance = FALSE
return MARTIAL_COMBO_DONE_CLEAR_COMBOS
@@ -6,7 +6,8 @@
target.visible_message("<span class='warning'>[user] karate chops [target]'s neck!</span>", \
"<span class='userdanger'>[user] karate chops your neck, rendering you unable to speak for a short time!</span>")
playsound(get_turf(user), 'sound/effects/hit_punch.ogg', 50, 1, -1)
target.apply_damage(5, BRUTE)
target.apply_damage(5, BRUTE, BODY_ZONE_HEAD)
target.AdjustSilence(10)
add_attack_logs(user, target, "Melee attacked with martial-art [src] : Neck Chop", ATKLOG_ALL)
user.mind.martial_art.in_stance = FALSE
return MARTIAL_COMBO_DONE_CLEAR_COMBOS
+19 -1
View File
@@ -3,6 +3,20 @@
var/datum/action/neck_chop/neckchop = new/datum/action/neck_chop()
var/datum/action/leg_sweep/legsweep = new/datum/action/leg_sweep()
var/datum/action/lung_punch/lungpunch = new/datum/action/lung_punch()
var/datum/action/neutral_stance/neutral = new/datum/action/neutral_stance()
/datum/action/neutral_stance
name = "Neutral Stance - You relax, cancelling your last Krav Maga stance attack."
button_icon_state = "neutralstance"
/datum/action/neutral_stance/Trigger()
var/mob/living/carbon/human/H = owner
if(!H.mind.martial_art.in_stance)
to_chat(owner, "<b><i>You cannot cancel an attack you haven't prepared!</i></b>")
return
to_chat(owner, "<b><i>You cancel your prepared attack.</i></b>")
owner.visible_message("<span class='danger'> [owner] relaxes [owner.p_their()] stance.</span>")
H.mind.martial_art.combos.Cut()
/datum/action/neck_chop
name = "Neck Chop - Injures the neck, stopping the victim from speaking for a while."
@@ -18,7 +32,7 @@
H.mind.martial_art.combos.Cut()
H.mind.martial_art.combos.Add(/datum/martial_combo/krav_maga/neck_chop)
H.mind.martial_art.reset_combos()
H.mind.martial_art.in_stance = TRUE
/datum/action/leg_sweep
name = "Leg Sweep - Trips the victim, rendering them prone and unable to move for a short time."
button_icon_state = "legsweep"
@@ -33,6 +47,7 @@
H.mind.martial_art.combos.Cut()
H.mind.martial_art.combos.Add(/datum/martial_combo/krav_maga/leg_sweep)
H.mind.martial_art.reset_combos()
H.mind.martial_art.in_stance = TRUE
/datum/action/lung_punch//referred to internally as 'quick choke'
name = "Lung Punch - Delivers a strong punch just above the victim's abdomen, constraining the lungs. The victim will be unable to breathe for a short time."
@@ -48,11 +63,13 @@
H.mind.martial_art.combos.Cut()
H.mind.martial_art.combos.Add(/datum/martial_combo/krav_maga/lung_punch)
H.mind.martial_art.reset_combos()
H.mind.martial_art.in_stance = TRUE
/datum/martial_art/krav_maga/teach(mob/living/carbon/human/H, make_temporary=0)
..()
to_chat(H, "<span class = 'userdanger'>You know the arts of Krav Maga!</span>")
to_chat(H, "<span class = 'danger'>Place your cursor over a move at the top of the screen to see what it does.</span>")
neutral.Grant(H)
neckchop.Grant(H)
legsweep.Grant(H)
lungpunch.Grant(H)
@@ -60,6 +77,7 @@
/datum/martial_art/krav_maga/remove(mob/living/carbon/human/H)
..()
to_chat(H, "<span class = 'userdanger'>You suddenly forget the arts of Krav Maga...</span>")
neutral.Remove(H)
neckchop.Remove(H)
legsweep.Remove(H)
lungpunch.Remove(H)
+1
View File
@@ -18,6 +18,7 @@
var/list/combos = list() // What combos can the user do? List of combo types
var/list/datum/martial_art/current_combos = list() // What combos are currently (possibly) being performed
var/last_hit = 0 // When the last hit happened
var/in_stance = FALSE // If the user is preparing a martial arts stance
/datum/martial_art/New()
. = ..()