From acda2ab6cd464162f27f8945a552bbe71e687135 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 21 Jul 2019 23:15:58 -0400 Subject: [PATCH] fixed pink candle + cadance potion --- CalamityPlayer.cs | 94 ++++++++++++++++++++++++----------------------- 1 file changed, 48 insertions(+), 46 deletions(-) diff --git a/CalamityPlayer.cs b/CalamityPlayer.cs index 7f258f6584..ac773b23dd 100644 --- a/CalamityPlayer.cs +++ b/CalamityPlayer.cs @@ -453,7 +453,7 @@ namespace CalamityMod public bool chaosCandle = false; public bool purpleCandle = false; public bool blueCandle = false; - public bool pinkCandle = false; + public bool pinkCandle = false; public double pinkCandleHealFraction = 0D; public bool yellowCandle = false; public bool trippy = false; @@ -1595,7 +1595,7 @@ namespace CalamityMod player.lifeRegen = 0; } player.lifeRegenTime = 0; - player.statDefense -= 50; + player.statDefense -= 50; player.allDamage -= 0.1f; } if (bFlames || aFlames) @@ -2857,18 +2857,18 @@ namespace CalamityMod { player.ClearBuff(BuffID.WindPushed); } - } + } #endregion - + #region RogueStealthStrike - public bool StealthStrikeAvailable() - { - return rogueStealth >= rogueStealthMax && rogueStealthMax > 0f; - } + public bool StealthStrikeAvailable() + { + return rogueStealth >= rogueStealthMax && rogueStealthMax > 0f; + } #endregion - + #region PostUpdate - + #region PostUpdateBuffs public override void PostUpdateBuffs() { @@ -3141,16 +3141,16 @@ namespace CalamityMod #region StressTiedEffects if (stressPills) { - player.statDefense += 8; + player.statDefense += 8; player.allDamage += 0.08f; } if (laudanum) { - player.statDefense += 6; + player.statDefense += 6; player.allDamage += 0.06f; } if (draedonsHeart) - { + { player.allDamage += 0.1f; } if (!stressLevel500 && player.FindBuffIndex(mod.BuffType("HeartAttack")) > -1) { player.ClearBuff(mod.BuffType("HeartAttack")); } @@ -3161,7 +3161,7 @@ namespace CalamityMod if (hAttack) { if (heartOfDarkness || draedonsHeart) - { + { player.allDamage += 0.1f; } player.statLifeMax2 += player.statLifeMax / 5 / 20 * 5; @@ -3171,7 +3171,7 @@ namespace CalamityMod player.lifeRegen += 1; player.endurance += CalamityWorld.revenge ? 0.07f : 0.05f; player.statDefense += CalamityWorld.revenge ? 20 : 15; - float damageBoost = CalamityWorld.revenge ? 0.12f : 0.1f; + float damageBoost = CalamityWorld.revenge ? 0.12f : 0.1f; player.allDamage += damageBoost; player.statLifeMax2 += CalamityWorld.revenge ? (player.statLifeMax / 5 / 20 * 10) : (player.statLifeMax / 5 / 20 * 5); } @@ -3537,7 +3537,7 @@ namespace CalamityMod { damageUp *= 2f; critUp *= 2; - } + } player.allDamage += damageUp; AllCritBoost(critUp); } @@ -3962,7 +3962,7 @@ namespace CalamityMod player.noFallDmg = true; } if (skeletronLore) - { + { player.allDamage += 0.05f; AllCritBoost(5); player.statDefense += 5; @@ -4030,7 +4030,7 @@ namespace CalamityMod } } if (dukeFishronLore) - { + { player.allDamage += 0.05f; AllCritBoost(5); player.moveSpeed += 0.1f; @@ -4038,7 +4038,7 @@ namespace CalamityMod if (lunaticCultistLore) { player.endurance += 0.04f; - player.statDefense += 4; + player.statDefense += 4; player.allDamage += 0.04f; AllCritBoost(4); player.minionKB += 0.5f; @@ -4049,7 +4049,7 @@ namespace CalamityMod if (player.gravDir == -1f && player.gravControl2) { player.endurance += 0.05f; - player.statDefense += 10; + player.statDefense += 10; player.allDamage += 0.1f; AllCritBoost(10); player.minionKB += 1.5f; @@ -4157,7 +4157,7 @@ namespace CalamityMod if (trinketOfChi) { if (trinketOfChiBuff) - { + { player.allDamage += 0.5f; if (player.itemAnimation > 0) chiBuffTimer = 0; @@ -4233,7 +4233,7 @@ namespace CalamityMod if (player.mount.Active) modStealth = 1f; } - float damageBoost = (1f - modStealth) * 0.2f; + float damageBoost = (1f - modStealth) * 0.2f; player.allDamage += damageBoost; int critBoost = (int)((1f - modStealth) * 10f); AllCritBoost(critBoost); @@ -4298,7 +4298,7 @@ namespace CalamityMod { NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); } - float damageBoost = (5f - shieldInvinc) * 0.03f; + float damageBoost = (5f - shieldInvinc) * 0.03f; player.allDamage += damageBoost; int critBoost = (int)((5f - shieldInvinc) * 2f); AllCritBoost(critBoost); @@ -4404,7 +4404,7 @@ namespace CalamityMod } if (holyWrath) { - if (player.FindBuffIndex(BuffID.Wrath) > -1) { player.ClearBuff(BuffID.Wrath); } + if (player.FindBuffIndex(BuffID.Wrath) > -1) { player.ClearBuff(BuffID.Wrath); } player.allDamage += 0.12f; player.moveSpeed += 0.05f; } @@ -4422,7 +4422,7 @@ namespace CalamityMod player.moveSpeed += 0.05f; } if (rRage) - { + { player.allDamage += 0.05f; player.moveSpeed += 0.05f; } @@ -4774,19 +4774,21 @@ namespace CalamityMod { player.statLifeMax2 = (int)((double)player.statLifeMax2 * 0.75); player.maxMinions += 2; - } - if (pinkCandle) - { - // every frame, add up 1/60th of the healing value (0.4% max HP per second) + } + + if (pinkCandle) + { + // every frame, add up 1/60th of the healing value (0.4% max HP per second) pinkCandleHealFraction += player.statLifeMax2 * 0.004 / 60; - if(pinkCandleHealFraction >= 1D) - { - pinkCandleHealFraction = 0D; - player.statLife += 1; - if (player.statLife > player.statLifeMax2) - player.statLife = player.statLifeMax2; - } - } + if (pinkCandleHealFraction >= 1D) + { + pinkCandleHealFraction = 0D; + if (player.statLife < player.statLifeMax2) + player.statLife++; + } + } + else pinkCandleHealFraction = 0D; + if (manaOverloader) { player.magicDamage += 0.06f; @@ -9790,11 +9792,11 @@ namespace CalamityMod fullBright = true; } } - } + } #endregion - + #region NurseModifications - /* + /* public override bool ModifyNurseHeal(NPC nurse, ref int health, ref bool removeDebuffs, ref string chatText) { if (CalamityWorld.revenge) @@ -9823,10 +9825,10 @@ namespace CalamityMod price = (int)((double)price * priceMultiplier); } } - */ - #endregion - - #region All-Class Crit Boost + */ + #endregion + + #region All-Class Crit Boost public void AllCritBoost(int boost) { player.meleeCrit += boost; @@ -9834,9 +9836,9 @@ namespace CalamityMod player.magicCrit += boost; player.thrownCrit += boost; CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += boost; - } + } #endregion - + #region PacketStuff private void ExactLevelPacket(bool server, int levelType) {