Fix Vigilance circle item use
This commit is contained in:
1 parent
3f3426b7e4
commit
323225f8fe
2 files changed
+11
-24
No files matched your search
@@ -40,28 +40,14 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
{
|
||||
if (player.altFunctionUse != 2)
|
||||
{
|
||||
int seekerIndex = 0;
|
||||
int totalSeekers = 1;
|
||||
for (int i = 0; i < Main.maxProjectiles; i++)
|
||||
if (player.maxMinions - player.slotsMinions >= 1f)
|
||||
{
|
||||
if (Main.projectile[i].type != type || !Main.projectile[i].active || Main.projectile[i].owner != player.whoAmI)
|
||||
continue;
|
||||
|
||||
totalSeekers++;
|
||||
}
|
||||
|
||||
int p = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI);
|
||||
if (Main.projectile.IndexInRange(p))
|
||||
Main.projectile[p].originalDamage = Item.damage;
|
||||
|
||||
for (int i = 0; i < Main.maxProjectiles; i++)
|
||||
{
|
||||
if (Main.projectile[i].type != type || !Main.projectile[i].active || Main.projectile[i].owner != player.whoAmI)
|
||||
continue;
|
||||
Main.projectile[i].ai[0] = seekerIndex / (float)totalSeekers;
|
||||
Main.projectile[i].netUpdate = true;
|
||||
|
||||
seekerIndex++;
|
||||
int p = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI);
|
||||
if (Main.projectile.IndexInRange(p))
|
||||
{
|
||||
Main.projectile[p].ai[0] = player.ownedProjectileCounts[type];
|
||||
Main.projectile[p].originalDamage = Item.damage;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -90,8 +90,9 @@ namespace CalamityMod.Projectiles.Summon
|
||||
|
||||
internal void DetermineFrames()
|
||||
{
|
||||
Projectile.frameCounter++;
|
||||
if (Projectile.frameCounter % 5 == 4)
|
||||
if (Projectile.FinalExtraUpdate())
|
||||
Projectile.frameCounter++;
|
||||
if (Projectile.frameCounter % 6 == 5)
|
||||
Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type];
|
||||
}
|
||||
|
||||
@@ -101,7 +102,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
if (Main.rand.NextBool(1600))
|
||||
SoundEngine.PlaySound(SoundID.DD2_KoboldFlyerHurt);
|
||||
|
||||
Vector2 destination = Owner.Center + (MathHelper.TwoPi * CircleAngleRatio - MathHelper.PiOver2).ToRotationVector2() * 310f;
|
||||
Vector2 destination = Owner.Center + (MathHelper.TwoPi * CircleAngleRatio / Owner.ownedProjectileCounts[Type] - MathHelper.PiOver2).ToRotationVector2() * 310f;
|
||||
Projectile.Center = Vector2.Lerp(Projectile.Center, destination, 0.03f);
|
||||
|
||||
if (!Projectile.WithinRange(destination, 20f))
|
||||
|
||||
Reference in new issue
Block a user