Files
GhomandGitHub 999bde8f84 Most screen alerts now fit the player's hud style. (#93493)
## About The Pull Request
Most screen alerts that use the midnight hud style no longer have the
button baked in their icon. Other screen alerts with their own
background or shape (robot and mech alerts, atmos, heretic buffs or
debuffs etc.) are not affected. Also updated a couple sprites but didn't
spend too much time on them. Mostly reusing existing assets.

Montage of how the alerts look on threee different hud styles
(Operative, Trasen-Knox, Detective, ALSO I FIXED THE BUCKLED ALERT
ALREADY):
<img width="293" height="323" alt="image"
src="https://github.com/user-attachments/assets/3a2b972b-aa5a-4c27-a454-c8c39acf6e20"
/>
It looks only a smidge iffy on the syndicate since the top and bottom
borders aren't layered over all the overlays, but it isn't something to
worry about in this PR.

## Why It's Good For The Game
Screen alerts always had the midnight hud button baked in their icon
states (now overlays), which completely disregard the player's hud
setting, much unlike action alerts buttons. Melbert has also said that
it'd be nice if the code for action buttons could also be used in screen
alerts and viceversa, to slim things down. That's obviously not what I'm
doing today, but having most of the screen alerts already without the
baked background will surely help if we ever pursue that objective.

## Changelog

🆑
refactor: Refactored screen alerts a little. Most should now fit the
player's hud style. Report any issue.
imageadd: A few screen alerts have been polished/updated a little.
/🆑
2025-10-31 15:30:39 -06:00

119 lines
4.4 KiB
Plaintext

/// The minimum amount of water stacks needed to start washing off the slime.
#define MIN_WATER_STACKS 5
/// The minimum amount of health a mob has to have before the status effect is removed.
#define MIN_HEALTH 10
/atom/movable/screen/alert/status_effect/slimed
name = "Covered in Slime"
desc = "You are covered in slime and it's eating away at you! Click to start cleaning it off, or find a faster way to wash it away!"
use_user_hud_icon = TRUE
overlay_state = "slimed"
clickable_glow = TRUE
/atom/movable/screen/alert/status_effect/slimed/Click()
. = ..()
if (!.)
return FALSE
if (!can_wash())
return FALSE
INVOKE_ASYNC(src, PROC_REF(remove_slime))
return TRUE
/// Confirm that we are capable of washing off slime
/atom/movable/screen/alert/status_effect/slimed/proc/can_wash()
var/mob/living/living_owner = owner
if (!living_owner.can_resist())
return FALSE
if (DOING_INTERACTION_WITH_TARGET(owner, owner))
return FALSE
if (locate(/datum/status_effect/fire_handler/wet_stacks) in living_owner.status_effects)
return FALSE // Don't double dip with washing
return TRUE
/// Try to get rid of it
/atom/movable/screen/alert/status_effect/slimed/proc/remove_slime()
owner.balloon_alert(owner, "cleaning off slime...")
var/datum/status_effect/slimed/slime_effect = owner.has_status_effect(/datum/status_effect/slimed)
while (!QDELETED(src) && !isnull(slime_effect))
if (!can_wash())
return
var/clean_interval = HAS_TRAIT(owner, TRAIT_WOUND_LICKER) ? 1.2 SECONDS : 1.5 SECONDS
owner.Shake(2, 0, duration = clean_interval * 0.8, shake_interval = 0.05 SECONDS)
if (!do_after(owner, clean_interval, owner))
return
slime_effect.remove_stacks()
/datum/status_effect/slimed
id = "slimed"
tick_interval = 3 SECONDS
alert_type = /atom/movable/screen/alert/status_effect/slimed
remove_on_fullheal = TRUE
/// The amount of slime stacks that were applied, reduced by showering yourself under water.
var/slime_stacks = 10 // ~10 seconds of standing under a shower
/// Slime color, used for particles.
var/slime_color
/// Changes particle colors to rainbow, this overrides `slime_color`.
var/rainbow
/datum/status_effect/slimed/on_creation(mob/living/new_owner, slime_color = COLOR_SLIME_GREY, rainbow = FALSE)
src.slime_color = slime_color
src.rainbow = rainbow
return ..()
/datum/status_effect/slimed/on_apply()
if(owner.get_organic_health() <= MIN_HEALTH)
return FALSE
to_chat(owner, span_userdanger("You have been covered in a thick layer of slime! Find a way to wash it off!"))
return ..()
/datum/status_effect/slimed/on_remove()
owner.remove_shared_particles(rainbow ? "slimed_rainbow" : "slimed_[slime_color]")
/datum/status_effect/slimed/update_particles()
var/obj/effect/abstract/shared_particle_holder/holder = owner.add_shared_particles(rainbow ? /particles/slime/rainbow : /particles/slime, rainbow ? "slimed_rainbow" : "slimed_[slime_color]")
if (!rainbow)
holder.particles.color = "[slime_color]a0"
/datum/status_effect/slimed/proc/remove_stacks(stacks_to_remove = 1)
slime_stacks -= stacks_to_remove // lose 1 stack per second
if(slime_stacks <= 0)
to_chat(owner, span_notice("You manage to wash off the layer of slime completely."))
qdel(src)
return
if(prob(10))
to_chat(owner,span_warning("The layer of slime is slowly getting thinner."))
/datum/status_effect/slimed/tick(seconds_between_ticks)
// remove from the mob once we have dealt enough damage
if(owner.get_organic_health() <= MIN_HEALTH)
to_chat(owner, span_warning("You feel the layer of slime crawling off of your weakened body."))
qdel(src)
return
// handle washing slime off
var/datum/status_effect/fire_handler/wet_stacks/wetness = locate() in owner.status_effects
if(istype(wetness) && wetness.stacks > (MIN_WATER_STACKS * seconds_between_ticks))
wetness.adjust_stacks(-5 * seconds_between_ticks)
remove_stacks(seconds_between_ticks) // 1 per second
if(slime_stacks <= 0)
return
// otherwise deal brute damage
owner.apply_damage(rand(2,4) * seconds_between_ticks, damagetype = BRUTE)
if(SPT_PROB(10, seconds_between_ticks))
var/feedback_text = pick(list(
"Your entire body screams with pain",
"Your skin feels like it's coming off",
"Your body feels like it's melting together"
))
to_chat(owner, span_userdanger("[feedback_text] as the layer of slime eats away at you!"))
/datum/status_effect/slimed/get_examine_text()
return span_warning("[owner.p_They()] [owner.p_are()] covered in bubbling slime!")
#undef MIN_HEALTH
#undef MIN_WATER_STACKS