From aeec95b350d89090fdde5b7e897f7bb794a3a38a Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Fri, 5 Jul 2013 23:31:27 -0700 Subject: [PATCH] Robot immortality fixes. --- code/modules/mob/living/silicon/robot/component.dm | 2 +- code/modules/mob/living/silicon/robot/life.dm | 4 +--- .../mob/living/silicon/robot/robot_damage.dm | 13 ++++--------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/code/modules/mob/living/silicon/robot/component.dm b/code/modules/mob/living/silicon/robot/component.dm index 223a1c547eb..e730974401c 100644 --- a/code/modules/mob/living/silicon/robot/component.dm +++ b/code/modules/mob/living/silicon/robot/component.dm @@ -39,7 +39,7 @@ brute_damage += brute electronics_damage += electronics - if(brute_damage + electronics_damage > max_damage) destroy() + if(brute_damage + electronics_damage >= max_damage) destroy() /datum/robot_component/proc/heal_damage(brute, electronics) if(installed != 1) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 160b8904daa..c5d18dccd2b 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -66,9 +66,7 @@ else src.camera.status = 1 - health = 200 - (getOxyLoss() + getFireLoss() + getBruteLoss()) - - if(getOxyLoss() > 50) Paralyse(3) + updatehealth() if(src.sleeping) Paralyse(3) diff --git a/code/modules/mob/living/silicon/robot/robot_damage.dm b/code/modules/mob/living/silicon/robot/robot_damage.dm index 710a2598c9c..ebcc575c0d8 100644 --- a/code/modules/mob/living/silicon/robot/robot_damage.dm +++ b/code/modules/mob/living/silicon/robot/robot_damage.dm @@ -3,21 +3,21 @@ health = 100 stat = CONSCIOUS return - health = 100 - getBruteLoss() - getFireLoss() + health = 100 - (getBruteLoss() + getFireLoss()) return /mob/living/silicon/robot/getBruteLoss() var/amount = 0 for(var/V in components) var/datum/robot_component/C = components[V] - if(C.installed == 1) amount += C.brute_damage + if(C.installed != 1) amount += C.brute_damage return amount /mob/living/silicon/robot/getFireLoss() var/amount = 0 for(var/V in components) var/datum/robot_component/C = components[V] - if(C.installed == 1) amount += C.electronics_damage + if(C.installed != 0) amount += C.electronics_damage return amount /mob/living/silicon/robot/adjustBruteLoss(var/amount) @@ -52,7 +52,6 @@ if(!parts.len) return var/datum/robot_component/picked = pick(parts) picked.heal_damage(brute,burn) - updatehealth() /mob/living/silicon/robot/take_organ_damage(var/brute = 0, var/burn = 0, var/sharp = 0) var/list/components = get_damageable_components() @@ -78,7 +77,6 @@ var/datum/robot_component/C = pick(components) C.take_damage(brute,burn,sharp) - updatehealth() /mob/living/silicon/robot/heal_overall_damage(var/brute, var/burn) var/list/datum/robot_component/parts = get_damaged_components(brute,burn) @@ -95,7 +93,6 @@ burn -= (burn_was-picked.electronics_damage) parts -= picked - updatehealth() /mob/living/silicon/robot/take_overall_damage(var/brute = 0, var/burn = 0, var/sharp = 0, var/used_weapon = null) if(status_flags & GODMODE) return //godmode @@ -129,6 +126,4 @@ brute -= (picked.brute_damage - brute_was) burn -= (picked.electronics_damage - burn_was) - parts -= picked - - updatehealth() + parts -= picked \ No newline at end of file