1 - Several entities now have coldDamage set to true.
2 - Several bosses are no longer capable of occassional cheap contact damage. 3 - Yharon creates a swirling fire vortex for his bullet hell instead of spinning and has various other edits.
This commit is contained in:
1 parent
91a9a08c29
commit
f3c8a06ffc
25 files changed
+711
-540
No files matched your search
@@ -182,7 +182,7 @@ namespace CalamityMod.Buffs
|
||||
break;
|
||||
|
||||
case BuffID.Warmth:
|
||||
tip += ". Immunity to the Chilled, Frozen, and Glacial State debuffs";
|
||||
tip += ". Grants immunity to Chilled, Frozen and Glacial State";
|
||||
break;
|
||||
|
||||
case BuffID.Invisibility:
|
||||
|
||||
@@ -285,7 +285,7 @@ namespace CalamityMod.Items
|
||||
// Warmth Potion provides debuff immunities
|
||||
if (item.type == ItemID.WarmthPotion)
|
||||
{
|
||||
string immunityLine = "\nMakes you immune to the Chilled, Frozen, and Glacial State debuffs";
|
||||
string immunityLine = "\nGrants immunity to Chilled, Frozen and Glacial State";
|
||||
EditTooltipByNum(0, (line) => line.Text += immunityLine);
|
||||
}
|
||||
|
||||
|
||||
+18
-3
@@ -640,6 +640,9 @@ namespace CalamityMod.NPCs
|
||||
// Center
|
||||
Vector2 vectorCenter = npc.Center;
|
||||
|
||||
// Set damage
|
||||
npc.damage = npc.defDamage;
|
||||
|
||||
// Get a target
|
||||
if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active)
|
||||
npc.TargetClosest();
|
||||
@@ -884,6 +887,9 @@ namespace CalamityMod.NPCs
|
||||
// Teleport to location
|
||||
else if (npc.ai[0] == 1f)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
npc.damage = 0;
|
||||
|
||||
npc.chaseable = true;
|
||||
Vector2 position = new Vector2(npc.ai[1] * 16f - (npc.width / 2), npc.ai[2] * 16f - (npc.height / 2));
|
||||
for (int m = 0; m < 5; m++)
|
||||
@@ -915,6 +921,9 @@ namespace CalamityMod.NPCs
|
||||
// Either teleport again or go to next AI state
|
||||
else if (npc.ai[0] == 2f)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
npc.damage = 0;
|
||||
|
||||
npc.alpha -= 50;
|
||||
if (npc.alpha <= 0)
|
||||
{
|
||||
@@ -2938,9 +2947,6 @@ namespace CalamityMod.NPCs
|
||||
// Teleport
|
||||
else if (npc.ai[0] == 5f)
|
||||
{
|
||||
// Don't deal damage
|
||||
npc.damage = 0;
|
||||
|
||||
// Slow down
|
||||
npc.velocity.X *= 0.9f;
|
||||
|
||||
@@ -3016,6 +3022,9 @@ namespace CalamityMod.NPCs
|
||||
// Mid-teleport
|
||||
else if (npc.ai[0] == 6f)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
npc.damage = 0;
|
||||
|
||||
if (death)
|
||||
npc.localAI[2] += 1f + 0.33f * (1f - lifeRatio);
|
||||
|
||||
@@ -3059,6 +3068,9 @@ namespace CalamityMod.NPCs
|
||||
// End of teleport
|
||||
else if (npc.ai[0] == 7f)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
npc.damage = 0;
|
||||
|
||||
// Turn visible
|
||||
npc.alpha -= 10;
|
||||
if (npc.alpha <= 0)
|
||||
@@ -6431,6 +6443,9 @@ namespace CalamityMod.NPCs
|
||||
// Pause before teleport
|
||||
else if (npc.ai[0] == 12f)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
npc.damage = 0;
|
||||
|
||||
// Alpha
|
||||
if (npc.alpha < 255 && npc.ai[2] >= num12 - 15f)
|
||||
{
|
||||
|
||||
@@ -2076,6 +2076,17 @@ namespace CalamityMod.NPCs
|
||||
canBreakPlayerDefense = true;
|
||||
break;
|
||||
|
||||
// Enemies that should have coldDamage set to true
|
||||
case NPCID.IceMimic:
|
||||
canBreakPlayerDefense = true;
|
||||
npc.coldDamage = true;
|
||||
break;
|
||||
|
||||
case NPCID.IceBat:
|
||||
case NPCID.IceTortoise:
|
||||
npc.coldDamage = true;
|
||||
break;
|
||||
|
||||
case NPCID.BloodSquid:
|
||||
npc.lifeMax = (int)(npc.lifeMax * 0.25);
|
||||
break;
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
NPC.boss = true;
|
||||
NPC.noGravity = true;
|
||||
NPC.noTileCollide = true;
|
||||
NPC.coldDamage = true;
|
||||
NPC.HitSound = SoundID.NPCHit5;
|
||||
NPC.DeathSound = SoundID.NPCDeath15;
|
||||
Music = CalamityMod.Instance.GetMusicFromMusicMod("Cryogen") ?? MusicID.FrostMoon;
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
AIType = -1;
|
||||
NPC.canGhostHeal = false;
|
||||
NPC.noTileCollide = true;
|
||||
NPC.coldDamage = true;
|
||||
NPC.GetNPCDamage();
|
||||
NPC.width = 216;
|
||||
NPC.height = 216;
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
AIType = -1;
|
||||
NPC.canGhostHeal = false;
|
||||
NPC.noTileCollide = true;
|
||||
NPC.coldDamage = true;
|
||||
NPC.GetNPCDamage();
|
||||
NPC.width = 100;
|
||||
NPC.height = 100;
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
NPC.lavaImmune = false;
|
||||
NPC.noGravity = false;
|
||||
NPC.noTileCollide = false;
|
||||
NPC.coldDamage = true;
|
||||
NPC.HitSound = SoundID.NPCHit1;
|
||||
NPC.DeathSound = SoundID.NPCDeath1;
|
||||
Banner = NPC.type;
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
NPC.value = Item.buyPrice(0, 0, 3, 50);
|
||||
NPC.knockBackResist = 0.75f;
|
||||
NPC.noGravity = true;
|
||||
NPC.coldDamage = true;
|
||||
NPC.HitSound = SoundID.NPCHit5;
|
||||
NPC.DeathSound = SoundID.NPCDeath15;
|
||||
NPC.Calamity().VulnerableToHeat = true;
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
NPC.value = Item.buyPrice(0, 0, 5, 0);
|
||||
NPC.knockBackResist = 0.5f;
|
||||
NPC.noGravity = true;
|
||||
NPC.coldDamage = true;
|
||||
NPC.HitSound = SoundID.NPCHit5;
|
||||
NPC.DeathSound = SoundID.NPCDeath15;
|
||||
NPC.Calamity().VulnerableToHeat = true;
|
||||
|
||||
@@ -33,7 +33,6 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
NPC.value = Item.buyPrice(0, 0, 25, 0);
|
||||
NPC.HitSound = SoundID.NPCHit5;
|
||||
NPC.DeathSound = SoundID.NPCDeath7;
|
||||
NPC.coldDamage = true;
|
||||
NPC.rarity = 2;
|
||||
Banner = NPC.type;
|
||||
BannerItem = ModContent.ItemType<IceClasperBanner>();
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
NPC.knockBackResist = 0f;
|
||||
NPC.HitSound = SoundID.NPCHit5;
|
||||
NPC.DeathSound = SoundID.NPCDeath15;
|
||||
NPC.coldDamage = true;
|
||||
NPC.Calamity().VulnerableToHeat = true;
|
||||
NPC.Calamity().VulnerableToCold = false;
|
||||
NPC.Calamity().VulnerableToSickness = false;
|
||||
|
||||
@@ -234,7 +234,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
NPC.spriteDirection = NPC.direction;
|
||||
}
|
||||
|
||||
float velocity = (malice || biomeEnraged) ? 18.5f : death ? 16.5f : revenge ? 15.5f : expertMode ? 14.5f : 12.5f;
|
||||
float velocity = (malice || biomeEnraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f;
|
||||
Vector2 targetVector = player.Center - vectorCenter;
|
||||
targetVector = Vector2.Normalize(targetVector) * velocity;
|
||||
float phaseGateValue = (malice || biomeEnraged) ? 60f : death ? 80f : revenge ? 90f : expertMode ? 100f : 120f;
|
||||
@@ -303,7 +303,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
NPC.netUpdate = true;
|
||||
Vector2 velocity = new Vector2(NPC.ai[2], NPC.ai[3]);
|
||||
velocity.Normalize();
|
||||
velocity *= (malice || biomeEnraged) ? 35f : death ? 31f : revenge ? 29f : expertMode ? 27f : 23f;
|
||||
velocity *= (malice || biomeEnraged) ? 32f : death ? 28f : revenge ? 26f : expertMode ? 24f : 20f;
|
||||
if (defenderAlive)
|
||||
velocity *= 0.8f;
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
NPC.netUpdate = true;
|
||||
Vector2 velocity = new Vector2(NPC.ai[2], NPC.ai[3]);
|
||||
velocity.Normalize();
|
||||
velocity *= (malice || biomeEnraged) ? 30f : death ? 26f : revenge ? 24f : expertMode ? 22f : 18f;
|
||||
velocity *= (malice || biomeEnraged) ? 25f : death ? 22f : revenge ? 20.5f : expertMode ? 19f : 16f;
|
||||
NPC.velocity = velocity;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,6 +242,9 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
|
||||
if (calamityGlobalNPC.newAI[3] == 1f)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
NPC.damage = 0;
|
||||
|
||||
NPC.dontTakeDamage = true;
|
||||
|
||||
NPC.rotation = NPC.velocity.X * 0.1f;
|
||||
@@ -333,6 +336,9 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
{
|
||||
if (NPC.localAI[1] == 0f)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
NPC.damage = 0;
|
||||
|
||||
// Slow down, rotation
|
||||
NPC.rotation = NPC.velocity.X * 0.1f;
|
||||
|
||||
@@ -356,6 +362,9 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
}
|
||||
else if (NPC.localAI[1] == 1f)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
NPC.damage = 0;
|
||||
|
||||
// Rotation
|
||||
NPC.rotation = NPC.velocity.X * 0.1f;
|
||||
|
||||
|
||||
@@ -344,6 +344,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
// Teleport and turn invisible
|
||||
else if (npc.ai[0] == -2f || npc.ai[0] == -8f)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
npc.damage = 0;
|
||||
|
||||
npc.velocity *= 0.9f;
|
||||
|
||||
if (Main.netMode != NetmodeID.SinglePlayer)
|
||||
@@ -368,6 +371,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
// Become visible
|
||||
else if (npc.ai[0] == -3f || npc.ai[0] == -9f)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
npc.damage = 0;
|
||||
|
||||
if (Main.netMode != NetmodeID.SinglePlayer)
|
||||
npc.ai[3] -= 15f;
|
||||
else
|
||||
@@ -409,6 +415,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
// Phase 1
|
||||
else
|
||||
{
|
||||
// Set damage
|
||||
npc.damage = npc.defDamage;
|
||||
|
||||
// Creeper count
|
||||
int creeperCount = NPC.CountNPCS(NPCID.Creeper);
|
||||
int creeperScale = GetBrainOfCthuluCreepersCountRevDeath() + 1 - creeperCount;
|
||||
@@ -500,6 +509,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
// Turn invisible and teleport
|
||||
else if (npc.ai[0] == 1f)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
npc.damage = 0;
|
||||
|
||||
npc.alpha += 25;
|
||||
if (npc.alpha >= 255)
|
||||
{
|
||||
@@ -514,6 +526,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
// Become visible
|
||||
else if (npc.ai[0] == 2f)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
npc.damage = 0;
|
||||
|
||||
npc.alpha -= 25;
|
||||
if (npc.alpha <= 0)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
@@ -808,6 +808,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
// Phase 3
|
||||
else if (npc.ai[0] == 10f && !player.dead)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
npc.damage = 0;
|
||||
|
||||
// Alpha
|
||||
if (npc.alpha < 255)
|
||||
{
|
||||
@@ -966,6 +969,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
// Pause before teleport
|
||||
else if (npc.ai[0] == 12f)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
npc.damage = 0;
|
||||
|
||||
// Alpha
|
||||
if (npc.alpha < 255)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
bool flag9 = false;
|
||||
npc.aiAction = 0;
|
||||
|
||||
// Reset damage
|
||||
npc.damage = npc.defDamage;
|
||||
|
||||
bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive;
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice;
|
||||
@@ -103,6 +106,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
// Activate teleport
|
||||
if (!Main.player[npc.target].dead && npc.ai[2] >= 300f && npc.ai[1] < 5f && npc.velocity.Y == 0f)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
npc.damage = 0;
|
||||
|
||||
npc.ai[2] = 0f;
|
||||
npc.ai[0] = 0f;
|
||||
npc.ai[1] = 5f;
|
||||
@@ -146,6 +152,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
// Teleport
|
||||
if (npc.ai[1] == 5f)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
npc.damage = 0;
|
||||
|
||||
teleporting = true;
|
||||
npc.aiAction = 1;
|
||||
npc.ai[0] += 1f;
|
||||
@@ -187,6 +196,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
// Post-teleport
|
||||
else if (npc.ai[1] == 6f)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
npc.damage = 0;
|
||||
|
||||
teleporting = true;
|
||||
npc.aiAction = 0;
|
||||
npc.ai[0] += 1f;
|
||||
|
||||
@@ -25,6 +25,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
bool phase3 = lifeRatio <= 0.35f;
|
||||
bool phase4 = lifeRatio <= 0.15f;
|
||||
|
||||
// Reset damage
|
||||
npc.damage = npc.defDamage;
|
||||
|
||||
// Spawn settings
|
||||
if (npc.localAI[0] == 0f)
|
||||
{
|
||||
@@ -55,6 +58,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
// Teleport
|
||||
if (!Main.player[npc.target].dead && npc.timeLeft > 10 && !phase2 && npc.ai[3] >= 300f && npc.ai[0] == 0f && npc.velocity.Y == 0f)
|
||||
{
|
||||
// Avoid cheap bullshit
|
||||
npc.damage = 0;
|
||||
|
||||
npc.ai[0] = 2f;
|
||||
npc.ai[1] = 0f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
@@ -185,122 +191,127 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
{
|
||||
// Phase switch phase
|
||||
case 0:
|
||||
|
||||
if (phase2)
|
||||
{
|
||||
if (phase2)
|
||||
{
|
||||
QueenSlime_FlyMovement(npc);
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.noTileCollide = false;
|
||||
npc.noGravity = false;
|
||||
if (npc.velocity.Y == 0f)
|
||||
{
|
||||
npc.velocity.X *= 0.8f;
|
||||
if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1)
|
||||
npc.velocity.X = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (npc.timeLeft <= 10 || (!phase2 && npc.velocity.Y != 0f))
|
||||
break;
|
||||
|
||||
npc.ai[1] += 1f;
|
||||
int idleTime = malice ? 20 : death ? 30 : 40;
|
||||
if (phase2)
|
||||
idleTime = malice ? 40 : death ? 60 : 80;
|
||||
if (phase4)
|
||||
idleTime /= 2;
|
||||
|
||||
if (!(npc.ai[1] > idleTime))
|
||||
break;
|
||||
|
||||
npc.ai[1] = 0f;
|
||||
if (phase2)
|
||||
{
|
||||
Player player = Main.player[npc.target];
|
||||
|
||||
switch ((int)npc.Calamity().newAI[0])
|
||||
{
|
||||
default:
|
||||
npc.ai[0] = Main.rand.NextBool() ? 6f : 5f;
|
||||
break;
|
||||
case 5:
|
||||
npc.ai[0] = phase4 ? 6f : Main.rand.NextBool() ? 4f : 6f;
|
||||
break;
|
||||
case 6:
|
||||
npc.ai[0] = phase4 ? 5f : Main.rand.NextBool() ? 5f : 4f;
|
||||
break;
|
||||
}
|
||||
|
||||
if (npc.ai[0] == 4f || npc.ai[0] == 6f)
|
||||
{
|
||||
npc.ai[2] = 1f;
|
||||
if (player != null && player.active && !player.dead && (player.Bottom.Y < npc.Bottom.Y || Math.Abs(player.Center.X - npc.Center.X) > 450f))
|
||||
{
|
||||
npc.ai[0] = 5f;
|
||||
npc.ai[2] = 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch ((int)npc.Calamity().newAI[0])
|
||||
{
|
||||
default:
|
||||
npc.ai[0] = Main.rand.NextBool() ? 5f : 4f;
|
||||
break;
|
||||
case 4:
|
||||
npc.ai[0] = Main.rand.NextBool() ? 3f : 5f;
|
||||
break;
|
||||
case 5:
|
||||
npc.ai[0] = Main.rand.NextBool() ? 4f : 3f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
npc.netUpdate = true;
|
||||
break;
|
||||
QueenSlime_FlyMovement(npc);
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.noTileCollide = false;
|
||||
npc.noGravity = false;
|
||||
if (npc.velocity.Y == 0f)
|
||||
{
|
||||
npc.velocity.X *= 0.8f;
|
||||
if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1)
|
||||
npc.velocity.X = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (npc.timeLeft <= 10 || (!phase2 && npc.velocity.Y != 0f))
|
||||
break;
|
||||
|
||||
npc.ai[1] += 1f;
|
||||
int idleTime = malice ? 20 : death ? 30 : 40;
|
||||
if (phase2)
|
||||
idleTime = malice ? 40 : death ? 60 : 80;
|
||||
if (phase4)
|
||||
idleTime /= 2;
|
||||
|
||||
if (!(npc.ai[1] > idleTime))
|
||||
break;
|
||||
|
||||
npc.ai[1] = 0f;
|
||||
if (phase2)
|
||||
{
|
||||
Player player = Main.player[npc.target];
|
||||
|
||||
switch ((int)npc.Calamity().newAI[0])
|
||||
{
|
||||
default:
|
||||
npc.ai[0] = Main.rand.NextBool() ? 6f : 5f;
|
||||
break;
|
||||
case 5:
|
||||
npc.ai[0] = phase4 ? 6f : Main.rand.NextBool() ? 4f : 6f;
|
||||
break;
|
||||
case 6:
|
||||
npc.ai[0] = phase4 ? 5f : Main.rand.NextBool() ? 5f : 4f;
|
||||
break;
|
||||
}
|
||||
|
||||
if (npc.ai[0] == 4f || npc.ai[0] == 6f)
|
||||
{
|
||||
npc.ai[2] = 1f;
|
||||
if (player != null && player.active && !player.dead && (player.Bottom.Y < npc.Bottom.Y || Math.Abs(player.Center.X - npc.Center.X) > 450f))
|
||||
{
|
||||
npc.ai[0] = 5f;
|
||||
npc.ai[2] = 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch ((int)npc.Calamity().newAI[0])
|
||||
{
|
||||
default:
|
||||
npc.ai[0] = Main.rand.NextBool() ? 5f : 4f;
|
||||
break;
|
||||
case 4:
|
||||
npc.ai[0] = Main.rand.NextBool() ? 3f : 5f;
|
||||
break;
|
||||
case 5:
|
||||
npc.ai[0] = Main.rand.NextBool() ? 4f : 3f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
npc.netUpdate = true;
|
||||
break;
|
||||
|
||||
// Enlarge after teleport
|
||||
case 1:
|
||||
|
||||
// Avoid cheap bullshit
|
||||
npc.damage = 0;
|
||||
|
||||
npc.rotation = 0f;
|
||||
npc.ai[1] += 1f;
|
||||
float teleportEndTime = malice ? 10f : death ? 15f : 20f;
|
||||
num3 = MathHelper.Clamp(npc.ai[1] / teleportEndTime, 0f, 1f);
|
||||
num3 = 0.5f + num3 * 0.5f;
|
||||
if (npc.ai[1] >= teleportEndTime && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
npc.rotation = 0f;
|
||||
npc.ai[1] += 1f;
|
||||
float teleportEndTime = malice ? 10f : death ? 15f : 20f;
|
||||
num3 = MathHelper.Clamp(npc.ai[1] / teleportEndTime, 0f, 1f);
|
||||
num3 = 0.5f + num3 * 0.5f;
|
||||
if (npc.ai[1] >= teleportEndTime && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
npc.ai[0] = 0f;
|
||||
npc.ai[1] = 0f;
|
||||
npc.netUpdate = true;
|
||||
npc.TargetClosest();
|
||||
}
|
||||
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient && npc.ai[1] >= teleportEndTime * 2f)
|
||||
{
|
||||
npc.ai[0] = 0f;
|
||||
npc.ai[1] = 0f;
|
||||
npc.TargetClosest();
|
||||
}
|
||||
|
||||
// Emit teleport dust
|
||||
Color newColor2 = NPC.AI_121_QueenSlime_GetDustColor();
|
||||
newColor2.A = 150;
|
||||
for (int num26 = 0; num26 < 10; num26++)
|
||||
{
|
||||
int num27 = Dust.NewDust(npc.position + Vector2.UnitX * -20f, npc.width + 40, npc.height, 4, npc.velocity.X, npc.velocity.Y, 50, newColor2, 1.5f);
|
||||
Main.dust[num27].noGravity = true;
|
||||
Main.dust[num27].velocity *= 2f;
|
||||
}
|
||||
|
||||
break;
|
||||
npc.ai[0] = 0f;
|
||||
npc.ai[1] = 0f;
|
||||
npc.netUpdate = true;
|
||||
npc.TargetClosest();
|
||||
}
|
||||
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient && npc.ai[1] >= teleportEndTime * 2f)
|
||||
{
|
||||
npc.ai[0] = 0f;
|
||||
npc.ai[1] = 0f;
|
||||
npc.TargetClosest();
|
||||
}
|
||||
|
||||
// Emit teleport dust
|
||||
Color newColor2 = NPC.AI_121_QueenSlime_GetDustColor();
|
||||
newColor2.A = 150;
|
||||
for (int num26 = 0; num26 < 10; num26++)
|
||||
{
|
||||
int num27 = Dust.NewDust(npc.position + Vector2.UnitX * -20f, npc.width + 40, npc.height, 4, npc.velocity.X, npc.velocity.Y, 50, newColor2, 1.5f);
|
||||
Main.dust[num27].noGravity = true;
|
||||
Main.dust[num27].velocity *= 2f;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// Shrink and spawn teleport gore and dust
|
||||
case 2:
|
||||
|
||||
// Avoid cheap bullshit
|
||||
npc.damage = 0;
|
||||
|
||||
npc.rotation = 0f;
|
||||
npc.ai[1] += 1f;
|
||||
float teleportTime = malice ? 20f : death ? 30f : 40f;
|
||||
@@ -340,6 +351,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
Main.dust[num25].velocity *= 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// She jump
|
||||
@@ -423,6 +435,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
npc.velocity.X *= malice ? 0.88f : death ? 0.9f : 0.91f;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// Slam down and create shockwave
|
||||
@@ -430,281 +443,279 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
// Release a massive eruption of crystals in phase 3 and the case is 6
|
||||
case 4:
|
||||
case 6:
|
||||
|
||||
npc.rotation *= 0.9f;
|
||||
npc.noTileCollide = true;
|
||||
npc.noGravity = true;
|
||||
|
||||
if (npc.ai[2] == 1f)
|
||||
{
|
||||
npc.rotation *= 0.9f;
|
||||
npc.noTileCollide = true;
|
||||
npc.noGravity = true;
|
||||
npc.noTileCollide = false;
|
||||
npc.noGravity = false;
|
||||
|
||||
if (npc.ai[2] == 1f)
|
||||
{
|
||||
npc.noTileCollide = false;
|
||||
npc.noGravity = false;
|
||||
int num20 = 30;
|
||||
if (phase2)
|
||||
num20 = 10;
|
||||
|
||||
int num20 = 30;
|
||||
if (phase2)
|
||||
num20 = 10;
|
||||
if (Main.getGoodWorld)
|
||||
num20 = 0;
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
num20 = 0;
|
||||
|
||||
if (npc.velocity.Y == 0f)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item167, npc.Center);
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int type = ProjectileID.QueenSlimeSmash;
|
||||
int damage = npc.GetProjectileDamage(type);
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Bottom, Vector2.Zero, type, damage, 0f, Main.myPlayer);
|
||||
|
||||
// Eruption of crystals in phase 3
|
||||
if (npc.ai[0] == 6f && phase3)
|
||||
{
|
||||
float projectileVelocity = 12f;
|
||||
type = ProjectileID.QueenSlimeMinionBlueSpike;
|
||||
damage = npc.GetProjectileDamage(type);
|
||||
Vector2 destination = new Vector2(npc.Center.X, npc.Center.Y - 100f) - npc.Center;
|
||||
destination.Normalize();
|
||||
destination *= projectileVelocity;
|
||||
int numProj = 18;
|
||||
float rotation = MathHelper.ToRadians(90);
|
||||
for (int i = 0; i < numProj; i++)
|
||||
{
|
||||
Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1)));
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, 0f, Main.myPlayer, 0f, -2f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int l = 0; l < 20; l++)
|
||||
{
|
||||
int num21 = Dust.NewDust(npc.Bottom - new Vector2(npc.width / 2, 30f), npc.width, 30, 31, npc.velocity.X, npc.velocity.Y, 40, NPC.AI_121_QueenSlime_GetDustColor());
|
||||
Main.dust[num21].noGravity = true;
|
||||
Main.dust[num21].velocity.Y = -5f + Main.rand.NextFloat() * -3f;
|
||||
Main.dust[num21].velocity.X *= 7f;
|
||||
}
|
||||
|
||||
npc.Calamity().newAI[0] = npc.ai[0];
|
||||
npc.SyncExtraAI();
|
||||
npc.ai[0] = 0f;
|
||||
npc.ai[1] = 0f;
|
||||
npc.ai[2] = 0f;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
else if (npc.ai[1] >= num20)
|
||||
{
|
||||
for (int m = 0; m < 4; m++)
|
||||
{
|
||||
Vector2 position = npc.Bottom - new Vector2(Main.rand.NextFloatDirection() * 16f, Main.rand.Next(8));
|
||||
int num22 = Dust.NewDust(position, 2, 2, 31, npc.velocity.X, npc.velocity.Y, 40, NPC.AI_121_QueenSlime_GetDustColor(), 1.4f);
|
||||
Main.dust[num22].position = position;
|
||||
Main.dust[num22].noGravity = true;
|
||||
Main.dust[num22].velocity.Y = npc.velocity.Y * 0.9f;
|
||||
Main.dust[num22].velocity.X = ((Main.rand.Next(2) == 0) ? (-10f) : 10f) + Main.rand.NextFloatDirection() * 3f;
|
||||
}
|
||||
}
|
||||
|
||||
npc.velocity.X *= 0.8f;
|
||||
float num23 = npc.ai[1];
|
||||
npc.ai[1] += 1f;
|
||||
if (npc.ai[1] >= num20)
|
||||
{
|
||||
if (num23 < num20)
|
||||
npc.netUpdate = true;
|
||||
|
||||
if (phase2 && npc.ai[1] > (num20 + 120))
|
||||
{
|
||||
npc.Calamity().newAI[0] = npc.ai[0];
|
||||
npc.SyncExtraAI();
|
||||
npc.ai[0] = 0f;
|
||||
npc.ai[1] = 0f;
|
||||
npc.ai[2] = 0f;
|
||||
npc.velocity.Y *= 0.8f;
|
||||
npc.netUpdate = true;
|
||||
break;
|
||||
}
|
||||
|
||||
npc.velocity.Y += malice ? 2f : death ? 1.75f : 1.5f;
|
||||
float num24 = malice ? 15.99f : death ? 15.5f : 15f;
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
npc.velocity.Y += 1f;
|
||||
num24 = 15.99f;
|
||||
}
|
||||
|
||||
if (npc.velocity.Y == 0f)
|
||||
npc.velocity.Y = 0.01f;
|
||||
|
||||
if (npc.velocity.Y >= num24)
|
||||
npc.velocity.Y = num24;
|
||||
|
||||
// Cascade of crystals in phase 3 or 4 while falling down
|
||||
if (((npc.ai[0] == 4f && phase3) || phase4) && npc.ai[1] % 12f == 0f)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item154, npc.Center);
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
Vector2 fireFrom = npc.Center;
|
||||
int projectileAmt = 2;
|
||||
int type = ProjectileID.QueenSlimeMinionBlueSpike;
|
||||
int damage = npc.GetProjectileDamage(type);
|
||||
for (int i = 0; i < projectileAmt; i++)
|
||||
{
|
||||
int totalProjectiles = 2;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
for (int j = 0; j < totalProjectiles; j++)
|
||||
{
|
||||
Vector2 projVelocity = npc.velocity.RotatedBy(radians * j + MathHelper.PiOver2);
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), fireFrom, projVelocity, type, damage, 0f, Main.myPlayer, 0f, -1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
npc.velocity.Y *= 0.8f;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[1] == 0f)
|
||||
{
|
||||
npc.TargetClosest();
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
|
||||
npc.ai[1] += 1f;
|
||||
if (!(npc.ai[1] >= 30f))
|
||||
break;
|
||||
|
||||
if (npc.ai[1] >= 60f)
|
||||
{
|
||||
npc.ai[1] = 60f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
npc.ai[1] = 0f;
|
||||
npc.ai[2] = 1f;
|
||||
npc.velocity.Y = -3f;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
Player player3 = Main.player[npc.target];
|
||||
Vector2 center = npc.Center;
|
||||
if (!player3.dead && player3.active && Math.Abs(npc.Center.X - player3.Center.X) / 16f <= despawnDistanceInTiles)
|
||||
center = player3.Center;
|
||||
|
||||
center.Y -= 384f;
|
||||
if (npc.velocity.Y == 0f)
|
||||
{
|
||||
npc.velocity = center - npc.Center;
|
||||
npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero);
|
||||
npc.velocity *= malice ? 30f : death ? 26f : 24f;
|
||||
}
|
||||
else
|
||||
npc.velocity.Y *= 0.95f;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Fire spread of gel projectiles
|
||||
case 5:
|
||||
{
|
||||
npc.rotation *= 0.9f;
|
||||
npc.noTileCollide = true;
|
||||
npc.noGravity = true;
|
||||
|
||||
if (phase2)
|
||||
npc.ai[3] = 0f;
|
||||
|
||||
if (npc.ai[2] == 1f)
|
||||
{
|
||||
npc.ai[1] += 1f;
|
||||
if (!(npc.ai[1] >= 10f))
|
||||
break;
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Item167, npc.Center);
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int numGelProjectiles = phase4 ? Main.rand.Next(9, 12) : phase2 ? Main.rand.Next(6, 9) : 12;
|
||||
if (Main.getGoodWorld)
|
||||
numGelProjectiles = 15;
|
||||
|
||||
float projectileVelocity = death ? 12f : 10.5f;
|
||||
int type = ProjectileID.QueenSlimeGelAttack;
|
||||
int type = ProjectileID.QueenSlimeSmash;
|
||||
int damage = npc.GetProjectileDamage(type);
|
||||
if (phase2)
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Bottom, Vector2.Zero, type, damage, 0f, Main.myPlayer);
|
||||
|
||||
// Eruption of crystals in phase 3
|
||||
if (npc.ai[0] == 6f && phase3)
|
||||
{
|
||||
Vector2 destination = new Vector2(npc.Center.X, npc.Center.Y + 100f) - npc.Center;
|
||||
float projectileVelocity = 12f;
|
||||
type = ProjectileID.QueenSlimeMinionBlueSpike;
|
||||
damage = npc.GetProjectileDamage(type);
|
||||
Vector2 destination = new Vector2(npc.Center.X, npc.Center.Y - 100f) - npc.Center;
|
||||
destination.Normalize();
|
||||
destination *= projectileVelocity;
|
||||
float rotation = MathHelper.ToRadians(120);
|
||||
for (int i = 0; i < numGelProjectiles; i++)
|
||||
int numProj = 18;
|
||||
float rotation = MathHelper.ToRadians(90);
|
||||
for (int i = 0; i < numProj; i++)
|
||||
{
|
||||
Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numGelProjectiles - 1)));
|
||||
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, 0f, Main.myPlayer, 0f, -2f);
|
||||
Main.projectile[proj].timeLeft = 900;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int j = 0; j < numGelProjectiles; j++)
|
||||
{
|
||||
Vector2 spinningpoint = new Vector2(projectileVelocity, 0f);
|
||||
spinningpoint = spinningpoint.RotatedBy((-j) * ((float)Math.PI * 2f) / numGelProjectiles, Vector2.Zero);
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, spinningpoint.X, spinningpoint.Y, type, damage, 0f, Main.myPlayer, 0f, -1f);
|
||||
Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1)));
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, 0f, Main.myPlayer, 0f, -2f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Item155, npc.Center);
|
||||
for (int l = 0; l < 20; l++)
|
||||
{
|
||||
int num21 = Dust.NewDust(npc.Bottom - new Vector2(npc.width / 2, 30f), npc.width, 30, 31, npc.velocity.X, npc.velocity.Y, 40, NPC.AI_121_QueenSlime_GetDustColor());
|
||||
Main.dust[num21].noGravity = true;
|
||||
Main.dust[num21].velocity.Y = -5f + Main.rand.NextFloat() * -3f;
|
||||
Main.dust[num21].velocity.X *= 7f;
|
||||
}
|
||||
|
||||
npc.Calamity().newAI[0] = npc.ai[0];
|
||||
npc.SyncExtraAI();
|
||||
npc.ai[0] = 0f;
|
||||
npc.ai[1] = 0f;
|
||||
npc.ai[2] = 0f;
|
||||
npc.netUpdate = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[1] == 0f)
|
||||
else if (npc.ai[1] >= num20)
|
||||
{
|
||||
npc.TargetClosest();
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
|
||||
npc.ai[1] += 1f;
|
||||
if (npc.ai[1] >= 50f)
|
||||
{
|
||||
npc.ai[1] = 50f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
for (int m = 0; m < 4; m++)
|
||||
{
|
||||
npc.ai[1] = 0f;
|
||||
npc.ai[2] = 1f;
|
||||
npc.netUpdate = true;
|
||||
Vector2 position = npc.Bottom - new Vector2(Main.rand.NextFloatDirection() * 16f, Main.rand.Next(8));
|
||||
int num22 = Dust.NewDust(position, 2, 2, 31, npc.velocity.X, npc.velocity.Y, 40, NPC.AI_121_QueenSlime_GetDustColor(), 1.4f);
|
||||
Main.dust[num22].position = position;
|
||||
Main.dust[num22].noGravity = true;
|
||||
Main.dust[num22].velocity.Y = npc.velocity.Y * 0.9f;
|
||||
Main.dust[num22].velocity.X = ((Main.rand.Next(2) == 0) ? (-10f) : 10f) + Main.rand.NextFloatDirection() * 3f;
|
||||
}
|
||||
}
|
||||
|
||||
float num16 = 100f;
|
||||
for (int k = 0; k < 4; k++)
|
||||
npc.velocity.X *= 0.8f;
|
||||
float num23 = npc.ai[1];
|
||||
npc.ai[1] += 1f;
|
||||
if (npc.ai[1] >= num20)
|
||||
{
|
||||
Vector2 vector2 = npc.Center + Main.rand.NextVector2CircularEdge(num16, num16);
|
||||
if (!phase2)
|
||||
vector2 += new Vector2(0f, 20f);
|
||||
if (num23 < num20)
|
||||
npc.netUpdate = true;
|
||||
|
||||
Vector2 v = vector2 - npc.Center;
|
||||
v = v.SafeNormalize(Vector2.Zero) * -8f;
|
||||
int num17 = Dust.NewDust(vector2, 2, 2, 31, v.X, v.Y, 40, NPC.AI_121_QueenSlime_GetDustColor(), 1.8f);
|
||||
Main.dust[num17].position = vector2;
|
||||
Main.dust[num17].noGravity = true;
|
||||
Main.dust[num17].alpha = 250;
|
||||
Main.dust[num17].velocity = v;
|
||||
Main.dust[num17].customData = npc;
|
||||
if (phase2 && npc.ai[1] > (num20 + 120))
|
||||
{
|
||||
npc.Calamity().newAI[0] = npc.ai[0];
|
||||
npc.SyncExtraAI();
|
||||
npc.ai[0] = 0f;
|
||||
npc.ai[1] = 0f;
|
||||
npc.ai[2] = 0f;
|
||||
npc.velocity.Y *= 0.8f;
|
||||
npc.netUpdate = true;
|
||||
break;
|
||||
}
|
||||
|
||||
npc.velocity.Y += malice ? 2f : death ? 1.75f : 1.5f;
|
||||
float num24 = malice ? 15.99f : death ? 15.5f : 15f;
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
npc.velocity.Y += 1f;
|
||||
num24 = 15.99f;
|
||||
}
|
||||
|
||||
if (npc.velocity.Y == 0f)
|
||||
npc.velocity.Y = 0.01f;
|
||||
|
||||
if (npc.velocity.Y >= num24)
|
||||
npc.velocity.Y = num24;
|
||||
|
||||
// Cascade of crystals in phase 3 or 4 while falling down
|
||||
if (((npc.ai[0] == 4f && phase3) || phase4) && npc.ai[1] % 12f == 0f)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item154, npc.Center);
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
Vector2 fireFrom = npc.Center;
|
||||
int projectileAmt = 2;
|
||||
int type = ProjectileID.QueenSlimeMinionBlueSpike;
|
||||
int damage = npc.GetProjectileDamage(type);
|
||||
for (int i = 0; i < projectileAmt; i++)
|
||||
{
|
||||
int totalProjectiles = 2;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
for (int j = 0; j < totalProjectiles; j++)
|
||||
{
|
||||
Vector2 projVelocity = npc.velocity.RotatedBy(radians * j + MathHelper.PiOver2);
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), fireFrom, projVelocity, type, damage, 0f, Main.myPlayer, 0f, -1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (phase2)
|
||||
QueenSlime_FlyMovement(npc);
|
||||
else
|
||||
npc.velocity.Y *= 0.8f;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[1] == 0f)
|
||||
{
|
||||
npc.TargetClosest();
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
|
||||
npc.ai[1] += 1f;
|
||||
if (!(npc.ai[1] >= 30f))
|
||||
break;
|
||||
|
||||
if (npc.ai[1] >= 60f)
|
||||
{
|
||||
npc.ai[1] = 60f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
npc.ai[1] = 0f;
|
||||
npc.ai[2] = 1f;
|
||||
npc.velocity.Y = -3f;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
Player player3 = Main.player[npc.target];
|
||||
Vector2 center = npc.Center;
|
||||
if (!player3.dead && player3.active && Math.Abs(npc.Center.X - player3.Center.X) / 16f <= despawnDistanceInTiles)
|
||||
center = player3.Center;
|
||||
|
||||
center.Y -= 384f;
|
||||
if (npc.velocity.Y == 0f)
|
||||
{
|
||||
npc.velocity = center - npc.Center;
|
||||
npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero);
|
||||
npc.velocity *= malice ? 30f : death ? 26f : 24f;
|
||||
}
|
||||
else
|
||||
npc.velocity.Y *= 0.95f;
|
||||
|
||||
break;
|
||||
|
||||
// Fire spread of gel projectiles
|
||||
case 5:
|
||||
|
||||
npc.rotation *= 0.9f;
|
||||
npc.noTileCollide = true;
|
||||
npc.noGravity = true;
|
||||
|
||||
if (phase2)
|
||||
npc.ai[3] = 0f;
|
||||
|
||||
if (npc.ai[2] == 1f)
|
||||
{
|
||||
npc.ai[1] += 1f;
|
||||
if (!(npc.ai[1] >= 10f))
|
||||
break;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int numGelProjectiles = phase4 ? Main.rand.Next(9, 12) : phase2 ? Main.rand.Next(6, 9) : 12;
|
||||
if (Main.getGoodWorld)
|
||||
numGelProjectiles = 15;
|
||||
|
||||
float projectileVelocity = death ? 12f : 10.5f;
|
||||
int type = ProjectileID.QueenSlimeGelAttack;
|
||||
int damage = npc.GetProjectileDamage(type);
|
||||
if (phase2)
|
||||
{
|
||||
Vector2 destination = new Vector2(npc.Center.X, npc.Center.Y + 100f) - npc.Center;
|
||||
destination.Normalize();
|
||||
destination *= projectileVelocity;
|
||||
float rotation = MathHelper.ToRadians(120);
|
||||
for (int i = 0; i < numGelProjectiles; i++)
|
||||
{
|
||||
Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numGelProjectiles - 1)));
|
||||
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, 0f, Main.myPlayer, 0f, -2f);
|
||||
Main.projectile[proj].timeLeft = 900;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int j = 0; j < numGelProjectiles; j++)
|
||||
{
|
||||
Vector2 spinningpoint = new Vector2(projectileVelocity, 0f);
|
||||
spinningpoint = spinningpoint.RotatedBy((-j) * ((float)Math.PI * 2f) / numGelProjectiles, Vector2.Zero);
|
||||
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, spinningpoint.X, spinningpoint.Y, type, damage, 0f, Main.myPlayer, 0f, -1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Item155, npc.Center);
|
||||
npc.Calamity().newAI[0] = npc.ai[0];
|
||||
npc.SyncExtraAI();
|
||||
npc.ai[0] = 0f;
|
||||
npc.ai[1] = 0f;
|
||||
npc.ai[2] = 0f;
|
||||
npc.netUpdate = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[1] == 0f)
|
||||
{
|
||||
npc.TargetClosest();
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
|
||||
npc.ai[1] += 1f;
|
||||
if (npc.ai[1] >= 50f)
|
||||
{
|
||||
npc.ai[1] = 50f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
npc.ai[1] = 0f;
|
||||
npc.ai[2] = 1f;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
float num16 = 100f;
|
||||
for (int k = 0; k < 4; k++)
|
||||
{
|
||||
Vector2 vector2 = npc.Center + Main.rand.NextVector2CircularEdge(num16, num16);
|
||||
if (!phase2)
|
||||
vector2 += new Vector2(0f, 20f);
|
||||
|
||||
Vector2 v = vector2 - npc.Center;
|
||||
v = v.SafeNormalize(Vector2.Zero) * -8f;
|
||||
int num17 = Dust.NewDust(vector2, 2, 2, 31, v.X, v.Y, 40, NPC.AI_121_QueenSlime_GetDustColor(), 1.8f);
|
||||
Main.dust[num17].position = vector2;
|
||||
Main.dust[num17].noGravity = true;
|
||||
Main.dust[num17].alpha = 250;
|
||||
Main.dust[num17].velocity = v;
|
||||
Main.dust[num17].customData = npc;
|
||||
}
|
||||
|
||||
if (phase2)
|
||||
QueenSlime_FlyMovement(npc);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Don't take damage while teleporting
|
||||
|
||||
+195
-183
File diff suppressed because it is too large.
Load diff
@@ -21,6 +21,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Projectile.height = 10;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.hostile = true;
|
||||
Projectile.coldDamage = true;
|
||||
Projectile.timeLeft = 300;
|
||||
Projectile.Calamity().affectedByMaliceModeVelocityMultiplier = true;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Projectile.height = 30;
|
||||
Projectile.scale = 0.5f;
|
||||
Projectile.hostile = true;
|
||||
Projectile.coldDamage = true;
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.timeLeft = 300;
|
||||
Projectile.Calamity().affectedByMaliceModeVelocityMultiplier = true;
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Projectile.width = 10;
|
||||
Projectile.height = 10;
|
||||
Projectile.hostile = true;
|
||||
Projectile.coldDamage = true;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.timeLeft = 300;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Projectile.hostile = true;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.coldDamage = true;
|
||||
Projectile.alpha = 255;
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.timeLeft = 300;
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using CalamityMod.NPCs.Yharon;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
public class YharonBulletHellVortex : ModProjectile
|
||||
{
|
||||
public ref float TimeCountdown => ref Projectile.ai[0];
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Bullet Hell Vortex");
|
||||
ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 408;
|
||||
Projectile.height = 408;
|
||||
Projectile.scale = 0.05f;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.alpha = 255;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Main.npc[(int)Projectile.ai[1]].active && Main.npc[(int)Projectile.ai[1]].type == ModContent.NPCType<Yharon>())
|
||||
{
|
||||
if (TimeCountdown > 0f)
|
||||
{
|
||||
if (TimeCountdown > 140f)
|
||||
Projectile.scale = MathHelper.Clamp(Projectile.scale + 0.05f, 0f, 1f);
|
||||
if (TimeCountdown < 25f)
|
||||
Projectile.scale = MathHelper.Clamp(Projectile.scale - 0.05f, 0f, 1f);
|
||||
TimeCountdown--;
|
||||
}
|
||||
else
|
||||
Projectile.Kill();
|
||||
}
|
||||
else
|
||||
Projectile.Kill();
|
||||
}
|
||||
|
||||
internal Color ColorFunction(float completionRatio) => Color.Lerp(Color.Yellow, Color.Yellow, completionRatio);
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
Texture2D vortexTexture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/OldDukeVortex").Value;
|
||||
for (int i = 0; i < 110; i++)
|
||||
{
|
||||
float angle = MathHelper.TwoPi * i / 50f + Main.GlobalTimeWrappedHourly * MathHelper.TwoPi;
|
||||
Color drawColor = Color.White * 0.04f;
|
||||
drawColor.A = 0;
|
||||
Vector2 drawPosition = Projectile.Center;
|
||||
|
||||
drawPosition += (angle + Main.GlobalTimeWrappedHourly * i / 16f).ToRotationVector2() * 6f;
|
||||
Main.EntitySpriteDraw(vortexTexture, drawPosition, null, drawColor, angle + MathHelper.PiOver2, vortexTexture.Size() * 0.5f, Projectile.scale, SpriteEffects.None, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user