/// 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) qdel(target.GetComponent(/datum/component/omen)) target.AddComponent( \ /datum/component/omen, \ incidents_left = incidents, \ on_death = CALLBACK(src, PROC_REF(on_death)), \ bless_fixable = incidents != INFINITY, \ ) if(silent) return to_chat(target, span_warning("You get a bad feeling...")) if(incidents == INFINITY) to_chat(target, span_warning("A very bad feeling... As if malevolent forces are watching you...")) /datum/smite/bad_luck/proc/on_death(datum/component/omen/omen) if(omen.incidents_left == INFINITY) return var/mob/living/our_guy = omen.parent omen.death_explode(our_guy) our_guy.gib(DROP_ALL_REMAINS)