mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 18:22:14 +00:00
## About The Pull Request Heretic has received a complete overhaul. This PR touches nearly every aspect of the antagonist. For readability's sake, not every change is going to be listed in this pull request. For the full list of changes please refer to the design doc: https://hackmd.io/@BiST8PJVRjiwVPY86U3bLQ/B11HyChz1g. Code by Me, @Xander3359 and @Arturlang TGUI by @Arturlang Sprites by OrcaCora and GregorDM Writing bits by @necromanceranne ### Core changes - Cross-pathing has been removed. Main knowledge spells are now exclusive to their path (for the most part). - For every main knowledge unlocked (save for the robes and the blade upgrade), Heretics can choose one option from a draft of 3 random side knowledges (this is a free point). - Heretics can now purchase side knowledges from a new tab, the "Knowledge Shop". Side-knowledges have been divided by tier (Stealth, Defense, Summons, Combat and Main). Tiers are unlocked as you progress toward your main path. - Heretics now gain the grasp and mark upgrade immediately, but their main knowledge choices cost twice as much (except for the first spell, the robes and the blade upgrade). - Path specific robes have been introduced! They come with their own set of quirks. - Each Path has received a passive ability. This passive is upgraded when you first create your robes, and again when you complete the Ritual of Knowledge. - Paths have been rebalanced as a result of the removal of cross-path progression. Cosmic and Moon paths have received soft reworks. - Upon unlocking the path 2nd level or reaching a total of 8 points worth of knowledge, Heretics will lose the ability to blade break (and the limit on blades all together). - Ascension now automatically calls the shuttle with no possibility of a recall. - Late join Heretic has been removed. ### New UI <img width="750" height="635" alt="moon path ui" src="https://github.com/user-attachments/assets/184ef783-5c9c-48a1-a2f7-4807ca93e990" /> ### Knowledge shop <img width="787" height="669" alt="Knowledge shop" src="https://github.com/user-attachments/assets/3dc89b84-8c70-4d47-b612-54396e3ea6e7" /> ### Quality of life //General balance changes - Heretics will now gain X-ray vision for a few seconds when nearby an eldritch essence (this effect has a cooldown). - Ritual of knowledge now requires 1 uncommon item instead of 2. You may now use a stunprod instead of a baton to complete the ritual. Beartraps have been removed from the list of possible reagents. - The maximum number of possible sacrifices required to ascend has been reduced from 6 to 5 while the minimum has been upped to 4. - Codex Cicatrix no longer requires a special pen to be made. ### Passive abilities - Heretics now start with a passive ability. You can find what it does on the path info tab after a path has been selected, and what they gain when upgraded. - Crafting your first set of Eldritch robes will bump your passive to level 2. - Unlocking the 2nd level will subsequently unlock your "Ritual Of Knowledge" - Completing the ritual of knowledge or ascending will net you the final level. ### Path Specific Robes - Armorer's Ritual is no longer a side knowledge. Each path will have their own unique version of the ritual. This is placed after the 2nd spell in the tree. - Robes can no longer be destroyed by fire and acid, grant t4 flash protection (Moth Heretics stay winning) and protection against basic syringes, to bring them on par with other antagonist's armor sets. - The recipe to craft the robes is now a set of armor/vest, a mask (any mask will do now, not just gas masks), plus the unique reagent required for the blades (Plasma for Cosmic, Trash For Rust, match for Ash and so on) - Wearing the robes as a non-heretic may yield some unfortunate side-effects. ### Moon Path Rework Moon path rework. Moon Heretics gain immunity to brain traumas and slowly regenerate brain health. Equipping the moon amulette channels its effects through the moon blade; making it unblockable and cause sanity damage instead of brute. Ring leader's Rise now summons an army of harmless clones that explode when attacked; the explosion briefly stuns non-heretics and cause sanity and brain damage to them. Moon blade can also now be used when pacified and Moon spells are no longer blocked by regular anti magic, only mind magic protection. **Cosmic Path Rework** Cosmic path has received the biggest batch of changes alongside Moon. The path has been dead last in ascension and pickrate (less than 5%) for almost 2 years. It did gain some popularity over the last few months, reaching the highest ascension rate in the game (12%) while mantaining a relatively low pickrate. Cosmic sits in a weird spot, where pretty much every knowledge surrounding the path is either mediocre or, in the case of the ascension, dysfunctional. Yet it has maintained a smidge of relevancy due to how quickly Cosmic heretics can capture and sacrifice targets thanks to Star Touch. As a result, the best course of action would be to rebalance the entirety of the kit; granting the heretic more tools to manipulate space and dictate the flow of a fight, while lessening their ability to end a confrontation by instantly sleeping their opponents. lastly The Star Gazer is now ghost controlled ; And they shoot lazers! <img width="636" height="451" alt="gazer gag 3" src="https://github.com/user-attachments/assets/601d6881-c042-4e42-8ce6-ac90cd27848b" /> ## Why It's Good For The Game ### Ok...but why do we want this? Again, if you want my full reasoning, please check my doc https://hackmd.io/@BiST8PJVRjiwVPY86U3bLQ/B11HyChz1g. To keep it short and concise; Heretic is too complex and unintuitive for its own good. Too impenetrable for new players and too abusable for experienced players. This can be chalked up to a lot of poor design decisions. But ultimately, what I believe being the biggest contributor to the current status of Heretic is the ability to move into different paths, also known as "Cross-Pathing". ### Cross Pathing my beloathed. Cross-pathing, while cool in theory, overcomplicates the antagonist and overloads them with power. Players dealing with the heretic are incapable of working out what a given heretic can do. This also leads to late game heretics having 3 rows Worth of action buttons and virtually no weakness. Over the last year, I've often received the understandable but also kind of unfair accusations of making Heretic too powerful without a clear aim or purpose. My goal with the paths I've reworked over the last year (Rust,Void and Blade) wasn't necessarily to just make them stronger (although that was also part of the goal, as they were paths that were underperforming), but for them to have more interactions with the sandbox and to better live up to the fantasy presented to the player. If an harbringer of frost gets countered by a cup of coffee, we probably messed something up. Unfortunately, the current incarnation of Heretic doesn't really allow for surgical balance changes to specific paths. Every time a knowledge gets buffed, we make every path that can easily tap onto that knowledge stronger by default. It doesn't take a genius to understand why this system is ultimately unsustainable. ### Blade Breaking I feel that after a heretic has reached the near peak of their power, they no longer need the ability to instantly escape any encounter. Check my doc for my full reasoning. ## Less versatile, more specialized paths. By removing cross-pathing, we remove a huge maintainability burden from the antagonist. Paths can now be designed around clearer strengths and weaknesses. They become easier to balance and less of an headache to understand for everyone. It also means we can give paths some needed quality of life quirks without having to worry how such a change might have a knock-on effect for other paths. Ash heretics can finally let loose without dying by their own flames. Cosmic Heretic can go to space without having to carry a modsuit. Moon Heretic can use their abilities without fear of one random trauma ruining their day, and so on. ### What a horrible night to have a curse...., wait how do I curse people again? As of right now the heretic tree has quite a hefty amount of trinkets that pretty much never see use. Partly because the tree itself is a nightmare to navigate. And partly because why would anyone set up an elaborate plan or scheme when they can unleash 2 rows of spell in the span of bunch of seconds. Heretics mostly gravitate towards powers that push them towards greater, more potent combat strength. If it doesn't contribute to killing people quicker, it isn't worth doing for most. And given the opportunity cost associated for taking those powers, they will remain that way so long as there are better choices to be poached. The new draft system encourages Heretics to play more with the tools at their disposal. If you want to go for a specific combo from the side path options, you may now do so by tapping into the knowledge shop. Yes, the shop does include a few knowledges from the other paths. But these are limited to 1 per path, are very expensive and can only be unlocked very late into the shift. ## Drip Of the Mansus The iconic heretic robe is actually sequestered to a side path that is most easily access by only two paths at a time. Since heretic paths are being made to be much more specialized, the most obvious way in which this can be showcased is through an easily identifiable outfit. By using the robes, we can both telegraph WHAT heretic you are looking at, and just how much power they've accumulated and when it is reasonable to take the kid gloves off and treat them as a genuine threat. If a heretic is in their robes, that heretic is now a significantly more prominent danger to the station. It also serves as a useful means for gating some of the more powerful effects of a heretic's path behind the robes, AND enable options for disarming them of that power should they be captured without making it something endemic to their mob. A major problem with heretics is a lack of certainty as to how powerful they have become. A heretics robes is one of the milestones to help players dealing with heretics identify that. ### Will this be 100% fair and balanced? This is a massive overhaul to a pretty complex and bloated antagonist. I've done my best to show the changes to several maintainers and other members of the community for their feedback. But at some point we'll have to see how this behave in the environment to get a feel if something is over or undertuned. (that's my way of saying, yes this is likely gonna require a testmerge or two). What I will say is that I'm not trying to change the core identity of Heretic. Heretics should have the upperhand in single encounters early on, be able to joust a small group of players after they unlock their final spell, and end the round when they ascend. They're a progression antagonist. They should retain their payoff as well as pose a danger as they grow stronger. But if more players feel like they are more reliably able to play the antagonist in more varied and interesting ways, rather than the antagonist largely existing as a measuring stick for 'robustness' due to its elitist design philosophy, then the rework has been a success. There should be something for everyone in the antagonist, as is true for all of our antagonist roles.
618 lines
22 KiB
Plaintext
618 lines
22 KiB
Plaintext
#define MINOR_INSANITY_PEN 5
|
|
#define MAJOR_INSANITY_PEN 10
|
|
#define MOOD_CATEGORY_NUTRITION "nutrition"
|
|
#define MOOD_CATEGORY_AREA_BEAUTY "area_beauty"
|
|
|
|
/**
|
|
* Mood datum
|
|
*
|
|
* Contains the logic for controlling a living mob's mood and sanity.
|
|
*/
|
|
/datum/mood
|
|
/// The parent (living) mob
|
|
var/mob/living/mob_parent
|
|
|
|
/// The total combined value of all moodlets for the mob
|
|
var/mood
|
|
/// Current sanity of the mob (ranges from 0 - 150)
|
|
var/sanity = SANITY_NEUTRAL
|
|
/// the total combined value of all visible moodlets for the mob
|
|
var/shown_mood
|
|
/// Multiplier to the sum total of mood the mob is experiencing
|
|
var/mood_modifier = 1
|
|
/// Multiplier to positive moodlet values. Stacks with mood_modifier
|
|
var/positive_mood_modifier = 1
|
|
/// Multiplier to negative moodlet values. Stacks with mood_modifier
|
|
var/negative_mood_modifier = 1
|
|
/// Multiplier to the length of positive moodlets.
|
|
/// Please don't set this to 0
|
|
var/positive_moodlet_length_modifier = 1
|
|
/// Multiplier to the length of negative moodlets.
|
|
/// Please don't set this to 0
|
|
var/negative_moodlet_length_modifier = 1
|
|
/// Used to track what stage of moodies they're on (1-9)
|
|
var/mood_level = MOOD_LEVEL_NEUTRAL
|
|
/// To track what stage of sanity they're on (1-6)
|
|
var/sanity_level = SANITY_LEVEL_NEUTRAL
|
|
/// Is the owner being punished for low mood? if so, how much?
|
|
var/insanity_effect = 0
|
|
/// The screen object for the current mood level
|
|
var/atom/movable/screen/mood/mood_screen_object
|
|
|
|
/// List of mood events currently active on this datum
|
|
var/list/mood_events = list()
|
|
|
|
/datum/mood/New(mob/living/mob_to_make_moody)
|
|
if (!istype(mob_to_make_moody))
|
|
stack_trace("Tried to apply mood to a non-living atom!")
|
|
qdel(src)
|
|
return
|
|
|
|
START_PROCESSING(SSmood, src)
|
|
|
|
mob_parent = mob_to_make_moody
|
|
|
|
RegisterSignal(mob_to_make_moody, COMSIG_MOB_HUD_CREATED, PROC_REF(modify_hud))
|
|
RegisterSignal(mob_to_make_moody, COMSIG_ENTER_AREA, PROC_REF(check_area_mood))
|
|
RegisterSignal(mob_to_make_moody, COMSIG_EXIT_AREA, PROC_REF(exit_area))
|
|
RegisterSignal(mob_to_make_moody, COMSIG_LIVING_REVIVE, PROC_REF(on_revive))
|
|
RegisterSignal(mob_to_make_moody, COMSIG_MOB_STATCHANGE, PROC_REF(handle_mob_death))
|
|
RegisterSignal(mob_to_make_moody, COMSIG_QDELETING, PROC_REF(clear_parent_ref))
|
|
|
|
var/area/our_area = get_area(mob_to_make_moody)
|
|
if(our_area)
|
|
check_area_mood(mob_to_make_moody, our_area)
|
|
|
|
mob_to_make_moody.become_area_sensitive(MOOD_DATUM_TRAIT)
|
|
if(mob_to_make_moody.hud_used)
|
|
modify_hud()
|
|
var/datum/hud/hud = mob_to_make_moody.hud_used
|
|
hud.show_hud(hud.hud_version)
|
|
|
|
/datum/mood/proc/clear_parent_ref()
|
|
SIGNAL_HANDLER
|
|
|
|
unmodify_hud()
|
|
mob_parent.lose_area_sensitivity(MOOD_DATUM_TRAIT)
|
|
UnregisterSignal(mob_parent, list(COMSIG_MOB_HUD_CREATED, COMSIG_ENTER_AREA, COMSIG_EXIT_AREA, COMSIG_LIVING_REVIVE, COMSIG_MOB_STATCHANGE, COMSIG_QDELETING))
|
|
var/area/our_area = get_area(mob_parent)
|
|
if(our_area)
|
|
UnregisterSignal(our_area, COMSIG_AREA_BEAUTY_UPDATED)
|
|
|
|
mob_parent = null
|
|
|
|
/datum/mood/Destroy(force)
|
|
STOP_PROCESSING(SSmood, src)
|
|
QDEL_LIST_ASSOC_VAL(mood_events)
|
|
return ..()
|
|
|
|
/datum/mood/process(seconds_per_tick)
|
|
switch(mood_level)
|
|
if(MOOD_LEVEL_SAD4)
|
|
adjust_sanity(-0.3 * seconds_per_tick, SANITY_INSANE)
|
|
if(MOOD_LEVEL_SAD3)
|
|
adjust_sanity(-0.15 * seconds_per_tick, SANITY_CRAZY)
|
|
if(MOOD_LEVEL_SAD2)
|
|
adjust_sanity(-0.1 * seconds_per_tick, SANITY_UNSTABLE)
|
|
if(MOOD_LEVEL_SAD1)
|
|
adjust_sanity(-0.05 * seconds_per_tick, SANITY_UNSTABLE)
|
|
if(MOOD_LEVEL_NEUTRAL)
|
|
adjust_sanity(0, SANITY_UNSTABLE) //This makes sure that mood gets increased should you be below the minimum.
|
|
if(MOOD_LEVEL_HAPPY1)
|
|
adjust_sanity(0.2 * seconds_per_tick, SANITY_UNSTABLE)
|
|
if(MOOD_LEVEL_HAPPY2)
|
|
adjust_sanity(0.3 * seconds_per_tick, SANITY_UNSTABLE)
|
|
if(MOOD_LEVEL_HAPPY3)
|
|
adjust_sanity(0.4 * seconds_per_tick, SANITY_NEUTRAL, SANITY_MAXIMUM)
|
|
if(MOOD_LEVEL_HAPPY4)
|
|
adjust_sanity(0.6 * seconds_per_tick, SANITY_NEUTRAL, SANITY_MAXIMUM)
|
|
|
|
/datum/mood/proc/handle_mob_death(datum/source, new_stat, old_stat)
|
|
SIGNAL_HANDLER
|
|
|
|
if (old_stat == DEAD && new_stat != DEAD)
|
|
START_PROCESSING(SSmood, src)
|
|
else if (old_stat != DEAD && new_stat == DEAD)
|
|
STOP_PROCESSING(SSmood, src)
|
|
|
|
/// Handles mood given by nutrition
|
|
/datum/mood/proc/update_nutrition_moodlets()
|
|
if(HAS_TRAIT(mob_parent, TRAIT_NOHUNGER))
|
|
clear_mood_event(MOOD_CATEGORY_NUTRITION)
|
|
return FALSE
|
|
|
|
if(HAS_TRAIT(mob_parent, TRAIT_GLUTTON))
|
|
add_mood_event(MOOD_CATEGORY_NUTRITION, /datum/mood_event/hungry) //you'll never get enough
|
|
return TRUE
|
|
|
|
if(HAS_TRAIT(mob_parent, TRAIT_FAT) && !HAS_TRAIT(mob_parent, TRAIT_VORACIOUS))
|
|
add_mood_event(MOOD_CATEGORY_NUTRITION, /datum/mood_event/fat)
|
|
return TRUE
|
|
|
|
switch(mob_parent.nutrition)
|
|
if(NUTRITION_LEVEL_FULL to INFINITY)
|
|
add_mood_event(MOOD_CATEGORY_NUTRITION, HAS_TRAIT(mob_parent, TRAIT_VORACIOUS) ? /datum/mood_event/wellfed : /datum/mood_event/too_wellfed)
|
|
if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FULL)
|
|
add_mood_event(MOOD_CATEGORY_NUTRITION, /datum/mood_event/wellfed)
|
|
if( NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED)
|
|
add_mood_event(MOOD_CATEGORY_NUTRITION, /datum/mood_event/fed)
|
|
if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED)
|
|
clear_mood_event(MOOD_CATEGORY_NUTRITION)
|
|
if(NUTRITION_LEVEL_VERY_HUNGRY to NUTRITION_LEVEL_HUNGRY)
|
|
add_mood_event(MOOD_CATEGORY_NUTRITION, /datum/mood_event/hungry)
|
|
if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_VERY_HUNGRY)
|
|
add_mood_event(MOOD_CATEGORY_NUTRITION, /datum/mood_event/hungry_very)
|
|
if(0 to NUTRITION_LEVEL_STARVING)
|
|
add_mood_event(MOOD_CATEGORY_NUTRITION, /datum/mood_event/starving)
|
|
|
|
return TRUE
|
|
|
|
/**
|
|
* Adds a mood event to the mob
|
|
*
|
|
* Arguments:
|
|
* * category - (text) category of the mood event - see /datum/mood_event for category explanation
|
|
* * type - (path) any /datum/mood_event
|
|
*/
|
|
/datum/mood/proc/add_mood_event(category, new_type, ...)
|
|
if (!ispath(new_type, /datum/mood_event))
|
|
CRASH("A non path ([new_type]), was used to add a mood event. This shouldn't be happening.")
|
|
if (!istext(category))
|
|
category = REF(category)
|
|
|
|
var/list/params = args.Copy(3)
|
|
var/datum/mood_event/new_event = new new_type(category)
|
|
if(!new_event.can_effect_mob(arglist(list(src, mob_parent) + params)))
|
|
qdel(new_event)
|
|
return
|
|
|
|
var/datum/mood_event/existing_event = mood_events[category]
|
|
if(existing_event)
|
|
var/continue_adding = FALSE
|
|
if(existing_event.type == new_event.type)
|
|
continue_adding = existing_event.be_refreshed(arglist(list(src) + params))
|
|
else
|
|
continue_adding = existing_event.be_replaced(arglist(list(src, new_event) + params))
|
|
if(!continue_adding)
|
|
update_mood()
|
|
qdel(new_event)
|
|
return
|
|
clear_mood_event(category)
|
|
|
|
new_event.on_add(src, mob_parent, params)
|
|
mood_events[category] = new_event
|
|
update_mood()
|
|
if(new_event.mood_change == 0 || new_event.hidden)
|
|
return
|
|
if(new_event.mood_change > 0)
|
|
add_personality_mood_to_viewers(mob_parent, "other_good_moodlet", list(
|
|
/datum/personality/empathetic = /datum/mood_event/empathetic_happy,
|
|
/datum/personality/misanthropic = /datum/mood_event/misanthropic_sad
|
|
), range = 4)
|
|
else
|
|
add_personality_mood_to_viewers(mob_parent, "other_bad_moodlet", list(
|
|
/datum/personality/empathetic = /datum/mood_event/empathetic_sad,
|
|
/datum/personality/misanthropic = /datum/mood_event/misanthropic_happy
|
|
), range = 4)
|
|
|
|
/**
|
|
* Removes a mood event from the mob
|
|
*
|
|
* Arguments:
|
|
* * category - (Text) Removes the mood event with the given category
|
|
*/
|
|
/datum/mood/proc/clear_mood_event(category)
|
|
if (!istext(category))
|
|
category = REF(category)
|
|
|
|
var/datum/mood_event/event = mood_events[category]
|
|
if (!event)
|
|
return
|
|
|
|
mood_events -= category
|
|
qdel(event)
|
|
update_mood()
|
|
|
|
/datum/mood/proc/get_mood_event(category)
|
|
return mood_events[category]
|
|
|
|
/// Updates the mobs mood.
|
|
/// Called after mood events have been added/removed.
|
|
/datum/mood/proc/update_mood()
|
|
if(QDELETED(mob_parent)) //don't bother updating their mood if they're about to be salty anyway. (in other words, we're about to be destroyed too anyway.)
|
|
return
|
|
mood = 0
|
|
shown_mood = 0
|
|
|
|
for(var/category in mood_events)
|
|
var/datum/mood_event/the_event = mood_events[category]
|
|
var/event_mood = the_event.mood_change
|
|
event_mood *= max((event_mood > 0) ? positive_mood_modifier : negative_mood_modifier, 0)
|
|
mood += event_mood
|
|
if (!the_event.hidden)
|
|
shown_mood += event_mood
|
|
|
|
mood *= max(mood_modifier, 0)
|
|
shown_mood *= max(mood_modifier, 0)
|
|
|
|
switch(mood)
|
|
if (-INFINITY to MOOD_SAD4)
|
|
mood_level = MOOD_LEVEL_SAD4
|
|
if (MOOD_SAD4 to MOOD_SAD3)
|
|
mood_level = MOOD_LEVEL_SAD3
|
|
if (MOOD_SAD3 to MOOD_SAD2)
|
|
mood_level = MOOD_LEVEL_SAD2
|
|
if (MOOD_SAD2 to MOOD_SAD1)
|
|
mood_level = MOOD_LEVEL_SAD1
|
|
if (MOOD_SAD1 to MOOD_HAPPY1)
|
|
mood_level = MOOD_LEVEL_NEUTRAL
|
|
if (MOOD_HAPPY1 to MOOD_HAPPY2)
|
|
mood_level = MOOD_LEVEL_HAPPY1
|
|
if (MOOD_HAPPY2 to MOOD_HAPPY3)
|
|
mood_level = MOOD_LEVEL_HAPPY2
|
|
if (MOOD_HAPPY3 to MOOD_HAPPY4)
|
|
mood_level = MOOD_LEVEL_HAPPY3
|
|
if (MOOD_HAPPY4 to INFINITY)
|
|
mood_level = MOOD_LEVEL_HAPPY4
|
|
|
|
update_mood_icon()
|
|
SEND_SIGNAL(mob_parent, COMSIG_CARBON_MOOD_UPDATE)
|
|
|
|
/// Updates the mob's mood icon
|
|
/datum/mood/proc/update_mood_icon()
|
|
if (!(mob_parent.client || mob_parent.hud_used) || isnull(mood_screen_object))
|
|
return
|
|
|
|
mood_screen_object.cut_overlays()
|
|
mood_screen_object.color = initial(mood_screen_object.color)
|
|
|
|
// lets see if we have an special icons to show instead of the normal mood levels
|
|
var/list/conflicting_moodies = list()
|
|
var/highest_absolute_mood = 0
|
|
for (var/category in mood_events)
|
|
var/datum/mood_event/the_event = mood_events[category]
|
|
if (!the_event.special_screen_obj)
|
|
continue
|
|
if (!the_event.special_screen_replace)
|
|
mood_screen_object.add_overlay(the_event.special_screen_obj)
|
|
else
|
|
conflicting_moodies += the_event
|
|
var/absmood = abs(the_event.mood_change)
|
|
highest_absolute_mood = absmood > highest_absolute_mood ? absmood : highest_absolute_mood
|
|
|
|
switch(sanity_level)
|
|
if (SANITY_LEVEL_GREAT)
|
|
mood_screen_object.color = "#2eeb9a"
|
|
if (SANITY_LEVEL_NEUTRAL)
|
|
mood_screen_object.color = "#86d656"
|
|
if (SANITY_LEVEL_DISTURBED)
|
|
mood_screen_object.color = "#4b96c4"
|
|
if (SANITY_LEVEL_UNSTABLE)
|
|
mood_screen_object.color = "#dfa65b"
|
|
if (SANITY_LEVEL_CRAZY)
|
|
mood_screen_object.color = "#f38943"
|
|
if (SANITY_LEVEL_INSANE)
|
|
mood_screen_object.color = "#f15d36"
|
|
|
|
if (!conflicting_moodies.len) // there's no special icons, use the normal icon states
|
|
mood_screen_object.icon_state = "mood[mood_level]"
|
|
return
|
|
|
|
for (var/datum/mood_event/conflicting_event as anything in conflicting_moodies)
|
|
if (abs(conflicting_event.mood_change) == highest_absolute_mood)
|
|
mood_screen_object.icon_state = "[conflicting_event.special_screen_obj]"
|
|
break
|
|
|
|
/// Sets up the mood HUD object
|
|
/datum/mood/proc/modify_hud(datum/source)
|
|
SIGNAL_HANDLER
|
|
|
|
var/datum/hud/hud = mob_parent.hud_used
|
|
mood_screen_object = new
|
|
mood_screen_object.color = "#4b96c4"
|
|
hud.infodisplay += mood_screen_object
|
|
RegisterSignal(hud, COMSIG_QDELETING, PROC_REF(unmodify_hud))
|
|
RegisterSignal(mood_screen_object, COMSIG_SCREEN_ELEMENT_CLICK, PROC_REF(hud_click))
|
|
|
|
/// Removes the mood HUD object
|
|
/datum/mood/proc/unmodify_hud(datum/source)
|
|
SIGNAL_HANDLER
|
|
|
|
if(!mood_screen_object)
|
|
return
|
|
var/datum/hud/hud = mob_parent.hud_used
|
|
if(hud?.infodisplay)
|
|
hud.infodisplay -= mood_screen_object
|
|
QDEL_NULL(mood_screen_object)
|
|
UnregisterSignal(hud, COMSIG_QDELETING)
|
|
|
|
/// Handles clicking on the mood HUD object
|
|
/datum/mood/proc/hud_click(datum/source, location, control, params, mob/user)
|
|
SIGNAL_HANDLER
|
|
|
|
if(user != mob_parent)
|
|
return
|
|
if(user.stat >= UNCONSCIOUS)
|
|
return
|
|
print_mood(user)
|
|
|
|
/// Prints the users mood, sanity, and moodies to chat
|
|
/datum/mood/proc/print_mood(mob/user)
|
|
var/msg = "[span_info("<EM>My current mental status:</EM>")]<br>"
|
|
|
|
if(!HAS_TRAIT(src, TRAIT_NOHUNGER))
|
|
msg += span_notice("My hunger: ")
|
|
var/nutrition = mob_parent.nutrition
|
|
switch(nutrition)
|
|
if(NUTRITION_LEVEL_FULL to INFINITY)
|
|
msg += "[span_info("I'm completely stuffed!")]<br>"
|
|
if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FULL)
|
|
msg += "[span_info("I'm well fed!")]<br>"
|
|
if(NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED)
|
|
msg += "[span_info("I'm not hungry.")]<br>"
|
|
if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED)
|
|
msg += "[span_info("I could use a bite to eat.")]<br>"
|
|
if(NUTRITION_LEVEL_VERY_HUNGRY to NUTRITION_LEVEL_HUNGRY)
|
|
msg += "[span_warning("I'm feeling hungry.")]<br>"
|
|
if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_VERY_HUNGRY)
|
|
msg += "[span_warning("I feel quite hungry.")]<br>"
|
|
if(0 to NUTRITION_LEVEL_STARVING)
|
|
msg += "[span_boldwarning("I'm starving!")]<br>"
|
|
|
|
var/drunkness = mob_parent.get_drunk_amount()
|
|
if(drunkness >= 1)
|
|
msg += span_notice("My current drunkenness: ")
|
|
switch(drunkness)
|
|
if(1 to 10)
|
|
msg += "[span_info("I'm feeling a little tipsy.")]<br>"
|
|
if(11 to 21)
|
|
msg += "[span_info("I'm feeling a bit drunk.")]<br>"
|
|
if(21 to 41)
|
|
msg += "[span_info("I'm feeling quite drunk.")]<br>"
|
|
if(41 to 61)
|
|
msg += "[span_info("I'm feeling very drunk.")]<br>"
|
|
if(61 to 81)
|
|
msg += "[span_warning("I'm feeling like a mess.")]<br>"
|
|
if(81 to INFINITY)
|
|
msg += "[span_boldwarning("I'm completely wasted.")]<br>"
|
|
|
|
msg += span_notice("My current sanity: ") //Long term
|
|
switch(sanity)
|
|
if(SANITY_GREAT to INFINITY)
|
|
msg += "[span_boldnicegreen("My mind feels like a temple!")]<br>"
|
|
if(SANITY_NEUTRAL to SANITY_GREAT)
|
|
msg += "[span_nicegreen("I have been feeling great lately!")]<br>"
|
|
if(SANITY_DISTURBED to SANITY_NEUTRAL)
|
|
msg += "[span_nicegreen("I have felt quite decent lately.")]<br>"
|
|
if(SANITY_UNSTABLE to SANITY_DISTURBED)
|
|
msg += "[span_warning("I'm feeling a little bit unhinged...")]<br>"
|
|
if(SANITY_CRAZY to SANITY_UNSTABLE)
|
|
msg += "[span_warning("I'm freaking out!!")]<br>"
|
|
if(SANITY_INSANE to SANITY_CRAZY)
|
|
msg += "[span_boldwarning("AHAHAHAHAHAHAHAHAHAH!!")]<br>"
|
|
|
|
msg += span_notice("My current mood: ") //Short term
|
|
switch(mood_level)
|
|
if(MOOD_LEVEL_SAD4)
|
|
msg += "[span_boldwarning("I wish I was dead!")]<br>"
|
|
if(MOOD_LEVEL_SAD3)
|
|
msg += "[span_boldwarning("I feel terrible...")]<br>"
|
|
if(MOOD_LEVEL_SAD2)
|
|
msg += "[span_boldwarning("I feel very upset.")]<br>"
|
|
if(MOOD_LEVEL_SAD1)
|
|
msg += "[span_warning("I'm a bit sad.")]<br>"
|
|
if(MOOD_LEVEL_NEUTRAL)
|
|
msg += "[span_grey("I'm alright.")]<br>"
|
|
if(MOOD_LEVEL_HAPPY1)
|
|
msg += "[span_nicegreen("I feel pretty okay.")]<br>"
|
|
if(MOOD_LEVEL_HAPPY2)
|
|
msg += "[span_boldnicegreen("I feel pretty good.")]<br>"
|
|
if(MOOD_LEVEL_HAPPY3)
|
|
msg += "[span_boldnicegreen("I feel amazing!")]<br>"
|
|
if(MOOD_LEVEL_HAPPY4)
|
|
msg += "[span_boldnicegreen("I love life!")]<br>"
|
|
|
|
var/list/additional_lines = list()
|
|
SEND_SIGNAL(user, COMSIG_CARBON_MOOD_CHECK, additional_lines)
|
|
if (length(additional_lines))
|
|
msg += "[additional_lines.Join("<br>")]<br>"
|
|
|
|
msg += "[span_notice("Moodlets:")]<br>"//All moodlets
|
|
if(mood_events.len)
|
|
for(var/category in mood_events)
|
|
var/datum/mood_event/event = mood_events[category]
|
|
msg += "• "
|
|
switch(event.mood_change)
|
|
if(-INFINITY to MOOD_SAD2)
|
|
msg += "[span_boldwarning(event.description)]<br>"
|
|
if(MOOD_SAD2 to MOOD_SAD1)
|
|
msg += "[span_warning(event.description)]<br>"
|
|
if(MOOD_SAD1 to MOOD_NEUTRAL)
|
|
msg += "[span_grey(event.description)]<br>"
|
|
if(MOOD_NEUTRAL to MOOD_HAPPY1)
|
|
msg += "[span_info(event.description)]<br>"
|
|
if(MOOD_HAPPY1 to MOOD_HAPPY2)
|
|
msg += "[span_nicegreen(event.description)]<br>"
|
|
if(MOOD_HAPPY2 to INFINITY)
|
|
msg += "[span_boldnicegreen(event.description)]<br>"
|
|
else
|
|
msg += "• [span_grey("I don't have much of a reaction to anything right now.")]<br>"
|
|
|
|
if(LAZYLEN(mob_parent.quirks))
|
|
msg += span_notice("You have these quirks: [mob_parent.get_quirk_string(FALSE, CAT_QUIRK_ALL)].")
|
|
|
|
to_chat(user, boxed_message(msg))
|
|
|
|
/// Updates the mob's moodies, if the area provides a mood bonus
|
|
/datum/mood/proc/check_area_mood(datum/source, area/new_area)
|
|
SIGNAL_HANDLER
|
|
|
|
RegisterSignal(new_area, COMSIG_AREA_BEAUTY_UPDATED, PROC_REF(update_beauty))
|
|
|
|
update_beauty(new_area)
|
|
if (new_area.mood_bonus && (!new_area.mood_trait || HAS_TRAIT(source, new_area.mood_trait)))
|
|
add_mood_event("area", /datum/mood_event/area, new_area.mood_bonus, new_area.mood_message)
|
|
else
|
|
clear_mood_event("area")
|
|
|
|
/// Updates the mob's given beauty moodie, based on the area
|
|
/datum/mood/proc/update_beauty(area/area_to_beautify)
|
|
SIGNAL_HANDLER
|
|
if (area_to_beautify.outdoors) // if we're outside, we don't care
|
|
clear_mood_event(MOOD_CATEGORY_AREA_BEAUTY)
|
|
return
|
|
|
|
if(HAS_MIND_TRAIT(mob_parent, TRAIT_MORBID))
|
|
if(HAS_TRAIT(mob_parent, TRAIT_SNOB))
|
|
switch(area_to_beautify.beauty)
|
|
if(BEAUTY_LEVEL_DECENT to BEAUTY_LEVEL_GOOD)
|
|
add_mood_event(MOOD_CATEGORY_AREA_BEAUTY, /datum/mood_event/ehroom)
|
|
return
|
|
if(BEAUTY_LEVEL_GOOD to BEAUTY_LEVEL_GREAT)
|
|
add_mood_event(MOOD_CATEGORY_AREA_BEAUTY, /datum/mood_event/badroom)
|
|
return
|
|
if(BEAUTY_LEVEL_GREAT to INFINITY)
|
|
add_mood_event(MOOD_CATEGORY_AREA_BEAUTY, /datum/mood_event/horridroom)
|
|
return
|
|
switch(area_to_beautify.beauty)
|
|
if(-INFINITY to BEAUTY_LEVEL_HORRID)
|
|
add_mood_event(MOOD_CATEGORY_AREA_BEAUTY, /datum/mood_event/greatroom)
|
|
if(BEAUTY_LEVEL_HORRID to BEAUTY_LEVEL_BAD)
|
|
add_mood_event(MOOD_CATEGORY_AREA_BEAUTY, /datum/mood_event/goodroom)
|
|
if(BEAUTY_LEVEL_BAD to BEAUTY_LEVEL_DECENT)
|
|
clear_mood_event(MOOD_CATEGORY_AREA_BEAUTY)
|
|
return
|
|
|
|
if(HAS_TRAIT(mob_parent, TRAIT_SNOB))
|
|
switch(area_to_beautify.beauty)
|
|
if(-INFINITY to BEAUTY_LEVEL_HORRID)
|
|
add_mood_event(MOOD_CATEGORY_AREA_BEAUTY, /datum/mood_event/horridroom)
|
|
return
|
|
if(BEAUTY_LEVEL_HORRID to BEAUTY_LEVEL_BAD)
|
|
add_mood_event(MOOD_CATEGORY_AREA_BEAUTY, /datum/mood_event/badroom)
|
|
return
|
|
switch(area_to_beautify.beauty)
|
|
if(BEAUTY_LEVEL_BAD to BEAUTY_LEVEL_DECENT)
|
|
clear_mood_event(MOOD_CATEGORY_AREA_BEAUTY)
|
|
if(BEAUTY_LEVEL_DECENT to BEAUTY_LEVEL_GOOD)
|
|
add_mood_event(MOOD_CATEGORY_AREA_BEAUTY, /datum/mood_event/decentroom)
|
|
if(BEAUTY_LEVEL_GOOD to BEAUTY_LEVEL_GREAT)
|
|
add_mood_event(MOOD_CATEGORY_AREA_BEAUTY, /datum/mood_event/goodroom)
|
|
if(BEAUTY_LEVEL_GREAT to INFINITY)
|
|
add_mood_event(MOOD_CATEGORY_AREA_BEAUTY, /datum/mood_event/greatroom)
|
|
|
|
/datum/mood/proc/exit_area(datum/source, area/old_area)
|
|
SIGNAL_HANDLER
|
|
UnregisterSignal(old_area, COMSIG_AREA_BEAUTY_UPDATED)
|
|
|
|
/// Called when parent is ahealed.
|
|
/datum/mood/proc/on_revive(datum/source, full_heal)
|
|
SIGNAL_HANDLER
|
|
|
|
if (!full_heal)
|
|
return
|
|
remove_temp_moods()
|
|
set_sanity(initial(sanity), override = TRUE)
|
|
|
|
/// Sets sanity to the specified amount and applies effects.
|
|
/datum/mood/proc/set_sanity(amount, minimum = SANITY_INSANE, maximum = SANITY_GREAT, override = FALSE)
|
|
// If we're out of the acceptable minimum-maximum range move back towards it in steps of 0.7
|
|
// If the new amount would move towards the acceptable range faster then use it instead
|
|
if(amount < minimum && sanity < minimum)
|
|
amount = sanity + 0.7
|
|
|
|
if(!override && HAS_TRAIT(mob_parent, TRAIT_UNSTABLE))
|
|
amount = min(sanity, amount)
|
|
|
|
if (amount > maximum)
|
|
amount = min(amount, maximum)
|
|
|
|
if(amount == sanity) //Prevents stuff from flicking around.
|
|
return
|
|
|
|
sanity = amount
|
|
SEND_SIGNAL(mob_parent, COMSIG_CARBON_SANITY_UPDATE, amount)
|
|
switch(sanity)
|
|
if(SANITY_INSANE to SANITY_CRAZY)
|
|
set_insanity_effect(MAJOR_INSANITY_PEN)
|
|
mob_parent.add_movespeed_modifier(/datum/movespeed_modifier/sanity/insane)
|
|
mob_parent.add_actionspeed_modifier(/datum/actionspeed_modifier/low_sanity)
|
|
sanity_level = SANITY_LEVEL_INSANE
|
|
if(SANITY_CRAZY to SANITY_UNSTABLE)
|
|
set_insanity_effect(MINOR_INSANITY_PEN)
|
|
mob_parent.add_movespeed_modifier(/datum/movespeed_modifier/sanity/crazy)
|
|
mob_parent.add_actionspeed_modifier(/datum/actionspeed_modifier/low_sanity)
|
|
sanity_level = SANITY_LEVEL_CRAZY
|
|
if(SANITY_UNSTABLE to SANITY_DISTURBED)
|
|
set_insanity_effect(0)
|
|
mob_parent.add_movespeed_modifier(/datum/movespeed_modifier/sanity/disturbed)
|
|
mob_parent.add_actionspeed_modifier(/datum/actionspeed_modifier/low_sanity)
|
|
sanity_level = SANITY_LEVEL_UNSTABLE
|
|
if(SANITY_DISTURBED to SANITY_NEUTRAL)
|
|
set_insanity_effect(0)
|
|
mob_parent.remove_movespeed_modifier(MOVESPEED_ID_SANITY)
|
|
mob_parent.remove_actionspeed_modifier(ACTIONSPEED_ID_SANITY)
|
|
sanity_level = SANITY_LEVEL_DISTURBED
|
|
if(SANITY_NEUTRAL+1 to SANITY_GREAT+1) //shitty hack but +1 to prevent it from responding to super small differences
|
|
set_insanity_effect(0)
|
|
mob_parent.remove_movespeed_modifier(MOVESPEED_ID_SANITY)
|
|
mob_parent.add_actionspeed_modifier(/datum/actionspeed_modifier/high_sanity)
|
|
sanity_level = SANITY_LEVEL_NEUTRAL
|
|
if(SANITY_GREAT+1 to INFINITY)
|
|
set_insanity_effect(0)
|
|
mob_parent.remove_movespeed_modifier(MOVESPEED_ID_SANITY)
|
|
mob_parent.add_actionspeed_modifier(/datum/actionspeed_modifier/high_sanity)
|
|
sanity_level = SANITY_LEVEL_GREAT
|
|
|
|
// Crazy or insane = add some uncommon hallucinations
|
|
if(sanity_level >= SANITY_LEVEL_CRAZY)
|
|
mob_parent.apply_status_effect(/datum/status_effect/hallucination/sanity)
|
|
else
|
|
mob_parent.remove_status_effect(/datum/status_effect/hallucination/sanity)
|
|
|
|
update_mood_icon()
|
|
|
|
/// Adjusts sanity by a value
|
|
/datum/mood/proc/adjust_sanity(amount, minimum = SANITY_INSANE, maximum = SANITY_GREAT, override = FALSE)
|
|
set_sanity(sanity + amount, minimum, maximum, override)
|
|
|
|
/// Sets the insanity effect on the mob
|
|
/datum/mood/proc/set_insanity_effect(newval)
|
|
if (newval == insanity_effect)
|
|
return
|
|
mob_parent.crit_threshold = (mob_parent.crit_threshold - insanity_effect) + newval
|
|
insanity_effect = newval
|
|
|
|
/// Removes all temporary moods
|
|
/datum/mood/proc/remove_temp_moods()
|
|
for (var/category in mood_events)
|
|
var/datum/mood_event/moodlet = mood_events[category]
|
|
if (!moodlet || !moodlet.timeout)
|
|
continue
|
|
mood_events -= moodlet.category
|
|
qdel(moodlet)
|
|
update_mood()
|
|
|
|
/// Helper to forcefully drain sanity
|
|
/datum/mood/proc/direct_sanity_drain(amount)
|
|
adjust_sanity(amount, override = TRUE)
|
|
|
|
/**
|
|
* Returns true if you already have a mood from a provided category.
|
|
* You may think to yourself, why am I trying to get a boolean from a component? Well, this system probably should not be a component.
|
|
*
|
|
* Arguments
|
|
* * category - Mood category to validate against.
|
|
*/
|
|
/datum/mood/proc/has_mood_of_category(category)
|
|
for(var/i in mood_events)
|
|
var/datum/mood_event/moodlet = mood_events[i]
|
|
if (moodlet.category == category)
|
|
return TRUE
|
|
return FALSE
|
|
|
|
#undef MINOR_INSANITY_PEN
|
|
#undef MAJOR_INSANITY_PEN
|
|
#undef MOOD_CATEGORY_NUTRITION
|
|
#undef MOOD_CATEGORY_AREA_BEAUTY
|