bug fixes
This commit is contained in:
1 parent
1bc7feecd4
commit
c08bbc022b
4 files changed
+34
-12
No files matched your search
@@ -46,8 +46,38 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
|
||||
}
|
||||
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, projectile.Calamity().stealthStrike ? 800f : 400f, 14f, 20f);
|
||||
projectile.velocity = initStealth && !flag17 ? initialVelocity : projectile.velocity;
|
||||
Vector2 center = projectile.Center;
|
||||
float maxDistance = projectile.Calamity().stealthStrike ? 800f : 400f;
|
||||
bool homeIn = false;
|
||||
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
{
|
||||
if (Main.npc[i].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2);
|
||||
|
||||
bool canHit = true;
|
||||
if (extraDistance < maxDistance && !ignoreTiles)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance) && canHit)
|
||||
{
|
||||
center = Main.npc[i].Center;
|
||||
homeIn = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (homeIn)
|
||||
{
|
||||
Vector2 homeInVector = projectile.DirectionTo(center);
|
||||
if (homeInVector.HasNaNs())
|
||||
homeInVector = Vector2.UnitY;
|
||||
|
||||
projectile.velocity = (projectile.velocity * 20f + homeInVector * 14f) / (21f);
|
||||
}
|
||||
projectile.velocity = initStealth && !homeIn ? initialVelocity : projectile.velocity;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
|
||||
@@ -42,11 +42,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2);
|
||||
|
||||
bool canHit = true;
|
||||
if (extraDistance < maxDistance && !ignoreTiles)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance) && canHit)
|
||||
if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance))
|
||||
{
|
||||
center = Main.npc[i].Center;
|
||||
homeIn = true;
|
||||
|
||||
@@ -50,10 +50,6 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2);
|
||||
|
||||
bool canHit = true;
|
||||
if (extraDistance < maxDistance && !ignoreTiles)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1))
|
||||
{
|
||||
center = Main.npc[i].Center;
|
||||
|
||||
@@ -237,7 +237,7 @@ namespace CalamityMod
|
||||
r.AddIngredient(ItemID.BottledWater);
|
||||
r.AddIngredient(ItemID.Daybloom);
|
||||
r.AddIngredient(ModContent.ItemType<BlightedLens>());
|
||||
r.AddTile(TileID.Bottle);
|
||||
r.AddTile(TileID.Bottles);
|
||||
r.SetResult(ItemID.ArcheryPotion);
|
||||
r.AddRecipe();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user