Merge branch '1.4' of https://github.com/CalamityTeam/CalamityMod into 1.4
This commit is contained in:
commit
d244d231a8
14 files changed
+57
-57
No files matched your search
@@ -59,7 +59,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num790 += Main.rand.Next(-npc.width, npc.width);
|
||||
num791 += Main.rand.Next(-npc.height, npc.height);
|
||||
|
||||
int num792 = NPC.NewNPC((int)num790, (int)num791, NPCID.Creeper, 0, 0f, 0f, 0f, 0f, 255);
|
||||
int num792 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)num790, (int)num791, NPCID.Creeper, 0, 0f, 0f, 0f, 0f, 255);
|
||||
Main.npc[num792].velocity = new Vector2(Main.rand.Next(-30, 31) * 0.1f, Main.rand.Next(-30, 31) * 0.1f);
|
||||
Main.npc[num792].netUpdate = true;
|
||||
}
|
||||
|
||||
@@ -649,7 +649,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
Vector2 vector11 = npc.Center + spinningpoint.RotatedBy(num36 * MathHelper.TwoPi / num31 - MathHelper.PiOver2);
|
||||
if (num35-- > 0)
|
||||
{
|
||||
int num37 = NPC.NewNPC((int)vector11.X, (int)vector11.Y + npc.height / 2, NPCID.CultistBossClone, npc.whoAmI);
|
||||
int num37 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector11.X, (int)vector11.Y + npc.height / 2, NPCID.CultistBossClone, npc.whoAmI);
|
||||
Main.npc[num37].ai[3] = npc.whoAmI;
|
||||
Main.npc[num37].netUpdate = true;
|
||||
Main.npc[num37].localAI[1] = npc.localAI[1];
|
||||
@@ -843,7 +843,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
Vector2 vector19 = vec4 * scaleFactor;
|
||||
vector19 = vector19.RotatedBy(num48 * num49 - (1.2566371f - num48) / 2f);
|
||||
float ai = (Main.rand.NextFloat() - 0.5f) * 0.3f * MathHelper.TwoPi / 60f;
|
||||
int num50 = NPC.NewNPC((int)vector18.X, (int)vector18.Y + 7, NPCID.AncientLight, 0, 0f, ai, vector19.X, vector19.Y, 255);
|
||||
int num50 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector18.X, (int)vector18.Y + 7, NPCID.AncientLight, 0, 0f, ai, vector19.X, vector19.Y, 255);
|
||||
Main.npc[num50].velocity = vector19;
|
||||
num49++;
|
||||
}
|
||||
@@ -891,7 +891,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
for (int i = 0; i < ancientDoomLimit; i++)
|
||||
{
|
||||
float ai2 = i * 120;
|
||||
NPC.NewNPC((int)(player.Center.X + (float)(Math.Sin(i * 120) * 550)), (int)(player.Center.Y + (float)(Math.Cos(i * 120) * 550)),
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(player.Center.X + (float)(Math.Sin(i * 120) * 550)), (int)(player.Center.Y + (float)(Math.Cos(i * 120) * 550)),
|
||||
NPCID.AncientDoom, 0, npc.whoAmI, 0f, ai2, 0f, Main.maxPlayers);
|
||||
}
|
||||
}
|
||||
@@ -915,7 +915,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num59++;
|
||||
int num60 = Main.rand.Next(point2.X - num55, point2.X + num55 + 1);
|
||||
int num61 = Main.rand.Next(point2.Y - num55, point2.Y + num55 + 1);
|
||||
if ((num61 < point2.Y - num57 || num61 > point2.Y + num57 || num60 < point2.X - num57 || num60 > point2.X + num57) && (num61 < point.Y - num56 || num61 > point.Y + num56 || num60 < point.X - num56 || num60 > point.X + num56) && !Main.tile[num60, num61].nactive())
|
||||
if ((num61 < point2.Y - num57 || num61 > point2.Y + num57 || num60 < point2.X - num57 || num60 > point2.X + num57) && (num61 < point.Y - num56 || num61 > point.Y + num56 || num60 < point.X - num56 || num60 > point.X + num56) && !Main.tile[num60, num61].IsActuated)
|
||||
{
|
||||
bool flag7 = true;
|
||||
if (flag7 && Collision.SolidTiles(num60 - num58, num60 + num58, num61 - num58, num61 + num58))
|
||||
@@ -923,7 +923,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
|
||||
if (flag7)
|
||||
{
|
||||
NPC.NewNPC(num60 * 16 + 8, num61 * 16 + 8, NPCID.AncientDoom, 0, npc.whoAmI);
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), num60 * 16 + 8, num61 * 16 + 8, NPCID.AncientDoom, 0, npc.whoAmI);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (j == totalSegments)
|
||||
type = NPCID.TheDestroyerTail;
|
||||
|
||||
int segment = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + npc.height), type, npc.whoAmI);
|
||||
int segment = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + npc.height), type, npc.whoAmI);
|
||||
Main.npc[segment].ai[3] = npc.whoAmI;
|
||||
Main.npc[segment].realLife = npc.whoAmI;
|
||||
Main.npc[segment].ai[1] = index;
|
||||
@@ -290,7 +290,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
{
|
||||
for (int l = num14; l < num15; l++)
|
||||
{
|
||||
if (Main.tile[k, l] != null && ((Main.tile[k, l].nactive() && (Main.tileSolid[Main.tile[k, l].TileType] || (Main.tileSolidTop[Main.tile[k, l].TileType] && Main.tile[k, l].TileFrameY == 0))) || Main.tile[k, l].LiquidAmount > 64))
|
||||
if (Main.tile[k, l] != null && ((Main.tile[k, l].IsActuated && (Main.tileSolid[Main.tile[k, l].TileType] || (Main.tileSolidTop[Main.tile[k, l].TileType] && Main.tile[k, l].TileFrameY == 0))) || Main.tile[k, l].LiquidAmount > 64))
|
||||
{
|
||||
Vector2 vector2;
|
||||
vector2.X = k * 16;
|
||||
|
||||
@@ -459,7 +459,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
Vector2 vector6 = Vector2.Normalize(player.Center - vector) * (npc.width + 20) / 2f + vector;
|
||||
NPC.NewNPC((int)vector6.X, (int)vector6.Y + 45, NPCID.DetonatingBubble);
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector6.X, (int)vector6.Y + 45, NPCID.DetonatingBubble);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -708,7 +708,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
Vector2 vector10 = Vector2.Normalize(npc.velocity) * (npc.width + 20) / 2f + vector;
|
||||
int num31 = NPC.NewNPC((int)vector10.X, (int)vector10.Y + 45, NPCID.DetonatingBubble);
|
||||
int num31 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector10.X, (int)vector10.Y + 45, NPCID.DetonatingBubble);
|
||||
Main.npc[num31].target = npc.target;
|
||||
Main.npc[num31].velocity = Vector2.Normalize(npc.velocity).RotatedBy(MathHelper.PiOver2 * npc.direction) * bubbleSpinBubbleVelocity;
|
||||
Main.npc[num31].netUpdate = true;
|
||||
@@ -716,7 +716,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
|
||||
if (npc.ai[2] % (bubbleSpinPhaseDivisor * 5) == 0f)
|
||||
{
|
||||
int npc2 = NPC.NewNPC((int)vector10.X, (int)vector10.Y + 45, NPCID.Sharkron2);
|
||||
int npc2 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector10.X, (int)vector10.Y + 45, NPCID.Sharkron2);
|
||||
Main.npc[npc2].ai[1] = 89f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
{
|
||||
npc.TargetClosest();
|
||||
if (Collision.CanHitLine(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1))
|
||||
NPC.NewNPC((int)(npc.position.X + (npc.width / 2) + npc.velocity.X), (int)(npc.position.Y + (npc.height / 2) + npc.velocity.Y), NPCID.VileSpit, 0, 0f, 1f, 0f, 0f, 255);
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2) + npc.velocity.X), (int)(npc.position.Y + (npc.height / 2) + npc.velocity.Y), NPCID.VileSpit, 0, 0f, 1f, 0f, 0f, 255);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,16 +142,16 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
npc.ai[2] = totalSegments;
|
||||
|
||||
// Body spawn
|
||||
npc.ai[0] = NPC.NewNPC(spawnX, spawnY, NPCID.EaterofWorldsBody, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
npc.ai[0] = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), spawnX, spawnY, NPCID.EaterofWorldsBody, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
}
|
||||
|
||||
// A body with a "length beyond this point" greater than zero just sets its next spawned segment to a freshly spawned body.
|
||||
else if (npc.type == NPCID.EaterofWorldsBody && npc.ai[2] > 0f)
|
||||
npc.ai[0] = NPC.NewNPC(spawnX, spawnY, NPCID.EaterofWorldsBody, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
npc.ai[0] = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), spawnX, spawnY, NPCID.EaterofWorldsBody, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
|
||||
// If the worm stops here ("length beyond this point" is zero), then spawn a tail instead.
|
||||
else
|
||||
npc.ai[0] = NPC.NewNPC(spawnX, spawnY, NPCID.EaterofWorldsTail, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
npc.ai[0] = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), spawnX, spawnY, NPCID.EaterofWorldsTail, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
|
||||
// Maintain the linked list of worm segments, and correctly set the "length beyond this point" of this segment.
|
||||
Main.npc[(int)npc.ai[0]].ai[1] = npc.whoAmI;
|
||||
@@ -250,7 +250,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
{
|
||||
for (int num34 = num31; num34 < num32; num34++)
|
||||
{
|
||||
if (Main.tile[num33, num34] != null && ((Main.tile[num33, num34].nactive() && (Main.tileSolid[Main.tile[num33, num34].TileType] || (Main.tileSolidTop[Main.tile[num33, num34].TileType] && Main.tile[num33, num34].TileFrameY == 0))) || Main.tile[num33, num34].LiquidAmount > 64))
|
||||
if (Main.tile[num33, num34] != null && ((Main.tile[num33, num34].IsActuated && (Main.tileSolid[Main.tile[num33, num34].TileType] || (Main.tileSolidTop[Main.tile[num33, num34].TileType] && Main.tile[num33, num34].TileFrameY == 0))) || Main.tile[num33, num34].LiquidAmount > 64))
|
||||
{
|
||||
Vector2 vector;
|
||||
vector.X = num33 * 16;
|
||||
@@ -258,7 +258,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (npc.position.X + npc.width > vector.X && npc.position.X < vector.X + 16f && npc.position.Y + npc.height > vector.Y && npc.position.Y < vector.Y + 16f)
|
||||
{
|
||||
inTiles = true;
|
||||
if (Main.rand.NextBool(100) && Main.tile[num33, num34].nactive())
|
||||
if (Main.rand.NextBool(100) && Main.tile[num33, num34].IsActuated)
|
||||
{
|
||||
WorldGen.KillTile(num33, num34, true, true, false);
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
Vector2 servantSpawnCenter = npc.Center + servantSpawnVelocity * 10f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(NPCID.ServantofCthulhu) < 12)
|
||||
{
|
||||
int num23 = NPC.NewNPC((int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, 0f, 0f, 255);
|
||||
int num23 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, 0f, 0f, 255);
|
||||
Main.npc[num23].velocity = servantSpawnVelocity;
|
||||
|
||||
if (Main.netMode == NetmodeID.Server && num23 < Main.maxNPCs)
|
||||
@@ -259,7 +259,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
Vector2 servantSpawnCenter = npc.Center + servantSpawnVelocity * 10f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int num34 = NPC.NewNPC((int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, 0f, 0f, 255);
|
||||
int num34 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, 0f, 0f, 255);
|
||||
Main.npc[num34].velocity.X = servantSpawnVelocity.X;
|
||||
Main.npc[num34].velocity.Y = servantSpawnVelocity.Y;
|
||||
|
||||
@@ -610,7 +610,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
Vector2 servantSpawnCenter = npc.Center + servantSpawnVelocity * 10f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int num34 = NPC.NewNPC((int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, 0f, 0f, 255);
|
||||
int num34 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, 0f, 0f, 255);
|
||||
Main.npc[num34].velocity.X = servantSpawnVelocity.X;
|
||||
Main.npc[num34].velocity.Y = servantSpawnVelocity.Y;
|
||||
|
||||
|
||||
@@ -36,9 +36,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (npc.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
npc.localAI[0] = 1f;
|
||||
NPC.NewNPC((int)npc.Center.X - 84, (int)npc.Center.Y - 9, NPCID.GolemFistLeft);
|
||||
NPC.NewNPC((int)npc.Center.X + 78, (int)npc.Center.Y - 9, NPCID.GolemFistRight);
|
||||
NPC.NewNPC((int)npc.Center.X - 3, (int)npc.Center.Y - 57, NPCID.GolemHead);
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X - 84, (int)npc.Center.Y - 9, NPCID.GolemFistLeft);
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X + 78, (int)npc.Center.Y - 9, NPCID.GolemFistRight);
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X - 3, (int)npc.Center.Y - 57, NPCID.GolemHead);
|
||||
}
|
||||
|
||||
// Get a target
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
}
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.Item38, (int)npc.position.X, (int)npc.position.Y);
|
||||
NPC.NewNPC((int)vector.X, (int)vector.Y, ModContent.NPCType<KingSlimeJewel>());
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType<KingSlimeJewel>());
|
||||
}
|
||||
|
||||
// Set up health value for spawning slimes
|
||||
@@ -387,8 +387,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (Main.rand.NextBool(250))
|
||||
npcType = NPCID.Pinky;
|
||||
|
||||
int num255 = NPC.NewNPC(x, y, npcType);
|
||||
Main.npc[num255].SetDefaults(npcType, -1f);
|
||||
int num255 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), x, y, npcType);
|
||||
Main.npc[num255].SetDefaults(npcType);
|
||||
Main.npc[num255].velocity.X = Main.rand.Next(-15, 16) * 0.1f;
|
||||
Main.npc[num255].velocity.Y = Main.rand.Next(-30, 1) * 0.1f;
|
||||
Main.npc[num255].ai[0] = -1000 * Main.rand.Next(3);
|
||||
@@ -432,12 +432,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
|
||||
if ((num240 < point4.Y - num237 || num240 > point4.Y + num237 || num239 < point4.X - num237 || num239 > point4.X + num237) &&
|
||||
(num240 < point3.Y - num236 || num240 > point3.Y + num236 || num239 < point3.X - num236 || num239 > point3.X + num236) &&
|
||||
!Main.tile[num239, num240].nactive())
|
||||
!Main.tile[num239, num240].IsActuated)
|
||||
{
|
||||
int num241 = num240;
|
||||
int num242 = 0;
|
||||
|
||||
if (Main.tile[num239, num241].nactive() && Main.tileSolid[Main.tile[num239, num241].TileType] && !Main.tileSolidTop[Main.tile[num239, num241].TileType])
|
||||
if (Main.tile[num239, num241].IsActuated && Main.tileSolid[Main.tile[num239, num241].TileType] && !Main.tileSolidTop[Main.tile[num239, num241].TileType])
|
||||
{
|
||||
num242 = 1;
|
||||
}
|
||||
@@ -446,7 +446,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
for (; num242 < 150 && num241 + num242 < Main.maxTilesY; num242++)
|
||||
{
|
||||
int y = num241 + num242;
|
||||
if (Main.tile[num239, y].nactive() && Main.tileSolid[Main.tile[num239, y].TileType] && !Main.tileSolidTop[Main.tile[num239, y].TileType])
|
||||
if (Main.tile[num239, y].IsActuated && Main.tileSolid[Main.tile[num239, y].TileType] && !Main.tileSolidTop[Main.tile[num239, y].TileType])
|
||||
{
|
||||
num242--;
|
||||
break;
|
||||
@@ -456,7 +456,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num240 += num242;
|
||||
|
||||
bool flag13 = true;
|
||||
if (flag13 && Main.tile[num239, num240].lava())
|
||||
if (flag13 && Main.tile[num239, num240].LiquidType == LiquidID.Lava)
|
||||
flag13 = false;
|
||||
if (flag13 && !Collision.CanHitLine(npc.Center, 0, 0, Main.player[npc.target].Center, 0, 0))
|
||||
flag13 = false;
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
|
||||
for (int num1156 = 0; num1156 < 2; num1156 = num + 1)
|
||||
{
|
||||
int num1157 = NPC.NewNPC((int)npc.Center.X + num1156 * 800 - 400, (int)npc.Center.Y - 100, NPCID.MoonLordHand, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
int num1157 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X + num1156 * 800 - 400, (int)npc.Center.Y - 100, NPCID.MoonLordHand, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
Main.npc[num1157].ai[2] = num1156;
|
||||
Main.npc[num1157].netUpdate = true;
|
||||
int[] arg_381A6_0 = array5;
|
||||
@@ -124,7 +124,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num = num1156;
|
||||
}
|
||||
|
||||
int num1158 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 400, NPCID.MoonLordHead, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
int num1158 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y - 400, NPCID.MoonLordHead, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
Main.npc[num1158].netUpdate = true;
|
||||
int[] arg_3823F_0 = array5;
|
||||
num = num1155;
|
||||
@@ -157,7 +157,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int num = NPC.NewNPC((int)Main.npc[(int)npc.localAI[2]].Center.X, (int)Main.npc[(int)npc.localAI[2]].Center.Y, NPCID.MoonLordFreeEye);
|
||||
int num = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)Main.npc[(int)npc.localAI[2]].Center.X, (int)Main.npc[(int)npc.localAI[2]].Center.Y, NPCID.MoonLordFreeEye);
|
||||
Main.npc[num].ai[3] = npc.whoAmI;
|
||||
Main.npc[num].netUpdate = true;
|
||||
}
|
||||
@@ -840,7 +840,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (projectile6.active && projectile6.type == ProjectileID.MoonLeech && Main.player[(int)projectile6.ai[1]].FindBuffIndex(145) != -1)
|
||||
{
|
||||
Vector2 center21 = Main.player[npc.target].Center;
|
||||
int num1230 = NPC.NewNPC((int)center21.X, (int)center21.Y, NPCID.MoonLordLeechBlob);
|
||||
int num1230 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)center21.X, (int)center21.Y, NPCID.MoonLordLeechBlob);
|
||||
Main.npc[num1230].netUpdate = true;
|
||||
Main.npc[num1230].ai[0] = npc.whoAmI + 1;
|
||||
Main.npc[num1230].ai[1] = num1229;
|
||||
|
||||
@@ -75,9 +75,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (npc.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
npc.localAI[0] = 1f;
|
||||
int num729 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasHook, npc.whoAmI);
|
||||
num729 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasHook, npc.whoAmI);
|
||||
num729 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasHook, npc.whoAmI);
|
||||
int num729 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasHook, npc.whoAmI);
|
||||
num729 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasHook, npc.whoAmI);
|
||||
num729 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasHook, npc.whoAmI);
|
||||
}
|
||||
|
||||
// Find positions of hooks
|
||||
@@ -146,7 +146,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
{
|
||||
if (Main.tile[x, y] != null)
|
||||
{
|
||||
if (Main.tile[x, y].nactive() && Main.tileSolid[Main.tile[x, y].TileType] && !Main.tileSolidTop[Main.tile[x, y].TileType] && !TileID.Sets.Platforms[Main.tile[x, y].TileType])
|
||||
if (Main.tile[x, y].IsActuated && Main.tileSolid[Main.tile[x, y].TileType] && !Main.tileSolidTop[Main.tile[x, y].TileType] && !TileID.Sets.Platforms[Main.tile[x, y].TileType])
|
||||
nearbyActiveTiles++;
|
||||
}
|
||||
}
|
||||
@@ -273,7 +273,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
int totalTentacles = (int)(baseTentacles * tileEnrageMult);
|
||||
for (int i = 0; i < totalTentacles; i++)
|
||||
{
|
||||
NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult);
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -377,7 +377,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
int totalTentacles = (int)(baseTentacles * tileEnrageMult);
|
||||
for (int i = 0; i < totalTentacles; i++)
|
||||
{
|
||||
NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult);
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -427,7 +427,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num758 *= num761;
|
||||
num760 *= num761;
|
||||
|
||||
int num762 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.Spore);
|
||||
int num762 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.Spore);
|
||||
Main.npc[num762].velocity.X = num758;
|
||||
Main.npc[num762].velocity.Y = num760;
|
||||
Main.npc[num762].dontTakeDamage = malice;
|
||||
@@ -611,7 +611,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
npc.ai[0] = npc.life;
|
||||
|
||||
if (NPC.CountNPCS(NPCID.PlanterasTentacle) < maxTentacles)
|
||||
NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult);
|
||||
NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
if (phase3)
|
||||
spawnType = NPCID.Bee;
|
||||
|
||||
int spawn = NPC.NewNPC((int)vector76.X, (int)vector76.Y, spawnType);
|
||||
int spawn = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)vector76.X, (int)vector76.Y, spawnType);
|
||||
Main.npc[spawn].velocity = Main.player[npc.target].Center - npc.Center;
|
||||
Main.npc[spawn].velocity.Normalize();
|
||||
Main.npc[spawn].velocity *= 5f;
|
||||
|
||||
@@ -65,13 +65,13 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
|
||||
void SpawnHands()
|
||||
{
|
||||
int num155 = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI);
|
||||
int num155 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI);
|
||||
Main.npc[num155].ai[0] = -1f;
|
||||
Main.npc[num155].ai[1] = npc.whoAmI;
|
||||
Main.npc[num155].target = npc.target;
|
||||
Main.npc[num155].netUpdate = true;
|
||||
|
||||
num155 = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI);
|
||||
num155 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI);
|
||||
Main.npc[num155].ai[0] = 1f;
|
||||
Main.npc[num155].ai[1] = npc.whoAmI;
|
||||
Main.npc[num155].ai[3] = 150f;
|
||||
@@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
// Spawn two additional hands with different attack timings
|
||||
if (death)
|
||||
{
|
||||
num155 = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI);
|
||||
num155 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI);
|
||||
Main.npc[num155].ai[0] = -1f;
|
||||
Main.npc[num155].Calamity().newAI[0] = -1f;
|
||||
Main.npc[num155].ai[1] = npc.whoAmI;
|
||||
@@ -89,7 +89,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
Main.npc[num155].target = npc.target;
|
||||
Main.npc[num155].netUpdate = true;
|
||||
|
||||
num155 = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI);
|
||||
num155 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI);
|
||||
Main.npc[num155].ai[0] = 1f;
|
||||
Main.npc[num155].Calamity().newAI[0] = -1f;
|
||||
Main.npc[num155].ai[1] = npc.whoAmI;
|
||||
@@ -220,7 +220,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
num1457++;
|
||||
int num1458 = Main.rand.Next(point13.X - num1453, point13.X + num1453 + 1);
|
||||
int num1459 = Main.rand.Next(point13.Y - num1453, point13.Y + num1453 + 1);
|
||||
if ((num1459 < point13.Y - num1455 || num1459 > point13.Y + num1455 || num1458 < point13.X - num1455 || num1458 > point13.X + num1455) && (num1459 < point12.Y - num1454 || num1459 > point12.Y + num1454 || num1458 < point12.X - num1454 || num1458 > point12.X + num1454) && !Main.tile[num1458, num1459].nactive())
|
||||
if ((num1459 < point13.Y - num1455 || num1459 > point13.Y + num1455 || num1458 < point13.X - num1455 || num1458 > point13.X + num1455) && (num1459 < point12.Y - num1454 || num1459 > point12.Y + num1454 || num1458 < point12.X - num1454 || num1458 > point12.X + num1454) && !Main.tile[num1458, num1459].IsActuated)
|
||||
{
|
||||
// New location params
|
||||
calamityGlobalNPC.newAI[2] = num1458 * 16 - npc.width / 2;
|
||||
|
||||
@@ -41,26 +41,26 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
{
|
||||
npc.ai[0] = 1f;
|
||||
|
||||
int arm = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PrimeCannon, npc.whoAmI);
|
||||
int arm = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PrimeCannon, npc.whoAmI);
|
||||
Main.npc[arm].ai[0] = -1f;
|
||||
Main.npc[arm].ai[1] = npc.whoAmI;
|
||||
Main.npc[arm].target = npc.target;
|
||||
Main.npc[arm].netUpdate = true;
|
||||
|
||||
arm = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PrimeSaw, npc.whoAmI);
|
||||
arm = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PrimeSaw, npc.whoAmI);
|
||||
Main.npc[arm].ai[0] = 1f;
|
||||
Main.npc[arm].ai[1] = npc.whoAmI;
|
||||
Main.npc[arm].target = npc.target;
|
||||
Main.npc[arm].netUpdate = true;
|
||||
|
||||
arm = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PrimeVice, npc.whoAmI);
|
||||
arm = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PrimeVice, npc.whoAmI);
|
||||
Main.npc[arm].ai[0] = -1f;
|
||||
Main.npc[arm].ai[1] = npc.whoAmI;
|
||||
Main.npc[arm].target = npc.target;
|
||||
Main.npc[arm].ai[3] = 150f;
|
||||
Main.npc[arm].netUpdate = true;
|
||||
|
||||
arm = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PrimeLaser, npc.whoAmI);
|
||||
arm = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PrimeLaser, npc.whoAmI);
|
||||
Main.npc[arm].ai[0] = 1f;
|
||||
Main.npc[arm].ai[1] = npc.whoAmI;
|
||||
Main.npc[arm].target = npc.target;
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int num331 = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + (npc.height / 2) + 20f), NPCID.LeechHead, 1);
|
||||
int num331 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + (npc.height / 2) + 20f), NPCID.LeechHead, 1);
|
||||
Main.npc[num331].velocity.X = npc.direction * 9;
|
||||
|
||||
if (phase2)
|
||||
@@ -373,7 +373,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
}
|
||||
if (num348 >= 0)
|
||||
{
|
||||
int num353 = NPC.NewNPC((int)npc.position.X, (int)num339, NPCID.TheHungry, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
int num353 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X, (int)num339, NPCID.TheHungry, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
Main.npc[num353].ai[0] = num348 * 0.1f - 0.05f;
|
||||
}
|
||||
}
|
||||
@@ -387,12 +387,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
|
||||
num339 = (Main.wofB + Main.wofT) / 2;
|
||||
num339 = (num339 + Main.wofT) / 2f;
|
||||
int num354 = NPC.NewNPC((int)npc.position.X, (int)num339, NPCID.WallofFleshEye, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
int num354 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X, (int)num339, NPCID.WallofFleshEye, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
Main.npc[num354].ai[0] = 1f;
|
||||
|
||||
num339 = (Main.wofB + Main.wofT) / 2;
|
||||
num339 = (num339 + Main.wofB) / 2f;
|
||||
num354 = NPC.NewNPC((int)npc.position.X, (int)num339, NPCID.WallofFleshEye, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
num354 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X, (int)num339, NPCID.WallofFleshEye, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
Main.npc[num354].ai[0] = -1f;
|
||||
|
||||
num339 = (Main.wofB + Main.wofT) / 2;
|
||||
@@ -401,7 +401,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
|
||||
int num;
|
||||
for (int num355 = 0; num355 < 11; num355 = num + 1)
|
||||
{
|
||||
num354 = NPC.NewNPC((int)npc.position.X, (int)num339, NPCID.TheHungry, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
num354 = NPC.NewNPC(npc.GetSpawnSourceForNPCFromNPCAI(), (int)npc.position.X, (int)num339, NPCID.TheHungry, npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
Main.npc[num354].ai[0] = num355 * 0.1f - 0.05f;
|
||||
num = num355;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user