its a lil janky but we take those (#15834)

Co-authored-by: Hatterhat <Hatterhat@users.noreply.github.com>
This commit is contained in:
Hatterhat
2022-09-17 15:47:24 -05:00
committed by GitHub
parent ff2555afc6
commit 1f0ad3e68c
10 changed files with 67 additions and 22 deletions
+31 -22
View File
@@ -15,6 +15,8 @@
/// Set this variable to something not null, this'll be the preferred unarmed parry in most cases if [can_martial_parry] is TRUE. YOU MUST RUN [get_block_parry_data(this)] INSTEAD OF DIRECTLY ACCESSING!
var/datum/block_parry_data/block_parry_data
var/pugilist = FALSE
var/datum/weakref/holder //owner of the martial art
var/display_combos = FALSE //shows combo meter if true
/datum/martial_art/proc/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
return FALSE
@@ -25,7 +27,7 @@
/datum/martial_art/proc/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
return FALSE
/datum/martial_art/proc/can_use(mob/living/carbon/human/H)
/datum/martial_art/proc/can_use(mob/living/carbon/human/owner_human)
return TRUE
/datum/martial_art/proc/add_to_streak(element,mob/living/carbon/human/D)
@@ -34,11 +36,16 @@
streak = streak+element
if(length(streak) > max_streak_length)
streak = copytext(streak, 1 + length(streak[1]))
if(display_combos)
var/mob/living/holder_living = holder.resolve()
holder_living?.hud_used?.combo_display.update_icon_state(streak)
return
/datum/martial_art/proc/reset_streak(mob/living/carbon/human/new_target)
current_target = new_target
streak = ""
var/mob/living/holder_living = holder.resolve()
holder_living?.hud_used?.combo_display.update_icon_state(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 var in the various attack procs. This is changed depending on whether we are in combat mode, lying down, or if our target is in combat mode.
@@ -47,46 +54,48 @@
damage *= 0.7
return damage
/datum/martial_art/proc/teach(mob/living/carbon/human/H, make_temporary = FALSE)
if(!istype(H) || !H.mind)
/datum/martial_art/proc/teach(mob/living/carbon/human/owner_human, make_temporary = FALSE)
if(!istype(owner_human) || !owner_human.mind)
return FALSE
if(H.mind.martial_art)
if(owner_human.mind.martial_art)
if(make_temporary)
if(!H.mind.martial_art.allow_temp_override)
if(!owner_human.mind.martial_art.allow_temp_override)
return FALSE
store(H.mind.martial_art,H)
store(owner_human.mind.martial_art,owner_human)
else
H.mind.martial_art.on_remove(H)
owner_human.mind.martial_art.on_remove(owner_human)
else if(make_temporary)
base = H.mind.default_martial_art
base = owner_human.mind.default_martial_art
if(help_verb)
add_verb(H, help_verb)
H.mind.martial_art = src
add_verb(owner_human, help_verb)
owner_human.mind.martial_art = src
holder = WEAKREF(owner_human)
if(pugilist)
ADD_TRAIT(H, TRAIT_PUGILIST, MARTIAL_ARTIST_TRAIT)
ADD_TRAIT(owner_human, TRAIT_PUGILIST, MARTIAL_ARTIST_TRAIT)
return TRUE
/datum/martial_art/proc/store(datum/martial_art/M,mob/living/carbon/human/H)
M.on_remove(H)
/datum/martial_art/proc/store(datum/martial_art/M,mob/living/carbon/human/owner_human)
M.on_remove(owner_human)
if(M.base) //Checks if M is temporary, if so it will not be stored.
base = M.base
else //Otherwise, M is stored.
base = M
/datum/martial_art/proc/remove(mob/living/carbon/human/H)
if(!istype(H) || !H.mind || H.mind.martial_art != src)
/datum/martial_art/proc/remove(mob/living/carbon/human/owner_human)
if(!istype(owner_human) || !owner_human.mind || owner_human.mind.martial_art != src)
return
on_remove(H)
on_remove(owner_human)
if(base)
base.teach(H)
base.teach(owner_human)
else
var/datum/martial_art/X = H.mind.default_martial_art
X.teach(H)
REMOVE_TRAIT(H, TRAIT_PUGILIST, MARTIAL_ARTIST_TRAIT)
var/datum/martial_art/X = owner_human.mind.default_martial_art
X.teach(owner_human)
REMOVE_TRAIT(owner_human, TRAIT_PUGILIST, MARTIAL_ARTIST_TRAIT)
holder = null
/datum/martial_art/proc/on_remove(mob/living/carbon/human/H)
/datum/martial_art/proc/on_remove(mob/living/carbon/human/owner_human)
if(help_verb)
remove_verb(H, help_verb)
remove_verb(owner_human, help_verb)
return
///Gets called when a projectile hits the owner. Returning anything other than BULLET_ACT_HIT will stop the projectile from hitting the mob.
+1
View File
@@ -11,6 +11,7 @@
block_chance = 75
pugilist = TRUE
var/old_grab_state = null
display_combos = TRUE
/datum/martial_art/cqc/reset_streak(mob/living/carbon/human/new_target)
. = ..()
+1
View File
@@ -7,6 +7,7 @@
id = MARTIALART_PLASMAFIST
help_verb = /mob/living/carbon/human/proc/plasma_fist_help
pugilist = TRUE
display_combos = TRUE
/datum/martial_art/plasma_fist/proc/check_streak(mob/living/carbon/human/A, mob/living/carbon/human/D)
+1
View File
@@ -13,6 +13,7 @@
var/datum/action/risingbassmove/sidekick = new/datum/action/risingbassmove/sidekick()
var/datum/action/risingbassmove/deftswitch = new/datum/action/risingbassmove/deftswitch()
var/repulsecool = 0
display_combos = TRUE
/datum/martial_art/the_rising_bass/proc/check_streak(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(findtext(streak,SIDE_KICK_COMBO))
+1
View File
@@ -9,6 +9,7 @@
help_verb = /mob/living/carbon/human/proc/sleeping_carp_help
block_parry_data = /datum/block_parry_data/sleeping_carp
pugilist = TRUE
display_combos = TRUE
/datum/martial_art/the_sleeping_carp/proc/check_streak(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(findtext(streak,STRONG_PUNCH_COMBO))