[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
@@ -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()
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -23,21 +23,15 @@
|
||||
if(foodtype & H.dna.species.toxic_food)
|
||||
to_chat(H,"<span class='warning'>What the hell was that thing?!</span>")
|
||||
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,"<span class='notice'>That didn't taste very good...</span>")
|
||||
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,"<span class='notice'>I love this taste!</span>")
|
||||
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, "<span class='warning'>You don't feel so good...</span>")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -206,9 +206,7 @@
|
||||
if(dat)
|
||||
user << browse("<TT><I>Penned by [author].</I></TT> <BR>" + "[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, "<span class='notice'>This book is completely blank!</span>")
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -277,9 +277,7 @@
|
||||
else
|
||||
M.visible_message("<span class='notice'>[M] hugs [src] to make [p_them()] feel better!</span>", \
|
||||
"<span class='notice'>You hug [src] to make [p_them()] feel better!</span>")
|
||||
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)
|
||||
|
||||
@@ -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]!","<span class='notice'>You successfully remove [I] from your [L.name].</span>")
|
||||
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]!", "<span class='notice'>You perform CPR on [C.name].</span>")
|
||||
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")
|
||||
|
||||
|
||||
@@ -144,9 +144,7 @@
|
||||
I.forceMove(src)
|
||||
L.receive_damage(I.w_class*I.embedding.embedded_impact_pain_multiplier)
|
||||
visible_message("<span class='danger'>[I] embeds itself in [src]'s [L.name]!</span>","<span class='userdanger'>[I] embeds itself in your [L.name]!</span>")
|
||||
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
|
||||
|
||||
|
||||
@@ -85,18 +85,15 @@
|
||||
to_chat(src, "<span class='notice'>You don't feel like harming anybody.</span>")
|
||||
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("<span class='danger'>[I] falls out of [name]'s [BP.name]!</span>","<span class='userdanger'>[I] falls out of your [BP.name]!</span>")
|
||||
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
|
||||
#undef THERMAL_PROTECTION_HAND_RIGHT
|
||||
|
||||
@@ -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, "<span class='notice'>You no longer feel vigorous.</span>")
|
||||
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))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -984,9 +984,6 @@
|
||||
"<span class='userdanger'>You're set on fire!</span>")
|
||||
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
|
||||
|
||||
@@ -231,9 +231,7 @@
|
||||
return
|
||||
if(!item_to_add)
|
||||
user.visible_message("[user] pets [src].","<span class='notice'>You rest your hand on [src]'s head for a moment.</span>")
|
||||
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!")
|
||||
|
||||
@@ -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, "<span class='boldannounce'>You feel reality distort for a moment...</span>")
|
||||
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)
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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, "<span class='notice'>You make a vow of silence.</span>")
|
||||
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, "<span class='notice'>You break your vow of silence.</span>")
|
||||
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.
|
||||
|
||||
|
||||
@@ -83,9 +83,7 @@
|
||||
to_chat(C, "<span class='warning'>The [item_to_retrieve] that was embedded in your [L] has mysteriously vanished. How fortunate!</span>")
|
||||
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
|
||||
|
||||
@@ -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("<span class='danger'><B>[C]'s [src.name] has been violently dismembered!</B></span>")
|
||||
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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]!", "<span class='notice'>You successfully remove [objects] objects from [H]'s [L.name].</span>")
|
||||
|
||||
Reference in New Issue
Block a user