Skip to content

Commit

Permalink
Progressive Breakdown Part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
WeNeedMorePhoron committed Jun 8, 2023
1 parent 56b1bc2 commit 86721e0
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
1 change: 1 addition & 0 deletions cev_eris.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3213,6 +3213,7 @@
#include "zzzz_modular_occulus\code\modules\research\nodes\engineering.dm"
#include "zzzz_modular_occulus\code\modules\research\nodes\illegal.dm"
#include "zzzz_modular_occulus\code\modules\research\xenoarchaeology\tools\anomaly_suit.dm"
#include "zzzz_modular_occulus\code\modules\sanity\breakdowns.dm"
#include "zzzz_modular_occulus\code\modules\sanity\sanity_mob.dm"
#include "zzzz_modular_occulus\code\modules\scrap\oldificator.dm"
#include "zzzz_modular_occulus\code\modules\shield_generators\shield_generator.dm"
Expand Down
11 changes: 10 additions & 1 deletion code/modules/sanity/breakdown.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,21 @@
log_and_message_admins("[holder.owner] is no longer affected by [name]")
to_chat(holder.owner,SPAN_NOTICE(pick(end_messages)))
if(insight_reward)
// Occulus Edit: Progressive Breakdown
if(!finished)
holder.unmanaged_breakdown = TRUE
to_chat(holder.owner, SPAN_WARNING("A lingering unease settles in your bones. Though the intensity of your craving has subsided, a void unfilled hints at a difficult hour yet to come."))
addtimer(CALLBACK(holder, .datum/sanity/proc/reset_unmanaged_breakdown, 1 HOUR))
// Occulus Edit End: Progressive Breakdown
if(finished)
// Occulus Edit: Success message on fulfilling your obsession
to_chat(holder.owner, SPAN_NOTICE("Your yearnings satiated, a vibrant surge of readiness infuses you. The world feels conquerable again, at least for the present moment."))
// Occulus Edit End
holder.give_insight(insight_reward)
if(restore_sanity_post)
holder.restoreLevel(restore_sanity_post)
else if(is_negative)
holder.changeLevel(-rand(20,30))
else if(restore_sanity_post)
holder.restoreLevel(restore_sanity_post)
qdel(src)
qdel(src)
9 changes: 8 additions & 1 deletion code/modules/sanity/sanity_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@

var/eat_time_message = 0

var/unmanaged_breakdown = FALSE // Occulus Edit: Whether there's a common breakdown with unfulfilled objective
// Occulus Edit: Gates negative breakdown behind not fulfilling a breakdown with insight reward

var/life_tick_modifier = 2 //How often is the onLife() triggered and by how much are the effects multiplied

/datum/sanity/New(mob/living/carbon/human/H)
Expand Down Expand Up @@ -394,12 +397,16 @@
S.reg_break(owner)

var/list/possible_results

// Occulus Edit: Rewritten to gate negative breakdown behind not managing a normal breakdown w/ objective instead of percentage
if((prob(positive_prob) && positive_prob_multiplier > 0) || positive_breakdown)
possible_results = subtypesof(/datum/breakdown/positive)
else if(prob(negative_prob))
else if(unmanaged_breakdown)
possible_results = subtypesof(/datum/breakdown/negative)
unmanaged_breakdown = FALSE // Reset
else
possible_results = subtypesof(/datum/breakdown/common)
// Occulus Edit End

for(var/datum/breakdown/B in breakdowns)
possible_results -= B.type
Expand Down
19 changes: 19 additions & 0 deletions zzzz_modular_occulus/code/modules/sanity/breakdowns.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Stat Loss breakdown, negative mirror of lesson learnt
/datum/breakdown/negative/forgotten
name = "A Lesson Forgotten"
duration = 0
restore_sanity_post = 50

start_messages = list(
"Your experience weighs you down, each one making you worse",
"Nothing in your mind clicks anymore, you feel more incompetent",
"Your past mistakes haunt you, and they keep repeating",
"You've forgotten what you've learned in the past",
"Nothing makes sense anymore!"
)

// This is like a negative mirror of A Lesson Learnt, stat loss is less harsh but still significant
/datum/breakdown/negative/forgotten/conclude()
for(var/stat in ALL_STATS)
holder.owner.stats.changeStat(stat, -rand(2,5))
..()
3 changes: 3 additions & 0 deletions zzzz_modular_occulus/code/modules/sanity/sanity_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
if(resting)
add_rest(INSIGHT_DESIRE_EXERCISE, rate)

/datum/sanity/proc/reset_unmanaged_breakdown()
to_chat(owner, SPAN_NOTICE("An hour has passed and the storm within has finally stilled. Unfulfilled desires recede into oblivion, and a newfound calm reigns, readying you for whatever comes next."))
unmanaged_breakdown = FALSE

0 comments on commit 86721e0

Please sign in to comment.