diff --git a/code/game/gamemodes/blob/blobs/blob_mobs.dm b/code/game/gamemodes/blob/blobs/blob_mobs.dm index d3a367e5e64..2df7b07445a 100644 --- a/code/game/gamemodes/blob/blobs/blob_mobs.dm +++ b/code/game/gamemodes/blob/blobs/blob_mobs.dm @@ -92,7 +92,7 @@ H.loc = src loc.visible_message(" The corpse of [H.name] suddenly rises!") -/mob/living/simple_animal/hostile/blob/blobspore/Die() +/mob/living/simple_animal/hostile/blob/blobspore/death(gibbed) // On death, create a small smoke of harmful gas (s-Acid) var/datum/effect/effect/system/chem_smoke_spread/S = new var/turf/location = get_turf(src) @@ -165,6 +165,6 @@ /mob/living/simple_animal/hostile/blob/blobbernaut/blob_act() return -/mob/living/simple_animal/hostile/blob/blobbernaut/Die() - ..() +/mob/living/simple_animal/hostile/blob/blobbernaut/death(gibbed) + ..(gibbed) flick("blobbernaut_death", src) \ No newline at end of file diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm index 4ce35c8a06e..402fa8f956a 100644 --- a/code/modules/mining/equipment_locker.dm +++ b/code/modules/mining/equipment_locker.dm @@ -628,7 +628,7 @@ return ..() -/mob/living/simple_animal/hostile/mining_drone/Die() +/mob/living/simple_animal/hostile/mining_drone/death() ..() visible_message("[src] is destroyed!") new /obj/effect/decal/cleanable/robot_debris(src.loc) diff --git a/code/modules/mob/living/carbon/death.dm b/code/modules/mob/living/carbon/death.dm index deca15ff0f7..7994f95978a 100644 --- a/code/modules/mob/living/carbon/death.dm +++ b/code/modules/mob/living/carbon/death.dm @@ -1,4 +1,6 @@ /mob/living/carbon/death(gibbed) + eye_blind = max(eye_blind, 1) + silent = 0 med_hud_set_health() med_hud_set_status() ..(gibbed) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index b4181b590a0..29bf40ef11a 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -67,7 +67,7 @@ /////////////// //Start of a breath chain, calls breathe() -/mob/living/carbon/proc/handle_breathing() +/mob/living/carbon/handle_breathing() if(SSmob.times_fired%4==2 || failed_last_breath) breathe() //Breathe per 4 ticks, unless suffocating else @@ -253,10 +253,10 @@ return -/mob/living/carbon/proc/handle_changeling() +/mob/living/carbon/handle_changeling() return -/mob/living/carbon/proc/handle_mutations_and_radiation() +/mob/living/carbon/handle_mutations_and_radiation() if(radiation) switch(radiation) @@ -281,7 +281,7 @@ radiation = Clamp(radiation, 0, 100) -/mob/living/carbon/proc/handle_chemicals_in_body() +/mob/living/carbon/handle_chemicals_in_body() if(reagents) reagents.metabolize(src) @@ -304,16 +304,16 @@ updatehealth() return -/mob/living/carbon/proc/handle_blood() +/mob/living/carbon/handle_blood() return -/mob/living/carbon/proc/handle_random_events() +/mob/living/carbon/handle_random_events() return -/mob/living/carbon/proc/handle_environment(var/datum/gas_mixture/environment) +/mob/living/carbon/handle_environment(var/datum/gas_mixture/environment) return -/mob/living/carbon/proc/handle_stomach() +/mob/living/carbon/handle_stomach() spawn(0) for(var/mob/living/M in stomach_contents) if(M.loc != src) @@ -330,26 +330,21 @@ M.adjustBruteLoss(5) nutrition += 10 -/mob/living/carbon/proc/handle_regular_status_updates() +/mob/living/carbon/handle_regular_status_updates() - if(stat == DEAD) - eye_blind = max(eye_blind, 1) - silent = 0 - else - updatehealth() - if(health <= config.health_threshold_dead || !getorgan(/obj/item/organ/brain)) - death() - eye_blind = max(eye_blind, 1) - silent = 0 - return 1 + updatehealth() + if(health <= config.health_threshold_dead || !getorgan(/obj/item/organ/brain)) + death() + return - if( (getOxyLoss() > 50) || (config.health_threshold_crit >= health) ) + if(stat != DEAD) + + if(getOxyLoss() > 50 || health <= config.health_threshold_crit) Paralyse(3) - if(paralysis) - AdjustParalysis(-1) - stat = UNCONSCIOUS - else if(sleeping) + ..() + + if(sleeping && !paralysis) handle_dreams() adjustStaminaLoss(-10) sleeping = max(sleeping-1, 0) @@ -358,14 +353,6 @@ spawn(0) emote("snore") - else if (status_flags & FAKEDEATH) - stat = UNCONSCIOUS - - else - stat = CONSCIOUS - - handle_disabilities() - //Dizziness if(dizziness) var/client/C = client @@ -419,16 +406,6 @@ if(druggy) druggy = max(druggy-1, 0) - if(stunned) - AdjustStunned(-1) - if(!stunned) - update_icons() - - if(weakened) - weakened = max(weakened-1,0) - if(!weakened) - update_icons() - if(hallucination) spawn handle_hallucinations() @@ -442,28 +419,10 @@ qdel(a) CheckStamina() - return 1 - -/mob/living/carbon/proc/handle_disabilities() - //Eyes - if(disabilities & BLIND || stat) //blindness from disability or unconsciousness doesn't get better on its own - eye_blind = max(eye_blind, 1) - else if(eye_blind) //blindness, heals slowly over time - eye_blind = max(eye_blind-1,0) - else if(eye_blurry) //blurry eyes heal slowly - eye_blurry = max(eye_blurry-1, 0) - - //Ears - if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own - setEarDamage(-1, max(ear_deaf, 1)) - else - // deafness heals slowly over time, unless ear_damage is over 100 - if(ear_damage < 100) - adjustEarDamage(-0.05,-1) - + return 1 //this handles hud updates. Calles update_vision() and handle_hud_icons() -/mob/living/carbon/proc/handle_regular_hud_updates() +/mob/living/carbon/handle_regular_hud_updates() if(!client) return 0 update_action_buttons() @@ -550,7 +509,7 @@ return 1 -/mob/living/carbon/proc/handle_vision() +/mob/living/carbon/handle_vision() client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask) @@ -597,7 +556,7 @@ if(!client.adminobs) reset_view(null) -/mob/living/carbon/proc/handle_hud_icons() +/mob/living/carbon/handle_hud_icons() return /mob/living/carbon/proc/handle_hud_icons_health() diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm new file mode 100644 index 00000000000..effe89bda3e --- /dev/null +++ b/code/modules/mob/living/life.dm @@ -0,0 +1,228 @@ +/mob/living/Life() + set invisibility = 0 + set background = BACKGROUND_ENABLED + + if (notransform) + return + if(!loc) + return + var/datum/gas_mixture/environment = loc.return_air() + + if(stat != DEAD) + + //Breathing, if applicable + handle_breathing() + + //Updates the number of stored chemicals for powers + handle_changeling() + + //Mutations and radiation + handle_mutations_and_radiation() + + //Chemicals in the body + handle_chemicals_in_body() + + //Blud + handle_blood() + + //Random events (vomiting etc) + handle_random_events() + + . = 1 + + //Handle temperature/pressure differences between body and environment + handle_environment(environment) + + handle_fire() + + //stuff in the stomach + handle_stomach() + + update_canmove() + + update_gravity(mob_has_gravity()) + + for(var/obj/item/weapon/grab/G in src) + G.process() + + handle_regular_status_updates() // Status updates, death etc. + + if(client) + handle_regular_hud_updates() + + return . + + + +/mob/living/proc/handle_breathing() + +/mob/living/proc/handle_changeling() + return + +/mob/living/proc/handle_mutations_and_radiation() + if(radiation) + + switch(radiation) + if(0 to 50) + radiation-- + if(prob(25)) + adjustToxLoss(1) + updatehealth() + + if(50 to 75) + radiation -= 2 + adjustToxLoss(1) + if(prob(5)) + radiation -= 5 + updatehealth() + + if(75 to 100) + radiation -= 3 + adjustToxLoss(3) + updatehealth() + + radiation = Clamp(radiation, 0, 100) + + +/mob/living/proc/handle_chemicals_in_body() + if(reagents) + reagents.metabolize(src) + + if(drowsyness) + drowsyness-- + eye_blurry = max(2, eye_blurry) + if(prob(5)) + sleeping += 1 + Paralyse(5) + + confused = max(0, confused - 1) + // decrement dizziness counter, clamped to 0 + if(resting) + dizziness = max(0, dizziness - 5) + jitteriness = max(0, jitteriness - 5) + else + dizziness = max(0, dizziness - 1) + jitteriness = max(0, jitteriness - 1) + + updatehealth() + return + +/mob/living/proc/handle_blood() + return + +/mob/living/proc/handle_random_events() + return + +/mob/living/proc/handle_environment(var/datum/gas_mixture/environment) + return + +/mob/living/proc/handle_stomach() + return + +/mob/living/proc/handle_regular_status_updates() + + if(stat != DEAD) + updatehealth() + + if(paralysis) + AdjustParalysis(-1) + stat = UNCONSCIOUS + + else if (status_flags & FAKEDEATH) + stat = UNCONSCIOUS + + else + stat = CONSCIOUS + + handle_disabilities() + + if(stunned) + AdjustStunned(-1) + if(!stunned) + update_icons() + + if(weakened) + weakened = max(weakened-1,0) + if(!weakened) + update_icons() + + return 1 + +/mob/living/proc/handle_disabilities() + //Eyes + if(disabilities & BLIND || stat) //blindness from disability or unconsciousness doesn't get better on its own + eye_blind = max(eye_blind, 1) + else if(eye_blind) //blindness, heals slowly over time + eye_blind = max(eye_blind-1,0) + else if(eye_blurry) //blurry eyes heal slowly + eye_blurry = max(eye_blurry-1, 0) + + //Ears + if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own + setEarDamage(-1, max(ear_deaf, 1)) + else + // deafness heals slowly over time, unless ear_damage is over 100 + if(ear_damage < 100) + adjustEarDamage(-0.05,-1) + + +//this handles hud updates. Calles update_vision() and handle_hud_icons() +/mob/living/proc/handle_regular_hud_updates() + if(!client) return 0 + + handle_vision() + handle_hud_icons() + + return 1 + +/mob/living/proc/handle_vision() + + client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask) + + if(stat == DEAD) + sight |= SEE_TURFS + sight |= SEE_MOBS + sight |= SEE_OBJS + see_in_dark = 8 + see_invisible = SEE_INVISIBLE_LEVEL_TWO + else + sight &= ~SEE_TURFS + sight &= ~SEE_MOBS + sight &= ~SEE_OBJS + see_in_dark = 2 + see_invisible = SEE_INVISIBLE_LIVING + if(see_override) + see_invisible = see_override + + if(blind) + if(eye_blind) + blind.layer = 18 + else + blind.layer = 0 + + if (disabilities & NEARSIGHT) + client.screen += global_hud.vimpaired + + if (eye_blurry) + client.screen += global_hud.blurry + + if (druggy) + client.screen += global_hud.druggy + + if(eye_stat > 20) + if(eye_stat > 30) + client.screen += global_hud.darkMask + else + client.screen += global_hud.vimpaired + + if(machine) + if (!( machine.check_eye(src) )) + reset_view(null) + else + if(!client.adminobs) + reset_view(null) + +/mob/living/proc/handle_hud_icons() + return + + diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 9dc994a1bad..66350b14641 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -8,7 +8,6 @@ Sorry Giacom. Please don't be mad :( push_mob_back(src, A.push_dir) */ - /mob/living/New() . = ..() generateStaticOverlay() diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index d90e464cee2..5fbf63a2a70 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -58,7 +58,7 @@ src.stat = 1 -/mob/living/silicon/robot/proc/handle_regular_status_updates() +/mob/living/silicon/robot/handle_regular_status_updates() if(src.camera && !scrambledcodes) if(src.stat == 2 || wires.IsCameraCut()) @@ -129,7 +129,7 @@ return 1 -/mob/living/silicon/robot/proc/handle_regular_hud_updates() +/mob/living/silicon/robot/handle_regular_hud_updates() if (src.stat == 2 || src.sight_mode & BORGXRAY) src.sight |= SEE_TURFS diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index 2f515596d37..336ca05e96a 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -34,7 +34,7 @@ for(var/spell in construct_spells) mob_spell_list += new spell(src) -/mob/living/simple_animal/construct/Die() +/mob/living/simple_animal/construct/death() ..() new /obj/item/weapon/ectoplasm (src.loc) visible_message("[src] collapses in a shattered heap.") diff --git a/code/modules/mob/living/simple_animal/friendly/corgi.dm b/code/modules/mob/living/simple_animal/friendly/corgi.dm index 6cfff764b88..da97a78c75d 100644 --- a/code/modules/mob/living/simple_animal/friendly/corgi.dm +++ b/code/modules/mob/living/simple_animal/friendly/corgi.dm @@ -29,8 +29,8 @@ ..() regenerate_icons() -/mob/living/simple_animal/corgi/Die() - ..() +/mob/living/simple_animal/corgi/death(gibbed) + ..(gibbed) regenerate_icons() /mob/living/simple_animal/corgi/revive() diff --git a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm index 4a003c9a72f..704338b87b9 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm @@ -94,8 +94,8 @@ pickVisualAppearence() -/mob/living/simple_animal/drone/Die() - ..() +/mob/living/simple_animal/drone/death(gibbed) + ..(gibbed) drop_l_hand() drop_r_hand() if(internal_storage) diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index d976a50bf86..48349474c2d 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -223,8 +223,8 @@ var/global/chicken_count = 0 pixel_y = rand(0, 10) chicken_count += 1 -/mob/living/simple_animal/chicken/Die() - ..() +/mob/living/simple_animal/chicken/death(gibbed) + ..(gibbed) chicken_count -= 1 /mob/living/simple_animal/chicken/attackby(var/obj/item/O as obj, var/mob/user as mob, params) diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index ae67489e9e0..a20a7801d3b 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -36,10 +36,10 @@ /mob/living/simple_animal/mouse/proc/splat() src.health = 0 src.icon_dead = "mouse_[body_color]_splat" - Die() + death() -/mob/living/simple_animal/mouse/Die() - ..() +/mob/living/simple_animal/mouse/death(gibbed) + ..(gibbed) if(!ckey) var/obj/item/trash/deadmouse/M = new(src.loc) M.icon_state = src.icon_dead diff --git a/code/modules/mob/living/simple_animal/friendly/slime.dm b/code/modules/mob/living/simple_animal/friendly/slime.dm index 85405278096..eed4bc24848 100644 --- a/code/modules/mob/living/simple_animal/friendly/slime.dm +++ b/code/modules/mob/living/simple_animal/friendly/slime.dm @@ -25,7 +25,7 @@ ..() overlays += "aslime-:33" -/mob/living/simple_animal/slime/adult/Die() +/mob/living/simple_animal/slime/adult/death(gibbed) for(var/i = 0, i<=1, i++) var/mob/living/simple_animal/slime/S1 = new /mob/living/simple_animal/slime (src.loc) S1.icon_state = "[colour] baby slime" diff --git a/code/modules/mob/living/simple_animal/hostile/alien.dm b/code/modules/mob/living/simple_animal/hostile/alien.dm index e08f84a93fd..909e17a36e6 100644 --- a/code/modules/mob/living/simple_animal/hostile/alien.dm +++ b/code/modules/mob/living/simple_animal/hostile/alien.dm @@ -92,7 +92,7 @@ damage = 30 icon_state = "toxin" -/mob/living/simple_animal/hostile/alien/Die() - ..() +/mob/living/simple_animal/hostile/alien/death(gibbed) + ..(gibbed) visible_message("[src] lets out a waning guttural screech, green blood bubbling from its maw...") playsound(src, 'sound/voice/hiss6.ogg', 100, 1) diff --git a/code/modules/mob/living/simple_animal/hostile/bees.dm b/code/modules/mob/living/simple_animal/hostile/bees.dm index 66707ccf069..9a07fae29f4 100644 --- a/code/modules/mob/living/simple_animal/hostile/bees.dm +++ b/code/modules/mob/living/simple_animal/hostile/bees.dm @@ -40,8 +40,8 @@ ..() update_bees() -/mob/living/simple_animal/hostile/poison/bees/Die() - ..() +/mob/living/simple_animal/hostile/poison/bees/death(gibbed) + ..(gibbed) qdel(src) return diff --git a/code/modules/mob/living/simple_animal/hostile/carp.dm b/code/modules/mob/living/simple_animal/hostile/carp.dm index a7683dd7847..2c4fe2f9de8 100644 --- a/code/modules/mob/living/simple_animal/hostile/carp.dm +++ b/code/modules/mob/living/simple_animal/hostile/carp.dm @@ -57,7 +57,7 @@ icon_living = "holocarp" maxbodytemp = INFINITY -/mob/living/simple_animal/hostile/carp/holocarp/Die() +/mob/living/simple_animal/hostile/carp/holocarp/death() qdel(src) return diff --git a/code/modules/mob/living/simple_animal/hostile/eyeballs.dm b/code/modules/mob/living/simple_animal/hostile/eyeballs.dm index 46f2e679e22..4bebf1eaa72 100644 --- a/code/modules/mob/living/simple_animal/hostile/eyeballs.dm +++ b/code/modules/mob/living/simple_animal/hostile/eyeballs.dm @@ -29,6 +29,6 @@ if(.) emote("me", 1, "glares at [.]") -/mob/living/simple_animal/hostile/carp/eyeball/Die() +/mob/living/simple_animal/hostile/carp/eyeball/death() qdel(src) return \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/hostile/hivebot.dm b/code/modules/mob/living/simple_animal/hostile/hivebot.dm index 11bbfa8a561..f6b7bfbf731 100644 --- a/code/modules/mob/living/simple_animal/hostile/hivebot.dm +++ b/code/modules/mob/living/simple_animal/hostile/hivebot.dm @@ -46,8 +46,8 @@ health = 80 ranged = 1 -/mob/living/simple_animal/hostile/hivebot/Die() - ..() +/mob/living/simple_animal/hostile/hivebot/death(gibbed) + ..(gibbed) visible_message("[src] blows apart!") new /obj/effect/decal/cleanable/robot_debris(src.loc) var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 3828dbdce6c..31a27c5246d 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -229,9 +229,9 @@ //////////////END HOSTILE MOB TARGETTING AND AGGRESSION//////////// -/mob/living/simple_animal/hostile/Die() +/mob/living/simple_animal/hostile/death(gibbed) LoseAggro() - ..() + ..(gibbed) walk(src, 0) /mob/living/simple_animal/hostile/proc/OpenFire(var/the_target) diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index e6f77f15489..4003bda143b 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -41,8 +41,8 @@ if(.) emote("me", 1, "[Attackemote] [.].") -/mob/living/simple_animal/hostile/mimic/Die() - ..() +/mob/living/simple_animal/hostile/mimic/death(gibbed) + ..(gibbed) visible_message("[src] stops moving!") qdel(src) @@ -107,13 +107,13 @@ ..() icon_state = initial(icon_state) -/mob/living/simple_animal/hostile/mimic/crate/Die() +/mob/living/simple_animal/hostile/mimic/crate/death(gibbed) var/obj/structure/closet/crate/C = new(get_turf(src)) // Put loot in crate for(var/obj/O in src) O.loc = C - ..() + ..(gibbed) /mob/living/simple_animal/hostile/mimic/crate/AttackingTarget() . =..() @@ -144,13 +144,13 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca /mob/living/simple_animal/hostile/mimic/copy/Life() ..() for(var/mob/living/M in contents) //a fix for animated statues from the flesh to stone spell - Die() + death() -/mob/living/simple_animal/hostile/mimic/copy/Die() +/mob/living/simple_animal/hostile/mimic/copy/death(gibbed) for(var/atom/movable/M in src) M.loc = get_turf(src) - ..() + ..(gibbed) /mob/living/simple_animal/hostile/mimic/copy/ListTargets() // Return a list of targets that isn't the creator diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm index 0e62f7f61b7..8bbfc2e7c7e 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm @@ -108,12 +108,12 @@ if(3.0) adjustBruteLoss(110) -/mob/living/simple_animal/hostile/asteroid/basilisk/Die() +/mob/living/simple_animal/hostile/asteroid/basilisk/death(gibbed) var/counter for(counter=0, counter<2, counter++) var/obj/item/weapon/ore/diamond/D = new /obj/item/weapon/ore/diamond(src.loc) D.layer = 4.1 - ..() + ..(gibbed) /mob/living/simple_animal/hostile/asteroid/goldgrub name = "goldgrub" @@ -204,10 +204,10 @@ visible_message("The [P.name] was repelled by [src.name]'s girth!") return -/mob/living/simple_animal/hostile/asteroid/goldgrub/Die() +/mob/living/simple_animal/hostile/asteroid/goldgrub/death(gibbed) alerted = 0 Reward() - ..() + ..(gibbed) /mob/living/simple_animal/hostile/asteroid/goldgrub/adjustBruteLoss(var/damage) idle_vision_range = 9 @@ -253,10 +253,10 @@ /mob/living/simple_animal/hostile/asteroid/hivelord/AttackingTarget() OpenFire() -/mob/living/simple_animal/hostile/asteroid/hivelord/Die() +/mob/living/simple_animal/hostile/asteroid/hivelord/death(gibbed) new /obj/item/asteroid/hivelord_core(src.loc) mouse_opacity = 1 - ..() + ..(gibbed) /obj/item/asteroid/hivelord_core name = "hivelord remains" @@ -318,7 +318,7 @@ spawn(100) qdel(src) -/mob/living/simple_animal/hostile/asteroid/hivelordbrood/Die() +/mob/living/simple_animal/hostile/asteroid/hivelordbrood/death() qdel(src) /mob/living/simple_animal/hostile/asteroid/goliath @@ -367,9 +367,9 @@ anchored = 1 ..() -/mob/living/simple_animal/hostile/asteroid/goliath/Die() +/mob/living/simple_animal/hostile/asteroid/goliath/death(gibbed) anchored = 0 - ..() + ..(gibbed) /mob/living/simple_animal/hostile/asteroid/goliath/OpenFire() var/tturf = get_turf(target) @@ -434,10 +434,10 @@ spawn(50) qdel(src) -/mob/living/simple_animal/hostile/asteroid/goliath/Die() +/mob/living/simple_animal/hostile/asteroid/goliath/death(gibbed) var/obj/item/asteroid/goliath_hide/G = new /obj/item/asteroid/goliath_hide(src.loc) G.layer = 4.1 - ..() + ..(gibbed) /obj/item/asteroid/goliath_hide name = "goliath hide plates" diff --git a/code/modules/mob/living/simple_animal/hostile/mushroom.dm b/code/modules/mob/living/simple_animal/hostile/mushroom.dm index c93b394050e..f06f3d4c28c 100644 --- a/code/modules/mob/living/simple_animal/hostile/mushroom.dm +++ b/code/modules/mob/living/simple_animal/hostile/mushroom.dm @@ -87,9 +87,9 @@ icon_state = "mushroom_color" UpdateMushroomCap() -/mob/living/simple_animal/hostile/mushroom/Die() +/mob/living/simple_animal/hostile/mushroom/death(gibbed) visible_message("[src] fainted.") - ..() + ..(gibbed) UpdateMushroomCap() /mob/living/simple_animal/hostile/mushroom/proc/UpdateMushroomCap() diff --git a/code/modules/mob/living/simple_animal/hostile/pirate.dm b/code/modules/mob/living/simple_animal/hostile/pirate.dm index aae825a6538..71dde5bdd9a 100644 --- a/code/modules/mob/living/simple_animal/hostile/pirate.dm +++ b/code/modules/mob/living/simple_animal/hostile/pirate.dm @@ -49,8 +49,8 @@ weapon1 = /obj/item/weapon/gun/energy/laser -/mob/living/simple_animal/hostile/pirate/Die() - ..() +/mob/living/simple_animal/hostile/pirate/death(gibbed) + ..(gibbed) if(corpse) new corpse (src.loc) if(weapon1) diff --git a/code/modules/mob/living/simple_animal/hostile/russian.dm b/code/modules/mob/living/simple_animal/hostile/russian.dm index 3f143ea19fe..568d89794e4 100644 --- a/code/modules/mob/living/simple_animal/hostile/russian.dm +++ b/code/modules/mob/living/simple_animal/hostile/russian.dm @@ -51,8 +51,8 @@ weapon1 = /obj/item/weapon/gun/projectile/shotgun/boltaction casingtype = /obj/item/ammo_casing/a762 -/mob/living/simple_animal/hostile/russian/Die() - ..() +/mob/living/simple_animal/hostile/russian/death(gibbed) + ..(gibbed) if(corpse) new corpse (src.loc) if(weapon1) diff --git a/code/modules/mob/living/simple_animal/hostile/syndicate.dm b/code/modules/mob/living/simple_animal/hostile/syndicate.dm index 72b30675077..cfa97043bfd 100644 --- a/code/modules/mob/living/simple_animal/hostile/syndicate.dm +++ b/code/modules/mob/living/simple_animal/hostile/syndicate.dm @@ -34,8 +34,8 @@ faction = list("syndicate") status_flags = CANPUSH -/mob/living/simple_animal/hostile/syndicate/Die() - ..() +/mob/living/simple_animal/hostile/syndicate/death(gibbed) + ..(gibbed) if(corpse) new corpse (src.loc) if(weapon1) @@ -160,8 +160,8 @@ minbodytemp = 0 mob_size = 0 -/mob/living/simple_animal/hostile/viscerator/Die() - ..() +/mob/living/simple_animal/hostile/viscerator/death(gibbed) + ..(gibbed) visible_message("[src] is smashed into pieces!") qdel(src) return \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/hostile/tree.dm b/code/modules/mob/living/simple_animal/hostile/tree.dm index 43ee23cf49b..c4ed28b8e18 100644 --- a/code/modules/mob/living/simple_animal/hostile/tree.dm +++ b/code/modules/mob/living/simple_animal/hostile/tree.dm @@ -50,8 +50,8 @@ L.Weaken(3) L.visible_message("\The [src] knocks down \the [L]!") -/mob/living/simple_animal/hostile/tree/Die() - ..() +/mob/living/simple_animal/hostile/tree/death(gibbed) + ..(gibbed) visible_message("[src] is hacked into pieces!") new /obj/item/stack/sheet/mineral/wood(loc) qdel(src) @@ -64,8 +64,8 @@ icon_dead = "festivus_pole" icon_gib = "festivus_pole" -/mob/living/simple_animal/hostile/tree/festivus/Die() - ..() +/mob/living/simple_animal/hostile/tree/festivus/death(gibbed) + ..(gibbed) visible_message("[src] is hacked into pieces!") new /obj/item/stack/rods(loc) qdel(src) diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index d49855fc02f..27549fcbfbc 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -113,12 +113,12 @@ /mob/living/simple_animal/parrot/proc/toggle_mode) -/mob/living/simple_animal/parrot/Die() +/mob/living/simple_animal/parrot/death(gibbed) if(held_item) held_item.loc = src.loc held_item = null walk(src,0) - ..() + ..(gibbed) /mob/living/simple_animal/parrot/Stat() ..() diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 0570e89ff65..b6bb2e9d2aa 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -81,13 +81,12 @@ ..() /mob/living/simple_animal/updatehealth() + if(health > maxHealth) + health = maxHealth return /mob/living/simple_animal/Life() - update_gravity(mob_has_gravity()) - - //Health if(stat == DEAD) if(health > 0) icon_state = icon_living @@ -98,21 +97,12 @@ update_canmove() return 0 + updatehealth() - if(health < 1 && stat != DEAD) - Die() - - if(health > maxHealth) - health = maxHealth - - if(stunned) - AdjustStunned(-1) - if(weakened) - AdjustWeakened(-1) - if(paralysis) - AdjustParalysis(-1) - - adjustEarDamage((ear_damage < 25 ? -0.05 : 0), -1) + if(health < 1) + death() + else + handle_regular_status_updates() //Movement if(!client && !stop_automated_movement && wander) @@ -392,22 +382,14 @@ if(statpanel("Status")) stat(null, "Health: [round((health / maxHealth) * 100)]%") -/mob/living/simple_animal/proc/Die() +/mob/living/simple_animal/death(gibbed) health = 0 // so /mob/living/simple_animal/Life() doesn't magically revive them - dead_mob_list += src icon_state = icon_dead stat = DEAD density = 0 - return - -/mob/living/simple_animal/death(gibbed) - if(stat == DEAD) - return - if(!gibbed) visible_message("\the [src] stops moving...") - - Die() + ..() /mob/living/simple_animal/ex_act(severity, target) ..() @@ -426,7 +408,7 @@ /mob/living/simple_animal/adjustBruteLoss(damage) health = Clamp(health - damage, 0, maxHealth) if(health < 1 && stat != DEAD) - Die() + death() /mob/living/simple_animal/proc/CanAttack(var/atom/the_target) if(see_invisible < the_target.invisibility) diff --git a/tgstation.dme b/tgstation.dme index a74a3ce7694..a923cd4885f 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1045,6 +1045,7 @@ #include "code\modules\mob\living\damage_procs.dm" #include "code\modules\mob\living\death.dm" #include "code\modules\mob\living\emote.dm" +#include "code\modules\mob\living\life.dm" #include "code\modules\mob\living\living.dm" #include "code\modules\mob\living\living_defense.dm" #include "code\modules\mob\living\living_defines.dm"