[reviewpls] Adds moodlets to the game - [Please give suggestions for trait additions in comments]

This commit is contained in:
Qustinnus
2018-03-08 02:15:57 +01:00
committed by CitadelStationBot
parent 4d0b7133c8
commit a96a28f3d6
86 changed files with 1220 additions and 43 deletions

View File

@@ -738,12 +738,17 @@
//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)
else
clear_alert("handcuffed")
if(mood)
mood.clear_event("handcuffed")
update_action_buttons_icon() //some of our action buttons might be unusable when we're handcuffed.
update_inv_handcuffed()
update_hud_handcuffed()

View File

@@ -266,6 +266,9 @@
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)
AdjustStun(-60)
AdjustKnockdown(-60)
AdjustUnconscious(-60)

View File

@@ -89,7 +89,21 @@
if(digitalcamo)
msg += "[t_He] [t_is] moving [t_his] body in an unnatural and blatantly unsimian manner.\n"
GET_COMPONENT_FROM(mood, /datum/component/mood, src)
if(mood)
switch(mood.shown_mood)
if(-INFINITY to MOOD_LEVEL_SAD4)
msg += "[t_He] look[p_s()] depressed.\n"
if(MOOD_LEVEL_SAD4 to MOOD_LEVEL_SAD3)
msg += "[t_He] look[p_s()] very sad.\n"
if(MOOD_LEVEL_SAD3 to MOOD_LEVEL_SAD2)
msg += "[t_He] look[p_s()] a bit down.\n"
if(MOOD_LEVEL_HAPPY2 to MOOD_LEVEL_HAPPY3)
msg += "[t_He] look[p_s()] quite happy.\n"
if(MOOD_LEVEL_HAPPY3 to MOOD_LEVEL_HAPPY4)
msg += "[t_He] look[p_s()] very happy.\n"
if(MOOD_LEVEL_HAPPY4 to INFINITY)
msg += "[t_He] look[p_s()] ecstatic.\n"
msg += "*---------*</span>"

View File

@@ -30,11 +30,17 @@
AddComponent(/datum/component/redirect, list(COMSIG_COMPONENT_CLEAN_ACT), CALLBACK(src, .proc/clean_blood))
/mob/living/carbon/human/ComponentInitialize()
if(!CONFIG_GET(flag/disable_human_mood))
AddComponent(/datum/component/mood)
/mob/living/carbon/human/Destroy()
QDEL_NULL(physiology)
QDEL_NULL_LIST(vore_organs) // CITADEL EDIT belly stuff
return ..()
/mob/living/carbon/human/OpenCraftingMenu()
handcrafting.ui_interact(src)
@@ -223,6 +229,9 @@
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")
return
if(href_list["item"])
@@ -651,6 +660,9 @@
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)
C.cpr_time = world.time
add_logs(src, C, "CPRed")

View File

@@ -144,6 +144,9 @@
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)
hitpush = FALSE
skipcatch = TRUE //can't catch the now embedded item

View File

@@ -85,6 +85,19 @@
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(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")
/mob/living/carbon/human/handle_mutations_and_radiation()
if(!dna || !dna.species.handle_mutations_and_radiation(src))
..()
@@ -330,6 +343,9 @@
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")
/mob/living/carbon/human/proc/handle_active_genes()
for(var/datum/mutation/human/HM in dna.mutations)

View File

@@ -1121,6 +1121,16 @@ GLOBAL_LIST_EMPTY(roundstart_races)
if (H.nutrition > 0 && H.stat != DEAD && !H.has_trait(TRAIT_NOHUNGER))
// 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(H.satiety > 0)
H.satiety--
if(H.satiety < 0)
@@ -1154,14 +1164,31 @@ 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.throw_alert("nutrition", /obj/screen/alert/fat)
if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FULL)
if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FULL)
if(mood)
mood.add_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.clear_alert("nutrition")
if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED)
if(mood)
mood.clear_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.throw_alert("nutrition", /obj/screen/alert/hungry)
else
if(0 to NUTRITION_LEVEL_STARVING)
if(mood)
mood.add_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)
@@ -1262,14 +1289,22 @@ GLOBAL_LIST_EMPTY(roundstart_races)
if(I.flags_2 & SLOWS_WHILE_IN_HAND_2)
. += I.slowdown
var/health_deficiency = (100 - H.health + H.staminaloss)
var/hungry = (500 - H.nutrition) / 5 // So overeat would be 100 and default level would be 80
if(health_deficiency >= 40)
if(flight)
. += (health_deficiency / 75)
else
. += (health_deficiency / 25)
if((hungry >= 70) && !flight) //Being hungry won't stop you from using flightpack controls/flapping your wings although it probably will in the wing case but who cares.
. += hungry / 50
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)
. += 1.5
if(MOOD_LEVEL_SAD4 to MOOD_LEVEL_SAD3)
. += 1
if(MOOD_LEVEL_SAD3 to MOOD_LEVEL_SAD2)
. += 0.5
if(H.has_trait(TRAIT_FAT))
. += (1.5 - flight)
if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT)
@@ -1621,6 +1656,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
if(H.has_trait(TRAIT_NOBREATH))
return TRUE
/datum/species/proc/handle_environment(datum/gas_mixture/environment, mob/living/carbon/human/H)
if(!environment)
return
@@ -1650,9 +1686,13 @@ 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)
switch(H.bodytemperature)
if(BODYTEMP_HEAT_DAMAGE_LIMIT to 400)
H.throw_alert("temp", /obj/screen/alert/hot, 1)
@@ -1670,7 +1710,11 @@ GLOBAL_LIST_EMPTY(roundstart_races)
if (H.stat < UNCONSCIOUS && (prob(burn_damage) * 10) / 4) //40% for level 3 damage on humans
H.emote("scream")
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)
switch(H.bodytemperature)
if(200 to BODYTEMP_COLD_DAMAGE_LIMIT)
H.throw_alert("temp", /obj/screen/alert/cold, 1)
@@ -1684,6 +1728,9 @@ GLOBAL_LIST_EMPTY(roundstart_races)
else
H.clear_alert("temp")
if(mood)
mood.clear_event("cold")
mood.clear_event("hot")
var/pressure = environment.return_pressure()
var/adjusted_pressure = H.calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob.
@@ -1778,6 +1825,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
else
H.adjust_bodytemperature(BODYTEMP_HEATING_MAX + (H.fire_stacks * 12))
/datum/species/proc/CanIgniteMob(mob/living/carbon/human/H)
if(H.has_trait(TRAIT_NOFIRE))
return FALSE

View File

@@ -144,6 +144,7 @@
//OXYGEN
GET_COMPONENT_FROM(mood, /datum/component/mood, src)
if(O2_partialpressure < safe_oxy_min) //Not enough oxygen
if(prob(20))
emote("gasp")
@@ -156,6 +157,8 @@
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)
else //Enough oxygen
failed_last_breath = 0
@@ -163,6 +166,8 @@
adjustOxyLoss(-5)
oxygen_used = breath_gases[/datum/gas/oxygen][MOLES]
clear_alert("not_enough_oxy")
if(mood)
mood.clear_event("suffocation")
breath_gases[/datum/gas/oxygen][MOLES] -= oxygen_used
breath_gases[/datum/gas/carbon_dioxide][MOLES] += oxygen_used

View File

@@ -42,12 +42,17 @@
/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)
else
clear_fullscreen("high")
clear_alert("high")
if(mood)
mood.clear_event("high")
/mob/living/carbon/set_drugginess(amount)
druggy = max(amount, 0)
@@ -97,4 +102,3 @@
var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN)
if(B)
. = B.cure_all_traumas(resilience)

View File

@@ -952,6 +952,9 @@
"<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
@@ -963,6 +966,9 @@
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")
update_fire()
/mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person

View File

@@ -58,3 +58,4 @@
icon = 'icons/effects/blood.dmi'
icon_state = "xfloor1"
random_icon_states = list("xfloor1", "xfloor2", "xfloor3", "xfloor4", "xfloor5", "xfloor6", "xfloor7")
beauty = -300

View File

@@ -231,6 +231,9 @@
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)
return
if(user && !user.temporarilyRemoveItemFromInventory(item_to_add))
@@ -613,6 +616,9 @@
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)
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!")

View File

@@ -66,6 +66,7 @@
desc = "A small pool of sludge, containing trace amounts of leaper venom."
icon = 'icons/effects/tomatodecal.dmi'
icon_state = "tomato_floor1"
beauty = -200
/obj/structure/leaper_bubble
name = "leaper bubble"