Functional Stuff

This commit is contained in:
Xyk authored and Cameron Ewell committed 2025-08-04 19:26:00 -04:00
1 parent e20951a5e6
commit 520250136e
7 files changed
+33 -38

No files matched your search

+6 -5
View File
@@ -805,10 +805,11 @@ namespace CalamityMod.CalPlayer
public int transformerStoredKills = 0;
public bool bloomStone = false;
public bool bloomStoneHookVisuals = false;
public int bloomStoneHealInc = 0;
public int bloomStoneHealPool = 0;
public int bloomStoneTotalHeal = 0;
public int bloomStoneHealTimer = 0;
public int bloomStoneDR = 0;
public float bloomStoneHealTimer = 0;
public float bloomStoneHealRate = 0;
public int bloomStoneBuffedHealRateTimer = 0;
public bool hideOfDeus = false;
public bool dAmulet = false;
public bool rampartOfDeities = false;
@@ -2840,10 +2841,10 @@ namespace CalamityMod.CalPlayer
auralisAurora = 0;
necroReviveCounter = -1;
hideOfDeusTimer = 0;
bloomStoneHealInc = 0;
bloomStoneHealPool = 0;
bloomStoneTotalHeal = 0;
bloomStoneHealTimer = 0;
bloomStoneDR = 0;
bloomStoneHealRate = 0;
murasamaHitCooldown = 0;
SulphWaterPoisoningLevel = 0f;
holyInfernoFadeIntensity = 0f;
+2 -2
View File
@@ -319,11 +319,11 @@ namespace CalamityMod.CalPlayer
GeneralParticleHandler.SpawnParticle(Plus);
}
}
if (calamityPlayer.bloomStoneDR > 0 && drawInfo.shadow == 0f)
if (calamityPlayer.bloomStoneBuffedHealRateTimer > 0 && drawInfo.shadow == 0f)
{
if (Main.rand.NextBool(10))
{
MediumMistParticle pollenCloud = new(Player.Center, Main.rand.NextVector2Circular(1f, 1f), Color.Yellow, Color.Gold, 0.85f, 100f);
MediumMistParticle pollenCloud = new(Player.Center, Main.rand.NextVector2Circular(1f, 1f), Color.Yellow, Color.Gold, 0.85f, 100f);
GeneralParticleHandler.SpawnParticle(pollenCloud);
}
if (Main.rand.NextBool(4))
-9
View File
@@ -696,15 +696,6 @@ namespace CalamityMod.CalPlayer
else
pinkCandleHealFraction = 0D;
if (BloomStoneRegen)
{
float dayTimeCompletion = !Main.dayTime ? 1f : (float)(Main.time / Main.dayLength);
float regenBenefitFactor = MathHelper.SmoothStep(0.25f, 1f, Utils.GetLerpValue(0f, 0.24f, dayTimeCompletion, true) * Utils.GetLerpValue(1f, 0.76f, dayTimeCompletion, true));
Player.lifeRegen += (int)MathHelper.Lerp(2f, 6f, regenBenefitFactor);
Player.lifeRegenTime += (int)MathHelper.Lerp(1f, 3f, regenBenefitFactor);
}
if (manaOverloader)
{
float manaRatio = Player.statMana / (float)Player.statManaMax2;
+23 -17
View File
@@ -2075,15 +2075,27 @@ namespace CalamityMod.CalPlayer
if (theBeeCooldown > 0)
theBeeCooldown--;
if (bloomStoneHealTimer > 0)
if (bloomStoneTotalHeal > 0)
{
if (bloomStone && bloomStoneHealTimer % 40 == 0)
float healRateDiv = (Player.statLife >= Player.statLifeMax ? 5 : // 5 times as slow if at max hp already (overheal prevention)
bloomStoneBuffedHealRateTimer > 0 ? Utils.Remap(bloomStoneBuffedHealRateTimer, 90, 0, 0.5f, 1f, true) // 2 times faster if pollen buffed, scales back down to regular speed as the buff fades
: 1); // Regular speed
bloomStoneHealRate = 1 / healRateDiv;
if (!bloomStone) // If you take it off, all your healing is instantly gone
bloomStoneTotalHeal = 0;
float secondsOfHealing = 16; // Number of seconds healing occurs over at base, this can be met slower or faster depending on heal rate
if (bloomStoneHealTimer >= 60) // heal the player a portion of their potion every second
{
Player.HealPlayer(Math.Min(bloomStoneHealInc, bloomStoneTotalHeal));
int healAmount = (int)(Math.Max(Math.Min(bloomStoneHealPool, (int)(bloomStoneTotalHeal / secondsOfHealing)), 1));
Player.HealPlayer(healAmount);
bloomStoneHealPool -= healAmount; // Subtract the amount healed from the pool until it's empty
// Special specifically programmed interaction with Chalice of the Blood God: Healing over time clears bits of the bleedout buffer.
if (chaliceOfTheBloodGod && chaliceBleedoutBuffer > 0D)
{
float amountOfBleedToClear = ChaliceOfTheBloodGod.HealingPotionRatioForBufferClear * bloomStoneHealInc;
float amountOfBleedToClear = ChaliceOfTheBloodGod.HealingPotionRatioForBufferClear * healAmount;
chaliceBleedoutBuffer -= amountOfBleedToClear;
// Display text indicating that healing was applied to the bleedout buffer.
if (!Main.dedServ)
@@ -2094,22 +2106,16 @@ namespace CalamityMod.CalPlayer
}
}
bloomStoneTotalHeal -= bloomStoneHealInc;
if (bloomStoneTotalHeal < 0)
if (bloomStoneHealPool == 0) // When you're out of healing, reset values
{
bloomStoneTotalHeal = 0;
}
bloomStoneHealTimer = 0;
}
bloomStoneHealTimer--;
}
else
{
bloomStoneTotalHeal = 0;
bloomStoneHealInc = 0;
}
if (bloomStoneDR > 0)
{
Player.endurance += bloomStoneHealTimer > 0 ? 0.12f : 0.06f;
bloomStoneDR--;
bloomStoneHealTimer += bloomStoneHealRate;
}
if (bloomStoneBuffedHealRateTimer > 0)
bloomStoneBuffedHealRateTimer--;
if (summonProjCooldown > 0f)
summonProjCooldown -= 1f;
+1 -4
View File
@@ -693,11 +693,8 @@ namespace CalamityMod.Items
{
// Temporarily disable Bloom Stone so that GetHealLife doesn't return 0
modPlayer.bloomStone = false;
modPlayer.bloomStoneTotalHeal = player.GetHealLife(item);
modPlayer.bloomStoneTotalHeal = modPlayer.bloomStoneHealPool = player.GetHealLife(item);
modPlayer.bloomStone = true;
modPlayer.bloomStoneHealInc = modPlayer.bloomStoneTotalHeal / 15;
modPlayer.bloomStoneHealTimer = (int)Math.Ceiling(modPlayer.bloomStoneTotalHeal / (double)modPlayer.bloomStoneHealInc) * 40;
}
// Staff/Axe of Regrowth growing Calamity grass
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

+1 -1
View File
@@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Typeless
continue;
if (Projectile.Hitbox.Intersects(p.Hitbox))
p.Calamity().bloomStoneDR = 360;
p.Calamity().bloomStoneBuffedHealRateTimer = 360;
}
break;
}