This commit is contained in:
Xyk committed 2024-04-28 15:20:05 -07:00
commit 02ca22b2b1
3 files changed
+78 -48

No files matched your search

+12 -3
View File
@@ -22,6 +22,8 @@ namespace CalamityMod.NPCs.NormalNPCs
public static Asset<Texture2D> EyeTexture;
public const int BombTimeLeft = 600;
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 6;
@@ -312,15 +314,22 @@ namespace CalamityMod.NPCs.NormalNPCs
NPC.rotation = NPC.velocity.X / 15f;
float acceleration = (bossRush ? 0.2f : 0.125f) + (death ? 0.05f * (1f - lifeRatio) : 0f);
float accelerationMult = 1f;
if (!cannonAlive)
{
acceleration += 0.025f;
accelerationMult += 0.5f;
}
if (!laserAlive)
{
acceleration += 0.025f;
accelerationMult += 0.5f;
}
if (!viceAlive)
acceleration += 0.025f;
if (!sawAlive)
acceleration += 0.025f;
acceleration *= 4f;
acceleration *= accelerationMult;
float topVelocity = acceleration * 100f;
float deceleration = 0.7f;
@@ -679,7 +688,7 @@ namespace CalamityMod.NPCs.NormalNPCs
}
int enragedBombs = Projectile.NewProjectile(NPC.GetSource_FromAI(), headCenter.X, headCenter.Y + 30f, enragedHeadBombTargetX, enragedHeadBombTargetY, type, damage, 0f, Main.myPlayer, -1f);
Main.projectile[enragedBombs].timeLeft = 600;
Main.projectile[enragedBombs].timeLeft = BombTimeLeft;
Main.projectile[enragedBombs].tileCollide = false;
}
}
@@ -757,7 +766,7 @@ namespace CalamityMod.NPCs.NormalNPCs
{
Vector2 bombVelocity = spinningPoint.RotatedBy(radians * k);
int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitY * 30f + bombVelocity.SafeNormalize(Vector2.UnitY) * 15f, bombVelocity - upwardVelocity, type, damage, 0f, Main.myPlayer, -2f);
Main.projectile[proj].timeLeft = 900;
Main.projectile[proj].timeLeft = BombTimeLeft;
Main.projectile[proj].tileCollide = false;
}
NPC.localAI[1] += 1f;
@@ -290,16 +290,23 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.rotation = npc.velocity.X / 15f;
float acceleration = (bossRush ? 0.2f : masterMode ? 0.125f : 0.1f) + (death ? 0.05f * (1f - lifeRatio) : 0f);
float accelerationMult = 1f;
if (!cannonAlive)
{
acceleration += 0.025f;
accelerationMult += 0.5f;
}
if (!laserAlive)
{
acceleration += 0.025f;
accelerationMult += 0.5f;
}
if (!viceAlive)
acceleration += 0.025f;
if (!sawAlive)
acceleration += 0.025f;
if (masterMode)
acceleration *= 4f;
acceleration *= accelerationMult;
float topVelocity = acceleration * 100f;
float deceleration = masterMode ? 0.7f : 0.85f;
@@ -830,14 +837,18 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Movement
float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f));
float accelerationMult = 1f;
if (!cannonAlive)
{
acceleration += 0.025f;
accelerationMult += 0.5f;
}
if (!viceAlive)
acceleration += 0.025f;
if (!sawAlive)
acceleration += 0.025f;
if (masterMode)
acceleration *= 4f;
acceleration *= accelerationMult;
float topVelocity = acceleration * 100f;
float deceleration = masterMode ? 0.6f : 0.8f;
@@ -1155,14 +1166,18 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Movement
float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f));
float accelerationMult = 1f;
if (!laserAlive)
{
acceleration += 0.025f;
accelerationMult += 0.5f;
}
if (!viceAlive)
acceleration += 0.025f;
if (!sawAlive)
acceleration += 0.025f;
if (masterMode)
acceleration *= 4f;
acceleration *= accelerationMult;
float topVelocity = acceleration * 100f;
float deceleration = masterMode ? 0.6f : 0.8f;
@@ -1388,14 +1403,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (npc.ai[2] == 99f)
{
float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f));
float accelerationMult = 1f;
if (!cannonAlive)
{
acceleration += 0.025f;
accelerationMult += 0.5f;
}
if (!laserAlive)
{
acceleration += 0.025f;
accelerationMult += 0.5f;
}
if (!sawAlive)
acceleration += 0.025f;
if (masterMode)
acceleration *= 4f;
acceleration *= accelerationMult;
float topVelocity = acceleration * 100f;
float deceleration = masterMode ? 0.6f : 0.8f;
@@ -1471,14 +1493,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
}
float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f));
float accelerationMult = 1f;
if (!cannonAlive)
{
acceleration += 0.025f;
accelerationMult += 0.5f;
}
if (!laserAlive)
{
acceleration += 0.025f;
accelerationMult += 0.5f;
}
if (!sawAlive)
acceleration += 0.025f;
if (masterMode)
acceleration *= 4f;
acceleration *= accelerationMult;
float topVelocity = acceleration * 100f;
float deceleration = masterMode ? 0.6f : 0.8f;
@@ -1749,14 +1778,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (npc.ai[2] == 99f)
{
float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f));
float accelerationMult = 1f;
if (!cannonAlive)
{
acceleration += 0.025f;
accelerationMult += 0.5f;
}
if (!laserAlive)
{
acceleration += 0.025f;
accelerationMult += 0.5f;
}
if (!viceAlive)
acceleration += 0.025f;
if (!laserAlive)
acceleration += 0.025f;
if (masterMode)
acceleration *= 4f;
acceleration *= accelerationMult;
float topVelocity = acceleration * 100f;
float deceleration = masterMode ? 0.6f : 0.8f;
@@ -1828,14 +1864,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
}
float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f));
float accelerationMult = 1f;
if (!cannonAlive)
{
acceleration += 0.025f;
accelerationMult += 0.5f;
}
if (!laserAlive)
{
acceleration += 0.025f;
accelerationMult += 0.5f;
}
if (!viceAlive)
acceleration += 0.025f;
if (!laserAlive)
acceleration += 0.025f;
if (masterMode)
acceleration *= 4f;
acceleration *= accelerationMult;
float topVelocity = acceleration * 100f;
float deceleration = masterMode ? 0.6f : 0.8f;
+12 -34
View File
@@ -10,6 +10,7 @@ using CalamityMod.Events;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.NPCs;
using CalamityMod.NPCs.NormalNPCs;
using CalamityMod.NPCs.PlagueEnemies;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Boss;
@@ -355,7 +356,7 @@ namespace CalamityMod.Projectiles
homingEndTime += 90f;
// Stop homing when within a certain distance of the target
if (Vector2.Distance(projectile.Center, Main.player[num133].Center) < ((revSkeletronPrimeHomingSkull && Main.masterMode && CalamityWorld.revenge) ? 192f : 96f) && projectile.ai[1] < homingEndTime)
if (Vector2.Distance(projectile.Center, Main.player[num133].Center) < ((revSkeletronPrimeHomingSkull && ((Main.masterMode && CalamityWorld.revenge) || BossRushEvent.BossRushActive)) ? 192f : 96f) && projectile.ai[1] < homingEndTime)
projectile.ai[1] = homingEndTime;
if (projectile.ai[1] < homingEndTime && projectile.ai[1] > homingStartTime)
@@ -2253,20 +2254,15 @@ namespace CalamityMod.Projectiles
return false;
}
if (projectile.timeLeft < SkeletronPrime2.BombTimeLeft / 2 && projectile.timeLeft > 3)
projectile.tileCollide = true;
if (masterModeSkeletronPrimeHomingBomb)
{
projectile.ai[1] += 1f;
float homingStartTime = 20f;
float homingEndTime = death ? 140f : 110f;
if (projectile.ai[1] < homingEndTime)
{
projectile.ai[1] = homingEndTime;
if (projectile.timeLeft > 3)
projectile.tileCollide = true;
}
if (Vector2.Distance(projectile.Center, Main.player[target].Center) < 192f && projectile.ai[1] < homingEndTime)
projectile.ai[1] = homingEndTime;
@@ -2290,12 +2286,7 @@ namespace CalamityMod.Projectiles
else
{
if (projectile.velocity.Y > 10f)
{
projectile.velocity.Y = 10f;
if (!projectile.tileCollide && projectile.timeLeft > 3)
projectile.tileCollide = true;
}
}
if (projectile.localAI[0] == 0f)
@@ -2334,24 +2325,11 @@ namespace CalamityMod.Projectiles
dust8.position = projectile.Center + new Vector2(0f, -projectile.height / 2 - 6).RotatedBy(projectile.rotation) * 1.1f;
}
if (!masterModeSkeletronPrimeHomingBomb)
if (masterModeSkeletronPrimeFallingBomb)
{
projectile.ai[2] += 1f;
if (projectile.ai[2] > 5f)
{
projectile.ai[2] = 10f;
if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f)
{
projectile.velocity.X *= 0.97f;
if ((double)projectile.velocity.X > -0.01 && (double)projectile.velocity.X < 0.01)
{
projectile.velocity.X = 0f;
projectile.netUpdate = true;
}
}
if (projectile.ai[2] > 60f)
projectile.velocity.Y += 0.2f;
}
}
projectile.rotation += projectile.velocity.X * 0.1f;
@@ -2386,13 +2364,13 @@ namespace CalamityMod.Projectiles
{
bool primeCannonProjectile = projectile.ai[1] == 2f;
bool homeIn = false;
float homingTime = masterMode ? 240f : 180f;
float homingTime = masterMode ? 90f : 180f;
float spreadOutCutoffTime = 555f;
float homeInCutoffTime = spreadOutCutoffTime - homingTime;
float minAcceleration = masterMode ? 0.096f : 0.08f;
float maxAcceleration = masterMode ? 0.144f : 0.12f;
float homingVelocity = masterMode ? 30f : 25f;
float maxVelocity = masterMode ? 18f : 15f;
float minAcceleration = masterMode ? 0.072f : 0.08f;
float maxAcceleration = masterMode ? 0.108f : 0.12f;
float homingVelocity = masterMode ? 22.5f : 25f;
float maxVelocity = masterMode ? 13.5f : 15f;
if (!primeCannonProjectile)
{