Skip to content

Commit

Permalink
Sensitive Snout Customization (#2436)
Browse files Browse the repository at this point in the history
* The boopening

* Forgot this one

* Finish implementing severity config

* Early return after boop

Otherwise we're constantly shaking them to get them up after the stun
Also typecast the quirk

* Swap severities around

* whoopsie

* glorf

* emote cooldown

* Review, use defines for severities
  • Loading branch information
FlufflesTheDog authored and StealsThePRs committed May 13, 2024
1 parent 70799df commit e5b1e6a
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 4 deletions.
8 changes: 4 additions & 4 deletions code/modules/mob/living/carbon/carbon_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,11 @@
return
else
playsound(src, 'modular_nova/modules/emotes/sound/emotes/Nose_boop.ogg', 50, 0)
if(HAS_TRAIT(src, TRAIT_SENSITIVESNOUT) && get_location_accessible(src, BODY_ZONE_PRECISE_MOUTH))
to_chat(src, span_warning("[helper] boops you on your sensitive nose, sending you to the ground!"))
src.Knockdown(20)
src.apply_damage(30, STAMINA)
helper.visible_message(span_notice("[helper] boops [src]'s nose."), span_notice("You boop [src] on the nose."))
if(HAS_TRAIT(src, TRAIT_SENSITIVESNOUT) && get_location_accessible(src, BODY_ZONE_PRECISE_MOUTH))
var/datum/quirk/sensitivesnout/poor_snout = src.get_quirk(/datum/quirk/sensitivesnout)
poor_snout?.get_booped(helper)
return
//NOVA EDIT ADDITION END
else if(check_zone(helper.zone_selected) == BODY_ZONE_HEAD && get_bodypart(BODY_ZONE_HEAD)) //Headpats!
//NOVA EDIT ADDITION BEGIN - OVERSIZED & DISALLOWED HEADPATS
Expand Down
46 changes: 46 additions & 0 deletions modular_nova/master_files/code/datums/traits/neutral.dm
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,16 @@ GLOBAL_VAR_INIT(DNR_trait_overlay, generate_DNR_trait_overlay())
new_tongue.copy_traits_from(human_holder.get_organ_slot(ORGAN_SLOT_TONGUE))
new_tongue.Insert(human_holder, special = TRUE, movement_flags = DELETE_IF_REPLACED)

#define SEVERITY_STUN 1
#define SEVERITY_SNEEZE 2
#define SEVERITY_KNOCKDOWN 3

GLOBAL_LIST_INIT(possible_snout_sensitivities, list(
"Stun" = SEVERITY_STUN,
"Sneeze" = SEVERITY_SNEEZE, //Includes a stun
"Collapse" = SEVERITY_KNOCKDOWN,
))

/datum/quirk/sensitivesnout
name = "Sensitive Snout"
desc = "Your face has always been sensitive, and it really hurts when someone pokes it!"
Expand All @@ -307,6 +317,42 @@ GLOBAL_VAR_INIT(DNR_trait_overlay, generate_DNR_trait_overlay())
value = 0
mob_trait = TRAIT_SENSITIVESNOUT
icon = FA_ICON_FINGERPRINT
var/severity = SEVERITY_KNOCKDOWN
COOLDOWN_DECLARE(emote_cooldown)

/datum/quirk_constant_data/sensitive_snout
associated_typepath = /datum/quirk/sensitivesnout
customization_options = list(/datum/preference/choiced/snout_sensitivity)

/datum/quirk/sensitivesnout/add(client/client_source)
var/desired_severity = GLOB.possible_snout_sensitivities[client_source?.prefs?.read_preference(/datum/preference/choiced/snout_sensitivity)]
severity = isnum(desired_severity) ? desired_severity : 1

/datum/quirk/sensitivesnout/proc/get_booped(attacker)
var/can_emote = FALSE
if(COOLDOWN_FINISHED(src, emote_cooldown))
can_emote = TRUE
COOLDOWN_START(src, emote_cooldown, 5 SECONDS)
if (ishuman(quirk_holder) && can_emote)
var/mob/living/carbon/human/human_holder = quirk_holder
human_holder.force_say()
switch(severity)
if(SEVERITY_STUN)
to_chat(quirk_holder, span_warning("[attacker] boops you on your sensitive nose, freezing you in place!"))
quirk_holder.Stun(1 SECONDS)
if(SEVERITY_SNEEZE)
to_chat(quirk_holder, span_warning("[attacker] boops you on your sensitive nose! You can't hold back a sneeze!"))
quirk_holder.Stun(1 SECONDS)
if(can_emote)
quirk_holder.emote("sneeze")
if(SEVERITY_KNOCKDOWN)
to_chat(quirk_holder, span_warning("[attacker] boops you on your sensitive nose, sending you to the ground!"))
quirk_holder.Knockdown(1 SECONDS)
quirk_holder.apply_damage(30, STAMINA)

#undef SEVERITY_STUN
#undef SEVERITY_SNEEZE
#undef SEVERITY_KNOCKDOWN

/datum/quirk/overweight
name = "Overweight"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/datum/preference/choiced/snout_sensitivity
category = PREFERENCE_CATEGORY_MANUALLY_RENDERED
savefile_key = "snout_sensitivity"
savefile_identifier = PREFERENCE_CHARACTER

/datum/preference/choiced/snout_sensitivity/init_possible_values()
return assoc_to_keys(GLOB.possible_snout_sensitivities)

/datum/preference/choiced/snout_sensitivity/create_default_value()
return "Collapse"

/datum/preference/choiced/snout_sensitivity/apply_to_human()
return

/datum/preference/choiced/snout_sensitivity/is_accessible(datum/preferences/preferences)
. = ..()
if (!.)
return FALSE

return "Sensitive Snout" in preferences.all_quirks
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6490,6 +6490,7 @@
#include "modular_nova\master_files\code\modules\client\preferences\mutant_parts.dm"
#include "modular_nova\master_files\code\modules\client\preferences\out_of_combat_fov_darkness.dm"
#include "modular_nova\master_files\code\modules\client\preferences\scream.dm"
#include "modular_nova\master_files\code\modules\client\preferences\sensitive_snout.dm"
#include "modular_nova\master_files\code\modules\client\preferences\tgui_prefs_migration.dm"
#include "modular_nova\master_files\code\modules\client\preferences\underwear_color.dm"
#include "modular_nova\master_files\code\modules\client\preferences\voice.dm"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { FeatureChoiced } from '../../base';
import { FeatureDropdownInput } from '../../dropdowns';

export const snout_sensitivity: FeatureChoiced = {
name: 'Severity',
component: FeatureDropdownInput,
};

0 comments on commit e5b1e6a

Please sign in to comment.