Reflexive Biting and Personal Space Traits (#17289)

* Reflexive Biting Trait

Added a new trait that causes you to bite the hand of anyone who either pats you on the head or boops you on the nose. This deals one point of damage to the hand committing said offense. This also includes a verb in Abilities to toggle this off and on.

* Personal bubble

* wording

* Block sniff and licks

* Moves from variables to flags

* Unsetting flags properly

* Properly resolved the conflict

* Better way to deconflict it
This commit is contained in:
SatinIsle
2025-03-17 23:20:37 +01:00
committed by GitHub
parent 1f42d228e6
commit 229a7d5b12
7 changed files with 94 additions and 9 deletions
@@ -466,19 +466,44 @@
t_him = "him"
if(FEMALE)
t_him = "her"
if(target.touch_reaction_flags & SPECIES_TRAIT_PERSONAL_BUBBLE)
H.visible_message( \
span_notice("[target] moves to avoid being touched by [H]!"), \
span_notice("[target] moves to avoid being touched by you!"), )
return
//VOREStation Edit Start - Headpats and Handshakes.
if(H.zone_sel.selecting == "head")
H.visible_message( \
span_notice("[H] pats [target] on the head."), \
span_notice("You pat [target] on the head."), )
if(target.touch_reaction_flags & SPECIES_TRAIT_PATTING_DEFENCE)
H.visible_message( \
span_warning("[target] reflexively bites the hand of [H] to prevent head patting!"), \
span_warning("[target] reflexively bites your hand!"), )
if(H.hand)
H.apply_damage(1, BRUTE, BP_L_HAND)
else
H.apply_damage(1, BRUTE, BP_R_HAND)
else
H.visible_message( \
span_notice("[H] pats [target] on the head."), \
span_notice("You pat [target] on the head."), )
else if(H.zone_sel.selecting == "r_hand" || H.zone_sel.selecting == "l_hand")
H.visible_message( \
span_notice("[H] shakes [target]'s hand."), \
span_notice("You shake [target]'s hand."), )
else if(H.zone_sel.selecting == "mouth")
H.visible_message( \
span_notice("[H] boops [target]'s nose."), \
span_notice("You boop [target] on the nose."), )
if(target.touch_reaction_flags & SPECIES_TRAIT_PATTING_DEFENCE)
H.visible_message( \
span_warning("[target] reflexively bites the hand of [H] to prevent nose booping!"), \
span_warning("[target] reflexively bites your hand!"), )
if(H.hand)
H.apply_damage(1, BRUTE, BP_L_HAND)
else
H.apply_damage(1, BRUTE, BP_R_HAND)
else
H.visible_message( \
span_notice("[H] boops [target]'s nose."), \
span_notice("You boop [target] on the nose."), )
//VOREStation Edit End
else
H.visible_message(span_notice("[H] hugs [target] to make [t_him] feel better!"), \
@@ -1414,3 +1414,25 @@
cost = 0
var_changes = list("mudking" = TRUE)
custom_only = FALSE
/datum/trait/neutral/patting_defence
name = "Reflexive Biting"
desc = "You will reflexively bite hands that attempt to pat your head or boop your nose, this can be toggled off."
cost = 0
custom_only = FALSE
/datum/trait/neutral/patting_defence/apply(var/datum/species/S,var/mob/living/carbon/human/H)
..()
H.touch_reaction_flags |= SPECIES_TRAIT_PATTING_DEFENCE
add_verb(H, /mob/living/proc/toggle_patting_defence)
/datum/trait/neutral/personal_space
name = "Personal Space Bubble"
desc = "You are adept at avoiding unwanted physical contact and dodge it with ease. You will reflexively dodge any attempt to hug, pat, boop, lick, sniff you or even shake your hand, this can be toggled off."
cost = 0
custom_only = FALSE
/datum/trait/neutral/patting_defence/apply(var/datum/species/S,var/mob/living/carbon/human/H)
..()
H.touch_reaction_flags |= SPECIES_TRAIT_PERSONAL_BUBBLE
add_verb(H, /mob/living/proc/toggle_personal_space)
@@ -105,3 +105,5 @@
"'s hands are shaking.",
" is rocking slightly from side to side."
)
var/touch_reaction_flags
+24
View File
@@ -30,3 +30,27 @@
to_chat(src, span_notice("You will [allow_self_surgery ? "now" : "no longer"] attempt to operate upon yourself."))
log_admin("DEBUG \[[world.timeofday]\]: [src.ckey ? "[src.name]:([src.ckey])" : "[src.name]"] has [allow_self_surgery ? "Enabled" : "Disabled"] self surgery.")
/mob/living/proc/toggle_patting_defence()
set name = "Toggle Reflexive Biting"
set desc = "Toggles the automatic biting for if someone pats you on the head or boops your nose."
set category = "Abilities.General"
if(touch_reaction_flags & SPECIES_TRAIT_PATTING_DEFENCE)
touch_reaction_flags &= ~(SPECIES_TRAIT_PATTING_DEFENCE)
to_chat(src,span_notice("You will no longer bite hands who pat or boop you."))
else
touch_reaction_flags |= SPECIES_TRAIT_PATTING_DEFENCE
to_chat(src,span_notice("You will now longer bite hands who pat or boop you."))
/mob/living/proc/toggle_personal_space()
set name = "Toggle Personal Space"
set desc = "Toggles dodging any attempts to hug or pat you."
set category = "Abilities.General"
if(touch_reaction_flags & SPECIES_TRAIT_PERSONAL_BUBBLE)
touch_reaction_flags &= ~(SPECIES_TRAIT_PERSONAL_BUBBLE)
to_chat(src,span_notice("You will no longer dodge all attempts at hugging, patting, booping, licking, smelling and hand shaking."))
else
touch_reaction_flags |= SPECIES_TRAIT_PERSONAL_BUBBLE
to_chat(src,span_notice("You will now dodge all attempts at hugging, patting, booping, licking, smelling and hand shaking."))
+8 -3
View File
@@ -530,15 +530,17 @@
return
setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(tasted == src)
visible_message(span_vwarning("[src] licks themself!"),span_notice("You lick yourself. You taste rather like [tasted.get_taste_message()]."),span_infoplain(span_bold("Slurp!")))
//balloon_alert_visible("licks themself!", "tastes like [tasted.get_taste_message()]")
else
if((tasted.touch_reaction_flags & SPECIES_TRAIT_PERSONAL_BUBBLE) && (!tasted.grabbed_by.len || !tasted.stat))
visible_message(span_warning("[src] tries to lick [tasted], but they dodge out of the way!"),span_warning("You try to lick [tasted], but they deftly avoid your attempt."))
return
visible_message(span_vwarning("[src] licks [tasted]!"),span_notice("You lick [tasted]. They taste rather like [tasted.get_taste_message()]."),span_infoplain(span_bold("Slurp!")))
//balloon_alert_visible("licks [tasted]!", "tastes like [tasted.get_taste_message()]")
/mob/living/proc/get_taste_message(allow_generic = 1)
if(!vore_taste && !allow_generic)
return FALSE
@@ -575,14 +577,17 @@
return
setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(smelled == src)
visible_message(span_vwarning("[src] smells themself!"),span_notice("You smell yourself. You smell like [smelled.get_smell_message()]."),span_infoplain(span_bold("Sniff!")))
//balloon_alert_visible("smells themself!", "smells like [smelled.get_smell_message()]")
else
if((smelled.touch_reaction_flags & SPECIES_TRAIT_PERSONAL_BUBBLE) && (!smelled.grabbed_by.len || !smelled.stat))
visible_message(span_warning("[src] tries to smell [smelled], but they dodge out of the way!"),span_warning("You try to smell [smelled], but they deftly avoid your attempt."))
return
visible_message(span_vwarning("[src] smells [smelled]!"),span_notice("You smell [smelled]. They smell like [smelled.get_smell_message()]."),span_infoplain(span_bold("Sniff!")))
//balloon_alert_visible("smells [smelled]!", "smells like [smelled.get_smell_message()]")
/mob/living/proc/get_smell_message(allow_generic = 1)
if(!vore_smell && !allow_generic)
return FALSE