First big chunk of the refactor

mid-refactor of `take_overall_damage`

Fully refactors the (?:take|heal)_(?:overall|organ)_damage procs

Allows the dead to examine

Removes the `blinded` var

Refactor cyborg components so vision loss is instant

Robot life/death updates instantly

Adds instant updates for damage overlays and HUD icons for humans

Final reconciliation with the species refactor

Adds a stat debugging system and debugging logs

Also fixes instant death on species change

"Debugging logs" are used for stuff an admin wouldn't care about but
someone debugging would

I used it to fix people dying instantly when changing species due to
temporary deletion of the brain

Fox's requests

Adds a more careful updating system to our reagents system
This commit is contained in:
Crazylemon64
2018-07-16 13:54:30 -07:00
parent 280905bc20
commit 3db4229918
174 changed files with 3299 additions and 2045 deletions
-1
View File
@@ -54,7 +54,6 @@
H.Stun(3)
if(affecting)
affecting.receive_damage(1, 0)
H.updatehealth()
else if(ismouse(target))
var/mob/living/simple_animal/mouse/M = target
visible_message("<span class='danger'>SPLAT!</span>")
@@ -262,8 +262,9 @@
return list()
/mob/living/simple_animal/hostile/syndicate/ranged/wildwest/death(gibbed)
if(!on_alert)
// putting this up here so we don't say anything after deathgasp
if(can_die() && !on_alert)
say("How could you betray the Syndicate?")
for(var/mob/living/simple_animal/hostile/syndicate/ranged/wildwest/W in living_mob_list)
W.on_alert = TRUE
..(gibbed)
return ..(gibbed)
+3 -3
View File
@@ -301,7 +301,7 @@ Gunshots/explosions/opening doors/less rare audio (done)
if(bubblegum.Adjacent(target) && !charged)
charged = TRUE
target.Weaken(4)
target.staminaloss += 40
target.adjustStaminaLoss(40)
step_away(target, bubblegum)
shake_camera(target, 4, 3)
target.visible_message("<span class='warning'>[target] jumps backwards, falling on the ground!</span>","<span class='userdanger'>[bubblegum] slams into you!</span>")
@@ -637,7 +637,7 @@ Gunshots/explosions/opening doors/less rare audio (done)
if(weapon_name)
my_target.playsound_local(my_target, weap.hitsound, 1)
my_target.show_message("<span class='danger'>[src.name] has attacked [my_target] with [weapon_name]!</span>", 1)
my_target.staminaloss += 30
my_target.adjustStaminaLoss(30)
if(prob(20))
my_target.AdjustEyeBlurry(3)
if(prob(33))
@@ -646,7 +646,7 @@ Gunshots/explosions/opening doors/less rare audio (done)
else
my_target.playsound_local(my_target, pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg'), 25, 1, -1)
my_target.show_message("<span class='userdanger'>[src.name] has punched [my_target]!</span>", 1)
my_target.staminaloss += 30
my_target.adjustStaminaLoss(30)
if(prob(33))
if(!locate(/obj/effect/overlay) in my_target.loc)
fake_blood(my_target)
+5 -3
View File
@@ -92,12 +92,14 @@
..()
/mob/living/simple_animal/hostile/mining_drone/death()
..()
// Only execute the below if we successfully died
. = ..()
if(!.)
return FALSE
visible_message("<span class='danger'>[src] is destroyed!</span>")
new /obj/effect/decal/cleanable/blood/gibs/robot(src.loc)
DropOre(0)
qdel(src)
return
/mob/living/simple_animal/hostile/mining_drone/attack_hand(mob/living/carbon/human/M)
if(M.a_intent == INTENT_HELP)
@@ -307,4 +309,4 @@
origin_tech = "programming=6"
#undef MINEDRONE_COLLECT
#undef MINEDRONE_ATTACK
#undef MINEDRONE_ATTACK
@@ -12,7 +12,6 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi
stat = DEAD
density = 0
canmove = 0
blinded = 0
anchored = 1 // don't get pushed around
invisibility = INVISIBILITY_OBSERVER
var/can_reenter_corpse
+5 -87
View File
@@ -1,94 +1,12 @@
//This is the proc for gibbing a mob. Cannot gib ghosts.
//added different sort of gibs and animations. N
// can't die if you're not alive
/mob/proc/gib()
death(1)
var/atom/movable/overlay/animation = null
notransform = 1
canmove = 0
icon = null
invisibility = 101
return FALSE
playsound(src.loc, 'sound/goonstation/effects/gib.ogg', 50, 1)
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
// flick("gibbed-m", animation)
gibs(loc, dna)
dead_mob_list -= src
if(client)
respawnable_list += src
spawn(15)
if(animation) qdel(animation)
if(src) qdel(src)
//This is the proc for turning a mob into ash. Mostly a copy of gib code (above).
//Originally created for wizard disintegrate. I've removed the virus code since it's irrelevant here.
//Dusting robots does not eject the MMI, so it's a bit more powerful than gib() /N
/mob/proc/dust()
death(1)
var/atom/movable/overlay/animation = null
notransform = 1
canmove = 0
icon = null
invisibility = 101
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
// flick("dust-m", animation)
new /obj/effect/decal/cleanable/ash(loc)
dead_mob_list -= src
if(client)
respawnable_list += src
spawn(15)
if(animation) qdel(animation)
if(src) qdel(src)
return FALSE
/mob/proc/melt()
death(1)
var/atom/movable/overlay/animation = null
notransform = 1
canmove = 0
icon = null
invisibility = 101
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
// flick("liquify", animation)
// new /obj/effect/decal/cleanable/ash(loc)
dead_mob_list -= src
if(client)
respawnable_list += src
spawn(15)
if(animation) qdel(animation)
if(src) qdel(src)
return FALSE
/mob/proc/death(gibbed)
//Makes it so gib/dust/melt all unbuckle their victims from anything they may be buckled to to avoid breaking beds/chairs/etc
if(gibbed && buckled)
buckled.unbuckle_mob()
//Quick fix for corpses kept propped up in chairs. ~Z
drop_r_hand()
drop_l_hand()
//End of fix.
timeofdeath = world.time
living_mob_list -= src
dead_mob_list += src
if(client)
respawnable_list += src
return ..(gibbed)
return FALSE
+2 -2
View File
@@ -28,7 +28,7 @@
//non-verbal languages are garbled if you can't see the speaker. Yes, this includes if they are inside a closet.
if(language && (language.flags & NONVERBAL))
if(!has_vision()) //blind people can't see dumbass
if(!has_vision(information_only = TRUE)) //blind people can't see dumbass
message = stars(message)
if(!speaker || !(speaker in view(src)))
@@ -95,7 +95,7 @@
//non-verbal languages are garbled if you can't see the speaker. Yes, this includes if they are inside a closet.
if(language && (language.flags & NONVERBAL))
if(!has_vision()) //blind people can't see dumbass
if(!has_vision(information_only=TRUE)) //blind people can't see dumbass
message = stars(message)
if(!speaker || !(speaker in view(src)))
@@ -19,6 +19,8 @@
var/leaping = 0
ventcrawler = 2
var/list/alien_organs = list()
var/death_message = "lets out a waning guttural screech, green blood bubbling from its maw..."
var/death_sound = 'sound/voice/hiss6.ogg'
/mob/living/carbon/alien/New()
verbs += /mob/living/verb/mob_sleep
@@ -49,25 +51,25 @@
/mob/living/carbon/alien/adjustToxLoss(amount)
return
return STATUS_UPDATE_NONE
/mob/living/carbon/alien/adjustFireLoss(amount) // Weak to Fire
if(amount > 0)
..(amount * 2)
return ..(amount * 2)
else
..(amount)
return
return ..(amount)
/mob/living/carbon/alien/check_eye_prot()
return 2
/mob/living/carbon/alien/updatehealth()
/mob/living/carbon/alien/updatehealth(reason = "none given")
if(status_flags & GODMODE)
health = maxHealth
stat = CONSCIOUS
return
health = maxHealth - getOxyLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
update_stat("updatehealth([reason])")
/mob/living/carbon/alien/handle_environment(var/datum/gas_mixture/environment)
@@ -256,4 +258,4 @@ Des: Removes all infected images from the alien.
if(getBruteLoss() < 200)
return pick("xltrails_1", "xltrails_2")
else
return pick("xttrails_1", "xttrails_2")
return pick("xttrails_1", "xttrails_2")
@@ -36,7 +36,6 @@ In all, this is a lot like the monkey code. /N
"<span class='userdanger'>[M.name] bites [src]!</span>")
adjustBruteLoss(damage)
add_attack_logs(M, src, "Alien attack", ATKLOG_ALL)
updatehealth()
else
to_chat(M, "<span class='warning'>[name] is too injured for that.</span>")
@@ -75,4 +74,3 @@ In all, this is a lot like the monkey code. /N
adjustCloneLoss(damage)
if(STAMINA)
adjustStaminaLoss(damage)
updatehealth()
+9 -12
View File
@@ -43,18 +43,15 @@
if(src) qdel(src)
/mob/living/carbon/alien/death(gibbed)
if(stat == DEAD) return
if(healths) healths.icon_state = "health6"
stat = DEAD
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return FALSE
if(healths)
healths.icon_state = "health6"
if(!gibbed)
playsound(loc, 'sound/voice/hiss6.ogg', 80, 1, 1)
for(var/mob/O in viewers(src, null))
O.show_message("<B>[src]</B> lets out a waning guttural screech, green blood bubbling from its maw...", 1)
update_canmove()
if(death_sound)
playsound(loc, death_sound, 80, 1, 1)
visible_message("<B>[src]</B> [death_message]")
update_icons()
timeofdeath = world.time
if(mind) mind.store_memory("Time of death: [station_time_timestamp("hh:mm:ss", timeofdeath)]", 0)
return ..(gibbed)
@@ -73,10 +73,7 @@
AdjustEarDamage(15)
AdjustEarDeaf(60)
adjustBruteLoss(b_loss)
adjustFireLoss(f_loss)
updatehealth()
take_overall_damage(b_loss, f_loss)
/mob/living/carbon/alien/humanoid/attack_slime(mob/living/carbon/slime/M)
..()
@@ -85,7 +82,6 @@
damage = rand(10, 40)
adjustBruteLoss(damage)
add_attack_logs(src, M, "Slime'd for [damage] damage")
updatehealth()
return
/mob/living/carbon/alien/humanoid/restrained()
@@ -30,7 +30,6 @@
"<span class='danger'>You hear someone fall.</span>")
adjustBruteLoss(damage)
add_attack_logs(M, src, "Melee attacked with fists")
updatehealth()
else
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message("<span class='danger'>[M] has attempted to punch [src]!</span>")
@@ -56,4 +55,4 @@
/mob/living/carbon/alien/humanoid/do_attack_animation(atom/A, visual_effect_icon, obj/item/used_item, no_effect, end_pixel_y)
if(!no_effect && !visual_effect_icon)
visual_effect_icon = ATTACK_EFFECT_CLAW
..()
..()
@@ -44,12 +44,10 @@
updatehealth()
if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP
blinded = 1
SetSilence(0)
else //ALIVE. LIGHTS ARE ON
if(health < config.health_threshold_dead || !get_int_organ(/obj/item/organ/internal/brain))
death()
blinded = 1
SetSilence(0)
return 1
@@ -62,10 +60,8 @@
Paralyse(3)
if(paralysis)
blinded = 1
stat = UNCONSCIOUS
else if(sleeping)
blinded = 1
stat = UNCONSCIOUS
if(prob(10) && health)
emote("hiss")
@@ -77,12 +73,8 @@
if(move_delay_add > 0)
move_delay_add = max(0, move_delay_add - rand(1, 2))
//Eyes
if(disabilities & BLIND) //disabled-blind, doesn't get better on its own
blinded = 1
else if(eye_blind) //blindness, heals slowly over time
if(eye_blind) //blindness, heals slowly over time
AdjustEyeBlind(-1)
blinded = 1
else if(eye_blurry) //blurry eyes heal slowly
AdjustEyeBlurry(-1)
@@ -1,15 +0,0 @@
/mob/living/carbon/alien/larva/death(gibbed)
if(stat == DEAD) return
if(healths) healths.icon_state = "health6"
stat = DEAD
icon_state = "larva_dead"
if(!gibbed)
visible_message("<span class='name'>[src]</span> lets out a waning high-pitched cry.")
update_canmove()
timeofdeath = world.time
if(mind) mind.store_memory("Time of death: [station_time_timestamp("hh:mm:ss", timeofdeath)]", 0)
living_mob_list -= src
return ..(gibbed)
@@ -12,6 +12,8 @@
var/amount_grown = 0
var/max_grown = 200
var/time_of_birth
death_message = "lets out a waning high-pitched cry."
death_sound = null
//This is fine right now, if we're adding organ specific damage this needs to be updated
/mob/living/carbon/alien/larva/New()
@@ -11,12 +11,10 @@
updatehealth()
if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP
blinded = 1
SetSilence(0)
else //ALIVE. LIGHTS ARE ON
if(health < -25 || !get_int_organ(/obj/item/organ/internal/brain))
death()
blinded = 1
SetSilence(0)
return 1
@@ -30,10 +28,8 @@
Paralyse(3)
if(paralysis)
blinded = 1
stat = UNCONSCIOUS
else if(sleeping)
blinded = 1
stat = UNCONSCIOUS
if(prob(10) && health)
emote("hiss_")
@@ -45,12 +41,8 @@
if(move_delay_add > 0)
move_delay_add = max(0, move_delay_add - rand(1, 2))
//Eyes
if(disabilities & BLIND) //disabled-blind, doesn't get better on its own
blinded = 1
else if(eye_blind) //blindness, heals slowly over time
if(eye_blind) //blindness, heals slowly over time
AdjustEyeBlind(-1)
blinded = 1
else if(eye_blurry) //blurry eyes heal slowly
AdjustEyeBlurry(-1)
@@ -9,16 +9,10 @@
if(layer != TURF_LAYER+0.2)
layer = TURF_LAYER+0.2
to_chat(src, text("<span class='noticealien'>You are now hiding.</span>"))
for(var/mob/O in oviewers(src, null))
if((O.client && !( O.blinded )))
to_chat(O, text("<B>[] scurries to the ground!</B>", src))
visible_message("<B>[src] scurries to the ground!</B>", "<span class='noticealien'>You are now hiding.</span>")
else
layer = MOB_LAYER
to_chat(src, text("<span class=notice'>You have stopped hiding.</span>"))
for(var/mob/O in oviewers(src, null))
if((O.client && !( O.blinded )))
to_chat(O, text("[] slowly peaks up from the ground...", src))
visible_message("[src] slowly peeks up from the ground...", "<span class=notice'>You have stopped hiding.</span>")
/mob/living/carbon/alien/larva/verb/evolve()
set name = "Evolve"
+9 -25
View File
@@ -1,42 +1,26 @@
/mob/living/carbon/brain/death(gibbed)
if(stat == DEAD) return
// Only execute the below if we successfully died
. = ..()
if(!.)
return FALSE
if(!gibbed && container && istype(container, /obj/item/mmi))//If not gibbed but in a container.
for(var/mob/O in viewers(container, null))
O.show_message(text("<span class='danger'>[]'s MMI flatlines!</span>", src), 1, "<span class='warning'>You hear something flatline.</span>", 2)
visible_message("<span class='danger'>[src]'s MMI flatlines!</span>", "<span class='warning'>You hear something flatline.</span>")
container.icon_state = "mmi_dead"
stat = DEAD
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
timeofdeath = world.time
if(mind) mind.store_memory("Time of death: [station_time_timestamp("hh:mm:ss", timeofdeath)]", 0) //mind. ?
return ..(gibbed)
/mob/living/carbon/brain/gib()
death(1)
var/atom/movable/overlay/animation = null
// can we muster a parent call here?
if(!death(TRUE) && stat != DEAD)
return FALSE
notransform = 1
canmove = 0
icon = null
invisibility = 101
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
// flick("gibbed-m", animation)
gibs(loc, dna)
dead_mob_list -= src
if(container && istype(container, /obj/item/mmi))
qdel(container)//Gets rid of the MMI if there is one
if(loc)
if(istype(loc,/obj/item/organ/internal/brain))
qdel(loc)//Gets rid of the brain item
spawn(15)
if(animation) qdel(animation)
if(src) qdel(src)
QDEL_IN(src, 0)
+3 -10
View File
@@ -29,19 +29,12 @@
adjustFireLoss(5.0*discomfort)
/mob/living/carbon/brain/handle_regular_status_updates()
updatehealth()
. = ..()
if(stat == DEAD)
blinded = 1
SetSilence(0)
else
if(.)
if(!container && (health < config.health_threshold_dead || ((world.time - timeofhostdeath) > config.revival_brain_life)))
death()
blinded = 1
SetSilence(0)
return 1
. = 1
return 0
/mob/living/carbon/brain/breathe()
return
@@ -1,8 +1,16 @@
/mob/living/carbon/brain/update_stat()
/mob/living/carbon/brain/update_stat(reason = "none given")
if(status_flags & GODMODE)
return
// if(health <= min_health)
if(health <= config.health_threshold_dead)
if(stat != DEAD)
if(stat == DEAD)
if(container && health > config.health_threshold_dead)
update_revive()
create_debug_log("revived, trigger reason: [reason]")
return
else
if(!container || health <= config.health_threshold_dead)
// Considered "dead" without any external apparatus
death()
create_debug_log("died, trigger reason: [reason]")
return
// Put brain(organ) damaging code here
+2 -2
View File
@@ -60,7 +60,7 @@
if(organ.receive_damage(d, 0))
H.UpdateDamageIcon()
H.updatehealth()
H.updatehealth("stomach attack")
else
src.take_organ_damage(d)
@@ -144,7 +144,7 @@
return 0
if(reagents.has_reagent("teslium"))
shock_damage *= 1.5 //If the mob has teslium in their body, shocks are 50% more damaging!
take_overall_damage(0,shock_damage, used_weapon = "Electrocution")
take_overall_damage(0,shock_damage, TRUE, used_weapon = "Electrocution")
visible_message(
"<span class='danger'>[src] was shocked by \the [source]!</span>", \
"<span class='userdanger'>You feel a powerful shock coursing through your body!</span>", \
@@ -55,9 +55,9 @@
var/stunprob = M.powerlevel * 7 + 10
if(prob(stunprob) && M.powerlevel >= 8)
adjustFireLoss(M.powerlevel * rand(6,10))
updatehealth()
updatehealth("slime attack")
return 1
/mob/living/carbon/is_mouth_covered(head_only = FALSE, mask_only = FALSE)
if((!mask_only && head && (head.flags_cover & HEADCOVERSMOUTH)) || (!head_only && wear_mask && (wear_mask.flags_cover & MASKCOVERSMOUTH)))
return TRUE
return TRUE
+4 -5
View File
@@ -1,12 +1,11 @@
/mob/living/carbon/death(gibbed)
SetLoseBreath(0)
med_hud_set_health()
med_hud_set_status()
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return FALSE
if(reagents)
reagents.death_metabolize(src)
for(var/obj/item/organ/internal/I in internal_organs)
I.on_owner_death()
..(gibbed)
+27 -38
View File
@@ -1,5 +1,6 @@
/mob/living/carbon/human/gib()
death(1)
if(!death(TRUE) && stat != DEAD)
return FALSE
var/atom/movable/overlay/animation = null
notransform = 1
canmove = 0
@@ -43,13 +44,13 @@
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, src)
s.start()
spawn(15)
if(animation) qdel(animation)
if(src) qdel(src)
QDEL_IN(animation, 15)
QDEL_IN(src, 0)
return TRUE
/mob/living/carbon/human/dust()
death(1)
if(!death(TRUE) && stat != DEAD)
return FALSE
var/atom/movable/overlay/animation = null
notransform = 1
canmove = 0
@@ -63,13 +64,13 @@
flick("dust-h", animation)
new dna.species.remains_type(get_turf(src))
spawn(15)
if(animation) qdel(animation)
if(src) qdel(src)
QDEL_IN(src, 0)
QDEL_IN(animation, 15)
return TRUE
/mob/living/carbon/human/melt()
death(1)
if(!death(TRUE) && stat != DEAD)
return FALSE
var/atom/movable/overlay/animation = null
notransform = 1
canmove = 0
@@ -82,60 +83,48 @@
animation.master = src
flick("liquify", animation)
QDEL_IN(src, 0)
QDEL_IN(animation, 15)
//new /obj/effect/decal/remains/human(loc)
spawn(15)
if(animation) qdel(animation)
if(src) qdel(src)
return TRUE
/mob/living/carbon/human/death(gibbed)
if(stat == DEAD)
return
if(healths)
healths.icon_state = "health5"
if(!gibbed)
if(can_die() && !gibbed)
emote("deathgasp") //let the world KNOW WE ARE DEAD
stat = DEAD
SetDizzy(0)
SetJitter(0)
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return FALSE
set_heartattack(FALSE)
//Handle species-specific deaths.
if(dna.species)
dna.species.handle_hud_icons(src)
//Handle species-specific deaths.
dna.species.handle_death(src)
callHook("death", list(src, gibbed))
if(ishuman(LAssailant))
var/mob/living/carbon/human/H=LAssailant
if(H.mind)
H.mind.kills += "[key_name(src)]"
if(!gibbed)
update_canmove()
timeofdeath = world.time
med_hud_set_health()
med_hud_set_status()
if(mind) mind.store_memory("Time of death: [station_time_timestamp("hh:mm:ss", timeofdeath)]", 0)
if(ticker && ticker.mode)
// log_world("k")
sql_report_death(src)
ticker.mode.check_win() //Calls the rounds wincheck, mainly for wizard, malf, and changeling now
if(wearing_rig)
wearing_rig.notify_ai("<span class='danger'>Warning: user death event. Mobility control passed to integrated intelligence system.</span>")
return ..(gibbed)
/mob/living/carbon/human/update_revive()
. = ..()
// Update healthdoll
if(. && healthdoll)
// We're alive again, so re-build the entire healthdoll
healthdoll.cached_healthdoll_overlays.Cut()
// Update healthdoll
if(dna.species)
dna.species.update_sight(src)
dna.species.handle_hud_icons(src)
/mob/living/carbon/human/proc/makeSkeleton()
var/obj/item/organ/external/head/H = get_organ("head")
@@ -294,7 +294,7 @@
if(prob(50) && !shielded)
Paralyse(10)
take_overall_damage(b_loss,f_loss, used_weapon = "Explosive Blast")
take_overall_damage(b_loss,f_loss, TRUE, used_weapon = "Explosive Blast")
..()
@@ -1598,7 +1598,7 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
if(H.health > config.health_threshold_dead && H.health <= config.health_threshold_crit)
var/suff = min(H.getOxyLoss(), 7)
H.adjustOxyLoss(-suff)
H.updatehealth()
H.updatehealth("cpr")
visible_message("<span class='danger'>[src] performs CPR on [H.name]!</span>", \
"<span class='notice'>You perform CPR on [H.name].</span>")
@@ -1867,4 +1867,4 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
/mob/living/carbon/human/proc/special_post_clone_handling()
if(mind && mind.assigned_role == "Cluwne") //HUNKE your suffering never stops
makeCluwne()
makeCluwne()
@@ -1,5 +1,5 @@
//Updates the mob's health from organs and mob damage variables
/mob/living/carbon/human/updatehealth()
/mob/living/carbon/human/updatehealth(reason = "none given")
if(status_flags & GODMODE)
health = maxHealth
stat = CONSCIOUS
@@ -17,20 +17,14 @@
//TODO: fix husking
if(((maxHealth - total_burn) < config.health_threshold_dead) && stat == DEAD)
ChangeToHusk()
if(dna.species.can_revive_by_healing)
var/obj/item/organ/internal/brain/B = get_int_organ(/obj/item/organ/internal/brain)
if(B)
if((health >= (config.health_threshold_dead + config.health_threshold_crit) * 0.5) && stat == DEAD && getBrainLoss()<120)
update_revive()
if(stat == CONSCIOUS && (src in dead_mob_list)) //Defib fix
update_revive()
update_stat("updatehealth([reason])")
med_hud_set_health()
med_hud_set_status()
handle_hud_icons()
handle_hud_icons_health()
/mob/living/carbon/human/adjustBrainLoss(amount)
/mob/living/carbon/human/adjustBrainLoss(amount, updating = TRUE)
if(status_flags & GODMODE)
return 0 //godmode
return STATUS_UPDATE_NONE //godmode
if(dna.species && dna.species.has_organ["brain"])
var/obj/item/organ/internal/brain/sponge = get_int_organ(/obj/item/organ/internal/brain)
@@ -38,15 +32,13 @@
if(dna.species)
amount = amount * dna.species.brain_mod
sponge.receive_damage(amount, 1)
brainloss = sponge.damage
else
brainloss = 200
else
brainloss = 0
if(updating)
update_stat("adjustBrainLoss")
return STATUS_UPDATE_STAT
/mob/living/carbon/human/setBrainLoss(amount)
/mob/living/carbon/human/setBrainLoss(amount, updating = TRUE)
if(status_flags & GODMODE)
return 0 //godmode
return STATUS_UPDATE_NONE //godmode
if(dna.species && dna.species.has_organ["brain"])
var/obj/item/organ/internal/brain/sponge = get_int_organ(/obj/item/organ/internal/brain)
@@ -54,11 +46,9 @@
if(dna.species)
amount = amount * dna.species.brain_mod
sponge.damage = min(max(amount, 0), (maxHealth*2))
brainloss = sponge.damage
else
brainloss = 200
else
brainloss = 0
if(updating)
update_stat("setBrainLoss")
return STATUS_UPDATE_STAT
/mob/living/carbon/human/getBrainLoss()
if(status_flags & GODMODE)
@@ -67,12 +57,11 @@
if(dna.species && dna.species.has_organ["brain"])
var/obj/item/organ/internal/brain/sponge = get_int_organ(/obj/item/organ/internal/brain)
if(sponge)
brainloss = min(sponge.damage,maxHealth*2)
return min(sponge.damage,maxHealth*2)
else
brainloss = 200
return 200
else
brainloss = 0
return brainloss
return 0
//These procs fetch a cumulative total damage from all organs
/mob/living/carbon/human/getBruteLoss()
@@ -88,23 +77,27 @@
return amount
/mob/living/carbon/human/adjustBruteLoss(amount, damage_source, robotic=0)
/mob/living/carbon/human/adjustBruteLoss(amount, updating_health = TRUE, damage_source = null, robotic = FALSE)
if(dna.species)
amount = amount * dna.species.brute_mod
if(amount > 0)
take_overall_damage(amount, 0, used_weapon = damage_source)
take_overall_damage(amount, 0, updating_health, used_weapon = damage_source)
else
heal_overall_damage(-amount, 0, 0, robotic)
heal_overall_damage(-amount, 0, updating_health, FALSE, robotic)
// brainless default for now
return STATUS_UPDATE_HEALTH
/mob/living/carbon/human/adjustFireLoss(amount, damage_source, robotic=0)
/mob/living/carbon/human/adjustFireLoss(amount, updating_health = TRUE, damage_source = null, robotic = FALSE)
if(dna.species)
amount = amount * dna.species.burn_mod
if(amount > 0)
take_overall_damage(0, amount, used_weapon = damage_source)
take_overall_damage(0, amount, updating_health, used_weapon = damage_source)
else
heal_overall_damage(0, -amount, 0, robotic)
heal_overall_damage(0, -amount, updating_health, FALSE, robotic)
// brainless default for now
return STATUS_UPDATE_HEALTH
/mob/living/carbon/human/proc/adjustBruteLossByPart(amount, organ_name, obj/damage_source = null)
/mob/living/carbon/human/proc/adjustBruteLossByPart(amount, organ_name, obj/damage_source = null, updating_health = TRUE)
if(dna.species)
amount = amount * dna.species.brute_mod
@@ -112,13 +105,14 @@
var/obj/item/organ/external/O = get_organ(organ_name)
if(amount > 0)
O.receive_damage(amount, 0, sharp=is_sharp(damage_source), used_weapon=damage_source)
O.receive_damage(amount, 0, sharp=is_sharp(damage_source), used_weapon=damage_source, list(), FALSE, updating_health)
else
//if you don't want to heal robot organs, they you will have to check that yourself before using this proc.
O.heal_damage(-amount, 0, internal = 0, robo_repair = O.is_robotic())
O.heal_damage(-amount, 0, internal = 0, robo_repair = O.is_robotic(), updating_health = updating_health)
return STATUS_UPDATE_HEALTH
/mob/living/carbon/human/proc/adjustFireLossByPart(amount, organ_name, obj/damage_source = null)
/mob/living/carbon/human/proc/adjustFireLossByPart(amount, organ_name, obj/damage_source = null, updating_health = TRUE)
if(dna.species)
amount = amount * dna.species.burn_mod
@@ -126,22 +120,23 @@
var/obj/item/organ/external/O = get_organ(organ_name)
if(amount > 0)
O.receive_damage(0, amount, sharp=is_sharp(damage_source), used_weapon=damage_source)
O.receive_damage(0, amount, sharp=is_sharp(damage_source), used_weapon=damage_source, forbidden_limbs = list(), ignore_resists = FALSE, updating_health = updating_health)
else
//if you don't want to heal robot organs, they you will have to check that yourself before using this proc.
O.heal_damage(0, -amount, internal = 0, robo_repair = O.is_robotic())
O.heal_damage(0, -amount, internal = 0, robo_repair = O.is_robotic(), updating_health = updating_health)
return STATUS_UPDATE_HEALTH
/mob/living/carbon/human/Paralyse(amount)
// Notify our AI if they can now control the suit.
if(wearing_rig && !stat && paralysis < amount) //We are passing out right this second.
wearing_rig.notify_ai("<span class='danger'>Warning: user consciousness failure. Mobility control passed to integrated intelligence system.</span>")
..()
return ..()
/mob/living/carbon/human/adjustCloneLoss(amount)
if(dna.species)
amount = amount * dna.species.clone_mod
..()
. = ..()
var/heal_prob = max(0, 80 - getCloneLoss())
var/mut_prob = min(80, getCloneLoss() + 10)
@@ -181,22 +176,22 @@
/mob/living/carbon/human/adjustOxyLoss(amount)
if(dna.species)
amount = amount * dna.species.oxy_mod
..()
. = ..()
/mob/living/carbon/human/setOxyLoss(amount)
if(dna.species)
amount = amount * dna.species.oxy_mod
..()
. = ..()
/mob/living/carbon/human/adjustToxLoss(amount)
if(dna.species)
amount = amount * dna.species.tox_mod
..()
. = ..()
/mob/living/carbon/human/setToxLoss(amount)
if(dna.species)
amount = amount * dna.species.tox_mod
..()
. = ..()
////////////////////////////////////////////
@@ -223,31 +218,29 @@
//Heals ONE external organ, organ gets randomly selected from damaged ones.
//It automatically updates damage overlays if necesary
//It automatically updates health status
/mob/living/carbon/human/heal_organ_damage(brute, burn)
/mob/living/carbon/human/heal_organ_damage(brute, burn, updating_health = TRUE)
var/list/obj/item/organ/external/parts = get_damaged_organs(brute,burn)
if(!parts.len)
return
var/obj/item/organ/external/picked = pick(parts)
if(picked.heal_damage(brute,burn))
if(picked.heal_damage(brute,burn, updating_health))
UpdateDamageIcon()
updatehealth()
//Damages ONE external organ, organ gets randomly selected from damagable ones.
//It automatically updates damage overlays if necesary
//It automatically updates health status
/mob/living/carbon/human/take_organ_damage(brute, burn, sharp = 0, edge = 0)
/mob/living/carbon/human/take_organ_damage(brute, burn, updating_health = TRUE, sharp = 0, edge = 0)
var/list/obj/item/organ/external/parts = get_damageable_organs()
if(!parts.len)
return
var/obj/item/organ/external/picked = pick(parts)
if(picked.receive_damage(brute, burn, sharp))
if(picked.receive_damage(brute, burn, sharp, updating_health))
UpdateDamageIcon()
updatehealth()
speech_problem_flag = 1
//Heal MANY external organs, in random order
/mob/living/carbon/human/heal_overall_damage(brute, burn, internal=0, robotic=0)
/mob/living/carbon/human/heal_overall_damage(brute, burn, updating_health = TRUE, internal=0, robotic=0)
var/list/obj/item/organ/external/parts = get_damaged_organs(brute,burn)
var/update = 0
@@ -257,20 +250,21 @@
var/brute_was = picked.brute_dam
var/burn_was = picked.burn_dam
update |= picked.heal_damage(brute,burn, internal, robotic)
update |= picked.heal_damage(brute,burn, internal, robotic, updating_health = FALSE)
brute -= (brute_was-picked.brute_dam)
burn -= (burn_was-picked.burn_dam)
parts -= picked
updatehealth()
if(updating_health)
updatehealth("heal overall damage")
speech_problem_flag = 1
if(update)
UpdateDamageIcon()
// damage MANY external organs, in random order
/mob/living/carbon/human/take_overall_damage(brute, burn, sharp = 0, edge = 0, used_weapon = null)
/mob/living/carbon/human/take_overall_damage(brute, burn, updating_health = TRUE, used_weapon = null, sharp = 0, edge = 0)
if(status_flags & GODMODE)
return //godmode
var/list/obj/item/organ/external/parts = get_damageable_organs()
@@ -285,14 +279,15 @@
var/burn_was = picked.burn_dam
update |= picked.receive_damage(brute_per_part, burn_per_part, sharp, used_weapon)
update |= picked.receive_damage(brute_per_part, burn_per_part, sharp, used_weapon, list(), FALSE, FALSE)
brute -= (picked.brute_dam - brute_was)
burn -= (picked.burn_dam - burn_was)
parts -= picked
updatehealth()
if(updating_health)
updatehealth("take overall damage")
if(update)
UpdateDamageIcon()
@@ -364,7 +359,7 @@ This function restores all organs.
var/list/attack_bubble_recipients = list()
var/mob/living/user
for(var/mob/O in viewers(user, src))
if(O.client && !(O.blinded))
if(O.client && O.has_vision(information_only=TRUE))
attack_bubble_recipients.Add(O.client)
spawn(0)
var/image/dmgIcon = image('icons/effects/hit_blips.dmi', src, "dmg[rand(1,2)]",MOB_LAYER+1)
@@ -383,5 +378,5 @@ This function restores all organs.
UpdateDamageIcon()
// Will set our damageoverlay icon to the next level, which will then be set back to the normal level the next mob.Life().
updatehealth()
updatehealth("apply damage")
return 1
@@ -375,7 +375,7 @@ emp_act
var/obj/item/organ/external/affecting = get_organ(ran_zone(L.zone_sel.selecting))
var/armor_block = run_armor_check(affecting, "melee")
apply_damage(damage, BRUTE, affecting, armor_block)
updatehealth()
updatehealth("larva attack")
/mob/living/carbon/human/attack_alien(mob/living/carbon/alien/humanoid/M)
if(check_shields(0, M.name))
@@ -404,7 +404,7 @@ emp_act
"<span class='userdanger'>[M] has wounded [src]!</span>")
apply_effect(4, WEAKEN, armor_block)
add_attack_logs(M, src, "Alien attacked")
updatehealth()
updatehealth("alien attack")
if(M.a_intent == INTENT_DISARM)
if(prob(80))
@@ -434,7 +434,7 @@ emp_act
if(affected)
affected.add_autopsy_data(M.name, damage) // Add the mob's name to the autopsy data
apply_damage(damage, M.melee_damage_type, affecting, armor)
updatehealth()
updatehealth("animal attack")
/mob/living/carbon/human/attack_slime(mob/living/carbon/slime/M)
..()
@@ -473,7 +473,7 @@ emp_act
M.mech_toxin_damage(src)
else
return
updatehealth()
updatehealth("mech melee attack")
M.occupant_message("<span class='danger'>You hit [src].</span>")
visible_message("<span class='danger'>[src] has been hit by [M.name].</span>", \
@@ -502,4 +502,4 @@ emp_act
if(check_head && head && (head.flags_cover & HEADCOVERSEYES))
return TRUE
if(check_mask && wear_mask && (wear_mask.flags_cover & MASKCOVERSMOUTH))
return TRUE
return TRUE
@@ -578,8 +578,11 @@
return get_dist(get_turf(towhere), get_turf(src))
/mob/living/carbon/human/interactive/death()
// Only execute the below if we successfully died
. = ..()
if(!.)
return FALSE
saveVoice()
..()
/mob/living/carbon/human/interactive/hear_say(message, verb = "says", datum/language/language = null, italics = 0, mob/speaker = null, sound/speech_sound, sound_vol)
if(!istype(speaker, /mob/living/carbon/human/interactive))
+15 -24
View File
@@ -144,12 +144,12 @@
if(3)
emote("drool")
if(getBrainLoss() >= 100 && stat != 2) //you lapse into a coma and die without immediate aid; RIP. -Fox
if(getBrainLoss() >= 100 && stat != DEAD) //you lapse into a coma and die without immediate aid; RIP. -Fox
Weaken(20)
AdjustLoseBreath(10)
AdjustSilence(2)
if(getBrainLoss() >= 120 && stat != 2) //they died from stupidity--literally. -Fox
if(getBrainLoss() >= 120 && stat != DEAD) //they died from stupidity--literally. -Fox
visible_message("<span class='alert'><B>[src]</B> goes limp, [p_their()] facial expression utterly blank.</span>")
death()
@@ -339,16 +339,16 @@
if(bodytemperature >= dna.species.heat_level_1 && bodytemperature <= dna.species.heat_level_2)
throw_alert("temp", /obj/screen/alert/hot, 1)
take_overall_damage(burn=mult*HEAT_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature")
take_overall_damage(burn=mult*HEAT_DAMAGE_LEVEL_1, updating_health = TRUE, used_weapon = "High Body Temperature")
if(bodytemperature > dna.species.heat_level_2 && bodytemperature <= dna.species.heat_level_3)
throw_alert("temp", /obj/screen/alert/hot, 2)
take_overall_damage(burn=mult*HEAT_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature")
take_overall_damage(burn=mult*HEAT_DAMAGE_LEVEL_2, updating_health = TRUE, used_weapon = "High Body Temperature")
if(bodytemperature > dna.species.heat_level_3 && bodytemperature < INFINITY)
throw_alert("temp", /obj/screen/alert/hot, 3)
if(on_fire)
take_overall_damage(burn=mult*HEAT_DAMAGE_LEVEL_3, used_weapon = "Fire")
take_overall_damage(burn=mult*HEAT_DAMAGE_LEVEL_3, updating_health = TRUE, used_weapon = "Fire")
else
take_overall_damage(burn=mult*HEAT_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature")
take_overall_damage(burn=mult*HEAT_DAMAGE_LEVEL_2, updating_health = TRUE, used_weapon = "High Body Temperature")
else if(bodytemperature < dna.species.cold_level_1)
if(status_flags & GODMODE)
@@ -360,13 +360,13 @@
var/mult = dna.species.coldmod
if(bodytemperature >= dna.species.cold_level_2 && bodytemperature <= dna.species.cold_level_1)
throw_alert("temp", /obj/screen/alert/cold, 1)
take_overall_damage(burn=mult*COLD_DAMAGE_LEVEL_1, used_weapon = "Low Body Temperature")
take_overall_damage(burn=mult*COLD_DAMAGE_LEVEL_1, updating_health = TRUE, used_weapon = "Low Body Temperature")
if(bodytemperature >= dna.species.cold_level_3 && bodytemperature < dna.species.cold_level_2)
throw_alert("temp", /obj/screen/alert/cold, 2)
take_overall_damage(burn=mult*COLD_DAMAGE_LEVEL_2, used_weapon = "Low Body Temperature")
take_overall_damage(burn=mult*COLD_DAMAGE_LEVEL_2, updating_health = TRUE, used_weapon = "Low Body Temperature")
if(bodytemperature > -INFINITY && bodytemperature < dna.species.cold_level_3)
throw_alert("temp", /obj/screen/alert/cold, 3)
take_overall_damage(burn=mult*COLD_DAMAGE_LEVEL_3, used_weapon = "Low Body Temperature")
take_overall_damage(burn=mult*COLD_DAMAGE_LEVEL_3, updating_health = TRUE, used_weapon = "Low Body Temperature")
else
clear_alert("temp")
else
@@ -382,7 +382,7 @@
if(adjusted_pressure >= dna.species.hazard_high_pressure)
if(!(HEATRES in mutations))
var/pressure_damage = min( ( (adjusted_pressure / dna.species.hazard_high_pressure) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE)
take_overall_damage(brute=pressure_damage, used_weapon = "High Pressure")
take_overall_damage(brute=pressure_damage, updating_health = TRUE, used_weapon = "High Pressure")
throw_alert("pressure", /obj/screen/alert/highpressure, 2)
else
clear_alert("pressure")
@@ -396,7 +396,7 @@
if(COLDRES in mutations)
clear_alert("pressure")
else
take_overall_damage(brute=LOW_PRESSURE_DAMAGE, used_weapon = "Low Pressure")
take_overall_damage(brute=LOW_PRESSURE_DAMAGE, updating_health = TRUE, used_weapon = "Low Pressure")
throw_alert("pressure", /obj/screen/alert/lowpressure, 2)
@@ -657,8 +657,6 @@
handle_trace_chems()
updatehealth()
return //TODO: DEFERRED
/mob/living/carbon/human/handle_drunk()
@@ -744,13 +742,11 @@
heal_overall_damage(0.1, 0.1)
if(paralysis)
blinded = 1
stat = UNCONSCIOUS
else if(sleeping)
speech_problem_flag = 1
blinded = 1
stat = UNCONSCIOUS
if(mind)
@@ -761,7 +757,6 @@
adjustToxLoss(-1)
else if(status_flags & FAKEDEATH)
blinded = 1
stat = UNCONSCIOUS
//Vision //god knows why this is here
@@ -771,26 +766,21 @@
if(!dna.species.vision_organ) // Presumably if a species has no vision organs, they see via some other means.
SetEyeBlind(0)
blinded = 0
SetEyeBlurry(0)
else if(!vision || vision.is_broken()) // Vision organs cut out or broken? Permablind.
EyeBlind(2)
blinded = 1
EyeBlurry(2)
else
//blindness
if(disabilities & BLIND) // Disabled-blind, doesn't get better on its own
blinded = 1
else if(eye_blind) // Blindness, heals slowly over time
AdjustEyeBlind(-1)
blinded = 1
else if(istype(glasses, /obj/item/clothing/glasses/sunglasses/blindfold)) //resting your eyes with a blindfold heals blurry eyes faster
AdjustEyeBlurry(-3)
blinded = 1
//blurry sight
if(vision.is_bruised()) // Vision organs impaired? Permablurry.
@@ -826,7 +816,6 @@
else //dead
blinded = 1
SetSilence(0)
@@ -860,11 +849,13 @@
remoteview_target = null
reset_perspective(null)
dna.species.handle_vision(src)
/mob/living/carbon/human/handle_hud_icons()
dna.species.handle_hud_icons(src)
/mob/living/carbon/human/handle_hud_icons_health()
dna.species.handle_hud_icons_health(src)
handle_hud_icons_health_overlay()
/mob/living/carbon/human/handle_random_events()
// Puke if toxloss is too high
if(!stat)
@@ -504,43 +504,23 @@
/datum/species/proc/handle_can_equip(obj/item/I, slot, disable_warning = 0, mob/living/carbon/human/user)
return FALSE
/datum/species/proc/handle_vision(mob/living/carbon/human/H)
// Right now this just handles blind, blurry, and similar states
if(H.blinded || H.eye_blind)
H.overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
H.throw_alert("blind", /obj/screen/alert/blind)
else
H.clear_fullscreen("blind")
H.clear_alert("blind")
if(H.disabilities & NEARSIGHTED) //this looks meh but saves a lot of memory by not requiring to add var/prescription
if(H.glasses) //to every /obj/item
var/obj/item/clothing/glasses/G = H.glasses
if(G.prescription)
H.clear_fullscreen("nearsighted")
else
H.overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1)
else
H.overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1)
else
H.clear_fullscreen("nearsighted")
if(H.eye_blurry)
H.overlay_fullscreen("blurry", /obj/screen/fullscreen/blurry)
else
H.clear_fullscreen("blurry")
if(H.druggy)
H.overlay_fullscreen("high", /obj/screen/fullscreen/high)
H.throw_alert("high", /obj/screen/alert/high)
else
H.clear_fullscreen("high")
H.clear_alert("high")
/datum/species/proc/get_perceived_trauma(mob/living/carbon/human/H)
return 100 - ((NO_PAIN in species_traits) ? 0 : H.traumatic_shock) - H.getStaminaLoss()
/datum/species/proc/handle_hud_icons(mob/living/carbon/human/H)
if(!H.client)
return
handle_hud_icons_health(H)
H.handle_hud_icons_health_overlay()
handle_hud_icons_nutrition(H)
/datum/species/proc/handle_hud_icons_health(mob/living/carbon/H)
if(!H.client)
return
handle_hud_icons_health_side(H)
handle_hud_icons_health_doll(H)
/datum/species/proc/handle_hud_icons_health_side(mob/living/carbon/human/H)
if(H.healths)
if(H.stat == DEAD)
H.healths.icon_state = "health7"
@@ -550,7 +530,7 @@
if(SCREWYHUD_DEAD) H.healths.icon_state = "health7"
if(SCREWYHUD_HEALTHY) H.healths.icon_state = "health0"
else
switch(100 - ((NO_PAIN in species_traits) ? 0 : H.traumatic_shock) - H.staminaloss)
switch(get_perceived_trauma(H))
if(100 to INFINITY) H.healths.icon_state = "health0"
if(80 to 100) H.healths.icon_state = "health1"
if(60 to 80) H.healths.icon_state = "health2"
@@ -559,6 +539,7 @@
if(0 to 20) H.healths.icon_state = "health5"
else H.healths.icon_state = "health6"
/datum/species/proc/handle_hud_icons_health_doll(mob/living/carbon/human/H)
if(H.healthdoll)
if(H.stat == DEAD)
H.healthdoll.icon_state = "healthdoll_DEAD"
@@ -588,6 +569,7 @@
H.healthdoll.overlays -= (cached_overlays - new_overlays)
H.healthdoll.cached_healthdoll_overlays = new_overlays
/datum/species/proc/handle_hud_icons_nutrition(mob/living/carbon/human/H)
switch(H.nutrition)
if(NUTRITION_LEVEL_FULL to INFINITY)
H.throw_alert("nutrition", /obj/screen/alert/fat)
@@ -717,4 +699,4 @@ It'll return null if the organ doesn't correspond, so include null checks when u
random_species += initial(S.name)
var/picked_species = pick(random_species)
var/datum/species/selected_species = GLOB.all_species[picked_species]
return species_name ? picked_species : selected_species.type
return species_name ? picked_species : selected_species.type
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,20 @@
/mob/living/carbon/human/update_stat(reason = "none given")
if(status_flags & GODMODE)
return
..(reason)
if(stat != DEAD)
switch(getBrainLoss())
if(100 to 120)
Weaken(20)
create_debug_log("collapsed from brain damage, trigger reason: [reason]")
if(120 to INFINITY)
visible_message("<span class='alert'><B>[src]</B> goes limp, [p_their()] facial expression utterly blank.</span>")
death()
create_debug_log("died of brain damage, trigger reason: [reason]")
else
if(dna.species && dna.species.can_revive_by_healing)
var/obj/item/organ/internal/brain/B = get_int_organ(/obj/item/organ/internal/brain)
if(B)
if((health >= (config.health_threshold_dead + config.health_threshold_crit) * 0.5) && getBrainLoss()<120)
update_revive()
create_debug_log("revived from healing, trigger reason: [reason]")
+55 -87
View File
@@ -219,19 +219,19 @@
radiation--
if(prob(25))
adjustToxLoss(1)
updatehealth()
updatehealth("handle mutations and radiation(0-50)")
if(50 to 75)
radiation -= 2
adjustToxLoss(1)
if(prob(5))
radiation -= 5
updatehealth()
updatehealth("handle mutations and radiation(50-75)")
if(75 to 100)
radiation -= 3
adjustToxLoss(3)
updatehealth()
updatehealth("handle mutations and radiation(75-100)")
radiation = Clamp(radiation, 0, 100)
@@ -259,39 +259,11 @@
M.adjustBruteLoss(5)
nutrition += 10
//This updates the health and status of the mob (conscious, unconscious, dead)
/mob/living/carbon/handle_regular_status_updates()
if(..()) //alive
if(health <= config.health_threshold_dead)
death()
return
if(getOxyLoss() > 50 || health <= config.health_threshold_crit)
Paralyse(3)
stat = UNCONSCIOUS
if(sleeping)
stat = UNCONSCIOUS
return 1
/mob/living/carbon/proc/CheckStamina()
if(staminaloss)
var/total_health = (health - staminaloss)
if(total_health <= config.health_threshold_softcrit && !stat)
to_chat(src, "<span class='notice'>You're too exhausted to keep going...</span>")
Weaken(5)
setStaminaLoss(health - 2)
return
setStaminaLoss(max((staminaloss - 3), 0))
//this updates all special effects: stunned, sleeping, weakened, druggy, stuttering, etc..
/mob/living/carbon/handle_status_effects()
..()
CheckStamina()
setStaminaLoss(max((staminaloss - 3), 0))
var/restingpwr = 1 + 4 * resting
@@ -375,61 +347,6 @@
Sleeping(2)
return sleeping
//this handles hud updates. Calls update_vision() and handle_hud_icons()
/mob/living/carbon/handle_regular_hud_updates()
if(!client)
return 0
if(stat == UNCONSCIOUS && health <= config.health_threshold_crit)
var/severity = 0
switch(health)
if(-20 to -10) severity = 1
if(-30 to -20) severity = 2
if(-40 to -30) severity = 3
if(-50 to -40) severity = 4
if(-60 to -50) severity = 5
if(-70 to -60) severity = 6
if(-80 to -70) severity = 7
if(-90 to -80) severity = 8
if(-95 to -90) severity = 9
if(-INFINITY to -95) severity = 10
overlay_fullscreen("crit", /obj/screen/fullscreen/crit, severity)
else
clear_fullscreen("crit")
if(oxyloss)
var/severity = 0
switch(oxyloss)
if(10 to 20) severity = 1
if(20 to 25) severity = 2
if(25 to 30) severity = 3
if(30 to 35) severity = 4
if(35 to 40) severity = 5
if(40 to 45) severity = 6
if(45 to INFINITY) severity = 7
overlay_fullscreen("oxy", /obj/screen/fullscreen/oxy, severity)
else
clear_fullscreen("oxy")
//Fire and Brute damage overlay (BSSR)
var/hurtdamage = getBruteLoss() + getFireLoss() + damageoverlaytemp
damageoverlaytemp = 0 // We do this so we can detect if someone hits us or not.
if(hurtdamage)
var/severity = 0
switch(hurtdamage)
if(5 to 15) severity = 1
if(15 to 30) severity = 2
if(30 to 45) severity = 3
if(45 to 70) severity = 4
if(70 to 85) severity = 5
if(85 to INFINITY) severity = 6
overlay_fullscreen("brute", /obj/screen/fullscreen/brute, severity)
else
clear_fullscreen("brute")
..()
return 1
/mob/living/carbon/update_sight()
if(!client)
return
@@ -464,6 +381,9 @@
return
/mob/living/carbon/handle_hud_icons_health()
if(!client)
return
if(healths)
if(stat != DEAD)
switch(health)
@@ -483,3 +403,51 @@
healths.icon_state = "health6"
else
healths.icon_state = "health7"
handle_hud_icons_health_overlay()
/mob/living/carbon/proc/handle_hud_icons_health_overlay()
if(stat == UNCONSCIOUS && health <= config.health_threshold_crit)
var/severity = 0
switch(health)
if(-20 to -10) severity = 1
if(-30 to -20) severity = 2
if(-40 to -30) severity = 3
if(-50 to -40) severity = 4
if(-60 to -50) severity = 5
if(-70 to -60) severity = 6
if(-80 to -70) severity = 7
if(-90 to -80) severity = 8
if(-95 to -90) severity = 9
if(-INFINITY to -95) severity = 10
overlay_fullscreen("crit", /obj/screen/fullscreen/crit, severity)
else if(stat == CONSCIOUS)
clear_fullscreen("crit")
if(oxyloss)
var/severity = 0
switch(oxyloss)
if(10 to 20) severity = 1
if(20 to 25) severity = 2
if(25 to 30) severity = 3
if(30 to 35) severity = 4
if(35 to 40) severity = 5
if(40 to 45) severity = 6
if(45 to INFINITY) severity = 7
overlay_fullscreen("oxy", /obj/screen/fullscreen/oxy, severity)
else
clear_fullscreen("oxy")
//Fire and Brute damage overlay (BSSR)
var/hurtdamage = getBruteLoss() + getFireLoss() + damageoverlaytemp
damageoverlaytemp = 0 // We do this so we can detect if someone hits us or not.
if(hurtdamage)
var/severity = 0
switch(hurtdamage)
if(5 to 15) severity = 1
if(15 to 30) severity = 2
if(30 to 45) severity = 3
if(45 to 70) severity = 4
if(70 to 85) severity = 5
if(85 to INFINITY) severity = 6
overlay_fullscreen("brute", /obj/screen/fullscreen/brute, severity)
else
clear_fullscreen("brute")
+5 -11
View File
@@ -1,6 +1,8 @@
/mob/living/carbon/slime/death(gibbed)
if(stat == DEAD)
return
// Only execute the below if we successfully died
. = ..()
if(!.)
return FALSE
if(!gibbed)
if(is_adult)
var/mob/living/carbon/slime/M = new /mob/living/carbon/slime(loc)
@@ -15,13 +17,5 @@
return
else
visible_message("<b>The [name]</b> seizes up and falls limp...")
stat = DEAD
icon_state = "[colour] baby slime dead"
overlays.len = 0
update_canmove()
if(ticker && ticker.mode)
ticker.mode.check_win()
return ..(gibbed)
overlays.Cut()
+2 -7
View File
@@ -131,7 +131,7 @@
else // a hot place
bodytemperature += adjust_body_temperature(bodytemperature, loc_temp, 1)
updatehealth()
updatehealth("handle environment")
return //TODO: DEFERRED
@@ -163,7 +163,7 @@
if(reagents.get_reagent_amount("epinephrine")>=5)
mutation_chance = max(mutation_chance - 5,0) //Prevents mutation chance going <0%
reagents.remove_reagent("epinephrine", 5)
updatehealth()
updatehealth("handle chemicals in body")
return //TODO: DEFERRED
@@ -195,7 +195,6 @@
if(src.stat == DEAD)
src.lying = 1
src.blinded = 1
else
if(src.paralysis || src.stunned || src.weakened || (status_flags && FAKEDEATH)) //Stunned etc.
if(src.stunned > 0)
@@ -207,7 +206,6 @@
src.stat = 0
if(src.paralysis > 0)
AdjustParalysis(-1)
src.blinded = 0
src.lying = 0
src.stat = 0
@@ -219,7 +217,6 @@
if(src.eye_blind)
src.SetEyeBlind(0)
src.blinded = 1
if(src.ear_deaf > 0) SetEarDeaf(0)
if(src.ear_damage < 25)
@@ -227,8 +224,6 @@
src.density = !( src.lying )
if(src.disabilities & BLIND)
src.blinded = 1
if(src.disabilities & DEAF)
EarDeaf(1)
@@ -102,9 +102,9 @@
adjustFireLoss(-10)
adjustCloneLoss(-10)
updatehealth()
updatehealth("slime feeding")
if(Victim)
Victim.updatehealth()
Victim.updatehealth("slime feeding")
sleep(rand(15,45))
@@ -1,15 +1,29 @@
/mob/living/carbon/update_stat()
/mob/living/carbon/update_stat(reason = "none given")
if(status_flags & GODMODE)
return
if(stat != DEAD)
// if(health <= min_health)
if(health <= config.health_threshold_dead)
death()
create_debug_log("died of damage, trigger reason: [reason]")
return
// if(paralysis || sleeping || getOxyLoss() > low_oxy_ko || (status_flags & FAKEDEATH) || health <= crit_health)
if(paralysis || sleeping || getOxyLoss() > 50 || (status_flags & FAKEDEATH) || health <= config.health_threshold_crit)
if(stat == CONSCIOUS)
KnockOut()
create_debug_log("fell unconscious, trigger reason: [reason]")
else
if(stat == UNCONSCIOUS)
WakeUp()
create_debug_log("woke up, trigger reason: [reason]")
/mob/living/carbon/update_stamina()
..()
if(staminaloss)
var/total_health = (health - staminaloss)
if(total_health <= config.health_threshold_softcrit && !stat)
to_chat(src, "<span class='notice'>You're too exhausted to keep going...</span>")
Weaken(5)
setStaminaLoss(health - 2)
handle_hud_icons_health()
return
+204 -2
View File
@@ -24,7 +24,7 @@
adjustCloneLoss(damage * blocked)
if(STAMINA)
adjustStaminaLoss(damage * blocked)
updatehealth()
updatehealth("apply damage")
return 1
/mob/living/proc/apply_damage_type(damage = 0, damagetype = BRUTE) //like apply damage except it always uses the damage procs
@@ -83,7 +83,7 @@
if(JITTER)
if(status_flags & CANSTUN)
Jitter(effect * blocked)
updatehealth()
updatehealth("apply effect")
return 1
/mob/living/proc/apply_effects(var/stun = 0, var/weaken = 0, var/paralyze = 0, var/irradiate = 0, var/slur = 0, var/stutter = 0, var/eyeblur = 0, var/drowsy = 0, var/blocked = 0, var/stamina = 0, var/jitter = 0)
@@ -99,3 +99,205 @@
if(stamina) apply_damage(stamina, STAMINA, null, blocked)
if(jitter) apply_effect(jitter, JITTER, blocked)
return 1
/mob/living/proc/getBruteLoss()
return bruteloss
/mob/living/proc/adjustBruteLoss(var/amount, updating_health = TRUE)
if(status_flags & GODMODE)
return FALSE //godmode
var/old_bruteloss = bruteloss
bruteloss = min(max(bruteloss + amount, 0),(maxHealth*2))
if(old_bruteloss == bruteloss)
updating_health = FALSE
. = STATUS_UPDATE_NONE
else
. = STATUS_UPDATE_HEALTH
if(updating_health)
updatehealth("adjustBruteLoss")
/mob/living/proc/getOxyLoss()
return oxyloss
/mob/living/proc/adjustOxyLoss(var/amount, updating_health = TRUE)
if(status_flags & GODMODE)
return FALSE //godmode
var/old_oxyloss = oxyloss
oxyloss = min(max(oxyloss + amount, 0),(maxHealth*2))
if(old_oxyloss == oxyloss)
updating_health = FALSE
. = STATUS_UPDATE_NONE
else
. = STATUS_UPDATE_HEALTH
if(updating_health)
updatehealth("adjustOxyLoss")
/mob/living/proc/setOxyLoss(amount, updating_health = TRUE)
if(status_flags & GODMODE)
return FALSE //godmode
var/old_oxyloss = oxyloss
oxyloss = amount
if(old_oxyloss == oxyloss)
updating_health = FALSE
. = STATUS_UPDATE_NONE
else
. = STATUS_UPDATE_HEALTH
if(updating_health)
updatehealth("setOxyLoss")
/mob/living/proc/getToxLoss()
return toxloss
/mob/living/proc/adjustToxLoss(var/amount, updating_health = TRUE)
if(status_flags & GODMODE)
return FALSE //godmode
var/old_toxloss = toxloss
toxloss = min(max(toxloss + amount, 0),(maxHealth*2))
if(old_toxloss == toxloss)
updating_health = FALSE
. = STATUS_UPDATE_NONE
else
. = STATUS_UPDATE_HEALTH
if(updating_health)
updatehealth("adjustToxLoss")
/mob/living/proc/setToxLoss(var/amount, updating_health = TRUE)
if(status_flags & GODMODE)
return FALSE //godmode
var/old_toxloss = toxloss
toxloss = amount
if(old_toxloss == toxloss)
updating_health = FALSE
. = STATUS_UPDATE_NONE
else
. = STATUS_UPDATE_HEALTH
if(updating_health)
updatehealth("setToxLoss")
/mob/living/proc/getFireLoss()
return fireloss
/mob/living/proc/adjustFireLoss(var/amount, updating_health = TRUE)
if(status_flags & GODMODE)
return FALSE //godmode
var/old_fireloss = fireloss
fireloss = min(max(fireloss + amount, 0),(maxHealth*2))
if(old_fireloss == fireloss)
updating_health = FALSE
. = STATUS_UPDATE_NONE
else
. = STATUS_UPDATE_HEALTH
if(updating_health)
updatehealth("adjustFireLoss")
/mob/living/proc/getCloneLoss()
return cloneloss
/mob/living/proc/adjustCloneLoss(var/amount, updating_health = TRUE)
if(status_flags & GODMODE)
return FALSE //godmode
var/old_cloneloss = cloneloss
cloneloss = min(max(cloneloss + amount, 0),(maxHealth*2))
if(old_cloneloss == cloneloss)
updating_health = FALSE
. = STATUS_UPDATE_NONE
else
. = STATUS_UPDATE_HEALTH
if(updating_health)
updatehealth("adjustCloneLoss")
/mob/living/proc/setCloneLoss(var/amount, updating_health = TRUE)
if(status_flags & GODMODE) return 0 //godmode
var/old_cloneloss = cloneloss
cloneloss = amount
if(old_cloneloss == cloneloss)
updating_health = FALSE
. = STATUS_UPDATE_NONE
else
. = STATUS_UPDATE_HEALTH
if(updating_health)
updatehealth("setCloneLoss")
/mob/living/proc/getBrainLoss()
return 0
/mob/living/proc/adjustBrainLoss(amount, updating = TRUE)
return STATUS_UPDATE_NONE
/mob/living/proc/setBrainLoss(amount, updating = TRUE)
return STATUS_UPDATE_NONE
/mob/living/proc/getStaminaLoss()
return staminaloss
/mob/living/proc/adjustStaminaLoss(amount, updating = TRUE)
if(status_flags & GODMODE)
return FALSE
var/old_stamloss = staminaloss
staminaloss = min(max(staminaloss + amount, 0),(maxHealth*2))
if(old_stamloss == staminaloss)
updating = FALSE
. = STATUS_UPDATE_NONE
else
. = STATUS_UPDATE_STAMINA
if(updating)
handle_hud_icons_health()
update_stamina()
/mob/living/proc/setStaminaLoss(amount, updating = TRUE)
if(status_flags & GODMODE)
return FALSE
var/old_stamloss = staminaloss
staminaloss = amount
if(old_stamloss == staminaloss)
updating = FALSE
. = STATUS_UPDATE_NONE
else
. = STATUS_UPDATE_STAMINA
if(updating)
handle_hud_icons_health()
update_stamina()
/mob/living/proc/getMaxHealth()
return maxHealth
/mob/living/proc/setMaxHealth(var/newMaxHealth)
maxHealth = newMaxHealth
// heal ONE external organ, organ gets randomly selected from damaged ones.
/mob/living/proc/heal_organ_damage(brute, burn, updating_health = TRUE)
adjustBruteLoss(-brute, FALSE)
adjustFireLoss(-burn, FALSE)
if(updating_health)
updatehealth("heal organ damage")
// damage ONE external organ, organ gets randomly selected from damaged ones.
/mob/living/proc/take_organ_damage(brute, burn, updating_health = TRUE)
if(status_flags & GODMODE)
return FALSE //godmode
adjustBruteLoss(brute, FALSE)
adjustFireLoss(burn, FALSE)
if(updating_health)
updatehealth("take organ damage")
// heal MANY external organs, in random order
/mob/living/proc/heal_overall_damage(brute, burn, updating_health = TRUE)
adjustBruteLoss(-brute, FALSE)
adjustFireLoss(-burn, FALSE)
if(updating_health)
updatehealth("heal overall damage")
// damage MANY external organs, in random order
/mob/living/proc/take_overall_damage(brute, burn, updating_health = TRUE, used_weapon = null)
if(status_flags & GODMODE)
return FALSE //godmode
adjustBruteLoss(brute, FALSE)
adjustFireLoss(burn, FALSE)
if(updating_health)
updatehealth("take overall damage")
/mob/living/proc/has_organic_damage()
return (maxHealth - health)
+76 -5
View File
@@ -1,12 +1,71 @@
//This is the proc for gibbing a mob. Cannot gib ghosts.
//added different sort of gibs and animations. N
/mob/living/gib()
if(!death(TRUE) && stat != DEAD)
return FALSE
// hide and freeze for the GC
notransform = 1
canmove = 0
icon = null
invisibility = 101
playsound(src.loc, 'sound/goonstation/effects/gib.ogg', 50, 1)
gibs(loc, dna)
QDEL_IN(src, 0)
return TRUE
//This is the proc for turning a mob into ash. Mostly a copy of gib code (above).
//Originally created for wizard disintegrate. I've removed the virus code since it's irrelevant here.
//Dusting robots does not eject the MMI, so it's a bit more powerful than gib() /N
/mob/living/dust()
if(!death(TRUE) && stat != DEAD)
return FALSE
new /obj/effect/decal/cleanable/ash(loc)
// hide and freeze them while they get GC'd
notransform = 1
canmove = 0
icon = null
invisibility = 101
QDEL_IN(src, 0)
return TRUE
/mob/living/melt()
if(!death(TRUE) && stat != DEAD)
return FALSE
// hide and freeze them while they get GC'd
notransform = 1
canmove = 0
icon = null
invisibility = 101
QDEL_IN(src, 0)
return TRUE
/mob/living/proc/can_die()
return !(stat == DEAD || (status_flags & GODMODE))
// Returns true if mob transitioned from live to dead
// Do a check with `can_die` beforehand if you need to do any
// handling before `stat` is set
/mob/living/death(gibbed)
blinded = max(blinded, 1)
if(!can_die())
// Whew! Good thing I'm indestructible! (or already dead)
return FALSE
stat = DEAD
SetDizzy(0)
SetJitter(0)
SetLoseBreath(0)
if(suiciding)
mind.suicided = TRUE
clear_fullscreens()
update_sight()
update_action_buttons_icon()
med_hud_set_health()
med_hud_set_status()
callHook("death", list(src, gibbed))
for(var/s in ownedSoullinks)
var/datum/soullink/S = s
S.ownerDies(gibbed, src)
@@ -14,7 +73,19 @@
var/datum/soullink/S = s
S.sharerDies(gibbed, src)
med_hud_set_health()
med_hud_set_status()
if(!gibbed)
update_canmove()
..(gibbed)
timeofdeath = world.time
living_mob_list -= src
dead_mob_list += src
if(mind)
mind.store_memory("Time of death: [station_time_timestamp("hh:mm:ss", timeofdeath)]", 0)
respawnable_list += src
if(ticker && ticker.mode)
ticker.mode.check_win()
// u no we dead
return TRUE
+3 -46
View File
@@ -8,12 +8,6 @@
return
var/datum/gas_mixture/environment = loc.return_air()
//Apparently, the person who wrote this code designed it so that
//blinded get reset each cycle and then get activated later in the
//code. Very ugly. I dont care. Moving this stuff here so its easy
//to find it.
blinded = null
if(stat != DEAD)
//Chemicals in the body
handle_chemicals_in_body()
@@ -51,8 +45,6 @@
handle_disabilities() // eye, ear, brain damages
handle_status_effects() //all special effects, stunned, weakened, jitteryness, hallucination, sleeping, etc
update_canmove(1) // set to 1 to not update icon action buttons; rip this argument out if Life is ever refactored to be non-stupid. -Fox
if(client)
//regular_hud_updates() //THIS DOESN'T FUCKING UPDATE SHIT
handle_regular_hud_updates() //IT JUST REMOVES FUCKING HUD IMAGES
@@ -90,21 +82,7 @@
//This updates the health and status of the mob (conscious, unconscious, dead)
/mob/living/proc/handle_regular_status_updates()
updatehealth()
if(stat != DEAD)
if(paralysis)
stat = UNCONSCIOUS
else if(status_flags & FAKEDEATH)
stat = UNCONSCIOUS
else
stat = CONSCIOUS
return 1
return stat != DEAD
//this updates all special effects: stunned, sleeping, weakened, druggy, stuttering, etc..
/mob/living/proc/handle_status_effects()
@@ -215,29 +193,6 @@
if(stat == DEAD)
return
if(blinded || eye_blind)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
throw_alert("blind", /obj/screen/alert/blind)
else
clear_fullscreen("blind")
clear_alert("blind")
if(disabilities & NEARSIGHTED)
overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1)
else
clear_fullscreen("nearsighted")
if(eye_blurry)
overlay_fullscreen("blurry", /obj/screen/fullscreen/blurry)
else
clear_fullscreen("blurry")
if(druggy)
overlay_fullscreen("high", /obj/screen/fullscreen/high)
throw_alert("high", /obj/screen/alert/high)
else
clear_fullscreen("high")
clear_alert("high")
if(machine)
if(!machine.check_eye(src))
@@ -247,6 +202,8 @@
reset_perspective(null)
/mob/living/proc/update_sight()
if(stat == DEAD)
grant_death_vision()
return
// Gives a mob the vision of being dead
+10 -121
View File
@@ -214,16 +214,14 @@
/mob/living/verb/succumb()
set hidden = 1
if(InCritical())
attack_log += "[src] has ["succumbed to death"] with [round(health, 0.1)] points of health!"
create_attack_log("[src] has ["succumbed to death"] with [round(health, 0.1)] points of health!")
adjustOxyLoss(health - config.health_threshold_dead)
updatehealth()
// super check for weird mobs, including ones that adjust hp
// we don't want to go overboard and gib them, though
for(var/i = 1 to 5)
if(health < config.health_threshold_dead)
break
take_overall_damage(max(5, health - config.health_threshold_dead), 0)
updatehealth()
to_chat(src, "<span class='notice'>You have given up life and succumbed to death.</span>")
/mob/living/proc/InCritical()
@@ -233,12 +231,15 @@
..()
flash_eyes()
/mob/living/proc/updatehealth()
/mob/living/proc/updatehealth(reason = "none given")
if(status_flags & GODMODE)
health = maxHealth
stat = CONSCIOUS
return
health = maxHealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
update_stat("updatehealth([reason])")
handle_hud_icons_health()
med_hud_set_health()
@@ -268,89 +269,6 @@
return temperature
// ++++ROCKDTBEN++++ MOB PROCS -- Ask me before touching.
// Stop! ... Hammertime! ~Carn
// I touched them without asking... I'm soooo edgy ~Erro (added nodamage checks)
// no ~Tigerkitty
/mob/living/proc/getBruteLoss()
return bruteloss
/mob/living/proc/adjustBruteLoss(var/amount)
if(status_flags & GODMODE) return 0 //godmode
bruteloss = min(max(bruteloss + amount, 0),(maxHealth*2))
/mob/living/proc/getOxyLoss()
return oxyloss
/mob/living/proc/adjustOxyLoss(var/amount)
if(status_flags & GODMODE) return 0 //godmode
oxyloss = min(max(oxyloss + amount, 0),(maxHealth*2))
/mob/living/proc/setOxyLoss(var/amount)
if(status_flags & GODMODE) return 0 //godmode
oxyloss = amount
/mob/living/proc/getToxLoss()
return toxloss
/mob/living/proc/adjustToxLoss(var/amount)
if(status_flags & GODMODE) return 0 //godmode
toxloss = min(max(toxloss + amount, 0),(maxHealth*2))
/mob/living/proc/setToxLoss(var/amount)
if(status_flags & GODMODE) return 0 //godmode
toxloss = amount
/mob/living/proc/getFireLoss()
return fireloss
/mob/living/proc/adjustFireLoss(var/amount)
if(status_flags & GODMODE) return 0 //godmode
fireloss = min(max(fireloss + amount, 0),(maxHealth*2))
/mob/living/proc/getCloneLoss()
return cloneloss
/mob/living/proc/adjustCloneLoss(var/amount)
if(status_flags & GODMODE) return 0 //godmode
cloneloss = min(max(cloneloss + amount, 0),(maxHealth*2))
/mob/living/proc/setCloneLoss(var/amount)
if(status_flags & GODMODE) return 0 //godmode
cloneloss = amount
/mob/living/proc/getBrainLoss()
return brainloss
/mob/living/proc/adjustBrainLoss(var/amount)
if(status_flags & GODMODE) return 0 //godmode
brainloss = min(max(brainloss + amount, 0),(maxHealth*2))
/mob/living/proc/setBrainLoss(var/amount)
if(status_flags & GODMODE) return 0 //godmode
brainloss = amount
/mob/living/proc/getStaminaLoss()
return staminaloss
/mob/living/proc/adjustStaminaLoss(var/amount)
if(status_flags & GODMODE) return 0
staminaloss = min(max(staminaloss + amount, 0),(maxHealth*2))
/mob/living/proc/setStaminaLoss(var/amount)
if(status_flags & GODMODE) return 0
staminaloss = amount
/mob/living/proc/getMaxHealth()
return maxHealth
/mob/living/proc/setMaxHealth(var/newMaxHealth)
maxHealth = newMaxHealth
// ++++ROCKDTBEN++++ MOB PROCS //END
/mob/proc/get_contents()
@@ -421,35 +339,6 @@
var/obj/item/organ/external/def_zone = ran_zone(t)
return def_zone
// heal ONE external organ, organ gets randomly selected from damaged ones.
/mob/living/proc/heal_organ_damage(var/brute, var/burn)
adjustBruteLoss(-brute)
adjustFireLoss(-burn)
updatehealth()
// damage ONE external organ, organ gets randomly selected from damaged ones.
/mob/living/proc/take_organ_damage(var/brute, var/burn)
if(status_flags & GODMODE) return 0 //godmode
adjustBruteLoss(brute)
adjustFireLoss(burn)
updatehealth()
// heal MANY external organs, in random order
/mob/living/proc/heal_overall_damage(var/brute, var/burn)
adjustBruteLoss(-brute)
adjustFireLoss(-burn)
updatehealth()
// damage MANY external organs, in random order
/mob/living/proc/take_overall_damage(var/brute, var/burn, var/used_weapon = null)
if(status_flags & GODMODE) return 0 //godmode
adjustBruteLoss(brute)
adjustFireLoss(burn)
updatehealth()
/mob/living/proc/has_organic_damage()
return (maxHealth - health)
/mob/living/proc/restore_all_organs()
return
@@ -474,6 +363,8 @@
C.reagents.clear_reagents()
C.reagents.addiction_list.Cut()
// rejuvenate: Called by `revive` to get the mob into a revivable state
// the admin "rejuvenate" command calls `revive`, not this proc.
/mob/living/proc/rejuvenate()
var/mob/living/carbon/human/human_mob = null //Get this declared for use later.
@@ -496,7 +387,6 @@
radiation = 0
SetDruggy(0)
SetHallucinate(0)
blinded = 0
nutrition = NUTRITION_LEVEL_FED + 50
bodytemperature = 310
CureBlind()
@@ -544,11 +434,10 @@
restore_all_organs()
surgeries.Cut() //End all surgeries.
if(stat == DEAD)
dead_mob_list -= src
living_mob_list += src
timeofdeath = 0
update_revive()
else if(stat == UNCONSCIOUS)
WakeUp()
stat = CONSCIOUS
update_fire()
regenerate_icons()
restore_blood()
+1 -1
View File
@@ -122,7 +122,7 @@
M.mech_toxin_damage(src)
else
return
updatehealth()
updatehealth("mech melee attack")
M.occupant_message("<span class='danger'>You hit [src].</span>")
visible_message("<span class='danger'>[src] has been hit by [M.name].</span>", \
"<span class='userdanger'>[src] has been hit by [M.name].</span>")
@@ -12,7 +12,6 @@
var/toxloss = 0 //Toxic damage caused by being poisoned or radiated
var/fireloss = 0 //Burn damage caused by being way too hot, too cold or burnt.
var/cloneloss = 0 //Damage caused by being cloned or ejected from the cloner early. slimes also deal cloneloss damage to victims
var/brainloss = 0 //'Retardation' damage caused by someone hitting you in the head with a bible or being infected with brainrot.
var/staminaloss = 0 //Stamina damage, or exhaustion. You recover it slowly naturally, and are stunned if it gets too high. Holodeck and hallucinations deal this.
@@ -67,4 +66,3 @@
hud_possible = list(HEALTH_HUD,STATUS_HUD,SPECIALROLE_HUD)
var/list/status_effects //a list of all status effects the mob has
+4 -2
View File
@@ -2,6 +2,8 @@
..()
//Mind updates
sync_mind()
update_stat("mob login")
update_sight()
//If they're SSD, remove it so they can wake back up.
player_logged = 0
@@ -11,8 +13,8 @@
to_chat(src, "<span class='notice'>You can ventcrawl! Use alt+click on vents to quickly travel about the station.</span>")
if(ranged_ability)
ranged_ability.add_ranged_ability(src, "<span class='notice'>You currently have <b>[ranged_ability]</b> active!</span>")
ranged_ability.add_ranged_ability(src, "<span class='notice'>You currently have <b>[ranged_ability]</b> active!</span>")
//Should update regardless of if we can ventcrawl, since we can end up in pipes in other ways.
update_pipe_vision()
-2
View File
@@ -549,7 +549,6 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/blob_act()
if(stat != 2)
adjustBruteLoss(60)
updatehealth()
return TRUE
return FALSE
@@ -685,7 +684,6 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/bullet_act(var/obj/item/projectile/Proj)
..(Proj)
updatehealth()
return 2
/mob/living/silicon/ai/reset_perspective(atom/A)
+6 -14
View File
@@ -1,19 +1,16 @@
/mob/living/silicon/ai/death(gibbed)
if(stat == DEAD)
return
stat = DEAD
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return FALSE
if(custom_sprite == 1)//check for custom AI sprite, defaulting to blue screen if no.
icon_state = "[ckey]-ai_dead"
else if("[icon_state]_dead" in icon_states(icon,1))
icon_state = "[icon_state]_dead"
else
icon_state = "ai_dead"
update_canmove()
if(eyeobj)
eyeobj.setLoc(get_turf(src))
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
shuttle_caller_list -= src
SSshuttle.autoEvac()
@@ -38,12 +35,7 @@
explosion(src.loc, 3, 6, 12, 15)
for(var/obj/machinery/ai_status_display/O in world) //change status
spawn( 0 )
O.mode = 2
if(istype(loc, /obj/item/aicard))
loc.icon_state = "aicard-404"
timeofdeath = world.time
if(mind) mind.store_memory("Time of death: [station_time_timestamp("hh:mm:ss", timeofdeath)]", 0)
return ..(gibbed)
if(istype(loc, /obj/item/aicard))
loc.icon_state = "aicard-404"
+11 -18
View File
@@ -14,13 +14,11 @@
reset_perspective(null)
unset_machine()
updatehealth()
updatehealth("life")
if(stat == DEAD)
return
update_gravity(mob_has_gravity())
if(health <= config.health_threshold_dead)
death()
return 0
if(!eyeobj || QDELETED(eyeobj) || !eyeobj.loc)
view_core()
@@ -44,21 +42,15 @@
var/area/my_area = get_area(src)
if(!lacks_power())
if(aiRestorePowerRoutine == 2)
to_chat(src, "Alert cancelled. Power has been restored without our assistance.")
if(aiRestorePowerRoutine > 1)
update_blind_effects()
aiRestorePowerRoutine = 0
clear_fullscreen("blind")
update_sight()
else if(aiRestorePowerRoutine == 3)
to_chat(src, "Alert cancelled. Power has been restored.")
aiRestorePowerRoutine = 0
clear_fullscreen("blind")
update_sight()
to_chat(src, "Alert cancelled. Power has been restored[aiRestorePowerRoutine == 2 ? "without our assistance" : ""].")
else
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
if(lacks_power())
if(!aiRestorePowerRoutine)
update_blind_effects()
aiRestorePowerRoutine = 1
update_sight()
to_chat(src, "<span class='danger'>You have lost power!</span>")
@@ -73,7 +65,7 @@
if(!lacks_power())
to_chat(src, "Alert cancelled. Power has been restored without our assistance.")
aiRestorePowerRoutine = 0
clear_fullscreen("blind")
update_blind_effects()
update_sight()
return
to_chat(src, "Fault confirmed: missing external power. Shutting down main control system to save power.")
@@ -112,7 +104,7 @@
if(!lacks_power())
to_chat(src, "Alert cancelled. Power has been restored without our assistance.")
aiRestorePowerRoutine = 0
clear_fullscreen("blind")
update_blind_effects()
update_sight()
return
@@ -143,12 +135,13 @@
if(get_nations_mode())
process_nations_ai()
/mob/living/silicon/ai/updatehealth()
/mob/living/silicon/ai/updatehealth(reason = "none given")
if(status_flags & GODMODE)
health = 100
stat = CONSCIOUS
else
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
update_stat("updatehealth([reason])")
diag_hud_set_status()
diag_hud_set_health()
@@ -1,10 +1,15 @@
/mob/living/silicon/ai/update_stat()
/mob/living/silicon/ai/update_stat(reason = "none given")
if(status_flags & GODMODE)
return
if(stat != DEAD)
if(health <= config.health_threshold_dead)
death()
create_debug_log("died of damage, trigger reason: [reason]")
return
else if(stat == UNCONSCIOUS)
WakeUp()
create_debug_log("woke up, trigger reason: [reason]")
//diag_hud_set_status()
/mob/living/silicon/ai/has_vision()
return ..() && !lacks_power()
@@ -1,10 +1,10 @@
/mob/living/silicon/decoy/death(gibbed)
if(stat == DEAD)
return
stat = DEAD
// Only execute the below if we successfully died
. = ..()
if(!.)
return FALSE
icon_state = "ai-crash"
for(var/obj/machinery/ai_status_display/O in world) //change status
if(atoms_share_level(O, src))
O.mode = 2
..(0)
gib()
gib()
@@ -2,17 +2,18 @@
return
/mob/living/silicon/decoy/updatehealth()
/mob/living/silicon/decoy/updatehealth(reason = "none given")
if(status_flags & GODMODE)
health = 100
stat = CONSCIOUS
else
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
update_stat()
update_stat("updatehealth([reason])")
/mob/living/silicon/decoy/update_stat()
/mob/living/silicon/decoy/update_stat(reason = "none given")
if(stat == DEAD)
return
if(health <= 0)
death()
death()
create_debug_log("died of damage, trigger reason: [reason]")
+11 -22
View File
@@ -1,28 +1,17 @@
/mob/living/silicon/pai/death(gibbed, cleanWipe)
if(stat == DEAD)
return
if(can_die())
if(!cleanWipe)
force_fold_out()
if(!cleanWipe)
force_fold_out()
visible_message("<span class=warning>[src] emits a dull beep before it loses power and collapses.</span>", "<span class=warning>You hear a dull beep followed by the sound of glass crunching.</span>")
name = "pAI debris"
desc = "The unfortunate remains of some poor personal AI device."
icon_state = "[chassis]_dead"
var/turf/T = get_turf_or_move(loc)
for(var/mob/M in viewers(T))
M.show_message("<span class='warning'>[src] emits a dull beep before it loses power and collapses.</span>", 3, "<span class='warning'>You hear a dull beep followed by the sound of glass crunching.</span>", 2)
name = "pAI debris"
desc = "The unfortunate remains of some poor personal AI device."
icon_state = "[chassis]_dead"
stat = DEAD
canmove = 0
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return FALSE
//var/tod = time2text(world.realtime,"hh:mm:ss") //weasellos time of death patch
//mind.store_memory("Time of death: [tod]", 0)
//New pAI's get a brand new mind to prevent meta stuff from their previous life. This new mind causes problems down the line if it's not deleted here.
//Read as: I have no idea what I'm doing but asking for help got me nowhere so this is what you get. - Nodrak
if(mind) qdel(mind)
living_mob_list -= src
if(icon_state != "[chassis]_dead" || cleanWipe)
qdel(src)
+2 -3
View File
@@ -18,11 +18,10 @@
qdel(src.cable)
cable = null
/mob/living/silicon/pai/updatehealth()
/mob/living/silicon/pai/updatehealth(reason = "none given")
if(status_flags & GODMODE)
health = 100
stat = CONSCIOUS
else
health = 100 - getBruteLoss() - getFireLoss()
if(health <= 0)
death(0)
update_stat("updatehealth([reason])")
+2 -8
View File
@@ -160,9 +160,8 @@
return 1
/mob/living/silicon/pai/blob_act()
if(stat != 2)
if(stat != DEAD)
adjustBruteLoss(60)
updatehealth()
return 1
return 0
@@ -238,7 +237,6 @@
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
add_attack_logs(M, src, "Animal attacked for [damage] damage")
adjustBruteLoss(damage)
updatehealth()
/mob/living/silicon/pai/proc/switchCamera(var/obj/machinery/camera/C)
usr:cameraFollow = null
@@ -454,9 +452,7 @@
if(stat == DEAD)
to_chat(user, "<span class='danger'>\The [src] is beyond help, at this point.</span>")
else if(getBruteLoss() || getFireLoss())
adjustBruteLoss(-15)
adjustFireLoss(-15)
updatehealth()
heal_overall_damage(15, 15)
N.use(1)
user.visible_message("<span class='notice'>[user.name] applied some [W] at [src]'s damaged areas.</span>",\
"<span class='notice'>You apply some [W] at [name]'s damaged areas.</span>")
@@ -467,7 +463,6 @@
else if(W.force)
visible_message("<span class='danger'>[user.name] attacks [src] with [W]!</span>")
adjustBruteLoss(W.force)
updatehealth()
else
visible_message("<span class='warning'>[user.name] bonks [src] harmlessly with [W].</span>")
spawn(1)
@@ -557,7 +552,6 @@
/mob/living/silicon/pai/bullet_act(var/obj/item/projectile/Proj)
..(Proj)
updatehealth()
if(stat != 2)
spawn(1)
close_up()
@@ -1,3 +1,4 @@
/mob/living/silicon/pai/update_stat()
/mob/living/silicon/pai/update_stat(reason = "none given")
if(health <= 0)
death(gibbed = 0)
create_debug_log("died of damage, trigger reason: [reason]")
@@ -21,7 +21,9 @@
src.owner = R
/datum/robot_component/proc/install()
go_online()
/datum/robot_component/proc/uninstall()
go_offline()
/datum/robot_component/proc/destroy()
if(wrapped)
@@ -34,34 +36,62 @@
installed = -1
uninstall()
/datum/robot_component/proc/take_damage(brute, electronics, sharp)
/datum/robot_component/proc/take_damage(brute, electronics, sharp, updating_health = TRUE)
if(installed != 1)
return
if(owner && updating_health)
owner.updatehealth("component '[src]' take damage")
brute_damage += brute
electronics_damage += electronics
if(brute_damage + electronics_damage >= max_damage)
destroy()
/datum/robot_component/proc/heal_damage(brute, electronics)
/datum/robot_component/proc/heal_damage(brute, electronics, updating_health = TRUE)
if(installed != 1)
// If it's not installed, can't repair it.
return 0
if(owner && updating_health)
owner.updatehealth("component '[src]' heal damage")
brute_damage = max(0, brute_damage - brute)
electronics_damage = max(0, electronics_damage - electronics)
/datum/robot_component/proc/is_powered()
return (installed == 1) && (brute_damage + electronics_damage < max_damage) && (powered)
/datum/robot_component/proc/consume_power()
if(toggled == 0)
powered = 0
return
powered = 1
/datum/robot_component/proc/disable()
if(!component_disabled)
go_offline()
component_disabled++
/datum/robot_component/proc/enable()
component_disabled--
if(!component_disabled)
go_online()
/datum/robot_component/proc/toggle()
toggled = !toggled
if(toggled)
go_online()
else
go_offline()
/datum/robot_component/proc/go_online()
return
/datum/robot_component/proc/go_offline()
return
/datum/robot_component/armour
name = "armour plating"
external_type = /obj/item/robot_parts/robot_component/armour
@@ -72,10 +102,25 @@
external_type = /obj/item/robot_parts/robot_component/actuator
max_damage = 50
/datum/robot_component/actuator/go_online()
owner.update_stat()
/datum/robot_component/actuator/go_offline()
owner.update_stat()
/datum/robot_component/cell
name = "power cell"
max_damage = 50
/datum/robot_component/cell/is_powered()
return ..() && owner.cell
/datum/robot_component/cell/go_online()
owner.update_stat()
/datum/robot_component/cell/go_offline()
owner.update_stat()
/datum/robot_component/cell/destroy()
..()
owner.cell = null
@@ -95,6 +140,14 @@
external_type = /obj/item/robot_parts/robot_component/camera
max_damage = 40
/datum/robot_component/camera/go_online()
owner.update_blind_effects()
owner.update_sight()
/datum/robot_component/camera/go_offline()
owner.update_blind_effects()
owner.update_sight()
/datum/robot_component/diagnosis_unit
name = "self-diagnosis unit"
external_type = /obj/item/robot_parts/robot_component/diagnosis_unit
@@ -117,9 +170,9 @@
/mob/living/silicon/robot/proc/disable_component(module_name, duration)
var/datum/robot_component/D = get_component(module_name)
D.component_disabled++
D.disable()
spawn(duration)
D.component_disabled--
D.enable()
// Returns component by it's string name
/mob/living/silicon/robot/proc/get_component(var/component_name)
@@ -154,6 +207,8 @@
name = "camera"
icon_state = "camera"
/obj/item/robot_parts/robot_component/diagnosis_unit
name = "diagnosis unit"
icon_state = "diagnosis_unit"
+14 -12
View File
@@ -46,11 +46,20 @@
/mob/living/silicon/robot/death(gibbed)
if(stat == DEAD) return
if(!gibbed)
emote("deathgasp")
stat = DEAD
update_canmove()
if(can_die())
if(!gibbed)
emote("deathgasp")
if(module)
module.handle_death(gibbed)
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return FALSE
diag_hud_set_status()
diag_hud_set_health()
if(camera)
camera.status = 0
update_headlamp(1) //So borg lights are disabled when killed.
@@ -59,13 +68,6 @@
var/obj/machinery/recharge_station/RC = loc
RC.go_out()
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
update_icons()
timeofdeath = world.time
if(mind) mind.store_memory("Time of death: [station_time_timestamp("hh:mm:ss", timeofdeath)]", 0)
sql_report_cyborg_death(src)
return ..(gibbed)
@@ -215,33 +215,13 @@
//DRONE LIFE/DEATH
//For some goddamn reason robots have this hardcoded. Redefining it for our fragile friends here.
/mob/living/silicon/robot/drone/updatehealth()
/mob/living/silicon/robot/drone/updatehealth(reason = "none given")
if(status_flags & GODMODE)
health = 35
stat = CONSCIOUS
return
health = 35 - (getBruteLoss() + getFireLoss())
return
//Easiest to check this here, then check again in the robot proc.
//Standard robots use config for crit, which is somewhat excessive for these guys.
//Drones killed by damage will gib.
/mob/living/silicon/robot/drone/handle_regular_status_updates()
if(health <= -35 && src.stat != DEAD)
timeofdeath = world.time
death() //Possibly redundant, having trouble making death() cooperate.
gib()
return
return ..() // If you don't return anything here, you won't update status effects, like weakening
/mob/living/silicon/robot/drone/death(gibbed)
if(module)
var/obj/item/gripper/G = locate(/obj/item/gripper) in module
if(G) G.drop_item()
..(gibbed)
update_stat("updatehealth([reason])")
//CONSOLE PROCS
@@ -1,24 +1,28 @@
//Redefining some robot procs, since drones can't be repaired and really shouldn't take component damage.
/mob/living/silicon/robot/drone/take_overall_damage(var/brute = 0, var/burn = 0, var/sharp = 0, var/used_weapon = null)
/mob/living/silicon/robot/drone/take_overall_damage(brute, burn, updating_health = TRUE, used_weapon = null, sharp = 0)
bruteloss += brute
fireloss += burn
if(updating_health)
updatehealth("take overall damage")
/mob/living/silicon/robot/drone/heal_overall_damage(var/brute, var/burn)
/mob/living/silicon/robot/drone/heal_overall_damage(brute, burn, updating_health = TRUE)
bruteloss -= brute
fireloss -= burn
if(bruteloss<0) bruteloss = 0
if(fireloss<0) fireloss = 0
if(updating_health)
updatehealth("heal overall damage")
/mob/living/silicon/robot/drone/take_organ_damage(var/brute = 0, var/burn = 0, var/sharp = 0)
take_overall_damage(brute,burn)
/mob/living/silicon/robot/drone/take_organ_damage(brute, burn, updating_health = TRUE, sharp = 0)
take_overall_damage(brute,burn, updating_health, null, sharp)
/mob/living/silicon/robot/drone/heal_organ_damage(var/brute, var/burn)
heal_overall_damage(brute,burn)
/mob/living/silicon/robot/drone/heal_organ_damage(brute, burn, updating_health = TRUE)
heal_overall_damage(brute,burn, updating_health)
/mob/living/silicon/robot/drone/getFireLoss()
return fireloss
/mob/living/silicon/robot/drone/getBruteLoss()
return bruteloss
return bruteloss
@@ -1,10 +1,11 @@
//Easiest to check this here, then check again in the robot proc.
//Standard robots use config for crit, which is somewhat excessive for these guys.
//Drones killed by damage will gib.
/mob/living/silicon/robot/drone/update_stat()
/mob/living/silicon/robot/drone/update_stat(reason = "none given")
if(status_flags & GODMODE)
return
if(health <= -35 && stat != DEAD)
gib()
create_debug_log("died of damage, trigger reason: [reason]")
return
return ..()
return ..(reason)
+5 -36
View File
@@ -21,22 +21,22 @@
/mob/living/silicon/robot/proc/handle_robot_cell()
if(stat != DEAD)
if(!is_component_functioning("power cell") || !cell)
Paralyse(2)
if(!is_component_functioning("power cell"))
uneq_all()
low_power_mode = 1
update_headlamp()
diag_hud_set_borgcell()
return
if(low_power_mode)
if(is_component_functioning("power cell") && cell && cell.charge)
if(is_component_functioning("power cell") && cell.charge)
low_power_mode = 0
update_headlamp()
else if(stat == CONSCIOUS)
use_power()
/mob/living/silicon/robot/proc/use_power()
if(is_component_functioning("power cell") && cell && cell.charge)
// this check is safe because `cell` is guaranteed to be set when the power cell is functioning
if(is_component_functioning("power cell") && cell.charge)
if(cell.charge <= 100)
uneq_all()
var/amt = Clamp((lamp_intensity - 2) * 2,1,cell.charge) //Always try to use at least one charge per tick, but allow it to completely drain the cell.
@@ -57,22 +57,10 @@
else
camera.status = 1
if(getOxyLoss() > 50)
Paralyse(3)
if(sleeping)
Paralyse(3)
AdjustSleeping(-1)
if(resting)
Weaken(5)
if(.) //alive
if(health <= config.health_threshold_dead)
death()
diag_hud_set_status()
return
if(!istype(src, /mob/living/silicon/robot/drone))
if(health < 50) //Gradual break down of modules as more damage is sustained
if(uneq_module(module_state_3))
@@ -86,19 +74,8 @@
if(uneq_module(module_state_1))
to_chat(src, "<span class='warning'>CRITICAL ERROR: All modules OFFLINE.</span>")
if(paralysis || stunned || weakened)
stat = UNCONSCIOUS
if(!paralysis > 0)
SetEyeBlind(0)
else
stat = CONSCIOUS
diag_hud_set_health()
diag_hud_set_status()
else //dead
SetEyeBlind(0)
//update the state of modules and components here
if(stat != CONSCIOUS)
@@ -109,14 +86,6 @@
else
radio.on = 1
if(is_component_functioning("camera") && stat == CONSCIOUS)
blinded = 0
else
blinded = 1
if(!is_component_functioning("actuator"))
Paralyse(3)
return 1
/mob/living/silicon/robot/update_sight()
@@ -234,7 +203,7 @@
weaponlock_time = 120
/mob/living/silicon/robot/update_canmove(delay_action_updates = 0)
if(paralysis || stunned || weakened || buckled || lockcharge)
if(paralysis || stunned || weakened || buckled || lockcharge || stat)
canmove = 0
else
canmove = 1
+7 -11
View File
@@ -477,12 +477,8 @@ var/list/robot_verbs_default = list(
return
var/datum/robot_component/C = components[toggle]
if(C.toggled)
C.toggled = 0
to_chat(src, "<span class='warning'>You disable [C.name].</span>")
else
C.toggled = 1
to_chat(src, "<span class='warning'>You enable [C.name].</span>")
C.toggle()
to_chat(src, "<span class='warning'>You [C.toggled ? "enable" : "disable"] [C.name].</span>")
/mob/living/silicon/robot/proc/sensor_mode()
set name = "Set Sensor Augmentation"
@@ -528,9 +524,8 @@ var/list/robot_verbs_default = list(
thruster_button.icon_state = "ionpulse[ionpulse_on]"
/mob/living/silicon/robot/blob_act()
if(stat != 2)
if(stat != DEAD)
adjustBruteLoss(60)
updatehealth()
return 1
else
gib()
@@ -573,7 +568,6 @@ var/list/robot_verbs_default = list(
/mob/living/silicon/robot/bullet_act(var/obj/item/projectile/Proj)
..(Proj)
updatehealth()
if(prob(75) && Proj.damage > 0) spark_system.start()
return 2
@@ -609,7 +603,6 @@ var/list/robot_verbs_default = list(
if(WT.remove_fuel(0))
playsound(src.loc, W.usesound, 50, 1)
adjustBruteLoss(-30)
updatehealth()
add_fingerprint(user)
user.visible_message("<span class='alert'>\The [user] patches some dents on \the [src] with \the [WT].</span>")
else
@@ -1259,7 +1252,9 @@ var/list/robot_verbs_default = list(
/mob/living/silicon/robot/adjustOxyLoss(var/amount)
if(suiciding)
..()
return ..()
else
return STATUS_UPDATE_NONE
/mob/living/silicon/robot/regenerate_icons()
..()
@@ -1439,6 +1434,7 @@ var/list/robot_verbs_default = list(
disable_component("comms", 160)
if(2)
disable_component("comms", 60)
/mob/living/silicon/robot/rejuvenate()
..()
var/brute = 1000
@@ -1,17 +1,12 @@
/mob/living/silicon/robot/updatehealth()
/mob/living/silicon/robot/updatehealth(reason = "none given")
if(status_flags & GODMODE)
health = maxHealth
stat = CONSCIOUS
return
health = maxHealth - (getOxyLoss() + getFireLoss() + getBruteLoss())
if(stat == DEAD && health > 0)
update_revive()
var/mob/dead/observer/ghost = get_ghost()
if(ghost)
to_chat(ghost, "<span class='ghostalert'>Your cyborg shell has been repaired, re-enter if you want to continue!</span> (Verbs -> Ghost -> Re-enter corpse)")
ghost << sound('sound/effects/genetics.ogg')
return
update_stat("updatehealth([reason])")
handle_hud_icons_health()
diag_hud_set_health()
/mob/living/silicon/robot/getBruteLoss()
var/amount = 0
@@ -27,17 +22,19 @@
if(C.installed != 0) amount += C.electronics_damage
return amount
/mob/living/silicon/robot/adjustBruteLoss(var/amount)
/mob/living/silicon/robot/adjustBruteLoss(amount, updating_health = TRUE)
if(amount > 0)
take_overall_damage(amount, 0)
take_overall_damage(amount, 0, updating_health)
else
heal_overall_damage(-amount, 0)
heal_overall_damage(-amount, 0, updating_health)
return STATUS_UPDATE_HEALTH
/mob/living/silicon/robot/adjustFireLoss(var/amount)
/mob/living/silicon/robot/adjustFireLoss(amount, updating_health = TRUE)
if(amount > 0)
take_overall_damage(0, amount)
take_overall_damage(0, amount, updating_health)
else
heal_overall_damage(0, -amount)
heal_overall_damage(0, -amount, updating_health)
return STATUS_UPDATE_HEALTH
/mob/living/silicon/robot/proc/get_damaged_components(var/brute, var/burn, var/get_all)
var/list/datum/robot_component/parts = list()
@@ -62,13 +59,13 @@
return C
return 0
/mob/living/silicon/robot/heal_organ_damage(var/brute, var/burn)
/mob/living/silicon/robot/heal_organ_damage(brute, burn, updating_health = TRUE)
var/list/datum/robot_component/parts = get_damaged_components(brute,burn)
if(!parts.len) return
var/datum/robot_component/picked = pick(parts)
picked.heal_damage(brute,burn)
picked.heal_damage(brute,burn, updating_health)
/mob/living/silicon/robot/take_organ_damage(var/brute = 0, var/burn = 0, var/sharp = 0, var/edge = 0)
/mob/living/silicon/robot/take_organ_damage(brute = 0, burn = 0, updating_health = TRUE, sharp = 0, edge = 0)
var/list/components = get_damageable_components()
if(!components.len)
return
@@ -98,13 +95,13 @@
var/datum/robot_component/armour/A = get_armour()
if(A)
A.take_damage(brute, burn, sharp)
A.take_damage(brute, burn, sharp, updating_health)
return
var/datum/robot_component/C = pick(components)
C.take_damage(brute, burn, sharp)
C.take_damage(brute, burn, sharp, updating_health)
/mob/living/silicon/robot/heal_overall_damage(var/brute, var/burn)
/mob/living/silicon/robot/heal_overall_damage(var/brute, var/burn, updating_health = TRUE)
var/list/datum/robot_component/parts = get_damaged_components(brute,burn)
while(parts.len && (brute>0 || burn>0) )
@@ -113,14 +110,14 @@
var/brute_was = picked.brute_damage
var/burn_was = picked.electronics_damage
picked.heal_damage(brute,burn)
picked.heal_damage(brute,burn, updating_health)
brute -= (brute_was-picked.brute_damage)
burn -= (burn_was-picked.electronics_damage)
parts -= picked
/mob/living/silicon/robot/take_overall_damage(var/brute = 0, var/burn = 0, var/sharp = 0, var/used_weapon = null)
/mob/living/silicon/robot/take_overall_damage(brute = 0, burn = 0, updating_health = TRUE, used_weapon = null, sharp = 0)
if(status_flags & GODMODE) return //godmode
var/list/datum/robot_component/parts = get_damageable_components()
@@ -158,9 +155,10 @@
var/brute_was = picked.brute_damage
var/burn_was = picked.electronics_damage
picked.take_damage(brute, burn)
picked.take_damage(brute, burn, sharp, FALSE)
brute -= (picked.brute_damage - brute_was)
burn -= (picked.electronics_damage - burn_was)
parts -= picked
updatehealth()
@@ -34,7 +34,6 @@
damage = rand(5, 35)
damage = round(damage / 2) // borgs recieve half damage
adjustBruteLoss(damage)
updatehealth()
return
/mob/living/silicon/robot/attack_hand(mob/living/carbon/human/user)
@@ -47,7 +46,7 @@
user.put_in_active_hand(cell)
to_chat(user, "<span class='notice'>You remove \the [cell].</span>")
cell = null
update_icons()
update_stat()
diag_hud_set_borgcell()
if(!opened)
@@ -106,7 +106,10 @@
// Return true in an overridden subtype to prevent normal removal handling
/obj/item/robot_module/proc/handle_custom_removal(component_id, mob/living/user, obj/item/W, params)
return FALSE
return FALSE
/obj/item/robot_module/proc/handle_death(gibbed)
return
/obj/item/robot_module/standard
name = "standard robot module"
@@ -217,6 +220,11 @@
fix_modules()
/obj/item/robot_module/engineering/handle_death()
var/obj/item/gripper/G = locate(/obj/item/gripper) in modules
if(G)
G.drop_item()
/obj/item/robot_module/security
name = "security robot module"
module_type = "Security"
@@ -530,6 +538,12 @@
..()
/obj/item/robot_module/drone/handle_death()
var/obj/item/gripper/G = locate(/obj/item/gripper) in modules
if(G)
G.drop_item()
//checks whether this item is a module of the robot it is located in.
/obj/item/proc/is_robot_module()
if(!istype(loc, /mob/living/silicon/robot))
@@ -3,19 +3,38 @@
if(stat || lockcharge || weakened || stunned || paralysis || !is_component_functioning("actuator"))
return TRUE
/mob/living/silicon/robot/update_stat()
/mob/living/silicon/robot/has_vision(information_only = FALSE)
return ..(information_only) && ((stat == DEAD && information_only) || is_component_functioning("camera"))
/mob/living/silicon/robot/update_stat(reason = "none given")
if(status_flags & GODMODE)
return
if(stat != DEAD)
if(health <= -maxHealth) //die only once
death()
create_debug_log("died of damage, trigger reason: [reason]")
return
if(!is_component_functioning("actuator") || paralysis || sleeping || stunned || weakened || getOxyLoss() > maxHealth * 0.5)
if(!is_component_functioning("actuator") || !is_component_functioning("power cell") || paralysis || sleeping || resting || stunned || weakened || getOxyLoss() > maxHealth * 0.5)
if(stat == CONSCIOUS)
KnockOut()
create_debug_log("fell unconscious, trigger reason: [reason]")
else
if(stat == UNCONSCIOUS)
WakeUp()
create_debug_log("woke up, trigger reason: [reason]")
else
if(health > 0)
update_revive()
var/mob/dead/observer/ghost = get_ghost()
if(ghost)
to_chat(ghost, "<span class='ghostalert'>Your cyborg shell has been repaired, re-enter if you want to continue!</span> (Verbs -> Ghost -> Re-enter corpse)")
ghost << sound('sound/effects/genetics.ogg')
create_attack_log("revived, trigger reason: [reason]")
// diag_hud_set_status()
// diag_hud_set_health()
// update_health_hud()
/mob/living/silicon/robot/update_revive(updating = TRUE)
. = ..(updating)
if(.)
update_icons()
+1 -1
View File
@@ -317,7 +317,7 @@
to_chat(src, "[A.alarm_name()]! ([(cameratext)? cameratext : "No Camera"])")
/mob/living/silicon/adjustToxLoss(var/amount)
return
return STATUS_UPDATE_NONE
/mob/living/silicon/get_access()
return IGNORE_ACCESS //silicons always have access
@@ -202,8 +202,11 @@
return ..()
/mob/living/simple_animal/bot/death(gibbed)
// Only execute the below if we successfully died
. = ..()
if(!.)
return FALSE
explode()
..()
/mob/living/simple_animal/bot/proc/explode()
qdel(src)
@@ -242,8 +245,8 @@
new /obj/effect/decal/cleanable/blood/oil(loc)
return ..(amount)
/mob/living/simple_animal/bot/updatehealth()
..()
/mob/living/simple_animal/bot/updatehealth(reason = "none given")
..(reason)
diag_hud_set_bothealth()
/mob/living/simple_animal/bot/handle_automated_action()
@@ -442,7 +442,7 @@
/mob/living/simple_animal/bot/medbot/examinate(atom/A as mob|obj|turf in view())
..()
if(!is_blind(src))
if(has_vision(information_only=TRUE))
chemscan(src, A)
/mob/living/simple_animal/bot/medbot/proc/medicate_patient(mob/living/carbon/C)
@@ -60,9 +60,9 @@
return baby
/mob/living/simple_animal/pet/cat/Runtime/death()
if(!memory_saved)
if(can_die() && !memory_saved)
Write_Memory(1)
..()
return ..()
/mob/living/simple_animal/pet/cat/Runtime/proc/Read_Memory()
var/savefile/S = new /savefile("data/npc_saves/Runtime.sav")
@@ -176,4 +176,4 @@
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
minbodytemp = 0
melee_damage_lower = 5
melee_damage_upper = 15
melee_damage_upper = 15
@@ -21,10 +21,8 @@
loot = list(/obj/effect/decal/cleanable/deadcockroach)
del_on_death = 1
/mob/living/simple_animal/cockroach/death(gibbed)
if(ticker.cinematic) //If the nuke is going off, then cockroaches are invincible. Keeps the nuke from killing them, cause cockroaches are immune to nukes.
return
..()
/mob/living/simple_animal/cockroach/can_die()
return ..() && !ticker.cinematic //If the nuke is going off, then cockroaches are invincible. Keeps the nuke from killing them, cause cockroaches are immune to nukes.
/mob/living/simple_animal/cockroach/Crossed(var/atom/movable/AM)
if(isliving(AM))
@@ -48,4 +46,4 @@
icon = 'icons/effects/blood.dmi'
icon_state = "xfloor1"
random_icon_states = list("xfloor1", "xfloor2", "xfloor3", "xfloor4", "xfloor5", "xfloor6", "xfloor7")
anchored = 1
anchored = 1
@@ -41,14 +41,6 @@
. = ..()
regenerate_icons()
/mob/living/simple_animal/pet/corgi/death(gibbed)
..()
regenerate_icons()
/mob/living/simple_animal/pet/corgi/revive()
..()
regenerate_icons()
/mob/living/simple_animal/pet/corgi/show_inv(mob/user as mob)
user.set_machine(src)
if(user.stat) return
@@ -626,7 +618,10 @@
s.start()
/mob/living/simple_animal/pet/corgi/Ian/borgi/death(gibbed)
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return FALSE
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, src)
s.start()
..()
@@ -2,8 +2,5 @@
set name = "Chase your tail"
set desc = "d'awwww."
set category = "Corgi"
to_chat(src, text("[pick("You dance around","You chase your tail")]."))
for(var/mob/O in oviewers(src, null))
if((O.client && !( O.blinded )))
to_chat(O, text("[] [pick("dances around","chases its tail")].", src))
spin(20, 1)
visible_message("[src] [pick("dances around","chases [p_their()] tail")].","[pick("You dance around","You chase your tail")].")
spin(20, 1)
@@ -67,22 +67,15 @@
MED.amount -= 1
if(MED.amount <= 0)
qdel(MED)
for(var/mob/M in viewers(src, null))
if((M.client && !( M.blinded )))
M.show_message("<span class='notice'>[user] applies the [MED] on [src]</span>")
user.visible_message("<span class='notice'>[user] applies the [MED] on [src]</span>")
else
to_chat(user, "<span class='notice'>this [src] is dead, medical items won't bring it back to life.</span>")
else
if(O.force)
health -= O.force
for(var/mob/M in viewers(src, null))
if((M.client && !( M.blinded )))
M.show_message("<span class='boldwarning'>[src] has been attacked with the [O] by [user]. </span>")
visible_message("<span class='boldwarning'>[src] has been attacked with the [O] by [user]. </span>")
else
to_chat(usr, "<span class='warning'>This weapon is ineffective, it does no damage.</span>")
for(var/mob/M in viewers(src, null))
if((M.client && !( M.blinded )))
M.show_message("<span class='warning'>[user] gently taps [src] with the [O]. </span>")
user.visible_message("<span class='warning'>[user] gently taps [src] with the [O]. </span>","<span class='warning'>This weapon is ineffective, it does no damage.</span>")
/mob/living/simple_animal/crab/Topic(href, href_list)
if(usr.stat) return
@@ -250,7 +250,10 @@ var/global/chicken_count = 0
chicken_count += 1
/mob/living/simple_animal/chicken/death(gibbed)
..(gibbed)
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return
chicken_count -= 1
/mob/living/simple_animal/chicken/attackby(obj/item/O, mob/user, params)
@@ -117,10 +117,13 @@
..()
/mob/living/simple_animal/mouse/death(gibbed)
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return FALSE
layer = MOB_LAYER
if(client)
client.time_died_as_mouse = world.time
..()
/*
* Mouse types
@@ -48,10 +48,13 @@
ranged = 1
/mob/living/simple_animal/hostile/hivebot/death(gibbed)
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return FALSE
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, src)
s.start()
..()
/mob/living/simple_animal/hostile/hivebot/tele//this still needs work
name = "Beacon"
@@ -289,8 +289,11 @@
//////////////END HOSTILE MOB TARGETTING AND AGGRESSION////////////
/mob/living/simple_animal/hostile/death(gibbed)
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return FALSE
LoseTarget()
..(gibbed)
/mob/living/simple_animal/hostile/proc/summon_backup(distance)
do_alert_animation(src)
@@ -95,17 +95,16 @@ Difficulty: Hard
visible_message("<span class='hierophant'>\"Vitemvw gsqtpixi. Stivexmsrep ijjmgmirgc gsqtvsqmwih.\"</span>")*/
/mob/living/simple_animal/hostile/megafauna/hierophant/death()
if(health > 0 || stat == DEAD)
return
else
stat = DEAD
blinking = TRUE //we do a fancy animation, release a huge burst(), and leave our staff.
animate(src, alpha = 0, color = "660099", time = 20, easing = EASE_OUT)
burst_range = 10
//visible_message("<span class='hierophant'>\"Mrmxmexmrk wipj-hiwxvygx wiuyirgi...\"</span>")
visible_message("<span class='hierophant_warning'>[src] disappears in a massive burst of magic, leaving only its staff.</span>")
burst(get_turf(src))
..()
if(!can_die())
return FALSE
blinking = TRUE //we do a fancy animation, release a huge burst(), and leave our staff.
animate(src, alpha = 0, color = "660099", time = 20, easing = EASE_OUT)
burst_range = 10
//visible_message("<span class='hierophant'>\"Mrmxmexmrk wipj-hiwxvygx wiuyirgi...\"</span>")
visible_message("<span class='hierophant_warning'>[src] disappears in a massive burst of magic, leaving only its staff.</span>")
burst(get_turf(src))
// Things are in this order due to `del_on_death`
return ..()
/mob/living/simple_animal/hostile/megafauna/hierophant/Destroy()
QDEL_NULL(spawned_rune)
@@ -612,4 +611,4 @@ Difficulty: Hard
icon_state = "hierophant"
smooth = SMOOTH_TRUE
#undef MEDAL_PREFIX
#undef MEDAL_PREFIX
@@ -89,9 +89,12 @@ Difficulty: Medium
speed = 2
charging = 0
/mob/living/simple_animal/hostile/megafauna/legion/can_die()
return ..() && health <= 0
/mob/living/simple_animal/hostile/megafauna/legion/death()
if(health > 0)
return
if(!can_die())
return FALSE
if(size > 1)
adjustHealth(-maxHealth) //heal ourself to full in prep for splitting
var/mob/living/simple_animal/hostile/megafauna/legion/L = new(loc)
@@ -117,7 +120,9 @@ Difficulty: Medium
L.GiveTarget(target)
visible_message("<span class='boldannounce'>[src] splits in twain!</span>")
return FALSE // not dead
else
// this must come before the parent call due to the setting of `loot` here
var/last_legion = TRUE
for(var/mob/living/simple_animal/hostile/megafauna/legion/other in mob_list)
if(other != src)
@@ -128,7 +133,7 @@ Difficulty: Medium
elimination = 0
else if(prob(5))
loot = list(/obj/structure/closet/crate/necropolis/tendril)
..()
return ..()
/mob/living/simple_animal/hostile/megafauna/legion/Process_Spacemove(movement_dir = 0)
return 1
@@ -139,4 +144,4 @@ Difficulty: Medium
desc = "The message repeats."
invisibility = 100
#undef MEDAL_PREFIX
#undef MEDAL_PREFIX
@@ -47,27 +47,16 @@
QDEL_NULL(internal_gps)
. = ..()
/mob/living/simple_animal/hostile/megafauna/can_die()
return ..() && health <= 0
/mob/living/simple_animal/hostile/megafauna/death(gibbed)
if(health > 0)
return
else
if(!admin_spawned)
feedback_set_details("megafauna_kills","[initial(name)]")
if(!elimination) //used so the achievment only occurs for the last legion to die.
grant_achievement(medal_type,score_type)
..()
/mob/living/simple_animal/hostile/megafauna/gib()
if(health > 0)
return
else
..()
/mob/living/simple_animal/hostile/megafauna/dust()
if(health > 0)
return
else
..()
// this happens before the parent call because `del_on_death` may be set
if(can_die() && !admin_spawned)
feedback_set_details("megafauna_kills","[initial(name)]")
if(!elimination) //used so the achievment only occurs for the last legion to die.
grant_achievement(medal_type,score_type)
return ..()
/mob/living/simple_animal/hostile/megafauna/AttackingTarget()
..()
@@ -92,11 +92,13 @@
icon_state = initial(icon_state)
/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
..()
if(can_die())
var/obj/structure/closet/crate/C = new(get_turf(src))
// Put loot in crate
for(var/obj/O in src)
O.loc = C
// due to `del_on_death`
return ..()
/mob/living/simple_animal/hostile/mimic/crate/AttackingTarget()
. =..()
@@ -129,9 +131,11 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
death()
/mob/living/simple_animal/hostile/mimic/copy/death(gibbed)
for(var/atom/movable/M in src)
M.loc = get_turf(src)
..()
if(can_die())
for(var/atom/movable/M in src)
M.loc = get_turf(src)
// due to `del_on_death`
return ..()
/mob/living/simple_animal/hostile/mimic/copy/ListTargets()
. = ..()
@@ -46,8 +46,11 @@
OpenFire()
/mob/living/simple_animal/hostile/asteroid/hivelord/death(gibbed)
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return FALSE
mouse_opacity = 1
..(gibbed)
/obj/item/organ/internal/hivelord_core
name = "hivelord remains"
@@ -165,9 +168,10 @@
color = "#C80000"
/mob/living/simple_animal/hostile/asteroid/hivelordbrood/blood/death()
if(loc) // Splash the turf we are on with blood
if(can_die() && loc)
// Splash the turf we are on with blood
reagents.reaction(get_turf(src))
..()
return ..()
/mob/living/simple_animal/hostile/asteroid/hivelordbrood/blood/New()
create_reagents(30)
@@ -235,15 +239,17 @@
var/mob/living/carbon/human/stored_mob
/mob/living/simple_animal/hostile/asteroid/hivelord/legion/death(gibbed)
visible_message("<span class='warning'>The skulls on [src] wail in anger as they flee from their dying host!</span>")
var/turf/T = get_turf(src)
if(T)
if(stored_mob)
stored_mob.forceMove(get_turf(src))
stored_mob = null
else
new /obj/effect/mob_spawn/human/corpse/charredskeleton(T)
..(gibbed)
if(can_die())
visible_message("<span class='warning'>The skulls on [src] wail in anger as they flee from their dying host!</span>")
var/turf/T = get_turf(src)
if(T)
if(stored_mob)
stored_mob.forceMove(get_turf(src))
stored_mob = null
else
new /obj/effect/mob_spawn/human/corpse/charredskeleton(T)
// due to `del_on_death`
return ..(gibbed)
/mob/living/simple_animal/hostile/asteroid/hivelordbrood/legion
@@ -330,4 +336,4 @@
mob_gender = NEUTER
husk = FALSE
mob_species = /datum/species/skeleton
mob_color = "#454545"
mob_color = "#454545"
@@ -91,7 +91,10 @@
UpdateMushroomCap()
/mob/living/simple_animal/hostile/mushroom/death(gibbed)
..()
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return FALSE
UpdateMushroomCap()
/mob/living/simple_animal/hostile/mushroom/proc/UpdateMushroomCap()
@@ -160,4 +163,4 @@
S.reagents.add_reagent("psilocybin", powerlevel)
S.reagents.add_reagent("omnizine", powerlevel)
S.reagents.add_reagent("synaptizine", powerlevel)
qdel(src)
qdel(src)
@@ -184,7 +184,10 @@
//Harder to kill the head, but it can kill off the whole worm
/mob/living/simple_animal/hostile/spaceWorm/wormHead/death(gibbed)
..()
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return FALSE
if(prob(catastrophicDeathProb))
for(var/mob/living/simple_animal/hostile/spaceWorm/SW in totalWormSegments)
SW.death()
@@ -294,7 +297,10 @@
/mob/living/simple_animal/hostile/spaceWorm/death(gibbed)
..()
// Only execute the below if we successfully died
. = ..()
if(!.)
return FALSE
if(myHead)
myHead.totalWormSegments -= src
@@ -9,25 +9,26 @@
metabolization_rate = 0.1
/datum/reagent/terror_black_toxin/on_mob_life(mob/living/M)
var/update_flags = STATUS_UPDATE_NONE
if(volume < 30)
// bitten once, die very slowly. Easy to survive a single bite - just go to medbay.
// total damage: 1/tick, human health 150 until crit, = 150 ticks, = 300 seconds = 5 minutes to get to medbay.
M.adjustToxLoss(1)
update_flags |= M.adjustToxLoss(1, FALSE)
else if(volume < 60)
// bitten twice, die slowly. Get to medbay.
// total damage: 2/tick, human health 150 until crit, = 75 ticks, = 150 seconds = 2.5 minutes to get some medical treatment.
M.adjustToxLoss(2)
M.EyeBlurry(3)
update_flags |= M.adjustToxLoss(2, FALSE)
update_flags |= M.EyeBlurry(3, FALSE)
else if(volume < 90)
// bitten thrice, die quickly, severe muscle cramps make movement very difficult. Even calling for help probably won't save you.
// total damage: 4, human health 150 until crit, = 37.5 ticks, = 75s = 1m15s until death
M.adjustToxLoss(4) // a bit worse than coiine
update_flags |= M.adjustToxLoss(4, FALSE) // a bit worse than coiine
update_flags |= M.EyeBlurry(6, FALSE)
M.Confused(6)
M.EyeBlurry(6)
else
// bitten 4 or more times, whole body goes into shock/death
// total damage: 8, human health 150 until crit, = 18.75 ticks, = 37s until death
M.adjustToxLoss(8)
M.EyeBlurry(6)
M.Paralyse(5)
..()
update_flags |= M.adjustToxLoss(8, FALSE)
update_flags |= M.EyeBlurry(6, FALSE)
update_flags |= M.Paralyse(5, FALSE)
return ..() | update_flags
@@ -41,12 +41,12 @@
L.attack_animal(src)
/mob/living/simple_animal/hostile/poison/terror_spider/gray/adjustBruteLoss(damage)
..(damage)
. = ..(damage)
if(invisibility > 0)
GrayDeCloak()
/mob/living/simple_animal/hostile/poison/terror_spider/gray/adjustFireLoss(damage)
..(damage)
. = ..(damage)
if(invisibility > 0)
GrayDeCloak()
@@ -136,4 +136,4 @@
if(temp_vent)
if(get_dist(src,temp_vent) > 0 && get_dist(src,temp_vent) < 5)
step_to(src,temp_vent)
// if you're bumped off your vent, try to get back to it
// if you're bumped off your vent, try to get back to it
@@ -33,24 +33,25 @@
ventsmash_action.Grant(src)
/mob/living/simple_animal/hostile/poison/terror_spider/mother/death(gibbed)
var/always_stillborn = FALSE
if(spider_awaymission && !is_away_level(z))
always_stillborn = TRUE
if(canspawn)
canspawn = 0
for(var/i in 0 to 30)
var/obj/structure/spider/spiderling/terror_spiderling/S = new /obj/structure/spider/spiderling/terror_spiderling(get_turf(src))
S.grow_as = pick(/mob/living/simple_animal/hostile/poison/terror_spider/red, /mob/living/simple_animal/hostile/poison/terror_spider/gray)
if(always_stillborn || prob(66))
S.stillborn = 1
else if(prob(10))
S.grow_as = pick(/mob/living/simple_animal/hostile/poison/terror_spider/black, /mob/living/simple_animal/hostile/poison/terror_spider/green)
S.amount_grown = 50 // double speed growth
S.immediate_ventcrawl = 1
visible_message("<span class='userdanger'>[src] breaks apart, the many spiders on its back scurrying everywhere!</span>")
degenerate = 1
..()
if(can_die())
var/always_stillborn = FALSE
if(spider_awaymission && !is_away_level(z))
always_stillborn = TRUE
if(canspawn)
canspawn = 0
for(var/i in 0 to 30)
var/obj/structure/spider/spiderling/terror_spiderling/S = new /obj/structure/spider/spiderling/terror_spiderling(get_turf(src))
S.grow_as = pick(/mob/living/simple_animal/hostile/poison/terror_spider/red, /mob/living/simple_animal/hostile/poison/terror_spider/gray)
if(always_stillborn || prob(66))
S.stillborn = 1
else if(prob(10))
S.grow_as = pick(/mob/living/simple_animal/hostile/poison/terror_spider/black, /mob/living/simple_animal/hostile/poison/terror_spider/green)
S.amount_grown = 50 // double speed growth
S.immediate_ventcrawl = 1
visible_message("<span class='userdanger'>[src] breaks apart, the many spiders on its back scurrying everywhere!</span>")
degenerate = 1
return ..()
/mob/living/simple_animal/hostile/poison/terror_spider/mother/Destroy()
canspawn = 0
return ..()
return ..()
@@ -36,10 +36,9 @@
thickweb_action.Grant(src)
/mob/living/simple_animal/hostile/poison/terror_spider/prince/death(gibbed)
if(!hasdied)
if(spider_uo71)
UnlockBlastDoors("UO71_SciStorage")
..()
if(can_die() && !hasdied && spider_uo71)
UnlockBlastDoors("UO71_SciStorage")
return ..()
/mob/living/simple_animal/hostile/poison/terror_spider/prince/spider_specialattack(mob/living/carbon/human/L)
if(prob(15))
@@ -47,4 +46,4 @@
L.Weaken(5)
L.Stun(5)
else
..()
..()
@@ -38,7 +38,7 @@
thickweb_action.Grant(src)
/mob/living/simple_animal/hostile/poison/terror_spider/purple/death(gibbed)
if(spider_myqueen)
if(can_die() && spider_myqueen)
var/mob/living/simple_animal/hostile/poison/terror_spider/queen/Q = spider_myqueen
if(Q.stat != DEAD && !Q.ckey)
if(get_dist(src,Q) > 20)
@@ -46,7 +46,7 @@
degenerate = 1
Q.DoLayTerrorEggs(/mob/living/simple_animal/hostile/poison/terror_spider/purple,1,0)
visible_message("<span class='notice'>[src] chitters in the direction of [Q]!</span>")
. = ..()
return ..()
/mob/living/simple_animal/hostile/poison/terror_spider/purple/Life(seconds, times_fired)
. = ..()
@@ -91,4 +91,4 @@
degenerate = 1
to_chat(src,"<span class='userdanger'>Your link to your Queen has been broken! Your life force starts to drain away!</span>")
melee_damage_lower = 5
melee_damage_upper = 10
melee_damage_upper = 10
@@ -81,7 +81,7 @@
to_chat(src, "<span class='notice'>You have [canlay] eggs available to lay.</span>")
/mob/living/simple_animal/hostile/poison/terror_spider/queen/death(gibbed)
if(!hasdied)
if(can_die() && !hasdied)
SetHiveCommand(0, 15) // Hive becomes very aggressive.
if(spider_uo71)
UnlockBlastDoors("UO71_Caves")
@@ -91,7 +91,7 @@
P.visible_message("<span class='danger'>\The [src] writhes in pain!</span>")
to_chat(P,"<span class='userdanger'>\The [src] has died. Without her hivemind link, purple terrors like yourself cannot survive more than a few minutes!</span>")
P.degenerate = 1
..()
return ..()
/mob/living/simple_animal/hostile/poison/terror_spider/queen/Retaliate()
..()
@@ -347,4 +347,4 @@
if(L.can_inject(null, 0, "chest", 0))
L.Hallucinate(400)
if(!isterrorspider(L))
L.adjustToxLoss(bonus_tox)
L.adjustToxLoss(bonus_tox)
@@ -162,11 +162,11 @@
..()
/mob/living/simple_animal/hostile/poison/terror_spider/adjustBruteLoss(damage)
..(damage)
. = ..(damage)
Retaliate()
/mob/living/simple_animal/hostile/poison/terror_spider/adjustFireLoss(damage)
..(damage)
. = ..(damage)
Retaliate()
/mob/living/simple_animal/hostile/poison/terror_spider/proc/Retaliate()
@@ -318,4 +318,4 @@
/mob/living/simple_animal/hostile/poison/terror_spider/proc/UnlockBlastDoors(target_id_tag)
for(var/obj/machinery/door/poddoor/P in airlocks)
if(P.density && P.id_tag == target_id_tag && P.z == z && !P.operating)
P.open()
P.open()
@@ -321,10 +321,11 @@ var/global/list/ts_spiderling_list = list()
ts_count_alive_station--
/mob/living/simple_animal/hostile/poison/terror_spider/death(gibbed)
if(!gibbed)
msg_terrorspiders("[src] has died in [get_area(src)].")
handle_dying()
..()
if(can_die())
if(!gibbed)
msg_terrorspiders("[src] has died in [get_area(src)].")
handle_dying()
return ..()
/mob/living/simple_animal/hostile/poison/terror_spider/proc/spider_special_action()
return
@@ -372,4 +373,4 @@ var/global/list/ts_spiderling_list = list()
visible_message("<span class='danger'>[src] pries open the door!</span>")
playsound(src.loc, "sparks", 100, 1)
D.open(1)
return 1
return 1
@@ -31,10 +31,9 @@
..()
/mob/living/simple_animal/hostile/poison/terror_spider/white/death(gibbed)
if(!hasdied)
if(spider_uo71)
UnlockBlastDoors("UO71_Bridge")
..()
if(can_die() && !hasdied && spider_uo71)
UnlockBlastDoors("UO71_Bridge")
return ..(gibbed)
/mob/living/simple_animal/hostile/poison/terror_spider/white/spider_specialattack(mob/living/carbon/human/L, poisonable)
if(!poisonable)
@@ -57,4 +56,4 @@
/proc/IsTSInfected(mob/living/carbon/C) // Terror AI requires this
if(C.get_int_organ(/obj/item/organ/internal/body_egg))
return 1
return 0
return 0
@@ -36,15 +36,14 @@
/mob/living/simple_animal/hostile/winter/snowman/death(gibbed)
if(prob(50) && !ranged) //50% chance to drop candy cane sword on death, if it has one to drop
loot = list(/obj/item/melee/candy_sword)
if(prob(20)) //chance to become a stationary snowman structure instead of a corpse
loot.Add(/obj/structure/snowman)
deathmessage = "shimmers as its animating magic fades away!"
del_on_death = 1
..() //this is just to make sure it gets properly killed before we qdel it
else
..()
if(can_die())
if(prob(50) && !ranged) //50% chance to drop candy cane sword on death, if it has one to drop
loot = list(/obj/item/melee/candy_sword)
if(prob(20)) //chance to become a stationary snowman structure instead of a corpse
loot.Add(/obj/structure/snowman)
deathmessage = "shimmers as its animating magic fades away!"
del_on_death = 1
return ..()
/mob/living/simple_animal/hostile/winter/snowman/ranged
maxHealth = 50
@@ -79,7 +78,10 @@
icon_dead = "santa-dead"
/mob/living/simple_animal/hostile/winter/santa/death(gibbed)
..()
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return FALSE
if(death_message)
visible_message(death_message)
if(next_stage)
@@ -133,12 +135,16 @@
melee_damage_upper = 30 //that's gonna leave a mark, for sure
/mob/living/simple_animal/hostile/winter/santa/stage_4/death(gibbed)
to_chat(world, "<span class='notice'><hr></span>")
to_chat(world, "<span class='notice'>THE FAT MAN HAS FALLEN!</span>")
to_chat(world, "<span class='notice'>SANTA CLAUS HAS BEEN DEFEATED!</span>")
to_chat(world, "<span class='notice'><hr></span>")
..()
if(can_die())
to_chat(world, "<span class='notice'><hr></span>")
to_chat(world, "<span class='notice'>THE FAT MAN HAS FALLEN!</span>")
to_chat(world, "<span class='notice'>SANTA CLAUS HAS BEEN DEFEATED!</span>")
to_chat(world, "<span class='notice'><hr></span>")
// Only execute the below if we successfully died
. = ..()
if(!.)
return FALSE
var/obj/item/grenade/clusterbuster/xmas/X = new /obj/item/grenade/clusterbuster/xmas(get_turf(src))
var/obj/item/grenade/clusterbuster/xmas/Y = new /obj/item/grenade/clusterbuster/xmas(get_turf(src))
X.prime()
Y.prime()
Y.prime()
@@ -113,11 +113,12 @@
return ..()
/mob/living/simple_animal/parrot/death(gibbed)
if(held_item)
held_item.loc = src.loc
held_item = null
walk(src,0)
..()
if(can_die())
if(held_item)
held_item.loc = src.loc
held_item = null
walk(src,0)
return ..()
/mob/living/simple_animal/parrot/Stat()
..()
@@ -15,6 +15,7 @@
allow_spin = 0 // No spinning. Spinning breaks our floating animation.
no_spin_thrown = 1
del_on_death = TRUE
var/obj/item/possessed_item
@@ -44,21 +45,14 @@
ghost.timeofdeath = world.time
death(0) // Turn back into a regular object.
/mob/living/simple_animal/possessed_object/death(gibbed)
var/mob/dead/observer/ghost = ghostize(1)
..()
if(gibbed) // Leave no trace.
ghost.timeofdeath = world.time
qdel(src)
return
if(possessed_item.loc == src)
possessed_item.forceMove(loc) // Put the normal item back once the EVIL SPIRIT has been vanquished from it. If it's not already in place
qdel(src)
if(can_die())
ghostize(GHOST_CAN_REENTER)
// if gibbed, the item goes with the ghost
if(!gibbed && possessed_item.loc == src)
// Put the normal item back once the EVIL SPIRIT has been vanquished from it. If it's not already in place
possessed_item.forceMove(loc)
return ..()
/mob/living/simple_animal/possessed_object/Life(seconds, times_fired)
..()
@@ -160,4 +154,4 @@
pixel_y = possessed_item.pixel_y
color = possessed_item.color
overlays = possessed_item.overlays
set_opacity(possessed_item.opacity)
set_opacity(possessed_item.opacity)
@@ -8,13 +8,7 @@
if(layer != TURF_LAYER+0.2)
layer = TURF_LAYER+0.2
to_chat(src, text("<span class=notice'>You are now hiding.</span>"))
for(var/mob/O in oviewers(src, null))
if((O.client && !( O.blinded )))
to_chat(O, text("<B>[] scurries to the ground!</B>", src))
visible_message("<B>[src] scurries to the ground!</B>", "<span class=notice'>You are now hiding.</span>")
else
layer = MOB_LAYER
to_chat(src, text("<span class=notice'>You have stopped hiding.</span>"))
for(var/mob/O in oviewers(src, null))
if((O.client && !( O.blinded )))
to_chat(O, text("[] slowly peaks up from the ground...", src))
visible_message("[src] slowly peeks up from the ground...", "<span class=notice'>You have stopped hiding.</span>")
+13 -18
View File
@@ -29,25 +29,20 @@
deathmessage = "lets out a contented sigh as their form unwinds."
attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
if(istype(O, /obj/item/soulstone))
O.transfer_soul("SHADE", src, user)
/mob/living/simple_animal/shade/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
if(istype(O, /obj/item/soulstone))
O.transfer_soul("SHADE", src, user)
else
if(O.force)
var/damage = O.force
if(O.damtype == STAMINA)
damage = 0
health -= damage
user.visible_message("<span class='boldwarning'>[src] has been attacked with the [O] by [user]. </span>")
else
if(O.force)
var/damage = O.force
if(O.damtype == STAMINA)
damage = 0
health -= damage
for(var/mob/M in viewers(src, null))
if((M.client && !( M.blinded )))
M.show_message("<span class='boldwarning'>[src] has been attacked with the [O] by [user]. </span>")
else
to_chat(usr, "<span class='warning'>This weapon is ineffective, it does no damage.</span>")
for(var/mob/M in viewers(src, null))
if((M.client && !( M.blinded )))
M.show_message("<span class='warning'>[user] gently taps [src] with the [O]. </span>")
return
user.visible_message("<span class='warning'>[user] gently taps [src] with the [O]. </span>", "<span class='warning'>This weapon is ineffective, it does no damage.</span>")
return
/mob/living/simple_animal/shade/sword
universal_speak = 1
faction = list("neutral")
faction = list("neutral")
@@ -105,8 +105,8 @@
client.screen += client.void
..()
/mob/living/simple_animal/updatehealth()
..()
/mob/living/simple_animal/updatehealth(reason = "none given")
..(reason)
health = Clamp(health, 0, maxHealth)
med_hud_set_status()
@@ -127,12 +127,15 @@
else if(stat != DEAD)
icon_state = icon_living
/mob/living/simple_animal/handle_regular_status_updates()
if(..()) //alive
/mob/living/simple_animal/update_stat(reason = "none given")
if(status_flags & GODMODE)
return
..(reason)
if(stat != DEAD)
if(health < 1)
death()
return FALSE
return TRUE
create_debug_log("died of damage, trigger reason: [reason]")
/mob/living/simple_animal/proc/handle_automated_action()
return
@@ -303,6 +306,10 @@
stat(null, "Health: [round((health / maxHealth) * 100)]%")
/mob/living/simple_animal/death(gibbed)
// Only execute the below if we successfully died
. = ..()
if(!.)
return FALSE
if(nest)
nest.spawned_mobs -= src
nest = null
@@ -322,10 +329,8 @@
else
health = 0
icon_state = icon_dead
stat = DEAD
density = 0
lying = 1
..()
/mob/living/simple_animal/ex_act(severity)
..()
@@ -341,35 +346,42 @@
if(3.0)
adjustBruteLoss(30)
/mob/living/simple_animal/proc/adjustHealth(amount)
/mob/living/simple_animal/proc/adjustHealth(amount, updating_health = TRUE)
if(status_flags & GODMODE)
return FALSE
var/oldbruteloss = bruteloss
bruteloss = Clamp(bruteloss + amount, 0, maxHealth)
handle_regular_status_updates()
if(oldbruteloss == bruteloss)
updating_health = FALSE
. = STATUS_UPDATE_NONE
else
. = STATUS_UPDATE_HEALTH
if(updating_health)
updatehealth()
/mob/living/simple_animal/adjustBruteLoss(amount)
/mob/living/simple_animal/adjustBruteLoss(amount, updating_health = TRUE)
if(damage_coeff[BRUTE])
adjustHealth(amount * damage_coeff[BRUTE])
return adjustHealth(amount * damage_coeff[BRUTE], updating_health)
/mob/living/simple_animal/adjustFireLoss(amount)
/mob/living/simple_animal/adjustFireLoss(amount, updating_health = TRUE)
if(damage_coeff[BURN])
adjustHealth(amount * damage_coeff[BURN])
return adjustHealth(amount * damage_coeff[BURN], updating_health)
/mob/living/simple_animal/adjustOxyLoss(amount)
/mob/living/simple_animal/adjustOxyLoss(amount, updating_health = TRUE)
if(damage_coeff[OXY])
adjustHealth(amount * damage_coeff[OXY])
return adjustHealth(amount * damage_coeff[OXY], updating_health)
/mob/living/simple_animal/adjustToxLoss(amount)
/mob/living/simple_animal/adjustToxLoss(amount, updating_health = TRUE)
if(damage_coeff[TOX])
adjustHealth(amount * damage_coeff[TOX])
return adjustHealth(amount * damage_coeff[TOX], updating_health)
/mob/living/simple_animal/adjustCloneLoss(amount)
/mob/living/simple_animal/adjustCloneLoss(amount, updating_health = TRUE)
if(damage_coeff[CLONE])
adjustHealth(amount * damage_coeff[CLONE])
return adjustHealth(amount * damage_coeff[CLONE], updating_health)
/mob/living/simple_animal/adjustStaminaLoss(amount)
/mob/living/simple_animal/adjustStaminaLoss(amount, updating_health = TRUE)
if(damage_coeff[STAMINA])
return ..(amount*damage_coeff[STAMINA])
return ..(amount*damage_coeff[STAMINA], updating_health)
/mob/living/simple_animal/proc/CanAttack(var/atom/the_target)
if(see_invisible < the_target.invisibility)
@@ -80,7 +80,10 @@ var/global/totaltribbles = 0 //global variable so it updates for all tribbles,
/mob/living/simple_animal/tribble/death(gibbed) // Gotta make sure to remove tribbles from the list on death
..()
// Only execute the below if we successfully died
. = ..(gibbed)
if(!.)
return FALSE
totaltribbles -= 1
@@ -195,10 +198,7 @@ var/global/totaltribbles = 0 //global variable so it updates for all tribbles,
if(src.destroyed)
return
else
to_chat(usr, text("<span class='notice'>You kick the lab cage.</span>"))
for(var/mob/O in oviewers())
if((O.client && !( O.blinded )))
to_chat(O, text("<span class='warning'>[] kicks the lab cage.</span>", usr))
user.visible_message("<span class='warning'>[user] kicks the lab cage.</span>", "<span class='notice'>You kick the lab cage.</span>")
src.health -= 2
healthcheck()
return

Some files were not shown because too many files have changed in this diff Show More