|
| 1 | +/// Minimum cooldown time before we start trying to do effect emotes again. |
| 2 | +#define MIN_EMOTE_COOLDOWN (10 SECONDS) |
| 3 | +/// Maximum cooldown time before we start trying to do effect emotes again. |
| 4 | +#define MAX_EMOTE_COOLDOWN (45 SECONDS) |
| 5 | +/// How many seconds are shaved off each tick while holy water is in the victim's system. |
| 6 | +#define HOLY_WATER_CURE_RATE (5 SECONDS) |
| 7 | + |
| 8 | +//Blight: Infects nearby humans and in general messes living stuff up. |
| 9 | +/datum/action/cooldown/spell/aoe/revenant/blight |
| 10 | + name = "Blight" |
| 11 | + desc = "Causes nearby living things to waste away." |
| 12 | + button_icon_state = "blight" |
| 13 | + cooldown_time = 20 SECONDS |
| 14 | + |
| 15 | + aoe_radius = 3 |
| 16 | + cast_amount = 50 |
| 17 | + unlock_amount = 75 |
| 18 | + |
| 19 | +/datum/action/cooldown/spell/aoe/revenant/blight/cast_on_thing_in_aoe(turf/victim, mob/living/basic/revenant/caster) |
| 20 | + for(var/mob/living/mob in victim) |
| 21 | + if(mob == caster) |
| 22 | + continue |
| 23 | + if(mob.can_block_magic(antimagic_flags)) |
| 24 | + to_chat(caster, span_warning("The spell had no effect on [mob]!")) |
| 25 | + continue |
| 26 | + new /obj/effect/temp_visual/revenant(get_turf(mob)) |
| 27 | + if(iscarbon(mob)) |
| 28 | + if(ishuman(mob)) |
| 29 | + mob.apply_status_effect(/datum/status_effect/revenant_blight) |
| 30 | + else |
| 31 | + mob.reagents?.add_reagent(/datum/reagent/toxin/plasma, 5) |
| 32 | + else |
| 33 | + mob.adjustToxLoss(5) |
| 34 | + for(var/obj/structure/spacevine/vine in victim) //Fucking with botanists, the ability. |
| 35 | + vine.add_atom_colour("#823abb", TEMPORARY_COLOUR_PRIORITY) |
| 36 | + new /obj/effect/temp_visual/revenant(vine.loc) |
| 37 | + QDEL_IN(vine, 10) |
| 38 | + for(var/obj/structure/glowshroom/shroom in victim) |
| 39 | + shroom.add_atom_colour("#823abb", TEMPORARY_COLOUR_PRIORITY) |
| 40 | + new /obj/effect/temp_visual/revenant(shroom.loc) |
| 41 | + QDEL_IN(shroom, 10) |
| 42 | + for(var/atom/movable/tray in victim) |
| 43 | + if(!tray.GetComponent(/datum/component/plant_growing)) |
| 44 | + continue |
| 45 | + |
| 46 | + new /obj/effect/temp_visual/revenant(tray.loc) |
| 47 | + SEND_SIGNAL(tray, COMSIG_GROWING_ADJUST_TOXIN, rand(45, 55)) |
| 48 | + SEND_SIGNAL(tray, COMSIG_GROWING_ADJUST_PEST, rand(8, 10)) |
| 49 | + SEND_SIGNAL(tray, COMSIG_GROWING_ADJUST_WEED, rand(8, 10)) |
| 50 | + |
| 51 | +/datum/status_effect/revenant_blight |
| 52 | + id = "revenant_blight" |
| 53 | + duration = 5 MINUTES |
| 54 | + tick_interval = 0 |
| 55 | + status_type = STATUS_EFFECT_REFRESH |
| 56 | + alert_type = null |
| 57 | + remove_on_fullheal = TRUE |
| 58 | + /// The omen/cursed component applied to the victim. |
| 59 | + var/datum/component/omen/revenant_blight/misfortune |
| 60 | + /// The revenant that cast this blight. |
| 61 | + var/mob/living/basic/revenant/gohst |
| 62 | + /// Cooldown var for when the status effect can emote again. |
| 63 | + COOLDOWN_DECLARE(next_emote) |
| 64 | + |
| 65 | +/datum/status_effect/revenant_blight/on_creation(mob/living/new_owner, mob/living/basic/revenant/gohst) |
| 66 | + . = ..() |
| 67 | + if(. && istype(gohst)) |
| 68 | + src.gohst = gohst |
| 69 | + RegisterSignal(gohst, COMSIG_QDELETING, PROC_REF(remove_when_ghost_dies)) |
| 70 | + |
| 71 | +/datum/status_effect/revenant_blight/on_apply() |
| 72 | + misfortune = owner.AddComponent(/datum/component/omen/revenant_blight) |
| 73 | + owner.set_haircolor(COLOR_REVENANT, override = TRUE) |
| 74 | + to_chat(owner, span_revenminor("You feel [pick("suddenly sick", "a surge of nausea", "like your skin is <i>wrong</i>")].")) |
| 75 | + return ..() |
| 76 | + |
| 77 | +/datum/status_effect/revenant_blight/on_remove() |
| 78 | + QDEL_NULL(misfortune) |
| 79 | + owner.set_haircolor(null, override = TRUE) |
| 80 | + if(gohst) |
| 81 | + UnregisterSignal(gohst, COMSIG_QDELETING) |
| 82 | + gohst = null |
| 83 | + to_chat(owner, span_notice("You feel better.")) |
| 84 | + |
| 85 | +/datum/status_effect/revenant_blight/tick(seconds_per_tick, times_fired) |
| 86 | + var/delta_time = DELTA_WORLD_TIME(SSfastprocess) |
| 87 | + if(owner.stat == CONSCIOUS && COOLDOWN_FINISHED(src, next_emote) && SPT_PROB(5, delta_time)) |
| 88 | + owner.emote(pick("pale", "shiver", "cries")) |
| 89 | + COOLDOWN_START(src, next_emote, rand(MIN_EMOTE_COOLDOWN, MAX_EMOTE_COOLDOWN)) |
| 90 | + if(owner.reagents?.has_reagent(/datum/reagent/water/holywater)) |
| 91 | + remove_duration(HOLY_WATER_CURE_RATE * delta_time) |
| 92 | + |
| 93 | +/datum/status_effect/revenant_blight/proc/remove_when_ghost_dies(datum/source) |
| 94 | + SIGNAL_HANDLER |
| 95 | + qdel(src) |
| 96 | + |
| 97 | +/datum/component/omen/revenant_blight |
| 98 | + incidents_left = INFINITY |
| 99 | + luck_mod = 0.6 // 60% chance of bad things happening |
| 100 | + damage_mod = 0.25 // 25% of normal damage |
| 101 | + |
| 102 | +#undef HOLY_WATER_CURE_RATE |
| 103 | +#undef MAX_EMOTE_COOLDOWN |
| 104 | +#undef MIN_EMOTE_COOLDOWN |
0 commit comments