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:
Qustinnus
2018-08-19 23:58:07 +02:00
committed by Tad Hardesty
parent 1c1311c4c1
commit b3eccaadc3
12 changed files with 49 additions and 62 deletions
-5
View File
@@ -110,11 +110,6 @@
layer = BLIND_LAYER
plane = FULLSCREEN_PLANE
/obj/screen/fullscreen/depression
icon_state = "depression"
layer = FLASH_LAYER
plane = FULLSCREEN_PLANE
/obj/screen/fullscreen/curse
icon_state = "curse"
layer = CURSE_LAYER
+8 -16
View File
@@ -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
+5 -5
View File
@@ -1,24 +1,24 @@
/datum/mood_event/drinks/drunk
/datum/mood_event/drunk
mood_change = 3
description = "<span class='nicegreen'>Everything just feels better after a drink or two.</span>\n"
timeout = 3000
/datum/mood_event/drinks/quality_nice
/datum/mood_event/quality_nice
description = "<span class='nicegreen'>That drink wasn't bad at all.</span>\n"
mood_change = 1
timeout = 1200
/datum/mood_event/drinks/quality_good
/datum/mood_event/quality_good
description = "<span class='nicegreen'>That drink was pretty good.</span>\n"
mood_change = 2
timeout = 1200
/datum/mood_event/drinks/quality_verygood
/datum/mood_event/quality_verygood
description = "<span class='nicegreen'>That drink was great!</span>\n"
mood_change = 3
timeout = 1200
/datum/mood_event/drinks/quality_fantastic
/datum/mood_event/quality_fantastic
description = "<span class='nicegreen'>That drink was amazing!</span>\n"
mood_change = 4
timeout = 1200
+12 -12
View File
@@ -1,39 +1,39 @@
/datum/mood_event/drugs/high
/datum/mood_event/high
mood_change = 6
description = "<span class='nicegreen'>Woooow duudeeeeee...I'm tripping baaalls...</span>\n"
/datum/mood_event/drugs/smoked
/datum/mood_event/smoked
description = "<span class='nicegreen'>I have had a smoke recently.</span>\n"
mood_change = 2
timeout = 3600
/datum/mood_event/drugs/overdose
/datum/mood_event/overdose
mood_change = -8
timeout = 3000
/datum/mood_event/drugs/overdose/add_effects(drug_name)
/datum/mood_event/overdose/add_effects(drug_name)
description = "<span class='warning'>I think I took a bit too much of that [drug_name]</span>\n"
/datum/mood_event/drugs/withdrawal_light
/datum/mood_event/withdrawal_light
mood_change = -2
/datum/mood_event/drugs/withdrawal_light/add_effects(drug_name)
/datum/mood_event/withdrawal_light/add_effects(drug_name)
description = "<span class='warning'>I could use some [drug_name]</span>\n"
/datum/mood_event/drugs/withdrawal_medium
/datum/mood_event/withdrawal_medium
mood_change = -5
/datum/mood_event/drugs/withdrawal_medium/add_effects(drug_name)
/datum/mood_event/withdrawal_medium/add_effects(drug_name)
description = "<span class='warning'>I really need [drug_name]</span>\n"
/datum/mood_event/drugs/withdrawal_severe
/datum/mood_event/withdrawal_severe
mood_change = -8
/datum/mood_event/drugs/withdrawal_severe/add_effects(drug_name)
/datum/mood_event/withdrawal_severe/add_effects(drug_name)
description = "<span class='boldwarning'>Oh god I need some [drug_name]</span>\n"
/datum/mood_event/drugs/withdrawal_critical
/datum/mood_event/withdrawal_critical
mood_change = -10
/datum/mood_event/drugs/withdrawal_critical/add_effects(drug_name)
/datum/mood_event/withdrawal_critical/add_effects(drug_name)
description = "<span class='boldwarning'>[drug_name]! [drug_name]! [drug_name]!</span>\n"
+8 -8
View File
@@ -1,34 +1,34 @@
//nutrition
/datum/mood_event/nutrition/fat
/datum/mood_event/fat
description = "<span class='warning'><B>I'm so fat...</B></span>\n" //muh fatshaming
mood_change = -4
/datum/mood_event/nutrition/wellfed
/datum/mood_event/wellfed
description = "<span class='nicegreen'>My belly feels round and full.</span>\n"
mood_change = 6
/datum/mood_event/nutrition/fed
/datum/mood_event/fed
description = "<span class='nicegreen'>I have recently had some food.</span>\n"
mood_change = 3
/datum/mood_event/nutrition/hungry
/datum/mood_event/hungry
description = "<span class='warning'>I'm getting a bit hungry.</span>\n"
mood_change = -8
/datum/mood_event/nutrition/starving
/datum/mood_event/starving
description = "<span class='boldwarning'>I'm starving!</span>\n"
mood_change = -15
//Disgust
/datum/mood_event/disgust/gross
/datum/mood_event/gross
description = "<span class='warning'>I saw something gross.</span>\n"
mood_change = -2
/datum/mood_event/disgust/verygross
/datum/mood_event/verygross
description = "<span class='warning'>I think I'm going to puke...</span>\n"
mood_change = -5
/datum/mood_event/disgust/disgusted
/datum/mood_event/disgusted
description = "<span class='boldwarning'>Oh god that's disgusting...</span>\n"
mood_change = -8
+1 -1
View File
@@ -429,7 +429,7 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put
if(drunkenness)
drunkenness = max(drunkenness - (drunkenness * 0.04), 0)
if(drunkenness >= 6)
SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "drunk", /datum/mood_event/drinks/drunk)
SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "drunk", /datum/mood_event/drunk)
if(prob(25))
slurring += 2
jitteriness = max(jitteriness - 3, 0)
@@ -45,7 +45,7 @@
if(druggy)
overlay_fullscreen("high", /obj/screen/fullscreen/high)
throw_alert("high", /obj/screen/alert/high)
SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "high", /datum/mood_event/drugs/high)
SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "high", /datum/mood_event/high)
else
clear_fullscreen("high")
clear_alert("high")
+5 -5
View File
@@ -88,29 +88,29 @@
/datum/reagent/proc/overdose_start(mob/living/M)
to_chat(M, "<span class='userdanger'>You feel like you took too much of [name]!</span>")
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/overdose, name)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/overdose, name)
return
/datum/reagent/proc/addiction_act_stage1(mob/living/M)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/withdrawal_light, name)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/withdrawal_light, name)
if(prob(30))
to_chat(M, "<span class='notice'>You feel like having some [name] right about now.</span>")
return
/datum/reagent/proc/addiction_act_stage2(mob/living/M)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/withdrawal_medium, name)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/withdrawal_medium, name)
if(prob(30))
to_chat(M, "<span class='notice'>You feel like you need [name]. You just can't get enough.</span>")
return
/datum/reagent/proc/addiction_act_stage3(mob/living/M)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/withdrawal_severe, name)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/withdrawal_severe, name)
if(prob(30))
to_chat(M, "<span class='danger'>You have an intense craving for [name].</span>")
return
/datum/reagent/proc/addiction_act_stage4(mob/living/M)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/withdrawal_critical, name)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/withdrawal_critical, name)
if(prob(30))
to_chat(M, "<span class='boldannounce'>You're not feeling good at all! You really need some [name].</span>")
return
@@ -28,7 +28,7 @@
/datum/reagent/drug/space_drugs/overdose_start(mob/living/M)
to_chat(M, "<span class='userdanger'>You start tripping hard!</span>")
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/overdose, name)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/overdose, name)
/datum/reagent/drug/space_drugs/overdose_process(mob/living/M)
if(M.hallucination < volume && prob(20))
@@ -49,7 +49,7 @@
if(prob(1))
var/smoke_message = pick("You feel relaxed.", "You feel calmed.","You feel alert.","You feel rugged.")
to_chat(M, "<span class='notice'>[smoke_message]</span>")
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "smoked", /datum/mood_event/drugs/smoked, name)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "smoked", /datum/mood_event/smoked, name)
M.AdjustStun(-20, 0)
M.AdjustKnockdown(-20, 0)
M.AdjustUnconscious(-20, 0)
@@ -25,13 +25,13 @@
if (quality && !M.has_trait(TRAIT_AGEUSIA))
switch(quality)
if (DRINK_NICE)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "quality_drink", /datum/mood_event/drinks/quality_nice)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "quality_drink", /datum/mood_event/quality_nice)
if (DRINK_GOOD)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "quality_drink", /datum/mood_event/drinks/quality_good)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "quality_drink", /datum/mood_event/quality_good)
if (DRINK_VERYGOOD)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "quality_drink", /datum/mood_event/drinks/quality_verygood)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "quality_drink", /datum/mood_event/quality_verygood)
if (DRINK_FANTASTIC)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "quality_drink", /datum/mood_event/drinks/quality_fantastic)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "quality_drink", /datum/mood_event/quality_fantastic)
return ..()
/datum/reagent/consumable/nutriment
+3 -3
View File
@@ -42,13 +42,13 @@
SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "disgust")
if(DISGUST_LEVEL_GROSS to DISGUST_LEVEL_VERYGROSS)
H.throw_alert("disgust", /obj/screen/alert/gross)
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "disgust", /datum/mood_event/disgust/gross)
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "disgust", /datum/mood_event/gross)
if(DISGUST_LEVEL_VERYGROSS to DISGUST_LEVEL_DISGUSTED)
H.throw_alert("disgust", /obj/screen/alert/verygross)
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "disgust", /datum/mood_event/disgust/verygross)
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "disgust", /datum/mood_event/verygross)
if(DISGUST_LEVEL_DISGUSTED to INFINITY)
H.throw_alert("disgust", /obj/screen/alert/disgusted)
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "disgust", /datum/mood_event/disgust/disgusted)
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "disgust", /datum/mood_event/disgusted)
/obj/item/organ/stomach/Remove(mob/living/carbon/M, special = 0)
var/mob/living/carbon/human/H = owner
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 MiB

After

Width:  |  Height:  |  Size: 4.1 MiB