Skip to content

Commit

Permalink
Allows Felinids to shower (#4686)
Browse files Browse the repository at this point in the history
sets to 0 stamina damage of water haters when in water instead of being damaged (compared to being recovered for regular people)
  • Loading branch information
OrbisAnima authored and StealsThePRs committed Dec 18, 2024
1 parent 80078d5 commit 33e46eb
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions code/datums/status_effects/neutral.dm
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,52 @@
SIGNAL_HANDLER
qdel(src)

<<<<<<< HEAD
/atom/movable/screen/alert/status_effect/shower_regen
=======
/datum/status_effect/washing_regen
id = "shower_regen"
duration = STATUS_EFFECT_PERMANENT
status_type = STATUS_EFFECT_UNIQUE
alert_type = /atom/movable/screen/alert/status_effect/washing_regen
///The screen alert shown if you hate water
var/hater_alert = /atom/movable/screen/alert/status_effect/washing_regen/hater
/// How much stamina we regain from washing
var/stamina_heal_per_tick = -4
/// How much brute, tox and fie damage we heal from this
var/heal_per_tick = 0

/datum/status_effect/washing_regen/on_apply()
. = ..()
if(HAS_TRAIT(owner, TRAIT_WATER_HATER) && !HAS_TRAIT(owner, TRAIT_WATER_ADAPTATION))
alert_type = hater_alert

/datum/status_effect/washing_regen/tick(seconds_between_ticks)
. = ..()
var/water_adaptation = HAS_TRAIT(owner, TRAIT_WATER_ADAPTATION)
var/water_hater = HAS_TRAIT(owner, TRAIT_WATER_HATER)
var/stam_recovery = (water_hater && !water_adaptation ? -stamina_heal_per_tick : stamina_heal_per_tick) * seconds_between_ticks
var/recovery = heal_per_tick
if(water_adaptation)
recovery -= 1
stam_recovery *= 1.5
else if(water_hater)
recovery *= 0
stam_recovery = 0 // NOVA EDIT ADDITIION - null the stamina damage.
recovery *= seconds_between_ticks

var/healed = 0
if(recovery) //very mild healing for those with the water adaptation trait (fish infusion)
healed += owner.adjustOxyLoss(recovery * (water_adaptation ? 1.5 : 1), updating_health = FALSE, required_biotype = MOB_ORGANIC)
healed += owner.adjustFireLoss(recovery, updating_health = FALSE, required_bodytype = BODYTYPE_ORGANIC)
healed += owner.adjustToxLoss(recovery, updating_health = FALSE, required_biotype = MOB_ORGANIC)
healed += owner.adjustBruteLoss(recovery, updating_health = FALSE, required_bodytype = BODYTYPE_ORGANIC)
healed += owner.adjustStaminaLoss(stam_recovery, updating_stamina = FALSE)
if(healed)
owner.updatehealth()

/atom/movable/screen/alert/status_effect/washing_regen
>>>>>>> c3c1ae504ae (Allows Felinids to shower (#4686))
name = "Washing"
desc = "A good wash fills me with energy!"
icon_state = "shower_regen"
Expand Down

0 comments on commit 33e46eb

Please sign in to comment.