mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 19:44:58 +01:00
[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:
@@ -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..."))
|
||||
|
||||
Reference in New Issue
Block a user