diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm
index 43870e44884..a76320a7a10 100644
--- a/code/__DEFINES/traits.dm
+++ b/code/__DEFINES/traits.dm
@@ -234,6 +234,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_PERMANENTLY_ONFIRE "permanently_onfire" //overrides the update_fire proc to always add fire (for lava)
#define TRAIT_SIGN_LANG "sign_language" //Galactic Common Sign Language
#define TRAIT_NANITE_MONITORING "nanite_monitoring" //The mob's nanites are sending a monitoring signal visible on diag HUD
+#define TRAIT_MARTIAL_ARTS_IMMUNE "martial_arts_immune" // nobody can use martial arts on this mob
/// Prevents mob from riding mobs when buckled onto something
#define TRAIT_CANT_RIDE "cant_ride"
#define TRAIT_BLOODY_MESS "bloody_mess" //from heparin, makes open bleeding wounds rapidly spill more blood
diff --git a/code/datums/martial/_martial.dm b/code/datums/martial/_martial.dm
index 84ad5467d36..51c12837725 100644
--- a/code/datums/martial/_martial.dm
+++ b/code/datums/martial/_martial.dm
@@ -10,68 +10,71 @@
var/allow_temp_override = TRUE //if this martial art can be overridden by temporary martial arts
var/smashes_tables = FALSE //If the martial art smashes tables when performing table slams and head smashes
-/datum/martial_art/proc/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/proc/help_act(mob/living/A, mob/living/D)
return FALSE
-/datum/martial_art/proc/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/proc/disarm_act(mob/living/A, mob/living/D)
return FALSE
-/datum/martial_art/proc/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/proc/harm_act(mob/living/A, mob/living/D)
return FALSE
-/datum/martial_art/proc/can_use(mob/living/carbon/human/H)
+/datum/martial_art/proc/grab_act(mob/living/A, mob/living/D)
+ return FALSE
+
+/datum/martial_art/proc/can_use(mob/living/L)
return TRUE
-/datum/martial_art/proc/add_to_streak(element,mob/living/carbon/human/D)
+/datum/martial_art/proc/add_to_streak(element, mob/living/D)
if(D != current_target)
reset_streak(D)
streak = streak+element
if(length(streak) > max_streak_length)
streak = copytext(streak, 1 + length(streak[1]))
-/datum/martial_art/proc/reset_streak(mob/living/carbon/human/new_target)
+/datum/martial_art/proc/reset_streak(mob/living/new_target)
current_target = new_target
streak = ""
-/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/owner, make_temporary=FALSE)
+ if(!istype(owner) || !owner.mind)
return FALSE
- if(H.mind.martial_art)
+ if(owner.mind.martial_art)
if(make_temporary)
- if(!H.mind.martial_art.allow_temp_override)
+ if(!owner.mind.martial_art.allow_temp_override)
return FALSE
- store(H.mind.martial_art,H)
+ store(owner.mind.martial_art, owner)
else
- H.mind.martial_art.on_remove(H)
+ owner.mind.martial_art.on_remove(owner)
else if(make_temporary)
- base = H.mind.default_martial_art
+ base = owner.mind.default_martial_art
if(help_verb)
- add_verb(H, help_verb)
- H.mind.martial_art = src
+ add_verb(owner, help_verb)
+ owner.mind.martial_art = src
return TRUE
-/datum/martial_art/proc/store(datum/martial_art/M,mob/living/carbon/human/H)
- M.on_remove(H)
- 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/store(datum/martial_art/old, mob/living/owner)
+ old.on_remove(owner)
+ if (old.base) //Checks if old is temporary, if so it will not be stored.
+ base = old.base
+ else //Otherwise, old is stored.
+ base = old
-/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/owner)
+ if(!istype(owner) || !owner.mind || owner.mind.martial_art != src)
return
- on_remove(H)
+ on_remove(owner)
if(base)
- base.teach(H)
+ base.teach(owner)
else
- var/datum/martial_art/X = H.mind.default_martial_art
- X.teach(H)
+ var/datum/martial_art/default = owner.mind.default_martial_art
+ default.teach(owner)
-/datum/martial_art/proc/on_remove(mob/living/carbon/human/H)
+/datum/martial_art/proc/on_remove(mob/living/owner)
if(help_verb)
- remove_verb(H, help_verb)
+ remove_verb(owner, 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.
-/datum/martial_art/proc/on_projectile_hit(mob/living/carbon/human/A, obj/projectile/P, def_zone)
+/datum/martial_art/proc/on_projectile_hit(mob/living/A, obj/projectile/P, def_zone)
return BULLET_ACT_HIT
diff --git a/code/datums/martial/boxing.dm b/code/datums/martial/boxing.dm
index 2760c333ece..b1fce737ef9 100644
--- a/code/datums/martial/boxing.dm
+++ b/code/datums/martial/boxing.dm
@@ -2,23 +2,26 @@
name = "Boxing"
id = MARTIALART_BOXING
-/datum/martial_art/boxing/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/boxing/disarm_act(mob/living/A, mob/living/D)
to_chat(A, "Can't disarm while boxing!")
- return 1
+ return TRUE
-/datum/martial_art/boxing/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/boxing/grab_act(mob/living/A, mob/living/D)
to_chat(A, "Can't grab while boxing!")
- return 1
+ return TRUE
-/datum/martial_art/boxing/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/boxing/harm_act(mob/living/A, mob/living/D)
+
+ var/mob/living/carbon/human/attacker_human = A
+ var/datum/species/species = attacker_human.dna.species
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
var/atk_verb = pick("left hook","right hook","straight punch")
- var/damage = rand(5, 8) + A.dna.species.punchdamagelow
+ var/damage = rand(5, 8) + species.punchdamagelow
if(!damage)
- playsound(D.loc, A.dna.species.miss_sound, 25, TRUE, -1)
+ playsound(D.loc, species.miss_sound, 25, TRUE, -1)
D.visible_message("[A]'s [atk_verb] misses [D]!", \
"You avoid [A]'s [atk_verb]!", "You hear a swoosh!", COMBAT_MESSAGE_RANGE, A)
to_chat(A, "Your [atk_verb] misses [D]!")
@@ -29,7 +32,7 @@
var/obj/item/bodypart/affecting = D.get_bodypart(ran_zone(A.zone_selected))
var/armor_block = D.run_armor_check(affecting, MELEE)
- playsound(D.loc, A.dna.species.attack_sound, 25, TRUE, -1)
+ playsound(D.loc, species.attack_sound, 25, TRUE, -1)
D.visible_message("[A] [atk_verb]ed [D]!", \
"You're [atk_verb]ed by [A]!", "You hear a sickening sound of flesh hitting flesh!", COMBAT_MESSAGE_RANGE, A)
@@ -48,23 +51,28 @@
log_combat(A, D, "knocked out (boxing) ")
return TRUE
+/datum/martial_art/boxing/can_use(mob/living/owner)
+ if (!ishuman(owner))
+ return FALSE
+ return ..()
+
/obj/item/clothing/gloves/boxing
var/datum/martial_art/boxing/style = new
/obj/item/clothing/gloves/boxing/equipped(mob/user, slot)
- . = ..()
+ ..()
+ // boxing requires human
if(!ishuman(user))
return
if(slot == ITEM_SLOT_GLOVES)
- var/mob/living/carbon/human/H = user
- style.teach(H,1)
+ var/mob/living/student = user
+ style.teach(student, 1)
return
/obj/item/clothing/gloves/boxing/dropped(mob/user)
- . = ..()
+ ..()
if(!ishuman(user))
return
- var/mob/living/carbon/human/H = user
- if(H.get_item_by_slot(ITEM_SLOT_GLOVES) == src)
- style.remove(H)
+ var/mob/living/owner = user
+ style.remove(owner)
return
diff --git a/code/datums/martial/cqc.dm b/code/datums/martial/cqc.dm
index 1ecdbde0fcf..d28db36b1e6 100644
--- a/code/datums/martial/cqc.dm
+++ b/code/datums/martial/cqc.dm
@@ -7,17 +7,17 @@
/datum/martial_art/cqc
name = "CQC"
id = MARTIALART_CQC
- help_verb = /mob/living/carbon/human/proc/CQC_help
+ help_verb = /mob/living/proc/CQC_help
block_chance = 75
smashes_tables = TRUE
var/old_grab_state = null
var/restraining = FALSE
-/datum/martial_art/cqc/reset_streak(mob/living/carbon/human/new_target)
+/datum/martial_art/cqc/reset_streak(mob/living/new_target)
. = ..()
restraining = FALSE
-/datum/martial_art/cqc/proc/check_streak(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/cqc/proc/check_streak(mob/living/A, mob/living/D)
if(!can_use(A))
return FALSE
if(findtext(streak,SLAM_COMBO))
@@ -41,7 +41,7 @@
Consecutive(A,D)
return FALSE
-/datum/martial_art/cqc/proc/Slam(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/cqc/proc/Slam(mob/living/A, mob/living/D)
if(!can_use(A))
return FALSE
if(D.body_position == STANDING_UP)
@@ -54,7 +54,7 @@
log_combat(A, D, "slammed (CQC)")
return TRUE
-/datum/martial_art/cqc/proc/Kick(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/cqc/proc/Kick(mob/living/A, mob/living/D)
if(!can_use(A))
return FALSE
if(!D.stat || !D.IsParalyzed())
@@ -64,7 +64,7 @@
playsound(get_turf(A), 'sound/weapons/cqchit1.ogg', 50, TRUE, -1)
var/atom/throw_target = get_edge_target_turf(D, A.dir)
D.throw_at(throw_target, 1, 14, A)
- D.apply_damage(10, A.dna.species.attack_type)
+ D.apply_damage(10, A.get_attack_type())
log_combat(A, D, "kicked (CQC)")
if(D.IsParalyzed() && !D.stat)
log_combat(A, D, "knocked out (Head kick)(CQC)")
@@ -76,7 +76,7 @@
D.adjustOrganLoss(ORGAN_SLOT_BRAIN, 15, 150)
return TRUE
-/datum/martial_art/cqc/proc/Pressure(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/cqc/proc/Pressure(mob/living/A, mob/living/D)
if(!can_use(A))
return FALSE
log_combat(A, D, "pressured (CQC)")
@@ -87,7 +87,7 @@
playsound(get_turf(A), 'sound/weapons/cqchit1.ogg', 50, TRUE, -1)
return TRUE
-/datum/martial_art/cqc/proc/Restrain(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/cqc/proc/Restrain(mob/living/A, mob/living/D)
if(restraining)
return
if(!can_use(A))
@@ -103,7 +103,7 @@
addtimer(VARSET_CALLBACK(src, restraining, FALSE), 50, TIMER_UNIQUE)
return TRUE
-/datum/martial_art/cqc/proc/Consecutive(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/cqc/proc/Consecutive(mob/living/A, mob/living/D)
if(!can_use(A))
return FALSE
if(!D.stat)
@@ -116,10 +116,10 @@
if(I && D.temporarilyRemoveItemFromInventory(I))
A.put_in_hands(I)
D.adjustStaminaLoss(50)
- D.apply_damage(25, A.dna.species.attack_type)
+ D.apply_damage(25, A.get_attack_type())
return TRUE
-/datum/martial_art/cqc/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/cqc/grab_act(mob/living/A, mob/living/D)
if(A.a_intent == INTENT_GRAB && A!=D && can_use(A)) // A!=D prevents grabbing yourself
add_to_streak("G",D)
if(check_streak(A,D)) //if a combo is made no grab upgrade is done
@@ -137,7 +137,7 @@
else
return FALSE
-/datum/martial_art/cqc/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/cqc/harm_act(mob/living/A, mob/living/D)
if(!can_use(A))
return FALSE
add_to_streak("H",D)
@@ -169,7 +169,7 @@
log_combat(A, D, "sweeped (CQC)")
return TRUE
-/datum/martial_art/cqc/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/cqc/disarm_act(mob/living/A, mob/living/D)
if(!can_use(A))
return FALSE
add_to_streak("D",D)
@@ -186,7 +186,7 @@
if(I && D.temporarilyRemoveItemFromInventory(I))
A.put_in_hands(I)
D.Jitter(2)
- D.apply_damage(5, A.dna.species.attack_type)
+ D.apply_damage(5, A.get_attack_type())
else
D.visible_message("[A] fails to disarm [D]!", \
"You're nearly disarmed by [A]!", "You hear a swoosh!", COMBAT_MESSAGE_RANGE, A)
@@ -207,7 +207,7 @@
return FALSE
return TRUE
-/mob/living/carbon/human/proc/CQC_help()
+/mob/living/proc/CQC_help()
set name = "Remember The Basics"
set desc = "You try to remember some of the basics of CQC."
set category = "CQC"
@@ -227,7 +227,7 @@
var/list/valid_areas = list(/area/crew_quarters/kitchen)
///Prevents use if the cook is not in the kitchen.
-/datum/martial_art/cqc/under_siege/can_use(mob/living/carbon/human/H) //this is used to make chef CQC only work in kitchen
- if(!is_type_in_list(get_area(H), valid_areas))
+/datum/martial_art/cqc/under_siege/can_use(mob/living/owner) //this is used to make chef CQC only work in kitchen
+ if(!is_type_in_list(get_area(owner), valid_areas))
return FALSE
return ..()
diff --git a/code/datums/martial/krav_maga.dm b/code/datums/martial/krav_maga.dm
index 722fa0a8203..ff52857c168 100644
--- a/code/datums/martial/krav_maga.dm
+++ b/code/datums/martial/krav_maga.dm
@@ -14,13 +14,12 @@
if(owner.incapacitated())
to_chat(owner, "You can't use [name] while you're incapacitated.")
return
- var/mob/living/carbon/human/H = owner
- if (H.mind.martial_art.streak == "neck_chop")
+ if (owner.mind.martial_art.streak == "neck_chop")
owner.visible_message("[owner] assumes a neutral stance.", "Your next attack is cleared.")
- H.mind.martial_art.streak = ""
+ owner.mind.martial_art.streak = ""
else
owner.visible_message("[owner] assumes the Neck Chop stance!", "Your next attack will be a Neck Chop.")
- H.mind.martial_art.streak = "neck_chop"
+ owner.mind.martial_art.streak = "neck_chop"
/datum/action/leg_sweep
name = "Leg Sweep - Trips the victim, knocking them down for a brief moment."
@@ -31,13 +30,12 @@
if(owner.incapacitated())
to_chat(owner, "You can't use [name] while you're incapacitated.")
return
- var/mob/living/carbon/human/H = owner
- if (H.mind.martial_art.streak == "leg_sweep")
+ if (owner.mind.martial_art.streak == "leg_sweep")
owner.visible_message("[owner] assumes a neutral stance.", "Your next attack is cleared.")
- H.mind.martial_art.streak = ""
+ owner.mind.martial_art.streak = ""
else
owner.visible_message("[owner] assumes the Leg Sweep stance!", "Your next attack will be a Leg Sweep.")
- H.mind.martial_art.streak = "leg_sweep"
+ owner.mind.martial_art.streak = "leg_sweep"
/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,29 +46,28 @@
if(owner.incapacitated())
to_chat(owner, "You can't use [name] while you're incapacitated.")
return
- var/mob/living/carbon/human/H = owner
- if (H.mind.martial_art.streak == "quick_choke")
+ if (owner.mind.martial_art.streak == "quick_choke")
owner.visible_message("[owner] assumes a neutral stance.", "Your next attack is cleared.")
- H.mind.martial_art.streak = ""
+ owner.mind.martial_art.streak = ""
else
owner.visible_message("[owner] assumes the Lung Punch stance!", "Your next attack will be a Lung Punch.")
- H.mind.martial_art.streak = "quick_choke"//internal name for lung punch
+ owner.mind.martial_art.streak = "quick_choke"//internal name for lung punch
-/datum/martial_art/krav_maga/teach(mob/living/carbon/human/H,make_temporary=0)
+/datum/martial_art/krav_maga/teach(mob/living/owner, make_temporary=FALSE)
if(..())
- to_chat(H, "You know the arts of [name]!")
- to_chat(H, "Place your cursor over a move at the top of the screen to see what it does.")
- neckchop.Grant(H)
- legsweep.Grant(H)
- lungpunch.Grant(H)
+ to_chat(owner, "You know the arts of [name]!")
+ to_chat(owner, "Place your cursor over a move at the top of the screen to see what it does.")
+ neckchop.Grant(owner)
+ legsweep.Grant(owner)
+ lungpunch.Grant(owner)
-/datum/martial_art/krav_maga/on_remove(mob/living/carbon/human/H)
- to_chat(H, "You suddenly forget the arts of [name]...")
- neckchop.Remove(H)
- legsweep.Remove(H)
- lungpunch.Remove(H)
+/datum/martial_art/krav_maga/on_remove(mob/living/owner)
+ to_chat(owner, "You suddenly forget the arts of [name]...")
+ neckchop.Remove(owner)
+ legsweep.Remove(owner)
+ lungpunch.Remove(owner)
-/datum/martial_art/krav_maga/proc/check_streak(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/krav_maga/proc/check_streak(mob/living/A, mob/living/D)
switch(streak)
if("neck_chop")
streak = ""
@@ -86,7 +83,7 @@
return TRUE
return FALSE
-/datum/martial_art/krav_maga/proc/leg_sweep(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/krav_maga/proc/leg_sweep(mob/living/A, mob/living/D)
if(D.stat || D.IsParalyzed())
return FALSE
var/obj/item/bodypart/affecting = D.get_bodypart(BODY_ZONE_CHEST)
@@ -100,7 +97,7 @@
log_combat(A, D, "leg sweeped")
return TRUE
-/datum/martial_art/krav_maga/proc/quick_choke(mob/living/carbon/human/A, mob/living/carbon/human/D)//is actually lung punch
+/datum/martial_art/krav_maga/proc/quick_choke(mob/living/A, mob/living/D)//is actually lung punch
D.visible_message("[A] pounds [D] on the chest!", \
"Your chest is slammed by [A]! You can't breathe!", "You hear a sickening sound of flesh hitting flesh!", COMBAT_MESSAGE_RANGE, A)
to_chat(A, "You pound [D] on the chest!")
@@ -111,24 +108,26 @@
log_combat(A, D, "quickchoked")
return TRUE
-/datum/martial_art/krav_maga/proc/neck_chop(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/krav_maga/proc/neck_chop(mob/living/A, mob/living/D)
D.visible_message("[A] karate chops [D]'s neck!", \
"Your neck is karate chopped by [A], rendering you unable to speak!", "You hear a sickening sound of flesh hitting flesh!", COMBAT_MESSAGE_RANGE, A)
to_chat(A, "You karate chop [D]'s neck, rendering [D.p_them()] unable to speak!")
playsound(get_turf(A), 'sound/effects/hit_punch.ogg', 50, TRUE, -1)
- D.apply_damage(5, A.dna.species.attack_type)
- if(D.silent <= 10)
- D.silent = clamp(D.silent + 10, 0, 10)
+ D.apply_damage(5, A.get_attack_type())
+ if (iscarbon(D))
+ var/mob/living/carbon/carbon_defender = D
+ if(carbon_defender.silent <= 10)
+ carbon_defender.silent = clamp(carbon_defender.silent + 10, 0, 10)
log_combat(A, D, "neck chopped")
return TRUE
-/datum/martial_art/krav_maga/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/krav_maga/grab_act(mob/living/A, mob/living/D)
if(check_streak(A,D))
return TRUE
log_combat(A, D, "grabbed (Krav Maga)")
..()
-/datum/martial_art/krav_maga/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/krav_maga/harm_act(mob/living/A, mob/living/D)
if(check_streak(A,D))
return TRUE
log_combat(A, D, "punched")
@@ -139,7 +138,7 @@
if(D.body_position == LYING_DOWN)
bonus_damage += 5
picked_hit_type = "stomp"
- D.apply_damage(rand(5,10) + bonus_damage, A.dna.species.attack_type, affecting, armor_block)
+ D.apply_damage(rand(5,10) + bonus_damage, A.get_attack_type(), affecting, armor_block)
if(picked_hit_type == "kick" || picked_hit_type == "stomp")
A.do_attack_animation(D, ATTACK_EFFECT_KICK)
playsound(get_turf(D), 'sound/effects/hit_kick.ogg', 50, TRUE, -1)
@@ -152,7 +151,7 @@
log_combat(A, D, "[picked_hit_type] with [name]")
return TRUE
-/datum/martial_art/krav_maga/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/krav_maga/disarm_act(mob/living/A, mob/living/D)
if(check_streak(A,D))
return TRUE
var/obj/item/bodypart/affecting = D.get_bodypart(ran_zone(A.zone_selected))
@@ -185,19 +184,13 @@
/obj/item/clothing/gloves/krav_maga/equipped(mob/user, slot)
. = ..()
- if(!ishuman(user))
- return
if(slot == ITEM_SLOT_GLOVES)
- var/mob/living/carbon/human/H = user
- style.teach(H,1)
+ style.teach(user, TRUE)
/obj/item/clothing/gloves/krav_maga/dropped(mob/user)
. = ..()
- if(!ishuman(user))
- return
- var/mob/living/carbon/human/H = user
- if(H.get_item_by_slot(ITEM_SLOT_GLOVES) == src)
- style.remove(H)
+ if(user.get_item_by_slot(ITEM_SLOT_GLOVES) == src)
+ style.remove(user)
/obj/item/clothing/gloves/krav_maga/sec//more obviously named, given to sec
name = "krav maga gloves"
diff --git a/code/datums/martial/mushpunch.dm b/code/datums/martial/mushpunch.dm
index 1115332a717..e1c9732b95d 100644
--- a/code/datums/martial/mushpunch.dm
+++ b/code/datums/martial/mushpunch.dm
@@ -2,7 +2,7 @@
name = "Mushroom Punch"
id = MARTIALART_MUSHPUNCH
-/datum/martial_art/mushpunch/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/mushpunch/harm_act(mob/living/A, mob/living/D)
var/atk_verb
to_chat(A, "You begin to wind up an attack...")
if(!do_after(A, 25, target = D))
@@ -13,7 +13,7 @@
D.visible_message("[A] [atk_verb]ed [D] with such inhuman strength that it sends [D.p_them()] flying backwards!", \
"You're [atk_verb]ed by [A] with such inhuman strength that it sends you flying backwards!", "You hear a sickening sound of flesh hitting flesh!", null, A)
to_chat(A, "You [atk_verb] [D] with such inhuman strength that it sends [D.p_them()] flying backwards!")
- D.apply_damage(rand(15,30), A.dna.species.attack_type)
+ D.apply_damage(rand(15,30), A.get_attack_type())
playsound(D, 'sound/effects/meteorimpact.ogg', 25, TRUE, -1)
var/throwtarget = get_edge_target_turf(A, get_dir(A, get_step_away(D, A)))
D.throw_at(throwtarget, 4, 2, A)//So stuff gets tossed around at the same time.
@@ -28,7 +28,7 @@
icon = 'icons/obj/hydroponics/seeds.dmi'
icon_state = "mycelium-angel"
-/obj/item/mushpunch/attack_self(mob/living/carbon/human/user)
+/obj/item/mushpunch/attack_self(mob/living/user)
if(!istype(user) || !user)
return
var/message = "You devour [src], and a confluence of skill and power from the mushroom enhances your punches! You do need a short moment to charge these powerful punches."
diff --git a/code/datums/martial/plasma_fist.dm b/code/datums/martial/plasma_fist.dm
index 261abb73c8c..c87a4d82ca3 100644
--- a/code/datums/martial/plasma_fist.dm
+++ b/code/datums/martial/plasma_fist.dm
@@ -5,13 +5,13 @@
/datum/martial_art/plasma_fist
name = "Plasma Fist"
id = MARTIALART_PLASMAFIST
- help_verb = /mob/living/carbon/human/proc/plasma_fist_help
+ help_verb = /mob/living/proc/plasma_fist_help
var/nobomb = FALSE
var/plasma_power = 1 //starts at a 1, 2, 4 explosion.
var/plasma_increment = 1 //how much explosion power gets added per kill (1 = 1, 2, 4. 2 = 2, 4, 8 and so on)
var/plasma_cap = 12 //max size explosion level
-/datum/martial_art/plasma_fist/proc/check_streak(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/plasma_fist/proc/check_streak(mob/living/A, mob/living/D)
if(findtext(streak,TORNADO_COMBO))
if(A == D)//helps using apotheosis
return FALSE
@@ -33,7 +33,7 @@
return TRUE
return FALSE
-/datum/martial_art/plasma_fist/proc/Tornado(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/plasma_fist/proc/Tornado(mob/living/A, mob/living/D)
A.say("TORNADO SWEEP!", forced="plasma fist")
dance_rotate(A, CALLBACK(GLOBAL_PROC, .proc/playsound, A.loc, 'sound/weapons/punch1.ogg', 15, TRUE, -1))
var/obj/effect/proc_holder/spell/aoe_turf/repulse/R = new(null)
@@ -44,7 +44,7 @@
log_combat(A, D, "tornado sweeped(Plasma Fist)")
return
-/datum/martial_art/plasma_fist/proc/Throwback(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/plasma_fist/proc/Throwback(mob/living/A, mob/living/D)
D.visible_message("[A] hits [D] with Plasma Punch!", \
"You're hit with a Plasma Punch by [A]!", "You hear a sickening sound of flesh hitting flesh!", null, A)
to_chat(A, "You hit [D] with Plasma Punch!")
@@ -55,7 +55,7 @@
log_combat(A, D, "threw back (Plasma Fist)")
return
-/datum/martial_art/plasma_fist/proc/Plasma(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/plasma_fist/proc/Plasma(mob/living/A, mob/living/D)
var/hasclient = D.client ? TRUE : FALSE
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
@@ -86,15 +86,17 @@
animate(A, color = oldcolor, time = 3 SECONDS)
-/datum/martial_art/plasma_fist/proc/Apotheosis(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/plasma_fist/proc/Apotheosis(mob/living/A, mob/living/D)
A.say("APOTHEOSIS!!", forced="plasma fist")
- A.set_species(/datum/species/plasmaman)
- A.dna.species.species_traits += TRAIT_BOMBIMMUNE
- A.unequip_everything()
- A.underwear = "Nude"
- A.undershirt = "Nude"
- A.socks = "Nude"
- A.update_body()
+ if (ishuman(A))
+ var/mob/living/carbon/human/human_attacker = A
+ human_attacker.set_species(/datum/species/plasmaman)
+ human_attacker.dna.species.species_traits += TRAIT_BOMBIMMUNE
+ human_attacker.unequip_everything()
+ human_attacker.underwear = "Nude"
+ human_attacker.undershirt = "Nude"
+ human_attacker.socks = "Nude"
+ human_attacker.update_body()
var/turf/boomspot = get_turf(A)
//before ghosting to prevent issues
@@ -111,19 +113,21 @@
explosion(boomspot,plasma_power,plasma_power*2,plasma_power*4,ignorecap = TRUE)
plasma_power = 1 //just in case there is any clever way to cause it to happen again
-/datum/martial_art/plasma_fist/proc/Apotheosis_end(mob/living/carbon/human/dying)
- dying.dna.species.species_traits -= TRAIT_BOMBIMMUNE
+/datum/martial_art/plasma_fist/proc/Apotheosis_end(mob/living/dying)
+ var/datum/dna/dna = dying.has_dna()
+ if (dna?.species)
+ dna.species.species_traits -= TRAIT_BOMBIMMUNE
if(dying.stat == DEAD)
return
dying.death()
-/datum/martial_art/plasma_fist/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/plasma_fist/harm_act(mob/living/A, mob/living/D)
add_to_streak("H",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)
+/datum/martial_art/plasma_fist/disarm_act(mob/living/A, mob/living/D)
add_to_streak("D",D)
if(check_streak(A,D))
return TRUE
@@ -131,19 +135,18 @@
to_chat(A, "You have added a disarm to your streak.")
return FALSE
-/datum/martial_art/plasma_fist/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/plasma_fist/grab_act(mob/living/A, mob/living/D)
add_to_streak("G",D)
if(check_streak(A,D))
return TRUE
return FALSE
-/mob/living/carbon/human/proc/plasma_fist_help()
+/mob/living/proc/plasma_fist_help()
set name = "Recall Teachings"
set desc = "Remember the martial techniques of the Plasma Fist."
set category = "Plasma Fist"
- var/mob/living/carbon/human/H = usr
- var/datum/martial_art/plasma_fist/martial = H.mind.martial_art
+ var/datum/martial_art/plasma_fist/martial = usr.mind.martial_art
to_chat(usr, "You clench your fists and have a flashback of knowledge...")
to_chat(usr, "Tornado Sweep: Harm Harm Disarm. Repulses opponent and everyone back.")
to_chat(usr, "Throwback: Disarm Harm Disarm. Throws the opponent and an item at them.")
diff --git a/code/datums/martial/psychotic_brawl.dm b/code/datums/martial/psychotic_brawl.dm
index d6cedfee04f..b8b4ebcbaef 100644
--- a/code/datums/martial/psychotic_brawl.dm
+++ b/code/datums/martial/psychotic_brawl.dm
@@ -2,20 +2,22 @@
name = "Psychotic Brawling"
id = MARTIALART_PSYCHOBRAWL
-/datum/martial_art/psychotic_brawling/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/psychotic_brawling/disarm_act(mob/living/A, mob/living/D)
return psycho_attack(A,D)
-/datum/martial_art/psychotic_brawling/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/psychotic_brawling/grab_act(mob/living/A, mob/living/D)
return psycho_attack(A,D)
-/datum/martial_art/psychotic_brawling/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/psychotic_brawling/harm_act(mob/living/A, mob/living/D)
return psycho_attack(A,D)
-/datum/martial_art/psychotic_brawling/proc/psycho_attack(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/psychotic_brawling/proc/psycho_attack(mob/living/A, mob/living/D)
var/atk_verb
switch(rand(1,8))
if(1)
- D.help_shake_act(A)
+ if (iscarbon(D) && iscarbon(A))
+ var/mob/living/carbon/defender = D
+ defender.help_shake_act(A)
atk_verb = "helped"
if(2)
A.emote("cry")
@@ -45,10 +47,12 @@
"You're [atk_verb]ed by [A]!", "You hear a sickening sound of flesh hitting flesh!", null, A)
to_chat(A, "You [atk_verb] [D]!")
playsound(get_turf(D), 'sound/weapons/punch1.ogg', 40, TRUE, -1)
- D.apply_damage(rand(5,10), A.dna.species.attack_type, BODY_ZONE_HEAD)
- A.apply_damage(rand(5,10), A.dna.species.attack_type, BODY_ZONE_HEAD)
- if(!istype(D.head,/obj/item/clothing/head/helmet/) && !istype(D.head,/obj/item/clothing/head/hardhat))
- D.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5)
+ D.apply_damage(rand(5,10), A.get_attack_type(), BODY_ZONE_HEAD)
+ A.apply_damage(rand(5,10), A.get_attack_type(), BODY_ZONE_HEAD)
+ if (iscarbon(D))
+ var/mob/living/carbon/defender = D
+ if(!istype(defender.head,/obj/item/clothing/head/helmet/) && !istype(defender.head,/obj/item/clothing/head/hardhat))
+ defender.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5)
A.Stun(rand(10,45))
D.Stun(rand(5,30))
if(5,6)
@@ -57,7 +61,7 @@
D.visible_message("[A] [atk_verb]s [D] with such inhuman strength that it sends [D.p_them()] flying backwards!", \
"You're [atk_verb]ed by [A] with such inhuman strength that it sends you flying backwards!", "You hear a sickening sound of flesh hitting flesh!", null, A)
to_chat(A, "You [atk_verb] [D] with such inhuman strength that it sends [D.p_them()] flying backwards!")
- D.apply_damage(rand(15,30), A.dna.species.attack_type)
+ D.apply_damage(rand(15,30), A.get_attack_type())
playsound(get_turf(D), 'sound/effects/meteorimpact.ogg', 25, TRUE, -1)
var/throwtarget = get_edge_target_turf(A, get_dir(A, get_step_away(D, A)))
D.throw_at(throwtarget, 4, 2, A)//So stuff gets tossed around at the same time.
diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm
index 64f19fd30d0..c2eb4ceabf4 100644
--- a/code/datums/martial/sleeping_carp.dm
+++ b/code/datums/martial/sleeping_carp.dm
@@ -6,9 +6,9 @@
name = "The Sleeping Carp"
id = MARTIALART_SLEEPINGCARP
allow_temp_override = FALSE
- help_verb = /mob/living/carbon/human/proc/sleeping_carp_help
+ help_verb = /mob/living/proc/sleeping_carp_help
-/datum/martial_art/the_sleeping_carp/proc/check_streak(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/the_sleeping_carp/proc/check_streak(mob/living/A, mob/living/D)
if(findtext(streak,STRONG_PUNCH_COMBO))
streak = ""
strongPunch(A,D)
@@ -24,7 +24,7 @@
return FALSE
///Gnashing Teeth: Harm Harm, consistent 20 force punch on every second harm punch
-/datum/martial_art/the_sleeping_carp/proc/strongPunch(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/the_sleeping_carp/proc/strongPunch(mob/living/A, mob/living/D)
///this var is so that the strong punch is always aiming for the body part the user is targeting and not trying to apply to the chest before deviating
var/obj/item/bodypart/affecting = D.get_bodypart(ran_zone(A.zone_selected))
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
@@ -34,33 +34,33 @@
to_chat(A, "You [atk_verb] [D]!")
playsound(get_turf(D), 'sound/weapons/punch1.ogg', 25, TRUE, -1)
log_combat(A, D, "strong punched (Sleeping Carp)")
- D.apply_damage(20, A.dna.species.attack_type, affecting)
+ D.apply_damage(20, A.get_attack_type(), affecting)
return
///Crashing Wave Kick: Harm Disarm combo, throws people seven tiles backwards
-/datum/martial_art/the_sleeping_carp/proc/launchKick(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/the_sleeping_carp/proc/launchKick(mob/living/A, mob/living/D)
A.do_attack_animation(D, ATTACK_EFFECT_KICK)
D.visible_message("[A] kicks [D] square in the chest, sending them flying!", \
"You are kicked square in the chest by [A], sending you flying!", "You hear a sickening sound of flesh hitting flesh!", COMBAT_MESSAGE_RANGE, A)
playsound(get_turf(A), 'sound/effects/hit_kick.ogg', 50, TRUE, -1)
var/atom/throw_target = get_edge_target_turf(D, A.dir)
D.throw_at(throw_target, 7, 14, A)
- D.apply_damage(15, A.dna.species.attack_type, BODY_ZONE_CHEST, wound_bonus = CANT_WOUND)
+ D.apply_damage(15, A.get_attack_type(), BODY_ZONE_CHEST, wound_bonus = CANT_WOUND)
log_combat(A, D, "launchkicked (Sleeping Carp)")
return
///Keelhaul: Harm Grab combo, knocks people down, deals stamina damage while they're on the floor
-/datum/martial_art/the_sleeping_carp/proc/dropKick(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/the_sleeping_carp/proc/dropKick(mob/living/A, mob/living/D)
A.do_attack_animation(D, ATTACK_EFFECT_KICK)
playsound(get_turf(A), 'sound/effects/hit_kick.ogg', 50, TRUE, -1)
if(D.body_position == STANDING_UP)
- D.apply_damage(10, A.dna.species.attack_type, BODY_ZONE_HEAD, wound_bonus = CANT_WOUND)
+ D.apply_damage(10, A.get_attack_type(), BODY_ZONE_HEAD, wound_bonus = CANT_WOUND)
D.apply_damage(40, STAMINA, BODY_ZONE_HEAD)
D.Knockdown(40)
D.visible_message("[A] kicks [D] in the head, sending them face first into the floor!", \
"You are kicked in the head by [A], sending you crashing to the floor!", "You hear a sickening sound of flesh hitting flesh!", COMBAT_MESSAGE_RANGE, A)
else
- D.apply_damage(5, A.dna.species.attack_type, BODY_ZONE_HEAD, wound_bonus = CANT_WOUND)
+ D.apply_damage(5, A.get_attack_type(), BODY_ZONE_HEAD, wound_bonus = CANT_WOUND)
D.apply_damage(40, STAMINA, BODY_ZONE_HEAD)
D.drop_all_held_items()
D.visible_message("[A] kicks [D] in the head!", \
@@ -68,14 +68,14 @@
log_combat(A, D, "dropkicked (Sleeping Carp)")
return
-/datum/martial_art/the_sleeping_carp/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/the_sleeping_carp/grab_act(mob/living/A, mob/living/D)
add_to_streak("G",D)
if(check_streak(A,D))
return TRUE
log_combat(A, D, "grabbed (Sleeping Carp)")
return ..()
-/datum/martial_art/the_sleeping_carp/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/the_sleeping_carp/harm_act(mob/living/A, mob/living/D)
add_to_streak("H",D)
if(check_streak(A,D))
return TRUE
@@ -90,20 +90,21 @@
log_combat(A, D, "punched (Sleeping Carp)")
return TRUE
-/datum/martial_art/the_sleeping_carp/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/the_sleeping_carp/disarm_act(mob/living/A, mob/living/D)
add_to_streak("D",D)
if(check_streak(A,D))
return TRUE
log_combat(A, D, "disarmed (Sleeping Carp)")
return ..()
-/datum/martial_art/the_sleeping_carp/on_projectile_hit(mob/living/carbon/human/A, obj/projectile/P, def_zone)
+/datum/martial_art/the_sleeping_carp/on_projectile_hit(mob/living/A, obj/projectile/P, def_zone)
. = ..()
if(A.incapacitated(FALSE, TRUE)) //NO STUN
return BULLET_ACT_HIT
if(!(A.mobility_flags & MOBILITY_USE)) //NO UNABLE TO USE
return BULLET_ACT_HIT
- if(A.dna && A.dna.check_mutation(HULK)) //NO HULK
+ var/datum/dna/dna = A.has_dna()
+ if(dna?.check_mutation(HULK)) //NO HULK
return BULLET_ACT_HIT
if(!isturf(A.loc)) //NO MOTHERFLIPPIN MECHS!
return BULLET_ACT_HIT
@@ -115,7 +116,7 @@
return BULLET_ACT_FORCE_PIERCE
return BULLET_ACT_HIT
-/datum/martial_art/the_sleeping_carp/teach(mob/living/carbon/human/H, make_temporary = FALSE)
+/datum/martial_art/the_sleeping_carp/teach(mob/living/H, make_temporary = FALSE)
. = ..()
if(!.)
return
@@ -124,7 +125,7 @@
ADD_TRAIT(H, TRAIT_NODISMEMBER, SLEEPING_CARP_TRAIT)
H.faction |= "carp" //:D
-/datum/martial_art/the_sleeping_carp/on_remove(mob/living/carbon/human/H)
+/datum/martial_art/the_sleeping_carp/on_remove(mob/living/H)
. = ..()
REMOVE_TRAIT(H, TRAIT_NOGUNS, SLEEPING_CARP_TRAIT)
REMOVE_TRAIT(H, TRAIT_HARDLY_WOUNDED, SLEEPING_CARP_TRAIT)
@@ -134,7 +135,7 @@
/// Verb added to humans who learn the art of the sleeping carp.
-/mob/living/carbon/human/proc/sleeping_carp_help()
+/mob/living/proc/sleeping_carp_help()
set name = "Recall Teachings"
set desc = "Remember the martial techniques of the Sleeping Carp clan."
set category = "Sleeping Carp"
diff --git a/code/datums/martial/wrestling.dm b/code/datums/martial/wrestling.dm
index ba11785d612..126f94e739b 100644
--- a/code/datums/martial/wrestling.dm
+++ b/code/datums/martial/wrestling.dm
@@ -5,7 +5,7 @@ The original authors are: cogwerks, pistoleer, spyguy, angriestibm, marquesas, a
If you make a derivative work from this code, you must include this notification header alongside it.
*/
-/mob/living/carbon/human/proc/wrestling_help()
+/mob/living/proc/wrestling_help()
set name = "Recall Teachings"
set desc = "Remember how to wrestle."
set category = "Wrestling"
@@ -24,7 +24,7 @@ If you make a derivative work from this code, you must include this notification
var/datum/action/strike/strike = new/datum/action/strike()
var/datum/action/drop/drop = new/datum/action/drop()
-/datum/martial_art/wrestling/proc/check_streak(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/wrestling/proc/check_streak(mob/living/A, mob/living/D)
switch(streak)
if("drop")
streak = ""
@@ -57,8 +57,7 @@ If you make a derivative work from this code, you must include this notification
to_chat(owner, "You can't WRESTLE while you're OUT FOR THE COUNT.")
return
owner.visible_message("[owner] prepares to BODY SLAM!", "Your next attack will be a BODY SLAM.")
- var/mob/living/carbon/human/H = owner
- H.mind.martial_art.streak = "slam"
+ owner.mind.martial_art.streak = "slam"
/datum/action/throw_wrassle
name = "Throw (Cinch) - Spin a cinched opponent around and throw them."
@@ -69,8 +68,7 @@ If you make a derivative work from this code, you must include this notification
to_chat(owner, "You can't WRESTLE while you're OUT FOR THE COUNT.")
return
owner.visible_message("[owner] prepares to THROW!", "Your next attack will be a THROW.")
- var/mob/living/carbon/human/H = owner
- H.mind.martial_art.streak = "throw"
+ owner.mind.martial_art.streak = "throw"
/datum/action/kick
name = "Kick - A powerful kick, sends people flying away from you. Also useful for escaping from bad situations."
@@ -81,8 +79,7 @@ If you make a derivative work from this code, you must include this notification
to_chat(owner, "You can't WRESTLE while you're OUT FOR THE COUNT.")
return
owner.visible_message("[owner] prepares to KICK!", "Your next attack will be a KICK.")
- var/mob/living/carbon/human/H = owner
- H.mind.martial_art.streak = "kick"
+ owner.mind.martial_art.streak = "kick"
/datum/action/strike
name = "Strike - Hit a neaby opponent with a quick attack."
@@ -93,8 +90,7 @@ If you make a derivative work from this code, you must include this notification
to_chat(owner, "You can't WRESTLE while you're OUT FOR THE COUNT.")
return
owner.visible_message("[owner] prepares to STRIKE!", "Your next attack will be a STRIKE.")
- var/mob/living/carbon/human/H = owner
- H.mind.martial_art.streak = "strike"
+ owner.mind.martial_art.streak = "strike"
/datum/action/drop
name = "Drop - Smash down onto an opponent."
@@ -105,34 +101,33 @@ If you make a derivative work from this code, you must include this notification
to_chat(owner, "You can't WRESTLE while you're OUT FOR THE COUNT.")
return
owner.visible_message("[owner] prepares to LEG DROP!", "Your next attack will be a LEG DROP.")
- var/mob/living/carbon/human/H = owner
- H.mind.martial_art.streak = "drop"
+ owner.mind.martial_art.streak = "drop"
-/datum/martial_art/wrestling/teach(mob/living/carbon/human/H,make_temporary=0)
+/datum/martial_art/wrestling/teach(mob/living/owner, make_temporary=FALSE)
if(..())
- to_chat(H, "SNAP INTO A THIN TIM!")
- to_chat(H, "Place your cursor over a move at the top of the screen to see what it does.")
- drop.Grant(H)
- kick.Grant(H)
- slam.Grant(H)
- throw_wrassle.Grant(H)
- strike.Grant(H)
+ to_chat(owner, "SNAP INTO A THIN TIM!")
+ to_chat(owner, "Place your cursor over a move at the top of the screen to see what it does.")
+ drop.Grant(owner)
+ kick.Grant(owner)
+ slam.Grant(owner)
+ throw_wrassle.Grant(owner)
+ strike.Grant(owner)
-/datum/martial_art/wrestling/on_remove(mob/living/carbon/human/H)
- to_chat(H, "You no longer feel that the tower of power is too sweet to be sour...")
- drop.Remove(H)
- kick.Remove(H)
- slam.Remove(H)
- throw_wrassle.Remove(H)
- strike.Remove(H)
+/datum/martial_art/wrestling/on_remove(mob/living/owner)
+ to_chat(owner, "You no longer feel that the tower of power is too sweet to be sour...")
+ drop.Remove(owner)
+ kick.Remove(owner)
+ slam.Remove(owner)
+ throw_wrassle.Remove(owner)
+ strike.Remove(owner)
-/datum/martial_art/wrestling/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/wrestling/harm_act(mob/living/A, mob/living/D)
if(check_streak(A,D))
return 1
log_combat(A, D, "punched with wrestling")
..()
-/datum/martial_art/wrestling/proc/throw_wrassle(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/wrestling/proc/throw_wrassle(mob/living/A, mob/living/D)
if(!D)
return
if(!A.pulling || A.pulling != D)
@@ -203,11 +198,11 @@ If you make a derivative work from this code, you must include this notification
if (T && isturf(T))
if (!D.stat)
D.emote("scream")
- D.throw_at(T, 10, 4, A, TRUE, TRUE, callback = CALLBACK(D, /mob/living/carbon/human.proc/Paralyze, 20))
+ D.throw_at(T, 10, 4, A, TRUE, TRUE, callback = CALLBACK(D, /mob/living.proc/Paralyze, 20))
log_combat(A, D, "has thrown with wrestling")
return
-/datum/martial_art/wrestling/proc/FlipAnimation(mob/living/carbon/human/D)
+/datum/martial_art/wrestling/proc/FlipAnimation(mob/living/D)
set waitfor = FALSE
if (D)
animate(D, transform = matrix(180, MATRIX_ROTATE), time = 1, loop = 0)
@@ -215,7 +210,7 @@ If you make a derivative work from this code, you must include this notification
if (D)
animate(D, transform = null, time = 1, loop = 0)
-/datum/martial_art/wrestling/proc/slam(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/wrestling/proc/slam(mob/living/A, mob/living/D)
if(!D)
return
if(!A.pulling || A.pulling != D)
@@ -327,11 +322,11 @@ If you make a derivative work from this code, you must include this notification
log_combat(A, D, "body-slammed")
return
-/datum/martial_art/wrestling/proc/CheckStrikeTurf(mob/living/carbon/human/A, turf/T)
+/datum/martial_art/wrestling/proc/CheckStrikeTurf(mob/living/A, turf/T)
if (A && (T && isturf(T) && get_dist(A, T) <= 1))
A.forceMove(T)
-/datum/martial_art/wrestling/proc/strike(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/wrestling/proc/strike(mob/living/A, mob/living/D)
if(!D)
return
var/turf/T = get_turf(A)
@@ -350,7 +345,7 @@ If you make a derivative work from this code, you must include this notification
D.Unconscious(20)
log_combat(A, D, "headbutted")
-/datum/martial_art/wrestling/proc/kick(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/wrestling/proc/kick(mob/living/A, mob/living/D)
if(!D)
return
A.emote("scream")
@@ -369,7 +364,7 @@ If you make a derivative work from this code, you must include this notification
D.throw_at(T, 3, 2)
log_combat(A, D, "roundhouse-kicked")
-/datum/martial_art/wrestling/proc/drop(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/wrestling/proc/drop(mob/living/A, mob/living/D)
if(!D)
return
var/obj/surface = null
@@ -447,13 +442,13 @@ If you make a derivative work from this code, you must include this notification
log_combat(A, D, "leg-dropped")
return
-/datum/martial_art/wrestling/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/wrestling/disarm_act(mob/living/A, mob/living/D)
if(check_streak(A,D))
return 1
log_combat(A, D, "wrestling-disarmed")
..()
-/datum/martial_art/wrestling/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
+/datum/martial_art/wrestling/grab_act(mob/living/A, mob/living/D)
if(check_streak(A,D))
return 1
if(A.pulling == D)
@@ -472,18 +467,12 @@ If you make a derivative work from this code, you must include this notification
/obj/item/storage/belt/champion/wrestling/equipped(mob/user, slot)
. = ..()
- if(!ishuman(user))
- return
if(slot == ITEM_SLOT_BELT)
- var/mob/living/carbon/human/H = user
- style.teach(H,1)
+ style.teach(user, TRUE)
return
/obj/item/storage/belt/champion/wrestling/dropped(mob/user)
. = ..()
- if(!ishuman(user))
- return
- var/mob/living/carbon/human/H = user
- if(H.get_item_by_slot(ITEM_SLOT_BELT) == src)
- style.remove(H)
+ if(user.get_item_by_slot(ITEM_SLOT_BELT) == src)
+ style.remove(user)
return
diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm
index eebb4176397..2e60dcaf8cd 100644
--- a/code/game/objects/structures/tables_racks.dm
+++ b/code/game/objects/structures/tables_racks.dm
@@ -145,7 +145,7 @@
var/extra_wound = 0
if(HAS_TRAIT(user, TRAIT_HULK))
extra_wound = 20
- banged_limb.receive_damage(30, wound_bonus = extra_wound)
+ banged_limb?.receive_damage(30, wound_bonus = extra_wound)
pushed_mob.apply_damage(60, STAMINA)
take_damage(50)
if(user.mind?.martial_art.smashes_tables && user.mind?.martial_art.can_use(user))
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 21cfc8a0d00..1a3712f60ed 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -1337,5 +1337,13 @@
return ..()
+
+/mob/living/carbon/get_attack_type()
+ var/datum/species/species = dna?.species
+ if (species)
+ return species.attack_type
+ return ..()
+
+
/mob/living/carbon/proc/attach_rot(mapload)
AddComponent(/datum/component/rot/corpse)
diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm
index cdd6b7ea524..21ba34f363f 100644
--- a/code/modules/mob/living/carbon/carbon_defense.dm
+++ b/code/modules/mob/living/carbon/carbon_defense.dm
@@ -165,6 +165,9 @@
if(W.try_handling(user))
return TRUE
+ if (user.apply_martial_art(src))
+ return TRUE
+
return FALSE
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 00f884c355d..6079d6c9877 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -1902,3 +1902,35 @@
/mob/living/proc/on_handsblocked_end()
REMOVE_TRAIT(src, TRAIT_UI_BLOCKED, TRAIT_HANDS_BLOCKED)
REMOVE_TRAIT(src, TRAIT_PULL_BLOCKED, TRAIT_HANDS_BLOCKED)
+
+
+/// Returns the attack damage type of a living mob such as [BRUTE].
+/mob/living/proc/get_attack_type()
+ return BRUTE
+
+
+/**
+ * Apply a martial art move from src to target.
+ *
+ * This is used to process martial art attacks against nonhumans.
+ * It is also used to process martial art attacks by nonhumans, even against humans
+ * Human vs human attacks are handled in species code right now.
+ */
+/mob/living/proc/apply_martial_art(mob/living/target)
+ if(HAS_TRAIT(target, TRAIT_MARTIAL_ARTS_IMMUNE))
+ return FALSE
+ var/datum/martial_art/style = mind?.martial_art
+ var/attack_result = FALSE
+ if (style)
+ switch (a_intent)
+ if (INTENT_GRAB)
+ attack_result = style.grab_act(src, target)
+ if (INTENT_HARM)
+ if (HAS_TRAIT(src, TRAIT_PACIFISM))
+ return FALSE
+ attack_result = style.harm_act(src, target)
+ if (INTENT_DISARM)
+ attack_result = style.disarm_act(src, target)
+ if (INTENT_HELP)
+ attack_result = style.help_act(src, target)
+ return attack_result
diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm
index e1048c00254..a45d056ff13 100644
--- a/code/modules/mob/living/living_defense.dm
+++ b/code/modules/mob/living/living_defense.dm
@@ -223,32 +223,47 @@
log_combat(M, src, "attacked")
return TRUE
+/mob/living/attack_hand(mob/living/carbon/human/user)
+ . = ..()
+ if (user.apply_martial_art(src))
+ return TRUE
/mob/living/attack_paw(mob/living/carbon/human/M)
if(isturf(loc) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return FALSE
- if (M.a_intent == INTENT_HARM)
- if(HAS_TRAIT(M, TRAIT_PACIFISM))
- to_chat(M, "You don't want to hurt anyone!")
- return FALSE
+ if (M.apply_martial_art(src))
+ return TRUE
- if(M.is_muzzled() || M.is_mouth_covered(FALSE, TRUE))
- to_chat(M, "You can't bite with your mouth covered!")
+ switch (M.a_intent)
+ if (INTENT_HARM)
+ if(HAS_TRAIT(M, TRAIT_PACIFISM))
+ to_chat(M, "You don't want to hurt anyone!")
+ return FALSE
+
+ if(M.is_muzzled() || M.is_mouth_covered(FALSE, TRUE))
+ to_chat(M, "You can't bite with your mouth covered!")
+ return FALSE
+ M.do_attack_animation(src, ATTACK_EFFECT_BITE)
+ if (prob(75))
+ log_combat(M, src, "attacked")
+ playsound(loc, 'sound/weapons/bite.ogg', 50, TRUE, -1)
+ visible_message("[M.name] bites [src]!", \
+ "[M.name] bites you!", "You hear a chomp!", COMBAT_MESSAGE_RANGE, M)
+ to_chat(M, "You bite [src]!")
+ return TRUE
+ else
+ visible_message("[M.name]'s bite misses [src]!", \
+ "You avoid [M.name]'s bite!", "You hear the sound of jaws snapping shut!", COMBAT_MESSAGE_RANGE, M)
+ to_chat(M, "Your bite misses [src]!")
+ if (INTENT_GRAB)
+ grabbedby(M)
return FALSE
- M.do_attack_animation(src, ATTACK_EFFECT_BITE)
- if (prob(75))
- log_combat(M, src, "attacked")
- playsound(loc, 'sound/weapons/bite.ogg', 50, TRUE, -1)
- visible_message("[M.name] bites [src]!", \
- "[M.name] bites you!", "You hear a chomp!", COMBAT_MESSAGE_RANGE, M)
- to_chat(M, "You bite [src]!")
- return TRUE
- else
- visible_message("[M.name]'s bite misses [src]!", \
- "You avoid [M.name]'s bite!", "You hear the sound of jaws snapping shut!", COMBAT_MESSAGE_RANGE, M)
- to_chat(M, "Your bite misses [src]!")
+ if (INTENT_DISARM)
+ if (M != src)
+ M.disarm(src)
+ return TRUE
return FALSE
/mob/living/attack_larva(mob/living/carbon/alien/larva/L)
diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm
index 4e5928bd14e..5f6f7aa6efc 100644
--- a/code/modules/mob/living/silicon/silicon.dm
+++ b/code/modules/mob/living/silicon/silicon.dm
@@ -59,6 +59,7 @@
diag_hud_set_health()
add_sensors()
ADD_TRAIT(src, TRAIT_ADVANCEDTOOLUSER, ROUNDSTART_TRAIT)
+ ADD_TRAIT(src, TRAIT_MARTIAL_ARTS_IMMUNE, ROUNDSTART_TRAIT)
/mob/living/silicon/Destroy()
QDEL_NULL(radio)
diff --git a/code/modules/mob/living/simple_animal/animal_defense.dm b/code/modules/mob/living/simple_animal/animal_defense.dm
index a1bcd48d9c3..aa72860d725 100644
--- a/code/modules/mob/living/simple_animal/animal_defense.dm
+++ b/code/modules/mob/living/simple_animal/animal_defense.dm
@@ -1,7 +1,9 @@
/mob/living/simple_animal/attack_hand(mob/living/carbon/human/M)
- ..()
+ // so that martial arts don't double dip
+ if (..())
+ return TRUE
switch(M.a_intent)
if("help")
if (stat == DEAD)
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm
index 9740b011bf6..609bdf0b122 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm
@@ -61,6 +61,7 @@
AddComponent(/datum/component/gps, gps_name)
ADD_TRAIT(src, TRAIT_NO_TELEPORT, MEGAFAUNA_TRAIT)
ADD_TRAIT(src, TRAIT_SPACEWALK, INNATE_TRAIT)
+ ADD_TRAIT(src, TRAIT_MARTIAL_ARTS_IMMUNE, MEGAFAUNA_TRAIT)
for(var/action_type in attack_action_types)
var/datum/action/innate/megafauna_attack/attack_action = new action_type()
attack_action.Grant(src)