mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 12:41:09 +01:00
Makes some improvements to mood code (#39750)
removes useless mood events subtypes fixes mood event timers not resetting when they get triggered again removes the depression overlay which makes our fruit happy
This commit is contained in:
@@ -123,16 +123,6 @@
|
||||
|
||||
/datum/component/mood/process() //Called on SSmood process
|
||||
var/mob/living/owner = parent
|
||||
switch(sanity)
|
||||
if(SANITY_INSANE to SANITY_CRAZY)
|
||||
owner.overlay_fullscreen("depression", /obj/screen/fullscreen/depression, 3)
|
||||
update_mood_icon()
|
||||
if(SANITY_INSANE to SANITY_UNSTABLE)
|
||||
owner.overlay_fullscreen("depression", /obj/screen/fullscreen/depression, 2)
|
||||
if(SANITY_UNSTABLE to SANITY_DISTURBED)
|
||||
owner.overlay_fullscreen("depression", /obj/screen/fullscreen/depression, 1)
|
||||
if(SANITY_DISTURBED to INFINITY)
|
||||
owner.clear_fullscreen("depression")
|
||||
|
||||
switch(mood_level)
|
||||
if(1)
|
||||
@@ -202,6 +192,8 @@
|
||||
if(the_event.type != type)
|
||||
clear_event(category)
|
||||
else
|
||||
if(the_event.timeout)
|
||||
addtimer(CALLBACK(src, .proc/clear_event, category), the_event.timeout, TIMER_UNIQUE|TIMER_OVERRIDE)
|
||||
return 0 //Don't have to update the event.
|
||||
the_event = new type(src, param)
|
||||
|
||||
@@ -209,7 +201,7 @@
|
||||
update_mood()
|
||||
|
||||
if(the_event.timeout)
|
||||
addtimer(CALLBACK(src, .proc/clear_event, category), the_event.timeout)
|
||||
addtimer(CALLBACK(src, .proc/clear_event, category), the_event.timeout, TIMER_UNIQUE|TIMER_OVERRIDE)
|
||||
|
||||
/datum/component/mood/proc/clear_event(category)
|
||||
var/datum/mood_event/event = mood_events[category]
|
||||
@@ -244,17 +236,17 @@
|
||||
/datum/component/mood/proc/HandleNutrition(mob/living/L)
|
||||
switch(L.nutrition)
|
||||
if(NUTRITION_LEVEL_FULL to INFINITY)
|
||||
add_event("nutrition", /datum/mood_event/nutrition/fat)
|
||||
add_event("nutrition", /datum/mood_event/fat)
|
||||
if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FULL)
|
||||
add_event("nutrition", /datum/mood_event/nutrition/wellfed)
|
||||
add_event("nutrition", /datum/mood_event/wellfed)
|
||||
if( NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED)
|
||||
add_event("nutrition", /datum/mood_event/nutrition/fed)
|
||||
add_event("nutrition", /datum/mood_event/fed)
|
||||
if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED)
|
||||
clear_event("nutrition")
|
||||
if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY)
|
||||
add_event("nutrition", /datum/mood_event/nutrition/hungry)
|
||||
add_event("nutrition", /datum/mood_event/hungry)
|
||||
if(0 to NUTRITION_LEVEL_STARVING)
|
||||
add_event("nutrition", /datum/mood_event/nutrition/starving)
|
||||
add_event("nutrition", /datum/mood_event/starving)
|
||||
|
||||
#undef MINOR_INSANITY_PEN
|
||||
#undef MAJOR_INSANITY_PEN
|
||||
|
||||
Reference in New Issue
Block a user