Some homing melee projectiles reworked.

This commit is contained in:
Andrew Marheine committed 2020-02-12 23:00:08 -06:00
1 parent 7123efbc44
commit ea1f677b7c
43 files changed
+1160 -913

No files matched your search

+30 -23
View File
@@ -44,30 +44,37 @@ namespace CalamityMod.Projectiles.Melee
Main.dust[num250].velocity *= 0f;
}
}
Lighting.AddLight(projectile.Center, 0.15f, 1f, 0.25f);
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];
+27 -21
View File
@@ -34,27 +34,33 @@ namespace CalamityMod.Projectiles.Melee
public override void AI()
{
Lighting.AddLight(projectile.Center, 0.6f, 0f, 0f);
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 460f;
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);
+27 -21
View File
@@ -33,27 +33,33 @@ namespace CalamityMod.Projectiles.Melee
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 = 6f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -33,27 +33,33 @@ namespace CalamityMod.Projectiles.Melee
Main.dust[num469].velocity *= 0f;
}
}
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 = 6f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -33,27 +33,33 @@ namespace CalamityMod.Projectiles.Melee
public override void AI()
{
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.05f / 255f, (255 - projectile.alpha) * 0.05f / 255f);
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 = 15f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+29 -23
View File
@@ -49,29 +49,35 @@ namespace CalamityMod.Projectiles.Melee
return;
}
}
int[] array = new int[20];
int num428 = 0;
float num429 = 500f;
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 = 500f;
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];
+27 -21
View File
@@ -34,27 +34,33 @@ namespace CalamityMod.Projectiles.Melee
Main.dust[num458].noGravity = true;
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 = 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 = 18f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -30,27 +30,33 @@ namespace CalamityMod.Projectiles.Melee
int num250 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f);
Main.dust[num250].noGravity = true;
Main.dust[num250].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 = 25f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+26 -21
View File
@@ -157,27 +157,32 @@ namespace CalamityMod.Projectiles.Melee
case 4: // Green, home in on enemies
color = new Color(0, 255, 0, alpha);
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 = 12f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -38,27 +38,33 @@ namespace CalamityMod.Projectiles.Melee
{
projectile.frame = 0;
}
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 = 10f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -39,27 +39,33 @@ namespace CalamityMod.Projectiles.Melee
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
}
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 600f;
bool flag17 = false;
for (int num475 = 0; num475 < Main.npc.Length; 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 = 18f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -50,27 +50,33 @@ namespace CalamityMod.Projectiles.Melee
Main.dust[num458].velocity *= 0f;
}
}
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 = 14f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -81,27 +81,33 @@ namespace CalamityMod.Projectiles.Melee
Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f);
}
}
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 1600f;
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 = 1600f;
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 = 35f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -80,27 +80,33 @@ namespace CalamityMod.Projectiles.Melee
Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f);
}
}
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 1600f;
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 = 1600f;
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 = 35f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -65,27 +65,33 @@ namespace CalamityMod.Projectiles.Melee
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 = 14f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -65,27 +65,33 @@ namespace CalamityMod.Projectiles.Melee
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 = 16f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -64,27 +64,33 @@ namespace CalamityMod.Projectiles.Melee
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 = 18f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -36,27 +36,33 @@ namespace CalamityMod.Projectiles.Melee
public override void AI()
{
Lighting.AddLight(projectile.Center, 0f, 0.5f, 0f);
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 = 25f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -86,27 +86,33 @@ namespace CalamityMod.Projectiles.Melee
Main.dust[num458].noGravity = true;
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 = 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);
+27 -21
View File
@@ -57,27 +57,33 @@ namespace CalamityMod.Projectiles.Melee
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 = 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 = 9f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -33,27 +33,33 @@ namespace CalamityMod.Projectiles.Melee
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 = 6f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -34,27 +34,33 @@ namespace CalamityMod.Projectiles.Melee
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 = 7f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+14 -9
View File
@@ -137,24 +137,29 @@ namespace CalamityMod.Projectiles.Melee
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)
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 = 15f;
+27 -21
View File
@@ -34,27 +34,33 @@ namespace CalamityMod.Projectiles.Melee
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 = 18f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -48,27 +48,33 @@ namespace CalamityMod.Projectiles.Melee
int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, 0f, 0f, 100, default, 0.8f);
Main.dust[num458].noGravity = true;
Main.dust[num458].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 = 12f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -33,27 +33,33 @@ namespace CalamityMod.Projectiles.Melee
int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 2f);
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 = 14f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+28 -22
View File
@@ -49,29 +49,35 @@ namespace CalamityMod.Projectiles.Melee
Main.dust[num469].velocity *= 0f;
}
}
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 150f * 3f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float distance = 450f;
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)
{
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 num483 = 5f * 3f;
float num483 = 15f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
+27 -21
View File
@@ -44,27 +44,33 @@ namespace CalamityMod.Projectiles.Melee
{
projectile.rotation += 0.5f;
}
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 = 35f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -36,27 +36,33 @@ namespace CalamityMod.Projectiles.Melee
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 = 20f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+25 -20
View File
@@ -50,26 +50,31 @@ namespace CalamityMod.Projectiles.Melee
projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction;
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 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 = 12f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+26 -21
View File
@@ -28,27 +28,32 @@ namespace CalamityMod.Projectiles.Melee
public override void AI()
{
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 = 20f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -34,27 +34,33 @@ namespace CalamityMod.Projectiles.Melee
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))
{
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);
+27 -21
View File
@@ -83,27 +83,33 @@ namespace CalamityMod.Projectiles.Melee
{
projectile.velocity.Y = 16f;
}
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 150f;
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 = 150f;
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);
+27 -21
View File
@@ -39,27 +39,33 @@ namespace CalamityMod.Projectiles.Melee
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 = 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 = 12f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+27 -21
View File
@@ -39,27 +39,33 @@ namespace CalamityMod.Projectiles.Melee
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 = 1000f;
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 = 1000f;
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 = 18f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
+28 -23
View File
@@ -34,29 +34,34 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override void AI()
{
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 + Main.npc[num430].width / 2;
float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2;
float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + 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];
+28 -23
View File
@@ -31,29 +31,34 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override void AI()
{
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 + Main.npc[num430].width / 2;
float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2;
float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + 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];
+28 -23
View File
@@ -30,29 +30,34 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override void AI()
{
int[] array = new int[20];
int num428 = 0;
float num429 = 450f;
bool flag14 = false;
for (int num430 = 0; num430 < 200; num430++)
{
if (Main.npc[num430].CanBeChasedBy(projectile, false))
{
float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2;
float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2;
float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + 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 = 450f;
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];
+28 -23
View File
@@ -33,29 +33,34 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override void AI()
{
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 + Main.npc[num430].width / 2;
float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2;
float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + 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];
+28 -23
View File
@@ -31,29 +31,34 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override void AI()
{
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 + Main.npc[num430].width / 2;
float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2;
float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + 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];
+28 -25
View File
@@ -30,31 +30,34 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override void AI()
{
if (Main.rand.NextBool(5))
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 73, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
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 + Main.npc[num430].width / 2;
float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2;
float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + 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];
+30 -23
View File
@@ -38,31 +38,38 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
{
projectile.velocity.X *= 1.01f;
projectile.velocity.Y *= 1.01f;
if (Main.rand.NextBool(5))
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 75, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
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 + Main.npc[num430].width / 2;
float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2;
float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + 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];
+28 -23
View File
@@ -30,29 +30,34 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override void AI()
{
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 + Main.npc[num430].width / 2;
float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2;
float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + 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];