[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:
committed by
Poojawa
parent
088f3fda5d
commit
dad2d44ea2
+20
-11
@@ -31,8 +31,9 @@
|
||||
|
||||
var/outdoors = FALSE //For space, the asteroid, lavaland, etc. Used with blueprints to determine if we are adding a new area (vs editing a station room)
|
||||
|
||||
var/beauty = 0 //To see how clean/dirty this area is, only works with indoors areas.
|
||||
var/areasize = 0 //Size of the area in tiles, only calculated for indoors areas.
|
||||
var/totalbeauty = 0 //All beauty in this area combined, only includes indoor area.
|
||||
var/beauty = 0 // Beauty average per open turf in the area
|
||||
var/areasize = 0 //Size of the area in open turfs, only calculated for indoors areas.
|
||||
|
||||
var/power_equip = TRUE
|
||||
var/power_light = TRUE
|
||||
@@ -136,6 +137,7 @@ GLOBAL_LIST_EMPTY(teleportlocs)
|
||||
if(contents.len)
|
||||
var/list/areas_in_z = SSmapping.areas_in_z
|
||||
var/z
|
||||
update_areasize()
|
||||
for(var/i in 1 to contents.len)
|
||||
var/atom/thing = contents[i]
|
||||
if(!thing)
|
||||
@@ -148,12 +150,12 @@ GLOBAL_LIST_EMPTY(teleportlocs)
|
||||
if(!areas_in_z["[z]"])
|
||||
areas_in_z["[z]"] = list()
|
||||
areas_in_z["[z]"] += src
|
||||
update_area_size()
|
||||
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/area/LateInitialize()
|
||||
power_change() // all machines set to current power level, also updates icon
|
||||
update_beauty()
|
||||
|
||||
/area/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
@@ -476,12 +478,14 @@ GLOBAL_LIST_EMPTY(teleportlocs)
|
||||
used_environ += amount
|
||||
|
||||
|
||||
/area/Entered(A)
|
||||
/area/Entered(atom/movable/M)
|
||||
set waitfor = FALSE
|
||||
if(!isliving(A))
|
||||
SendSignal(COMSIG_AREA_ENTERED, M)
|
||||
M.SendSignal(COMSIG_ENTER_AREA, src) //The atom that enters the area
|
||||
if(!isliving(M))
|
||||
return
|
||||
|
||||
var/mob/living/L = A
|
||||
var/mob/living/L = M
|
||||
if(!L.ckey)
|
||||
return
|
||||
|
||||
@@ -501,9 +505,9 @@ GLOBAL_LIST_EMPTY(teleportlocs)
|
||||
L.client.played = TRUE
|
||||
addtimer(CALLBACK(L.client, /client/proc/ResetAmbiencePlayed), 600)
|
||||
|
||||
GET_COMPONENT_FROM(mood, /datum/component/mood, L)
|
||||
if(mood)
|
||||
mood.update_beauty(src)
|
||||
/area/Exited(atom/movable/M)
|
||||
SendSignal(COMSIG_AREA_EXITED, M)
|
||||
M.SendSignal(COMSIG_EXIT_AREA, src) //The atom that exits the area
|
||||
|
||||
/client/proc/ResetAmbiencePlayed()
|
||||
played = FALSE
|
||||
@@ -532,11 +536,16 @@ GLOBAL_LIST_EMPTY(teleportlocs)
|
||||
blob_allowed = FALSE
|
||||
addSorted()
|
||||
|
||||
/area/proc/update_area_size()
|
||||
/area/proc/update_beauty()
|
||||
if(!areasize)
|
||||
return FALSE
|
||||
beauty = totalbeauty / areasize
|
||||
|
||||
/area/proc/update_areasize()
|
||||
if(outdoors)
|
||||
return FALSE
|
||||
areasize = 0
|
||||
for(var/turf/T in src.contents)
|
||||
for(var/turf/open/T in contents)
|
||||
areasize++
|
||||
|
||||
/area/AllowDrop()
|
||||
|
||||
Reference in New Issue
Block a user