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
+12
View File
@@ -132,6 +132,18 @@
#define EMOTE_VISUAL 1 //A mob emote is visual
#define EMOTE_SOUND 2 //A mob emote is sound
#define STATUS_UPDATE_HEALTH 1
#define STATUS_UPDATE_STAT 2
#define STATUS_UPDATE_CANMOVE 4
#define STATUS_UPDATE_STAMINA 8
#define STATUS_UPDATE_BLIND 16
#define STATUS_UPDATE_BLURRY 32
#define STATUS_UPDATE_NEARSIGHTED 64
#define STATUS_UPDATE_DRUGGY 128
#define STATUS_UPDATE_NONE 0
#define STATUS_UPDATE_ALL (~0)
//Human sub-species
#define isshadowling(A) (is_species(A, /datum/species/shadow/ling))
#define isshadowlinglesser(A) (is_species(A, /datum/species/shadow/ling/lesser))
+4 -1
View File
@@ -1,3 +1,6 @@
#define SOLID 1
#define LIQUID 2
#define GAS 3
#define GAS 3
#define REAGENT_OVERDOSE_EFFECT 1
#define REAGENT_OVERDOSE_FLAGS 2
+1 -1
View File
@@ -31,7 +31,7 @@
/datum/proc/vv_get_var(var_name)
switch(var_name)
if("attack_log")
if("attack_log", "debug_log")
return debug_variable(var_name, vars[var_name], 0, src, sanitize = FALSE)
if("vars")
return debug_variable(var_name, list(), 0, src)
+1 -2
View File
@@ -24,7 +24,6 @@
to_chat(affected_mob, "<span class='danger'>Your stomach stings painfully.</span>")
if(prob(20))
affected_mob.adjustToxLoss(2)
affected_mob.updatehealth()
if(4)
if(prob(10))
affected_mob.visible_message("<span class='danger'>[affected_mob] buzzes.</span>", \
@@ -37,4 +36,4 @@
new /mob/living/simple_animal/hostile/poison/bees(affected_mob.loc)
//if(5)
//Plus if you die, you explode into bees
return
return
-3
View File
@@ -25,7 +25,6 @@
to_chat(affected_mob, "<span class='danger'>You don't feel like yourself.</span>")
if(prob(5))
affected_mob.adjustBrainLoss(1)
affected_mob.updatehealth()
if(3)
if(prob(2))
affected_mob.emote("stare")
@@ -33,7 +32,6 @@
affected_mob.emote("drool")
if(prob(10) && affected_mob.getBrainLoss()<=98)//shouldn't retard you to death now
affected_mob.adjustBrainLoss(2)
affected_mob.updatehealth()
if(prob(2))
to_chat(affected_mob, "<span class='danger'>Your try to remember something important...but can't.</span>")
@@ -44,7 +42,6 @@
affected_mob.emote("drool")
if(prob(15) && affected_mob.getBrainLoss()<=98) //shouldn't retard you to death now
affected_mob.adjustBrainLoss(3)
affected_mob.updatehealth()
if(prob(2))
to_chat(affected_mob, "<span class='danger'>Strange buzzing fills your head, removing all thoughts.</span>")
if(prob(3))
+1 -2
View File
@@ -41,7 +41,6 @@
to_chat(affected_mob, "<span class='danger'>Your stomach hurts.</span>")
if(prob(20))
affected_mob.adjustToxLoss(2)
affected_mob.updatehealth()
if(4)
if(!transformed && !carrier)
//Save original dna for when the disease is cured.
@@ -69,4 +68,4 @@
affected_mob.domutcheck()
to_chat(affected_mob, "<span class='notice'>You feel more like yourself.</span>")
return ..()
return ..()
-2
View File
@@ -31,7 +31,6 @@
to_chat(affected_mob, "<span class='danger'>Your stomach hurts.</span>")
if(prob(20))
affected_mob.adjustToxLoss(1)
affected_mob.updatehealth()
if(3)
if(affected_mob.lying && prob(15))
@@ -50,5 +49,4 @@
to_chat(affected_mob, "<span class='danger'>Your stomach hurts.</span>")
if(prob(20))
affected_mob.adjustToxLoss(1)
affected_mob.updatehealth()
return
+1 -3
View File
@@ -18,7 +18,6 @@
if(2)
if(prob(45))
affected_mob.adjustToxLoss(5)
affected_mob.updatehealth()
if(prob(1))
affected_mob.emote("sneeze")
if(3)
@@ -32,7 +31,6 @@
if(prob(10))
affected_mob.emote("cough")
affected_mob.adjustToxLoss(5)
affected_mob.updatehealth()
if(5)
to_chat(affected_mob, "<span class='danger'>Your body feels as if it's trying to rip itself open...</span>")
if(prob(50))
@@ -50,4 +48,4 @@
cure_chance = 10
agent = "gibbis"
spread_flags = NON_CONTAGIOUS
disease_flags = CURABLE
disease_flags = CURABLE
+1 -3
View File
@@ -19,7 +19,6 @@
if(2)
if(prob(45))
affected_mob.adjustToxLoss(5)
affected_mob.updatehealth()
if(prob(1))
to_chat(affected_mob, "<span class='danger'>You feel strange...</span>")
if(3)
@@ -35,8 +34,7 @@
to_chat(affected_mob, "<span class='danger'>You feel a burning beat inside...</span>")
if(prob(20))
affected_mob.adjustToxLoss(5)
affected_mob.updatehealth()
if(5)
to_chat(affected_mob, "<span class='danger'>Your body is unable to contain the Rhumba Beat...</span>")
if(prob(50))
affected_mob.gib()
affected_mob.gib()
+3 -3
View File
@@ -65,12 +65,12 @@
lakey = sanitizeSQL(H.lastattacker:key)
var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss")
var/coord = "[H.x], [H.y], [H.z]"
// to_chat(world, "INSERT INTO death (name, byondkey, job, special, pod, tod, laname, lakey, gender, bruteloss, fireloss, brainloss, oxyloss) VALUES ('[sqlname]', '[sqlkey]', '[sqljob]', '[sqlspecial]', '[sqlpod]', '[sqltime]', '[laname]', '[lakey]', '[H.gender]', [H.bruteloss], [H.getFireLoss()], [H.brainloss], [H.getOxyLoss()])")
// to_chat(world, "INSERT INTO death (name, byondkey, job, special, pod, tod, laname, lakey, gender, bruteloss, fireloss, brainloss, oxyloss) VALUES ('[sqlname]', '[sqlkey]', '[sqljob]', '[sqlspecial]', '[sqlpod]', '[sqltime]', '[laname]', '[lakey]', '[H.gender]', [H.bruteloss], [H.getFireLoss()], [H.getBrainLoss()], [H.getOxyLoss()])")
establish_db_connection()
if(!dbcon.IsConnected())
log_game("SQL ERROR during death reporting. Failed to connect.")
else
var/DBQuery/query = dbcon.NewQuery("INSERT INTO [format_table_name("death")] (name, byondkey, job, special, pod, tod, laname, lakey, gender, bruteloss, fireloss, brainloss, oxyloss, coord) VALUES ('[sqlname]', '[sqlkey]', '[sqljob]', '[sqlspecial]', '[sqlpod]', '[sqltime]', '[laname]', '[lakey]', '[H.gender]', [H.getBruteLoss()], [H.getFireLoss()], [H.brainloss], [H.getOxyLoss()], '[coord]')")
var/DBQuery/query = dbcon.NewQuery("INSERT INTO [format_table_name("death")] (name, byondkey, job, special, pod, tod, laname, lakey, gender, bruteloss, fireloss, brainloss, oxyloss, coord) VALUES ('[sqlname]', '[sqlkey]', '[sqljob]', '[sqlspecial]', '[sqlpod]', '[sqltime]', '[laname]', '[lakey]', '[H.gender]', [H.getBruteLoss()], [H.getFireLoss()], [H.getBrainLoss()], [H.getOxyLoss()], '[coord]')")
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR during death reporting. Error : \[[err]\]\n")
@@ -105,7 +105,7 @@
if(!dbcon.IsConnected())
log_game("SQL ERROR during death reporting. Failed to connect.")
else
var/DBQuery/query = dbcon.NewQuery("INSERT INTO [format_table_name("death")] (name, byondkey, job, special, pod, tod, laname, lakey, gender, bruteloss, fireloss, brainloss, oxyloss, coord) VALUES ('[sqlname]', '[sqlkey]', '[sqljob]', '[sqlspecial]', '[sqlpod]', '[sqltime]', '[laname]', '[lakey]', '[H.gender]', [H.getBruteLoss()], [H.getFireLoss()], [H.brainloss], [H.getOxyLoss()], '[coord]')")
var/DBQuery/query = dbcon.NewQuery("INSERT INTO [format_table_name("death")] (name, byondkey, job, special, pod, tod, laname, lakey, gender, bruteloss, fireloss, brainloss, oxyloss, coord) VALUES ('[sqlname]', '[sqlkey]', '[sqljob]', '[sqlspecial]', '[sqlpod]', '[sqltime]', '[laname]', '[lakey]', '[H.gender]', [H.getBruteLoss()], [H.getFireLoss()], [H.getBrainLoss()], [H.getOxyLoss()], '[coord]')")
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR during death reporting. Error : \[[err]\]\n")
+1 -1
View File
@@ -265,7 +265,7 @@
affecting = H.bodyparts_by_name[name]
if(!istype(affecting, /obj/item/organ/external))
continue
affecting.heal_damage(4, 0)
affecting.heal_damage(4, 0, updating_health = FALSE)
H.UpdateDamageIcon()
H.updatehealth()
+8 -2
View File
@@ -97,7 +97,10 @@
loc.visible_message("<span class='warning'>The corpse of [H.name] suddenly rises!</span>")
/mob/living/simple_animal/hostile/blob/blobspore/death(gibbed)
..()
// Only execute the below if we successfuly died
. = ..()
if(!.)
return FALSE
// On death, create a small smoke of harmful gas (s-Acid)
var/datum/effect_system/smoke_spread/chem/S = new
var/turf/location = get_turf(src)
@@ -178,5 +181,8 @@
return
/mob/living/simple_animal/hostile/blob/blobbernaut/death(gibbed)
..()
// Only execute the below if we successfully died
. = ..()
if(!.)
return FALSE
flick("blobbernaut_death", src)
@@ -15,6 +15,7 @@
user.emote("deathgasp")
user.timeofdeath = world.time
user.status_flags |= FAKEDEATH //play dead
user.update_stat("fakedeath sting")
user.update_canmove()
addtimer(CALLBACK(src, .proc/ready_to_regenerate, user), LING_FAKEDEATH_TIME)
@@ -46,8 +46,8 @@
for(var/i in 1 to healing_ticks)
if(user)
var/healpertick = -(total_healing / healing_ticks)
user.heal_overall_damage((-healpertick/recent_uses), (-healpertick/recent_uses))
user.adjustOxyLoss(healpertick/recent_uses)
user.heal_overall_damage((-healpertick/recent_uses), (-healpertick/recent_uses), updating_health = FALSE)
user.adjustOxyLoss(healpertick/recent_uses, FALSE)
user.blood_volume = min(user.blood_volume + 30, BLOOD_VOLUME_NORMAL)
user.updatehealth()
else
+15 -13
View File
@@ -6,22 +6,22 @@
//Revive from regenerative stasis
/obj/effect/proc_holder/changeling/revive/sting_action(var/mob/living/carbon/user)
user.setToxLoss(0)
user.setOxyLoss(0)
user.setCloneLoss(0)
user.setBrainLoss(0)
user.SetParalysis(0)
user.SetStunned(0)
user.SetWeakened(0)
user.setToxLoss(0, FALSE)
user.setOxyLoss(0, FALSE)
user.setCloneLoss(0, FALSE)
user.setBrainLoss(0, FALSE)
user.SetParalysis(0, FALSE)
user.SetStunned(0, FALSE)
user.SetWeakened(0, FALSE)
user.radiation = 0
user.SetEyeBlind(0)
user.SetEyeBlurry(0)
user.SetEyeBlind(0, FALSE)
user.SetEyeBlurry(0, FALSE)
user.SetEarDamage(0)
user.SetEarDeaf(0)
user.heal_overall_damage(user.getBruteLoss(), user.getFireLoss())
user.CureBlind()
user.heal_overall_damage(user.getBruteLoss(), user.getFireLoss(), updating_health = FALSE)
user.CureBlind(FALSE)
user.CureDeaf()
user.CureNearsighted()
user.CureNearsighted(FALSE)
user.reagents.clear_reagents()
user.germ_level = 0
user.timeofdeath = 0
@@ -52,7 +52,9 @@
IO.rejuvenate()
IO.trace_chemicals.Cut()
H.remove_all_embedded_objects()
H.updatehealth()
user.updatehealth()
user.update_blind_effects()
user.update_blurry_effects()
to_chat(user, "<span class='notice'>We have regenerated.</span>")
+1 -3
View File
@@ -210,9 +210,7 @@ var/list/blacklisted_pylon_turfs = typecacheof(list(
if(L.health != L.maxHealth)
new /obj/effect/temp_visual/heal(get_turf(src), "#960000")
if(ishuman(L))
L.adjustBruteLoss(-1)
L.adjustFireLoss(-1)
L.updatehealth()
L.heal_overall_damage(1, 1)
if(istype(L, /mob/living/simple_animal/shade) || istype(L, /mob/living/simple_animal/hostile/construct))
var/mob/living/simple_animal/M = L
if(M.health < M.maxHealth)
@@ -42,7 +42,7 @@
to_chat(src, "<span class='danger'>You begin doggedly resisting the parasite's control (this will take approximately sixty seconds).</span>")
to_chat(B.host, "<span class='danger'>You feel the captive mind of [src] begin to resist your control.</span>")
var/delay = (rand(350,450) + B.host.brainloss)
var/delay = (rand(350,450) + B.host.getBrainLoss())
addtimer(CALLBACK(src, .proc/return_control, B), delay)
@@ -90,7 +90,10 @@
snapback()
/mob/living/simple_animal/hostile/guardian/death(gibbed)
..()
// Only execute the below if we successfully died
. = ..()
if(!.)
return FALSE
to_chat(summoner, "<span class='danger'>Your [name] died somehow!</span>")
summoner.death()
@@ -124,16 +124,19 @@
morph_time = world.time + MORPH_COOLDOWN
/mob/living/simple_animal/hostile/morph/death(gibbed)
if(morphed)
visible_message("<span class='warning'>[src] twists and dissolves into a pile of green flesh!</span>", \
"<span class='userdanger'>Your skin ruptures! Your flesh breaks apart! No disguise can ward off de--</span>")
restore()
if(gibbed)
. = ..()
if(stat == DEAD && gibbed)
for(var/atom/movable/AM in src)
AM.forceMove(loc)
if(prob(90))
step(AM, pick(alldirs))
..(gibbed)
// Only execute the below if we successfully died
if(!.)
return FALSE
if(morphed)
visible_message("<span class='warning'>[src] twists and dissolves into a pile of green flesh!</span>", \
"<span class='userdanger'>Your skin ruptures! Your flesh breaks apart! No disguise can ward off de--</span>")
restore()
/mob/living/simple_animal/hostile/morph/Aggro() // automated only
..()
@@ -161,15 +161,18 @@
/mob/living/simple_animal/revenant/dust()
death()
. = death()
/mob/living/simple_animal/revenant/gib()
death()
. = death()
/mob/living/simple_animal/revenant/death()
..()
if(!revealed)
return
return FALSE
// Only execute the below if we successfully died
. = ..()
if(!.)
return FALSE
ghost_darkness_images -= ghostimage
updateallghostimages()
@@ -190,7 +193,6 @@
R.client_to_revive = src.client //If the essence reforms, the old revenant is put back in the body
ghostize()
qdel(src)
return
/mob/living/simple_animal/revenant/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/nullrod))
@@ -96,10 +96,15 @@
desc = "A repulsive pile of guts and gore."
/mob/living/simple_animal/slaughter/death(gibbed)
// Only execute the below if we successfully died
. = ..()
if(!.)
return FALSE
for(var/mob/living/M in consumed_mobs)
M.forceMove(get_turf(src))
..()
release_consumed(M)
/mob/living/simple_animal/slaughter/proc/release_consumed(mob/living/M)
M.forceMove(get_turf(src))
/mob/living/simple_animal/slaughter/phasein()
. = ..()
@@ -297,13 +302,12 @@
deathmessage = "fades out, as all of its friends are released from its prison of hugs."
loot = list(/mob/living/simple_animal/pet/cat/kitten{name = "Laughter"})
/mob/living/simple_animal/slaughter/laughter/death(gibbed)
for(var/mob/living/M in consumed_mobs)
if(M.revive())
M.grab_ghost(force = TRUE)
playsound(get_turf(src), feast_sound, 50, 1, -1)
to_chat(M, "<span class='clown'>You leave the [src]'s warm embrace, and feel ready to take on the world.</span>")
..()
/mob/living/simple_animal/slaughter/laughter/release_consumed(mob/living/M)
if(M.revive())
M.grab_ghost(force = TRUE)
playsound(get_turf(src), feast_sound, 50, 1, -1)
to_chat(M, "<span class='clown'>You leave the [src]'s warm embrace, and feel ready to take on the world.</span>")
..(M)
//Objectives and helpers.
@@ -345,4 +349,4 @@
..()
/datum/objective/demonFluff/check_completion()
return 1
return 1
@@ -493,18 +493,19 @@
metabolization_rate = 100 //lel
/datum/reagent/shadowling_blindness_smoke/on_mob_life(mob/living/M)
var/update_flags = STATUS_UPDATE_NONE
if(!is_shadow_or_thrall(M))
to_chat(M, "<span class='warning'><b>You breathe in the black smoke, and your eyes burn horribly!</b></span>")
M.EyeBlind(5)
update_flags |= M.EyeBlind(5, FALSE)
if(prob(25))
M.visible_message("<b>[M]</b> claws at [M.p_their()] eyes!")
M.Stun(3)
else
to_chat(M, "<span class='notice'><b>You breathe in the black smoke, and you feel revitalized!</b></span>")
M.heal_organ_damage(2,2)
M.adjustOxyLoss(-2)
M.adjustToxLoss(-2)
..()
update_flags |= M.heal_organ_damage(2, 2, updating_health = FALSE)
update_flags |= M.adjustOxyLoss(-2, FALSE)
update_flags |= M.adjustToxLoss(-2, FALSE)
return ..() | update_flags
/obj/effect/proc_holder/spell/aoe_turf/unearthly_screech
name = "Sonic Screech"
+2 -4
View File
@@ -264,9 +264,6 @@
maim_clone(H)
H.Paralyse(4)
//Here let's calculate their health so the pod doesn't immediately eject them!!!
H.updatehealth()
if(grab_ghost_when == CLONER_FRESH_CLONE)
clonemind.transfer_to(H)
H.ckey = R.ckey
@@ -555,7 +552,7 @@
qdel(i)
missing_organs.Cut()
H.setCloneLoss(CLONE_INITIAL_DAMAGE)
H.setCloneLoss(CLONE_INITIAL_DAMAGE, FALSE)
H.setBrainLoss(BRAIN_INITIAL_DAMAGE)
for(var/o in H.internal_organs)
@@ -578,6 +575,7 @@
missing_organs += I
organs_number = LAZYLEN(missing_organs)
H.updatehealth()
/obj/machinery/clonepod/proc/check_brine()
// Clones are in a pickled bath of mild chemicals, keeping
+12 -14
View File
@@ -64,21 +64,19 @@
return 1
if(href_list["fix"])
src.active = 1
while(src.occupant.health < 100)
src.occupant.adjustOxyLoss(-1)
src.occupant.adjustFireLoss(-1)
src.occupant.adjustToxLoss(-1)
src.occupant.adjustBruteLoss(-1)
src.occupant.updatehealth()
if(src.occupant.health >= 0 && src.occupant.stat == 2)
src.occupant.stat = 0
src.occupant.lying = 0
dead_mob_list -= src.occupant
living_mob_list += src.occupant
active = 1
while(occupant.health < 100)
occupant.adjustOxyLoss(-1, FALSE)
occupant.adjustFireLoss(-1, FALSE)
occupant.adjustToxLoss(-1, FALSE)
occupant.adjustBruteLoss(-1, FALSE)
occupant.updatehealth()
if(occupant.health >= 0 && occupant.stat == DEAD)
occupant.update_revive()
occupant.lying = 0
sleep(10)
src.active = 0
src.add_fingerprint(usr)
active = 0
add_fingerprint(usr)
if(href_list["wireless"])
var/wireless = text2num(href_list["wireless"])
+2 -2
View File
@@ -217,7 +217,7 @@
// Check if camera is accessible when jumping
/obj/machinery/computer/security/proc/can_access_camera(var/obj/machinery/camera/C, var/mob/M)
if(CanUseTopic(M, default_state) != STATUS_INTERACTIVE || M.incapacitated() || M.blinded)
if(CanUseTopic(M, default_state) != STATUS_INTERACTIVE || M.incapacitated() || !M.has_vision())
return 0
if(isrobot(M))
@@ -361,4 +361,4 @@
icon_screen = "engie_cams"
light_color = "#FAC54B"
network = list("Power Alarms","Atmosphere Alarms","Fire Alarms")
circuit = /obj/item/circuitboard/camera/engineering
circuit = /obj/item/circuitboard/camera/engineering
+1 -1
View File
@@ -385,7 +385,7 @@
occupant.adjustToxLoss(max(-efficiency, (-20*(efficiency ** 2)) / occupant.getToxLoss()))
var/heal_brute = occupant.getBruteLoss() ? min(efficiency, 20*(efficiency**2) / occupant.getBruteLoss()) : 0
var/heal_fire = occupant.getFireLoss() ? min(efficiency, 20*(efficiency**2) / occupant.getFireLoss()) : 0
occupant.heal_organ_damage(heal_brute,heal_fire)
occupant.heal_organ_damage(heal_brute, heal_fire)
if(beaker && next_trans == 0)
var/proportion = 10 * min(1/beaker.volume, 1)
// Yes, this means you can get more bang for your buck with a beaker of SF vs a patch
+2 -5
View File
@@ -158,9 +158,7 @@
var/mob/living/silicon/robot/R = occupant
restock_modules()
if(repairs)
R.adjustBruteLoss(-(repairs))
R.adjustFireLoss(-(repairs))
R.updatehealth()
R.heal_overall_damage(repairs, repairs)
if(R.cell)
R.cell.charge = min(R.cell.charge + recharge_speed, R.cell.maxcharge)
else if(istype(occupant, /mob/living/carbon/human))
@@ -168,8 +166,7 @@
if(H.get_int_organ(/obj/item/organ/internal/cell) && H.nutrition < 450)
H.nutrition = min(H.nutrition+recharge_speed_nutrition, 450)
if(repairs)
H.heal_overall_damage(repairs, repairs, 0, 1)
H.updatehealth()
H.heal_overall_damage(repairs, repairs, TRUE, 0, 1)
/obj/machinery/recharge_station/proc/go_out()
if(!occupant)
-1
View File
@@ -62,7 +62,6 @@
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
H.emote("scream") // It is painful
H.adjustBruteLoss(max(0, 80 - H.getBruteLoss())) // Hurt the human, don't try to kill them though.
H.handle_regular_hud_updates() // Make sure they see the pain.
// Sleep for a couple of ticks to allow the human to see the pain
sleep(5)
@@ -228,7 +228,6 @@
return
if(M.health > 0)
M.adjustOxyLoss(-1)
M.updatehealth()
M.AdjustStunned(-4)
M.AdjustWeakened(-4)
M.AdjustStunned(-4)
@@ -520,4 +519,3 @@
for(var/reagent in processed_reagents)
reagents.add_reagent(reagent,amount)
chassis.use_power(energy_drain)
@@ -94,7 +94,6 @@
if(target)
target.Paralyse(10)
target.updatehealth()
/obj/item/mecha_parts/mecha_equipment/drill/diamonddrill
@@ -56,7 +56,6 @@
if(!M)
return
M.adjustOxyLoss(round(dam_force/2))
M.updatehealth()
target.visible_message("<span class='danger'>[chassis] squeezes [target].</span>", \
"<span class='userdanger'>[chassis] squeezes [target].</span>",\
"<span class='italics'>You hear something crack.</span>")
@@ -451,4 +450,3 @@
//NC.mergeConnectedNetworksOnTurf()
last_piece = NC
return 1
+1 -2
View File
@@ -232,7 +232,6 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d
var/obj/item/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_arm")
if(affecting && affecting.receive_damage(0, 5)) // 5 burn damage
H.UpdateDamageIcon()
H.updatehealth()
return
else
extinguish()
@@ -554,4 +553,4 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d
return TRUE
/obj/item/attack_hulk(mob/living/carbon/human/user)
return FALSE
return FALSE
@@ -90,7 +90,6 @@
to_chat(AI, "Your core files are being wiped!")
while(AI && AI.stat != DEAD)
AI.adjustOxyLoss(2)
AI.updatehealth()
sleep(10)
flush = 0
@@ -302,14 +302,12 @@
if(cyborg.health < cyborg.maxHealth)
if(cyborg.health < 0)
repair_amount = -2.5
repair_amount = 2.5
powercost = 30
else
repair_amount = -1
repair_amount = 1
powercost = 10
cyborg.adjustBruteLoss(repair_amount)
cyborg.adjustFireLoss(repair_amount)
cyborg.updatehealth()
cyborg.heal_overall_damage(repair_amount, repair_amount)
cyborg.cell.use(powercost)
else
cyborg.cell.use(5)
+1 -3
View File
@@ -94,9 +94,7 @@
hp -= Proj.damage
if(hp <= 0)
for(var/mob/O in oviewers())
if((O.client && !( O.blinded )))
to_chat(O, "<span class='warning'>[src] breaks into tiny pieces and collapses!</span>")
visible_message("<span class='warning'>[src] breaks into tiny pieces and collapses!</span>")
qdel(src)
// Create a temporary object to represent the damage
@@ -73,7 +73,6 @@
else
M.heal_organ_damage(heal_brute, heal_burn)
M.updatehealth()
user.visible_message("<span class='green'>[user] applies [src] on [M].</span>", \
"<span class='green'>You apply [src] on [M].</span>")
use(1)
+1 -4
View File
@@ -15,9 +15,7 @@
if(istype(M,/mob/living/silicon/robot)) //Repairing cyborgs
var/mob/living/silicon/robot/R = M
if(R.getBruteLoss() || R.getFireLoss() )
R.adjustBruteLoss(-15)
R.adjustFireLoss(-15)
R.updatehealth()
R.heal_overall_damage(15, 15)
use(1)
user.visible_message("<span class='notice'>\The [user] applied some [src] at [R]'s damaged areas.</span>",\
"<span class='notice'>You apply some [src] at [R]'s damaged areas.</span>")
@@ -31,7 +29,6 @@
if(S && S.is_robotic())
if(S.get_damage())
S.heal_damage(15, 15, robo_repair = 1)
H.updatehealth()
use(1)
user.visible_message("<span class='notice'>\The [user] applies some nanite paste at[user != M ? " \the [M]'s" : " \the"][S.name] with \the [src].</span>",\
"<span class='notice'>You apply some nanite paste at [user == M ? "your" : "[M]'s"] [S.name].</span>")
-2
View File
@@ -332,7 +332,6 @@
"<span class='userdanger'>[user] has touched [H.name] with [src]!</span>")
H.adjustStaminaLoss(50)
H.Weaken(5)
H.updatehealth() //forces health update before next life tick
playsound(get_turf(src), 'sound/machines/defib_zap.ogg', 50, 1, -1)
H.emote("gasp")
if(!H.undergoing_cardiac_arrest() && (prob(10) || defib.combat)) // Your heart explodes.
@@ -479,7 +478,6 @@
"<span class='userdanger'>[user] has touched [H.name] with [src]!</span>")
H.adjustStaminaLoss(50)
H.Weaken(5)
H.updatehealth() //forces health update before next life tick
if(!H.undergoing_cardiac_arrest() && prob(10)) // Your heart explodes.
H.set_heartattack(TRUE)
playsound(get_turf(src), 'sound/machines/defib_zap.ogg', 50, 1, -1)
@@ -56,7 +56,6 @@
var/obj/item/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_hand")
if(affecting.receive_damage( 0, 5 )) //INFERNO
H.UpdateDamageIcon()
H.updatehealth()
user.visible_message("<span class='notice'>After a few attempts, [user] manages to light the [src], [user.p_they()] however burn[user.p_s()] [user.p_their()] finger in the process.</span>")
set_light(2)
+1 -3
View File
@@ -50,7 +50,6 @@
to_chat(H, "<span class='warning'>[src] cuts into your hand!</span>")
if(affecting.receive_damage(force*0.5))
H.UpdateDamageIcon()
H.updatehealth()
/obj/item/shard/attackby(obj/item/I, mob/user, params)
if(iswelder(I))
@@ -87,7 +86,6 @@
H.Weaken(3)
if(affecting.receive_damage(5, 0))
H.UpdateDamageIcon()
H.updatehealth()
..()
/obj/item/shard/plasma
@@ -126,4 +124,4 @@
to_chat(usr, "You add the newly-formed plasma glass to the stack. It now contains [NG.amount] sheets.")
qdel(src)
else
return ..()
return ..()
-1
View File
@@ -147,7 +147,6 @@
H.adjustBruteLoss(damage)
H.UpdateDamageIcon()
H.updatehealth()
return
/obj/structure/proc/can_touch(var/mob/user)
@@ -60,9 +60,7 @@
if(allowed(user))
locked = !locked
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
for(var/mob/O in viewers(user, 3))
if((O.client && !( O.blinded )))
to_chat(O, "<span class='notice'>The locker has been [locked ? null : "un"]locked by [user].</span>")
visible_message("<span class='notice'>The locker has been [locked ? null : "un"]locked by [user].</span>")
update_icon()
else
to_chat(user, "<span class='notice'>Access Denied</span>")
@@ -270,9 +270,7 @@
return
if(src.allowed(user))
src.locked = !src.locked
for(var/mob/O in viewers(user, 3))
if((O.client && !( O.blinded )))
to_chat(O, "<span class='notice'>The crate has been [locked ? null : "un"]locked by [user].</span>")
visible_message("<span class='notice'>The crate has been [locked ? null : "un"]locked by [user].</span>")
update_icon()
else
to_chat(user, "<span class='notice'>Access Denied</span>")
+2 -5
View File
@@ -69,10 +69,7 @@
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
@@ -82,4 +79,4 @@
new /obj/item/clothing/mask/facehugger/lamarr(src.loc)
occupied = 0
update_icon()
return
return
+2 -6
View File
@@ -207,9 +207,7 @@
return
O.forceMove(loc)
if(user != O)
for(var/mob/B in viewers(user, 3))
if((B.client && !( B.blinded )))
to_chat(B, text("<span class='warning'>[] stuffs [] into []!</span>", user, O, src))
user.visible_message("<span class='warning'>[user] stuffs [O] into [src]!</span>")
return
/obj/structure/m_tray/Destroy()
@@ -440,9 +438,7 @@
return
O.forceMove(loc)
if(user != O)
for(var/mob/B in viewers(user, 3))
if((B.client && !( B.blinded )))
to_chat(B, text("<span class='warning'>[] stuffs [] into []!</span>", user, O, src))
user.visible_message("<span class='warning'>[user] stuffs [O] into [src]!</span>")
//Foreach goto(99)
return
+10 -15
View File
@@ -24,24 +24,24 @@
//Do dmgamt damage divided by the number of damage types applied.
if(damagetype & BRUTELOSS)
adjustBruteLoss(dmgamt / damage_mod)
adjustBruteLoss(dmgamt / damage_mod, FALSE)
if(damagetype & FIRELOSS)
adjustFireLoss(dmgamt / damage_mod)
adjustFireLoss(dmgamt / damage_mod, FALSE)
if(damagetype & TOXLOSS)
adjustToxLoss(dmgamt / damage_mod)
adjustToxLoss(dmgamt / damage_mod, FALSE)
if(damagetype & OXYLOSS)
adjustOxyLoss(dmgamt / damage_mod)
adjustOxyLoss(dmgamt / damage_mod, FALSE)
// Failing that...
if(!(damagetype & BRUTELOSS) && !(damagetype & FIRELOSS) && !(damagetype & TOXLOSS) && !(damagetype & OXYLOSS))
if(NO_BREATHE in dna.species.species_traits)
// the ultimate fallback
take_overall_damage(max(dmgamt - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0), 0)
take_overall_damage(max(dmgamt - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0), 0, updating_health = FALSE)
else
adjustOxyLoss(max(dmgamt - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
adjustOxyLoss(max(dmgamt - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0), FALSE)
var/obj/item/organ/external/affected = get_organ("head")
if(affected)
@@ -87,8 +87,6 @@
to_chat(viewers(src), "<span class='danger'>[src] [replacetext(pick(dna.species.suicide_messages), "their", p_their())] It looks like [p_theyre()] trying to commit suicide.</span>")
do_suicide(0)
updatehealth()
/mob/living/carbon/brain/verb/suicide()
set hidden = 1
@@ -132,7 +130,6 @@
to_chat(viewers(src), "<span class='danger'>[src] is powering down. It looks like [p_theyre()] trying to commit suicide.</span>")
//put em at -175
adjustOxyLoss(max(maxHealth * 2 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
updatehealth()
/mob/living/silicon/robot/verb/suicide()
set hidden = 1
@@ -152,7 +149,6 @@
to_chat(viewers(src), "<span class='danger'>[src] is powering down. It looks like [p_theyre()] trying to commit suicide.</span>")
//put em at -175
adjustOxyLoss(max(maxHealth * 2 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
updatehealth()
/mob/living/silicon/pai/verb/suicide()
set category = "pAI Commands"
@@ -189,7 +185,6 @@
to_chat(viewers(src), "<span class='danger'>[src] is thrashing wildly! It looks like [p_theyre()] trying to commit suicide.</span>")
//put em at -175
adjustOxyLoss(max(175 - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
updatehealth()
/mob/living/carbon/slime/verb/suicide()
@@ -206,9 +201,9 @@
if(confirm == "Yes")
suiciding = 1
setOxyLoss(100)
adjustBruteLoss(100 - getBruteLoss())
setToxLoss(100)
setCloneLoss(100)
setOxyLoss(100, FALSE)
adjustBruteLoss(100 - getBruteLoss(), FALSE)
setToxLoss(100, FALSE)
setCloneLoss(100, FALSE)
updatehealth()
-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]")

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