1 - Ebonian and Crimulan Slime Gods teleport 10 blocks farther away from their targets and jump through tiles to get to their targets.

This commit is contained in:
mountaindrew10 committed 2022-07-23 04:22:40 -05:00
1 parent 354b8f06f1
commit ef333ffec5
4 files changed
+56 -8

No files matched your search

+14 -2
View File
@@ -168,7 +168,7 @@ namespace CalamityMod.NPCs.SlimeGod
NPC.netUpdate = true;
NPC.TargetClosest(false);
player = Main.player[NPC.target];
Vector2 vectorAimedAheadOfTarget = player.Center + new Vector2((float)Math.Round(player.velocity.X), 0f).SafeNormalize(Vector2.Zero) * 800f;
Vector2 vectorAimedAheadOfTarget = player.Center + new Vector2((float)Math.Round(player.velocity.X), 0f).SafeNormalize(Vector2.Zero) * 960f;
Point point2 = vectorAimedAheadOfTarget.ToTileCoordinates();
int num5 = 5;
int num8 = 0;
@@ -269,6 +269,7 @@ namespace CalamityMod.NPCs.SlimeGod
NPC.ai[1] = 0f;
NPC.velocity.Y -= velocityY * speedMult;
NPC.velocity.X = (velocityX + distanceSpeedBoost) * NPC.direction;
NPC.noTileCollide = true;
NPC.netUpdate = true;
}
else if (NPC.ai[1] >= jumpGateValue - 30f)
@@ -281,6 +282,16 @@ namespace CalamityMod.NPCs.SlimeGod
NPC.velocity.X = -1f;
if (NPC.direction > 0 && NPC.velocity.X < 1f)
NPC.velocity.X = 1f;
if (!player.dead)
{
if (NPC.velocity.Y > 0f && NPC.Bottom.Y > player.Top.Y)
NPC.noTileCollide = false;
else if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.Center, 1, 1) && !Collision.SolidCollision(NPC.position, NPC.width, NPC.height))
NPC.noTileCollide = false;
else
NPC.noTileCollide = true;
}
}
NPC.ai[2] += 1f;
@@ -290,7 +301,8 @@ namespace CalamityMod.NPCs.SlimeGod
if (NPC.velocity.Y == 0f)
{
float phaseSwitchGateValue = 360f;
if (NPC.ai[2] >= phaseSwitchGateValue)
bool switchPhase = NPC.ai[2] >= phaseSwitchGateValue;
if (switchPhase)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
+14 -2
View File
@@ -161,7 +161,7 @@ namespace CalamityMod.NPCs.SlimeGod
NPC.netUpdate = true;
NPC.TargetClosest(false);
player = Main.player[NPC.target];
Vector2 vectorAimedAheadOfTarget = player.Center + new Vector2((float)Math.Round(player.velocity.X), 0f).SafeNormalize(Vector2.Zero) * 800f;
Vector2 vectorAimedAheadOfTarget = player.Center + new Vector2((float)Math.Round(player.velocity.X), 0f).SafeNormalize(Vector2.Zero) * 960f;
Point point2 = vectorAimedAheadOfTarget.ToTileCoordinates();
int num5 = 5;
int num8 = 0;
@@ -262,6 +262,7 @@ namespace CalamityMod.NPCs.SlimeGod
NPC.ai[1] = 0f;
NPC.velocity.Y -= velocityY * speedMult;
NPC.velocity.X = (velocityX + distanceSpeedBoost) * NPC.direction;
NPC.noTileCollide = true;
NPC.netUpdate = true;
}
else if (NPC.ai[1] >= jumpGateValue - 30f)
@@ -274,6 +275,16 @@ namespace CalamityMod.NPCs.SlimeGod
NPC.velocity.X = -1f;
if (NPC.direction > 0 && NPC.velocity.X < 1f)
NPC.velocity.X = 1f;
if (!player.dead)
{
if (NPC.velocity.Y > 0f && NPC.Bottom.Y > player.Top.Y)
NPC.noTileCollide = false;
else if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.Center, 1, 1) && !Collision.SolidCollision(NPC.position, NPC.width, NPC.height))
NPC.noTileCollide = false;
else
NPC.noTileCollide = true;
}
}
NPC.ai[2] += 1f;
@@ -283,7 +294,8 @@ namespace CalamityMod.NPCs.SlimeGod
if (NPC.velocity.Y == 0f)
{
float phaseSwitchGateValue = 420f;
if (NPC.ai[2] >= phaseSwitchGateValue)
bool switchPhase = NPC.ai[2] >= phaseSwitchGateValue;
if (switchPhase)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
+14 -2
View File
@@ -172,7 +172,7 @@ namespace CalamityMod.NPCs.SlimeGod
NPC.netUpdate = true;
NPC.TargetClosest(false);
player = Main.player[NPC.target];
Vector2 vectorAimedAheadOfTarget = player.Center + new Vector2((float)Math.Round(player.velocity.X), 0f).SafeNormalize(Vector2.Zero) * 800f;
Vector2 vectorAimedAheadOfTarget = player.Center + new Vector2((float)Math.Round(player.velocity.X), 0f).SafeNormalize(Vector2.Zero) * 960f;
Point point2 = vectorAimedAheadOfTarget.ToTileCoordinates();
int num5 = 5;
int num8 = 0;
@@ -266,6 +266,7 @@ namespace CalamityMod.NPCs.SlimeGod
NPC.ai[1] = 0f;
NPC.velocity.Y -= velocityY * speedMult;
NPC.velocity.X = (velocityX + distanceSpeedBoost) * NPC.direction;
NPC.noTileCollide = true;
NPC.netUpdate = true;
}
else if (NPC.ai[1] >= jumpGateValue - 30f)
@@ -278,6 +279,16 @@ namespace CalamityMod.NPCs.SlimeGod
NPC.velocity.X = -1f;
if (NPC.direction > 0 && NPC.velocity.X < 1f)
NPC.velocity.X = 1f;
if (!player.dead)
{
if (NPC.velocity.Y > 0f && NPC.Bottom.Y > player.Top.Y)
NPC.noTileCollide = false;
else if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.Center, 1, 1) && !Collision.SolidCollision(NPC.position, NPC.width, NPC.height))
NPC.noTileCollide = false;
else
NPC.noTileCollide = true;
}
}
NPC.ai[2] += 1f;
@@ -287,7 +298,8 @@ namespace CalamityMod.NPCs.SlimeGod
if (NPC.velocity.Y == 0f)
{
float phaseSwitchGateValue = 180f;
if (NPC.ai[2] >= phaseSwitchGateValue)
bool switchPhase = NPC.ai[2] >= phaseSwitchGateValue;
if (switchPhase)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
+14 -2
View File
@@ -168,7 +168,7 @@ namespace CalamityMod.NPCs.SlimeGod
NPC.netUpdate = true;
NPC.TargetClosest(false);
player = Main.player[NPC.target];
Vector2 vectorAimedAheadOfTarget = player.Center + new Vector2((float)Math.Round(player.velocity.X), 0f).SafeNormalize(Vector2.Zero) * 800f;
Vector2 vectorAimedAheadOfTarget = player.Center + new Vector2((float)Math.Round(player.velocity.X), 0f).SafeNormalize(Vector2.Zero) * 960f;
Point point2 = vectorAimedAheadOfTarget.ToTileCoordinates();
int num5 = 5;
int num8 = 0;
@@ -262,6 +262,7 @@ namespace CalamityMod.NPCs.SlimeGod
NPC.ai[1] = 0f;
NPC.velocity.Y -= velocityY * speedMult;
NPC.velocity.X = (velocityX + distanceSpeedBoost) * NPC.direction;
NPC.noTileCollide = true;
NPC.netUpdate = true;
}
else if (NPC.ai[1] >= jumpGateValue - 30f)
@@ -274,6 +275,16 @@ namespace CalamityMod.NPCs.SlimeGod
NPC.velocity.X = -1f;
if (NPC.direction > 0 && NPC.velocity.X < 1f)
NPC.velocity.X = 1f;
if (!player.dead)
{
if (NPC.velocity.Y > 0f && NPC.Bottom.Y > player.Top.Y)
NPC.noTileCollide = false;
else if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.Center, 1, 1) && !Collision.SolidCollision(NPC.position, NPC.width, NPC.height))
NPC.noTileCollide = false;
else
NPC.noTileCollide = true;
}
}
NPC.ai[2] += 1f;
@@ -283,7 +294,8 @@ namespace CalamityMod.NPCs.SlimeGod
if (NPC.velocity.Y == 0f)
{
float phaseSwitchGateValue = 210f;
if (NPC.ai[2] >= phaseSwitchGateValue)
bool switchPhase = NPC.ai[2] >= phaseSwitchGateValue;
if (switchPhase)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{