Adds the damage roll into a proc checked on each of the harm, disarm and grab acts and before a combo is complete, and also checks for whether we are in combat mode, lying down or if the target is in combat mode

This commit is contained in:
necromanceranne
2020-04-06 15:01:59 +10:00
parent 35f96a1c24
commit ff4847b441
10 changed files with 61 additions and 29 deletions
+13 -2
View File
@@ -10,7 +10,7 @@
var/help_verb
var/pacifism_check = TRUE //are the martial arts combos/attacks unable to be used by pacifist.
var/allow_temp_override = TRUE //if this martial art can be overridden by temporary martial arts
var/damage_base //this is set on teach and is a random value between your species punchdamagelow and punchdamagehigh
var/damage_base //this is set by damage_roll proc and is a random value between your species punchdamagelow and punchdamagehigh.
/datum/martial_art/proc/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
return FALSE
@@ -36,6 +36,18 @@
current_target = new_target
streak = ""
/datum/martial_art/proc/damage_roll(mob/living/carbon/human/A, mob/living/carbon/human/D)
//Here we roll for our damage to be added into the damage_base var. This is changed depending on whether we are in combat mode, lying down, or if our target is in combat mode.
var/damage = rand(A.dna.species.punchdamagelow, A.dna.species.punchdamagehigh)
if(!(D.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
damage *= 1.5
if(!CHECK_MOBILITY(A, MOBILITY_STAND))
damage *= 0.5
if(!(A.combat_flags & COMBAT_FLAG_COMBAT_ACTIVE))
damage *= 0.25
damage_base = damage
return
/datum/martial_art/proc/teach(mob/living/carbon/human/H, make_temporary = FALSE)
if(!istype(H) || !H.mind)
return FALSE
@@ -52,7 +64,6 @@
H.verbs += help_verb
H.mind.martial_art = src
ADD_TRAIT(H, TRAIT_PUGILIST, MARTIAL_ARTIST_TRAIT)
damage_base = rand(H.dna.species.punchdamagelow, H.dna.species.punchdamagehigh)
return TRUE
/datum/martial_art/proc/store(datum/martial_art/M,mob/living/carbon/human/H)
+1 -1
View File
@@ -16,7 +16,7 @@
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
var/atk_verb = pick("left hook","right hook","straight punch")
damage_roll(A,D)
var/extra_damage = damage_base
if(extra_damage == A.dna.species.punchdamagelow)
playsound(D.loc, A.dna.species.miss_sound, 25, 1, -1)
+3
View File
@@ -113,6 +113,7 @@
/datum/martial_art/cqc/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(A.a_intent == INTENT_GRAB && A!=D && can_use(A)) // A!=D prevents grabbing yourself
add_to_streak("G",D)
damage_roll(A,D)
if(check_streak(A,D)) //if a combo is made no grab upgrade is done
return TRUE
old_grab_state = A.grab_state
@@ -130,6 +131,7 @@
if(!can_use(A))
return FALSE
add_to_streak("H",D)
damage_roll(A,D)
if(check_streak(A,D))
return TRUE
log_combat(A, D, "attacked (CQC)")
@@ -160,6 +162,7 @@
if(!can_use(A))
return FALSE
add_to_streak("D",D)
damage_roll(A,D)
var/obj/item/I = null
if(check_streak(A,D))
return TRUE
+3
View File
@@ -132,6 +132,7 @@
if(check_streak(A,D))
return TRUE
log_combat(A, D, "grabbed (Krav Maga)")
damage_roll(A,D)
..()
/datum/martial_art/krav_maga/harm_act(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
@@ -140,6 +141,7 @@
if(check_streak(A,D))
return TRUE
log_combat(A, D, "punched")
damage_roll(A,D)
var/picked_hit_type = pick("punches", "kicks")
var/bonus_damage = 0
if(CHECK_MOBILITY(D, MOBILITY_STAND))
@@ -162,6 +164,7 @@
return TRUE
var/obj/item/bodypart/affecting = D.get_bodypart(ran_zone(A.zone_selected))
var/armor_block = D.run_armor_check(affecting, "melee")
damage_roll(A,D)
if(D.mobility_flags & MOBILITY_STAND)
D.visible_message("<span class='danger'>[A] reprimands [D]!</span>", \
"<span class='userdanger'>You're slapped by [A]!</span>", "<span class='hear'>You hear a sickening sound of flesh hitting flesh!</span>", COMBAT_MESSAGE_RANGE, A)
+1
View File
@@ -7,6 +7,7 @@
to_chat(A, "<span class='spider'>You begin to wind up an attack...</span>")
if(!do_after(A, 25, target = D))
to_chat(A, "<span class='spider'><b>Your attack was interrupted!</b></span>")
damage_roll(A,D)
return TRUE //martial art code was a mistake
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
atk_verb = pick("punches", "smashes", "ruptures", "cracks")
+3
View File
@@ -65,18 +65,21 @@
/datum/martial_art/plasma_fist/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
add_to_streak("H",D)
damage_roll(A,D)
if(check_streak(A,D))
return TRUE
return FALSE
/datum/martial_art/plasma_fist/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
add_to_streak("D",D)
damage_roll(A,D)
if(check_streak(A,D))
return TRUE
return FALSE
/datum/martial_art/plasma_fist/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
add_to_streak("G",D)
damage_roll(A,D)
if(check_streak(A,D))
return TRUE
return FALSE
+3
View File
@@ -4,12 +4,15 @@
pacifism_check = FALSE //Quite uncontrollable and unpredictable, people will still end up harming others with it.
/datum/martial_art/psychotic_brawling/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
damage_roll(A,D)
return psycho_attack(A,D)
/datum/martial_art/psychotic_brawling/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
damage_roll(A,D)
return psycho_attack(A,D)
/datum/martial_art/psychotic_brawling/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
damage_roll(A,D)
return psycho_attack(A,D)
/datum/martial_art/psychotic_brawling/proc/psycho_attack(mob/living/carbon/human/A, mob/living/carbon/human/D)
+3
View File
@@ -156,18 +156,21 @@
/datum/martial_art/the_rising_bass/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
add_to_streak("D",D)
damage_roll(A,D)
if(check_streak(A,D))
return TRUE
return ..()
/datum/martial_art/the_rising_bass/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
add_to_streak("H",D)
damage_roll(A,D)
if(check_streak(A,D))
return TRUE
return ..()
/datum/martial_art/the_rising_bass/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
add_to_streak("G",D)
damage_roll(A,D)
if(check_streak(A,D))
return TRUE
return ..()
+3
View File
@@ -78,6 +78,7 @@
/datum/martial_art/the_sleeping_carp/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
add_to_streak("G",D)
damage_roll(A,D)
if(check_streak(A,D))
return TRUE
log_combat(A, D, "grabbed (Sleeping Carp)")
@@ -85,6 +86,7 @@
/datum/martial_art/the_sleeping_carp/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
add_to_streak("H",D)
damage_roll(A,D)
if(check_streak(A,D))
return TRUE
var/obj/item/bodypart/affecting = D.get_bodypart(ran_zone(A.zone_selected))
@@ -101,6 +103,7 @@
/datum/martial_art/the_sleeping_carp/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
add_to_streak("D",D)
damage_roll(A,D)
if(check_streak(A,D))
return TRUE
log_combat(A, D, "disarmed (Sleeping Carp)")
+28 -26
View File
@@ -19,29 +19,29 @@
/datum/martial_art/wrestling/proc/check_streak(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
if(!can_use(A, D))
return 0
return FALSE
switch(streak)
if("drop")
streak = ""
drop(A,D)
return 1
return TRUE
if("strike")
streak = ""
strike(A,D)
return 1
return TRUE
if("kick")
streak = ""
kick(A,D)
return 1
return TRUE
if("throw")
streak = ""
throw_wrassle(A,D)
return 1
return TRUE
if("slam")
streak = ""
slam(A,D)
return 1
return 0
return TRUE
return FALSE
/datum/action/slam
name = "Slam (Cinch) - Slam a grappled opponent into the floor."
@@ -138,7 +138,7 @@
/datum/martial_art/wrestling/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(check_streak(A,D))
return 1
return TRUE
log_combat(A, D, "punched with wrestling")
..()
@@ -173,11 +173,11 @@
if (get_dist(A, D) > 1)
to_chat(A, "[D] is too far away!")
return 0
return FALSE
if (!isturf(A.loc) || !isturf(D.loc))
to_chat(A, "You can't throw [D] from here!")
return 0
return FALSE
A.setDir(turn(A.dir, 90))
var/turf/T = get_step(A, A.dir)
@@ -186,7 +186,7 @@
D.forceMove(T)
D.setDir(get_dir(D, A))
else
return 0
return FALSE
sleep(delay)
@@ -195,11 +195,11 @@
if (get_dist(A, D) > 1)
to_chat(A, "[D] is too far away!")
return 0
return FALSE
if (!isturf(A.loc) || !isturf(D.loc))
to_chat(A, "You can't throw [D] from here!")
return 0
return FALSE
D.forceMove(A.loc) // Maybe this will help with the wallthrowing bug.
@@ -211,7 +211,7 @@
D.emote("scream")
D.throw_at(T, 10, 4, A, TRUE, TRUE, callback = CALLBACK(D, /mob/living/carbon/human.proc/DefaultCombatKnockdown, 20))
log_combat(A, D, "has thrown with wrestling")
return 0
return FALSE
/datum/martial_art/wrestling/proc/FlipAnimation(mob/living/carbon/human/D)
set waitfor = FALSE
@@ -258,7 +258,7 @@
A.pixel_y = 0
D.pixel_x = 0
D.pixel_y = 0
return 0
return FALSE
if (!isturf(A.loc) || !isturf(D.loc))
to_chat(A, "You can't slam [D] here!")
@@ -266,7 +266,7 @@
A.pixel_y = 0
D.pixel_x = 0
D.pixel_y = 0
return 0
return FALSE
else
if (A)
A.pixel_x = 0
@@ -274,7 +274,7 @@
if (D)
D.pixel_x = 0
D.pixel_y = 0
return 0
return FALSE
sleep(1)
@@ -286,11 +286,11 @@
if (get_dist(A, D) > 1)
to_chat(A, "[D] is too far away!")
return 0
return FALSE
if (!isturf(A.loc) || !isturf(D.loc))
to_chat(A, "You can't slam [D] here!")
return 0
return FALSE
D.forceMove(A.loc)
@@ -327,7 +327,7 @@
log_combat(A, D, "body-slammed")
return 0
return FALSE
/datum/martial_art/wrestling/proc/CheckStrikeTurf(mob/living/carbon/human/A, turf/T)
if (A && (T && isturf(T) && get_dist(A, T) <= 1))
@@ -404,12 +404,12 @@
A.adjustBruteLoss(rand(10,20))
A.DefaultCombatKnockdown(60)
to_chat(A, "[D] is too far away!")
return 0
return FALSE
if (!isturf(A.loc) || !isturf(D.loc))
A.pixel_y = 0
to_chat(A, "You can't drop onto [D] from here!")
return 0
return FALSE
if(A)
animate(A, transform = matrix(90, MATRIX_ROTATE), time = 1, loop = 0)
@@ -442,14 +442,16 @@
return
/datum/martial_art/wrestling/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
damage_roll(A,D)
if(check_streak(A,D))
return 1
return TRUE
log_combat(A, D, "wrestling-disarmed")
..()
/datum/martial_art/wrestling/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
damage_roll(A,D)
if(check_streak(A,D))
return 1
return TRUE
if(!can_use(A,D))
return ..()
if(A.pulling == D || A == D) // don't stun grab yoursel
@@ -459,7 +461,7 @@
"<span class='userdanger'>[A] gets [D] in a cinch!</span>")
D.Stun(rand(60,100))
log_combat(A, D, "cinched")
return 1
return TRUE
/obj/item/storage/belt/champion/wrestling
name = "Wrestling Belt"
@@ -492,7 +494,7 @@
//Make sure that moves can only be used on people wearing the holodeck belt
/datum/martial_art/wrestling/holodeck/can_use(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
if(!(istype(D.mind?.martial_art, /datum/martial_art/wrestling/holodeck)))
return 0
return FALSE
else
return ..()