Reverts #68155 (Fix simple mob deaths causing deadchat notifications), Fixes living level mobs being able to die while dead (#70103)

This commit is contained in:
MrMelbert
2022-09-27 22:33:27 -07:00
committed by GitHub
parent a2a2c2da24
commit cf0f039c8e
11 changed files with 20 additions and 19 deletions
+3
View File
@@ -126,6 +126,9 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define AREA_USES_STARLIGHT (1<<14)
/// If engravings are persistent in this area
#define PERSISTENT_ENGRAVINGS (1<<15)
/// Mobs that die in this area don't produce a dead chat message
#define NO_DEATH_MESSAGE (1<<16)
/*
These defines are used specifically with the atom/pass_flags bitmask
the atom/checkpass() proc uses them (tables will call movable atom checkpass(PASSTABLE) for example)
-2
View File
@@ -381,8 +381,6 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_BLUSHING "blushing"
/// This person is crying
#define TRAIT_CRYING "crying"
/// For simple mobs controlled by a player. Sends a death alert in deadchat (used by space dragons, morphs, revenants, elite lavaland mobs, brood spiders)
#define TRAIT_ALERT_GHOSTS_ON_DEATH "trait_alert_ghosts_on_death"
#define TRAIT_NOBLEED "nobleed" //This carbon doesn't bleed
/// This atom can ignore the "is on a turf" check for simple AI datum attacks, allowing them to attack from bags or lockers as long as any other conditions are met
#define TRAIT_AI_BAGATTACK "bagattack"
+5 -5
View File
@@ -51,22 +51,22 @@ DEFINE_BITFIELD(appearance_flags, list(
DEFINE_BITFIELD(area_flags, list(
"ABDUCTOR_PROOF" = ABDUCTOR_PROOF,
"AREA_USES_STARLIGHT" = AREA_USES_STARLIGHT,
"BLOBS_ALLOWED" = BLOBS_ALLOWED,
"BLOCK_SUICIDE" = BLOCK_SUICIDE,
"CAVES_ALLOWED" = CAVES_ALLOWED,
"CULT_PERMITTED" = CULT_PERMITTED,
"FLORA_ALLOWED" = FLORA_ALLOWED,
"HIDDEN_AREA" = HIDDEN_AREA,
"MEGAFAUNA_SPAWN_ALLOWED" = MEGAFAUNA_SPAWN_ALLOWED,
"MOB_SPAWN_ALLOWED" = MOB_SPAWN_ALLOWED,
"NO_ALERTS" = NO_ALERTS,
"NOTELEPORT" = NOTELEPORT,
"CAVES_ALLOWED" = CAVES_ALLOWED,
"NO_ALERTS" = NO_ALERTS,
"NO_DEATH_MESSAGE" = NO_DEATH_MESSAGE,
"PERSISTENT_ENGRAVINGS" = PERSISTENT_ENGRAVINGS,
"UNIQUE_AREA" = UNIQUE_AREA,
"VALID_TERRITORY" = VALID_TERRITORY,
"XENOBIOLOGY_COMPATIBLE" = XENOBIOLOGY_COMPATIBLE,
"NO_ALERTS" = NO_ALERTS,
"AREA_USES_STARLIGHT" = AREA_USES_STARLIGHT,
"PERSISTENT_ENGRAVINGS" = PERSISTENT_ENGRAVINGS,
))
DEFINE_BITFIELD(turf_flags, list(
-1
View File
@@ -177,7 +177,6 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_SHIFTY_EYES" = TRAIT_SHIFTY_EYES,
"TRAIT_CANNOT_BE_UNBUCKLED" = TRAIT_CANNOT_BE_UNBUCKLED,
"TRAIT_GAMER" = TRAIT_GAMER,
"TRAIT_ALERT_GHOSTS_ON_DEATH" = TRAIT_ALERT_GHOSTS_ON_DEATH,
),
/obj/item/bodypart = list(
"TRAIT_PARALYSIS" = TRAIT_PARALYSIS,
+1
View File
@@ -242,6 +242,7 @@ The areas used here are STRICTLY on the CC Z level.
base_lighting_alpha = 255
has_gravity = STANDARD_GRAVITY
flags_1 = NONE
area_flags = UNIQUE_AREA | NOTELEPORT | NO_DEATH_MESSAGE
/area/centcom/ctf/control_room
name = "Control Room A"
-1
View File
@@ -45,7 +45,6 @@
/mob/living/simple_animal/hostile/morph/Initialize(mapload)
. = ..()
ADD_TRAIT(src, TRAIT_ALERT_GHOSTS_ON_DEATH, INNATE_TRAIT)
ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT)
AddElement(/datum/element/content_barfer)
@@ -71,7 +71,6 @@
AddElement(/datum/element/simple_flying)
ADD_TRAIT(src, TRAIT_SPACEWALK, INNATE_TRAIT)
ADD_TRAIT(src, TRAIT_SIXTHSENSE, INNATE_TRAIT)
ADD_TRAIT(src, TRAIT_ALERT_GHOSTS_ON_DEATH, INNATE_TRAIT)
// Starting spells
var/datum/action/cooldown/spell/night_vision/revenant/vision = new(src)
+11 -5
View File
@@ -69,14 +69,21 @@
* * gibbed - Was the mob gibbed?
*/
/mob/living/proc/death(gibbed)
if(stat == DEAD)
return FALSE
set_stat(DEAD)
unset_machine()
timeofdeath = world.time
tod = station_time_timestamp()
var/turf/T = get_turf(src)
if(mind && mind.name && mind.active && !istype(T.loc, /area/centcom/ctf))
if(!isanimal_or_basicmob(src) || HAS_TRAIT(src, TRAIT_ALERT_GHOSTS_ON_DEATH))
deadchat_broadcast(" has died at <b>[get_area_name(T)]</b>.", "<b>[mind.name]</b>", follow_target = src, turf_target = T, message_type=DEADCHAT_DEATHRATTLE)
var/turf/death_turf = get_turf(src)
var/area/death_area = get_area(src)
// Display a death message if the mob is a player mob (has an active mind)
var/player_mob_check = mind && mind.name && mind.active
// and, display a death message if the area allows it (or if they're in nullspace)
var/valid_area_check = !death_area || !(death_area.area_flags & NO_DEATH_MESSAGE)
if(player_mob_check && valid_area_check)
deadchat_broadcast(" has died at <b>[get_area_name(death_turf)]</b>.", "<b>[mind.name]</b>", follow_target = src, turf_target = death_turf, message_type=DEADCHAT_DEATHRATTLE)
if(SSlag_switch.measures[DISABLE_DEAD_KEYLOOP] && !client?.holder)
to_chat(src, span_deadsay(span_big("Observer freelook is disabled.\nPlease use Orbit, Teleport, and Jump to look around.")))
ghostize(TRUE)
@@ -91,7 +98,6 @@
med_hud_set_status()
stop_pulling()
SEND_SIGNAL(src, COMSIG_LIVING_DEATH, gibbed)
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_MOB_DEATH, src, gibbed)
@@ -300,8 +300,6 @@
var/datum/action/innate/spider/comm/not_hivemind_talk = new(src)
not_hivemind_talk.Grant(src)
ADD_TRAIT(src, TRAIT_ALERT_GHOSTS_ON_DEATH, INNATE_TRAIT)
/datum/action/innate/spider
icon_icon = 'icons/mob/actions/actions_animal.dmi'
background_icon_state = "bg_alien"
@@ -28,7 +28,6 @@
//Gives player-controlled variants the ability to swap attacks
/mob/living/simple_animal/hostile/asteroid/elite/Initialize(mapload)
. = ..()
ADD_TRAIT(src, TRAIT_ALERT_GHOSTS_ON_DEATH, INNATE_TRAIT)
for(var/action_type in attack_action_types)
var/datum/action/innate/elite_attack/attack_action = new action_type()
attack_action.Grant(src)
@@ -88,7 +88,6 @@
ADD_TRAIT(src, TRAIT_SPACEWALK, INNATE_TRAIT)
ADD_TRAIT(src, TRAIT_NO_FLOATING_ANIM, INNATE_TRAIT)
ADD_TRAIT(src, TRAIT_HEALS_FROM_CARP_RIFTS, INNATE_TRAIT)
ADD_TRAIT(src, TRAIT_ALERT_GHOSTS_ON_DEATH, INNATE_TRAIT)
AddElement(/datum/element/content_barfer)
small_sprite = new
small_sprite.Grant(src)