[MIRROR] Adds charges to omens and omen smiting. Reduces omen bad luck if nobody's nearby. [MDB IGNORE] (#24583)

* Adds charges to omens and omen smiting. Reduces omen bad luck if nobody's nearby.

* Update door.dm

* Update door.dm

---------

Co-authored-by: carlarctg <53100513+carlarctg@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-10-25 21:22:41 +02:00
committed by GitHub
parent b327f357d2
commit 031b17eaad
4 changed files with 77 additions and 44 deletions
+7 -5
View File
@@ -6,21 +6,23 @@
var/silent
/// Is this permanent?
var/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"
permanent = tgui_alert(user, "Would you like this to be permanent or removed automatically after the first accident?", "Permanent?", list("Permanent", "Temporary")) == "Permanent"
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(permanent)
if(incidents == INFINITY)
var/existing_component = target.GetComponent(/datum/component/omen)
qdel(existing_component)
target.AddComponent(/datum/component/omen/smite, permanent = permanent)
target.AddComponent(/datum/component/omen/smite, incidents_left = incidents)
if(silent)
return
to_chat(target, span_warning("You get a bad feeling..."))
if(permanent)
if(incidents == INFINITY)
to_chat(target, span_warning("A <b>very</b> bad feeling... As if malevolent forces are watching you..."))