Commented out Brimstone Slag glowmask code, redid some homing code.
This commit is contained in:
1 parent
75e0a9e2bf
commit
6cb7c3f5ce
31 files changed
+650
-533
No files matched your search
@@ -25,10 +25,6 @@ namespace CalamityMod.Projectiles.Boss
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0.3f, 0f, 0f);
|
||||
if (projectile.timeLeft > 90)
|
||||
{
|
||||
projectile.timeLeft = 90;
|
||||
}
|
||||
if (projectile.ai[0] > 7f)
|
||||
{
|
||||
float num296 = 1f;
|
||||
|
||||
@@ -41,26 +41,32 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X);
|
||||
}
|
||||
|
||||
float centerX = projectile.Center.X;
|
||||
float centerY = projectile.Center.Y;
|
||||
float num474 = 250f;
|
||||
float distance = 250f;
|
||||
bool homeIn = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
|
||||
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
|
||||
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
|
||||
if (num478 < num474)
|
||||
float extraDistance = (float)(Main.npc[num475].width / 2) + (float)(Main.npc[num475].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num475].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
num474 = num478;
|
||||
centerX = num476;
|
||||
centerY = num477;
|
||||
distance = Vector2.Distance(Main.npc[num475].Center, projectile.Center);
|
||||
centerX = Main.npc[num475].Center.X;
|
||||
centerY = Main.npc[num475].Center.Y;
|
||||
homeIn = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (homeIn)
|
||||
{
|
||||
float num483 = 13f;
|
||||
|
||||
@@ -41,26 +41,32 @@ namespace CalamityMod.Projectiles.Magic
|
||||
}
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, randomDust, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
|
||||
}
|
||||
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float num474 = 400f;
|
||||
float distance = 400f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
|
||||
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
|
||||
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
|
||||
if (num478 < num474)
|
||||
{
|
||||
num474 = num478;
|
||||
num472 = num476;
|
||||
num473 = num477;
|
||||
float extraDistance = (float)(Main.npc[num475].width / 2) + (float)(Main.npc[num475].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num475].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
distance = Vector2.Distance(Main.npc[num475].Center, projectile.Center);
|
||||
num472 = Main.npc[num475].Center.X;
|
||||
num473 = Main.npc[num475].Center.Y;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag17)
|
||||
{
|
||||
float num483 = 20f;
|
||||
|
||||
@@ -132,24 +132,29 @@ namespace CalamityMod.Projectiles.Magic
|
||||
projectile.velocity *= 1.001f;
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float num474 = 400f;
|
||||
float distance = 400f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
|
||||
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
|
||||
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
|
||||
if (num478 < num474)
|
||||
float extraDistance = (float)(Main.npc[num475].width / 2) + (float)(Main.npc[num475].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num475].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
num474 = num478;
|
||||
num472 = num476;
|
||||
num473 = num477;
|
||||
distance = Vector2.Distance(Main.npc[num475].Center, projectile.Center);
|
||||
num472 = Main.npc[num475].Center.X;
|
||||
num473 = Main.npc[num475].Center.Y;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag17)
|
||||
{
|
||||
float num483 = 20f;
|
||||
|
||||
@@ -57,10 +57,9 @@ namespace CalamityMod.Projectiles.Magic
|
||||
if (projectile.ai[0] > 30f)
|
||||
{
|
||||
projectile.ai[0] = 30f;
|
||||
int num4;
|
||||
for (int num376 = 0; num376 < 200; num376 = num4 + 1)
|
||||
for (int num376 = 0; num376 < 200; num376++)
|
||||
{
|
||||
if (Main.npc[num376].CanBeChasedBy(projectile, false) && (!Main.npc[num376].wet || projectile.type == 307))
|
||||
if (Main.npc[num376].CanBeChasedBy(projectile, false) && !Main.npc[num376].wet)
|
||||
{
|
||||
float num377 = Main.npc[num376].position.X + (float)(Main.npc[num376].width / 2);
|
||||
float num378 = Main.npc[num376].position.Y + (float)(Main.npc[num376].height / 2);
|
||||
@@ -73,7 +72,6 @@ namespace CalamityMod.Projectiles.Magic
|
||||
flag10 = true;
|
||||
}
|
||||
}
|
||||
num4 = num376;
|
||||
}
|
||||
}
|
||||
if (!flag10)
|
||||
@@ -112,7 +110,6 @@ namespace CalamityMod.Projectiles.Magic
|
||||
if (projectile.velocity.Y < 0f && num383 > 0f)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + num381 * 2f;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (projectile.velocity.Y > num383)
|
||||
@@ -121,7 +118,6 @@ namespace CalamityMod.Projectiles.Magic
|
||||
if (projectile.velocity.Y > 0f && num383 < 0f)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y - num381 * 2f;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,29 +35,35 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
projectile.velocity *= 0.98f;
|
||||
}
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float num429 = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2);
|
||||
float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2);
|
||||
float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432);
|
||||
if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1))
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag14)
|
||||
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float distance = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num430].width / 2) + (float)(Main.npc[num430].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num430].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag14)
|
||||
{
|
||||
int num434 = Main.rand.Next(num428);
|
||||
num434 = array[num434];
|
||||
|
||||
@@ -36,27 +36,33 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Main.dust[num469].velocity *= 0f;
|
||||
}
|
||||
}
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float num474 = 500f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
|
||||
{
|
||||
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
|
||||
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
|
||||
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
|
||||
if (num478 < num474)
|
||||
{
|
||||
num474 = num478;
|
||||
num472 = num476;
|
||||
num473 = num477;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag17)
|
||||
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float distance = 500f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num475].width / 2) + (float)(Main.npc[num475].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num475].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
distance = Vector2.Distance(Main.npc[num475].Center, projectile.Center);
|
||||
num472 = Main.npc[num475].Center.X;
|
||||
num473 = Main.npc[num475].Center.Y;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag17)
|
||||
{
|
||||
float num483 = 8f;
|
||||
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
|
||||
@@ -87,7 +87,6 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Main.dust[num898].scale += projectile.scale * 0.75f;
|
||||
num897++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,41 +53,41 @@ namespace CalamityMod.Projectiles.Magic
|
||||
projectile.frame = 0;
|
||||
}
|
||||
}
|
||||
int num3;
|
||||
for (int num433 = 0; num433 < 1000; num433 = num3 + 1)
|
||||
{
|
||||
num3 = num433;
|
||||
}
|
||||
int[] array = new int[20];
|
||||
int num434 = 0;
|
||||
float num435 = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num436 = 0; num436 < 200; num436 = num3 + 1)
|
||||
{
|
||||
if (Main.npc[num436].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num437 = Main.npc[num436].position.X + (float)(Main.npc[num436].width / 2);
|
||||
float num438 = Main.npc[num436].position.Y + (float)(Main.npc[num436].height / 2);
|
||||
float num439 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num437) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num438);
|
||||
if (num439 < num435 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num436].Center, 1, 1))
|
||||
{
|
||||
if (num434 < 20)
|
||||
{
|
||||
array[num434] = num436;
|
||||
num434++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
num3 = num436;
|
||||
}
|
||||
if (projectile.timeLeft < 30)
|
||||
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float distance = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num430].width / 2) + (float)(Main.npc[num430].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num430].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (projectile.timeLeft < 30)
|
||||
{
|
||||
flag14 = false;
|
||||
}
|
||||
if (flag14)
|
||||
{
|
||||
int num440 = Main.rand.Next(num434);
|
||||
int num440 = Main.rand.Next(num428);
|
||||
num440 = array[num440];
|
||||
float num441 = Main.npc[num440].position.X + (float)(Main.npc[num440].width / 2);
|
||||
float num442 = Main.npc[num440].position.Y + (float)(Main.npc[num440].height / 2);
|
||||
@@ -105,7 +105,6 @@ namespace CalamityMod.Projectiles.Magic
|
||||
num444 *= num446;
|
||||
num445 *= num446;
|
||||
Projectile.NewProjectile(vector33.X, vector33.Y, num444, num445, ModContent.ProjectileType<ClimaxBeam>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,41 +51,41 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
projectile.velocity *= 0.98f;
|
||||
}
|
||||
int num3;
|
||||
for (int num433 = 0; num433 < 1000; num433 = num3 + 1)
|
||||
{
|
||||
num3 = num433;
|
||||
}
|
||||
int[] array = new int[20];
|
||||
int num434 = 0;
|
||||
float num435 = 400f;
|
||||
bool flag14 = false;
|
||||
for (int num436 = 0; num436 < 200; num436 = num3 + 1)
|
||||
{
|
||||
if (Main.npc[num436].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num437 = Main.npc[num436].position.X + (float)(Main.npc[num436].width / 2);
|
||||
float num438 = Main.npc[num436].position.Y + (float)(Main.npc[num436].height / 2);
|
||||
float num439 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num437) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num438);
|
||||
if (num439 < num435 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num436].Center, 1, 1))
|
||||
{
|
||||
if (num434 < 20)
|
||||
{
|
||||
array[num434] = num436;
|
||||
num434++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
num3 = num436;
|
||||
}
|
||||
if (projectile.timeLeft < 30)
|
||||
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float distance = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num430].width / 2) + (float)(Main.npc[num430].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num430].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (projectile.timeLeft < 30)
|
||||
{
|
||||
flag14 = false;
|
||||
}
|
||||
if (flag14)
|
||||
{
|
||||
int num440 = Main.rand.Next(num434);
|
||||
int num440 = Main.rand.Next(num428);
|
||||
num440 = array[num440];
|
||||
float num441 = Main.npc[num440].position.X + (float)(Main.npc[num440].width / 2);
|
||||
float num442 = Main.npc[num440].position.Y + (float)(Main.npc[num440].height / 2);
|
||||
@@ -103,7 +103,6 @@ namespace CalamityMod.Projectiles.Magic
|
||||
num444 *= num446;
|
||||
num445 *= num446;
|
||||
Projectile.NewProjectile(vector33.X, vector33.Y, num444, num445, ModContent.ProjectileType<ClimaxBeam>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,27 +58,33 @@ namespace CalamityMod.Projectiles.Magic
|
||||
projectile.velocity = (projectile.velocity * (num953 - 1f) + vector102 * scaleFactor12) / num953;
|
||||
return;
|
||||
}
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float num474 = 600f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
|
||||
{
|
||||
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
|
||||
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
|
||||
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
|
||||
if (num478 < num474)
|
||||
{
|
||||
num474 = num478;
|
||||
num472 = num476;
|
||||
num473 = num477;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag17)
|
||||
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float distance = 600f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num475].width / 2) + (float)(Main.npc[num475].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num475].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
distance = Vector2.Distance(Main.npc[num475].Center, projectile.Center);
|
||||
num472 = Main.npc[num475].Center.X;
|
||||
num473 = Main.npc[num475].Center.Y;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag17)
|
||||
{
|
||||
float num483 = 9f;
|
||||
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
|
||||
@@ -35,29 +35,35 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
projectile.velocity *= 0.98f;
|
||||
}
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float num429 = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2);
|
||||
float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2);
|
||||
float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432);
|
||||
if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1))
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag14)
|
||||
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float distance = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num430].width / 2) + (float)(Main.npc[num430].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num430].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag14)
|
||||
{
|
||||
int num434 = Main.rand.Next(num428);
|
||||
num434 = array[num434];
|
||||
|
||||
@@ -35,29 +35,35 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
projectile.velocity *= 0.98f;
|
||||
}
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float num429 = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2);
|
||||
float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2);
|
||||
float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432);
|
||||
if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1))
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag14)
|
||||
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float distance = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num430].width / 2) + (float)(Main.npc[num430].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num430].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag14)
|
||||
{
|
||||
int num434 = Main.rand.Next(num428);
|
||||
num434 = array[num434];
|
||||
|
||||
@@ -35,18 +35,23 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
projectile.velocity *= 0.98f;
|
||||
}
|
||||
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float num429 = 300f;
|
||||
float distance = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2);
|
||||
float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2);
|
||||
float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432);
|
||||
if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1))
|
||||
float extraDistance = (float)(Main.npc[num430].width / 2) + (float)(Main.npc[num430].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num430].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
@@ -57,6 +62,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag14)
|
||||
{
|
||||
int num434 = Main.rand.Next(num428);
|
||||
|
||||
@@ -41,27 +41,33 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
projectile.velocity.X *= 1.25f;
|
||||
projectile.velocity.Y *= 1.25f;
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float num474 = 300f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
|
||||
{
|
||||
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
|
||||
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
|
||||
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
|
||||
if (num478 < num474)
|
||||
{
|
||||
num474 = num478;
|
||||
num472 = num476;
|
||||
num473 = num477;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag17)
|
||||
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float distance = 300f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num475].width / 2) + (float)(Main.npc[num475].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num475].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
distance = Vector2.Distance(Main.npc[num475].Center, projectile.Center);
|
||||
num472 = Main.npc[num475].Center.X;
|
||||
num473 = Main.npc[num475].Center.Y;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag17)
|
||||
{
|
||||
float num483 = 10f;
|
||||
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
|
||||
@@ -59,7 +59,6 @@ namespace CalamityMod.Projectiles.Magic
|
||||
dust.scale *= num333;
|
||||
num3 = num336;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
|
||||
@@ -30,27 +30,33 @@ namespace CalamityMod.Projectiles.Magic
|
||||
int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 100, default, 0.6f);
|
||||
Main.dust[num469].velocity *= 0f;
|
||||
}
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float num474 = 500f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
|
||||
{
|
||||
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
|
||||
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
|
||||
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
|
||||
if (num478 < num474)
|
||||
{
|
||||
num474 = num478;
|
||||
num472 = num476;
|
||||
num473 = num477;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag17)
|
||||
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float distance = 500f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num475].width / 2) + (float)(Main.npc[num475].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num475].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
distance = Vector2.Distance(Main.npc[num475].Center, projectile.Center);
|
||||
num472 = Main.npc[num475].Center.X;
|
||||
num473 = Main.npc[num475].Center.Y;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag17)
|
||||
{
|
||||
float num483 = 22f;
|
||||
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
@@ -62,7 +68,6 @@ namespace CalamityMod.Projectiles.Magic
|
||||
num485 *= num486;
|
||||
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,27 +32,33 @@ namespace CalamityMod.Projectiles.Magic
|
||||
int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num469].noGravity = true;
|
||||
Main.dust[num469].velocity *= 0f;
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float num474 = 400f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
|
||||
{
|
||||
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
|
||||
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
|
||||
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
|
||||
if (num478 < num474)
|
||||
{
|
||||
num474 = num478;
|
||||
num472 = num476;
|
||||
num473 = num477;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag17)
|
||||
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float distance = 400f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num475].width / 2) + (float)(Main.npc[num475].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num475].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
distance = Vector2.Distance(Main.npc[num475].Center, projectile.Center);
|
||||
num472 = Main.npc[num475].Center.X;
|
||||
num473 = Main.npc[num475].Center.Y;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag17)
|
||||
{
|
||||
float num483 = 10f;
|
||||
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
|
||||
@@ -46,27 +46,33 @@ namespace CalamityMod.Projectiles.Magic
|
||||
int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num458].noGravity = true;
|
||||
Main.dust[num458].velocity *= 0f;
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float num474 = 500f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
|
||||
{
|
||||
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
|
||||
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
|
||||
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
|
||||
if (num478 < num474)
|
||||
{
|
||||
num474 = num478;
|
||||
num472 = num476;
|
||||
num473 = num477;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag17)
|
||||
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float distance = 500f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num475].width / 2) + (float)(Main.npc[num475].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num475].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
distance = Vector2.Distance(Main.npc[num475].Center, projectile.Center);
|
||||
num472 = Main.npc[num475].Center.X;
|
||||
num473 = Main.npc[num475].Center.Y;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag17)
|
||||
{
|
||||
float num483 = 12f;
|
||||
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
|
||||
@@ -51,41 +51,41 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
projectile.velocity *= 0.98f;
|
||||
}
|
||||
int num3;
|
||||
for (int num433 = 0; num433 < 1000; num433 = num3 + 1)
|
||||
{
|
||||
num3 = num433;
|
||||
}
|
||||
int[] array = new int[20];
|
||||
int num434 = 0;
|
||||
float num435 = 400f;
|
||||
bool flag14 = false;
|
||||
for (int num436 = 0; num436 < 200; num436 = num3 + 1)
|
||||
{
|
||||
if (Main.npc[num436].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num437 = Main.npc[num436].position.X + (float)(Main.npc[num436].width / 2);
|
||||
float num438 = Main.npc[num436].position.Y + (float)(Main.npc[num436].height / 2);
|
||||
float num439 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num437) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num438);
|
||||
if (num439 < num435 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num436].Center, 1, 1))
|
||||
{
|
||||
if (num434 < 20)
|
||||
{
|
||||
array[num434] = num436;
|
||||
num434++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
num3 = num436;
|
||||
}
|
||||
if (projectile.timeLeft < 30)
|
||||
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float distance = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num430].width / 2) + (float)(Main.npc[num430].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num430].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (projectile.timeLeft < 30)
|
||||
{
|
||||
flag14 = false;
|
||||
}
|
||||
if (flag14)
|
||||
{
|
||||
int num440 = Main.rand.Next(num434);
|
||||
int num440 = Main.rand.Next(num428);
|
||||
num440 = array[num440];
|
||||
float num441 = Main.npc[num440].position.X + (float)(Main.npc[num440].width / 2);
|
||||
float num442 = Main.npc[num440].position.Y + (float)(Main.npc[num440].height / 2);
|
||||
@@ -103,7 +103,6 @@ namespace CalamityMod.Projectiles.Magic
|
||||
num444 *= num446;
|
||||
num445 *= num446;
|
||||
Projectile.NewProjectile(vector33.X, vector33.Y, num444, num445, ModContent.ProjectileType<MagneticBeam>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,29 +35,35 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
projectile.velocity *= 0.98f;
|
||||
}
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float num429 = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2);
|
||||
float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2);
|
||||
float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432);
|
||||
if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1))
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag14)
|
||||
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float distance = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num430].width / 2) + (float)(Main.npc[num430].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num430].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag14)
|
||||
{
|
||||
int num434 = Main.rand.Next(num428);
|
||||
num434 = array[num434];
|
||||
|
||||
@@ -33,27 +33,33 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Main.dust[num458].velocity *= 0.5f;
|
||||
Main.dust[num458].velocity += projectile.velocity * 0.1f;
|
||||
}
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float num474 = 800f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
|
||||
{
|
||||
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
|
||||
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
|
||||
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
|
||||
if (num478 < num474)
|
||||
{
|
||||
num474 = num478;
|
||||
num472 = num476;
|
||||
num473 = num477;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag17)
|
||||
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float distance = 800f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num475].width / 2) + (float)(Main.npc[num475].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num475].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
distance = Vector2.Distance(Main.npc[num475].Center, projectile.Center);
|
||||
num472 = Main.npc[num475].Center.X;
|
||||
num473 = Main.npc[num475].Center.Y;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag17)
|
||||
{
|
||||
float num483 = 30f;
|
||||
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
|
||||
@@ -26,27 +26,33 @@ namespace CalamityMod.Projectiles.Magic
|
||||
public override void AI()
|
||||
{
|
||||
projectile.rotation += projectile.velocity.X * 0.05f;
|
||||
float centerX = projectile.Center.X;
|
||||
float centerY = projectile.Center.Y;
|
||||
float num474 = 600f;
|
||||
bool homeIn = false;
|
||||
for (int i = 0; i < 200; i++)
|
||||
{
|
||||
if (Main.npc[i].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1))
|
||||
{
|
||||
float num476 = Main.npc[i].position.X + (float)(Main.npc[i].width / 2);
|
||||
float num477 = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2);
|
||||
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
|
||||
if (num478 < num474)
|
||||
{
|
||||
num474 = num478;
|
||||
centerX = num476;
|
||||
centerY = num477;
|
||||
homeIn = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (homeIn)
|
||||
|
||||
float centerX = projectile.Center.X;
|
||||
float centerY = projectile.Center.Y;
|
||||
float distance = 600f;
|
||||
bool homeIn = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num475].width / 2) + (float)(Main.npc[num475].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num475].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
distance = Vector2.Distance(Main.npc[num475].Center, projectile.Center);
|
||||
centerX = Main.npc[num475].Center.X;
|
||||
centerY = Main.npc[num475].Center.Y;
|
||||
homeIn = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (homeIn)
|
||||
{
|
||||
float num483 = 6f;
|
||||
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
|
||||
@@ -47,27 +47,33 @@ namespace CalamityMod.Projectiles.Magic
|
||||
int num102 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 92, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num102].noGravity = true;
|
||||
}
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float num474 = 500f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
|
||||
{
|
||||
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
|
||||
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
|
||||
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
|
||||
if (num478 < num474)
|
||||
{
|
||||
num474 = num478;
|
||||
num472 = num476;
|
||||
num473 = num477;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag17)
|
||||
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float distance = 500f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num475].width / 2) + (float)(Main.npc[num475].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num475].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
distance = Vector2.Distance(Main.npc[num475].Center, projectile.Center);
|
||||
num472 = Main.npc[num475].Center.X;
|
||||
num473 = Main.npc[num475].Center.Y;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag17)
|
||||
{
|
||||
float num483 = 8f;
|
||||
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
|
||||
@@ -35,29 +35,35 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
projectile.velocity *= 0.98f;
|
||||
}
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float num429 = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2);
|
||||
float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2);
|
||||
float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432);
|
||||
if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1))
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag14)
|
||||
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float distance = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num430].width / 2) + (float)(Main.npc[num430].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num430].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag14)
|
||||
{
|
||||
int num434 = Main.rand.Next(num428);
|
||||
num434 = array[num434];
|
||||
|
||||
@@ -35,29 +35,35 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
projectile.velocity *= 0.98f;
|
||||
}
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float num429 = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2);
|
||||
float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2);
|
||||
float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432);
|
||||
if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1))
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag14)
|
||||
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float distance = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num430].width / 2) + (float)(Main.npc[num430].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num430].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag14)
|
||||
{
|
||||
int num434 = Main.rand.Next(num428);
|
||||
num434 = array[num434];
|
||||
|
||||
@@ -69,27 +69,33 @@ namespace CalamityMod.Projectiles.Magic
|
||||
projectile.velocity = (projectile.velocity * (num953 - 1f) + vector102 * scaleFactor12) / num953;
|
||||
return;
|
||||
}
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float num474 = 600f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
|
||||
{
|
||||
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
|
||||
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
|
||||
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
|
||||
if (num478 < num474)
|
||||
{
|
||||
num474 = num478;
|
||||
num472 = num476;
|
||||
num473 = num477;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag17)
|
||||
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float distance = 600f;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num475].width / 2) + (float)(Main.npc[num475].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num475].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
distance = Vector2.Distance(Main.npc[num475].Center, projectile.Center);
|
||||
num472 = Main.npc[num475].Center.X;
|
||||
num473 = Main.npc[num475].Center.Y;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag17)
|
||||
{
|
||||
float num483 = 9f;
|
||||
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
|
||||
@@ -37,29 +37,35 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
projectile.velocity *= 0.98f;
|
||||
}
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float num429 = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2);
|
||||
float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2);
|
||||
float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432);
|
||||
if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1))
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag14)
|
||||
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float distance = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num430].width / 2) + (float)(Main.npc[num430].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num430].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag14)
|
||||
{
|
||||
int num434 = Main.rand.Next(num428);
|
||||
num434 = array[num434];
|
||||
|
||||
@@ -38,28 +38,34 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Main.dust[num458].velocity *= 0.5f;
|
||||
Main.dust[num458].velocity += projectile.velocity * 0.1f;
|
||||
}
|
||||
|
||||
homeTimer += 5f;
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float num474 = homeTimer;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
|
||||
{
|
||||
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
|
||||
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
|
||||
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
|
||||
if (num478 < num474)
|
||||
{
|
||||
num474 = num478;
|
||||
num472 = num476;
|
||||
num473 = num477;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag17)
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float distance = homeTimer;
|
||||
bool flag17 = false;
|
||||
for (int num475 = 0; num475 < 200; num475++)
|
||||
{
|
||||
if (Main.npc[num475].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[num475].width / 2) + (float)(Main.npc[num475].height / 2);
|
||||
|
||||
bool useCollisionDetection = extraDistance < distance;
|
||||
bool canHit = true;
|
||||
if (useCollisionDetection)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[num475].Center, projectile.Center) < (distance + extraDistance) && canHit)
|
||||
{
|
||||
distance = Vector2.Distance(Main.npc[num475].Center, projectile.Center);
|
||||
num472 = Main.npc[num475].Center.X;
|
||||
num473 = Main.npc[num475].Center.Y;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag17)
|
||||
{
|
||||
float num483 = 25f;
|
||||
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace CalamityMod.Tiles.Abyss
|
||||
}
|
||||
if (i < 250 || i > Main.maxTilesX - 250)
|
||||
{
|
||||
if (Main.rand.Next(400) == 0)
|
||||
if (Main.rand.NextBool(400))
|
||||
{
|
||||
if (Main.tile[i, tileLocationY].liquid == 255)
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace CalamityMod.Tiles.Crags
|
||||
return TileFraming.BrimstoneFraming(i, j, resetFrame);
|
||||
}
|
||||
|
||||
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
/*public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Texture2D sprite = ModContent.GetTexture("CalamityMod/Tiles/Crags/BrimstoneSlagGlow");
|
||||
@@ -93,7 +93,7 @@ namespace CalamityMod.Tiles.Crags
|
||||
Main.spriteBatch.Draw(sprite, new Vector2((float)(i * 16 - (int)Main.screenPosition.X) + (float)num10, (float)(j * 16 - (int)Main.screenPosition.Y + index4 * 2)) + zero, drawRectangle, drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
private Color GetDrawColour(int i, int j, Color colour)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user