1 - Slime God no longer uses mines.

This commit is contained in:
Andrew Marheine committed 2022-01-21 02:28:44 -06:00
1 parent ce44c6151f
commit fdcffadae2
8 files changed
+123 -474

No files matched your search

+23 -53
View File
@@ -168,63 +168,33 @@ namespace CalamityMod.NPCs.SlimeGod
if (npc.localAI[0] >= 600f && Vector2.Distance(player.Center, npc.Center) > 160f)
{
npc.localAI[0] = 0f;
if (expertMode && Main.rand.NextBool(2))
float num179 = 6f;
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num180 = player.position.X + (float)player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
npc.netUpdate = true;
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
int type = ModContent.ProjectileType<AbyssBallVolley>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
int totalProjectiles = expertMode ? 6 : 4;
int spread = expertMode ? 90 : 60;
for (int num186 = 0; num186 < totalProjectiles; num186++)
{
float num179 = 8f;
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num180 = player.position.X + (float)player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
npc.netUpdate = true;
num180 = player.position.X + (float)player.width * 0.5f - value9.X;
num182 = player.position.Y + (float)player.height * 0.5f - value9.Y;
num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
num183 = num179 / num183;
num180 += (float)Main.rand.Next(-spread, spread + 1);
num182 += (float)Main.rand.Next(-spread, spread + 1);
num180 *= num183;
num182 *= num183;
int type = ModContent.ProjectileType<AbyssMine>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
for (int num186 = 0; num186 < 3; num186++)
{
num180 = player.position.X + (float)player.width * 0.5f - value9.X;
num182 = player.position.Y + (float)player.height * 0.5f - value9.Y;
num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
num183 = num179 / num183;
num180 += (float)Main.rand.Next(-60, 61);
num182 += (float)Main.rand.Next(-60, 61);
num180 *= num183;
num182 *= num183;
Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
}
else
{
float num179 = 8f;
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num180 = player.position.X + (float)player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
npc.netUpdate = true;
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
int type = ModContent.ProjectileType<AbyssBallVolley>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
for (int num186 = 0; num186 < 4; num186++)
{
num180 = player.position.X + (float)player.width * 0.5f - value9.X;
num182 = player.position.Y + (float)player.height * 0.5f - value9.Y;
num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
num183 = num179 / num183;
num180 += (float)Main.rand.Next(-60, 61);
num182 += (float)Main.rand.Next(-60, 61);
num180 *= num183;
num182 *= num183;
Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
}
}
+38 -92
View File
@@ -419,54 +419,26 @@ namespace CalamityMod.NPCs.SlimeGod
float divisor = malice ? 10f : 15f;
if (npc.ai[1] % divisor == 0f && Vector2.Distance(player.Center, vectorCenter) > 160f)
{
if (expertMode && Main.rand.NextBool(2))
{
float num179 = revenge ? 2f : 3f;
Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
float num180 = player.position.X + player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
npc.netUpdate = true;
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
int type = Main.rand.NextBool(2) ? ModContent.ProjectileType<AbyssMine>() : ModContent.ProjectileType<AbyssMine2>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
num180 = player.position.X + player.width * 0.5f - value9.X;
num182 = player.position.Y + player.height * 0.5f - value9.Y;
num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
else
{
float num179 = revenge ? 6f : 5f;
Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
float num180 = player.position.X + player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
npc.netUpdate = true;
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
int type = Main.rand.NextBool(2) ? ModContent.ProjectileType<AbyssBallVolley>() : ModContent.ProjectileType<AbyssBallVolley2>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
num180 = player.position.X + player.width * 0.5f - value9.X;
num182 = player.position.Y + player.height * 0.5f - value9.Y;
num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
float num179 = expertMode ? 9f : 7.5f;
Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
float num180 = player.position.X + player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
int type = Main.rand.NextBool(2) ? ModContent.ProjectileType<AbyssBallVolley>() : ModContent.ProjectileType<AbyssBallVolley2>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
num180 = player.position.X + player.width * 0.5f - value9.X;
num182 = player.position.Y + player.height * 0.5f - value9.Y;
num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
}
}
@@ -479,59 +451,33 @@ namespace CalamityMod.NPCs.SlimeGod
{
if (npc.ai[1] % 40f == 0f)
{
if (expertMode && Main.rand.NextBool(2))
float num179 = expertMode ? 12f : 10f;
Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
float num180 = player.position.X + player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
int type = Main.rand.NextBool(2) ? ModContent.ProjectileType<AbyssBallVolley>() : ModContent.ProjectileType<AbyssBallVolley2>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
int totalProjectiles = expertMode ? 3 : 2;
int spread = expertMode ? 45 : 30;
for (int num186 = 0; num186 < totalProjectiles; num186++)
{
float num179 = revenge ? 2f : 3f;
Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
float num180 = player.position.X + player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
npc.netUpdate = true;
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
int type = Main.rand.NextBool(2) ? ModContent.ProjectileType<AbyssMine>() : ModContent.ProjectileType<AbyssMine2>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
num180 = player.position.X + player.width * 0.5f - value9.X;
num182 = player.position.Y + player.height * 0.5f - value9.Y;
num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
num183 = num179 / num183;
num180 += Main.rand.Next(-spread, spread + 1);
num182 += Main.rand.Next(-spread, spread + 1);
num180 *= num183;
num182 *= num183;
Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
else
{
float num179 = revenge ? 6f : 5f;
Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
float num180 = player.position.X + player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
npc.netUpdate = true;
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
int type = Main.rand.NextBool(2) ? ModContent.ProjectileType<AbyssBallVolley>() : ModContent.ProjectileType<AbyssBallVolley2>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
for (int num186 = 0; num186 < 2; num186++)
{
num180 = player.position.X + player.width * 0.5f - value9.X;
num182 = player.position.Y + player.height * 0.5f - value9.Y;
num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
num183 = num179 / num183;
num180 += Main.rand.Next(-30, 31);
num182 += Main.rand.Next(-30, 31);
num180 *= num183;
num182 *= num183;
Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
}
}
}
}
+20 -53
View File
@@ -178,63 +178,30 @@ namespace CalamityMod.NPCs.SlimeGod
if (npc.localAI[0] >= 450f && Vector2.Distance(player.Center, npc.Center) > 160f)
{
npc.localAI[0] = 0f;
if (expertMode && Main.rand.NextBool(2))
float num179 = expertMode ? 12f : 10f;
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num180 = player.position.X + (float)player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
int type = ModContent.ProjectileType<AbyssBallVolley2>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
for (int num186 = 0; num186 < 2; num186++)
{
float num179 = revenge ? 9f : 8f;
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num180 = player.position.X + (float)player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
npc.netUpdate = true;
num180 = player.position.X + (float)player.width * 0.5f - value9.X;
num182 = player.position.Y + (float)player.height * 0.5f - value9.Y;
num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
num183 = num179 / num183;
num180 += (float)Main.rand.Next(-10, 11);
num182 += (float)Main.rand.Next(-10, 11);
num180 *= num183;
num182 *= num183;
int type = ModContent.ProjectileType<AbyssMine2>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
for (int num186 = 0; num186 < 2; num186++)
{
num180 = player.position.X + (float)player.width * 0.5f - value9.X;
num182 = player.position.Y + (float)player.height * 0.5f - value9.Y;
num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
num183 = num179 / num183;
num180 += (float)Main.rand.Next(-60, 61);
num182 += (float)Main.rand.Next(-60, 61);
num180 *= num183;
num182 *= num183;
Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
}
else
{
float num179 = revenge ? 9f : 8f;
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num180 = player.position.X + (float)player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
npc.netUpdate = true;
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
int type = ModContent.ProjectileType<AbyssBallVolley2>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
for (int num186 = 0; num186 < 2; num186++)
{
num180 = player.position.X + (float)player.width * 0.5f - value9.X;
num182 = player.position.Y + (float)player.height * 0.5f - value9.Y;
num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
num183 = num179 / num183;
num180 += (float)Main.rand.Next(-30, 31);
num182 += (float)Main.rand.Next(-30, 31);
num180 *= num183;
num182 *= num183;
Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
}
}
+23 -56
View File
@@ -153,7 +153,7 @@ namespace CalamityMod.NPCs.SlimeGod
}
if (Main.netMode != NetmodeID.MultiplayerClient)
{
{
npc.localAI[0] += flag100 ? 0.5f : 1f;
if (revenge)
npc.localAI[0] += 0.5f;
@@ -163,61 +163,28 @@ namespace CalamityMod.NPCs.SlimeGod
if (npc.localAI[0] >= 450f && Vector2.Distance(player.Center, npc.Center) > 160f)
{
npc.localAI[0] = 0f;
if (expertMode && Main.rand.NextBool(2))
{
float num179 = revenge ? 9f : 8f;
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num180 = player.position.X + (float)player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
npc.netUpdate = true;
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
int type = ModContent.ProjectileType<AbyssMine2>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
num180 = player.position.X + (float)player.width * 0.5f - value9.X;
num182 = player.position.Y + (float)player.height * 0.5f - value9.Y;
num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
num183 = num179 / num183;
num180 += (float)Main.rand.Next(-30, 31);
num182 += (float)Main.rand.Next(-30, 31);
num180 *= num183;
num182 *= num183;
Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
else
{
float num179 = revenge ? 9f : 8f;
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num180 = player.position.X + (float)player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
npc.netUpdate = true;
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
int type = ModContent.ProjectileType<AbyssBallVolley2>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
num180 = player.position.X + (float)player.width * 0.5f - value9.X;
num182 = player.position.Y + (float)player.height * 0.5f - value9.Y;
num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
num183 = num179 / num183;
num180 += (float)Main.rand.Next(-15, 16);
num182 += (float)Main.rand.Next(-15, 16);
num180 *= num183;
num182 *= num183;
Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
npc.netUpdate = true;
}
}
float num179 = expertMode ? 12f : 10f;
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num180 = player.position.X + (float)player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
int type = ModContent.ProjectileType<AbyssBallVolley2>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
num180 = player.position.X + (float)player.width * 0.5f - value9.X;
num182 = player.position.Y + (float)player.height * 0.5f - value9.Y;
num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
}
if (npc.ai[0] == 0f)
{
+19 -48
View File
@@ -157,63 +157,34 @@ namespace CalamityMod.NPCs.SlimeGod
if (npc.localAI[0] >= 600f && Vector2.Distance(player.Center, npc.Center) > 160f)
{
npc.localAI[0] = 0f;
if (expertMode && Main.rand.NextBool(2))
float num179 = 6f;
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num180 = player.position.X + (float)player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
int type = ModContent.ProjectileType<AbyssBallVolley>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
int totalProjectiles = expertMode ? 3 : 2;
int spread = expertMode ? 45 : 30;
for (int num186 = 0; num186 < totalProjectiles; num186++)
{
float num179 = 8f;
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num180 = player.position.X + (float)player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
npc.netUpdate = true;
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
int type = ModContent.ProjectileType<AbyssMine>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
num180 = player.position.X + (float)player.width * 0.5f - value9.X;
num182 = player.position.Y + (float)player.height * 0.5f - value9.Y;
num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
num183 = num179 / num183;
num180 += (float)Main.rand.Next(-30, 31);
num182 += (float)Main.rand.Next(-30, 31);
num180 += (float)Main.rand.Next(-spread, spread + 1);
num182 += (float)Main.rand.Next(-spread, spread + 1);
num180 *= num183;
num182 *= num183;
Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
else
{
float num179 = 8f;
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num180 = player.position.X + (float)player.width * 0.5f - value9.X;
float num181 = Math.Abs(num180) * 0.1f;
float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181;
float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
npc.netUpdate = true;
num183 = num179 / num183;
num180 *= num183;
num182 *= num183;
int type = ModContent.ProjectileType<AbyssBallVolley>();
int damage = npc.GetProjectileDamage(type);
value9.X += num180;
value9.Y += num182;
for (int num186 = 0; num186 < 2; num186++)
{
num180 = player.position.X + (float)player.width * 0.5f - value9.X;
num182 = player.position.Y + (float)player.height * 0.5f - value9.Y;
num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
num183 = num179 / num183;
num180 += (float)Main.rand.Next(-30, 31);
num182 += (float)Main.rand.Next(-30, 31);
num180 *= num183;
num182 *= num183;
Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f);
}
}
npc.netUpdate = true;
}
}
}
if (npc.ai[0] == 0f)
-80
View File
@@ -1,80 +0,0 @@
using CalamityMod.Events;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class AbyssMine : ModProjectile
{
public override string Texture => "CalamityMod/Projectiles/Boss/AbyssBallVolley";
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Abyss Mine");
}
public override void SetDefaults()
{
projectile.Calamity().canBreakPlayerDefense = true;
projectile.width = 30;
projectile.height = 30;
projectile.hostile = true;
projectile.alpha = 60;
projectile.penetrate = -1;
projectile.tileCollide = false;
projectile.timeLeft = (Main.expertMode || BossRushEvent.BossRushActive || CalamityWorld.malice) ? 3000 : 2400;
projectile.Calamity().affectedByMaliceModeVelocityMultiplier = true;
}
public override void AI()
{
projectile.velocity *= 0.97f;
if (projectile.ai[1] == 0f)
{
projectile.ai[1] = 1f;
Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 33);
}
if (Main.rand.NextBool(6))
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, 0f, 0f);
}
public override void Kill(int timeLeft)
{
Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 14);
projectile.position = projectile.Center;
projectile.width = projectile.height = 96;
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
for (int num621 = 0; num621 < 10; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.2f);
Main.dust[num622].velocity *= 3f;
if (Main.rand.NextBool(2))
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 20; num623++)
{
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.7f);
Main.dust[num624].velocity *= 5f;
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f);
Main.dust[num624].velocity *= 2f;
}
projectile.Damage();
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(projectile.Center, 12f, targetHitbox);
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(BuffID.Weak, 240);
}
}
}
-86
View File
@@ -1,86 +0,0 @@
using CalamityMod.Events;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class AbyssMine2 : ModProjectile
{
public override string Texture => "CalamityMod/Projectiles/Boss/AbyssBallVolley2";
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Abyss Mine");
}
public override void SetDefaults()
{
projectile.Calamity().canBreakPlayerDefense = true;
projectile.width = 30;
projectile.height = 30;
projectile.hostile = true;
projectile.alpha = 60;
projectile.penetrate = -1;
projectile.tileCollide = false;
projectile.timeLeft = (Main.expertMode || BossRushEvent.BossRushActive || CalamityWorld.malice) ? 3000 : 2400;
projectile.Calamity().affectedByMaliceModeVelocityMultiplier = true;
}
public override void AI()
{
projectile.velocity *= 0.99f;
if (projectile.ai[1] == 0f)
{
projectile.ai[1] = 1f;
Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 33);
}
if (Main.rand.NextBool(6))
{
int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 127, 0f, 0f);
Main.dust[dust].noGravity = true;
}
}
public override void Kill(int timeLeft)
{
Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 14);
projectile.position.X = projectile.position.X + (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2);
projectile.width = projectile.height = 96;
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
for (int num621 = 0; num621 < 10; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1.2f);
Main.dust[num622].velocity *= 3f;
Main.dust[num622].noGravity = true;
if (Main.rand.NextBool(2))
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 20; num623++)
{
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1.7f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1f);
Main.dust[num624].velocity *= 2f;
}
projectile.Damage();
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(projectile.Center, 12f, targetHitbox);
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(BuffID.Darkness, 240);
}
}
}
-6
View File
@@ -563,16 +563,10 @@ namespace CalamityMod
{ new Tuple<int, int>(ModContent.NPCType<SlimeGodCore>(), ModContent.ProjectileType<AbyssBallVolley>()), new int[] { 42, 68, 84, 92, 126 } },
{ new Tuple<int, int>(ModContent.NPCType<SlimeGodCore>(), ModContent.ProjectileType<AbyssBallVolley2>()), new int[] { 38, 60, 76, 84, 114 } },
{ new Tuple<int, int>(ModContent.NPCType<SlimeGodCore>(), ModContent.ProjectileType<AbyssMine>()), new int[] { 60, 96, 116, 128, 174 } },
{ new Tuple<int, int>(ModContent.NPCType<SlimeGodCore>(), ModContent.ProjectileType<AbyssMine2>()), new int[] { 54, 88, 108, 116, 162 } },
{ new Tuple<int, int>(ModContent.NPCType<SlimeGod>(), ModContent.ProjectileType<AbyssBallVolley>()), new int[] { 42, 68, 84, 92, 126 } },
{ new Tuple<int, int>(ModContent.NPCType<SlimeGod>(), ModContent.ProjectileType<AbyssMine>()), new int[] { 60, 96, 116, 128, 174 } },
{ new Tuple<int, int>(ModContent.NPCType<SlimeGodRun>(), ModContent.ProjectileType<AbyssBallVolley2>()), new int[] { 38, 60, 76, 84, 114 } },
{ new Tuple<int, int>(ModContent.NPCType<SlimeGodRun>(), ModContent.ProjectileType<AbyssMine2>()), new int[] { 54, 88, 108, 116, 162 } },
{ new Tuple<int, int>(ModContent.NPCType<SlimeGodSplit>(), ModContent.ProjectileType<AbyssBallVolley>()), new int[] { 38, 60, 76, 84, 114 } },
{ new Tuple<int, int>(ModContent.NPCType<SlimeGodSplit>(), ModContent.ProjectileType<AbyssMine>()), new int[] { 54, 88, 104, 112, 156 } },
{ new Tuple<int, int>(ModContent.NPCType<SlimeGodRunSplit>(), ModContent.ProjectileType<AbyssBallVolley2>()), new int[] { 34, 52, 68, 74, 102 } },
{ new Tuple<int, int>(ModContent.NPCType<SlimeGodRunSplit>(), ModContent.ProjectileType<AbyssMine2>()), new int[] { 48, 80, 100, 108, 150 } },
{ new Tuple<int, int>(ModContent.NPCType<SlimeSpawnCrimson2>(), ModContent.ProjectileType<CrimsonSpike>()), new int[] { 24, 48, 60, 68, 90 } },
{ new Tuple<int, int>(NPCID.WallofFleshEye, ProjectileID.EyeLaser), new int[] {