[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
View File
@@ -60,6 +60,7 @@
/obj/structure/sign/poster/Initialize()
. = ..()
addtimer(CALLBACK(src, /datum.proc/AddComponent, /datum/component/beauty, 75), 0)
if(random_basetype)
randomise(random_basetype)
if(!ruined)
+9 -16
View File
@@ -4,17 +4,17 @@
var/list/random_icon_states = list()
var/blood_state = "" //I'm sorry but cleanable/blood code is ass, and so is blood_DNA
var/bloodiness = 0 //0-100, amount of blood in this decal, used for making footprints and affecting the alpha of bloody footprints
var/beauty = 0
var/mergeable_decal = TRUE //when two of these are on a same tile or do we need to merge them into just one?
var/beauty
/obj/effect/decal/cleanable/Initialize(mapload, list/datum/disease/diseases)
. = ..()
if (random_icon_states && length(src.random_icon_states) > 0)
src.icon_state = pick(src.random_icon_states)
if (random_icon_states && length(random_icon_states) > 0)
icon_state = pick(random_icon_states)
create_reagents(300)
if(src.loc && isturf(src.loc))
for(var/obj/effect/decal/cleanable/C in src.loc)
if(C != src && C.type == src.type && !QDELETED(C))
if(loc && isturf(loc))
for(var/obj/effect/decal/cleanable/C in loc)
if(C != src && C.type == type && !QDELETED(C))
if (replace_decal(C))
return INITIALIZE_HINT_QDEL
@@ -26,10 +26,9 @@
if(LAZYLEN(diseases_to_add))
AddComponent(/datum/component/infective, diseases_to_add)
/obj/effect/decal/cleanable/LateInitialize()
if(src.loc && isturf(src.loc))
var/area/A = get_area(src)
A.beauty += beauty / max(1, A.areasize) //Ensures that the effects scale with room size
/obj/effect/decal/cleanable/ComponentInitialize()
. = ..()
addtimer(CALLBACK(src, /datum.proc/AddComponent, /datum/component/beauty, beauty), 0) //inb4 i get yelled at for using the beauty var on cleanable instead of calling this proc on every subtype which would be pedantic and actually run worse.
/obj/effect/decal/cleanable/proc/replace_decal(obj/effect/decal/cleanable/C) // Returns true if we should give up in favor of the pre-existing decal
if(mergeable_decal)
@@ -97,9 +96,3 @@
return bloodiness
else
return 0
/obj/effect/decal/cleanable/Destroy()
. = ..()
if(src.loc && isturf(src.loc))
var/area/A = get_area(src)
A.beauty -= beauty / max(1, A.areasize)
@@ -8,7 +8,7 @@
random_icon_states = list("xfloor1", "xfloor2", "xfloor3", "xfloor4", "xfloor5", "xfloor6", "xfloor7")
bloodiness = MAX_SHOE_BLOODINESS
blood_state = BLOOD_STATE_XENO
beauty = -200
beauty = -250
/obj/effect/decal/cleanable/xenoblood/Initialize()
. = ..()
@@ -6,7 +6,7 @@
random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7")
blood_state = BLOOD_STATE_HUMAN
bloodiness = MAX_SHOE_BLOODINESS
beauty = -200
beauty = -250
/obj/effect/decal/cleanable/blood/replace_decal(obj/effect/decal/cleanable/blood/C)
C.add_blood_DNA(return_blood_DNA())
@@ -3,7 +3,7 @@
desc = "Someone should clean that up."
icon = 'icons/obj/objects.dmi'
icon_state = "shards"
beauty = -150
beauty = -300
/obj/effect/decal/cleanable/ash
name = "ashes"
@@ -11,7 +11,7 @@
icon = 'icons/obj/objects.dmi'
icon_state = "ash"
mergeable_decal = FALSE
beauty = -150
beauty = -300
/obj/effect/decal/cleanable/ash/Initialize()
. = ..()
@@ -26,7 +26,7 @@
/obj/effect/decal/cleanable/ash/large
name = "large pile of ashes"
icon_state = "big_ash"
beauty = -150
beauty = -300
/obj/effect/decal/cleanable/ash/large/Initialize()
. = ..()
@@ -37,7 +37,7 @@
desc = "Back to sand."
icon = 'icons/obj/shards.dmi'
icon_state = "tiny"
beauty = -20
beauty = -125
/obj/effect/decal/cleanable/glass/Initialize()
. = ..()
@@ -51,7 +51,7 @@
desc = "Someone should clean that up."
icon_state = "dirt"
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
beauty = -150
beauty = -300
/obj/effect/decal/cleanable/flour
name = "flour"
@@ -64,7 +64,7 @@
desc = "Jeez. I hope that's not for lunch."
light_color = LIGHT_COLOR_GREEN
icon_state = "greenglow"
beauty = -100
beauty = -200
/obj/effect/decal/cleanable/greenglow/Initialize(mapload)
. = ..()
@@ -80,7 +80,7 @@
layer = WALL_OBJ_LAYER
icon_state = "cobweb1"
resistance_flags = FLAMMABLE
beauty = -150
beauty = -300
/obj/effect/decal/cleanable/cobweb/cobweb2
icon_state = "cobweb2"
@@ -92,12 +92,12 @@
icon = 'icons/effects/effects.dmi'
icon_state = "molten"
mergeable_decal = FALSE
beauty = -250
beauty = -300
/obj/effect/decal/cleanable/molten_object/large
name = "big gooey grey mass"
icon_state = "big_molten"
beauty = -200
beauty = -450
//Vomit (sorry)
/obj/effect/decal/cleanable/vomit
@@ -106,7 +106,7 @@
icon = 'icons/effects/blood.dmi'
icon_state = "vomit_1"
random_icon_states = list("vomit_1", "vomit_2", "vomit_3", "vomit_4")
beauty = -400
beauty = -600
/obj/effect/decal/cleanable/vomit/attack_hand(mob/user)
if(ishuman(user))
@@ -161,7 +161,7 @@
gender = NEUTER
icon = 'icons/effects/tomatodecal.dmi'
random_icon_states = list("smashed_pie")
beauty = -125
beauty = -200
/obj/effect/decal/cleanable/chem_pile
name = "chemical pile"
@@ -169,7 +169,7 @@
gender = NEUTER
icon = 'icons/obj/objects.dmi'
icon_state = "ash"
beauty = -125
beauty = -200
/obj/effect/decal/cleanable/shreds
name = "shreds"
@@ -177,7 +177,7 @@
icon_state = "shreds"
gender = PLURAL
mergeable_decal = FALSE
beauty = -125
beauty = -200
/obj/effect/decal/cleanable/shreds/ex_act(severity, target)
if(severity == 1) //so shreds created during an explosion aren't deleted by the explosion.
@@ -47,7 +47,7 @@
random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7")
blood_state = BLOOD_STATE_OIL
bloodiness = MAX_SHOE_BLOODINESS
beauty = -125
beauty = -150
/obj/effect/decal/cleanable/oil/Initialize()
. = ..()