diff --git a/code/datums/components/mood.dm b/code/datums/components/mood.dm index 1e11c02a9af..6b3a8dd1f86 100644 --- a/code/datums/components/mood.dm +++ b/code/datums/components/mood.dm @@ -370,7 +370,8 @@ /datum/component/mood/proc/check_area_mood(datum/source, var/area/A) SIGNAL_HANDLER - if(A.mood_bonus) + + if(A.mood_check()) if(get_event("area")) //walking between areas that give mood bonus should first clear the bonus from the previous one clear_event(null, "area") add_event(null, "area", /datum/mood_event/area, list(A.mood_bonus, A.mood_message)) diff --git a/code/game/area/Space_Station_13_areas.dm b/code/game/area/Space_Station_13_areas.dm index 719fc912d79..02a4c9b077e 100644 --- a/code/game/area/Space_Station_13_areas.dm +++ b/code/game/area/Space_Station_13_areas.dm @@ -601,6 +601,19 @@ NOTE: there are two lists of areas in the end of this file: centcom and station lighting_colour_bulb = "#ffebc1" sound_environment = SOUND_AREA_WOODFLOOR +<<<<<<< HEAD +======= +/area/crew_quarters/bar/mood_check(mob/living/carbon/human/subject) + . = ..() + if (HAS_TRAIT(subject, TRAIT_LIGHT_DRINKER)) + . = FALSE + +/area/crew_quarters/bar/lounge + name = "Bar lounge" + icon_state = "lounge" + sound_environment = SOUND_AREA_SMALL_SOFTFLOOR + +>>>>>>> 815472638b... Refactors area moods to optionally restrict to jobs (+ new area moods!) (#7502) /area/crew_quarters/bar/Initialize(mapload) . = ..() GLOB.bar_areas += src @@ -991,6 +1004,9 @@ NOTE: there are two lists of areas in the end of this file: centcom and station name = "Brig" icon_state = "brig" mood_bonus = -3 + mood_job_allowed = list(JOB_NAME_HEADOFSECURITY,JOB_NAME_WARDEN,JOB_NAME_SECURITYOFFICER,JOB_NAME_BRIGPHYSICIAN,JOB_NAME_DETECTIVE) + mood_job_reverse = TRUE + mood_message = "I hate cramped brig cells.\n" /area/security/courtroom @@ -1002,6 +1018,8 @@ NOTE: there are two lists of areas in the end of this file: centcom and station name = "Prison Wing" icon_state = "sec_prison" mood_bonus = -4 + mood_job_allowed = list(JOB_NAME_HEADOFSECURITY,JOB_NAME_WARDEN, JOB_NAME_SECURITYOFFICER) // JUSTICE! + mood_job_reverse = TRUE mood_message = "I'm trapped here with little hope of escape!\n" /area/security/processing @@ -1379,6 +1397,9 @@ NOTE: there are two lists of areas in the end of this file: centcom and station name = "Armory" icon_state = "armory" ambience_index = AMBIENCE_DANGER + mood_job_allowed = list(JOB_NAME_WARDEN) + mood_bonus = 1 + mood_message = "It's good to be home." /area/ai_monitored/storage/eva name = "EVA Storage" @@ -1399,6 +1420,9 @@ NOTE: there are two lists of areas in the end of this file: centcom and station name = "AI Upload Chamber" icon_state = "ai_upload" sound_environment = SOUND_AREA_SMALL_ENCLOSED + mood_job_allowed = list(JOB_NAME_RESEARCHDIRECTOR, JOB_NAME_CAPTAIN) + mood_bonus = 4 + mood_message = "The AI will bend to my will!\n" /area/ai_monitored/turret_protected/ai_upload_foyer name = "AI Upload Access" @@ -1460,6 +1484,9 @@ NOTE: there are two lists of areas in the end of this file: centcom and station name = "Telecomms Control Room" icon_state = "tcomsatcomp" sound_environment = SOUND_AREA_MEDIUM_SOFTFLOOR + mood_job_allowed = list(JOB_NAME_CHIEFENGINEER, JOB_NAME_STATIONENGINEER) + mood_bonus = 2 + mood_message = "It's good to see these in working order.\n" /area/tcommsat/server name = "Telecomms Server Room" diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index da09f8c6d84..2bbece5ff38 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -33,6 +33,10 @@ var/mood_bonus = 0 //Mood for being here var/mood_message = "This area is pretty nice!\n" //Mood message for being here, only shows up if mood_bonus != 0 + /// if defined, restricts what jobs get this buff using JOB_NAME defines (-candycane/etherware) + var/list/mood_job_allowed = null + /// if true, mood_job_allowed will represent jobs exempt from getting the mood. + var/mood_job_reverse = FALSE ///Will objects this area be needing power? var/requires_power = TRUE @@ -720,3 +724,17 @@ GLOBAL_LIST_EMPTY(teleportlocs) /area/get_virtual_z_level() return get_virtual_z(get_turf(src)) + +/// if it returns true, the mood effect assigned to the area is defined. Defaults to checking mood_job_allowed +/area/proc/mood_check(mob/living/carbon/human/subject) + if(!mood_bonus) + return FALSE + + . = TRUE + + if(!length(mood_job_allowed)) + return . + if(!(subject.mind?.assigned_role in mood_job_allowed)) + . = FALSE + if(mood_job_reverse) + return !. // the most eye bleeding syntax ive written