1 - I'm going to tear my hair out.

2 - Made the player always heal to full on respawn.
This commit is contained in:
mountaindrew10 committed 2024-04-20 08:39:19 -05:00
1 parent 21ad9a0dea
commit 06fe2c4a02
6 files changed
+9 -51

No files matched your search

+1 -6
View File
@@ -306,7 +306,6 @@ namespace CalamityMod.CalPlayer
#region Pet
public bool thirdSage = false;
public bool thirdSageH = false;
public bool perfmini = false;
public bool akato = false;
public bool yharonPet = false;
@@ -1235,7 +1234,6 @@ namespace CalamityMod.CalPlayer
adrenalineBoostThree = false;
drawBossHPBar = true;
shouldDrawSmallText = true;
healToFull = false;
newMerchantInventory = false;
newPainterInventory = false;
@@ -1288,7 +1286,6 @@ namespace CalamityMod.CalPlayer
boost.AddWithCondition("adrenalineThree", adrenalineBoostThree);
boost.AddWithCondition("bossHPBar", drawBossHPBar);
boost.AddWithCondition("drawSmallText", shouldDrawSmallText);
boost.AddWithCondition("fullHPRespawn", healToFull);
boost.AddWithCondition("newMerchantInventory", newMerchantInventory);
boost.AddWithCondition("newPainterInventory", newPainterInventory);
@@ -1379,7 +1376,6 @@ namespace CalamityMod.CalPlayer
adrenalineBoostThree = boost.Contains("adrenalineThree");
drawBossHPBar = boost.Contains("bossHPBar");
shouldDrawSmallText = boost.Contains("drawSmallText");
healToFull = boost.Contains("fullHPRespawn");
newMerchantInventory = boost.Contains("newMerchantInventory");
newPainterInventory = boost.Contains("newPainterInventory");
@@ -3735,8 +3731,7 @@ namespace CalamityMod.CalPlayer
#region On Respawn
public override void OnRespawn()
{
if (healToFull)
thirdSageH = true;
healToFull = true;
// The player rotation can be off if the player dies at the right time when using Final Dawn.
Player.fullRotation = 0f;
+2 -2
View File
@@ -2962,9 +2962,9 @@ namespace CalamityMod.CalPlayer
// The player's true max life value with Calamity adjustments
actualMaxLife = Player.statLifeMax2;
if (thirdSageH && !Player.dead && healToFull)
if (!Player.dead && healToFull)
{
thirdSageH = false;
healToFull = false;
Player.statLife = actualMaxLife;
}
@@ -33,37 +33,6 @@ namespace CalamityMod.Items.Pets
public override bool AltFunctionUse(Player player) => true;
public override void UseStyle(Player player, Rectangle heldItemFrame)
{
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.5) && Main.myPlayer == player.whoAmI)
{
if (player.altFunctionUse == 2)
{
if (!player.Calamity().healToFull)
{
player.Calamity().healToFull = true;
string key = "Mods.CalamityMod.Misc.ThirdSageBlessingText";
Color messageColor = Color.Violet;
Main.NewText(Language.GetTextValue(key), messageColor);
}
else
{
player.Calamity().healToFull = false;
string key2 = "Mods.CalamityMod.Misc.ThirdSageBlessingText2";
Color messageColor2 = Color.Violet;
Main.NewText(Language.GetTextValue(key2), messageColor2);
}
}
else
{
if (player.whoAmI == Main.myPlayer && player.itemTime == 0)
{
player.AddBuff(Item.buffType, 3600, true);
}
}
}
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) => false;
}
}
@@ -52,8 +52,6 @@ SevensBust: Bust!
SevensDoubles: Doubles!
SevensTriples: Triples!
StylishHammerHit: Stylish!
ThirdSageBlessingText: You have been blessed by the Third Sage!
ThirdSageBlessingText2: The Third Sage has rescinded its blessing...
GenericConsumedText: "[c/8A8A8A:You have already consumed this item]"
BloodOrangeText: You have already consumed a Blood Orange. Eating any more would make your blood too thick to flow.
MiracleFruitText: You have already consumed a Miracle Fruit. It would take a miracle to put you back together if you ate another.
-6
View File
@@ -1001,9 +1001,6 @@ namespace CalamityMod
"StarlightFuelCell" => player.Calamity().adrenalineBoostTwo,
"Ectoheart" => player.Calamity().adrenalineBoostThree,
"HermitsBox" => player.Calamity().healToFull,
"HermitsBoxofOneHundredMedicines" => player.Calamity().healToFull,
"CelestialOnion" => player.Calamity().extraAccessoryML,
_ => false, // Return false if no case is found
@@ -1033,9 +1030,6 @@ namespace CalamityMod
case "StarlightFuelCell": player.Calamity().adrenalineBoostTwo = value; break;
case "Ectoheart": player.Calamity().adrenalineBoostThree = value; break;
case "HermitsBox": player.Calamity().healToFull = value; break;
case "HermitsBoxofOneHundredMedicines": player.Calamity().healToFull = value; break;
case "CelestialOnion": player.Calamity().extraAccessoryML = value; break;
};
}
@@ -136,11 +136,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int type = ProjectileID.Fireball;
damage = npc.GetProjectileDamage(type);
int numProj = 3;
int spread = 30;
int spread = 15;
float rotation = MathHelper.ToRadians(spread);
for (int j = 0; j < numProj; j++)
{
Vector2 randomVelocity = Main.rand.NextVector2CircularEdge(2f, 2f);
Vector2 randomVelocity = Main.rand.NextVector2CircularEdge(1.5f, 1.5f);
Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, j / (float)(numProj - 1))) + randomVelocity;
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 50f, perturbedSpeed, type, damage, 0f, Main.myPlayer);
}
@@ -600,9 +600,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
{
float distanceAboveTarget = 240f * npc.ai[0];
float distanceAwayFromTargetX = 560f;
float distanceAwayFromTargetXLeeway = 40f;
float distanceAwayFromTargetY = Main.player[npc.target].Center.Y - npc.Center.Y;
float distanceAwayFromTargetYLeeway = 48f;
bool tooFarX = Math.Abs(Main.player[npc.target].Center.X - npc.Center.X) > distanceAwayFromTargetX;
float distanceAwayFromTargetYLeeway = 40f;
float absoluteDistanceX = Math.Abs(Main.player[npc.target].Center.X - npc.Center.X);
bool tooFarX = absoluteDistanceX > distanceAwayFromTargetX + distanceAwayFromTargetXLeeway || absoluteDistanceX < distanceAwayFromTargetX - distanceAwayFromTargetXLeeway;
bool tooFarY = distanceAwayFromTargetY > distanceAboveTarget + distanceAwayFromTargetYLeeway || distanceAwayFromTargetY < distanceAboveTarget - distanceAwayFromTargetYLeeway;
bool tooFar = tooFarX || tooFarY;
if (tooFar)