implemented getOxyLoss()

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2520 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
rockdtben
2011-11-14 14:44:52 +00:00
parent d539e731e8
commit faee0422ae
41 changed files with 119 additions and 110 deletions
+6 -6
View File
@@ -1165,7 +1165,7 @@ datum
if(M.stat == 2.0)
return //See above, down and around. --Agouri
if(!M) M = holder.my_atom
M:oxyloss = max(M:oxyloss-2, 0)
M:oxyloss = max(M:getOxyLoss()-2, 0)
if(holder.has_reagent("lexorin"))
holder.remove_reagent("lexorin", 2)
..()
@@ -1199,7 +1199,7 @@ datum
if(M.stat == 2.0)
return
if(!M) M = holder.my_atom
if(M:oxyloss && prob(40)) M:oxyloss--
if(M:getOxyLoss() && prob(40)) M:oxyloss--
if(M:getBruteLoss() && prob(40)) M:heal_organ_damage(1,0)
if(M:fireloss && prob(40)) M:heal_organ_damage(0,1)
if(M:toxloss && prob(40)) M:toxloss--
@@ -1401,7 +1401,7 @@ datum
if(!M) M = holder.my_atom
if(M.bodytemperature < 170)
if(M:cloneloss) M:cloneloss = max(0, M:cloneloss-1)
if(M:oxyloss) M:oxyloss = max(0, M:oxyloss-3)
if(M:getOxyLoss()) M:oxyloss = max(0, M:getOxyLoss()-3)
M:heal_organ_damage(3,3)
if(M:toxloss) M:toxloss = max(0, M:toxloss-3)
..()
@@ -1418,7 +1418,7 @@ datum
if(!M) M = holder.my_atom
if(M.bodytemperature < 170)
if(M:cloneloss) M:cloneloss = max(0, M:cloneloss-3)
if(M:oxyloss) M:oxyloss = max(0, M:oxyloss-3)
if(M:getOxyLoss()) M:oxyloss = max(0, M:getOxyLoss()-3)
M:heal_organ_damage(3,3)
if(M:toxloss) M:toxloss = max(0, M:toxloss-3)
..()
@@ -1928,7 +1928,7 @@ datum
on_mob_life(var/mob/living/M as mob)
M:nutrition += nutriment_factor
if(!M) M = holder.my_atom
if(M:oxyloss && prob(30)) M:oxyloss--
if(M:getOxyLoss() && prob(30)) M:oxyloss--
M:nutrition++
..()
return
@@ -3030,7 +3030,7 @@ datum
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
if(M:oxyloss && prob(50)) M:oxyloss -= 2
if(M:getOxyLoss() && prob(50)) M:oxyloss -= 2
if(M:getBruteLoss() && prob(60)) M:heal_organ_damage(2,0)
if(M:fireloss && prob(50)) M:heal_organ_damage(0,2)
if(M:toxloss && prob(50)) M:toxloss -= 2
+2 -2
View File
@@ -42,7 +42,7 @@
sleeping = 0
bruteloss = max(getBruteLoss(), 0)
toxloss = max(toxloss, 0)
oxyloss = max(oxyloss, 0)
oxyloss = max(getOxyLoss(), 0)
fireloss = max(fireloss, 0)
if(stat)
stat = 0
@@ -50,7 +50,7 @@
proc/UpdateDamage()
health = 60 - (oxyloss + toxloss + fireloss + getBruteLoss() + cloneloss)
health = 60 - (getOxyLoss() + toxloss + fireloss + getBruteLoss() + cloneloss)
return
@@ -20,7 +20,7 @@
if (src.nodamage == 0)
//oxyloss is only used for suicide
//toxloss isn't used for aliens, its actually used as alien powers!!
src.health = 150 - src.oxyloss - src.fireloss - src.getBruteLoss()
src.health = 150 - src.getOxyLoss() - src.fireloss - src.getBruteLoss()
else
src.health = 150
src.stat = 0
@@ -76,9 +76,9 @@
handle_regular_status_updates()
health = 150 - (oxyloss + fireloss + getBruteLoss() + cloneloss)
health = 150 - (getOxyLoss() + fireloss + getBruteLoss() + cloneloss)
if(oxyloss > 50) paralysis = max(paralysis, 3)
if(getOxyLoss() > 50) paralysis = max(paralysis, 3)
if(src.sleeping)
src.paralysis = max(src.paralysis, 3)
@@ -20,7 +20,7 @@
if (src.nodamage == 0)
//oxyloss is only used for suicide
//toxloss isn't used for aliens, its actually used as alien powers!!
src.health = 125 - src.oxyloss - src.fireloss - src.getBruteLoss()
src.health = 125 - src.getOxyLoss() - src.fireloss - src.getBruteLoss()
else
src.health = 125
src.stat = 0
@@ -77,9 +77,9 @@
handle_regular_status_updates()
health = 150 - (oxyloss + fireloss + getBruteLoss() + cloneloss)
health = 150 - (getOxyLoss() + fireloss + getBruteLoss() + cloneloss)
if(oxyloss > 50) paralysis = max(paralysis, 3)
if(getOxyLoss() > 50) paralysis = max(paralysis, 3)
if(src.sleeping)
src.paralysis = max(src.paralysis, 3)
@@ -755,7 +755,7 @@ In all, this is a lot like the monkey code. /N
if (nodamage == 0)
//oxyloss is only used for suicide
//toxloss isn't used for aliens, its actually used as alien powers!!
health = 100 - oxyloss - fireloss - getBruteLoss()
health = 100 - getOxyLoss() - fireloss - getBruteLoss()
else
health = 100
stat = 0
@@ -86,7 +86,7 @@
sleeping = max(min(sleeping, 20), 0)
bruteloss = max(getBruteLoss(), 0)
toxloss = max(toxloss, 0)
oxyloss = max(oxyloss, 0)
oxyloss = max(getOxyLoss(), 0)
fireloss = max(fireloss, 0)
@@ -396,9 +396,9 @@
handle_regular_status_updates()
health = 100 - (oxyloss + fireloss + getBruteLoss() + cloneloss)
health = 100 - (getOxyLoss() + fireloss + getBruteLoss() + cloneloss)
if(oxyloss > 50) paralysis = max(paralysis, 3)
if(getOxyLoss() > 50) paralysis = max(paralysis, 3)
if(src.sleeping)
src.paralysis = max(src.paralysis, 3)
@@ -23,7 +23,7 @@
if (src.nodamage == 0)
//oxyloss is only used for suicide
//toxloss isn't used for aliens, its actually used as alien powers!!
src.health = 250 - src.oxyloss - src.fireloss - src.getBruteLoss()
src.health = 250 - src.getOxyLoss() - src.fireloss - src.getBruteLoss()
else
src.health = 250
src.stat = 0
@@ -78,9 +78,9 @@
handle_regular_status_updates()
health = 250 - (oxyloss + fireloss + getBruteLoss() + cloneloss)
health = 250 - (getOxyLoss() + fireloss + getBruteLoss() + cloneloss)
if(oxyloss > 50) paralysis = max(paralysis, 3)
if(getOxyLoss() > 50) paralysis = max(paralysis, 3)
if(src.sleeping)
src.paralysis = max(src.paralysis, 3)
@@ -503,7 +503,7 @@
if (nodamage == 0)
//oxyloss is only used for suicide
//toxloss isn't used for aliens, its actually used as alien powers!!
health = 25 - oxyloss - fireloss - getBruteLoss()
health = 25 - getOxyLoss() - fireloss - getBruteLoss()
else
health = 25
stat = 0
@@ -84,7 +84,7 @@
sleeping = max(min(sleeping, 20), 0)
bruteloss = max(getBruteLoss(), 0)
toxloss = max(toxloss, 0)
oxyloss = max(oxyloss, 0)
oxyloss = max(getOxyLoss(), 0)
fireloss = max(fireloss, 0)
handle_mutations_and_radiation()
@@ -323,9 +323,9 @@
handle_regular_status_updates()
health = 25 - (oxyloss + fireloss + getBruteLoss() + cloneloss)
health = 25 - (getOxyLoss() + fireloss + getBruteLoss() + cloneloss)
if(oxyloss > 50) paralysis = max(paralysis, 3)
if(getOxyLoss() > 50) paralysis = max(paralysis, 3)
if(sleeping)
paralysis = max(paralysis, 3)
@@ -20,7 +20,7 @@
handle_regular_status_updates()
health = 200 - (oxyloss + fireloss + getBruteLoss())
health = 200 - (getOxyLoss() + fireloss + getBruteLoss())
weakened = 0
stunned = 0
@@ -43,7 +43,7 @@
return 1
updatehealth()
src.health = 200 - src.oxyloss - src.fireloss - src.getBruteLoss()
src.health = 200 - src.getOxyLoss() - src.fireloss - src.getBruteLoss()
xcom_attack(mob/living/carbon/human/target as mob)
if(!ishuman(target))
+3 -3
View File
@@ -47,7 +47,7 @@
weakened = max(weakened, 0)
bruteloss = max(getBruteLoss(), 0)
fireloss = max(fireloss, 0)
oxyloss = max(oxyloss, 0)
oxyloss = max(getOxyLoss(), 0)
toxloss = max(toxloss, 0)
handle_mutations_and_radiation()
@@ -144,9 +144,9 @@
handle_regular_status_updates()
health = 100 - (oxyloss + toxloss + fireloss + getBruteLoss() + cloneloss)
health = 100 - (getOxyLoss() + toxloss + fireloss + getBruteLoss() + cloneloss)
if(oxyloss > 25) paralysis = max(paralysis, 3)
if(getOxyLoss() > 25) paralysis = max(paralysis, 3)
if(sleeping)
paralysis = max(paralysis, 5)
@@ -1874,7 +1874,7 @@ It can still be worn/put on as normal.
return
if ((target.health >= -99.0 && target.health < 0))
target.cpr_time = world.time
var/suff = min(target.oxyloss, 7)
var/suff = min(target.getOxyLoss(), 7)
target.oxyloss -= suff
target.updatehealth()
for(var/mob/O in viewers(source, null))
@@ -2195,7 +2195,7 @@ It can still be worn/put on as normal.
for(var/datum/organ/external/O in organs)
src.bruteloss += O.brute_dam
src.fireloss += O.burn_dam
src.health = 100 - src.oxyloss - src.toxloss - src.fireloss - src.getBruteLoss() - src.cloneloss
src.health = 100 - src.getOxyLoss() - src.toxloss - src.fireloss - src.getBruteLoss() - src.cloneloss
/mob/living/carbon/human/abiotic(var/full_body = 0)
+5 -5
View File
@@ -104,7 +104,7 @@
sleeping = max(min(sleeping, 20), 0)
bruteloss = max(getBruteLoss(), 0)
toxloss = max(toxloss, 0)
oxyloss = max(oxyloss, 0)
oxyloss = max(getOxyLoss(), 0)
fireloss = max(fireloss, 0)
@@ -346,7 +346,7 @@
oxygen_used = breath.oxygen*ratio/6
oxygen_alert = max(oxygen_alert, 1)*/
else // We're in safe limits
oxyloss = max(oxyloss-5, 0)
oxyloss = max(getOxyLoss()-5, 0)
oxygen_used = breath.oxygen/6
oxygen_alert = 0
@@ -607,7 +607,7 @@
heal_overall_damage(1,0)
if(toxloss)
toxloss--
if(oxyloss)
if(getOxyLoss())
oxyloss--
if(overeatduration > 500 && !(mutations & FAT))
@@ -656,9 +656,9 @@
handle_regular_status_updates()
// health = 100 - (oxyloss + toxloss + fireloss + bruteloss + cloneloss)
// health = 100 - (getOxyLoss() + toxloss + fireloss + bruteloss + cloneloss)
if(oxyloss > 50) paralysis = max(paralysis, 3)
if(getOxyLoss() > 50) paralysis = max(paralysis, 3)
if(sleeping)
paralysis = max(paralysis, 3)
@@ -396,9 +396,9 @@
handle_regular_status_updates()
if(istype(src, /mob/living/carbon/metroid/adult))
health = 200 - (oxyloss + toxloss + fireloss + getBruteLoss() + cloneloss)
health = 200 - (getOxyLoss() + toxloss + fireloss + getBruteLoss() + cloneloss)
else
health = 150 - (oxyloss + toxloss + fireloss + getBruteLoss() + cloneloss)
health = 150 - (getOxyLoss() + toxloss + fireloss + getBruteLoss() + cloneloss)
@@ -416,7 +416,7 @@
if(src.stat != 2) src.stat = 1
if(prob(30))
if(oxyloss>0) oxyloss = max(oxyloss-1, 0)
if(getOxyLoss()>0) oxyloss = max(getOxyLoss()-1, 0)
if(toxloss>0) toxloss = max(toxloss-1, 0)
if(fireloss>0) fireloss = max(fireloss-1,0)
if(cloneloss>0) cloneloss = max(cloneloss-1,0)
@@ -648,9 +648,9 @@ mob/living/carbon/metroid/var/temperature_resistance = T0C+75
if (nodamage == 0)
// metroids can't suffocate unless they suicide. They are also not harmed by fire
if(istype(src, /mob/living/carbon/metroid/adult))
health = 200 - (oxyloss + toxloss + fireloss + getBruteLoss() + cloneloss)
health = 200 - (getOxyLoss() + toxloss + fireloss + getBruteLoss() + cloneloss)
else
health = 150 - (oxyloss + toxloss + fireloss + getBruteLoss() + cloneloss)
health = 150 - (getOxyLoss() + toxloss + fireloss + getBruteLoss() + cloneloss)
else
if(istype(src, /mob/living/carbon/metroid/adult))
health = 200
@@ -79,8 +79,8 @@
if(toxloss > 0)
toxloss = max(0, toxloss-10)
if(oxyloss > 0)
oxyloss = max(0, oxyloss-10)
if(getOxyLoss() > 0)
oxyloss = max(0, getOxyLoss()-10)
if(getBruteLoss() > 0)
bruteloss = max(0, getBruteLoss()-10)
@@ -97,7 +97,7 @@
Metroid.Feedstop()
if(toxloss<0) toxloss = 0
if(oxyloss<0) oxyloss = 0
if(getOxyLoss()<0) oxyloss = 0
if(getBruteLoss()<0) bruteloss = 0
if(fireloss<0) fireloss = 0
if(cloneloss<0) cloneloss = 0
@@ -293,7 +293,7 @@
oxygen_used = breath.oxygen*ratio/6
oxygen_alert = max(oxygen_alert, 1)*/
else // We're in safe limits
oxyloss = max(oxyloss-5, 0)
oxyloss = max(getOxyLoss()-5, 0)
oxygen_used = breath.oxygen/6
oxygen_alert = 0
@@ -397,9 +397,9 @@
handle_regular_status_updates()
health = 100 - (oxyloss + toxloss + fireloss + getBruteLoss() + cloneloss)
health = 100 - (getOxyLoss() + toxloss + fireloss + getBruteLoss() + cloneloss)
if(oxyloss > 25) paralysis = max(paralysis, 3)
if(getOxyLoss() > 25) paralysis = max(paralysis, 3)
if(src.sleeping)
src.paralysis = max(src.paralysis, 5)
@@ -103,7 +103,7 @@
bruteloss += 30
if ((O.icon_state == "flaming" && !( shielded )))
fireloss += 40
health = 100 - oxyloss - toxloss - fireloss - getBruteLoss()
health = 100 - getOxyLoss() - toxloss - fireloss - getBruteLoss()
return
//mob/living/carbon/monkey/bullet_act(var/obj/item/projectile/Proj)taken care of in living
@@ -139,7 +139,7 @@
O.show_message("\red <B>[M.name] has bit [name]!</B>", 1)
var/damage = rand(1, 5)
bruteloss += damage
health = 100 - oxyloss - toxloss - fireloss - getBruteLoss()
health = 100 - getOxyLoss() - toxloss - fireloss - getBruteLoss()
for(var/datum/disease/D in M.viruses)
if(istype(D, /datum/disease/jungle_fever))
contract_disease(D,1,0)
@@ -536,16 +536,16 @@
if(1.0)
if (stat != 2)
bruteloss += 200
health = 100 - oxyloss - toxloss - fireloss - getBruteLoss()
health = 100 - getOxyLoss() - toxloss - fireloss - getBruteLoss()
if(2.0)
if (stat != 2)
bruteloss += 60
fireloss += 60
health = 100 - oxyloss - toxloss - fireloss - getBruteLoss()
health = 100 - getOxyLoss() - toxloss - fireloss - getBruteLoss()
if(3.0)
if (stat != 2)
bruteloss += 30
health = 100 - oxyloss - toxloss - fireloss - getBruteLoss()
health = 100 - getOxyLoss() - toxloss - fireloss - getBruteLoss()
if (prob(50))
paralysis += 10
else
@@ -554,7 +554,7 @@
/mob/living/carbon/monkey/blob_act()
if (stat != 2)
fireloss += 60
health = 100 - oxyloss - toxloss - fireloss - getBruteLoss()
health = 100 - getOxyLoss() - toxloss - fireloss - getBruteLoss()
if (prob(50))
paralysis += 10
+2 -2
View File
@@ -2,13 +2,13 @@
set hidden = 1
if ((src.health < 0 && src.health > -95.0))
src.oxyloss += src.health + 200
src.health = 100 - src.oxyloss - src.toxloss - src.fireloss - src.getBruteLoss()
src.health = 100 - src.getOxyLoss() - src.toxloss - src.fireloss - src.getBruteLoss()
src << "\blue You have given up life and succumbed to death."
/mob/living/proc/updatehealth()
if(!src.nodamage)
src.health = 100 - src.oxyloss - src.toxloss - src.fireloss - src.getBruteLoss() - src.cloneloss
src.health = 100 - src.getOxyLoss() - src.toxloss - src.fireloss - src.getBruteLoss() - src.cloneloss
else
src.health = 100
src.stat = 0
+4 -4
View File
@@ -76,7 +76,7 @@
src << "Alert cancelled. Power has been restored without our assistance."
src:aiRestorePowerRoutine = 0
spawn(1)
while (src.oxyloss>0 && stat!=2)
while (src.getOxyLoss()>0 && stat!=2)
sleep(50)
src.oxyloss-=1
src.oxyloss = 0
@@ -85,7 +85,7 @@
src << "Alert cancelled. Power has been restored."
src:aiRestorePowerRoutine = 0
spawn(1)
while (src.oxyloss>0 && stat!=2)
while (src.getOxyLoss()>0 && stat!=2)
sleep(50)
src.oxyloss-=1
src.oxyloss = 0
@@ -239,9 +239,9 @@
/mob/living/silicon/ai/updatehealth()
if (src.nodamage == 0)
if(src.fire_res_on_core)
src.health = 100 - src.oxyloss - src.toxloss - src.getBruteLoss()
src.health = 100 - src.getOxyLoss() - src.toxloss - src.getBruteLoss()
else
src.health = 100 - src.oxyloss - src.toxloss - src.fireloss - src.getBruteLoss()
src.health = 100 - src.getOxyLoss() - src.toxloss - src.fireloss - src.getBruteLoss()
else
src.health = 100
src.stat = 0
@@ -9,7 +9,7 @@
/mob/living/silicon/decoy/updatehealth()
if (src.nodamage == 0)
src.health = 100 - src.oxyloss - src.toxloss - src.fireloss - src.getBruteLoss()
src.health = 100 - src.getOxyLoss() - src.toxloss - src.fireloss - src.getBruteLoss()
else
src.health = 100
src.stat = 0
@@ -469,7 +469,7 @@
dat += {"Bioscan Results for [M]: <br>"
Overall Status: [M.stat > 1 ? "dead" : "[M.health]% healthy"] <br>
Scan Breakdown: <br>
Respiratory: [M.oxyloss > 50 ? "<font color=#FF5555>" : "<font color=#55FF55>"][M.oxyloss]</font><br>
Respiratory: [M.getOxyLoss() > 50 ? "<font color=#FF5555>" : "<font color=#55FF55>"][M.getOxyLoss()]</font><br>
Toxicology: [M.toxloss > 50 ? "<font color=#FF5555>" : "<font color=#55FF55>"][M.toxloss]</font><br>
Burns: [M.fireloss > 50 ? "<font color=#FF5555>" : "<font color=#55FF55>"][M.fireloss]</font><br>
Structural Integrity: [M.getBruteLoss() > 50 ? "<font color=#FF5555>" : "<font color=#55FF55>"][M.getBruteLoss()]</font><br>
@@ -36,7 +36,7 @@
sleeping = 0
bruteloss = max(getBruteLoss(), 0)
toxloss = max(toxloss, 0)
oxyloss = max(oxyloss, 0)
oxyloss = max(getOxyLoss(), 0)
fireloss = max(fireloss, 0)
use_power()
@@ -87,9 +87,9 @@
if(src.stat)
src.camera.status = 0
health = 200 - (oxyloss + fireloss + getBruteLoss())
health = 200 - (getOxyLoss() + fireloss + getBruteLoss())
if(oxyloss > 50) paralysis = max(paralysis, 3)
if(getOxyLoss() > 50) paralysis = max(paralysis, 3)
if(src.sleeping)
src.paralysis = max(src.paralysis, 3)