Various tweaks and fixes
This commit is contained in:
1 parent
c7a2a89258
commit
b1eae4fd8f
5 files changed
+376
-370
No files matched your search
+348
-342
File diff suppressed because it is too large.
Load diff
@@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
bannerItem = ModContent.ItemType<WulfrumDroneBanner>();
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
public override void PostAI()
|
||||
{
|
||||
npc.spriteDirection = (npc.direction > 0) ? 1 : -1;
|
||||
}
|
||||
|
||||
@@ -114,12 +114,12 @@ namespace CalamityMod.Projectiles.Summon
|
||||
projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt();
|
||||
if (flag25)
|
||||
{
|
||||
projectile.rotation = (vector46 - projectile.Center).ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.ToRadians(180) * projectile.direction);
|
||||
projectile.rotation = projectile.rotation.AngleLerp((vector46 - projectile.Center).ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.ToRadians(180) * projectile.direction), 0.1f);
|
||||
projectile.spriteDirection *= -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.rotation = vector.ToRotation() - (projectile.spriteDirection == 1 ? 0f : MathHelper.ToRadians(180) * projectile.direction);
|
||||
projectile.rotation = projectile.rotation.AngleLerp(vector.ToRotation() - (projectile.spriteDirection == 1 ? 0f : MathHelper.ToRadians(180) * projectile.direction), 0.1f);
|
||||
}
|
||||
projectile.Center = player.Center + new Vector2(80, 0).RotatedBy(rotation);
|
||||
rotation += 0.03;
|
||||
@@ -168,7 +168,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
float scaleFactor3 = 6f;
|
||||
int num658 = ModContent.ProjectileType<AstralProbeRound>();
|
||||
if (flag25 && projectile.ai[1] == 0f)
|
||||
if (flag25 && projectile.ai[1] == 0f && vector46 != projectile.position)
|
||||
{
|
||||
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 12, 0.5f, 0f);
|
||||
projectile.ai[1] += 1f;
|
||||
|
||||
@@ -140,30 +140,30 @@ namespace CalamityMod.Projectiles.Summon
|
||||
projectile.velocity.X = MathHelper.Clamp(projectile.velocity.X, -12f, 12f);
|
||||
}
|
||||
projectile.velocity.Y = (targetPosition.Y - projectile.Center.Y + potentialTarget.spriteDirection * 75f) / 90f;
|
||||
float SAImovement = 0.05f;
|
||||
for (int index = 0; index < Main.projectile.Length; index++)
|
||||
}
|
||||
float SAImovement = 0.05f;
|
||||
for (int index = 0; index < Main.projectile.Length; index++)
|
||||
{
|
||||
Projectile proj = Main.projectile[index];
|
||||
if (index != projectile.whoAmI &&
|
||||
proj.active && proj.owner == projectile.owner &&
|
||||
proj.type == projectile.type && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < projectile.width)
|
||||
{
|
||||
Projectile proj = Main.projectile[index];
|
||||
if (index != projectile.whoAmI &&
|
||||
proj.active && proj.owner == projectile.owner &&
|
||||
proj.type == projectile.type && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < projectile.width)
|
||||
if (projectile.position.X < proj.position.X)
|
||||
{
|
||||
if (projectile.position.X < proj.position.X)
|
||||
{
|
||||
projectile.velocity.X -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.X += SAImovement;
|
||||
}
|
||||
if (projectile.position.Y < proj.position.Y)
|
||||
{
|
||||
projectile.velocity.Y -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.Y += SAImovement;
|
||||
}
|
||||
projectile.velocity.X -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.X += SAImovement;
|
||||
}
|
||||
if (projectile.position.Y < proj.position.Y)
|
||||
{
|
||||
projectile.velocity.Y -= SAImovement;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.Y += SAImovement;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace CalamityMod
|
||||
//if we've found a valid boss target, ignore ALL targets which aren't bosses.
|
||||
if (bossFound && !Main.npc[index].boss)
|
||||
continue;
|
||||
if (Main.npc[index].CanBeChasedBy(null, false))
|
||||
if (Main.npc[index].CanBeChasedBy(null, false) || (Main.npc[index].active && Main.npc[index].type == NPCID.TargetDummy))
|
||||
{
|
||||
if (Vector2.Distance(origin, Main.npc[index].Center) < distance)
|
||||
{
|
||||
@@ -155,7 +155,7 @@ namespace CalamityMod
|
||||
{
|
||||
for (int index = 0; index < Main.npc.Length; index++)
|
||||
{
|
||||
if (Main.npc[index].CanBeChasedBy(null, false))
|
||||
if (Main.npc[index].CanBeChasedBy(null, false) || (Main.npc[index].active && Main.npc[index].type == NPCID.TargetDummy))
|
||||
{
|
||||
if (Vector2.Distance(origin, Main.npc[index].Center) < distance)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user