Chad Primes
This commit is contained in:
1 parent
84cf94b9f8
commit
74845cd222
11 files changed
+77
-49
No files matched your search
@@ -114,6 +114,10 @@ namespace CalamityMod
|
||||
// Wall of Flesh eye laser telegraph glowmask
|
||||
public static Asset<Texture2D> WallOfFleshEyeGlowmask;
|
||||
|
||||
// Master Rev+ Skeletron Prime
|
||||
public static Asset<Texture2D> ChadPrime;
|
||||
public static Asset<Texture2D> ChadPrimeEyeGlowmask;
|
||||
|
||||
// DR data structure
|
||||
public static SortedDictionary<int, float> DRValues;
|
||||
|
||||
@@ -300,6 +304,10 @@ namespace CalamityMod
|
||||
// Wall of Flesh glowmask
|
||||
WallOfFleshEyeGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow", AssetRequestMode.AsyncLoad);
|
||||
|
||||
// Master Rev+ Skeletron Prime textures
|
||||
ChadPrime = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/ChadPrime", AssetRequestMode.AsyncLoad);
|
||||
ChadPrimeEyeGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/ChadPrimeHeadGlow", AssetRequestMode.AsyncLoad);
|
||||
|
||||
// TODO -- Sky shaders should probably be loaded in a ModSystem
|
||||
Filters.Scene["CalamityMod:DevourerofGodsHead"] = new Filter(new DoGScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.1f, 1.0f).UseOpacity(0.5f), EffectPriority.VeryHigh);
|
||||
SkyManager.Instance["CalamityMod:DevourerofGodsHead"] = new DoGSky();
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 588 B |
Binary file not shown.
|
After Width: | Height: | Size: 602 B |
@@ -1414,7 +1414,7 @@ namespace CalamityMod.NPCs
|
||||
else if (npc.type == NPCID.SkeletronPrime || npc.type == ModContent.NPCType<SkeletronPrime2>())
|
||||
{
|
||||
// HP boosted in Master Mode due to having two heads (piercing can make them die faster than normal here since they share an HP bar)
|
||||
npc.lifeMax = (int)Math.Round(npc.lifeMax * (Main.masterMode ? 1.4 : 1.2));
|
||||
npc.lifeMax = (int)Math.Round(npc.lifeMax * (Main.masterMode ? 1.7 : 1.2));
|
||||
npc.npcSlots = 12f;
|
||||
}
|
||||
else if (npc.type <= NPCID.PrimeLaser && npc.type >= NPCID.PrimeCannon)
|
||||
@@ -7372,7 +7372,7 @@ namespace CalamityMod.NPCs
|
||||
// His afterimages I can't get to work, so fuck it
|
||||
else if (npc.type == NPCID.SkeletronPrime || npc.type == ModContent.NPCType<SkeletronPrime2>())
|
||||
{
|
||||
Texture2D npcTexture = TextureAssets.Npc[npc.type].Value;
|
||||
Texture2D npcTexture = (masterMode && revenge && npc.type == NPCID.SkeletronPrime) ? CalamityMod.ChadPrime.Value : TextureAssets.Npc[npc.type].Value;
|
||||
int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type];
|
||||
|
||||
npc.frame.Y = (int)newAI[3];
|
||||
@@ -7439,9 +7439,8 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
int alpha = 192;
|
||||
eyesColor = npc.type == NPCType<SkeletronPrime2>() ? new Color(150, 100, 255, alpha) : new Color(255, 255, 0, alpha);
|
||||
Texture2D glowTexture = CalamityConfig.Instance.NewVanillaTextures ? SkeletronPrime2.EyeTexture.Value : TextureAssets.BoneEyes.Value;
|
||||
for (int i = 0; i < 3; i++)
|
||||
spriteBatch.Draw(glowTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, eyesColor, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f);
|
||||
Texture2D glowTexture = npc.type == NPCID.SkeletronPrime ? CalamityMod.ChadPrimeEyeGlowmask.Value : SkeletronPrime2.EyeTexture.Value;
|
||||
spriteBatch.Draw(glowTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, eyesColor, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
else
|
||||
spriteBatch.Draw(TextureAssets.BoneEyes.Value, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, eyesColor, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f);
|
||||
|
||||
@@ -18,7 +18,6 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
{
|
||||
public class SkeletronPrime2 : ModNPC
|
||||
{
|
||||
public override string Texture => $"Terraria/Images/NPC_{NPCID.SkeletronPrime}";
|
||||
public override string BossHeadTexture => $"Terraria/Images/NPC_Head_Boss_18";
|
||||
|
||||
public static Asset<Texture2D> EyeTexture;
|
||||
@@ -30,7 +29,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
NPCID.Sets.NPCBestiaryDrawOffset.Add(Type, bestiaryData);
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
EyeTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/SkeletronPrimeHeadGlow");
|
||||
EyeTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/SkeletronPrime2HeadGlow");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,7 +214,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
// Phases
|
||||
bool phase2 = lifeRatio < 0.66f;
|
||||
bool phase3 = lifeRatio < 0.33f;
|
||||
bool spawnSpazmatism = phase3 && !bossRush && NPC.localAI[2] == 0f;
|
||||
bool spawnSpazmatism = lifeRatio < 0.5f && !bossRush && NPC.localAI[2] == 0f;
|
||||
|
||||
// Spawn Spazmatism in Master Mode (just like Oblivion from Avalon)
|
||||
if (spawnSpazmatism)
|
||||
@@ -271,6 +270,9 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
|
||||
bool normalLaserRotation = NPC.localAI[1] % 2f == 0f;
|
||||
|
||||
// Prevents cheap hits
|
||||
bool canUseAttackInMaster = NPC.position.Y < Main.player[NPC.target].position.Y - 350f;
|
||||
|
||||
// Float near player
|
||||
if (NPC.ai[1] == 0f || NPC.ai[1] == 4f)
|
||||
{
|
||||
@@ -283,7 +285,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
{
|
||||
// Start spin phase after 1.875 seconds
|
||||
NPC.ai[2] += phase3 ? 1.2f : 0.8f;
|
||||
if (NPC.ai[2] >= (90f - (death ? 60f * (1f - lifeRatio) : 0f)) && (!otherHeadChargingOrSpinning || phase3))
|
||||
if (NPC.ai[2] >= (90f - (death ? 60f * (1f - lifeRatio) : 0f)) && (!otherHeadChargingOrSpinning || phase3) && canUseAttackInMaster)
|
||||
{
|
||||
bool shouldSpinAround = NPC.ai[1] == 4f && NPC.position.Y < Main.player[NPC.target].position.Y - 400f &&
|
||||
Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) < 600f && Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 400f;
|
||||
@@ -318,9 +320,10 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
acceleration += 0.025f;
|
||||
if (!sawAlive)
|
||||
acceleration += 0.025f;
|
||||
acceleration *= 4f;
|
||||
|
||||
float topVelocity = acceleration * 100f;
|
||||
float deceleration = 0.8f;
|
||||
float deceleration = 0.7f;
|
||||
|
||||
float headDecelerationUpDist = 0f;
|
||||
float headDecelerationDownDist = 0f;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
@@ -797,7 +797,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
// Despawn
|
||||
bool oblivionWasAlive = npc.localAI[3] == 1f && !oblivionAlive;
|
||||
bool oblivionFightDespawn = (oblivionAlive && lifeRatio < 0.1f) || oblivionWasAlive;
|
||||
bool oblivionFightDespawn = (oblivionAlive && lifeRatio < 0.5f) || oblivionWasAlive;
|
||||
if (player.dead || oblivionFightDespawn)
|
||||
{
|
||||
shouldFly = false;
|
||||
|
||||
@@ -178,9 +178,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
// Phases
|
||||
bool phase2 = lifeRatio < 0.66f;
|
||||
bool spawnDestroyer = phase2 && masterMode && !bossRush && npc.localAI[2] == 0f;
|
||||
bool spawnDestroyer = lifeRatio < 0.75f && masterMode && !bossRush && npc.localAI[2] == 0f;
|
||||
bool phase3 = lifeRatio < 0.33f;
|
||||
bool spawnRetinazer = phase3 && masterMode && !bossRush && npc.localAI[2] == 1f;
|
||||
bool spawnRetinazer = lifeRatio < 0.5f && masterMode && !bossRush && npc.localAI[2] == 1f;
|
||||
|
||||
// Spawn The Destroyer in Master Mode (just like Oblivion from Avalon)
|
||||
if (spawnDestroyer)
|
||||
@@ -248,6 +248,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
bool normalLaserRotation = npc.localAI[1] % 2f == 0f;
|
||||
|
||||
// Prevents cheap hits
|
||||
bool canUseAttackInMaster = npc.position.Y < Main.player[npc.target].position.Y - 350f;
|
||||
|
||||
// Float near player
|
||||
if (npc.ai[1] == 0f || npc.ai[1] == 4f)
|
||||
{
|
||||
@@ -260,7 +263,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
{
|
||||
// Start spin phase after 1.5 seconds
|
||||
npc.ai[2] += phase3 ? 1.5f : 1f;
|
||||
if (npc.ai[2] >= (90f - (death ? 60f * (1f - lifeRatio) : 0f)) && (!otherHeadChargingOrSpinning || !masterMode || phase3))
|
||||
if (npc.ai[2] >= (90f - (death ? 60f * (1f - lifeRatio) : 0f)) && (!otherHeadChargingOrSpinning || !masterMode || phase3) && (canUseAttackInMaster || !masterMode))
|
||||
{
|
||||
bool shouldSpinAround = npc.ai[1] == 4f && npc.position.Y < Main.player[npc.target].position.Y - 400f &&
|
||||
Vector2.Distance(Main.player[npc.target].Center, npc.Center) < 600f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 400f;
|
||||
@@ -295,9 +298,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
acceleration += 0.025f;
|
||||
if (!sawAlive)
|
||||
acceleration += 0.025f;
|
||||
if (masterMode)
|
||||
acceleration *= 4f;
|
||||
|
||||
float topVelocity = acceleration * 100f;
|
||||
float deceleration = masterMode ? 0.8f : 0.85f;
|
||||
float deceleration = masterMode ? 0.7f : 0.85f;
|
||||
|
||||
float headDecelerationUpDist = 0f;
|
||||
float headDecelerationDownDist = 0f;
|
||||
@@ -831,9 +836,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
acceleration += 0.025f;
|
||||
if (!sawAlive)
|
||||
acceleration += 0.025f;
|
||||
if (masterMode)
|
||||
acceleration *= 4f;
|
||||
|
||||
float topVelocity = acceleration * 100f;
|
||||
float deceleration = masterMode ? 0.75f : 0.8f;
|
||||
float deceleration = masterMode ? 0.6f : 0.8f;
|
||||
|
||||
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y - 80f)
|
||||
{
|
||||
@@ -1154,9 +1161,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
acceleration += 0.025f;
|
||||
if (!sawAlive)
|
||||
acceleration += 0.025f;
|
||||
if (masterMode)
|
||||
acceleration *= 4f;
|
||||
|
||||
float topVelocity = acceleration * 100f;
|
||||
float deceleration = masterMode ? 0.75f : 0.8f;
|
||||
float deceleration = masterMode ? 0.6f : 0.8f;
|
||||
|
||||
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y - 130f)
|
||||
{
|
||||
@@ -1385,9 +1394,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
acceleration += 0.025f;
|
||||
if (!sawAlive)
|
||||
acceleration += 0.025f;
|
||||
if (masterMode)
|
||||
acceleration *= 4f;
|
||||
|
||||
float topVelocity = acceleration * 100f;
|
||||
float deceleration = masterMode ? 0.75f : 0.8f;
|
||||
float deceleration = masterMode ? 0.6f : 0.8f;
|
||||
|
||||
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 20f)
|
||||
{
|
||||
@@ -1466,9 +1477,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
acceleration += 0.025f;
|
||||
if (!sawAlive)
|
||||
acceleration += 0.025f;
|
||||
if (masterMode)
|
||||
acceleration *= 4f;
|
||||
|
||||
float topVelocity = acceleration * 100f;
|
||||
float deceleration = masterMode ? 0.75f : 0.8f;
|
||||
float deceleration = masterMode ? 0.6f : 0.8f;
|
||||
|
||||
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 290f)
|
||||
{
|
||||
@@ -1742,9 +1755,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
acceleration += 0.025f;
|
||||
if (!laserAlive)
|
||||
acceleration += 0.025f;
|
||||
if (masterMode)
|
||||
acceleration *= 4f;
|
||||
|
||||
float topVelocity = acceleration * 100f;
|
||||
float deceleration = masterMode ? 0.75f : 0.8f;
|
||||
float deceleration = masterMode ? 0.6f : 0.8f;
|
||||
|
||||
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 20f)
|
||||
{
|
||||
@@ -1819,9 +1834,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
acceleration += 0.025f;
|
||||
if (!laserAlive)
|
||||
acceleration += 0.025f;
|
||||
if (masterMode)
|
||||
acceleration *= 4f;
|
||||
|
||||
float topVelocity = acceleration * 100f;
|
||||
float deceleration = masterMode ? 0.75f : 0.8f;
|
||||
float deceleration = masterMode ? 0.6f : 0.8f;
|
||||
|
||||
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 310f)
|
||||
{
|
||||
@@ -1949,7 +1966,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
if (masterMode)
|
||||
acceleration *= 1.25f;
|
||||
|
||||
float deceleration = masterMode ? 0.75f : 0.8f;
|
||||
float deceleration = masterMode ? 0.6f : 0.8f;
|
||||
|
||||
if (npc.velocity.X > sawArmOtherChargeTargetX)
|
||||
{
|
||||
|
||||
@@ -140,12 +140,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
// Phase duration variables
|
||||
float phase1MaxLaserPhaseDurationDecrease = masterMode ? 120f : 300f;
|
||||
|
||||
// If Oblivion is alive, go to phase 2 at 40% HP, reduce aggression of all attacks
|
||||
// If Oblivion is alive reduce aggression of all attacks
|
||||
if (oblivionAlive)
|
||||
{
|
||||
phase2LifeRatio = 0.4f;
|
||||
finalPhaseLifeRatio = 0.1f;
|
||||
|
||||
phase1MaxSpeedIncrease = masterMode ? 1f : 2f;
|
||||
phase1MaxAccelerationIncrease = masterMode ? 0.0125f : 0.025f;
|
||||
phase1MaxChargeSpeedIncrease = masterMode ? 1.5f : 3f;
|
||||
@@ -173,7 +170,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
// Despawn
|
||||
bool oblivionWasAlive = npc.localAI[3] == 1f && !oblivionAlive;
|
||||
bool oblivionFightDespawn = (oblivionAlive && lifeRatio < 0.1f) || oblivionWasAlive;
|
||||
bool oblivionFightDespawn = (oblivionAlive && lifeRatio < 0.5f) || oblivionWasAlive;
|
||||
if (Main.player[npc.target].dead || oblivionFightDespawn)
|
||||
{
|
||||
npc.velocity.Y -= 0.04f;
|
||||
@@ -213,8 +210,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
retinazerFaceDirection = -1;
|
||||
|
||||
Vector2 retinazerPosition = npc.Center;
|
||||
float retinazerTargetX = Main.player[npc.target].Center.X + (retinazerFaceDirection * 300) - retinazerPosition.X;
|
||||
float retinazerTargetY = Main.player[npc.target].Center.Y - 300f - retinazerPosition.Y;
|
||||
float distanceFromTarget = oblivionAlive ? 450f : 300f;
|
||||
float retinazerTargetX = Main.player[npc.target].Center.X + (retinazerFaceDirection * distanceFromTarget) - retinazerPosition.X;
|
||||
float retinazerTargetY = Main.player[npc.target].Center.Y - distanceFromTarget - retinazerPosition.Y;
|
||||
|
||||
if (NPC.IsMechQueenUp)
|
||||
{
|
||||
@@ -274,7 +272,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
npc.ai[2] += 1f;
|
||||
float phaseGateValue = (masterMode ? 300f : 450f) - (death ? phase1MaxLaserPhaseDurationDecrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f);
|
||||
float laserGateValue = 30f;
|
||||
float laserGateValue = oblivionAlive ? 90f : 30f;
|
||||
if (NPC.IsMechQueenUp)
|
||||
{
|
||||
phaseGateValue = 900f;
|
||||
@@ -289,7 +287,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
|
||||
else if (npc.position.Y + npc.height < Main.player[npc.target].position.Y && retinazerTargetDistCopy < (death ? 800f : 640f))
|
||||
else if (retinazerTargetDistCopy < (death ? 960f : 800f))
|
||||
{
|
||||
if (!Main.player[npc.target].dead)
|
||||
{
|
||||
@@ -380,7 +378,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) - MathHelper.PiOver2;
|
||||
|
||||
float delayBeforeChargingAgain = (masterMode ? 48f : 56f) - (death ? (masterMode ? 3f : 6f) * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f);
|
||||
if (npc.ai[2] >= delayBeforeChargingAgain)
|
||||
if (npc.ai[2] >= delayBeforeChargingAgain + (oblivionAlive ? 15f : 0f))
|
||||
{
|
||||
npc.ai[3] += 1f;
|
||||
npc.ai[2] = 0f;
|
||||
@@ -455,7 +453,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
damage = (int)(damage * secondMechMultiplier);
|
||||
}
|
||||
|
||||
Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * 7f;
|
||||
Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * (oblivionAlive ? 6f : 7f);
|
||||
int numProj = shootLaser ? 6 : 2;
|
||||
int spread = shootLaser ? 20 : 80;
|
||||
float rotation = MathHelper.ToRadians(spread);
|
||||
@@ -544,6 +542,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
Vector2 eyePosition = npc.Center;
|
||||
float retinazerPhase2TargetX = Main.player[npc.target].Center.X - eyePosition.X;
|
||||
float distanceFromTarget = oblivionAlive ? 480f : 420f;
|
||||
float retinazerPhase2TargetY = Main.player[npc.target].Center.Y - 420f - eyePosition.Y;
|
||||
|
||||
if (NPC.IsMechQueenUp)
|
||||
@@ -620,7 +619,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
npc.localAI[1] += 1f + (death ? (phase2LifeRatio - lifeRatio) / phase2LifeRatio : 0f);
|
||||
if (npc.localAI[1] >= (spazAlive ? 52f : 26f))
|
||||
if (npc.localAI[1] >= (spazAlive ? (oblivionAlive ? 76f : 52f) : 26f))
|
||||
{
|
||||
bool canHit = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height);
|
||||
if (canHit || !spazAlive || finalPhase)
|
||||
@@ -685,7 +684,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
}
|
||||
|
||||
Vector2 retinazerPhase2RapidFirePos = npc.Center;
|
||||
float retinazerPhase2RapidFireTargetX = Main.player[npc.target].Center.X + (retinazerPhase2FaceDirection * 420f) - retinazerPhase2RapidFirePos.X;
|
||||
float distanceFromTarget = oblivionAlive ? 480f : 420f;
|
||||
float retinazerPhase2RapidFireTargetX = Main.player[npc.target].Center.X + (retinazerPhase2FaceDirection * distanceFromTarget) - retinazerPhase2RapidFirePos.X;
|
||||
float retinazerPhase2RapidFireTargetY = Main.player[npc.target].Center.Y - retinazerPhase2RapidFirePos.Y;
|
||||
float retinazerPhase2RapidFireTargetDist = (float)Math.Sqrt(retinazerPhase2RapidFireTargetX * retinazerPhase2RapidFireTargetX + retinazerPhase2RapidFireTargetY * retinazerPhase2RapidFireTargetY);
|
||||
retinazerPhase2RapidFireTargetDist = retinazerPhase2RapidFireMaxSpeed / retinazerPhase2RapidFireTargetDist;
|
||||
@@ -725,7 +725,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
npc.localAI[1] += 1f + (death ? (phase2LifeRatio - lifeRatio) / phase2LifeRatio : 0f);
|
||||
if (npc.localAI[1] > (spazAlive ? 20f : 10f))
|
||||
if (npc.localAI[1] > (spazAlive ? (oblivionAlive ? 30f : 20f) : 10f))
|
||||
{
|
||||
bool canHit = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height);
|
||||
if (canHit || !spazAlive || finalPhase)
|
||||
@@ -1120,12 +1120,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
float phase1MaxCursedFlamePhaseDurationDecrease = masterMode ? 80f : 200f;
|
||||
float phase1MaxChargesDecrease = masterMode ? 2f : 4f;
|
||||
|
||||
// If Oblivion is alive, go to phase 2 at 40% HP, reduce aggression of all attacks
|
||||
// If Oblivion is alive reduce aggression of all attacks
|
||||
if (oblivionAlive)
|
||||
{
|
||||
phase2LifeRatio = 0.4f;
|
||||
finalPhaseLifeRatio = 0.1f;
|
||||
|
||||
phase1MaxSpeedIncrease = masterMode ? 1.125f : 2.25f;
|
||||
phase1MaxAccelerationIncrease = masterMode ? 0.0375f : 0.075f;
|
||||
phase1MaxChargeSpeedIncrease = masterMode ? 1.5f : 3f;
|
||||
@@ -1154,7 +1151,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
// Despawn
|
||||
bool oblivionWasAlive = npc.localAI[3] == 1f && !oblivionAlive;
|
||||
bool oblivionFightDespawn = (oblivionAlive && lifeRatio < 0.1f) || oblivionWasAlive;
|
||||
bool oblivionFightDespawn = (oblivionAlive && lifeRatio < 0.5f) || oblivionWasAlive;
|
||||
if (Main.player[npc.target].dead || oblivionFightDespawn)
|
||||
{
|
||||
npc.velocity.Y -= 0.04f;
|
||||
@@ -1197,7 +1194,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
spazmatismFireballFaceDirection = -1;
|
||||
|
||||
Vector2 spazmatismFireballPos = npc.Center;
|
||||
float spazmatismFireballTargetX = Main.player[npc.target].Center.X + (spazmatismFireballFaceDirection * 400) - spazmatismFireballPos.X;
|
||||
float distanceFromTarget = oblivionAlive ? 480f : 400f;
|
||||
float spazmatismFireballTargetX = Main.player[npc.target].Center.X + (spazmatismFireballFaceDirection * distanceFromTarget) - spazmatismFireballPos.X;
|
||||
float spazmatismFireballTargetY = Main.player[npc.target].Center.Y - spazmatismFireballPos.Y;
|
||||
if (NPC.IsMechQueenUp)
|
||||
{
|
||||
@@ -1276,7 +1274,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
npc.ai[3] += 0.4f;
|
||||
}
|
||||
|
||||
if (npc.ai[3] >= 30f)
|
||||
if (npc.ai[3] >= (oblivionAlive ? 60f : 30f))
|
||||
{
|
||||
npc.ai[3] = 0f;
|
||||
spazmatismFireballPos = npc.Center;
|
||||
@@ -1364,7 +1362,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
// Charge 8 times
|
||||
float chargeTime = masterMode ? 45f : 25f;
|
||||
if (npc.ai[2] >= chargeTime)
|
||||
if (npc.ai[2] >= chargeTime + (oblivionAlive ? 15f : 0f))
|
||||
{
|
||||
// Reset AI array and go to cursed fireball phase
|
||||
npc.ai[3] += 1f;
|
||||
@@ -1445,7 +1443,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
damage = (int)(damage * secondMechMultiplier);
|
||||
}
|
||||
|
||||
Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * 16f + Main.rand.NextVector2CircularEdge(3f, 3f);
|
||||
Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * (oblivionAlive ? 12f : 16f) + Main.rand.NextVector2CircularEdge(3f, 3f);
|
||||
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 50f, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f);
|
||||
Main.projectile[proj].tileCollide = false;
|
||||
}
|
||||
@@ -1540,7 +1538,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
{
|
||||
// Boost speed if too far from target
|
||||
if (spazmatismFlamethrowerTargetDist > flamethrowerDistance)
|
||||
spazmatismFlamethrowerMaxSpeed += MathHelper.Lerp(0f, masterMode ? 8f : 6f, MathHelper.Clamp((spazmatismFlamethrowerTargetDist - flamethrowerDistance) / 1000f, 0f, 1f));
|
||||
spazmatismFlamethrowerMaxSpeed += MathHelper.Lerp(0f, oblivionAlive ? 3f : masterMode ? 8f : 6f, MathHelper.Clamp((spazmatismFlamethrowerTargetDist - flamethrowerDistance) / 1000f, 0f, 1f));
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
@@ -1742,7 +1740,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) - MathHelper.PiOver2;
|
||||
|
||||
// Charges 5 times
|
||||
if (npc.ai[2] >= chargeTime * 1.6f)
|
||||
if (npc.ai[2] >= (chargeTime * 1.6f) + (oblivionAlive ? 15f : 0f))
|
||||
{
|
||||
npc.ai[3] += 1f;
|
||||
npc.ai[2] = 0f;
|
||||
|
||||
@@ -355,7 +355,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) < 96f && projectile.ai[1] < homingEndTime)
|
||||
if (Vector2.Distance(projectile.Center, Main.player[num133].Center) < ((revSkeletronPrimeHomingSkull && Main.masterMode && CalamityWorld.revenge) ? 192f : 96f) && projectile.ai[1] < homingEndTime)
|
||||
projectile.ai[1] = homingEndTime;
|
||||
|
||||
if (projectile.ai[1] < homingEndTime && projectile.ai[1] > homingStartTime)
|
||||
@@ -2267,6 +2267,9 @@ namespace CalamityMod.Projectiles
|
||||
projectile.tileCollide = true;
|
||||
}
|
||||
|
||||
if (Vector2.Distance(projectile.Center, Main.player[target].Center) < 192f && projectile.ai[1] < homingEndTime)
|
||||
projectile.ai[1] = homingEndTime;
|
||||
|
||||
if (projectile.ai[1] < homingEndTime && projectile.ai[1] > homingStartTime)
|
||||
{
|
||||
float num134 = projectile.velocity.Length();
|
||||
@@ -2418,7 +2421,7 @@ namespace CalamityMod.Projectiles
|
||||
projectile.velocity = Vector2.SmoothStep(projectile.velocity, velocity, amount);
|
||||
|
||||
// Stop homing when within a certain distance of the target
|
||||
if (Vector2.Distance(projectile.Center, Main.player[playerIndex].Center) < 96f && projectile.timeLeft > homeInCutoffTime)
|
||||
if (Vector2.Distance(projectile.Center, Main.player[playerIndex].Center) < (masterMode ? 192f : 96f) && projectile.timeLeft > homeInCutoffTime)
|
||||
projectile.timeLeft = (int)homeInCutoffTime;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user