From b6ef174c074cf8624dac107a83684c3f7cd8c9a5 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Sat, 7 May 2016 01:28:11 -0400 Subject: [PATCH] Simple Animal Damage Fix --- .../gamemodes/miniantags/bot_swarm/swarmer.dm | 5 ++--- .../gamemodes/miniantags/guardian/guardian.dm | 2 +- code/game/gamemodes/miniantags/morph/morph.dm | 2 +- .../gamemodes/miniantags/revenant/revenant.dm | 2 +- code/modules/mining/equipment_locker.dm | 2 +- code/modules/mob/living/simple_animal/bot/bot.dm | 15 +++------------ .../mob/living/simple_animal/hostile/hostile.dm | 2 +- .../mob/living/simple_animal/hostile/mimic.dm | 2 +- .../living/simple_animal/hostile/mining_mobs.dm | 4 ++-- .../mob/living/simple_animal/hostile/mushroom.dm | 2 +- .../simple_animal/hostile/retaliate/retaliate.dm | 2 +- .../living/simple_animal/hostile/syndicate.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 16 +++++++++++----- 13 files changed, 27 insertions(+), 31 deletions(-) diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index ccd498bb97f..315e48ba983 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -97,8 +97,7 @@ /mob/living/simple_animal/hostile/swarmer/emp_act() if(health > 1) - health = 1 - return + adjustHealth(health-1) else death() @@ -515,7 +514,7 @@ return to_chat(src, "Attempting to repair damage to our body, stand by...") if(do_mob(src, src, 100)) - adjustBruteLoss(-100) + adjustHealth(-100) to_chat(src, "We successfully repaired ourselves.") /mob/living/simple_animal/hostile/swarmer/proc/ToggleLight() diff --git a/code/game/gamemodes/miniantags/guardian/guardian.dm b/code/game/gamemodes/miniantags/guardian/guardian.dm index 2108e1c3147..dbb56523e4e 100644 --- a/code/game/gamemodes/miniantags/guardian/guardian.dm +++ b/code/game/gamemodes/miniantags/guardian/guardian.dm @@ -86,7 +86,7 @@ hud_used.guardianhealthdisplay.maptext = "
[resulthealth]%
" -/mob/living/simple_animal/hostile/guardian/adjustBruteLoss(amount) //The spirit is invincible, but passes on damage to the summoner +/mob/living/simple_animal/hostile/guardian/adjustHealth(amount) //The spirit is invincible, but passes on damage to the summoner var/damage = amount * damage_transfer if (summoner) if(loc == summoner) diff --git a/code/game/gamemodes/miniantags/morph/morph.dm b/code/game/gamemodes/miniantags/morph/morph.dm index dbbf561b609..780abb8854f 100644 --- a/code/game/gamemodes/miniantags/morph/morph.dm +++ b/code/game/gamemodes/miniantags/morph/morph.dm @@ -162,7 +162,7 @@ if(L.stat == DEAD) if(do_after(src, 30, target = L)) if(eat(L)) - heal_overall_damage(50,50) + adjustHealth(-50) return else if(istype(target,/obj/item)) // Eat items just to be annoying var/obj/item/I = target diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm index 0e048b85df0..7fddc8c3c56 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant.dm @@ -81,7 +81,7 @@ /mob/living/simple_animal/revenant/narsie_act() return //most humans will now be either bones or harvesters, but we're still un-alive. -/mob/living/simple_animal/revenant/adjustBruteLoss(amount) +/mob/living/simple_animal/revenant/adjustHealth(amount) if(!revealed) return essence = max(0, essence-amount) diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm index c94bfcd0ce8..2987ad9f889 100644 --- a/code/modules/mining/equipment_locker.dm +++ b/code/modules/mining/equipment_locker.dm @@ -811,7 +811,7 @@ O.forceMove(loc) return -/mob/living/simple_animal/hostile/mining_drone/adjustBruteLoss() +/mob/living/simple_animal/hostile/mining_drone/adjustHealth() if(search_objects) SetOffenseBehavior() ..() diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 3c5206ba3a5..633413cfc86 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -216,17 +216,10 @@ else to_chat(user, "[src] is in pristine condition.") -/mob/living/simple_animal/bot/adjustBruteLoss(amount) - . = ..() - +/mob/living/simple_animal/bot/adjustHealth(amount) if(amount > 0 && prob(10)) new /obj/effect/decal/cleanable/blood/oil(loc) - -/mob/living/simple_animal/bot/adjustFireLoss(amount) - . = ..() - - if(amount > 0 && prob(5)) - new /obj/effect/decal/cleanable/blood/oil(loc) + return ..(amount) /mob/living/simple_animal/bot/updatehealth() ..() @@ -346,9 +339,7 @@ return var/obj/item/weapon/weldingtool/WT = W if(WT.remove_fuel(0, user)) - adjustBruteLoss(-10) - adjustFireLoss(-10) - updatehealth() + adjustHealth(-10) add_fingerprint(user) user.visible_message("[user] repairs [src]!","You repair [src].") else diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 757b72f3809..b1627d17af0 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -186,7 +186,7 @@ /mob/living/simple_animal/hostile/proc/Goto(var/target, var/delay, var/minimum_distance) walk_to(src, target, minimum_distance, delay) -/mob/living/simple_animal/hostile/adjustBruteLoss(var/damage) +/mob/living/simple_animal/hostile/adjustHealth(damage) ..(damage) if(!stat && search_objects < 3)//Not unconscious, and we don't ignore mobs if(search_objects)//Turn off item searching and ignore whatever item we were looking at, we're more concerned with fight or flight diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index 7cff96385e1..e5ee97a70ef 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -99,7 +99,7 @@ visible_message("[src] starts to move!") attempt_open = 1 -/mob/living/simple_animal/hostile/mimic/crate/adjustBruteLoss(var/damage) +/mob/living/simple_animal/hostile/mimic/crate/adjustHealth(damage) trigger() ..(damage) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm index 5145a7c6a60..5a9f4a433af 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm @@ -204,7 +204,7 @@ Reward() ..() -/mob/living/simple_animal/hostile/asteroid/goldgrub/adjustBruteLoss(var/damage) +/mob/living/simple_animal/hostile/asteroid/goldgrub/adjustHealth(damage) idle_vision_range = 9 ..() @@ -403,7 +403,7 @@ pre_attack = 0 return -/mob/living/simple_animal/hostile/asteroid/goliath/adjustBruteLoss(var/damage) +/mob/living/simple_animal/hostile/asteroid/goliath/adjustHealth(damage) ranged_cooldown-- handle_preattack() ..() diff --git a/code/modules/mob/living/simple_animal/hostile/mushroom.dm b/code/modules/mob/living/simple_animal/hostile/mushroom.dm index 82a7f09af80..e6dda5e301c 100644 --- a/code/modules/mob/living/simple_animal/hostile/mushroom.dm +++ b/code/modules/mob/living/simple_animal/hostile/mushroom.dm @@ -59,7 +59,7 @@ health = maxHealth ..() -/mob/living/simple_animal/hostile/mushroom/adjustBruteLoss(var/damage)//Possibility to flee from a fight just to make it more visually interesting +/mob/living/simple_animal/hostile/mushroom/adjustHealth(damage)//Possibility to flee from a fight just to make it more visually interesting if(!retreat_distance && prob(33)) retreat_distance = 5 spawn(30) diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/retaliate.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/retaliate.dm index b9f04ec68ee..cd34c8a6491 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/retaliate.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/retaliate.dm @@ -61,7 +61,7 @@ H.enemies |= enemies return 0 -/mob/living/simple_animal/hostile/retaliate/adjustBruteLoss(var/damage) +/mob/living/simple_animal/hostile/retaliate/adjustHealth(damage) ..(damage) Retaliate() diff --git a/code/modules/mob/living/simple_animal/hostile/syndicate.dm b/code/modules/mob/living/simple_animal/hostile/syndicate.dm index 4d6688aa75b..0ce0cc71a86 100644 --- a/code/modules/mob/living/simple_animal/hostile/syndicate.dm +++ b/code/modules/mob/living/simple_animal/hostile/syndicate.dm @@ -71,7 +71,7 @@ if(!Proj) return if(prob(65)) if((Proj.damage_type == BRUTE || Proj.damage_type == BURN)) - src.health -= Proj.damage + adjustHealth(Proj.damage) else visible_message("\red [src] blocks [Proj] with its shield!") return 0 diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 23477c2fc18..b87e4703ff7 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -492,25 +492,31 @@ if(3.0) adjustBruteLoss(30) +/mob/living/simple_animal/proc/adjustHealth(amount) + if(status_flags & GODMODE) + return 0 + bruteloss = Clamp(bruteloss + amount, 0, maxHealth) + handle_regular_status_updates() + /mob/living/simple_animal/adjustBruteLoss(amount) if(damage_coeff[BRUTE]) - return ..(amount * damage_coeff[BRUTE]) + adjustHealth(amount * damage_coeff[BRUTE]) /mob/living/simple_animal/adjustFireLoss(amount) if(damage_coeff[BURN]) - return ..(amount * damage_coeff[BURN]) + adjustHealth(amount * damage_coeff[BURN]) /mob/living/simple_animal/adjustOxyLoss(amount) if(damage_coeff[OXY]) - return ..(amount * damage_coeff[OXY]) + adjustHealth(amount * damage_coeff[OXY]) /mob/living/simple_animal/adjustToxLoss(amount) if(damage_coeff[TOX]) - return ..(amount * damage_coeff[TOX]) + adjustHealth(amount * damage_coeff[TOX]) /mob/living/simple_animal/adjustCloneLoss(amount) if(damage_coeff[CLONE]) - return ..(amount * damage_coeff[CLONE]) + adjustHealth(amount * damage_coeff[CLONE]) /mob/living/simple_animal/adjustStaminaLoss(amount) if(damage_coeff[STAMINA])