From 3d0cb39e91157900499f53c5c7625e9e42739ac1 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Sun, 22 Sep 2019 18:42:47 +0200 Subject: [PATCH 1/6] Removes revenant blight's shabby tox damage in favor of negative mood effects, and necropolis curse if not cured. --- code/__DEFINES/components.dm | 2 ++ code/datums/components/mood.dm | 26 +++++++++------- .../mood_events/generic_negative_events.dm | 7 +++++ code/datums/status_effects/debuffs.dm | 6 ++-- .../antagonists/revenant/revenant_blight.dm | 31 ++++++++++++------- 5 files changed, 46 insertions(+), 26 deletions(-) diff --git a/code/__DEFINES/components.dm b/code/__DEFINES/components.dm index 40aea24105..86ac003da2 100644 --- a/code/__DEFINES/components.dm +++ b/code/__DEFINES/components.dm @@ -222,6 +222,8 @@ //Mood #define COMSIG_ADD_MOOD_EVENT "add_mood" //Called when you send a mood event from anywhere in the code. #define COMSIG_CLEAR_MOOD_EVENT "clear_mood" //Called when you clear a mood event from anywhere in the code. +#define COMSIG_INCREASE_SANITY "decrease_sanity" //Called when you want to increase sanity from anywhere in the code. +#define COMSIG_DECREASE_SANITY "increase_sanity" //Same as above but to decrease sanity instead. //NTnet #define COMSIG_COMPONENT_NTNET_RECEIVE "ntnet_receive" //called on an object by its NTNET connection component on receive. (sending_id(number), sending_netname(text), data(datum/netdata)) diff --git a/code/datums/components/mood.dm b/code/datums/components/mood.dm index 730ffa9ff0..70c66b9e70 100644 --- a/code/datums/components/mood.dm +++ b/code/datums/components/mood.dm @@ -21,6 +21,8 @@ RegisterSignal(parent, COMSIG_ADD_MOOD_EVENT, .proc/add_event) RegisterSignal(parent, COMSIG_CLEAR_MOOD_EVENT, .proc/clear_event) + RegisterSignal(parent, COMSIG_INCREASE_SANITY, .proc/IncreaseSanity) + RegisterSignal(parent, COMSIG_DECREASE_SANITY, .proc/DecreaseSanity) RegisterSignal(parent, COMSIG_MOB_HUD_CREATED, .proc/modify_hud) var/mob/living/owner = parent @@ -129,23 +131,23 @@ switch(mood_level) if(1) - DecreaseSanity(0.2) + DecreaseSanity(src, 0.2) if(2) - DecreaseSanity(0.125, SANITY_CRAZY) + DecreaseSanity(src, 0.125, SANITY_CRAZY) if(3) - DecreaseSanity(0.075, SANITY_UNSTABLE) + DecreaseSanity(src, 0.075, SANITY_UNSTABLE) if(4) - DecreaseSanity(0.025, SANITY_DISTURBED) + DecreaseSanity(src, 0.025, SANITY_DISTURBED) if(5) - IncreaseSanity(0.1) + IncreaseSanity(src, 0.1) if(6) - IncreaseSanity(0.15) + IncreaseSanity(src, 0.15) if(7) - IncreaseSanity(0.20) + IncreaseSanity(src, 0.20) if(8) - IncreaseSanity(0.25, SANITY_GREAT) + IncreaseSanity(src, 0.25, SANITY_GREAT) if(9) - IncreaseSanity(0.4, SANITY_GREAT) + IncreaseSanity(src, 0.4, SANITY_GREAT) if(insanity_effect != holdmyinsanityeffect) if(insanity_effect > holdmyinsanityeffect) @@ -218,7 +220,7 @@ master.crit_threshold = (master.crit_threshold - insanity_effect) + newval insanity_effect = newval -/datum/component/mood/proc/DecreaseSanity(amount, minimum = SANITY_INSANE) +/datum/component/mood/proc/DecreaseSanity(datum/source, amount, minimum = SANITY_INSANE) if(sanity < minimum) //This might make KevinZ stop fucking pinging me. IncreaseSanity(0.5) else @@ -229,7 +231,7 @@ else insanity_effect = (MINOR_INSANITY_PEN) -/datum/component/mood/proc/IncreaseSanity(amount, maximum = SANITY_NEUTRAL) +/datum/component/mood/proc/IncreaseSanity(datum/source, amount, maximum = SANITY_NEUTRAL) // Disturbed stops you from getting any more sane - I'm just gonna bung this in here var/mob/living/owner = parent if(HAS_TRAIT(owner, TRAIT_UNSTABLE)) @@ -262,6 +264,8 @@ if(the_event.timeout) addtimer(CALLBACK(src, .proc/clear_event, null, category), the_event.timeout, TIMER_UNIQUE|TIMER_OVERRIDE) + return the_event + /datum/component/mood/proc/clear_event(datum/source, category) var/datum/mood_event/event = mood_events[category] if(!event) diff --git a/code/datums/mood_events/generic_negative_events.dm b/code/datums/mood_events/generic_negative_events.dm index 69f1a66814..f747c563ad 100644 --- a/code/datums/mood_events/generic_negative_events.dm +++ b/code/datums/mood_events/generic_negative_events.dm @@ -169,3 +169,10 @@ /datum/mood_event/sad_empath/add_effects(mob/sadtarget) description = "[sadtarget.name] seems upset...\n" + +/datum/mood_event/revenant_blight + description = "Just give up, honk...\n" + mood_change = -5 + +/datum/mood_event/revenant_blight/add_effects() + description = "Just give up, [pick("no one will miss you", "there is nothing you can do to help", "even a clown would be more useful than you", "does it even matter in the end?")]...\n" diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index e930c77c36..158dfe0dae 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -358,7 +358,7 @@ else new /obj/effect/temp_visual/bleed(get_turf(owner)) -/mob/living/proc/apply_necropolis_curse(set_curse) +/mob/living/proc/apply_necropolis_curse(set_curse, duration = 10 MINUTES) var/datum/status_effect/necropolis_curse/C = has_status_effect(STATUS_EFFECT_NECROPOLIS_CURSE) if(!set_curse) set_curse = pick(CURSE_BLINDING, CURSE_SPAWNING, CURSE_WASTING, CURSE_GRASPING) @@ -366,11 +366,11 @@ apply_status_effect(STATUS_EFFECT_NECROPOLIS_CURSE, set_curse) else C.apply_curse(set_curse) - C.duration += 3000 //additional curses add 5 minutes + C.duration += duration * 0.5 //additional curses add half their duration /datum/status_effect/necropolis_curse id = "necrocurse" - duration = 6000 //you're cursed for 10 minutes have fun + duration = 10 MINUTES //you're cursed for 10 minutes have fun tick_interval = 50 alert_type = null var/curse_flags = NONE diff --git a/code/modules/antagonists/revenant/revenant_blight.dm b/code/modules/antagonists/revenant/revenant_blight.dm index 7037ecae86..645a664f66 100644 --- a/code/modules/antagonists/revenant/revenant_blight.dm +++ b/code/modules/antagonists/revenant/revenant_blight.dm @@ -12,8 +12,8 @@ disease_flags = CURABLE permeability_mod = 1 severity = DISEASE_SEVERITY_HARMFUL - var/stagedamage = 0 //Highest stage reached. var/finalstage = 0 //Because we're spawning off the cure in the final stage, we need to check if we've done the final stage's effects. + var/datum/mood_event/revenant_blight/depression /datum/disease/revblight/cure() if(affected_mob) @@ -21,12 +21,13 @@ if(affected_mob.dna && affected_mob.dna.species) affected_mob.dna.species.handle_mutant_bodyparts(affected_mob) affected_mob.dna.species.handle_hair(affected_mob) - to_chat(affected_mob, "You feel better.") + SEND_SIGNAL(affected_mob, COMSIG_CLEAR_MOOD_EVENT, "rev_blight") ..() /datum/disease/revblight/stage_act() if(!finalstage) - if(affected_mob.lying && prob(stage*6)) + if(affected_mob.lying && prob(stage*4)) + to_chat(affected_mob, "You feel better.") cure() return if(prob(stage*3)) @@ -34,10 +35,6 @@ affected_mob.confused += 8 affected_mob.adjustStaminaLoss(8) new /obj/effect/temp_visual/revenant(affected_mob.loc) - if(stagedamage < stage) - stagedamage++ - affected_mob.adjustToxLoss(stage*2) //should, normally, do about 30 toxin damage. - new /obj/effect/temp_visual/revenant(affected_mob.loc) if(prob(45)) affected_mob.adjustStaminaLoss(stage) ..() //So we don't increase a stage before applying the stage damage. @@ -46,9 +43,13 @@ if(prob(5)) affected_mob.emote("pale") if(3) + if(!depression) + depression = SEND_SIGNAL(affected_mob, COMSIG_ADD_MOOD_EVENT, "rev_blight", /datum/mood_event/revenant_blight) + SEND_SIGNAL(affected_mob, COMSIG_DECREASE_SANITY, 0.12, SANITY_CRAZY) if(prob(10)) affected_mob.emote(pick("pale","shiver")) if(4) + SEND_SIGNAL(affected_mob, COMSIG_DECREASE_SANITY, 0.18, SANITY_CRAZY) if(prob(15)) affected_mob.emote(pick("pale","shiver","cries")) if(5) @@ -56,12 +57,18 @@ finalstage = TRUE to_chat(affected_mob, "You feel like [pick("nothing's worth it anymore", "nobody ever needed your help", "nothing you did mattered", "everything you tried to do was worthless")].") affected_mob.adjustStaminaLoss(45) - new /obj/effect/temp_visual/revenant(affected_mob.loc) - if(affected_mob.dna && affected_mob.dna.species) + if(affected_mob.dna?.species) affected_mob.dna.species.handle_mutant_bodyparts(affected_mob,"#1d2953") affected_mob.dna.species.handle_hair(affected_mob,"#1d2953") affected_mob.visible_message("[affected_mob] looks terrifyingly gaunt...", "You suddenly feel like your skin is wrong...") affected_mob.add_atom_colour("#1d2953", TEMPORARY_COLOUR_PRIORITY) - addtimer(CALLBACK(src, .proc/cure), 100) - else - return + new /obj/effect/temp_visual/revenant(affected_mob.loc) + addtimer(CALLBACK(src, .proc/curses), 150) + +/datum/disease/revblight/proc/curses() + if(QDELETED(affected_mob)) + return + affected_mob.playsound_local(affected_mob, 'sound/effects/curse5.ogg', 40, 1, -1) + to_chat(affected_mob, "You sense the terrific curse of a vengeful ghost befall upon you...") + target_mob.apply_necropolis_curse(null, 7 MINUTES) //Once the blight has done its course without being cured beforehand, it will cast a necrocurse to compensate how underpowered it's. + cure() From 75ae73dc1b83bc795e6bcb49eae57a4d6fdc1597 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Sun, 22 Sep 2019 18:43:44 +0200 Subject: [PATCH 2/6] u n d e f i n e d v a r --- code/modules/antagonists/revenant/revenant_blight.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/antagonists/revenant/revenant_blight.dm b/code/modules/antagonists/revenant/revenant_blight.dm index 645a664f66..10ba843975 100644 --- a/code/modules/antagonists/revenant/revenant_blight.dm +++ b/code/modules/antagonists/revenant/revenant_blight.dm @@ -70,5 +70,5 @@ return affected_mob.playsound_local(affected_mob, 'sound/effects/curse5.ogg', 40, 1, -1) to_chat(affected_mob, "You sense the terrific curse of a vengeful ghost befall upon you...") - target_mob.apply_necropolis_curse(null, 7 MINUTES) //Once the blight has done its course without being cured beforehand, it will cast a necrocurse to compensate how underpowered it's. + affected_mob.apply_necropolis_curse(null, 7 MINUTES) //Once the blight has done its course without being cured beforehand, it will cast a necrocurse to compensate how underpowered it's. cure() From bb4e279b72e992eb65f1076c01775cb6aa951570 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Sun, 22 Sep 2019 18:54:33 +0200 Subject: [PATCH 3/6] Bumping harmfulness. --- code/modules/antagonists/revenant/revenant_blight.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/antagonists/revenant/revenant_blight.dm b/code/modules/antagonists/revenant/revenant_blight.dm index 10ba843975..89d8de283a 100644 --- a/code/modules/antagonists/revenant/revenant_blight.dm +++ b/code/modules/antagonists/revenant/revenant_blight.dm @@ -11,7 +11,7 @@ viable_mobtypes = list(/mob/living/carbon/human) disease_flags = CURABLE permeability_mod = 1 - severity = DISEASE_SEVERITY_HARMFUL + severity = DISEASE_SEVERITY_DANGEROUS var/finalstage = 0 //Because we're spawning off the cure in the final stage, we need to check if we've done the final stage's effects. var/datum/mood_event/revenant_blight/depression From 9cc480a5eb07ebea9e3ca8f81c2555e80b418162 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Sun, 22 Sep 2019 19:02:49 +0200 Subject: [PATCH 4/6] datum source. --- code/datums/components/mood.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/datums/components/mood.dm b/code/datums/components/mood.dm index 70c66b9e70..eb381af577 100644 --- a/code/datums/components/mood.dm +++ b/code/datums/components/mood.dm @@ -222,7 +222,7 @@ /datum/component/mood/proc/DecreaseSanity(datum/source, amount, minimum = SANITY_INSANE) if(sanity < minimum) //This might make KevinZ stop fucking pinging me. - IncreaseSanity(0.5) + IncreaseSanity(src, 0.5) else sanity = max(minimum, sanity - amount) if(sanity < SANITY_UNSTABLE) @@ -237,7 +237,7 @@ if(HAS_TRAIT(owner, TRAIT_UNSTABLE)) return if(sanity > maximum) - DecreaseSanity(0.5) //Removes some sanity to go back to our current limit. + DecreaseSanity(src, 0.5) //Removes some sanity to go back to our current limit. else sanity = min(maximum, sanity + amount) if(sanity > SANITY_CRAZY) From fc933ab7bbb6f1ba3f05073895b55b9f3700f9c7 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Sun, 22 Sep 2019 19:05:55 +0200 Subject: [PATCH 5/6] setting durations. --- code/datums/status_effects/debuffs.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 158dfe0dae..269b880ecc 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -363,7 +363,8 @@ if(!set_curse) set_curse = pick(CURSE_BLINDING, CURSE_SPAWNING, CURSE_WASTING, CURSE_GRASPING) if(QDELETED(C)) - apply_status_effect(STATUS_EFFECT_NECROPOLIS_CURSE, set_curse) + apply_status_effect(STATUS_EFFECT_NECROPOLIS_CURSE, set_curse, duration) + else C.apply_curse(set_curse) C.duration += duration * 0.5 //additional curses add half their duration @@ -378,7 +379,8 @@ var/effect_cooldown = 100 var/obj/effect/temp_visual/curse/wasting_effect = new -/datum/status_effect/necropolis_curse/on_creation(mob/living/new_owner, set_curse) +/datum/status_effect/necropolis_curse/on_creation(mob/living/new_owner, set_curse, _duration) + duration = _duration . = ..() if(.) apply_curse(set_curse) From f449849bca92fabcf8e33e21d9d3f939204b59c3 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Sun, 22 Sep 2019 19:06:34 +0200 Subject: [PATCH 6/6] if --- code/datums/status_effects/debuffs.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 269b880ecc..8191ea985c 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -380,7 +380,8 @@ var/obj/effect/temp_visual/curse/wasting_effect = new /datum/status_effect/necropolis_curse/on_creation(mob/living/new_owner, set_curse, _duration) - duration = _duration + if(_duration) + duration = _duration . = ..() if(.) apply_curse(set_curse)