From 4815a0f37c62243d66bf08a3e4796b0aa41bd23f Mon Sep 17 00:00:00 2001 From: Nerd Lord Date: Mon, 4 Jan 2016 15:29:23 -0500 Subject: [PATCH 1/3] Simple animals no longer convert other damage types to brute using the brute damage proc, allowing you to make mobs immune to brute but not all damage types. No, no, do it properly not half-ass it --- .../gamemodes/miniantags/revenant/revenant.dm | 2 +- code/modules/holiday/halloween.dm | 4 ++-- code/modules/mining/equipment_locker.dm | 2 +- code/modules/mob/living/simple_animal/bot/bot.dm | 11 +++-------- .../living/simple_animal/guardian/guardian.dm | 2 +- .../mob/living/simple_animal/hostile/hostile.dm | 2 +- .../mob/living/simple_animal/hostile/mimic.dm | 2 +- .../living/simple_animal/hostile/mining_mobs.dm | 6 +++--- .../mob/living/simple_animal/hostile/mushroom.dm | 2 +- .../simple_animal/hostile/retaliate/retaliate.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 16 +++++++++++----- 11 files changed, 26 insertions(+), 25 deletions(-) diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm index ed153281399..cdbef5976ef 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant.dm @@ -139,7 +139,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/holiday/halloween.dm b/code/modules/holiday/halloween.dm index 6f187ea2ae9..ea41f4f1807 100644 --- a/code/modules/holiday/halloween.dm +++ b/code/modules/holiday/halloween.dm @@ -212,7 +212,7 @@ step(I,direction) return -/mob/living/simple_animal/shade/howling_ghost/adjustBruteLoss() +/mob/living/simple_animal/shade/howling_ghost/adjustHealth() return /mob/living/simple_animal/shade/howling_ghost/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) @@ -272,7 +272,7 @@ /mob/living/simple_animal/hostile/retaliate/clown/insane/AttackTarget() return -/mob/living/simple_animal/hostile/retaliate/clown/insane/adjustBruteLoss() +/mob/living/simple_animal/hostile/retaliate/clown/insane/adjustHealth() if(prob(5)) playsound(loc, 'sound/spookoween/insane_low_laugh.ogg', 300, 1) diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm index ac26ed6c52b..7d0e9756caf 100644 --- a/code/modules/mining/equipment_locker.dm +++ b/code/modules/mining/equipment_locker.dm @@ -742,7 +742,7 @@ O.loc = src.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 d03ed22c237..c1b9737308f 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -163,12 +163,7 @@ else user << "[src] is in pristine condition." -/mob/living/simple_animal/bot/adjustBruteLoss(amount) - if(amount>0 && prob(10)) - new /obj/effect/decal/cleanable/oil(loc) - return ..(amount) - -/mob/living/simple_animal/bot/adjustFireLoss(amount) +/mob/living/simple_animal/bot/adjustHealth(amount) if(amount>0 && prob(10)) new /obj/effect/decal/cleanable/oil(loc) return ..(amount) @@ -710,12 +705,12 @@ Pass a positive integer as an argument to override a bot's default speed. if(usr in users) users.Remove(usr) return 1 - + if(topic_denied(usr)) usr << "[src]'s interface is not responding!" return 1 add_fingerprint(usr) - + if((href_list["power"]) && (bot_core.allowed(usr) || !locked)) if (on) turn_off() diff --git a/code/modules/mob/living/simple_animal/guardian/guardian.dm b/code/modules/mob/living/simple_animal/guardian/guardian.dm index afced5e62b3..849443eacf7 100644 --- a/code/modules/mob/living/simple_animal/guardian/guardian.dm +++ b/code/modules/mob/living/simple_animal/guardian/guardian.dm @@ -78,7 +78,7 @@ summoner << "Your [name] died somehow!" summoner.death() -/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/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index ffdde0fb938..06d620caa4c 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -179,7 +179,7 @@ /mob/living/simple_animal/hostile/proc/Goto(target, delay, minimum_distance) walk_to(src, target, minimum_distance, delay) -/mob/living/simple_animal/hostile/adjustBruteLoss(damage) +/mob/living/simple_animal/hostile/adjustHealth(damage) ..(damage) if(!ckey && !stat && search_objects < 3 && damage > 0)//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 3db6b3e76f8..ed4ec3fdfde 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -70,7 +70,7 @@ visible_message("[src] starts to move!") attempt_open = 1 -/mob/living/simple_animal/hostile/mimic/crate/adjustBruteLoss(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 bfd17bc69db..29ae2bad90d 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm @@ -181,7 +181,7 @@ visible_message("The [P.name] was repelled by [src.name]'s girth!") return -/mob/living/simple_animal/hostile/asteroid/goldgrub/adjustBruteLoss(damage) +/mob/living/simple_animal/hostile/asteroid/goldgrub/adjustHealth(damage) idle_vision_range = 9 ..() @@ -384,7 +384,7 @@ pre_attack = 0 return -/mob/living/simple_animal/hostile/asteroid/goliath/adjustBruteLoss(damage) +/mob/living/simple_animal/hostile/asteroid/goliath/adjustHealth(damage) ranged_cooldown-- handle_preattack() ..() @@ -524,7 +524,7 @@ Inflate() ..() -/mob/living/simple_animal/hostile/asteroid/fugu/adjustBruteLoss(var/damage) +/mob/living/simple_animal/hostile/asteroid/fugu/adjustHealth(var/damage) if(wumbo) return ..() diff --git a/code/modules/mob/living/simple_animal/hostile/mushroom.dm b/code/modules/mob/living/simple_animal/hostile/mushroom.dm index fe593390418..03dbb7e29b6 100644 --- a/code/modules/mob/living/simple_animal/hostile/mushroom.dm +++ b/code/modules/mob/living/simple_animal/hostile/mushroom.dm @@ -61,7 +61,7 @@ deathmessage = "[src] fainted." ..() -/mob/living/simple_animal/hostile/mushroom/adjustBruteLoss(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 5c4a4621da0..f2c009f2c3b 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/retaliate.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/retaliate.dm @@ -51,7 +51,7 @@ H.enemies |= enemies return 0 -/mob/living/simple_animal/hostile/retaliate/adjustBruteLoss(damage) +/mob/living/simple_animal/hostile/retaliate/adjustHealth(damage) ..(damage) if(stat == CONSCIOUS) Retaliate() diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index f0c670e6d9a..ea563b51068 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -276,25 +276,31 @@ Proj.on_hit(src) return 0 +/mob/living/simple_animal/proc/adjustHealth(amount) + if(status_flags & GODMODE) + return 0 + bruteloss = min(max(bruteloss + amount, 0),(maxHealth*2)) + handle_regular_status_updates() + /mob/living/simple_animal/adjustBruteLoss(amount) if(damage_coeff[BRUTE]) - ..(amount*damage_coeff[BRUTE]) + adjustHealth(amount*damage_coeff[BRUTE]) /mob/living/simple_animal/adjustFireLoss(amount) if(damage_coeff[BURN]) - adjustBruteLoss(amount*damage_coeff[BURN]) + adjustHealth(amount*damage_coeff[BURN]) /mob/living/simple_animal/adjustOxyLoss(amount) if(damage_coeff[OXY]) - adjustBruteLoss(amount*damage_coeff[OXY]) + adjustHealth(amount*damage_coeff[OXY]) /mob/living/simple_animal/adjustToxLoss(amount) if(damage_coeff[TOX]) - ..(amount*damage_coeff[TOX]) + adjustHealth(amount*damage_coeff[TOX]) /mob/living/simple_animal/adjustCloneLoss(amount) if(damage_coeff[CLONE]) - ..(amount*damage_coeff[CLONE]) + adjustHealth(amount*damage_coeff[CLONE]) /mob/living/simple_animal/adjustStaminaLoss(amount) return From 3d32bde4a6242d28a8868a734e66fff126331786 Mon Sep 17 00:00:00 2001 From: Nerd Lord Date: Mon, 4 Jan 2016 15:41:08 -0500 Subject: [PATCH 2/3] I mean, you shouldn't make any of these immune to damage types but it won't break the healing if you do. --- code/game/gamemodes/miniantags/bot_swarm/swarmer.dm | 2 +- code/game/gamemodes/miniantags/morph/morph.dm | 2 +- code/modules/mob/living/simple_animal/constructs.dm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index da0a9add2ce..b3b032bf8d4 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -486,7 +486,7 @@ return src << "Attempting to repair damage to our body, stand by..." if(do_mob(src, src, 100)) - adjustBruteLoss(-100) + adjustHealth(-100) src << "We successfully repaired ourselves." /mob/living/simple_animal/hostile/swarmer/proc/ToggleLight() diff --git a/code/game/gamemodes/miniantags/morph/morph.dm b/code/game/gamemodes/miniantags/morph/morph.dm index be09a38c2c1..9576cf396f8 100644 --- a/code/game/gamemodes/miniantags/morph/morph.dm +++ b/code/game/gamemodes/miniantags/morph/morph.dm @@ -153,7 +153,7 @@ if(do_after(src, 30, target = L)) visible_message("[src] swallows [target] whole!") L.loc = src - adjustBruteLoss(-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/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index ee584f7cbbe..5ea94615935 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -57,7 +57,7 @@ /mob/living/simple_animal/hostile/construct/attack_animal(mob/living/simple_animal/M) if(istype(M, /mob/living/simple_animal/hostile/construct/builder)) if(health < maxHealth) - adjustBruteLoss(-5) + adjustHealth(-5) if(src != M) Beam(M,icon_state="sendbeam",icon='icons/effects/effects.dmi',time=4) M.visible_message("[M] repairs some of \the [src]'s dents.", \ From 240263c5d574b5d33ba94df518bd95f3e4e3cf76 Mon Sep 17 00:00:00 2001 From: Nerd Lord Date: Tue, 5 Jan 2016 22:51:18 -0500 Subject: [PATCH 3/3] Clamp it! --- code/modules/mob/living/simple_animal/simple_animal.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index ea563b51068..416a8079c15 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -279,7 +279,7 @@ /mob/living/simple_animal/proc/adjustHealth(amount) if(status_flags & GODMODE) return 0 - bruteloss = min(max(bruteloss + amount, 0),(maxHealth*2)) + bruteloss = Clamp(bruteloss + amount, 0, maxHealth) handle_regular_status_updates() /mob/living/simple_animal/adjustBruteLoss(amount)