Ooze line, correcting effect orders
This commit is contained in:
1 parent
786100acd3
commit
3e18bbeacd
11 files changed
+174
-241
No files matched your search
@@ -903,6 +903,10 @@ namespace CalamityMod.CalPlayer
|
||||
public bool lAmbergrisVisual = false;
|
||||
public bool tortShell = false;
|
||||
public bool absorber = false;
|
||||
/// <summary>
|
||||
/// Used for detetcing life regen hindering debuffs
|
||||
/// </summary>
|
||||
bool _hasNoNaturalRegen = false;
|
||||
public bool hadLifeRegenHinderingDebuff = false;
|
||||
public bool alwaysHoneyRegen = false;
|
||||
public float alwaysHoneyRegenAmount = 0;
|
||||
@@ -922,8 +926,6 @@ namespace CalamityMod.CalPlayer
|
||||
public float pulseRate = 1;
|
||||
public bool aAmpoule = false;
|
||||
public bool rOoze = false;
|
||||
public float radiantOozeRegen = 0;
|
||||
public float purityRegen = 0;
|
||||
public bool fBarrier = false;
|
||||
public bool aBrain = false;
|
||||
public bool amalgam = false;
|
||||
@@ -2390,8 +2392,6 @@ namespace CalamityMod.CalPlayer
|
||||
livingDew = false;
|
||||
aAmpoule = false;
|
||||
rOoze = false;
|
||||
radiantOozeRegen = 0;
|
||||
purityRegen = 0;
|
||||
fBarrier = false;
|
||||
aBrain = false;
|
||||
amalgam = false;
|
||||
@@ -5013,6 +5013,9 @@ namespace CalamityMod.CalPlayer
|
||||
if (gSabaton && Player.whoAmI == Main.myPlayer)
|
||||
Player.jumpSpeedBoost += 2f;
|
||||
}
|
||||
|
||||
//Update life regen that needs to happen before calculating debuffs
|
||||
GeneralLifeRegen();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -48,22 +48,22 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
int totalVanillaDoT = 0;
|
||||
|
||||
if (Player.poisoned && !purity)
|
||||
if (Player.poisoned)
|
||||
totalVanillaDoT += 4;
|
||||
|
||||
if (Player.onFire && !purity)
|
||||
if (Player.onFire)
|
||||
totalVanillaDoT += 8;
|
||||
|
||||
if (Player.tongued)
|
||||
totalVanillaDoT += 100;
|
||||
|
||||
if (Player.venom && !purity)
|
||||
if (Player.venom)
|
||||
totalVanillaDoT += 12;
|
||||
|
||||
if (Player.onFrostBurn && !purity)
|
||||
if (Player.onFrostBurn)
|
||||
totalVanillaDoT += 12;
|
||||
|
||||
if (Player.onFire2 && !purity)
|
||||
if (Player.onFire2)
|
||||
totalVanillaDoT += 12;
|
||||
|
||||
if (Player.burned)
|
||||
@@ -72,7 +72,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (Player.suffocating)
|
||||
totalVanillaDoT += 40;
|
||||
|
||||
if (Player.electrified && !purity)
|
||||
if (Player.electrified)
|
||||
{
|
||||
totalVanillaDoT += eleResist ? 4 : 8;
|
||||
if (Player.controlLeft || Player.controlRight)
|
||||
@@ -101,38 +101,38 @@ namespace CalamityMod.CalPlayer
|
||||
// Whispering Death sets positive regen to zero but doesn't actually deal any damage
|
||||
ApplyDoTDebuff(whisperingDeath, 0, laudanum);
|
||||
|
||||
ApplyDoTDebuff(irradiated, 4, purity);
|
||||
ApplyDoTDebuff(irradiated, 4);
|
||||
int sulphurDoT = 6 - (sulphurSet ? 2 : 0) - (sulphurskin ? 2 : 0) - (corrosiveSpine ? 2 : 0);
|
||||
ApplyDoTDebuff(sulphurPoison, sulphurDoT, purity);
|
||||
ApplyDoTDebuff(riptide, 6, purity);
|
||||
ApplyDoTDebuff(sulphurPoison, sulphurDoT);
|
||||
ApplyDoTDebuff(riptide, 6);
|
||||
ApplyDoTDebuff(weakBrimstoneFlames, 7);
|
||||
ApplyDoTDebuff(burningBlood, 8, purity);
|
||||
ApplyDoTDebuff(brainRot, 8, purity);
|
||||
ApplyDoTDebuff(vaporfied, 8, purity);
|
||||
ApplyDoTDebuff(burningBlood, 8);
|
||||
ApplyDoTDebuff(brainRot, 8);
|
||||
ApplyDoTDebuff(vaporfied, 8);
|
||||
int staticDoT = ((Player.controlLeft || Player.controlRight) ? 12 : 3) / (eleResist ? 2 : 1);
|
||||
ApplyDoTDebuff(staticDischarge, staticDoT, purity);
|
||||
ApplyDoTDebuff(heavybleeding, 16, purity);
|
||||
ApplyDoTDebuff(crushDepth, 18, purity);
|
||||
ApplyDoTDebuff(astralInfection, 24, infectedJewel || hideOfDeus || purity);
|
||||
ApplyDoTDebuff(shadowflame, 30, purity);
|
||||
ApplyDoTDebuff(brimstoneFlames, 30, purity);
|
||||
ApplyDoTDebuff(plague, (int)MathF.Round(30 * (alchFlask ? (1f - AlchemicalDecanter.PlagueReduction) : 1f)), purity);
|
||||
ApplyDoTDebuff(staticDischarge, staticDoT);
|
||||
ApplyDoTDebuff(heavybleeding, 16);
|
||||
ApplyDoTDebuff(crushDepth, 18);
|
||||
ApplyDoTDebuff(astralInfection, 24, hideOfDeus);
|
||||
ApplyDoTDebuff(shadowflame, 30);
|
||||
ApplyDoTDebuff(brimstoneFlames, 30);
|
||||
ApplyDoTDebuff(plague, (int)MathF.Round(30 * (alchFlask ? (1f - AlchemicalDecanter.PlagueReduction) : 1f)));
|
||||
ApplyDoTDebuff(vHex, 30); // Has other effects
|
||||
ApplyDoTDebuff(searingLava, 30);
|
||||
ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player
|
||||
ApplyDoTDebuff(laceration, 36, purity);
|
||||
ApplyDoTDebuff(daybroken, 40, purity);
|
||||
ApplyDoTDebuff(bane, 40, purity);
|
||||
ApplyDoTDebuff(nightwither, 40, purity);
|
||||
ApplyDoTDebuff(holyFlames, 40, purity);
|
||||
ApplyDoTDebuff(voidfrost, 40, purity);
|
||||
ApplyDoTDebuff(hadopelagicPressure, 40, purity);
|
||||
ApplyDoTDebuff(demonicFlames, 33); // Never inflicted on the player
|
||||
ApplyDoTDebuff(laceration, 36);
|
||||
ApplyDoTDebuff(daybroken, 40);
|
||||
ApplyDoTDebuff(bane, 40);
|
||||
ApplyDoTDebuff(nightwither, 40);
|
||||
ApplyDoTDebuff(holyFlames, 40);
|
||||
ApplyDoTDebuff(voidfrost, 40);
|
||||
ApplyDoTDebuff(hadopelagicPressure, 40);
|
||||
|
||||
// Profaned Soul Crystal turns you into Providence, a God, and you take more damage from God Slayer Inferno
|
||||
ApplyDoTDebuff(godSlayerInferno, profanedCrystalBuffs ? 50 : 40);
|
||||
int fluxDoT = ((Player.controlLeft || Player.controlRight) ? 50 : 10) / (eleResist ? 2 : 1);
|
||||
ApplyDoTDebuff(vermillionFlux, fluxDoT);
|
||||
ApplyDoTDebuff(elementalMix, 50, purity); // Never inflicted on the player
|
||||
ApplyDoTDebuff(elementalMix, 50); // Never inflicted on the player
|
||||
ApplyDoTDebuff(trueVHex, 50);
|
||||
int dragonfireDoT = ((Player.name == "JFL" || Player.name == "MrJFL") ? 200 : 50) / (dynamoStemCells ? 2 : 1);
|
||||
ApplyDoTDebuff(dragonFire, dragonfireDoT);
|
||||
@@ -276,7 +276,25 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
bool hasLifeRegenHinderingDebuff = Player.lifeRegenTime == 0;
|
||||
|
||||
|
||||
#region Life Regen That Works Even During DoT Debuffs
|
||||
|
||||
//Negation of debuffs. These all will not take life regen above 0
|
||||
if (Player.lifeRegen < 0)
|
||||
{
|
||||
if (crownJewel)
|
||||
Player.lifeRegen += CrownJewel.ReducedDoTAmount;
|
||||
|
||||
if (infectedJewel)
|
||||
Player.lifeRegen += InfectedJewel.ReducedDoTAmount;
|
||||
|
||||
if (purity)
|
||||
Player.lifeRegen += Radiance.ReducedDoTAmount;
|
||||
|
||||
if (Player.lifeRegen > 0)
|
||||
Player.lifeRegen = 0;
|
||||
}
|
||||
|
||||
if (divineBless)
|
||||
{
|
||||
if (Player.whoAmI == Main.myPlayer && Player.miscCounter % AngelicAlliance.DivineBlessFramesPerHeal == 0) // Flat 4 health per second
|
||||
@@ -318,75 +336,19 @@ namespace CalamityMod.CalPlayer
|
||||
else if (grandDadHealTimer > 0)
|
||||
grandDadHealTimer--;
|
||||
|
||||
if (purity)
|
||||
//Raising natural regen post-damaging-debuff
|
||||
if (hadLifeRegenHinderingDebuff && !hasLifeRegenHinderingDebuff)
|
||||
{
|
||||
int intendedPurityDefense = 0;
|
||||
int currentDebuffs = Player.buffType.Count(i => CalamityBuffSets.IsDebuff[i]);
|
||||
if (currentDebuffs > 0)
|
||||
{
|
||||
Player.lifeRegen += Radiance.DebuffedRegenBoost;
|
||||
if (infectedJewel)
|
||||
Player.lifeRegenTime += InfectedJewel.PostDebuffRegenTimeBoost;
|
||||
|
||||
intendedPurityDefense = Radiance.DebuffedDefenseBoost + (currentDebuffs - 1) * Radiance.ExtraDebuffDefenseBoost;
|
||||
if (jewelBonusDefense < intendedPurityDefense)
|
||||
jewelBonusDefense = intendedPurityDefense;
|
||||
if (purity)
|
||||
Player.lifeRegenTime += Radiance.PostDebuffRegenTimeBoost;
|
||||
|
||||
// Update tooltip
|
||||
purityRegen += Radiance.DebuffedRegenBoost / 2f;
|
||||
}
|
||||
|
||||
// If the defense should be ticking down to some lower value, do that.
|
||||
if (Player.miscCounter % Radiance.FramesToDecayDefense == 0 && jewelBonusDefense > intendedPurityDefense)
|
||||
--jewelBonusDefense;
|
||||
|
||||
// Actually apply defense bonus
|
||||
Player.statDefense += jewelBonusDefense;
|
||||
}
|
||||
|
||||
// Infected Jewel does not stack with Purity
|
||||
else if (infectedJewel)
|
||||
{
|
||||
Player.lifeRegen += InfectedJewel.RegenBoost;
|
||||
|
||||
// If the player has any debuffs, give the extra life regen and defense
|
||||
// More defense is given for each additional debuff
|
||||
int intendedJewelDefense = 0;
|
||||
int currentDebuffs = Player.buffType.Count(i => CalamityBuffSets.IsDebuff[i]);
|
||||
if (currentDebuffs > 0)
|
||||
{
|
||||
Player.lifeRegen += InfectedJewel.DebuffedRegenBoost;
|
||||
|
||||
intendedJewelDefense = InfectedJewel.DebuffedDefenseBoost + (currentDebuffs - 1) * InfectedJewel.ExtraDebuffDefenseBoost;
|
||||
if (jewelBonusDefense < intendedJewelDefense)
|
||||
jewelBonusDefense = intendedJewelDefense;
|
||||
}
|
||||
|
||||
// If the defense should be ticking down to some lower value, do that.
|
||||
if (Player.miscCounter % InfectedJewel.FramesToDecayDefense == 0 && jewelBonusDefense > intendedJewelDefense)
|
||||
--jewelBonusDefense;
|
||||
|
||||
// Actually apply defense bonus
|
||||
Player.statDefense += jewelBonusDefense;
|
||||
}
|
||||
|
||||
// Crown Jewel does not stack with Purity or Infected Jewel
|
||||
else if (crownJewel)
|
||||
{
|
||||
Player.lifeRegen += CrownJewel.RegenBoost;
|
||||
|
||||
// If any debuff is detected, provide even more life regen
|
||||
if (Player.buffType.Any(i => CalamityBuffSets.IsDebuff[i]))
|
||||
Player.lifeRegen += CrownJewel.DebuffedRegenBoost;
|
||||
}
|
||||
|
||||
//If a player had a life regen hindering debuff, add 30 seconds to their regen time when under Tequila Sunrise
|
||||
//This stacks with all other post-debuff boosts due to Tequila Sunrise increasing DoT damage taken
|
||||
if (tequilaSunrise)
|
||||
{
|
||||
if (hadLifeRegenHinderingDebuff && !hasLifeRegenHinderingDebuff)
|
||||
{
|
||||
if (tequilaSunrise)
|
||||
Player.lifeRegenTime += 1800;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// During Silva revive or God Slayer dash, all negative life regen is canceled
|
||||
@@ -461,24 +423,29 @@ namespace CalamityMod.CalPlayer
|
||||
// The bleedout is applied by directly reducing the player's health. It is not canceled by anything.
|
||||
ChaliceOfTheBloodGod.HandleBleedout(Player);
|
||||
|
||||
//Finally, update the state of hadLifeRegenHinderingDebuff for next frame.
|
||||
hadLifeRegenHinderingDebuff = hasLifeRegenHinderingDebuff;
|
||||
//Finally, update the state of hadLifeRegenHinderingDebuff for next frame. Needs to check for 2 frames of 0 regen time to be sure they had a debuff
|
||||
hadLifeRegenHinderingDebuff = hasLifeRegenHinderingDebuff && _hasNoNaturalRegen;
|
||||
_hasNoNaturalRegen = hasLifeRegenHinderingDebuff;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Update Life Regen
|
||||
public override void UpdateLifeRegen()
|
||||
//This method runs BEFORE UpdateBadLifeRegen. Put most effects here. Ran at the end of PostUpdateEquips
|
||||
public void GeneralLifeRegen()
|
||||
{
|
||||
|
||||
float lifeRatio = (Player.statLife) / (float)Player.statLifeMax2;
|
||||
|
||||
if (mushy)
|
||||
Player.lifeRegen += Mushy.RegenBoost;
|
||||
|
||||
if (permafrostsConcoction)
|
||||
{
|
||||
if (Player.statLife < actualMaxLife / 2)
|
||||
if (lifeRatio <= 0.5f)
|
||||
Player.lifeRegen++;
|
||||
if (Player.statLife < actualMaxLife / 4)
|
||||
if (lifeRatio <= 0.25f)
|
||||
Player.lifeRegen++;
|
||||
if (Player.statLife < actualMaxLife / 10)
|
||||
if (lifeRatio <= 0.1f)
|
||||
Player.lifeRegen += 2;
|
||||
}
|
||||
|
||||
@@ -494,21 +461,25 @@ namespace CalamityMod.CalPlayer
|
||||
if (PinkJellyRegen)
|
||||
Player.lifeRegen += LifeJelly.AuraRegenBoost;
|
||||
|
||||
// Grant life regen based on missing health for Radiant Ooze, Ambrosial Ampule, and Radiance
|
||||
if (rOoze || aAmpoule || purity)
|
||||
{
|
||||
float missingLifeRatio = (Player.statLifeMax2 - Player.statLife) / (float)Player.statLifeMax2;
|
||||
// Rounding is needed to prevent flooring and making the max unreachable
|
||||
int lifeRegenToGive = (int)Math.Round(MathHelper.Lerp(RadiantOoze.MinRegenBoost, RadiantOoze.MaxRegenBoost, missingLifeRatio));
|
||||
Player.lifeRegen += lifeRegenToGive;
|
||||
// Update tooltips
|
||||
radiantOozeRegen += lifeRegenToGive / 2f;
|
||||
purityRegen += lifeRegenToGive / 2f;
|
||||
}
|
||||
if (rOoze)
|
||||
Player.lifeRegen += (int)Math.Round(MathHelper.Lerp(RadiantOoze.MaxRegenBoost, RadiantOoze.MinRegenBoost, lifeRatio));
|
||||
|
||||
if (livingDew)
|
||||
Player.lifeRegenTime += LivingDew.RegenTimeBoost;
|
||||
|
||||
if (aAmpoule)
|
||||
{
|
||||
Player.lifeRegen += (int)Math.Round(MathHelper.Lerp(AmbrosialAmpoule.MaxRegenBoost, AmbrosialAmpoule.MinRegenBoost, lifeRatio));
|
||||
Player.lifeRegenTime += AmbrosialAmpoule.RegenTimeBoost;
|
||||
}
|
||||
|
||||
if (purity)
|
||||
{
|
||||
Player.lifeRegen += (int)Math.Round(MathHelper.Lerp(Radiance.MaxRegenBoost, Radiance.MinRegenBoost, lifeRatio));
|
||||
Player.lifeRegenTime += Radiance.RegenTimeBoost;
|
||||
}
|
||||
|
||||
|
||||
if (GreenJellyRegen)
|
||||
Player.lifeRegen += Items.Accessories.GrandGelatin.AuraRegenBoost;
|
||||
|
||||
@@ -554,6 +525,27 @@ namespace CalamityMod.CalPlayer
|
||||
regen.position = Player.Center - velocity;
|
||||
}
|
||||
}
|
||||
if (fearmongerSet && fearmongerRegenFrames > 0)
|
||||
{
|
||||
if (Player.lifeRegenTime < FearmongerGreathelm.MinionRegenTimeFloor)
|
||||
Player.lifeRegenTime = FearmongerGreathelm.MinionRegenTimeFloor;
|
||||
|
||||
Player.lifeRegen += FearmongerGreathelm.MinionRegenBoost;
|
||||
Player.lifeRegenTime += FearmongerGreathelm.MinionRegenTimeBoost;
|
||||
}
|
||||
if (handWarmer && eskimoSet)
|
||||
{
|
||||
Player.lifeRegen += 2;
|
||||
}
|
||||
}
|
||||
|
||||
//This method runs AFTER UpdateBadLifeRegen. Only put effects that should bypass debuff DoT canceling here.
|
||||
public override void UpdateLifeRegen()
|
||||
{
|
||||
if (avertorBonus)
|
||||
{
|
||||
Player.lifeRegen += 4;
|
||||
}
|
||||
|
||||
if (community)
|
||||
{
|
||||
@@ -568,22 +560,10 @@ namespace CalamityMod.CalPlayer
|
||||
Player.lifeRegen += lesserEffect ? 1 : regenBoost;
|
||||
}
|
||||
|
||||
if (handWarmer && eskimoSet)
|
||||
if (manaOverloader)
|
||||
{
|
||||
Player.lifeRegen += 2;
|
||||
}
|
||||
if (avertorBonus)
|
||||
{
|
||||
Player.lifeRegen += 4;
|
||||
}
|
||||
|
||||
if (fearmongerSet && fearmongerRegenFrames > 0)
|
||||
{
|
||||
if (Player.lifeRegenTime < FearmongerGreathelm.MinionRegenTimeFloor)
|
||||
Player.lifeRegenTime = FearmongerGreathelm.MinionRegenTimeFloor;
|
||||
|
||||
Player.lifeRegen += FearmongerGreathelm.MinionRegenBoost;
|
||||
Player.lifeRegenTime += FearmongerGreathelm.MinionRegenTimeBoost;
|
||||
float manaRatio = Player.statMana / (float)Player.statManaMax2;
|
||||
Player.lifeRegen += (int)(MathF.Round(MathHelper.Lerp(4f, -4f, manaRatio)) * (Player.HasBuff(BuffID.ManaSickness) ? 0.5f : 1f));
|
||||
}
|
||||
|
||||
if (pinkCandle && !noLifeRegen)
|
||||
@@ -600,12 +580,6 @@ namespace CalamityMod.CalPlayer
|
||||
else
|
||||
pinkCandleHealFraction = 0D;
|
||||
|
||||
if (manaOverloader)
|
||||
{
|
||||
float manaRatio = Player.statMana / (float)Player.statManaMax2;
|
||||
Player.lifeRegen += (int)(MathF.Round(MathHelper.Lerp(4f, -4f, manaRatio)) * (Player.HasBuff(BuffID.ManaSickness) ? 0.5f : 1f));
|
||||
}
|
||||
|
||||
#region Standing Still Life Regen
|
||||
// Standing still healing bonuses (all are exclusive with vanilla Shiny Stone, but all function similarly)
|
||||
if (!Player.shinyStone && Player.StandingStill() && Player.velocity.Y == 0 && Player.itemAnimation == 0 && (shadeRegen || cFreeze))
|
||||
@@ -692,7 +666,13 @@ namespace CalamityMod.CalPlayer
|
||||
public override void NaturalLifeRegen(ref float regen)
|
||||
{
|
||||
// Honey Dew and its upgrades make natural regen more powerful
|
||||
if (honeyDew)
|
||||
if (purity)
|
||||
regen *= Radiance.NaturalRegenPower;
|
||||
else if (aAmpoule)
|
||||
regen *= AmbrosialAmpoule.NaturalRegenPower;
|
||||
else if (livingDew)
|
||||
regen *= LivingDew.NaturalRegenPower;
|
||||
else if (honeyDew)
|
||||
regen *= HoneyDew.NaturalRegenPower;
|
||||
|
||||
// The Camper counteracts the regen loss while moving horizontally
|
||||
|
||||
@@ -3637,24 +3637,24 @@ namespace CalamityMod.CalPlayer
|
||||
if (tarraSet)
|
||||
Player.lifeMagnet = true;
|
||||
|
||||
if (whisperingDeath && !laudanum && !purity)
|
||||
if (whisperingDeath && !laudanum)
|
||||
Player.GetDamage<GenericDamageClass>() -= 0.2f;
|
||||
|
||||
if (armorCrunch && !laudanum && !purity)
|
||||
if (armorCrunch && !laudanum)
|
||||
{
|
||||
Player.statDefense -= ArmorCrunch.DefenseReduction;
|
||||
Player.endurance *= ArmorCrunch.MultiplicativeDamageReductionPlayer;
|
||||
}
|
||||
|
||||
if (wither && !purity)
|
||||
if (wither)
|
||||
{
|
||||
Player.statDefense -= RemsRevenge.WitherDefenseReduction;
|
||||
}
|
||||
|
||||
if (eutrophication && !purity)
|
||||
if (eutrophication)
|
||||
Player.velocity = Vector2.Zero;
|
||||
|
||||
if ((vaporfied && !purity) || galvanicCorrosion)
|
||||
if ((vaporfied) || galvanicCorrosion)
|
||||
Player.velocity *= 0.98f;
|
||||
|
||||
if (molluskHelmet)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -13,8 +14,11 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
|
||||
public static int MaxLifeBoost = 50;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxLifeBoost, LivingDew.RegenTimeBoost.ToPercent(), (HoneyDew.NaturalRegenPower - 1f).ToPercent(), RadiantOoze.MinRegenBoost.ToRegenPerSecond(), RadiantOoze.MaxRegenBoost.ToRegenPerSecond());
|
||||
public static int MinRegenBoost => 2;
|
||||
public static int MaxRegenBoost => 6;
|
||||
public static float RegenTimeBoost => 1;
|
||||
public static float NaturalRegenPower => 1.5f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinRegenBoost.ToRegenPerSecond(), MaxRegenBoost.ToRegenPerSecond(), (NaturalRegenPower - 1f).ToPercent(), RegenTimeBoost.ToPercent());
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -28,19 +32,8 @@ namespace CalamityMod.Items.Accessories
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
player.statLifeMax2 += MaxLifeBoost;
|
||||
if (!player.HasBuff(BuffID.Honey))
|
||||
player.AddBuff(BuffID.Honey, 2);
|
||||
|
||||
// bool left in for abyss light purposes and life regen effects
|
||||
modPlayer.aAmpoule = true;
|
||||
|
||||
// Inherits all effects of Honey Dew and Living Dew
|
||||
modPlayer.honeyDew = true;
|
||||
modPlayer.livingDew = true;
|
||||
|
||||
// Add light if the other accessories aren't equipped and visibility is turned on
|
||||
if (!(modPlayer.rOoze || modPlayer.purity) && !hideVisual)
|
||||
if (!(modPlayer.purity) && !hideVisual)
|
||||
Lighting.AddLight(player.Center, new Vector3(1.2f, 1.2f, 0.72f));
|
||||
}
|
||||
|
||||
@@ -49,7 +42,7 @@ namespace CalamityMod.Items.Accessories
|
||||
var player = Main.LocalPlayer;
|
||||
if (player != null)
|
||||
{
|
||||
list.FindAndReplace("[REGEN]", player.Calamity().radiantOozeRegen.ToString("0.##"));
|
||||
list.FindAndReplace("[REGEN]", ((int)MathF.Round(MathHelper.Lerp(MaxRegenBoost, MinRegenBoost, (player.statLife / (float)player.statLifeMax2)))).ToRegenPerSecond());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,13 +11,12 @@ namespace CalamityMod.Items.Accessories
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
|
||||
public static int RegenBoost = 1;
|
||||
public static int DebuffedRegenBoost = 3; // Added on top of the baseline regen boost
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), DebuffedRegenBoost.ToRegenPerSecond());
|
||||
public static int ReducedDoTAmount = 4;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), ReducedDoTAmount.ToRegenPerSecond());
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 26;
|
||||
Item.height = 26;
|
||||
Item.defense = 1;
|
||||
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
Item.accessory = true;
|
||||
@@ -27,6 +26,7 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.crownJewel = true;
|
||||
player.lifeRegen += RegenBoost;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,9 +10,8 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
|
||||
public static int MaxLifeBoost = 10;
|
||||
public static float NaturalRegenPower = 1.5f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxLifeBoost, (NaturalRegenPower - 1f).ToPercent());
|
||||
public static float NaturalRegenPower => 1.5f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((NaturalRegenPower - 1f).ToPercent());
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 20;
|
||||
@@ -24,7 +23,6 @@ namespace CalamityMod.Items.Accessories
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
player.statLifeMax2 += MaxLifeBoost;
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.honeyDew = true;
|
||||
}
|
||||
|
||||
@@ -14,16 +14,13 @@ namespace CalamityMod.Items.Accessories
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
|
||||
public static int RegenBoost = 2;
|
||||
public static int DebuffedRegenBoost = 3; // Added on top of the baseline regen boost
|
||||
public static int DebuffedDefenseBoost = 8;
|
||||
public static int ExtraDebuffDefenseBoost = 3; // Per additional debuff
|
||||
public static int FramesToDecayDefense = 15;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), DebuffedDefenseBoost, DebuffedRegenBoost.ToRegenPerSecond(), ExtraDebuffDefenseBoost);
|
||||
public static int ReducedDoTAmount = 8;
|
||||
public static int PostDebuffRegenTimeBoost = CalamityUtils.SecondsToFrames(10);
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), ReducedDoTAmount.ToRegenPerSecond(), PostDebuffRegenTimeBoost.FramesToSeconds());
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 26;
|
||||
Item.height = 26;
|
||||
Item.defense = 2;
|
||||
Item.value = CalamityGlobalItem.RarityLimeBuyPrice;
|
||||
Item.rare = ItemRarityID.Lime;
|
||||
Item.accessory = true;
|
||||
@@ -33,6 +30,7 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.infectedJewel = true;
|
||||
player.lifeRegen += RegenBoost;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -11,9 +11,9 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
|
||||
public static int MaxLifeBoost = 25;
|
||||
public static int RegenTimeBoost = 1;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxLifeBoost, RegenTimeBoost.ToPercent(), (HoneyDew.NaturalRegenPower - 1f).ToPercent());
|
||||
public static int RegenTimeBoost => 1;
|
||||
public static float NaturalRegenPower => 1.5f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((NaturalRegenPower - 1f).ToPercent(), RegenTimeBoost.ToPercent());
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 34;
|
||||
@@ -25,11 +25,7 @@ namespace CalamityMod.Items.Accessories
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
player.statLifeMax2 += MaxLifeBoost;
|
||||
|
||||
// Inherits all effects of Honey Dew
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.honeyDew = true;
|
||||
modPlayer.livingDew = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Rarities;
|
||||
@@ -13,18 +14,17 @@ using Terraria.ModLoader;
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
[LegacyName("AstralArcanum", "Purity")]
|
||||
public class Radiance : ModItem, ILocalizedModType, IHoldShiftTooltipItem
|
||||
public class Radiance : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
|
||||
public static int MaxLifeBoost = 70;
|
||||
public static int DebuffedRegenBoost = 4; // Added on top of the baseline regen boost
|
||||
public static int DebuffedDefenseBoost = 9;
|
||||
public static int ExtraDebuffDefenseBoost = 4; // Per additional debuff
|
||||
public static int FramesToDecayDefense = 15;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxLifeBoost);
|
||||
public LocalizedText TooltipExtensionText => this.GetLocalization("HoldShiftTooltip").WithFormatArgs(LivingDew.RegenTimeBoost.ToPercent(), (HoneyDew.NaturalRegenPower - 1f).ToPercent(),
|
||||
RadiantOoze.MinRegenBoost.ToRegenPerSecond(), RadiantOoze.MaxRegenBoost.ToRegenPerSecond(), DebuffedDefenseBoost, DebuffedRegenBoost.ToRegenPerSecond(), ExtraDebuffDefenseBoost);
|
||||
public static int MinRegenBoost => 2;
|
||||
public static int MaxRegenBoost => 8;
|
||||
public static int ReducedDoTAmount => 20;
|
||||
public static int PostDebuffRegenTimeBoost => CalamityUtils.SecondsToFrames(10);
|
||||
public static float RegenTimeBoost => 1;
|
||||
public static float NaturalRegenPower => 1.5f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinRegenBoost.ToRegenPerSecond(),MaxRegenBoost.ToRegenPerSecond(),ReducedDoTAmount.ToRegenPerSecond(), (NaturalRegenPower - 1f).ToPercent(),RegenTimeBoost.ToPercent());
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 7));
|
||||
@@ -35,7 +35,6 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
Item.width = 18;
|
||||
Item.height = 44;
|
||||
Item.defense = 3;
|
||||
Item.accessory = true;
|
||||
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
|
||||
Item.rare = ModContent.RarityType<BurnishedAuric>();
|
||||
@@ -44,17 +43,8 @@ namespace CalamityMod.Items.Accessories
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
player.statLifeMax2 += MaxLifeBoost;
|
||||
|
||||
// Abyss light, debuff near-immunity, and life regen effects
|
||||
modPlayer.purity = true;
|
||||
|
||||
// Inherits effects from Honey Dew and Living Dew
|
||||
modPlayer.honeyDew = true;
|
||||
modPlayer.livingDew = true;
|
||||
|
||||
// Add light if the other accessories aren't equipped and visibility is turned on
|
||||
if (!(modPlayer.rOoze || modPlayer.aAmpoule) && !hideVisual)
|
||||
if (!hideVisual)
|
||||
Lighting.AddLight(player.Center, new Vector3(1.32f, 1.32f, 1.82f));
|
||||
}
|
||||
|
||||
@@ -64,8 +54,7 @@ namespace CalamityMod.Items.Accessories
|
||||
var player = Main.LocalPlayer;
|
||||
if (player != null)
|
||||
{
|
||||
list.FindAndReplace("[REGEN]", player.Calamity().purityRegen.ToString("0.##"));
|
||||
list.FindAndReplace("[DEFENSE]", player.Calamity().jewelBonusDefense.ToString());
|
||||
list.FindAndReplace("[REGEN]", ((int)MathF.Round(MathHelper.Lerp(MaxRegenBoost, MinRegenBoost, (player.statLife / (float)player.statLifeMax2)))).ToRegenPerSecond());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -13,8 +14,8 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
|
||||
public static int MinRegenBoost = 1;
|
||||
public static int MaxRegenBoost = 5;
|
||||
public static int MinRegenBoost => 1;
|
||||
public static int MaxRegenBoost => 5;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinRegenBoost.ToRegenPerSecond(), MaxRegenBoost.ToRegenPerSecond());
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -29,11 +30,8 @@ namespace CalamityMod.Items.Accessories
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
|
||||
// bool left in for abyss light purposes and life regen effects
|
||||
modPlayer.rOoze = true;
|
||||
|
||||
// Add light if the other accessories aren't equipped and visibility is turned on
|
||||
if (!(modPlayer.aAmpoule || modPlayer.purity) && !hideVisual)
|
||||
Lighting.AddLight(player.Center, new Vector3(1f, 1f, 0.6f));
|
||||
}
|
||||
@@ -43,7 +41,7 @@ namespace CalamityMod.Items.Accessories
|
||||
var player = Main.LocalPlayer;
|
||||
if (player != null)
|
||||
{
|
||||
list.FindAndReplace("[REGEN]", (player.Calamity().radiantOozeRegen).ToString("0.##"));
|
||||
list.FindAndReplace("[REGEN]", ((int)MathF.Round(MathHelper.Lerp(MaxRegenBoost, MinRegenBoost, (player.statLife / (float)player.statLifeMax2)))).ToRegenPerSecond());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,11 +98,8 @@ AmbrosialAmpoule: {
|
||||
DisplayName: Ambrosial Ampoule
|
||||
Tooltip:
|
||||
'''
|
||||
+{0} max life
|
||||
Natural life regen is {1}% faster and {2}% more potent
|
||||
Grants +{2} to +{3} HP/s life regen based on missing health
|
||||
Current boost: +[REGEN] HP/s
|
||||
Fire and sickness debuff durations are halved
|
||||
+{0} to +{1} HP/s life regen based on missing health [c/999999:(Current: +[REGEN] HP/s)]
|
||||
Natural life regen is {2}% more potent and returns {3}% faster
|
||||
You emit yellow light if visibility is enabled
|
||||
'''
|
||||
}
|
||||
@@ -468,7 +465,7 @@ CrownJewel: {
|
||||
Tooltip:
|
||||
'''
|
||||
+{0} HP/s life regen
|
||||
You gain an additional +{1} HP/s life regen while afflicted with any debuff
|
||||
Reduces damage over time taken by {1} HP/s
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -946,11 +943,7 @@ HideofAstrumDeus: {
|
||||
|
||||
HoneyDew: {
|
||||
DisplayName: Honey Dew
|
||||
Tooltip:
|
||||
'''
|
||||
+{0} max life
|
||||
Natural life regen is {1}% more potent
|
||||
'''
|
||||
Tooltip: Natural life regen is {0}% more potent
|
||||
}
|
||||
|
||||
HowlsHeart: {
|
||||
@@ -976,11 +969,9 @@ InfectedJewel: {
|
||||
DisplayName: Infected Jewel
|
||||
Tooltip:
|
||||
'''
|
||||
Passively grants +{0} HP/s life regen
|
||||
Grants {1} defense and +{2} HP/s life regen while afflicted with any debuff
|
||||
Granted defense fades away when not afflicted with any debuffs
|
||||
Each debuff beyond the first grants {3} additional defense
|
||||
Nullifies the [cbuffplr:CalamityMod/AstralInfectionDebuff]
|
||||
+{0} HP/s life regen
|
||||
Reduces damage over time taken by {1} HP/s
|
||||
Jump-starts regeneration after a damaging debuff ends
|
||||
'A beautiful gemstone tarnished by spaceborne rot'
|
||||
'''
|
||||
}
|
||||
@@ -1077,11 +1068,7 @@ LifeJelly: {
|
||||
|
||||
LivingDew: {
|
||||
DisplayName: Living Dew
|
||||
Tooltip:
|
||||
'''
|
||||
+{0} max life
|
||||
Natural life regen is {1}% faster and {2}% more potent
|
||||
'''
|
||||
Tooltip: Natural life regen is {0}% more potent and returns {1}% faster
|
||||
}
|
||||
|
||||
LuxorsGift: {
|
||||
@@ -1390,30 +1377,21 @@ Radiance: {
|
||||
DisplayName: Radiance
|
||||
Tooltip:
|
||||
'''
|
||||
+{0} max life
|
||||
Provides greatly improved life regen, increasing with lost health
|
||||
Gain increased defense from debuffs inflicted on you, and greatly reduces their effectiveness
|
||||
Current boosts: +[REGEN] HP/s and [DEFENSE] defense.
|
||||
+{0} to +{1} HP/s life regen based on missing health [c/999999:(Current: +[REGEN] HP/s)]
|
||||
Reduces damage over time taken by {2} HP/s and jump-starts regeneration after a damaging debuff ends
|
||||
Natural life regen is {3}% more potent and returns {4}% faster
|
||||
You emit shining blue light if visibility is enabled
|
||||
'A once putrid crystal, now glimmering with immaculate purity'
|
||||
'''
|
||||
HoldShiftTooltip:
|
||||
'''
|
||||
[c/CDF69C:Natural life regen is {0}% faster and {1}% more potent]
|
||||
[c/CDF69C:Grants +{2} to +{3} HP/s life regen based on missing health]
|
||||
[c/CDF69C:Grants {4} defense and +{5} HP/s life regen while afflicted with any debuff]
|
||||
[c/CDF69C:Each additional debuff grants {6} defense, which decays while not debuffed]
|
||||
[c/CDF69C:Causes weak damaging debuffs to be harmless]
|
||||
'''
|
||||
}
|
||||
|
||||
RadiantOoze: {
|
||||
DisplayName: Radiant Ooze
|
||||
Tooltip:
|
||||
'''
|
||||
Grants +{0} to +{1} HP/s life regen based on missing health
|
||||
Current boost: +[REGEN] HP/s
|
||||
+{0} to +{1} HP/s life regen based on missing health
|
||||
You emit yellow light if visibility is enabled
|
||||
[c/999999:(Current regen: +[REGEN] HP/s)]
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user