From 0fd34595ecb8ff07342d56f6d9b17c25fbeed0ba Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Wed, 21 Dec 2022 08:42:44 +0700 Subject: [PATCH] Poison Meter linear scaling and tweaks --- CalPlayer/CalamityPlayerLifeRegen.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 7e3ed31734..d606dde626 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -169,24 +169,26 @@ namespace CalamityMod.CalPlayer nearSafeZone = true; } - bool getFuckedASPoisoning = false; + float ASPoisonLevel = 0f; //TODO -- Zenith seed. if (CalamityGlobalNPC.aquaticScourge >= 0 && Main.getGoodWorld && Main.masterMode) { + NPC AS = Main.npc[CalamityGlobalNPC.aquaticScourge]; //if the player is 50 blocks or more away from the head - if (Vector2.Distance(Player.Center, Main.npc[CalamityGlobalNPC.aquaticScourge].Center) >= 800f) - getFuckedASPoisoning = true; + if (AS.life < AS.lifeMax) //Only poison when damaged + ASPoisonLevel = Utils.GetLerpValue(800f, 1600f, Vector2.Distance(Player.Center, AS.Center), true); } - if (getFuckedASPoisoning || (ZoneSulphur && Player.IsUnderwater() && !decayEffigy && !abyssalDivingSuit && !Player.lavaWet && !Player.honeyWet && !nearSafeZone)) + bool ASPoisoning = ASPoisonLevel > 0f; + if (ASPoisoning || (ZoneSulphur && Player.IsUnderwater() && !decayEffigy && !abyssalDivingSuit && !Player.lavaWet && !Player.honeyWet && !nearSafeZone)) { float increment = 1f / SulphSeaWaterSafetyTime; //No way to mitigate AS Poisoning - if (getFuckedASPoisoning) - increment *= 4f; - if (sulphurskin && !getFuckedASPoisoning) + if (ASPoisoning) + increment *= 4f + (8f * ASPoisonLevel); + if (sulphurskin && !ASPoisoning) increment *= 0.5f; - if (sulfurSet && !getFuckedASPoisoning) + if (sulfurSet && !ASPoisoning) increment *= 0.5f; SulphWaterPoisoningLevel = MathHelper.Clamp(SulphWaterPoisoningLevel + increment, 0f, 1f);