diff --git a/code/__defines/traits/declarations.dm b/code/__defines/traits/declarations.dm index 58de9a3d6aa..557f3d837c0 100644 --- a/code/__defines/traits/declarations.dm +++ b/code/__defines/traits/declarations.dm @@ -37,3 +37,5 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_IGNORE_FIRE_PROTECTION "ignore_fire_protection" /// Owner will slam down heavily into the ground upon falling from a height! #define TRAIT_HEAVY_LANDING "trait_heavy_landing" +/// If using melee, attacks will use the 'get_sparring_variant' if possible +#define TRAIT_NONLETHAL_BLOWS "trait_nonlethal_blows" diff --git a/code/__defines/traits/sources.dm b/code/__defines/traits/sources.dm index 9e282a693df..d7d65ff6018 100644 --- a/code/__defines/traits/sources.dm +++ b/code/__defines/traits/sources.dm @@ -5,3 +5,5 @@ #define ROUNDSTART_TRAIT "roundstart" /// This trait comes from when a mob is currently typing. #define CURRENTLY_TYPING_TRAIT "currently_typing" +/// Trait given by performing an action (proc, verb, etc. Something that the USER can control) +#define ACTION_TRAIT "action" diff --git a/code/modules/clothing/gloves/boxing.dm b/code/modules/clothing/gloves/boxing.dm index 3cb5ca54578..8e7d3419504 100644 --- a/code/modules/clothing/gloves/boxing.dm +++ b/code/modules/clothing/gloves/boxing.dm @@ -4,6 +4,19 @@ icon_state = "boxing" item_state_slots = list(slot_r_hand_str = "red", slot_l_hand_str = "red") +/obj/item/clothing/gloves/boxing/equipped(mob/user, slot) + . = ..() + if(user) + if(slot && slot == slot_gloves) + ADD_TRAIT(user, TRAIT_NONLETHAL_BLOWS, CLOTHING_TRAIT) + return + if(HAS_TRAIT_FROM(user, TRAIT_NONLETHAL_BLOWS, CLOTHING_TRAIT)) + REMOVE_TRAIT(user, TRAIT_NONLETHAL_BLOWS, CLOTHING_TRAIT) + +/obj/item/clothing/gloves/boxing/dropped(mob/user) + . = ..() + if(HAS_TRAIT_FROM(user, TRAIT_NONLETHAL_BLOWS, CLOTHING_TRAIT)) + REMOVE_TRAIT(user, TRAIT_NONLETHAL_BLOWS, CLOTHING_TRAIT) /* /obj/item/clothing/gloves/boxing/attackby(obj/item/W, mob/user) if(W.has_tool_quality(TOOL_WIRECUTTER) || istype(W, /obj/item/surgical/scalpel)) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index f076113e17b..7c499876b3d 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1635,8 +1635,13 @@ set category = "IC.Game" if(stat) return - pulling_punches = !pulling_punches - to_chat(src, span_notice("You are now [pulling_punches ? "pulling your punches" : "not pulling your punches"].")) + var/pulling = FALSE + if(HAS_TRAIT_FROM(src, TRAIT_NONLETHAL_BLOWS, ACTION_TRAIT)) + REMOVE_TRAIT(src, TRAIT_NONLETHAL_BLOWS, ACTION_TRAIT) + else + ADD_TRAIT(src, TRAIT_NONLETHAL_BLOWS, ACTION_TRAIT) + pulling = TRUE + to_chat(src, span_notice("You are now [pulling ? "pulling your punches" : "not pulling your punches"].")) return /mob/living/carbon/human/should_have_organ(var/organ_check) diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index a9e7c0802b7..a27d4f02a70 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -4,7 +4,7 @@ /mob/living/carbon/human/proc/get_unarmed_attack(var/mob/living/carbon/human/target, var/hit_zone) if(nif && nif.flag_check(NIF_C_HARDCLAWS,NIF_FLAGS_COMBAT)){return unarmed_hardclaws} if(src.default_attack && src.default_attack.is_usable(src, target, hit_zone)) - if(pulling_punches) + if(HAS_TRAIT(src, TRAIT_NONLETHAL_BLOWS)) var/datum/unarmed_attack/soft_type = src.default_attack.get_sparring_variant() if(soft_type) return soft_type @@ -12,20 +12,20 @@ if(src.gloves) var/obj/item/clothing/gloves/G = src.gloves if(istype(G) && G.special_attack && G.special_attack.is_usable(src, target, hit_zone)) - if(pulling_punches) + if(HAS_TRAIT(src, TRAIT_NONLETHAL_BLOWS)) var/datum/unarmed_attack/soft_type = G.special_attack.get_sparring_variant() if(soft_type) return soft_type return G.special_attack if(src.default_attack && src.default_attack.is_usable(src, target, hit_zone)) - if(pulling_punches) + if(HAS_TRAIT(src, TRAIT_NONLETHAL_BLOWS)) var/datum/unarmed_attack/soft_type = src.default_attack.get_sparring_variant() if(soft_type) return soft_type return src.default_attack for(var/datum/unarmed_attack/u_attack in species.unarmed_attacks) if(u_attack.is_usable(src, target, hit_zone)) - if(pulling_punches) + if(HAS_TRAIT(src, TRAIT_NONLETHAL_BLOWS)) var/datum/unarmed_attack/soft_variant = u_attack.get_sparring_variant() if(soft_variant) return soft_variant @@ -389,7 +389,7 @@ var/obj/item/clothing/accessory/G = H.gloves real_damage += G.punch_force hit_dam_type = G.punch_damtype - if(H.pulling_punches && !attack.sharp && !attack.edge) //SO IT IS DECREED: PULLING PUNCHES WILL PREVENT THE ACTUAL DAMAGE FROM RINGS AND KNUCKLES, BUT NOT THE ADDED PAIN, BUT YOU CAN'T "PULL" A KNIFE + if(HAS_TRAIT(H, TRAIT_NONLETHAL_BLOWS) && !attack.sharp && !attack.edge) //SO IT IS DECREED: PULLING PUNCHES WILL PREVENT THE ACTUAL DAMAGE FROM RINGS AND KNUCKLES, BUT NOT THE ADDED PAIN, BUT YOU CAN'T "PULL" A KNIFE hit_dam_type = HALLOSS real_damage *= damage_multiplier rand_damage *= damage_multiplier diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 0bdaefd20d8..47306d673f9 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -90,7 +90,6 @@ var/hand_blood_color var/list/flavor_texts = list() - var/pulling_punches // Are you trying not to hurt your opponent? var/robolimb_count = 0 // Total number of external robot parts. var/robobody_count = 0 // Counts torso, groin, and head, if they're robotic