Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions code/modules/mob/living/human/death.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/mob/living/human/gib(do_gibs = TRUE)
var/turf/my_turf = get_turf(src)
if(do_gibs && has_trait(/decl/trait/undead, TRAIT_LEVEL_MODERATE))
do_gibs = FALSE
. = ..(do_gibs)
if(.)
for(var/obj/item/organ/I in get_internal_organs())
Expand All @@ -18,15 +16,10 @@
E.throw_at(get_edge_target_turf(E, pick(global.alldirs)), rand(1,3), THROWFORCE_GIBS)

/mob/living/human/get_death_message(gibbed)
if(has_trait(/decl/trait/undead, TRAIT_LEVEL_MODERATE))
return "crumbles and falls apart!"
if(get_config_value(/decl/config/toggle/health_show_human_death_message))
return species.get_species_death_message(src) || "seizes up and falls limp..."
return ..()

/mob/living/human/get_self_death_message(gibbed)
return has_trait(/decl/trait/undead, TRAIT_LEVEL_MODERATE) ? "You have crumbled." : ..()

/mob/living/human/death(gibbed)
if(!(. = ..()))
return
Expand All @@ -43,12 +36,6 @@
if(SSticker.mode)
SSticker.mode.check_win()

if(!QDELETED(src) && !gibbed && has_trait(/decl/trait/undead, TRAIT_LEVEL_MODERATE))
gib()

/mob/living/human/get_gibber_type()
return has_trait(/decl/trait/undead, TRAIT_LEVEL_MODERATE) ? null : ..()

/mob/living/human/physically_destroyed(var/skip_qdel, var/droplimb_type = DISMEMBER_METHOD_BLUNT)
for(var/obj/item/organ/external/limb in get_external_organs())
if(!limb.parent_organ) // don't dismember root
Expand Down
33 changes: 0 additions & 33 deletions code/modules/mob/living/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1121,16 +1121,6 @@
var/temp_inc = max(min(BODYTEMP_HEATING_MAX*(1-get_heat_protection()), exposed_temperature - bodytemperature), 0)
bodytemperature += temp_inc

/mob/living/human/need_breathe()
return has_trait(/decl/trait/undead) ? FALSE : ..()

// Undead don't get hungry/thirsty (except for brains)
/mob/living/human/get_nutrition()
return has_trait(/decl/trait/undead) ? get_max_nutrition() : ..()

/mob/living/human/get_hydration()
return has_trait(/decl/trait/undead) ? get_max_hydration() : ..()

/mob/living/human/currently_has_skin()
return currently_has_meat()

Expand All @@ -1146,29 +1136,6 @@
/mob/living/human/get_attack_telegraph_delay()
return client ? 0 : DEFAULT_ATTACK_COOLDOWN

/mob/living/human/set_status_condition(condition, amount)
if(has_trait(/decl/trait/undead))
var/static/list/ignore_status_conditions = list(
STAT_BLIND,
STAT_DEAF,
STAT_CONFUSE,
STAT_DIZZY,
STAT_JITTER,
STAT_STUTTER,
STAT_SLUR,
STAT_ASLEEP,
STAT_DRUGGY,
STAT_DROWSY,
STAT_BLURRY,
STAT_BLIND,
STAT_TINNITUS,
STAT_DEAF
)
if(condition in ignore_status_conditions)
return

. = ..()

/mob/living/human/isSynthetic()
if(isnull(full_prosthetic))
robolimb_count = 0
Expand Down
10 changes: 0 additions & 10 deletions code/modules/mob/living/human/human_appearance_head.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,8 @@

// Eyes! TODO, make these a marking.
/mob/living/human/get_eye_colour()
// Force an evil red glow for undead mobs.
if(stat == CONSCIOUS && has_trait(/decl/trait/undead))
return COLOR_RED
return _eye_colour

/mob/living/human/death(gibbed)
. = ..()
if(!QDELETED(src) && has_trait(/decl/trait/undead))
var/obj/item/organ/external/head/head = get_organ(BP_HEAD)
head.glowing_eyes = initial(head.glowing_eyes)
update_eyes()

/mob/living/human/set_eye_colour(var/new_color, var/skip_update = FALSE)
if((. = ..()))
_eye_colour = new_color
Expand Down
17 changes: 3 additions & 14 deletions code/modules/mob/living/human/human_damage.dm
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
/mob/living/human/get_life_damage_types()
if(has_trait(/decl/trait/undead))
// Undead human mobs use brute and burn damage instead of brain damage, a la simplemobs.
var/static/list/life_damage_types = list(
BURN,
BRUTE
)
return life_damage_types
var/static/list/brain_life_damage_types = list(
BRAIN
)
Expand Down Expand Up @@ -146,13 +139,9 @@
return 0

/mob/living/human/setOxyLoss(var/amount)
if(has_trait(/decl/trait/undead))
return
take_damage(amount - get_damage(OXY), OXY)

/mob/living/human/adjustOxyLoss(var/damage, var/do_update_health = TRUE)
if(has_trait(/decl/trait/undead))
return
. = FALSE
if(need_breathe())
var/obj/item/organ/internal/lungs/breathe_organ = get_organ(get_bodytype().breathing_organ, /obj/item/organ/internal/lungs)
Expand All @@ -163,21 +152,21 @@
..(do_update_health = FALSE) // Oxyloss cannot directly kill humans

/mob/living/human/getToxLoss()
if((species.species_flags & SPECIES_FLAG_NO_POISON) || isSynthetic() || has_trait(/decl/trait/undead))
if((species.species_flags & SPECIES_FLAG_NO_POISON) || isSynthetic())
return 0
var/amount = 0
for(var/obj/item/organ/internal/I in get_internal_organs())
amount += I.getToxLoss()
return amount

/mob/living/human/setToxLoss(var/amount)
if(!(species.species_flags & SPECIES_FLAG_NO_POISON) && !isSynthetic() || has_trait(/decl/trait/undead))
if(!(species.species_flags & SPECIES_FLAG_NO_POISON) && !isSynthetic())
take_damage(get_damage(TOX)-amount, TOX)

// TODO: better internal organ damage procs.
/mob/living/human/adjustToxLoss(var/amount, var/do_update_health = TRUE)

if((species.species_flags & SPECIES_FLAG_NO_POISON) || isSynthetic() || has_trait(/decl/trait/undead))
if((species.species_flags & SPECIES_FLAG_NO_POISON) || isSynthetic())
return

var/heal = amount < 0
Expand Down
13 changes: 0 additions & 13 deletions code/modules/mob/living/human/human_organs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,26 +155,13 @@
if(E.need_process())
LAZYDISTINCTADD(bad_external_organs, E)

/mob/living/human/proc/check_vital_organ_missing()

Check failure on line 158 in code/modules/mob/living/human/human_organs.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

override of /mob/living/human/check_vital_organ_missing precedes definition
// Undead don't care about missing internal organs.
if(has_trait(/decl/trait/undead))
return FALSE
return get_bodytype()?.check_vital_organ_missing(src)

/mob/living/human/should_have_organ(organ_to_check)
// It might be nice to have eyes etc. matter for zombies, but as all organs are dead it won't work currently.
return has_trait(/decl/trait/undead) ? FALSE : ..()

/mob/living/human/proc/process_internal_organs()

Check failure on line 161 in code/modules/mob/living/human/human_organs.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

override of /mob/living/human/process_internal_organs precedes definition
if(has_trait(/decl/trait/undead))
return
for(var/obj/item/organ/I in internal_organs)
I.Process()

/mob/living/human/get_vision_organ_tag()
// Where we're going, we don't need eyes.
return has_trait(/decl/trait/undead) ? null : ..()

// Takes care of organ related updates, such as broken and missing limbs
/mob/living/human/proc/handle_organs()

Expand Down
10 changes: 6 additions & 4 deletions code/modules/organs/external/_external.dm
Original file line number Diff line number Diff line change
Expand Up @@ -725,16 +725,18 @@ This function completely restores a damaged organ to perfect condition.
/obj/item/organ/external/is_broken()
return ((status & ORGAN_CUT_AWAY) || ((status & ORGAN_BROKEN) && !splinted))

/obj/item/organ/external/proc/check_status_flags_for_process()
if(status & (ORGAN_CUT_AWAY|ORGAN_BLEEDING|ORGAN_BROKEN|ORGAN_MUTATED|ORGAN_DISLOCATED|ORGAN_DEAD))
return TRUE
return FALSE

//Determines if we even need to process this organ.
/obj/item/organ/external/proc/need_process()

if(length(ailments))
return TRUE

if(status & (ORGAN_CUT_AWAY|ORGAN_BLEEDING|ORGAN_BROKEN|ORGAN_MUTATED|ORGAN_DISLOCATED))
return TRUE

if((status & ORGAN_DEAD) && !owner?.has_trait(/decl/trait/undead))
if(check_status_flags_for_process())
return TRUE

if((brute_dam || burn_dam) && !BP_IS_PROSTHETIC(src)) //Robot limbs don't autoheal and thus don't need to process when damaged
Expand Down
4 changes: 1 addition & 3 deletions code/modules/organs/organ.dm
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,7 @@
return bodytype && !(bodytype.body_flags & BODY_FLAG_NO_PAIN) && !(status & ORGAN_DEAD)

/obj/item/organ/proc/is_usable()
. = !(status & (ORGAN_CUT_AWAY|ORGAN_MUTATED))
if(. && (status & ORGAN_DEAD))
return owner?.has_trait(/decl/trait/undead)
return !(status & (ORGAN_CUT_AWAY|ORGAN_MUTATED|ORGAN_DEAD))

/obj/item/organ/proc/can_recover()
return (max_damage > 0) && !(status & ORGAN_DEAD) || death_time >= REALTIMEOFDAY - ORGAN_RECOVERY_THRESHOLD
Expand Down
11 changes: 0 additions & 11 deletions mods/content/fantasy/datum/overrides.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,3 @@
/obj/item/remains/robot
)
return spawnable_choices

// Overrides to populate the dungeon with undead.
/obj/random/hostile/dungeon/spawn_choices()
var/static/list/spawnable_choices = list(
/mob/living/human/zombie = 1,
/mob/living/human/skeleton = 2,
/mob/living/human/zombie/hnoll = 1,
/mob/living/human/skeleton/hnoll = 2
)
return spawnable_choices

2 changes: 2 additions & 0 deletions mods/content/undead/_undead.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/decl/modpack/undead
name = "Undead Content"
12 changes: 12 additions & 0 deletions mods/content/undead/_undead.dme
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef MODPACK_UNDEAD
#define MODPACK_UNDEAD
// BEGIN_INCLUDE
#include "_undead.dm"
#include "overrides.dm"
#include "skillset.dm"
#include "traits.dm"
#include "mods\undead.dm"
#include "mods\undead_skeleton.dm"
#include "mods\undead_zombie.dm"
// END_INCLUDE
#endif
File renamed without changes.
134 changes: 134 additions & 0 deletions mods/content/undead/overrides.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/mob/living/can_feel_pain(var/check_organ)
return !has_trait(/decl/trait/undead) && ..()

/mob/living/human/get_gibber_type() // To avoid skeletons causing gibs.
return has_trait(/decl/trait/undead, TRAIT_LEVEL_MODERATE) ? null : ..()

/mob/living/human/ssd_check()
if(has_trait(/decl/trait/undead))
return FALSE
return ..()

/mob/living/human/get_movement_delay(travel_dir)
. = ..()
if(has_trait(/decl/trait/undead))
var/static/default_walk_delay = get_config_value(/decl/config/num/movement_walk)
. = max(., default_walk_delay)

/mob/living/human/get_attack_telegraph_delay()
if(has_trait(/decl/trait/undead))
return (0.6 SECONDS)
return ..()

/mob/living/human/get_self_death_message(gibbed)
return has_trait(/decl/trait/undead, TRAIT_LEVEL_MODERATE) ? "You have crumbled." : ..()

/mob/living/human/get_death_message(gibbed)
if(has_trait(/decl/trait/undead, TRAIT_LEVEL_MODERATE))
return "crumbles and falls apart!"
return ..()

/mob/living/human/death(gibbed)
. = ..()
if(stat == DEAD && !QDELETED(src) && !gibbed && has_trait(/decl/trait/undead, TRAIT_LEVEL_MODERATE))
gib()

/mob/living/human/get_eye_colour()
// Force an evil red glow for undead mobs.
if(stat == CONSCIOUS && has_trait(/decl/trait/undead))
return COLOR_RED
return ..()

/mob/living/human/death(gibbed)
. = ..()
if(!QDELETED(src) && has_trait(/decl/trait/undead))
var/obj/item/organ/external/head/head = get_organ(BP_HEAD)
head.glowing_eyes = initial(head.glowing_eyes)
update_eyes()

/mob/living/human/get_life_damage_types()
if(has_trait(/decl/trait/undead))
// Undead human mobs use brute and burn damage instead of brain damage, a la simplemobs.
var/static/list/life_damage_types = list(
BURN,
BRUTE
)
return life_damage_types
return ..()

/mob/living/human/getOxyLoss(var/amount)
return has_trait(/decl/trait/undead) ? 0 : ..()

/mob/living/human/setOxyLoss(var/amount)
return has_trait(/decl/trait/undead) ? 0 : ..()

/mob/living/human/adjustOxyLoss(var/damage, var/do_update_health = TRUE)
return has_trait(/decl/trait/undead) ? 0 : ..()

/mob/living/human/getToxLoss()
return has_trait(/decl/trait/undead) ? 0 : ..()

/mob/living/human/setToxLoss(var/amount)
return has_trait(/decl/trait/undead) ? 0 : ..()

/mob/living/human/adjustToxLoss(var/amount, var/do_update_health = TRUE)
return has_trait(/decl/trait/undead) ? 0 : ..()

/mob/living/human/proc/check_vital_organ_missing()

Check failure on line 77 in mods/content/undead/overrides.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

duplicate definition of proc/check_vital_organ_missing
return !has_trait(/decl/trait/undead) && ..()

/mob/living/human/proc/process_internal_organs()

Check failure on line 80 in mods/content/undead/overrides.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

duplicate definition of proc/process_internal_organs
return has_trait(/decl/trait/undead) ? null : ..()

/mob/living/human/should_have_organ(organ_to_check)
// It might be nice to have eyes etc. matter for zombies, but as all organs are dead it won't work currently.
return has_trait(/decl/trait/undead) ? FALSE : ..()

/mob/living/human/get_vision_organ_tag()
// Where we're going, we don't need eyes.
return has_trait(/decl/trait/undead) ? null : ..()

/mob/living/human/need_breathe()
return has_trait(/decl/trait/undead) ? FALSE : ..()

// Undead don't get hungry/thirsty (except for brains)
/mob/living/human/get_nutrition()
return has_trait(/decl/trait/undead) ? get_max_nutrition() : ..()

/mob/living/human/get_hydration()
return has_trait(/decl/trait/undead) ? get_max_hydration() : ..()

// Overrides to handle dead flag separately.
/obj/item/organ/is_usable()
. = !(status & (ORGAN_CUT_AWAY|ORGAN_MUTATED))
if(. && (status & ORGAN_DEAD))
return owner?.has_trait(/decl/trait/undead)

/obj/item/organ/external/check_status_flags_for_process()
if(status & (ORGAN_CUT_AWAY|ORGAN_BLEEDING|ORGAN_BROKEN|ORGAN_MUTATED|ORGAN_DISLOCATED))
return TRUE
if((status & ORGAN_DEAD) && !owner?.has_trait(/decl/trait/undead))
return TRUE
return FALSE

/mob/living/human/set_status_condition(condition, amount)
if(has_trait(/decl/trait/undead))
var/static/list/ignore_status_conditions = list(
STAT_BLIND,
STAT_DEAF,
STAT_CONFUSE,
STAT_DIZZY,
STAT_JITTER,
STAT_STUTTER,
STAT_SLUR,
STAT_ASLEEP,
STAT_DRUGGY,
STAT_DROWSY,
STAT_BLURRY,
STAT_BLIND,
STAT_TINNITUS,
STAT_DEAF
)
if(condition in ignore_status_conditions)
return
. = ..()
2 changes: 2 additions & 0 deletions mods/content/undead/skillset.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/datum/skillset/undead
default_value = SKILL_BASIC
4 changes: 4 additions & 0 deletions mods/content/undead/traits.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/decl/trait/undead
name = "Undead"
description = "Your body is dead, but remains animated through some supernatural force."
levels = list(TRAIT_LEVEL_MINOR, TRAIT_LEVEL_MODERATE) // Moderate means skeleton, minor means zombie.
3 changes: 0 additions & 3 deletions mods/pyrelight/_pyrelight.dme
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,5 @@
#include "plants\plants_fruit_template.dm"
#include "plants\fruit_subtypes\nightweave.dm"
#include "plants\plant_subtypes\nightweave.dm"
#include "undead\undead.dm"
#include "undead\undead_skeleton.dm"
#include "undead\undead_zombie.dm"
#endif
// END_INCLUDE
Loading
Loading