mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-26 22:57:39 +01:00
[MIRROR] Adds dodge pickup attempt option to personal space bubble (#12276)
Co-authored-by: Olive <49600480+zeskorion@users.noreply.github.com> Co-authored-by: CameronSTaljaard <cameronstaljaard@gmail.com>
This commit is contained in:
co-authored by
Olive
CameronSTaljaard
parent
5cb81fbb11
commit
a656eb127a
@@ -5,3 +5,4 @@
|
||||
#define SPECIES_TRAIT_PATTING_DEFENCE 1
|
||||
#define SPECIES_TRAIT_PERSONAL_BUBBLE 2
|
||||
#define SPECIES_TRAIT_THORNS 4
|
||||
#define SPECIES_TRAIT_PICKUP_DODGE 8
|
||||
|
||||
@@ -368,6 +368,12 @@ var/list/holder_mob_icon_cache = list()
|
||||
if(!holder_type || buckled || pinned.len)
|
||||
return
|
||||
|
||||
// Dodge pickup if enabled by personal space bubble.
|
||||
if(!self_grab && (touch_reaction_flags & SPECIES_TRAIT_PICKUP_DODGE))
|
||||
grabber.visible_message(span_notice("[src] deftly evades [grabber]'s attempt to pick them up!"))
|
||||
to_chat(grabber, span_notice("[src] evaded your pickup attempt!"))
|
||||
return
|
||||
|
||||
if(self_grab)
|
||||
if(src.incapacitated()) return
|
||||
else
|
||||
|
||||
@@ -1620,16 +1620,20 @@
|
||||
|
||||
/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."
|
||||
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, shake your hand, or pick you up. These can be toggled independently."
|
||||
cost = 0
|
||||
custom_only = FALSE
|
||||
has_preferences = list("bubble_toggle" = list(TRAIT_PREF_TYPE_BOOLEAN, "Enabled on spawn", TRAIT_NO_VAREDIT_TARGET, TRUE))
|
||||
has_preferences = list("bubble_toggle" = list(TRAIT_PREF_TYPE_BOOLEAN, "Dodge physical contact on spawn", TRAIT_NO_VAREDIT_TARGET, TRUE),
|
||||
"pickup_dodge_toggle" = list(TRAIT_PREF_TYPE_BOOLEAN, "Dodge pickup attempts on spawn", TRAIT_NO_VAREDIT_TARGET, TRUE))
|
||||
|
||||
/datum/trait/neutral/personal_space/apply(var/datum/species/S, var/mob/living/carbon/human/H, var/list/trait_prefs)
|
||||
..()
|
||||
if(trait_prefs && trait_prefs["bubble_toggle"])
|
||||
H.touch_reaction_flags |= SPECIES_TRAIT_PERSONAL_BUBBLE
|
||||
if(trait_prefs && trait_prefs["pickup_dodge_toggle"])
|
||||
H.touch_reaction_flags |= SPECIES_TRAIT_PICKUP_DODGE
|
||||
add_verb(H, /mob/living/proc/toggle_personal_space)
|
||||
add_verb(H, /mob/living/proc/toggle_pickup_dodge)
|
||||
|
||||
/datum/trait/neutral/colour_changing_eyes
|
||||
name = "Colour changing eyes"
|
||||
|
||||
@@ -55,6 +55,18 @@
|
||||
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."))
|
||||
|
||||
/mob/living/proc/toggle_pickup_dodge()
|
||||
set name = "Toggle Pickup Dodge"
|
||||
set desc = "Toggles dodging any attempts to pick you up."
|
||||
set category = "Abilities.General"
|
||||
|
||||
if(touch_reaction_flags & SPECIES_TRAIT_PICKUP_DODGE)
|
||||
touch_reaction_flags &= ~(SPECIES_TRAIT_PICKUP_DODGE)
|
||||
to_chat(src, span_notice("You will no longer dodge pickup attempts."))
|
||||
return
|
||||
touch_reaction_flags |= SPECIES_TRAIT_PICKUP_DODGE
|
||||
to_chat(src, span_notice("You will now dodge pickup attempts."))
|
||||
|
||||
/mob/living/proc/toggle_thorns()
|
||||
set name = "Toggle Thorns"
|
||||
set desc = "Toggles defensive thorns across your body."
|
||||
|
||||
Reference in New Issue
Block a user