[MIRROR] [READY] Several fixes/changes to mood, longterm mood effects, beauty component (#5992)

* [READY] Several fixes/changes to mood, longterm mood effects, beauty component (#36344)

cl Floyd / Qustinnus
del: Removes short-term effects of mood
add; Adds long-term effects of mood by implementing sanity which goes up with good mood, down with bad mood, but takes time to change. Your sanity can be seen as your average mood in the recent past. All effects of moods are now covered by this system
add: Beauty component, currently only attached to cleanables, but you could attach it to any atom/movable and make them pretty/ugly, affecting mood of anyone in the room.
refactor: Removes the original way of adding mood events, uses signals properly instead.
fix: Cleanables "giving" area's free beauty during initialization
fix: Fixes some events not clearing properly
/cl

Fixes #36444

From now on mood no longer affects you directly, instead it decides whether your sanity goes up or down, when your sanity gets too low you will get the effects of what mood did before.

This means getting hit with bad moods due to being attacked while not mean you are doomed anymore, and you get a large timeframe to get away and just fix your mood later.

I also added the beauty component, you could add this to any object and it would either make a room prettier or uglier, comparable to DF or Rimworld. You could add traits to make certain people ugly, for example.

* [READY] Several fixes/changes to mood, longterm mood effects, beauty component
This commit is contained in:
CitadelStationBot
2018-03-19 21:33:18 -05:00
committed by Poojawa
parent 088f3fda5d
commit dad2d44ea2
64 changed files with 394 additions and 345 deletions
+1 -3
View File
@@ -303,9 +303,7 @@
need_mob_update += R.addiction_act_stage4(C)
if(40 to INFINITY)
to_chat(C, "<span class='notice'>You feel like you've gotten over your need for [R.name].</span>")
GET_COMPONENT_FROM(mood, /datum/component/mood, C)
if(mood)
mood.clear_event("[R.id]_addiction")
C.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "[R.id]_addiction")
cached_addictions.Remove(R)
addiction_tick++
if(C && need_mob_update) //some of the metabolized reagents had effects on the mob that requires some updates.
+5 -15
View File
@@ -91,39 +91,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>")
GET_COMPONENT_FROM(mood, /datum/component/mood, M)
if(mood)
mood.add_event("[id]_overdose", /datum/mood_event/drugs/overdose, name)
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/overdose, name)
return
/datum/reagent/proc/addiction_act_stage1(mob/living/M)
GET_COMPONENT_FROM(mood, /datum/component/mood, M)
if(mood)
mood.add_event("[id]_overdose", /datum/mood_event/drugs/withdrawal_light, name)
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/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)
GET_COMPONENT_FROM(mood, /datum/component/mood, M)
if(mood)
mood.add_event("[id]_overdose", /datum/mood_event/drugs/withdrawal_medium, name)
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/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)
GET_COMPONENT_FROM(mood, /datum/component/mood, M)
if(mood)
mood.add_event("[id]_overdose", /datum/mood_event/drugs/withdrawal_severe, name)
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/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)
GET_COMPONENT_FROM(mood, /datum/component/mood, M)
if(mood)
mood.add_event("[id]_overdose", /datum/mood_event/drugs/withdrawal_critical, name)
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/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
@@ -6,9 +6,8 @@
var/trippy = TRUE //Does this drug make you trip?
/datum/reagent/drug/on_mob_delete(mob/living/M)
GET_COMPONENT_FROM(mood, /datum/component/mood, M)
if(mood && trippy)
mood.clear_event("[id]_high")
if(trippy)
M.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "[id]_high")
/datum/reagent/drug/space_drugs
name = "Space drugs"
@@ -29,9 +28,7 @@
/datum/reagent/drug/space_drugs/overdose_start(mob/living/M)
to_chat(M, "<span class='userdanger'>You start tripping hard!</span>")
GET_COMPONENT_FROM(mood, /datum/component/mood, M)
if(mood)
mood.add_event("[id]_overdose", /datum/mood_event/drugs/overdose, name)
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "[id]_overdose", /datum/mood_event/drugs/overdose, name)
/datum/reagent/drug/space_drugs/overdose_process(mob/living/M)
if(M.hallucination < volume && prob(20))
@@ -52,9 +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>")
GET_COMPONENT_FROM(mood, /datum/component/mood, M)
if(mood)
mood.add_event("smoked", /datum/mood_event/drugs/smoked, name)
M.SendSignal(COMSIG_ADD_MOOD_EVENT, "smoked", /datum/mood_event/drugs/smoked, name)
M.AdjustStun(-20, 0)
M.AdjustKnockdown(-20, 0)
M.AdjustUnconscious(-20, 0)