From 8892ae794c20d57c95da8e662cb7babe53b46978 Mon Sep 17 00:00:00 2001 From: rockdtben Date: Sat, 24 Dec 2011 20:54:25 +0000 Subject: [PATCH] Now all calls for bruteloss are handled via procs now. Extensibility++ git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2803 316c924e-a436-60f5-8080-3fe189b3f50e --- code/WorkInProgress/virus2/base.dm | 2 +- code/game/mecha/equipment/tools/tools.dm | 3 +-- .../mob/living/carbon/metroid/powers.dm | 25 ++++--------------- .../mob/living/carbon/monkey/monkey.dm | 16 ++++++------ code/modules/mob/living/living.dm | 8 +++--- code/modules/mob/living/silicon/ai/ai.dm | 6 ++--- code/modules/mob/living/silicon/ai/life.dm | 5 ++-- code/modules/mob/living/silicon/pai/pai.dm | 4 +-- .../modules/mob/living/silicon/robot/robot.dm | 14 +++++------ code/modules/mob/living/silicon/silicon.dm | 2 +- code/unused/hivebot/hivebot.dm | 7 +++--- code/unused/newcombatsystem.dm | 2 +- 12 files changed, 37 insertions(+), 57 deletions(-) diff --git a/code/WorkInProgress/virus2/base.dm b/code/WorkInProgress/virus2/base.dm index 4b543badeb1..505cf3694b0 100644 --- a/code/WorkInProgress/virus2/base.dm +++ b/code/WorkInProgress/virus2/base.dm @@ -428,7 +428,7 @@ mob.suiciding = 1 //instead of killing them instantly, just put them at -175 health and let 'em gasp for a while viewers(mob) << "\red [mob.name] is holding \his breath. It looks like \he's trying to commit suicide." - mob.oxyloss = max(175 - mob.toxloss - mob.fireloss - mob.bruteloss, mob.oxyloss) + mob.adjustOxyLoss(175 - mob.getToxLoss() - mob.getFireLoss() - mob.getBruteLoss() - mob.getOxyLoss()) mob.updatehealth() spawn(200) //in case they get revived by cryo chamber or something stupid like that, let them suicide again in 20 seconds mob.suiciding = 0 diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm index bab1d1a7f55..57470a74335 100644 --- a/code/game/mecha/equipment/tools/tools.dm +++ b/code/game/mecha/equipment/tools/tools.dm @@ -1071,8 +1071,7 @@ if(!M) return if(M.health > 0) - if(M.getOxyLoss() > 0) - M.adjustOxyLoss(-1) + M.adjustOxyLoss(-1) M.updatehealth() M.AdjustStunned(-4) M.AdjustWeakened(-4) diff --git a/code/modules/mob/living/carbon/metroid/powers.dm b/code/modules/mob/living/carbon/metroid/powers.dm index a08b4df5edd..6cba3331f0a 100644 --- a/code/modules/mob/living/carbon/metroid/powers.dm +++ b/code/modules/mob/living/carbon/metroid/powers.dm @@ -76,32 +76,17 @@ if(Victim.health <= 0) Victim.adjustToxLoss(rand(2,4)) - if(getToxLoss() > 0) - adjustToxLoss(-10) - - if(getOxyLoss() > 0) - oxyloss = max(0, getOxyLoss()-10) - - if(getBruteLoss() > 0) - bruteloss = max(0, getBruteLoss()-10) - - if(getFireLoss() > 0) - adjustFireLoss(-10) - - if(getCloneLoss() > 0) - adjustCloneLoss(-10) + adjustToxLoss(-10) + adjustOxyLoss(-10) + adjustBruteLoss(-10) + adjustFireLoss(-10) + adjustCloneLoss(-10) if(Victim) for(var/mob/living/carbon/metroid/Metroid in view(1,M)) if(Metroid.Victim == M && Metroid != src) Metroid.Feedstop() - if(getToxLoss()<0) adjustToxLoss(0) - if(getOxyLoss()<0) adjustOxyLoss(0) - if(getBruteLoss()<0) adjustBruteLoss(0) - if(getFireLoss()<0) adjustFireLoss(0) - if(getCloneLoss()<0) adjustCloneLoss(0) - nutrition += rand(10,25) if(nutrition >= lastnut + 50) if(prob(80)) diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 0f398a4d70e..5603c83c6b6 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -100,7 +100,7 @@ M.show_message(text("\red [] has been hit by []", src, O), 1) if (health > 0) var/shielded = 0 - bruteloss += 30 + adjustBruteLoss(30) if ((O.icon_state == "flaming" && !( shielded ))) adjustFireLoss(40) health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() @@ -115,7 +115,7 @@ O.show_message(text("\red [M.name] has bit []!", src), 1) var/damage = rand(1, 5) if (mutations & HULK) damage += 10 - bruteloss += damage + adjustBruteLoss(damage) updatehealth() for(var/datum/disease/D in M.viruses) @@ -138,7 +138,7 @@ for(var/mob/O in viewers(src, null)) O.show_message("\red [M.name] has bit [name]!", 1) var/damage = rand(1, 5) - bruteloss += damage + adjustBruteLoss(damage) health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() for(var/datum/disease/D in M.viruses) if(istype(D, /datum/disease/jungle_fever)) @@ -194,7 +194,7 @@ if ((O.client && !( O.blinded ))) O.show_message(text("\red [] has knocked out [name]!", M), 1) return - bruteloss += damage + adjustBruteLoss(damage) updatehealth() else playsound(loc, 'punchmiss.ogg', 25, 1, -1) @@ -268,7 +268,7 @@ for(var/mob/O in viewers(src, null)) if ((O.client && !( O.blinded ))) O.show_message(text("\red [] has slashed [name]!", M), 1) - bruteloss += damage + adjustBruteLoss(damage) updatehealth() else playsound(loc, 'slashmiss.ogg', 25, 1, -1) @@ -309,7 +309,7 @@ for(var/mob/O in viewers(src, null)) if ((O.client && !( O.blinded ))) O.show_message(text("\red [] has disarmed [name]!", M), 1) - bruteloss += damage + adjustBruteLoss(damage) updatehealth() return @@ -335,7 +335,7 @@ else damage = rand(5, 35) - bruteloss += damage + adjustBruteLoss(damage) if(M.powerlevel > 0) var/stunprob = 10 @@ -544,7 +544,7 @@ health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() if(2.0) if (stat != 2) - bruteloss += 60 + adjustBruteLoss(60) adjustFireLoss(60) health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() if(3.0) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index df6e2e0d1aa..02360e44401 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -111,25 +111,25 @@ // heal ONE external organ, organ gets randomly selected from damaged ones. /mob/living/proc/heal_organ_damage(var/brute, var/burn) - bruteloss = max(0, getBruteLoss()-brute) + adjustBruteLoss(-brute) adjustFireLoss(-burn) src.updatehealth() // damage ONE external organ, organ gets randomly selected from damaged ones. /mob/living/proc/take_organ_damage(var/brute, var/burn) - bruteloss += brute + adjustBruteLoss(brute) adjustFireLoss(burn) src.updatehealth() // heal MANY external organs, in random order /mob/living/proc/heal_overall_damage(var/brute, var/burn) - bruteloss = max(0, getBruteLoss()-brute) + adjustBruteLoss(-brute) adjustFireLoss(-burn) src.updatehealth() // damage MANY external organs, in random order /mob/living/proc/take_overall_damage(var/brute, var/burn) - bruteloss += brute + adjustBruteLoss(brute) adjustFireLoss(burn) src.updatehealth() diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 4b9f8be2160..1fac0ada413 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -190,7 +190,7 @@ /mob/living/silicon/ai/blob_act() if (stat != 2) - bruteloss += 60 + adjustBruteLoss(60) updatehealth() return 1 return 0 @@ -266,7 +266,7 @@ M.show_message(text("\red [] has been hit by []", src, O), 1) //Foreach goto(19) if (health > 0) - bruteloss += 30 + adjustBruteLoss(30) if ((O.icon_state == "flaming")) adjustFireLoss(40) updatehealth() @@ -302,7 +302,7 @@ O.show_message(text("\red [] has slashed at []!", M, src), 1) if(prob(8)) flick("noise", flash) - bruteloss += damage + adjustBruteLoss(damage) updatehealth() else playsound(loc, 'slashmiss.ogg', 25, 1, -1) diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index e0389fcef38..d31397a9a54 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -82,7 +82,7 @@ spawn(1) while (src.getOxyLoss()>0 && stat!=2) sleep(50) - src.oxyloss-=1 + src.adjustOxyLoss(-1) src.oxyloss = 0 return else if (src:aiRestorePowerRoutine==3) @@ -91,8 +91,7 @@ spawn(1) while (src.getOxyLoss()>0 && stat!=2) sleep(50) - src.oxyloss-=1 - src.oxyloss = 0 + src.adjustOxyLoss(-1) return else diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 0cf92458edc..6e0908137be 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -41,7 +41,7 @@ /mob/living/silicon/pai/blob_act() if (src.stat != 2) - src.bruteloss += 60 + src.adjustBruteLoss(60) src.updatehealth() return 1 return 0 @@ -138,7 +138,7 @@ O.show_message(text("\red [] has slashed at []!", M, src), 1) if(prob(8)) flick("noise", src.flash) - src.bruteloss += damage + src.adjustBruteLoss(damage) src.updatehealth() else playsound(src.loc, 'slashmiss.ogg', 25, 1, -1) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index e386950f048..415509711c7 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -151,7 +151,7 @@ /mob/living/silicon/robot/blob_act() if (stat != 2) - bruteloss += 60 + adjustBruteLoss(60) updatehealth() return 1 return 0 @@ -219,7 +219,7 @@ M.show_message(text("\red [src] has been hit by [O]"), 1) //Foreach goto(19) if (health > 0) - bruteloss += 30 + adjustBruteLoss(30) if ((O.icon_state == "flaming")) adjustFireLoss(40) updatehealth() @@ -319,8 +319,7 @@ if (istype(W, /obj/item/weapon/weldingtool) && W:welding) if (W:remove_fuel(0)) - bruteloss -= 30 - if(getBruteLoss() < 0) bruteloss = 0 + adjustBruteLoss(-30) updatehealth() add_fingerprint(user) for(var/mob/O in viewers(user, null)) @@ -332,7 +331,6 @@ else if(istype(W, /obj/item/weapon/cable_coil) && wiresexposed) var/obj/item/weapon/cable_coil/coil = W adjustFireLoss(-30) - if(getFireLoss() < 0) adjustFireLoss(0) updatehealth() coil.use(1) for(var/mob/O in viewers(user, null)) @@ -496,7 +494,7 @@ O.show_message(text("\red [] has slashed at []!", M, src), 1) if(prob(8)) flick("noise", flash) - bruteloss += damage + adjustBruteLoss(damage) updatehealth() else playsound(loc, 'slashmiss.ogg', 25, 1, -1) @@ -544,7 +542,7 @@ damage = rand(5, 35) damage = round(damage / 2) // borgs recieve half damage - bruteloss += damage + adjustBruteLoss(damage) if(M.powerlevel > 0) @@ -574,7 +572,7 @@ s.start() if (prob(stunprob) && M.powerlevel >= 8) - bruteloss += M.powerlevel * rand(6,10) + adjustBruteLoss(M.powerlevel * rand(6,10)) updatehealth() diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 9ae9d586221..643e9e516d6 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -27,7 +27,7 @@ return 1 /mob/living/silicon/bullet_act(var/obj/item/projectile/Proj) - if(!Proj.nodamage) bruteloss += Proj.damage + if(!Proj.nodamage) adjustBruteLoss(Proj.damage) Proj.on_hit(src,2) return 2 diff --git a/code/unused/hivebot/hivebot.dm b/code/unused/hivebot/hivebot.dm index 8cbb4815da7..9ee9314ed5b 100644 --- a/code/unused/hivebot/hivebot.dm +++ b/code/unused/hivebot/hivebot.dm @@ -34,7 +34,7 @@ /mob/living/silicon/hivebot/blob_act() if (src.stat != 2) - src.bruteloss += 60 + src.adjustBruteLoss(60) src.updatehealth() return 1 return 0 @@ -183,8 +183,7 @@ /mob/living/silicon/hivebot/attackby(obj/item/weapon/W as obj, mob/user as mob) if (istype(W, /obj/item/weapon/weldingtool) && W:welding) if (W:remove_fuel(0)) - src.bruteloss -= 30 - if(src.getBruteLoss() < 0) src.bruteloss = 0 + src.adjustBruteLoss(-30) src.updatehealth() src.add_fingerprint(user) for(var/mob/O in viewers(user, null)) @@ -227,7 +226,7 @@ O.show_message(text("\red [] has slashed at []!", M, src), 1) if(prob(8)) flick("noise", src.flash) - src.bruteloss += damage + src.adjustBruteLoss(damage) src.updatehealth() else playsound(src.loc, 'slashmiss.ogg', 25, 1, -1) diff --git a/code/unused/newcombatsystem.dm b/code/unused/newcombatsystem.dm index 26a138726c6..274581a04e1 100644 --- a/code/unused/newcombatsystem.dm +++ b/code/unused/newcombatsystem.dm @@ -84,7 +84,7 @@ for(var/mob/O in viewers(src,7)) O << "\red \b [target.name] deftly parries the attack with [target.l_hand.name]!" return - target.bruteloss -= src.force + target.adjustBruteLoss(-src.force) var/modifier_knockdown = 1.0 var/modifier_knockout = 1.0