Files
Bubberstation/code/modules/admin/smites/bad_luck.dm
T
071f6063e6 Adds charges to omens and omen smiting. Reduces omen bad luck if nobody's nearby. (#78899)
## About The Pull Request

refactor: Adds charges to omens and omen smiting rather than only being
permanent or one-use. Mirrors now grant seven bad luckers.

qol: Reduces omen bad luck if nobody's nearby to witness the funny.
(Ghosts are included in the check!)

fix: Fixed an issue where a monkey check in doorcrushing was never
actually able to pass. Also they screech now.

## Why It's Good For The Game

> refactor: Adds charges to omens and omen smiting rather than only
being permanent or one-use. Mirrors now grant seven bad luckers.

Allows for someone to get between 1-infinity omen accidents. Seriously
why wasnt this a thing before

> qol: Reduces omen bad luck if nobody's nearby.

I LOVE this quirk, but trying to do antything at all except 'Suffer
Miserably' is nigh impossible. To alleviate life a little, making it so
that you have a lesser chance of suffering misfortune if nobody's around
will be the perfect compromise. It makes life easier but doesn't
compromise funny moments.

Any client in viewrange will disable the reduction. This includes
ghosts.

## Changelog

🆑
refactor: Adds charges to omens and omen smiting rather than only being
permanent or one-use. Mirrors now grant seven bad luckers.
qol: Reduces omen bad luck if nobody's nearby to witness the funny.
(Ghosts are included in the check!)
fix: Fixed an issue where a monkey check in doorcrushing was never
actually able to pass. Also they screech now.
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2023-10-25 12:39:54 +00:00

29 lines
1.1 KiB
Plaintext

/// Gives the target bad luck, optionally permanently
/datum/smite/bad_luck
name = "Bad Luck"
/// Should the target know they've received bad luck?
var/silent
/// Is this permanent?
var/incidents
/datum/smite/bad_luck/configure(client/user)
silent = tgui_alert(user, "Do you want to apply the omen with a player notification?", "Notify Player?", list("Notify", "Silent")) == "Silent"
incidents = tgui_input_number(user, "For how many incidents will the omen last? 0 means permanent.", "Duration?", default = 0, round_value = 1)
if(incidents == 0)
incidents = INFINITY
/datum/smite/bad_luck/effect(client/user, mob/living/target)
. = ..()
//if permanent, replace any existing omen
if(incidents == INFINITY)
var/existing_component = target.GetComponent(/datum/component/omen)
qdel(existing_component)
target.AddComponent(/datum/component/omen/smite, incidents_left = incidents)
if(silent)
return
to_chat(target, span_warning("You get a bad feeling..."))
if(incidents == INFINITY)
to_chat(target, span_warning("A <b>very</b> bad feeling... As if malevolent forces are watching you..."))