This commit is contained in:
Doze-Zoze committed 2025-05-07 19:40:32 -05:00
commit a2b31b13af
3 files changed
+31 -24

No files matched your search

@@ -130,6 +130,10 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs
// Increase projectile fire rate based on number of nearby active tiles
float projectileFireRateMultiplier = MathHelper.Lerp(0.5f, 1.5f, 1f - ((tileEnrageMult - 1f) / 0.5f));
// Decides whether Ceaseless moves closer to its target or not
float distanceRequiredToMove = (Main.getGoodWorld || !anyDarkEnergies) ? 320f : bossRush ? 600f : death ? 520f : revenge ? 480f : expertMode ? 440f : 400f;
bool move = Vector2.Distance(npc.Center, player.Center) > distanceRequiredToMove || !Collision.CanHit(npc.Center, 1, 1, player.Center, 1, 1);
// Succ attack
if (!anyDarkEnergies)
{
@@ -142,7 +146,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs
// Avoid cheap bullshit
npc.damage = 0;
if (Vector2.Distance(npc.Center, player.Center) > 320f || !Collision.CanHit(npc.Center, 1, 1, player.Center, 1, 1))
if (move)
Movement(true);
else
npc.ai[3] = 1f;
@@ -171,7 +175,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs
npc.velocity = Vector2.Zero;
// Move towards target again if they get outside the succ radius
float moveCloserGateValue = suckDistance * 0.75f;
float moveCloserGateValue = suckDistance * 0.8f;
if (Vector2.Distance(npc.Center, player.Center) > moveCloserGateValue)
npc.ai[3] = 0f;
@@ -377,7 +381,18 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs
// Avoid cheap bullshit
npc.damage = 0;
Movement(false);
if (move)
{
Movement(false);
}
else
{
// Slow down
if (npc.velocity.Length() > 0.5f)
npc.velocity *= 0.8f;
else
npc.velocity = Vector2.Zero;
}
// Count up all Dark Energy HP values
int totalDarkEnergyHP = 0;
@@ -469,8 +484,8 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs
// Move between 8 different positions around the player, in order
float maxDistance = 320f;
Vector2 moveToOffset = succ ? Vector2.Zero : new Vector2(0f, -maxDistance);
if (!succ)
Vector2 moveToOffset = succ ? Vector2.Zero : Main.getGoodWorld ? new Vector2(0f, -maxDistance) : Vector2.Zero;
if (!succ && Main.getGoodWorld)
{
// Move to a new location every few seconds
calamityGlobalNPC.newAI[2] += 1f;
@@ -522,18 +537,8 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs
Vector2 distanceFromDestination = destination - npc.Center;
// Movement
if (npc.Distance(destination) > maxDistance || succ)
{
if (npc.Distance(destination) > maxDistance || succ || !Main.getGoodWorld)
CalamityUtils.SmoothMovement(npc, 0f, distanceFromDestination, velocity, acceleration, true);
}
else
{
// Slow down
if (npc.velocity.Length() > 0.5f)
npc.velocity *= 0.8f;
else
npc.velocity = Vector2.Zero;
}
}
// Spawn more Dark Energies as the fight progresses
@@ -527,7 +527,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (!despawn)
npc.localAI[1] += 1f;
if (npc.localAI[1] >= 210f)
float teleportGateValue = npc.ai[0] == -6f ? 300f : 210f;
if (npc.localAI[1] >= teleportGateValue)
{
npc.localAI[1] = 0f;
+8 -7
View File
@@ -317,37 +317,38 @@ namespace CalamityMod.Tiles
if (type == TileID.MatureHerbs)
{
int herbType = Main.tile[i, j].TileFrameX / 18;
int seedQuantity = Main.rand.Next(2) + 1;
switch (herbType)
{
default:
break;
case (int)HerbType.Daybloom:
DropItem(i, j, ItemID.DaybloomSeeds, quantity: 1, asStack: true);
DropItem(i, j, ItemID.DaybloomSeeds, quantity: seedQuantity, asStack: true);
break;
case (int)HerbType.Moonglow:
DropItem(i, j, ItemID.MoonglowSeeds, quantity: 1, asStack: true);
DropItem(i, j, ItemID.MoonglowSeeds, quantity: seedQuantity, asStack: true);
break;
case (int)HerbType.Blinkroot:
DropItem(i, j, ItemID.BlinkrootSeeds, quantity: 1, asStack: true);
DropItem(i, j, ItemID.BlinkrootSeeds, quantity: seedQuantity, asStack: true);
break;
case (int)HerbType.Deathweed:
DropItem(i, j, ItemID.DeathweedSeeds, quantity: 1, asStack: true);
DropItem(i, j, ItemID.DeathweedSeeds, quantity: seedQuantity, asStack: true);
break;
case (int)HerbType.Waterleaf:
DropItem(i, j, ItemID.WaterleafSeeds, quantity: 1, asStack: true);
DropItem(i, j, ItemID.WaterleafSeeds, quantity: seedQuantity, asStack: true);
break;
case (int)HerbType.Fireblossom:
DropItem(i, j, ItemID.FireblossomSeeds, quantity: 1, asStack: true);
DropItem(i, j, ItemID.FireblossomSeeds, quantity: seedQuantity, asStack: true);
break;
case (int)HerbType.Shiverthorn:
DropItem(i, j, ItemID.ShiverthornSeeds, quantity: 1, asStack: true);
DropItem(i, j, ItemID.ShiverthornSeeds, quantity: seedQuantity, asStack: true);
break;
}
}