Accentuate the positive with **Personality**: A (soft) mood rework (#92941)

Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
This commit is contained in:
MrMelbert
2025-10-02 19:00:13 +00:00
committed by GitHub
co-authored by SmArtKar
parent 0124adacc7
commit 3ea7b03369
110 changed files with 2557 additions and 314 deletions
@@ -27,7 +27,7 @@
//Gondolas aren't affected by cold.
unsuitable_atmos_damage = 0
basic_mob_flags = DEL_ON_DEATH
basic_mob_flags = SENDS_DEATH_MOODLETS|DEL_ON_DEATH
///List of loot drops on death, since it deletes itself on death (like trooper).
var/list/loot = list(
+1 -7
View File
@@ -3,12 +3,6 @@
mob_size = MOB_SIZE_SMALL
mob_biotypes = MOB_ORGANIC|MOB_BEAST
blood_volume = BLOOD_VOLUME_NORMAL
basic_mob_flags = SENDS_DEATH_MOODLETS
/// if the mob is protected from being renamed by collars.
var/unique_pet = FALSE
/mob/living/basic/pet/death(gibbed)
. = ..()
add_memory_in_range(src, 7, /datum/memory/pet_died, deuteragonist = src) //Protagonist is the person memorizing it
-3
View File
@@ -4,8 +4,6 @@
losebreath = 0
breathing_loop.stop() //This would've happened eventually but it's nice to make it stop immediatelly in this case
if(!gibbed)
add_memory_in_range(src, 7, /datum/memory/witnessed_death, protagonist = src)
reagents.end_metabolization(src)
. = ..()
@@ -18,7 +16,6 @@
BT.on_death()
/mob/living/carbon/gib(drop_bitflags=NONE)
add_memory_in_range(src, 7, /datum/memory/witness_gib, protagonist = src)
if(drop_bitflags & DROP_ITEMS)
for(var/obj/item/W in src)
if(dropItemToGround(W))
+1 -1
View File
@@ -230,7 +230,7 @@
living_user.add_mood_event("encountered_evil", /datum/mood_event/encountered_evil)
living_user.set_jitter_if_lower(15 SECONDS)
if(HAS_TRAIT(user, TRAIT_SPIRITUAL) && mind?.holy_role)
if(HAS_TRAIT(user, TRAIT_SPIRITUAL) && mind?.holy_role && user != src)
. += "[t_He] [t_has] a holy aura about [t_him]."
living_user.add_mood_event("religious_comfort", /datum/mood_event/religiously_comforted)
@@ -306,6 +306,9 @@
for(var/datum/quirk/original_quircks as anything in quirks)
clone.add_quirk(original_quircks.type, override_client = client, announce = FALSE)
for(var/personality_type in personalities)
clone.add_personality(personality_type)
clone.updateappearance(mutcolor_update = TRUE, mutations_overlay_update = TRUE)
return clone
+48 -2
View File
@@ -17,6 +17,7 @@
if(stat != DEAD)
death(TRUE)
send_death_moodlets(/datum/mood_event/see_death)
ghostize()
spill_organs(drop_bitflags)
@@ -102,6 +103,8 @@
// keep us upright so the animation fits.
ADD_TRAIT(src, TRAIT_FORCED_STANDING, TRAIT_GENERIC)
send_death_moodlets(/datum/mood_event/see_death/dusted)
if(drop_items)
unequip_everything()
@@ -160,6 +163,47 @@
ash.pixel_z = -5
ash.pixel_w = rand(-1, 1)
/**
* Sends a moodlet to all nearby living mobs that are not blind or unconscious
* to indicate that they saw this mob die (and thus feel bad about it)
*
* Note: If the mob already has a death moodlet, and the same moodlet is applied, the existing moodlet will simply worsen.
* Note: If the mob has a death moodlet, and a worse moodlet is applied, the worse moodlet will take priority.
*
* Arguments:
* * moodlet - The type of moodlet to send. Defaults to [/datum/mood_event/see_death]
*/
/mob/living/proc/send_death_moodlets(datum/mood_event/moodlet = /datum/mood_event/see_death)
if(flags_1 & HOLOGRAM_1)
return
for(var/mob/living/nearby in viewers(src))
if(nearby.stat >= UNCONSCIOUS || nearby.is_blind())
continue
nearby.add_mood_event("saw_death", moodlet, src)
/mob/living/silicon/send_death_moodlets(datum/mood_event/moodlet)
return // You are a machine
/mob/living/basic/send_death_moodlets(datum/mood_event/moodlet)
if(!(basic_mob_flags & SENDS_DEATH_MOODLETS))
return
. = ..()
add_memory_in_range(src, 7, /datum/memory/pet_died, deuteragonist = src) //Protagonist is the person memorizing it
/mob/living/simple_animal/send_death_moodlets(datum/mood_event/moodlet)
return // I don't care about you anymore
/mob/living/carbon/human/send_death_moodlets(datum/mood_event/moodlet)
for(var/datum/surgery/organ_manipulation/manipulation in surgeries)
// This check exists so debraining someone doesn't make the surgeon super sad
if(manipulation.location == BODY_ZONE_HEAD && body_position == LYING_DOWN)
return
. = ..()
var/memory_type = ispath(moodlet, /datum/mood_event/see_death/gibbed) ? /datum/memory/witness_gib : /datum/memory/witnessed_death
add_memory_in_range(src, 7, memory_type, protagonist = src)
/*
* Called when the mob dies. Can also be called manually to kill a mob.
*
@@ -170,8 +214,10 @@
if(stat == DEAD)
return FALSE
if(!gibbed && (death_sound || death_message || (living_flags & ALWAYS_DEATHGASP)))
INVOKE_ASYNC(src, TYPE_PROC_REF(/mob, emote), "deathgasp")
if(!gibbed)
if(death_sound || death_message || (living_flags & ALWAYS_DEATHGASP))
INVOKE_ASYNC(src, TYPE_PROC_REF(/mob, emote), "deathgasp")
send_death_moodlets(/datum/mood_event/see_death)
set_stat(DEAD)
timeofdeath = world.time
+4 -3
View File
@@ -33,8 +33,9 @@
else
effect.be_replaced()
if(buckled)
buckled.unbuckle_mob(src,force=1)
clear_personalities() // must be done for the personalities which process
buckled?.unbuckle_mob(src,force=1)
remove_from_all_data_huds()
GLOB.mob_living_list -= src
@@ -43,7 +44,7 @@
QDEL_LIST(imaginary_group)
QDEL_LAZYLIST(diseases)
QDEL_LIST(surgeries)
QDEL_LIST(quirks)
QDEL_LAZYLIST(quirks)
return ..()
/mob/living/onZImpact(turf/impacted_turf, levels, impact_flags = NONE)
+5 -1
View File
@@ -89,7 +89,11 @@
*/
var/incorporeal_move = FALSE
var/list/quirks = list()
/// Lazylist of all quirks the mob has. These are not singletons
var/list/quirks
/// Lazylist of all typepaths of personalities the mob has.
var/list/personalities
///a list of surgery datums. generally empty, they're added when the player wants them.
var/list/surgeries = list()
///Mob specific surgery speed modifier
+22
View File
@@ -489,6 +489,26 @@
return quirk
return null
/// Helper to easily add a personality by a typepath
/mob/living/proc/add_personality(personality_type)
var/datum/personality/personality = SSpersonalities.personalities_by_type[personality_type]
personality.apply_to_mob(src)
/// Helper to easily add multiple personalities by a list of typepaths
/mob/living/proc/add_personalities(list/new_personalities)
for(var/personality_type in new_personalities)
add_personality(personality_type)
/// Helper to easily remove a personality by a typepath
/mob/living/proc/remove_personality(personality_type)
var/datum/personality/personality = SSpersonalities.personalities_by_type[personality_type]
personality.remove_from_mob(src)
/// Helper to clear all personalities from a mob
/mob/living/proc/clear_personalities()
for(var/personality_type in personalities)
remove_personality(personality_type)
/mob/living/proc/cure_husk(source)
REMOVE_TRAIT(src, TRAIT_HUSK, source)
if(HAS_TRAIT(src, TRAIT_HUSK))
@@ -526,6 +546,8 @@
emote("deathgasp")
station_timestamp_timeofdeath = station_time_timestamp()
if(!HAS_TRAIT(src, TRAIT_FAKEDEATH) && !silent)
send_death_moodlets(/datum/mood_event/see_death)
add_traits(list(TRAIT_FAKEDEATH, TRAIT_DEATHCOMA), source)
///Unignores all slowdowns that lack the IGNORE_NOSLOW flag.