diff --git a/code/__DEFINES/components.dm b/code/__DEFINES/components.dm index bbe29f3e85..51579b4d88 100644 --- a/code/__DEFINES/components.dm +++ b/code/__DEFINES/components.dm @@ -19,6 +19,10 @@ #define COMSIG_COMPONENT_REMOVING "component_removing" //before a component is removed from a datum because of RemoveComponent: (/datum/component) #define COMSIG_PARENT_QDELETED "parent_qdeleted" //before a datum's Destroy() is called: () +// /Component signals +#define COMSIG_ADD_MOOD_EVENT "add_mood" //Called when you send a mood event from anywhere in the code. +#define COMSIG_CLEAR_MOOD_EVENT "clear_mood" //Called when you clear a mood event from anywhere in the code. + #define COMSIG_COMPONENT_CLEAN_ACT "clean_act" //called on an object to clean it of cleanables. Usualy with soap: (num/strength) #define COMSIG_COMPONENT_NTNET_RECIEVE "ntnet_recieve" //called on an object by its NTNET connection component on recieve. (sending_id(number), sending_netname(text), data(datum/netdata)) @@ -50,6 +54,8 @@ #define COMSIG_ATOM_SET_LIGHT "atom_set_light" //from base of atom/set_light(): (l_range, l_power, l_color) #define COMSIG_ATOM_ROTATE "atom_rotate" //from base of atom/shuttleRotate(): (rotation, params) #define COMSIG_ATOM_DIR_CHANGE "atom_dir_change" //from base of atom/setDir(): (old_dir, new_dir) +#define COMSIG_ENTER_AREA "enter_area" //from base of area/Entered(): (/area) +#define COMSIG_EXIT_AREA "exit_area" //from base of area/Exited(): (/area) #define COMSIG_CLICK "atom_click" //from base of atom/Click(): (location, control, params) #define COMSIG_CLICK_SHIFT "shift_click" //from base of atom/ShiftClick(): (/mob) @@ -57,6 +63,10 @@ #define COMSIG_CLICK_ALT "alt_click" //from base of atom/AltClick(): (/mob) #define COMSIG_CLICK_CTRL_SHIFT "ctrl_shift_click" //from base of atom/CtrlShiftClick(/mob) +// /area signals +#define COMSIG_AREA_ENTERED "area_entered" //from base of area/Entered(): (atom/movable/M) +#define COMSIG_AREA_EXITED "area_exited" //from base of area/Exited(): (atom/movable/M) + // /atom/movable signals #define COMSIG_MOVABLE_MOVED "movable_moved" //from base of atom/movable/Moved(): (/atom, dir) #define COMSIG_MOVABLE_CROSSED "movable_crossed" //from base of atom/movable/Crossed(): (/atom/movable) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 71267e272f..8be6ac7782 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -95,15 +95,23 @@ #define MOOD_LEVEL_SAD1 -3 #define MOOD_LEVEL_SAD2 -12 #define MOOD_LEVEL_SAD3 -18 -#define MOOD_LEVEL_SAD4 -26 +#define MOOD_LEVEL_SAD4 -25 + +//Sanity levels for humans +#define SANITY_GREAT 125 +#define SANITY_NEUTRAL 100 +#define SANITY_DISTURBED 75 +#define SANITY_UNSTABLE 50 +#define SANITY_CRAZY 25 +#define SANITY_INSANE 0 //Beauty levels of areas for carbons -#define BEAUTY_LEVEL_HORRID -50 -#define BEAUTY_LEVEL_BAD -25 -#define BEAUTY_LEVEL_GOOD 25 -#define BEAUTY_LEVEL_GREAT 50 - - +#define BEAUTY_LEVEL_HORRID -100 +#define BEAUTY_LEVEL_BAD -66 +#define BEAUTY_LEVEL_MEH -33 +#define BEAUTY_LEVEL_DECENT 33 +#define BEAUTY_LEVEL_GOOD 66 +#define BEAUTY_LEVEL_GREAT 100 //Nutrition levels for humans #define NUTRITION_LEVEL_FAT 600 diff --git a/code/__DEFINES/sound.dm b/code/__DEFINES/sound.dm index 453a02db01..f2d78f3438 100644 --- a/code/__DEFINES/sound.dm +++ b/code/__DEFINES/sound.dm @@ -70,3 +70,11 @@ 'sound/ambience/ambiatmos.ogg', 'sound/ambience/ambiatmos2.ogg', 'sound/ambience/ambiodd.ogg') #define REEBE list('sound/ambience/ambireebe1.ogg', 'sound/ambience/ambireebe2.ogg', 'sound/ambience/ambireebe3.ogg') + + + +#define CREEPY_SOUNDS list('sound/effects/ghost.ogg', 'sound/effects/ghost2.ogg', 'sound/effects/heart_beat.ogg', 'sound/effects/screech.ogg',\ + 'sound/hallucinations/behind_you1.ogg', 'sound/hallucinations/behind_you2.ogg', 'sound/hallucinations/far_noise.ogg', 'sound/hallucinations/growl1.ogg', 'sound/hallucinations/growl2.ogg',\ + 'sound/hallucinations/growl3.ogg', 'sound/hallucinations/im_here1.ogg', 'sound/hallucinations/im_here2.ogg', 'sound/hallucinations/i_see_you1.ogg', 'sound/hallucinations/i_see_you2.ogg',\ + 'sound/hallucinations/look_up1.ogg', 'sound/hallucinations/look_up2.ogg', 'sound/hallucinations/over_here1.ogg', 'sound/hallucinations/over_here2.ogg', 'sound/hallucinations/over_here3.ogg',\ + 'sound/hallucinations/turn_around1.ogg', 'sound/hallucinations/turn_around2.ogg', 'sound/hallucinations/veryfar_noise.ogg', 'sound/hallucinations/wail.ogg') diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index d2b8ad7d9f..709625ca3f 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -396,13 +396,11 @@ Proc for attack log creation, because really why not GET_COMPONENT_FROM(mood, /datum/component/mood, user) if(mood) - switch(mood.mood) //Alerts do_after delay based on how happy you are - if(-INFINITY to MOOD_LEVEL_SAD2) + switch(mood.sanity) //Alters do_after delay based on how sane you are + if(SANITY_INSANE to SANITY_DISTURBED) delay *= 1.25 - if(MOOD_LEVEL_HAPPY3 to MOOD_LEVEL_HAPPY4) - delay *= 0.95 - if(MOOD_LEVEL_HAPPY4 to INFINITY) - delay *= 0.9 + if(SANITY_NEUTRAL to SANITY_GREAT) + delay *= 0.90 var/endtime = world.time + delay var/starttime = world.time diff --git a/code/datums/brain_damage/mild.dm b/code/datums/brain_damage/mild.dm index 9a523cb39f..5c23fb4c8b 100644 --- a/code/datums/brain_damage/mild.dm +++ b/code/datums/brain_damage/mild.dm @@ -43,9 +43,7 @@ /datum/brain_trauma/mild/dumbness/on_gain() owner.add_trait(TRAIT_DUMB, TRAUMA_TRAIT) - GET_COMPONENT_FROM(mood, /datum/component/mood, owner) - if(mood) - mood.add_event("dumb", /datum/mood_event/oblivious) + owner.SendSignal(COMSIG_ADD_MOOD_EVENT, "dumb", /datum/mood_event/oblivious) ..() /datum/brain_trauma/mild/dumbness/on_life() @@ -59,9 +57,7 @@ /datum/brain_trauma/mild/dumbness/on_lose() owner.remove_trait(TRAIT_DUMB, TRAUMA_TRAIT) owner.derpspeech = 0 - GET_COMPONENT_FROM(mood, /datum/component/mood, owner) - if(mood) - mood.clear_event("dumb") + owner.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "dumb") ..() /datum/brain_trauma/mild/speech_impediment diff --git a/code/datums/components/beauty.dm b/code/datums/components/beauty.dm new file mode 100644 index 0000000000..4dbfca4014 --- /dev/null +++ b/code/datums/components/beauty.dm @@ -0,0 +1,35 @@ +/datum/component/beauty + var/beauty = 0 + +/datum/component/beauty/Initialize(beautyamount) + if(!ismovableatom(parent)) + . = COMPONENT_INCOMPATIBLE + CRASH("Someone put a beauty component on a non-atom/movable, not everything can be pretty.") + beauty = beautyamount + RegisterSignal(COMSIG_ENTER_AREA, .proc/enter_area) + RegisterSignal(COMSIG_EXIT_AREA, .proc/exit_area) + var/area/A = get_area(parent) + if(!A || A.outdoors) + return + A.totalbeauty += beauty + A.update_beauty() + +/datum/component/beauty/proc/enter_area(area/A) + if(A.outdoors) //Fuck the outside. + return FALSE + A.totalbeauty += beauty + A.update_beauty() + +/datum/component/beauty/proc/exit_area(area/A) + if(A.outdoors) //Fuck the outside. + return FALSE + A.totalbeauty -= beauty + A.update_beauty() + +/datum/component/beauty/Destroy() + . = ..() + var/area/A = get_area(parent) + if(!A || A.outdoors) + return + A.totalbeauty -= beauty + A.update_beauty() diff --git a/code/datums/components/mood.dm b/code/datums/components/mood.dm index 2f0401302f..f522445ee0 100644 --- a/code/datums/components/mood.dm +++ b/code/datums/components/mood.dm @@ -1,10 +1,12 @@ /datum/component/mood var/mood //Real happiness + var/sanity = 100 //Current sanity var/shown_mood //Shown happiness, this is what others can see when they try to examine you, prevents antag checking by noticing traitors are always very happy. - var/mood_level //To track what stage of moodies they're on + var/mood_level = 5 //To track what stage of moodies they're on var/mood_modifier = 1 //Modifier to allow certain mobs to be less affected by moodlets var/datum/mood_event/list/mood_events = list() var/mob/living/owner + var/datum/looping_sound/reverse_bear_trap/slow/soundloop //Insanity ticking /datum/component/mood/Initialize() if(!isliving(parent)) @@ -12,16 +14,61 @@ CRASH("Some good for nothing loser put a mood component on something that isn't even a living mob.") START_PROCESSING(SSmood, src) owner = parent + soundloop = new(list(owner), FALSE, TRUE) + RegisterSignal(COMSIG_ADD_MOOD_EVENT, .proc/add_event) + RegisterSignal(COMSIG_CLEAR_MOOD_EVENT, .proc/clear_event) + RegisterSignal(COMSIG_ENTER_AREA, .proc/update_beauty) /datum/component/mood/Destroy() STOP_PROCESSING(SSmood, src) + QDEL_NULL(soundloop) return ..() /datum/component/mood/proc/print_mood() var/msg = "*---------*\nYour current mood\n" - for(var/i in mood_events) - var/datum/mood_event/event = mood_events[i] - msg += event.description + msg += "My mental status: " //Long term + switch(sanity) + if(SANITY_GREAT to INFINITY) + msg += "My mind feels like a temple!\n" + if(SANITY_NEUTRAL to SANITY_GREAT) + msg += "I have been feeling great lately!\n" + if(SANITY_DISTURBED to SANITY_NEUTRAL) + msg += "I have felt quite decent lately.\n" + if(SANITY_UNSTABLE to SANITY_DISTURBED) + msg += "I'm feeling a little bit unhinged...\n" + if(SANITY_CRAZY to SANITY_UNSTABLE) + msg += "I'm freaking out!!\n" + if(SANITY_INSANE to SANITY_CRAZY) + msg += "AHAHAHAHAHAHAHAHAHAH!!\n" + + msg += "My current mood: " //Short term + switch(mood_level) + if(1) + msg += "I wish I was dead!\n" + if(2) + msg += "I feel terrible...\n" + if(3) + msg += "I feel very upset.\n" + if(4) + msg += "I'm a bit sad.\n" + if(5) + msg += "I'm alright.\n" + if(6) + msg += "I feel pretty okay.\n" + if(7) + msg += "I feel pretty good.\n" + if(8) + msg += "I feel amazing!\n" + if(9) + msg += "I love life!\n" + + msg += "Moodlets:\n"//All moodlets + if(mood_events.len) + for(var/i in mood_events) + var/datum/mood_event/event = mood_events[i] + msg += event.description + else + msg += "Nothing special has happend to me lately!\n" to_chat(owner, msg) /datum/component/mood/proc/update_mood() //Called whenever a mood event is added or removed @@ -54,41 +101,87 @@ mood_level = 8 if(MOOD_LEVEL_HAPPY4 to INFINITY) mood_level = 9 + update_mood_icon() + +/datum/component/mood/proc/update_mood_icon() if(owner.client && owner.hud_used) - owner.hud_used.mood.icon_state = "mood[mood_level]" + if(sanity < 25) + owner.hud_used.mood.icon_state = "mood_insane" + else + owner.hud_used.mood.icon_state = "mood[mood_level]" /datum/component/mood/process() //Called on SSmood process - switch(mood) - if(-INFINITY to MOOD_LEVEL_SAD4) + switch(sanity) + if(SANITY_INSANE to SANITY_CRAZY) owner.overlay_fullscreen("depression", /obj/screen/fullscreen/depression, 3) - if(MOOD_LEVEL_SAD4 to MOOD_LEVEL_SAD3) + update_mood_icon() + if(prob(7)) + owner.playsound_local(null, pick(CREEPY_SOUNDS), 100, 1) + soundloop.start() + if(SANITY_INSANE to SANITY_UNSTABLE) owner.overlay_fullscreen("depression", /obj/screen/fullscreen/depression, 2) - if(MOOD_LEVEL_SAD3 to MOOD_LEVEL_SAD2) + if(prob(3)) + owner.playsound_local(null, pick(CREEPY_SOUNDS), 60, 1) + soundloop.stop() + if(SANITY_UNSTABLE to SANITY_DISTURBED) owner.overlay_fullscreen("depression", /obj/screen/fullscreen/depression, 1) - if(MOOD_LEVEL_SAD2 to INFINITY) + soundloop.stop() + if(SANITY_DISTURBED to SANITY_GREAT) owner.clear_fullscreen("depression") + soundloop.stop() + + switch(mood_level) + if(1) + DecreaseSanity(0.4) + if(2) + DecreaseSanity(0.25) + if(3) + DecreaseSanity(0.15) + if(4) + DecreaseSanity(0.05) + if(5) + IncreaseSanity(0.1) + if(6) + IncreaseSanity(0.15) + if(7) + IncreaseSanity(0.20) + if(8) + IncreaseSanity(0.25, 125) + if(9) + IncreaseSanity(0.4, 125) if(owner.has_trait(TRAIT_DEPRESSION)) - if(prob(0.1)) + if(prob(0.05)) add_event("depression", /datum/mood_event/depression) clear_event("jolly") if(owner.has_trait(TRAIT_JOLLY)) - if(prob(0.1)) + if(prob(0.05)) add_event("jolly", /datum/mood_event/jolly) clear_event("depression") + var/area/A = get_area(owner) + if(A) + update_beauty(A) + +/datum/component/mood/proc/DecreaseSanity(amount) + sanity = max(0, sanity - amount) + +/datum/component/mood/proc/IncreaseSanity(amount, limit = 99) + if(sanity > limit) + DecreaseSanity(-0.5) //Removes some sanity to go back to our current limit. + else + sanity = min(limit, sanity + amount) + /datum/component/mood/proc/add_event(category, type, param) //Category will override any events in the same category, should be unique unless the event is based on the same thing like hunger. var/datum/mood_event/the_event if(mood_events[category]) the_event = mood_events[category] if(the_event.type != type) clear_event(category) - return .() else return 0 //Don't have to update the event. - else - the_event = new type(src, param) + the_event = new type(src, param) mood_events[category] = the_event update_mood() @@ -105,18 +198,22 @@ qdel(event) update_mood() -/datum/component/mood/proc/update_beauty(var/area/A) +/datum/component/mood/proc/update_beauty(area/A) if(A.outdoors) //if we're outside, we don't care. clear_event("area_beauty") return FALSE switch(A.beauty) if(-INFINITY to BEAUTY_LEVEL_HORRID) - add_event("area_beauty", /datum/mood_event/disgustingroom) + add_event("area_beauty", /datum/mood_event/horridroom) if(BEAUTY_LEVEL_HORRID to BEAUTY_LEVEL_BAD) - add_event("area_beauty", /datum/mood_event/grossroom) - if(BEAUTY_LEVEL_BAD to BEAUTY_LEVEL_GOOD) + add_event("area_beauty", /datum/mood_event/badroom) + if(BEAUTY_LEVEL_BAD to BEAUTY_LEVEL_MEH) + add_event("area_beauty", /datum/mood_event/mehroom) + if(BEAUTY_LEVEL_MEH to BEAUTY_LEVEL_DECENT) clear_event("area_beauty") + if(BEAUTY_LEVEL_DECENT to BEAUTY_LEVEL_GOOD) + add_event("area_beauty", /datum/mood_event/decentroom) if(BEAUTY_LEVEL_GOOD to BEAUTY_LEVEL_GREAT) - add_event("area_beauty", /datum/mood_event/niceroom) + add_event("area_beauty", /datum/mood_event/goodroom) if(BEAUTY_LEVEL_GREAT to INFINITY) add_event("area_beauty", /datum/mood_event/greatroom) diff --git a/code/datums/looping_sounds/item_sounds.dm b/code/datums/looping_sounds/item_sounds.dm index b418d20985..d0ec277b36 100644 --- a/code/datums/looping_sounds/item_sounds.dm +++ b/code/datums/looping_sounds/item_sounds.dm @@ -41,6 +41,12 @@ mid_length = 3.5 volume = 25 +/datum/looping_sound/reverse_bear_trap/slow + mid_sounds = list('sound/effects/clock_tick.ogg') + mid_length = 10 + volume = 40 + + /datum/looping_sound/reverse_bear_trap_beep mid_sounds = list('sound/machines/beep.ogg') mid_length = 60 diff --git a/code/datums/mood_events/beauty_events.dm b/code/datums/mood_events/beauty_events.dm new file mode 100644 index 0000000000..534facdb21 --- /dev/null +++ b/code/datums/mood_events/beauty_events.dm @@ -0,0 +1,23 @@ +/datum/mood_event/horridroom + description = "This room looks terrible!\n" + mood_change = -5 + +/datum/mood_event/badroom + description = "This room looks really bad.\n" + mood_change = -3 + +/datum/mood_event/mehroom + description = "This room doesn't look great.\n" + mood_change = -1 + +/datum/mood_event/decentroom + description = "This room looks alright.\n" + mood_change = 2 + +/datum/mood_event/goodroom + description = "This room looks really pretty!\n" + mood_change = 4 + +/datum/mood_event/greatroom + description = "This room is beautiful!\n" + mood_change = 7 diff --git a/code/datums/mood_events/generic_negative_events.dm b/code/datums/mood_events/generic_negative_events.dm index c2db1e8a37..95161f4f39 100644 --- a/code/datums/mood_events/generic_negative_events.dm +++ b/code/datums/mood_events/generic_negative_events.dm @@ -49,7 +49,7 @@ /datum/mood_event/depression description = "I feel sad for no particular reason.\n" - mood_change = -6 + mood_change = -9 timeout = 1200 /datum/mood_event/shameful_suicide //suicide_acts that return SHAME, like sord @@ -64,7 +64,7 @@ /datum/mood_event/noshoes description = "I am a disgrace to comedy everywhere!\n" - mood_change = -3 + mood_change = -5 /datum/mood_event/tased description = "There's no \"z\" in \"taser\". It's in the zap.\n" @@ -73,13 +73,22 @@ /datum/mood_event/embedded description = "Pull it out!\n" - mood_change = -6 + mood_change = -7 /datum/mood_event/table description = "Someone threw me on a table!\n" mood_change = -2 timeout = 1200 +/datum/mood_event/table/add_effects() + if(ishuman(owner)) + var/mob/living/carbon/human/H = owner + if(iscatperson(H)) + H.startTailWag() + addtimer(CALLBACK(H, /mob/living/carbon/human.proc/endTailWag), 30) + description = "They want to play on the table!\n" + mood_change = 2 + /datum/mood_event/brain_damage mood_change = -3 @@ -96,15 +105,6 @@ mood_change = -3 timeout = 3000 - -/datum/mood_event/grossroom - description = "This room is kind of dirty...\n" - mood_change = -3 - -/datum/mood_event/disgustingroom - description = "This room is disgusting!\n" - mood_change = -5 - //These are unused so far but I want to remember them to use them later /datum/mood_event/cloned_corpse description = "I recently saw my own corpse...\n" diff --git a/code/datums/mood_events/generic_positive_events.dm b/code/datums/mood_events/generic_positive_events.dm index f5c5bb9807..e96567cf9d 100644 --- a/code/datums/mood_events/generic_positive_events.dm +++ b/code/datums/mood_events/generic_positive_events.dm @@ -37,11 +37,6 @@ description = "What a lovely day.\n" mood_change = 3 -/datum/mood_event/happytable - description = "They want to play on the table!\n" - mood_change = 2 - timeout = 1200 - /datum/mood_event/jolly description = "I feel happy for no particular reason.\n" mood_change = 6 @@ -61,11 +56,3 @@ description = "I have seen the truth, praise the almighty one!\n" mood_change = 40 //maybe being a cultist isnt that bad after all hidden = TRUE - -/datum/mood_event/niceroom - description = "This room looks really pretty!\n" - mood_change = 4 - -/datum/mood_event/greatroom - description = "This room is beautiful!\n" - mood_change = 7 diff --git a/code/datums/mutations/body.dm b/code/datums/mutations/body.dm index fd0dd077b7..f0da9b125f 100644 --- a/code/datums/mutations/body.dm +++ b/code/datums/mutations/body.dm @@ -11,9 +11,7 @@ owner.visible_message("[owner] starts having a seizure!", "You have a seizure!") owner.Unconscious(200) owner.Jitter(1000) - GET_COMPONENT_FROM(mood, /datum/component/mood, owner) - if(mood) - mood.add_event("epilepsy", /datum/mood_event/epilepsy) + owner.SendSignal(COMSIG_ADD_MOOD_EVENT, "epilepsy", /datum/mood_event/epilepsy) addtimer(CALLBACK(src, .proc/jitter_less, owner), 90) /datum/mutation/human/epilepsy/proc/jitter_less(mob/living/carbon/human/owner) diff --git a/code/datums/mutations/hulk.dm b/code/datums/mutations/hulk.dm index b12efbc452..d51b7dd891 100644 --- a/code/datums/mutations/hulk.dm +++ b/code/datums/mutations/hulk.dm @@ -14,9 +14,7 @@ owner.add_trait(TRAIT_STUNIMMUNE, TRAIT_HULK) owner.add_trait(TRAIT_PUSHIMMUNE, TRAIT_HULK) owner.update_body_parts() - GET_COMPONENT_FROM(mood, /datum/component/mood, owner) - if(mood) - mood.add_event("hulk", /datum/mood_event/hulk) + owner.SendSignal(COMSIG_ADD_MOOD_EVENT, "hulk", /datum/mood_event/hulk) /datum/mutation/human/hulk/on_attack_hand(mob/living/carbon/human/owner, atom/target, proximity) if(proximity) //no telekinetic hulk attack @@ -33,10 +31,8 @@ owner.remove_trait(TRAIT_STUNIMMUNE, TRAIT_HULK) owner.remove_trait(TRAIT_PUSHIMMUNE, TRAIT_HULK) owner.update_body_parts() - GET_COMPONENT_FROM(mood, /datum/component/mood, owner) - if(mood) - mood.clear_event("hulk") - + owner.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "hulk") + /datum/mutation/human/hulk/say_mod(message) if(message) message = "[uppertext(replacetext(message, ".", "!"))]!!" diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 0f3bfb12b1..f5d0ec3bd7 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -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() diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 07f5c0f923..566df0b6c2 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -70,9 +70,7 @@ Reset() /obj/machinery/computer/arcade/proc/prizevend(mob/user) - GET_COMPONENT_FROM(mood, /datum/component/mood, user) - if(mood) - mood.add_event("arcade", /datum/mood_event/arcade) + user.SendSignal(COMSIG_ADD_MOOD_EVENT, "arcade", /datum/mood_event/arcade) if(prob(0.0001)) //1 in a million new /obj/item/gun/energy/pulse/prize(src) SSmedals.UnlockMedal(MEDAL_PULSE, usr.client) @@ -175,7 +173,7 @@ sleep(10) enemy_hp -= attackamt - arcade_action() + arcade_action(usr) else if (href_list["heal"]) blocked = TRUE @@ -191,7 +189,7 @@ player_hp += healamt blocked = TRUE updateUsrDialog() - arcade_action() + arcade_action(usr) else if (href_list["charge"]) blocked = TRUE @@ -204,7 +202,7 @@ updateUsrDialog() sleep(10) - arcade_action() + arcade_action(usr) if (href_list["close"]) usr.unset_machine() @@ -227,7 +225,7 @@ updateUsrDialog() return -/obj/machinery/computer/arcade/battle/proc/arcade_action() +/obj/machinery/computer/arcade/battle/proc/arcade_action(mob/user) if ((enemy_mp <= 0) || (enemy_hp <= 0)) if(!gameover) gameover = TRUE @@ -242,7 +240,7 @@ Reset() obj_flags &= ~EMAGGED else - prizevend(usr) + prizevend(user) SSblackbox.record_feedback("nested tally", "arcade_results", 1, list("win", (obj_flags & EMAGGED ? "emagged":"normal"))) @@ -484,7 +482,7 @@ if (href_list["continue"]) //Continue your travels if(gameStatus == ORION_STATUS_NORMAL && !event && turns != 7) if(turns >= ORION_TRAIL_WINTURN) - win() + win(usr) else food -= (alive+lings_aboard)*2 fuel -= 5 @@ -1028,7 +1026,7 @@ return removed -/obj/machinery/computer/arcade/orion_trail/proc/win() +/obj/machinery/computer/arcade/orion_trail/proc/win(mob/user) gameStatus = ORION_STATUS_START say("Congratulations, you made it to Orion!") if(obj_flags & EMAGGED) @@ -1036,7 +1034,7 @@ message_admins("[key_name_admin(usr)] made it to Orion on an emagged machine and got an explosive toy ship.") log_game("[key_name(usr)] made it to Orion on an emagged machine and got an explosive toy ship.") else - prizevend(usr) + prizevend(user) obj_flags &= ~EMAGGED name = "The Orion Trail" desc = "Learn how our ancestors got to Orion, and have fun in the process!" diff --git a/code/game/objects/effects/contraband.dm b/code/game/objects/effects/contraband.dm index 4499b9b62e..4c4427e77f 100644 --- a/code/game/objects/effects/contraband.dm +++ b/code/game/objects/effects/contraband.dm @@ -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) diff --git a/code/game/objects/effects/decals/cleanable.dm b/code/game/objects/effects/decals/cleanable.dm index c070c1a6ea..0794b818da 100644 --- a/code/game/objects/effects/decals/cleanable.dm +++ b/code/game/objects/effects/decals/cleanable.dm @@ -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) diff --git a/code/game/objects/effects/decals/cleanable/aliens.dm b/code/game/objects/effects/decals/cleanable/aliens.dm index 79103c28aa..f93d5b5f44 100644 --- a/code/game/objects/effects/decals/cleanable/aliens.dm +++ b/code/game/objects/effects/decals/cleanable/aliens.dm @@ -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() . = ..() diff --git a/code/game/objects/effects/decals/cleanable/humans.dm b/code/game/objects/effects/decals/cleanable/humans.dm index 7b2c00a0b6..215a012b64 100644 --- a/code/game/objects/effects/decals/cleanable/humans.dm +++ b/code/game/objects/effects/decals/cleanable/humans.dm @@ -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()) diff --git a/code/game/objects/effects/decals/cleanable/misc.dm b/code/game/objects/effects/decals/cleanable/misc.dm index e5253d4b85..53e368ea64 100644 --- a/code/game/objects/effects/decals/cleanable/misc.dm +++ b/code/game/objects/effects/decals/cleanable/misc.dm @@ -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. diff --git a/code/game/objects/effects/decals/cleanable/robots.dm b/code/game/objects/effects/decals/cleanable/robots.dm index b70b500bba..91956fdb65 100644 --- a/code/game/objects/effects/decals/cleanable/robots.dm +++ b/code/game/objects/effects/decals/cleanable/robots.dm @@ -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() . = ..() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index d19f9d1ab6..92a4a93243 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -537,9 +537,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) else M.take_bodypart_damage(7) - GET_COMPONENT_FROM(mood, /datum/component/mood, M) - if(mood) - mood.add_event("eye_stab", /datum/mood_event/eye_stab) + M.SendSignal(COMSIG_ADD_MOOD_EVENT, "eye_stab", /datum/mood_event/eye_stab) add_logs(user, M, "attacked", "[src.name]", "(INTENT: [uppertext(user.a_intent)])") diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index 0383121308..ad616e8ad3 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -191,7 +191,7 @@ FD.CalculateAffectingAreas() to_chat(usr, "You rename the '[prevname]' to '[str]'.") log_game("[key_name(usr)] has renamed [prevname] to [str]") - A.update_area_size() + A.update_areasize() interact() return 1 diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index b9f2276e23..cb934ce194 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -549,9 +549,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM var/hitzone = user.held_index_to_dir(user.active_hand_index) == "r" ? BODY_ZONE_PRECISE_R_HAND : BODY_ZONE_PRECISE_L_HAND user.apply_damage(5, BURN, hitzone) user.visible_message("After a few attempts, [user] manages to light [src] - however, [user.p_they()] burn their finger in the process.", "You burn yourself while lighting the lighter!") - GET_COMPONENT_FROM(mood, /datum/component/mood, user) - if(mood) - mood.add_event("burnt_thumb", /datum/mood_event/burnt_thumb) + user.SendSignal(COMSIG_ADD_MOOD_EVENT, "burnt_thumb", /datum/mood_event/burnt_thumb) else set_lit(FALSE) diff --git a/code/game/objects/items/clown_items.dm b/code/game/objects/items/clown_items.dm index ab30e7ea18..515dab5e27 100644 --- a/code/game/objects/items/clown_items.dm +++ b/code/game/objects/items/clown_items.dm @@ -117,9 +117,7 @@ AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg'=1), 50) /obj/item/weapon/bikehorn/attack(mob/living/carbon/M, mob/living/carbon/user) - GET_COMPONENT_FROM(mood, /datum/component/mood, M) - if(mood) - mood.add_event("honk", /datum/mood_event/honk) + M.SendSignal(COMSIG_ADD_MOOD_EVENT, "honk", /datum/mood_event/honk) /obj/item/bikehorn/suicide_act(mob/user) user.visible_message("[user] solemnly points the horn at [user.p_their()] temple! It looks like [user.p_theyre()] trying to commit suicide!") diff --git a/code/game/objects/items/storage/book.dm b/code/game/objects/items/storage/book.dm index 5e8b78769e..10b28e12f6 100644 --- a/code/game/objects/items/storage/book.dm +++ b/code/game/objects/items/storage/book.dm @@ -96,9 +96,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible", H.visible_message("[user] heals [H] with the power of [deity_name]!") to_chat(H, "May the power of [deity_name] compel you to be healed!") playsound(src.loc, "punch", 25, 1, -1) - GET_COMPONENT_FROM(mood, /datum/component/mood, H) - if(mood) - mood.add_event("blessing", /datum/mood_event/blessing) + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "blessing", /datum/mood_event/blessing) return 1 /obj/item/storage/book/bible/attack(mob/living/M, mob/living/carbon/human/user, heal_mode = TRUE) diff --git a/code/game/objects/items/weaponry.dm b/code/game/objects/items/weaponry.dm index c0802dfb55..bf67efa6c7 100644 --- a/code/game/objects/items/weaponry.dm +++ b/code/game/objects/items/weaponry.dm @@ -444,6 +444,10 @@ throw_range = 2 attack_verb = list("busted") +/obj/item/statuebust/Initialize() + . = ..() + addtimer(CALLBACK(src, /datum.proc/AddComponent, /datum/component/beauty, 1000), 0) + /obj/item/tailclub name = "tail club" desc = "For the beating to death of lizards with their own tails." diff --git a/code/game/objects/structures/flora.dm b/code/game/objects/structures/flora.dm index 7c99a715cd..7d827abbb1 100644 --- a/code/game/objects/structures/flora.dm +++ b/code/game/objects/structures/flora.dm @@ -291,6 +291,10 @@ throw_speed = 2 throw_range = 4 +/obj/item/twohanded/required/kirbyplants/Initialize() + . = ..() + addtimer(CALLBACK(src, /datum.proc/AddComponent, /datum/component/beauty, 750), 0) + /obj/item/twohanded/required/kirbyplants/equipped(mob/living/user) var/image/I = image(icon = 'icons/obj/flora/plants.dmi' , icon_state = src.icon_state, loc = user) I.copy_overlays(src) diff --git a/code/game/objects/structures/showcase.dm b/code/game/objects/structures/showcase.dm index a976c2e3fe..fe6785db2d 100644 --- a/code/game/objects/structures/showcase.dm +++ b/code/game/objects/structures/showcase.dm @@ -11,6 +11,10 @@ anchored = TRUE var/deconstruction_state = SHOWCASE_CONSTRUCTED +/obj/structure/showcase/Initialize() + . = ..() + addtimer(CALLBACK(src, /datum.proc/AddComponent, /datum/component/beauty, 750), 0) + /obj/structure/showcase/fakeid name = "\improper CentCom identification console" desc = "You can use this to change ID's." @@ -18,7 +22,7 @@ icon_state = "computer" /obj/structure/showcase/fakeid/Initialize() - ..() + . = ..() add_overlay("id") add_overlay("id_key") @@ -29,7 +33,7 @@ icon_state = "computer" /obj/structure/showcase/fakesec/Initialize() - ..() + . = ..() add_overlay("security") add_overlay("security_key") diff --git a/code/game/objects/structures/statues.dm b/code/game/objects/structures/statues.dm index e5ab4e5776..8a58cce1b0 100644 --- a/code/game/objects/structures/statues.dm +++ b/code/game/objects/structures/statues.dm @@ -10,6 +10,11 @@ var/material_drop_type = /obj/item/stack/sheet/metal CanAtmosPass = ATMOS_PASS_DENSITY + +/obj/structure/statue/Initialize() + . = ..() + addtimer(CALLBACK(src, /datum.proc/AddComponent, /datum/component/beauty, 1250), 0) + /obj/structure/statue/attackby(obj/item/W, mob/living/user, params) add_fingerprint(user) user.changeNext_move(CLICK_CD_MELEE) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 3f47c7d7df..c83aa0efc7 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -116,14 +116,7 @@ if(!ishuman(pushed_mob)) return var/mob/living/carbon/human/H = pushed_mob - GET_COMPONENT_FROM(mood, /datum/component/mood, H) - if(mood) - if(iscatperson(H)) //Catpeople are a bit dumb and think its fun to be on a table - mood.add_event("table", /datum/mood_event/happytable) - H.startTailWag() - addtimer(CALLBACK(H, /mob/living/carbon/human.proc/endTailWag), 30) - else - mood.add_event("table", /datum/mood_event/table) + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "table", /datum/mood_event/table) /obj/structure/table/attackby(obj/item/I, mob/user, params) if(!(flags_1 & NODECONSTRUCT_1)) diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 81a08c77a1..ec07a51380 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -335,9 +335,7 @@ L.ExtinguishMob() L.adjust_fire_stacks(-20) //Douse ourselves with water to avoid fire more easily L.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) - GET_COMPONENT_FROM(mood, /datum/component/mood, L) - if(mood) - mood.add_event("shower", /datum/mood_event/nice_shower) + L.SendSignal(COMSIG_ADD_MOOD_EVENT, "shower", /datum/mood_event/nice_shower) if(iscarbon(L)) var/mob/living/carbon/M = L . = TRUE diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm index fc0681148a..b8a05de431 100644 --- a/code/game/turfs/open.dm +++ b/code/game/turfs/open.dm @@ -203,9 +203,7 @@ if(!(lube&SLIDE_ICE)) playsound(C.loc, 'sound/misc/slip.ogg', 50, 1, -3) - GET_COMPONENT_FROM(mood, /datum/component/mood, C) - if(mood) - mood.add_event("slipped", /datum/mood_event/slipped) + C.SendSignal(COMSIG_ADD_MOOD_EVENT, "slipped", /datum/mood_event/slipped) for(var/obj/item/I in C.held_items) C.accident(I) diff --git a/code/modules/antagonists/_common/antag_datum.dm b/code/modules/antagonists/_common/antag_datum.dm index 8b603d109a..1ea471a346 100644 --- a/code/modules/antagonists/_common/antag_datum.dm +++ b/code/modules/antagonists/_common/antag_datum.dm @@ -109,16 +109,12 @@ GLOBAL_LIST_EMPTY(antagonists) /datum/antagonist/proc/give_antag_moodies() if(!antag_moodlet) return - GET_COMPONENT_FROM(mood, /datum/component/mood, owner.current) - if(mood) - mood.add_event("antag_moodlet", antag_moodlet) + owner.current.SendSignal(COMSIG_ADD_MOOD_EVENT, "antag_moodlet", antag_moodlet) /datum/antagonist/proc/clear_antag_moodies() if(!antag_moodlet) return - GET_COMPONENT_FROM(mood, /datum/component/mood, owner.current) - if(mood) - mood.add_event("antag_moodlet") + owner.current.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "antag_moodlet") //Returns the team antagonist belongs to if any. /datum/antagonist/proc/get_team() diff --git a/code/modules/client/verbs/suicide.dm b/code/modules/client/verbs/suicide.dm index 9471f0ab9e..2b5602833a 100644 --- a/code/modules/client/verbs/suicide.dm +++ b/code/modules/client/verbs/suicide.dm @@ -21,9 +21,7 @@ if(damagetype & SHAME) adjustStaminaLoss(200) suiciding = FALSE - GET_COMPONENT_FROM(mood, /datum/component/mood, src) - if(mood) - mood.add_event("shameful_suicide", /datum/mood_event/shameful_suicide) + SendSignal(COMSIG_ADD_MOOD_EVENT, "shameful_suicide", /datum/mood_event/shameful_suicide) return var/damage_mod = 0 for(var/T in list(BRUTELOSS, FIRELOSS, TOXLOSS, OXYLOSS)) diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm index 7ae401f564..d5e75d4bad 100644 --- a/code/modules/clothing/shoes/miscellaneous.dm +++ b/code/modules/clothing/shoes/miscellaneous.dm @@ -82,16 +82,12 @@ /obj/item/clothing/shoes/clown_shoes/equipped(mob/user, slot) . = ..() if(user.mind && user.mind.assigned_role == "Clown") - GET_COMPONENT_FROM(mood, /datum/component/mood, user) - if(mood) - mood.clear_event("noshoes") + user.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "noshoes") /obj/item/clothing/shoes/clown_shoes/dropped(mob/user) . = ..() if(user.mind && user.mind.assigned_role == "Clown") - GET_COMPONENT_FROM(mood, /datum/component/mood, user) - if(mood) - mood.add_event("noshoes", /datum/mood_event/noshoes) + user.SendSignal(COMSIG_ADD_MOOD_EVENT, "noshoes", /datum/mood_event/noshoes) /obj/item/clothing/shoes/clown_shoes/jester name = "jester shoes" diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index c912a9b4e8..26391c0957 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -870,12 +870,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( //Rare audio if("creepy") //These sounds are (mostly) taken from Hidden: Source - var/static/list/hallucinations_creepyasssounds = list('sound/effects/ghost.ogg', 'sound/effects/ghost2.ogg', 'sound/effects/heart_beat.ogg', 'sound/effects/screech.ogg',\ - 'sound/hallucinations/behind_you1.ogg', 'sound/hallucinations/behind_you2.ogg', 'sound/hallucinations/far_noise.ogg', 'sound/hallucinations/growl1.ogg', 'sound/hallucinations/growl2.ogg',\ - 'sound/hallucinations/growl3.ogg', 'sound/hallucinations/im_here1.ogg', 'sound/hallucinations/im_here2.ogg', 'sound/hallucinations/i_see_you1.ogg', 'sound/hallucinations/i_see_you2.ogg',\ - 'sound/hallucinations/look_up1.ogg', 'sound/hallucinations/look_up2.ogg', 'sound/hallucinations/over_here1.ogg', 'sound/hallucinations/over_here2.ogg', 'sound/hallucinations/over_here3.ogg',\ - 'sound/hallucinations/turn_around1.ogg', 'sound/hallucinations/turn_around2.ogg', 'sound/hallucinations/veryfar_noise.ogg', 'sound/hallucinations/wail.ogg') - target.playsound_local(null, pick(hallucinations_creepyasssounds), 50, 1) + target.playsound_local(null, pick(CREEPY_SOUNDS), 50, 1) if("ratvar") target.playsound_local(null, 'sound/effects/ratvar_rises.ogg', 100) sleep(150) diff --git a/code/modules/food_and_drinks/food.dm b/code/modules/food_and_drinks/food.dm index 4e38cb81d9..375ce80f96 100644 --- a/code/modules/food_and_drinks/food.dm +++ b/code/modules/food_and_drinks/food.dm @@ -23,21 +23,15 @@ if(foodtype & H.dna.species.toxic_food) to_chat(H,"What the hell was that thing?!") H.adjust_disgust(25 + 30 * fraction) - GET_COMPONENT_FROM(mood, /datum/component/mood, H) - if(mood) - mood.add_event("toxic_food", /datum/mood_event/disgusting_food) + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "toxic_food", /datum/mood_event/disgusting_food) else if(foodtype & H.dna.species.disliked_food) to_chat(H,"That didn't taste very good...") H.adjust_disgust(11 + 15 * fraction) - GET_COMPONENT_FROM(mood, /datum/component/mood, H) - if(mood) - mood.add_event("gross_food", /datum/mood_event/gross_food) + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "gross_food", /datum/mood_event/gross_food) else if(foodtype & H.dna.species.liked_food) to_chat(H,"I love this taste!") H.adjust_disgust(-5 + -2.5 * fraction) - GET_COMPONENT_FROM(mood, /datum/component/mood, H) - if(mood) - mood.add_event("fav_food", /datum/mood_event/favorite_food) + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "fav_food", /datum/mood_event/favorite_food) else if(foodtype & H.dna.species.toxic_food) to_chat(H, "You don't feel so good...") diff --git a/code/modules/food_and_drinks/food/snacks_pie.dm b/code/modules/food_and_drinks/food/snacks_pie.dm index 1f755e24b2..5efcb98faf 100644 --- a/code/modules/food_and_drinks/food/snacks_pie.dm +++ b/code/modules/food_and_drinks/food/snacks_pie.dm @@ -56,9 +56,7 @@ if(!H.creamed) // one layer at a time H.add_overlay(creamoverlay) H.creamed = TRUE - GET_COMPONENT_FROM(mood, /datum/component/mood, H) - if(mood) - mood.add_event("creampie", /datum/mood_event/creampie) + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "creampie", /datum/mood_event/creampie) qdel(src) /obj/item/reagent_containers/food/snacks/pie/cream/nostun diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index b302701b24..25b091d2c7 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -206,9 +206,7 @@ if(dat) user << browse("Penned by [author].
" + "[dat]", "window=book[window_size != null ? ";size=[window_size]" : ""]") user.visible_message("[user] opens a book titled \"[title]\" and begins reading intently.") - GET_COMPONENT_FROM(mood, /datum/component/mood, user) - if(mood) - mood.add_event("book_nerd", /datum/mood_event/book_nerd) + user.SendSignal(COMSIG_ADD_MOOD_EVENT, "book_nerd", /datum/mood_event/book_nerd) onclose(user, "book") else to_chat(user, "This book is completely blank!") diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 3b7e60213c..dc0b094128 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -755,17 +755,14 @@ //called when we get cuffed/uncuffed /mob/living/carbon/proc/update_handcuffed() - GET_COMPONENT_FROM(mood, /datum/component/mood, src) if(handcuffed) drop_all_held_items() stop_pulling() throw_alert("handcuffed", /obj/screen/alert/restrained/handcuffed, new_master = src.handcuffed) - if(mood) - mood.add_event("handcuffed", /datum/mood_event/handcuffed) + SendSignal(COMSIG_ADD_MOOD_EVENT, "handcuffed", /datum/mood_event/handcuffed) else clear_alert("handcuffed") - if(mood) - mood.clear_event("handcuffed") + SendSignal(COMSIG_CLEAR_MOOD_EVENT, "handcuffed") update_action_buttons_icon() //some of our action buttons might be unusable when we're handcuffed. update_inv_handcuffed() update_hud_handcuffed() diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 0444398fba..75233a70c1 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -277,9 +277,7 @@ else M.visible_message("[M] hugs [src] to make [p_them()] feel better!", \ "You hug [src] to make [p_them()] feel better!") - GET_COMPONENT_FROM(mood, /datum/component/mood, src) - if(mood) - mood.add_event("hug", /datum/mood_event/hug) + SendSignal(COMSIG_ADD_MOOD_EVENT, "hug", /datum/mood_event/hug) AdjustStun(-60) AdjustKnockdown(-60) AdjustUnconscious(-60) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 2bcb1d5189..22587d97d3 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -32,6 +32,7 @@ /mob/living/carbon/human/ComponentInitialize() + . = ..() if(!CONFIG_GET(flag/disable_human_mood)) AddComponent(/datum/component/mood) @@ -229,9 +230,7 @@ usr.visible_message("[usr] successfully rips [I] out of their [L.name]!","You successfully remove [I] from your [L.name].") if(!has_embedded_objects()) clear_alert("embeddedobject") - GET_COMPONENT_FROM(mood, /datum/component/mood, usr) - if(mood) - mood.clear_event("embeddedobject") + usr.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "embedded") return if(href_list["item"]) @@ -660,9 +659,7 @@ return src.visible_message("[src] performs CPR on [C.name]!", "You perform CPR on [C.name].") - GET_COMPONENT_FROM(mood, /datum/component/mood, src) - if(mood) - mood.add_event("perform_cpr", /datum/mood_event/perform_cpr) + SendSignal(COMSIG_ADD_MOOD_EVENT, "perform_cpr", /datum/mood_event/perform_cpr) C.cpr_time = world.time add_logs(src, C, "CPRed") diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index fd60a60296..b744630a56 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -144,9 +144,7 @@ I.forceMove(src) L.receive_damage(I.w_class*I.embedding.embedded_impact_pain_multiplier) visible_message("[I] embeds itself in [src]'s [L.name]!","[I] embeds itself in your [L.name]!") - GET_COMPONENT_FROM(mood, /datum/component/mood, src) - if(mood) - mood.add_event("embedded", /datum/mood_event/embedded) + SendSignal(COMSIG_ADD_MOOD_EVENT, "embedded", /datum/mood_event/embedded) hitpush = FALSE skipcatch = TRUE //can't catch the now embedded item diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 246e615199..55f66c975e 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -85,18 +85,15 @@ to_chat(src, "You don't feel like harming anybody.") a_intent_change(INTENT_HELP) - GET_COMPONENT_FROM(mood, /datum/component/mood, src) - if (getBrainLoss() >= 60 && stat == CONSCIOUS) - if(mood) - mood.add_event("brain_damage", /datum/mood_event/brain_damage) + if (getBrainLoss() >= 60 && !incapacitated(TRUE)) + SendSignal(COMSIG_ADD_MOOD_EVENT, "brain_damage", /datum/mood_event/brain_damage) if(prob(3)) if(prob(25)) emote("drool") else say(pick_list_replacements(BRAIN_DAMAGE_FILE, "brain_damage")) else - if(mood) - mood.clear_event("brain_damage") + SendSignal(COMSIG_CLEAR_MOOD_EVENT, "brain_damage") /mob/living/carbon/human/handle_mutations_and_radiation() if(!dna || !dna.species.handle_mutations_and_radiation(src)) @@ -343,9 +340,7 @@ visible_message("[I] falls out of [name]'s [BP.name]!","[I] falls out of your [BP.name]!") if(!has_embedded_objects()) clear_alert("embeddedobject") - GET_COMPONENT_FROM(mood, /datum/component/mood, src) - if(mood) - mood.clear_event("embedded") + SendSignal(COMSIG_CLEAR_MOOD_EVENT, "embedded") /mob/living/carbon/human/proc/handle_active_genes() for(var/datum/mutation/human/HM in dna.mutations) @@ -474,4 +469,4 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put #undef THERMAL_PROTECTION_ARM_LEFT #undef THERMAL_PROTECTION_ARM_RIGHT #undef THERMAL_PROTECTION_HAND_LEFT -#undef THERMAL_PROTECTION_HAND_RIGHT \ No newline at end of file +#undef THERMAL_PROTECTION_HAND_RIGHT diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 8b132f3b38..9e7a508579 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1124,14 +1124,8 @@ GLOBAL_LIST_EMPTY(roundstart_races) // THEY HUNGER var/hunger_rate = HUNGER_FACTOR GET_COMPONENT_FROM(mood, /datum/component/mood, H) - if(mood) - switch(mood.mood) //Alerts do_after delay based on how happy you are - if(MOOD_LEVEL_HAPPY2 to MOOD_LEVEL_HAPPY3) - hunger_rate *= 0.9 - if(MOOD_LEVEL_HAPPY3 to MOOD_LEVEL_HAPPY4) - hunger_rate *= 0.8 - if(MOOD_LEVEL_HAPPY4 to INFINITY) - hunger_rate *= 0.7 + if(mood && mood.sanity > SANITY_DISTURBED) + hunger_rate *= min(0.5, 1 - 0.002 * mood.sanity) //0.85 to 0.75 if(H.satiety > 0) H.satiety-- @@ -1166,31 +1160,24 @@ GLOBAL_LIST_EMPTY(roundstart_races) to_chat(H, "You no longer feel vigorous.") H.metabolism_efficiency = 1 - GET_COMPONENT_FROM(mood, /datum/component/mood, H) switch(H.nutrition) if(NUTRITION_LEVEL_FULL to INFINITY) - if(mood) - mood.add_event("nutrition", /datum/mood_event/nutrition/fat) + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "nutrition", /datum/mood_event/nutrition/fat) H.throw_alert("nutrition", /obj/screen/alert/fat) if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FULL) - if(mood) - mood.add_event("nutrition", /datum/mood_event/nutrition/wellfed) + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "nutrition", /datum/mood_event/nutrition/wellfed) H.clear_alert("nutrition") if( NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED) - if(mood) - mood.add_event("nutrition", /datum/mood_event/nutrition/fed) + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "nutrition", /datum/mood_event/nutrition/fed) H.clear_alert("nutrition") if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED) - if(mood) - mood.clear_event("nutrition") + H.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "nutrition") H.clear_alert("nutrition") if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY) - if(mood) - mood.add_event("nutrition", /datum/mood_event/nutrition/hungry) + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "nutrition", /datum/mood_event/nutrition/hungry) H.throw_alert("nutrition", /obj/screen/alert/hungry) if(0 to NUTRITION_LEVEL_STARVING) - if(mood) - mood.add_event("nutrition", /datum/mood_event/nutrition/starving) + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "nutrition", /datum/mood_event/nutrition/starving) H.throw_alert("nutrition", /obj/screen/alert/starving) /datum/species/proc/update_health_hud(mob/living/carbon/human/H) @@ -1300,12 +1287,12 @@ GLOBAL_LIST_EMPTY(roundstart_races) GET_COMPONENT_FROM(mood, /datum/component/mood, H) if(mood && !flight) //How can depression slow you down if you can just fly away from your problems? - switch(mood.mood) - if(-INFINITY to MOOD_LEVEL_SAD4) + switch(mood.sanity) + if(SANITY_INSANE to SANITY_CRAZY) . += 1.5 - if(MOOD_LEVEL_SAD4 to MOOD_LEVEL_SAD3) + if(SANITY_CRAZY to SANITY_UNSTABLE) . += 1 - if(MOOD_LEVEL_SAD3 to MOOD_LEVEL_SAD2) + if(SANITY_UNSTABLE to SANITY_DISTURBED) . += 0.5 if(H.has_trait(TRAIT_FAT)) @@ -1728,13 +1715,11 @@ GLOBAL_LIST_EMPTY(roundstart_races) H.adjust_bodytemperature(natural*(1/(thermal_protection+1)) + min(thermal_protection * (loc_temp - H.bodytemperature) / BODYTEMP_HEAT_DIVISOR, BODYTEMP_HEATING_MAX)) // +/- 50 degrees from 310K is the 'safe' zone, where no damage is dealt. - GET_COMPONENT_FROM(mood, /datum/component/mood, H) if(H.bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT && !H.has_trait(TRAIT_RESISTHEAT)) //Body temperature is too hot. var/burn_damage - if(mood) - mood.clear_event("cold") - mood.add_event("hot", /datum/mood_event/hot) + H.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "cold") + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "hot", /datum/mood_event/hot) switch(H.bodytemperature) if(BODYTEMP_HEAT_DAMAGE_LIMIT to 400) H.throw_alert("temp", /obj/screen/alert/hot, 1) @@ -1754,9 +1739,8 @@ GLOBAL_LIST_EMPTY(roundstart_races) H.apply_damage(burn_damage, BURN) else if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT && !(GLOB.mutations_list[COLDRES] in H.dna.mutations)) - if(mood) - mood.clear_event("hot") - mood.add_event("cold", /datum/mood_event/cold) + H.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "hot") + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "cold", /datum/mood_event/cold) switch(H.bodytemperature) if(200 to BODYTEMP_COLD_DAMAGE_LIMIT) H.throw_alert("temp", /obj/screen/alert/cold, 1) @@ -1770,9 +1754,8 @@ GLOBAL_LIST_EMPTY(roundstart_races) else H.clear_alert("temp") - if(mood) - mood.clear_event("cold") - mood.clear_event("hot") + H.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "cold") + H.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "hot") var/pressure = environment.return_pressure() var/adjusted_pressure = H.calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob. @@ -1866,7 +1849,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) H.adjust_bodytemperature(11) else H.adjust_bodytemperature(BODYTEMP_HEATING_MAX + (H.fire_stacks * 12)) - + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "on_fire", /datum/mood_event/on_fire) /datum/species/proc/CanIgniteMob(mob/living/carbon/human/H) if(H.has_trait(TRAIT_NOFIRE)) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index dc939f8fc1..42547e3544 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -144,7 +144,6 @@ //OXYGEN - GET_COMPONENT_FROM(mood, /datum/component/mood, src) if(O2_partialpressure < safe_oxy_min) //Not enough oxygen if(prob(20)) emote("gasp") @@ -157,8 +156,7 @@ adjustOxyLoss(3) failed_last_breath = 1 throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy) - if(mood) - mood.add_event("suffocation", /datum/mood_event/suffocation) + SendSignal(COMSIG_ADD_MOOD_EVENT, "suffocation", /datum/mood_event/suffocation) else //Enough oxygen failed_last_breath = 0 @@ -166,8 +164,7 @@ adjustOxyLoss(-5) oxygen_used = breath_gases[/datum/gas/oxygen][MOLES] clear_alert("not_enough_oxy") - if(mood) - mood.clear_event("suffocation") + SendSignal(COMSIG_CLEAR_MOOD_EVENT, "suffocation") breath_gases[/datum/gas/oxygen][MOLES] -= oxygen_used breath_gases[/datum/gas/carbon_dioxide][MOLES] += oxygen_used diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index a8f2e282ed..3baf5087d6 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -162,4 +162,4 @@ I.take_damage(fire_stacks, BURN, "fire", 0) adjust_bodytemperature(BODYTEMP_HEATING_MAX) - + SendSignal(COMSIG_ADD_MOOD_EVENT, "on_fire", /datum/mood_event/on_fire) diff --git a/code/modules/mob/living/carbon/status_procs.dm b/code/modules/mob/living/carbon/status_procs.dm index 1db31d5a2d..7a7a4681c5 100644 --- a/code/modules/mob/living/carbon/status_procs.dm +++ b/code/modules/mob/living/carbon/status_procs.dm @@ -42,17 +42,14 @@ /mob/living/carbon/adjust_drugginess(amount) druggy = max(druggy+amount, 0) - GET_COMPONENT_FROM(mood, /datum/component/mood, src) if(druggy) overlay_fullscreen("high", /obj/screen/fullscreen/high) throw_alert("high", /obj/screen/alert/high) - if(mood) - mood.add_event("high", /datum/mood_event/drugs/high) + SendSignal(COMSIG_ADD_MOOD_EVENT, "high", /datum/mood_event/drugs/high) else clear_fullscreen("high") clear_alert("high") - if(mood) - mood.clear_event("high") + SendSignal(COMSIG_CLEAR_MOOD_EVENT, "high") /mob/living/carbon/set_drugginess(amount) druggy = max(amount, 0) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 2ddd4281ae..933c25c992 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -984,9 +984,6 @@ "You're set on fire!") new/obj/effect/dummy/fire(src) throw_alert("fire", /obj/screen/alert/fire) - GET_COMPONENT_FROM(mood, /datum/component/mood, src) - if(mood) - mood.add_event("on_fire", /datum/mood_event/on_fire) update_fire() return TRUE return FALSE @@ -998,9 +995,7 @@ for(var/obj/effect/dummy/fire/F in src) qdel(F) clear_alert("fire") - GET_COMPONENT_FROM(mood, /datum/component/mood, src) - if(mood) - mood.clear_event("on_fire") + SendSignal(COMSIG_CLEAR_MOOD_EVENT, "on_fire") update_fire() /mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person diff --git a/code/modules/mob/living/simple_animal/friendly/dog.dm b/code/modules/mob/living/simple_animal/friendly/dog.dm index 4dab39e397..5c68ca8117 100644 --- a/code/modules/mob/living/simple_animal/friendly/dog.dm +++ b/code/modules/mob/living/simple_animal/friendly/dog.dm @@ -231,9 +231,7 @@ return if(!item_to_add) user.visible_message("[user] pets [src].","You rest your hand on [src]'s head for a moment.") - GET_COMPONENT_FROM(mood, /datum/component/mood, user) - if(mood) - mood.add_event("pet_corgi", /datum/mood_event/pet_corgi) + user.SendSignal(COMSIG_ADD_MOOD_EVENT, "pet_corgi", /datum/mood_event/pet_corgi) return if(user && !user.temporarilyRemoveItemFromInventory(item_to_add)) @@ -616,9 +614,7 @@ if(M && stat != DEAD) // Added check to see if this mob (the dog) is dead to fix issue 2454 new /obj/effect/temp_visual/heart(loc) emote("me", 1, "yaps happily!") - GET_COMPONENT_FROM(mood, /datum/component/mood, M) - if(mood) - mood.add_event("pet_corgi", /datum/mood_event/pet_corgi) + M.SendSignal(COMSIG_ADD_MOOD_EVENT, "pet_corgi", /datum/mood_event/pet_corgi) else if(M && stat != DEAD) // Same check here, even though emote checks it as well (poor form to check it only in the help case) emote("me", 1, "growls!") diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index d060286efb..5ed6b84a18 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -233,9 +233,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard) if(M.z == z) SEND_SOUND(M, 'sound/magic/charge.ogg') to_chat(M, "You feel reality distort for a moment...") - GET_COMPONENT_FROM(mood, /datum/component/mood, M) - if(mood) - mood.add_event("delam", /datum/mood_event/delam) + M.SendSignal(COMSIG_ADD_MOOD_EVENT, "delam", /datum/mood_event/delam) if(combined_gas > MOLE_PENALTY_THRESHOLD) investigate_log("has collapsed into a singularity.", INVESTIGATE_SUPERMATTER) if(T) diff --git a/code/modules/projectiles/projectile/energy/stun.dm b/code/modules/projectiles/projectile/energy/stun.dm index 3b04febae3..1c24d47a9d 100644 --- a/code/modules/projectiles/projectile/energy/stun.dm +++ b/code/modules/projectiles/projectile/energy/stun.dm @@ -18,9 +18,7 @@ do_sparks(1, TRUE, src) else if(iscarbon(target)) var/mob/living/carbon/C = target - GET_COMPONENT_FROM(mood, /datum/component/mood, C) - if(mood) - mood.add_event("tased", /datum/mood_event/tased) + C.SendSignal(COMSIG_ADD_MOOD_EVENT, "tased", /datum/mood_event/tased) if(C.dna && C.dna.check_mutation(HULK)) C.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" )) else if((C.status_flags & CANKNOCKDOWN) && !C.has_trait(TRAIT_STUNIMMUNE)) diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index 2a650f3381..d49c4a6fa0 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -303,9 +303,7 @@ need_mob_update += R.addiction_act_stage4(C) if(40 to INFINITY) to_chat(C, "You feel like you've gotten over your need for [R.name].") - 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. diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm index a1a65409a1..3fe5d47479 100644 --- a/code/modules/reagents/chemistry/reagents.dm +++ b/code/modules/reagents/chemistry/reagents.dm @@ -91,39 +91,29 @@ /datum/reagent/proc/overdose_start(mob/living/M) to_chat(M, "You feel like you took too much of [name]!") - 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, "You feel like having some [name] right about now.") 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, "You feel like you need [name]. You just can't get enough.") 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, "You have an intense craving for [name].") 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, "You're not feeling good at all! You really need some [name].") return diff --git a/code/modules/reagents/chemistry/reagents/drug_reagents.dm b/code/modules/reagents/chemistry/reagents/drug_reagents.dm index 22d638ea20..32b96d2780 100644 --- a/code/modules/reagents/chemistry/reagents/drug_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drug_reagents.dm @@ -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, "You start tripping hard!") - 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, "[smoke_message]") - 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) diff --git a/code/modules/spells/spell_types/mime.dm b/code/modules/spells/spell_types/mime.dm index d51f89be18..f6b1921e6c 100644 --- a/code/modules/spells/spell_types/mime.dm +++ b/code/modules/spells/spell_types/mime.dm @@ -56,15 +56,12 @@ /obj/effect/proc_holder/spell/targeted/mime/speak/cast(list/targets,mob/user = usr) for(var/mob/living/carbon/human/H in targets) H.mind.miming=!H.mind.miming - GET_COMPONENT_FROM(mood, /datum/component/mood, H) if(H.mind.miming) to_chat(H, "You make a vow of silence.") - if(mood) - mood.clear_event("vow") + H.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "vow") else + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "vow", /datum/mood_event/broken_vow) to_chat(H, "You break your vow of silence.") - if(mood) - mood.add_event("vow", /datum/mood_event/broken_vow) // These spells can only be gotten from the "Guide for Advanced Mimery series" for Mime Traitors. diff --git a/code/modules/spells/spell_types/summonitem.dm b/code/modules/spells/spell_types/summonitem.dm index d568aa67f4..bd5099da68 100644 --- a/code/modules/spells/spell_types/summonitem.dm +++ b/code/modules/spells/spell_types/summonitem.dm @@ -83,9 +83,7 @@ to_chat(C, "The [item_to_retrieve] that was embedded in your [L] has mysteriously vanished. How fortunate!") if(!C.has_embedded_objects()) C.clear_alert("embeddedobject") - GET_COMPONENT_FROM(mood, /datum/component/mood, C) - if(mood) - mood.clear_event("embedded") + C.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "embedded") break else diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index 5b128de600..aa0b714cc8 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -19,9 +19,7 @@ affecting.receive_damage(CLAMP(brute_dam/2, 15, 50), CLAMP(burn_dam/2, 0, 50)) //Damage the chest based on limb's existing damage C.visible_message("[C]'s [src.name] has been violently dismembered!") C.emote("scream") - GET_COMPONENT_FROM(mood, /datum/component/mood, C) - if(mood) - mood.add_event("dismembered", /datum/mood_event/dismembered) + C.SendSignal(COMSIG_ADD_MOOD_EVENT, "dismembered", /datum/mood_event/dismembered) drop_limb() if(dam_type == BURN) @@ -104,9 +102,7 @@ I.forceMove(src) if(!C.has_embedded_objects()) C.clear_alert("embeddedobject") - GET_COMPONENT_FROM(mood, /datum/component/mood, C) - if(mood) - mood.add_event("embedded") + C.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "embedded") if(!special) if(C.dna) diff --git a/code/modules/surgery/bodyparts/helpers.dm b/code/modules/surgery/bodyparts/helpers.dm index 36081ad677..12531a9ee5 100644 --- a/code/modules/surgery/bodyparts/helpers.dm +++ b/code/modules/surgery/bodyparts/helpers.dm @@ -121,9 +121,7 @@ I.forceMove(T) clear_alert("embeddedobject") - GET_COMPONENT_FROM(mood, /datum/component/mood, src) - if(mood) - mood.clear_event("embedded") + SendSignal(COMSIG_CLEAR_MOOD_EVENT, "embedded") /mob/living/carbon/proc/has_embedded_objects() . = 0 diff --git a/code/modules/surgery/organs/stomach.dm b/code/modules/surgery/organs/stomach.dm index e0d3dbb384..21b6f6abb3 100755 --- a/code/modules/surgery/organs/stomach.dm +++ b/code/modules/surgery/organs/stomach.dm @@ -36,33 +36,25 @@ H.blur_eyes(3) //We need to add more shit down here H.adjust_disgust(-0.5 * disgust_metabolism) - GET_COMPONENT_FROM(mood, /datum/component/mood, H) switch(H.disgust) if(0 to DISGUST_LEVEL_GROSS) H.clear_alert("disgust") - if(mood) - mood.clear_event("disgust") + H.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "disgust") if(DISGUST_LEVEL_GROSS to DISGUST_LEVEL_VERYGROSS) H.throw_alert("disgust", /obj/screen/alert/gross) - if(mood) - mood.add_event("disgust", /datum/mood_event/disgust/gross) + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "disgust", /datum/mood_event/disgust/gross) if(DISGUST_LEVEL_VERYGROSS to DISGUST_LEVEL_DISGUSTED) H.throw_alert("disgust", /obj/screen/alert/verygross) - if(mood) - mood.add_event("disgust", /datum/mood_event/disgust/verygross) + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "disgust", /datum/mood_event/disgust/verygross) if(DISGUST_LEVEL_DISGUSTED to INFINITY) H.throw_alert("disgust", /obj/screen/alert/disgusted) - if(mood) - mood.add_event("disgust", /datum/mood_event/disgust/disgusted) + H.SendSignal(COMSIG_ADD_MOOD_EVENT, "disgust", /datum/mood_event/disgust/disgusted) /obj/item/organ/stomach/Remove(mob/living/carbon/M, special = 0) var/mob/living/carbon/human/H = owner if(istype(H)) H.clear_alert("disgust") - GET_COMPONENT_FROM(mood, /datum/component/mood, H) - if(mood) - mood.clear_event("disgust") - + H.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "disgust") ..() /obj/item/organ/stomach/fly diff --git a/code/modules/surgery/remove_embedded_object.dm b/code/modules/surgery/remove_embedded_object.dm index 2818ea2ab5..548a73627d 100644 --- a/code/modules/surgery/remove_embedded_object.dm +++ b/code/modules/surgery/remove_embedded_object.dm @@ -30,9 +30,7 @@ L.embedded_objects -= I if(!H.has_embedded_objects()) H.clear_alert("embeddedobject") - GET_COMPONENT_FROM(mood, /datum/component/mood, H) - if(mood) - mood.clear_event("embedded") + H.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "embedded") if(objects > 0) user.visible_message("[user] successfully removes [objects] objects from [H]'s [L]!", "You successfully remove [objects] objects from [H]'s [L.name].") diff --git a/icons/mob/screen_gen.dmi b/icons/mob/screen_gen.dmi index 2c234e9894..28e37d526c 100644 Binary files a/icons/mob/screen_gen.dmi and b/icons/mob/screen_gen.dmi differ diff --git a/tgstation.dme b/tgstation.dme index bfcc32cf67..e57765a3dc 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -314,6 +314,7 @@ #include "code\datums\components\_component.dm" #include "code\datums\components\anti_magic.dm" #include "code\datums\components\archaeology.dm" +#include "code\datums\components\beauty.dm" #include "code\datums\components\butchering.dm" #include "code\datums\components\caltrop.dm" #include "code\datums\components\chasm.dm" @@ -408,6 +409,7 @@ #include "code\datums\martial\psychotic_brawl.dm" #include "code\datums\martial\sleeping_carp.dm" #include "code\datums\martial\wrestling.dm" +#include "code\datums\mood_events\beauty_events.dm" #include "code\datums\mood_events\drug_events.dm" #include "code\datums\mood_events\generic_negative_events.dm" #include "code\datums\mood_events\generic_positive_events.dm"