diff --git a/Items/Weapons/Summon/EtherealSubjugator.cs b/Items/Weapons/Summon/EtherealSubjugator.cs index 17c2215f30..49ec3e3d51 100644 --- a/Items/Weapons/Summon/EtherealSubjugator.cs +++ b/Items/Weapons/Summon/EtherealSubjugator.cs @@ -15,14 +15,13 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Ethereal Subjugator"); - Tooltip.SetDefault("Summons a phantom to protect you\n" + - "Each phantom takes only half of a minion slot"); + Tooltip.SetDefault("Summons a phantom to protect you"); SacrificeTotal = 1; } public override void SetDefaults() { - Item.damage = 45; + Item.damage = 200; Item.mana = 10; Item.width = 66; Item.height = 70; diff --git a/Projectiles/Ranged/ExoFlare.cs b/Projectiles/Ranged/ExoFlare.cs index 1d4475778c..45e1e85147 100644 --- a/Projectiles/Ranged/ExoFlare.cs +++ b/Projectiles/Ranged/ExoFlare.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Ranged float colorInterpolation = (float)Math.Cos(Projectile.timeLeft / 16f + Main.GlobalTimeWrappedHourly / 20f + i / (float)Projectile.oldPos.Length * MathHelper.Pi) * 0.5f + 0.5f; Color color = Color.Lerp(Color.LightGreen, Color.LightPink, colorInterpolation) * 0.4f; color.A = 0; - Vector2 drawPosition = Projectile.oldPos[i] + lightTexture.Size() * 0.5f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Vector2 drawPosition = Projectile.oldPos[i] + lightTexture.Size() * 0.5f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY) + new Vector2(-25f, -25f); Color outerColor = color; Color innerColor = color * 0.5f; float intensity = 0.9f + 0.15f * (float)Math.Cos(Main.GlobalTimeWrappedHourly % 60f * MathHelper.TwoPi); diff --git a/Projectiles/Ranged/ExoLight.cs b/Projectiles/Ranged/ExoLight.cs index eb4fe298d0..df4c7a12e3 100644 --- a/Projectiles/Ranged/ExoLight.cs +++ b/Projectiles/Ranged/ExoLight.cs @@ -145,7 +145,7 @@ namespace CalamityMod.Projectiles.Ranged Color.SlateGray }) * Projectile.Opacity; color.A = 0; - Vector2 drawPosition = Projectile.oldPos[i] + lightTexture.Size() * 0.5f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Vector2 drawPosition = Projectile.oldPos[i] + lightTexture.Size() * 0.5f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY) + new Vector2(-15f, -15f); Color outerColor = color; Color innerColor = color * 0.5f; float intensity = 0.9f + 0.15f * (float)Math.Cos(Main.GlobalTimeWrappedHourly % 60f * MathHelper.TwoPi); diff --git a/Projectiles/Summon/GhostFire.cs b/Projectiles/Summon/GhostFire.cs index 855bfd6bce..b8533cfe3a 100644 --- a/Projectiles/Summon/GhostFire.cs +++ b/Projectiles/Summon/GhostFire.cs @@ -1,49 +1,135 @@ -using Microsoft.Xna.Framework; +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Summon { public class GhostFire : ModProjectile { public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public bool ableToHit = true; + public NPC target; public override void SetStaticDefaults() { - DisplayName.SetDefault("Fire"); + DisplayName.SetDefault("Ghastly Particle"); ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; } public override void SetDefaults() { - Projectile.width = 4; - Projectile.height = 4; + Projectile.width = Projectile.height = 16; Projectile.friendly = true; Projectile.tileCollide = false; - Projectile.penetrate = -1; - Projectile.extraUpdates = 100; - Projectile.timeLeft = 80; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 50; + Projectile.penetrate = 200; + Projectile.extraUpdates = 3; + Projectile.timeLeft = 600; Projectile.minion = true; Projectile.minionSlots = 0f; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 50; Projectile.DamageType = DamageClass.Summon; } + public override bool? CanDamage() => ableToHit ? (bool?)null : false; public override void AI() { - Projectile.localAI[0] += 1f; - if (Projectile.localAI[0] > 6f) + Player player = Main.player[Projectile.owner]; + Projectile.localAI[0] += 1f / (Projectile.extraUpdates + 1); + + if (Projectile.penetrate < 200) //If an enemy has already been hit by the projectile, prevents any further homing capabilities { - Vector2 vector33 = Projectile.position; - vector33 -= Projectile.velocity * 0.25f; - Projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 180, 0f, 0f, 0, default, 0.2f); - Main.dust[num448].position = vector33; - Main.dust[num448].noGravity = true; - Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; - Main.dust[num448].velocity *= 0.2f; + if (Projectile.timeLeft > 60) { Projectile.timeLeft = 60; } //The projectile start shrinking and slowing down. it can still hit for a bit during this, to allow a bit of multi-target if the enemies are really close to eachother. + Projectile.velocity *= 0.88f; } + else if (Projectile.localAI[0] < 60f) //If the projectile hasn't been alive for 1 second yet, slow it down more every frame and prevent any homing capabilities. + { + Projectile.velocity *= 0.93f; + } + else FindTarget(player); //No barricades stand in our way. FIND AND KILL! + + if (Projectile.timeLeft <= 20) //removes projectile's ability to hit when it is super close to death because it will have been visually shrunk to almost nothing in PreDraw + { + ableToHit = false; + } + } + public void FindTarget(Player player) + { + float maxDistance = 3000f; + bool foundTarget = false; + if (player.HasMinionAttackTargetNPC) //Targetted enemy takes priority for homing no matter what. + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(Projectile, false)) + { + float targetDist = Vector2.Distance(npc.Center, Projectile.Center); + if (targetDist < maxDistance) + { + maxDistance = targetDist; + foundTarget = true; + target = npc; + } + } + } + if (!foundTarget) + { + for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) + { + NPC npc = Main.npc[npcIndex]; + if (npc.CanBeChasedBy(Projectile, false)) + { + float targetDist = Vector2.Distance(npc.Center, Projectile.Center); + if (targetDist < maxDistance) + { + maxDistance = targetDist; + foundTarget = true; + target = npc; + } + } + } + } + if (!foundTarget) //If the enemy that the projectile was heading towards died prematurely, slow down the projectile if there are no new targets. + { + Projectile.velocity *= 0.98f; + } + else KillTheThing(target); //If there is an npc found, seek and destroy. + } + public void KillTheThing(NPC npc) + { + Projectile.velocity = Projectile.SuperhomeTowardsTarget(npc, 50f/(Projectile.extraUpdates+1), 60f / (Projectile.extraUpdates + 1), 1f / (Projectile.extraUpdates + 1)); //predictionStrength is lessened to account for extra updates, otherwise the projectile tends to copy fast NPC movement 1:1. Not Cool. + } + public override bool PreDraw(ref Color lightColor) //photoviscerator ball drawcode, slightly edited + { + Texture2D lightTexture = ModContent.Request("CalamityMod/ExtraTextures/SmallGreyscaleCircle").Value; + for (int i = 0; i < Projectile.oldPos.Length; i++) + { + float colorInterpolation = (float)Math.Cos(Projectile.timeLeft / 32f + Main.GlobalTimeWrappedHourly / 20f + i / (float)Projectile.oldPos.Length * MathHelper.Pi) * 0.5f + 0.5f; + Color color = Color.Lerp(Color.Cyan, Color.LightBlue, colorInterpolation) * 0.4f; + color.A = 0; + Vector2 drawPosition = Projectile.oldPos[i] + lightTexture.Size() * 0.5f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY) + new Vector2 (-28f, -28f); //Last vector is to offset the circle so that it is displayed where the hitbox actually is, instead of a bit down and to the right. + Color outerColor = color; + Color innerColor = color * 0.5f; + float intensity = 0.9f + 0.15f * (float)Math.Cos(Main.GlobalTimeWrappedHourly % 60f * MathHelper.TwoPi); + intensity *= MathHelper.Lerp(0.15f, 1f, 1f - i / (float)Projectile.oldPos.Length); + if (Projectile.timeLeft <= 60) //Shrinks to nothing when projectile is nearing death + { + intensity *= Projectile.timeLeft / 60f; + } + // Become smaller the futher along the old positions we are. + Vector2 outerScale = new Vector2(1f) * intensity; + Vector2 innerScale = new Vector2(1f) * intensity * 0.7f; + outerColor *= intensity; + innerColor *= intensity; + Main.EntitySpriteDraw(lightTexture, drawPosition, null, outerColor, 0f, lightTexture.Size() * 0.5f, outerScale * 0.6f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(lightTexture, drawPosition, null, innerColor, 0f, lightTexture.Size() * 0.5f, innerScale * 0.6f, SpriteEffects.None, 0); + } + return false; } } } diff --git a/Projectiles/Summon/PhantomGuy.cs b/Projectiles/Summon/PhantomGuy.cs index e22c0e9ae4..c72e629c16 100644 --- a/Projectiles/Summon/PhantomGuy.cs +++ b/Projectiles/Summon/PhantomGuy.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.netImportant = true; Projectile.friendly = true; Projectile.ignoreWater = true; - Projectile.minionSlots = 0.5f; + Projectile.minionSlots = 1f; Projectile.timeLeft = 18000; Projectile.penetrate = -1; Projectile.tileCollide = false; @@ -36,6 +36,9 @@ namespace CalamityMod.Projectiles.Summon Projectile.DamageType = DamageClass.Summon; } + public int shootTimeCounter = 0; + bool canShoot = false; + public override void AI() { Player player = Main.player[Projectile.owner]; @@ -80,7 +83,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(Projectile, false)) { float num646 = Vector2.Distance(npc.Center, Projectile.Center); - if (!flag25 && num646 < num633) + if (num646 < num633) { num633 = num646; vector46 = npc.Center; @@ -194,24 +197,37 @@ namespace CalamityMod.Projectiles.Summon } if (Projectile.ai[0] == 0f) { - float scaleFactor3 = 6f; - int num658 = ModContent.ProjectileType(); if (flag25 && Projectile.ai[1] == 0f) { - SoundEngine.PlaySound(SoundID.Item20, Projectile.position); Projectile.ai[1] += 1f; if (Main.myPlayer == Projectile.owner) { - Vector2 value19 = vector46 - Projectile.Center; - value19.Normalize(); - value19 *= scaleFactor3; - int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, value19.X, value19.Y, num658, Projectile.damage, 0f, Main.myPlayer, 0f, 0f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Projectile.originalDamage; + canShoot = true; Projectile.netUpdate = true; } } } + if (canShoot) + { + shootTimeCounter++; + + if (shootTimeCounter % 20 == 0 && shootTimeCounter <= 60) + { + SoundEngine.PlaySound(SoundID.Item20, Projectile.position); + float randomRadius = Main.rand.Next(10, 14); + Vector2 randomVelocity = Main.rand.NextVector2CircularEdge(randomRadius, randomRadius); + Projectile.velocity -= randomVelocity*0.22f; //funny recoil + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, randomVelocity.X, randomVelocity.Y, ModContent.ProjectileType(), Projectile.damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.netUpdate = true; + } + if (shootTimeCounter > 200) + { + canShoot = false; + shootTimeCounter = 0; + Projectile.netUpdate = true; + } + + } } public override Color? GetAlpha(Color lightColor) diff --git a/Tiles/Furniture/ChaosCandle.cs b/Tiles/Furniture/ChaosCandle.cs index 15604d6fba..6d59836a4d 100644 --- a/Tiles/Furniture/ChaosCandle.cs +++ b/Tiles/Furniture/ChaosCandle.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Tiles.Furniture public override bool RightClick(int i, int j) { - CalamityUtils.RightClickBreak(i, j); + CalamityUtils.LightHitWire(Type, i, j, 1, 1); return true; } } diff --git a/Tiles/Furniture/Fountains/AbyssFountainTile.cs b/Tiles/Furniture/Fountains/AbyssFountainTile.cs index 7d49acf4ea..b7cb48fa38 100644 --- a/Tiles/Furniture/Fountains/AbyssFountainTile.cs +++ b/Tiles/Furniture/Fountains/AbyssFountainTile.cs @@ -1,8 +1,10 @@ using CalamityMod.Items.Placeables.Furniture.Fountains; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -19,7 +21,7 @@ namespace CalamityMod.Tiles.Furniture.Fountains public override void NearbyEffects(int i, int j, bool closer) { - if (Main.tile[i, j].TileFrameX < 36) + if (Main.tile[i, j].TileFrameX >= 36) CalamityGlobalTile.SetActiveFountainColor(ModContent.Find("CalamityMod/AbyssWater").Slot); } @@ -60,6 +62,7 @@ namespace CalamityMod.Tiles.Furniture.Fountains public override bool RightClick(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 2, 4); + SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16)); return true; } diff --git a/Tiles/Furniture/Fountains/AbyssFountainTile.png b/Tiles/Furniture/Fountains/AbyssFountainTile.png index 68927bab25..145dd37d5c 100644 Binary files a/Tiles/Furniture/Fountains/AbyssFountainTile.png and b/Tiles/Furniture/Fountains/AbyssFountainTile.png differ diff --git a/Tiles/Furniture/Fountains/AbyssFountainTile_Highlight.png b/Tiles/Furniture/Fountains/AbyssFountainTile_Highlight.png index 1d1e01fe1a..6288ffd19a 100644 Binary files a/Tiles/Furniture/Fountains/AbyssFountainTile_Highlight.png and b/Tiles/Furniture/Fountains/AbyssFountainTile_Highlight.png differ diff --git a/Tiles/Furniture/Fountains/AstralFountainTile.cs b/Tiles/Furniture/Fountains/AstralFountainTile.cs index 042d6ae760..8bcc5d495d 100644 --- a/Tiles/Furniture/Fountains/AstralFountainTile.cs +++ b/Tiles/Furniture/Fountains/AstralFountainTile.cs @@ -2,8 +2,10 @@ using CalamityMod.Items.Placeables.Furniture.Fountains; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -20,7 +22,7 @@ namespace CalamityMod.Tiles.Furniture.Fountains public override void NearbyEffects(int i, int j, bool closer) { - if (Main.tile[i, j].TileFrameX < 36) + if (Main.tile[i, j].TileFrameX >= 36) CalamityGlobalTile.SetActiveFountainColor(ModContent.Find("CalamityMod/AstralWater").Slot); } @@ -61,6 +63,7 @@ namespace CalamityMod.Tiles.Furniture.Fountains public override bool RightClick(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 2, 4); + SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16)); return true; } diff --git a/Tiles/Furniture/Fountains/AstralFountainTile.png b/Tiles/Furniture/Fountains/AstralFountainTile.png index 126498ac4d..d727da44c5 100644 Binary files a/Tiles/Furniture/Fountains/AstralFountainTile.png and b/Tiles/Furniture/Fountains/AstralFountainTile.png differ diff --git a/Tiles/Furniture/Fountains/AstralFountainTile_Highlight.png b/Tiles/Furniture/Fountains/AstralFountainTile_Highlight.png index 169f6ac0a3..b9b2a85f47 100644 Binary files a/Tiles/Furniture/Fountains/AstralFountainTile_Highlight.png and b/Tiles/Furniture/Fountains/AstralFountainTile_Highlight.png differ diff --git a/Tiles/Furniture/Fountains/SulphurousFountainTile.cs b/Tiles/Furniture/Fountains/SulphurousFountainTile.cs index 597f60a3f1..dd0c8e6797 100644 --- a/Tiles/Furniture/Fountains/SulphurousFountainTile.cs +++ b/Tiles/Furniture/Fountains/SulphurousFountainTile.cs @@ -1,8 +1,10 @@ using CalamityMod.Items.Placeables.Furniture.Fountains; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -19,7 +21,7 @@ namespace CalamityMod.Tiles.Furniture.Fountains public override void NearbyEffects(int i, int j, bool closer) { - if (Main.tile[i, j].TileFrameX < 36) + if (Main.tile[i, j].TileFrameX >= 36) CalamityGlobalTile.SetActiveFountainColor(ModContent.Find("CalamityMod/SulphuricWater").Slot); } @@ -60,6 +62,7 @@ namespace CalamityMod.Tiles.Furniture.Fountains public override bool RightClick(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 2, 4); + SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16)); return true; } diff --git a/Tiles/Furniture/Fountains/SulphurousFountainTile.png b/Tiles/Furniture/Fountains/SulphurousFountainTile.png index 9dfcecd6e6..ddbdeb2212 100644 Binary files a/Tiles/Furniture/Fountains/SulphurousFountainTile.png and b/Tiles/Furniture/Fountains/SulphurousFountainTile.png differ diff --git a/Tiles/Furniture/Fountains/SulphurousFountainTile_Highlight.png b/Tiles/Furniture/Fountains/SulphurousFountainTile_Highlight.png index 31243c312d..92589b7b11 100644 Binary files a/Tiles/Furniture/Fountains/SulphurousFountainTile_Highlight.png and b/Tiles/Furniture/Fountains/SulphurousFountainTile_Highlight.png differ diff --git a/Tiles/Furniture/Fountains/SunkenSeaFountainTile.cs b/Tiles/Furniture/Fountains/SunkenSeaFountainTile.cs index 4a8fb520f0..699f5f2202 100644 --- a/Tiles/Furniture/Fountains/SunkenSeaFountainTile.cs +++ b/Tiles/Furniture/Fountains/SunkenSeaFountainTile.cs @@ -1,8 +1,10 @@ using CalamityMod.Items.Placeables.Furniture.Fountains; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -19,7 +21,7 @@ namespace CalamityMod.Tiles.Furniture.Fountains public override void NearbyEffects(int i, int j, bool closer) { - if (Main.tile[i, j].TileFrameX < 36) + if (Main.tile[i, j].TileFrameX >= 36) CalamityGlobalTile.SetActiveFountainColor(ModContent.Find("CalamityMod/SunkenSeaWater").Slot); } @@ -60,6 +62,7 @@ namespace CalamityMod.Tiles.Furniture.Fountains public override bool RightClick(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 2, 4); + SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16)); return true; } diff --git a/Tiles/Furniture/Fountains/SunkenSeaFountainTile.png b/Tiles/Furniture/Fountains/SunkenSeaFountainTile.png index e8ceb8d0a1..2e964dcf1a 100644 Binary files a/Tiles/Furniture/Fountains/SunkenSeaFountainTile.png and b/Tiles/Furniture/Fountains/SunkenSeaFountainTile.png differ diff --git a/Tiles/Furniture/Fountains/SunkenSeaFountainTile_Highlight.png b/Tiles/Furniture/Fountains/SunkenSeaFountainTile_Highlight.png index 5866fcb8b8..4364cf01ee 100644 Binary files a/Tiles/Furniture/Fountains/SunkenSeaFountainTile_Highlight.png and b/Tiles/Furniture/Fountains/SunkenSeaFountainTile_Highlight.png differ diff --git a/Tiles/Furniture/LanternCenterTile.cs b/Tiles/Furniture/LanternCenterTile.cs index 5b903a48ad..fc0a3bbffe 100644 --- a/Tiles/Furniture/LanternCenterTile.cs +++ b/Tiles/Furniture/LanternCenterTile.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Placeables.Furniture; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.GameContent.Events; using Terraria.GameContent.ObjectInteractions; @@ -58,6 +59,7 @@ namespace CalamityMod.Tiles.Furniture { CalamityUtils.LightHitWire(Type, i, j, 3, 3); LanternNight.ToggleManualLanterns(); + SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16)); return true; } diff --git a/Tiles/Furniture/TranquilityCandle.cs b/Tiles/Furniture/TranquilityCandle.cs index 5002998856..67e621f03a 100644 --- a/Tiles/Furniture/TranquilityCandle.cs +++ b/Tiles/Furniture/TranquilityCandle.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Tiles.Furniture public override bool RightClick(int i, int j) { - CalamityUtils.RightClickBreak(i, j); + CalamityUtils.LightHitWire(Type, i, j, 1, 1); return true; } } diff --git a/Utilities/ProjectileUtils.cs b/Utilities/ProjectileUtils.cs index c3ba722111..08d11d7696 100644 --- a/Utilities/ProjectileUtils.cs +++ b/Utilities/ProjectileUtils.cs @@ -152,9 +152,11 @@ namespace CalamityMod /// The projectile that should home. /// The target. /// The inertia of the movement change. - public static Vector2 SuperhomeTowardsTarget(this Projectile projectile, NPC target, float homingSpeed, float inertia) + /// The ratio for how much the projectile aims ahead of the target. 1f is normal predictiveness. 0.01f is the lowest possible value, equating to no practical predictiveness. + public static Vector2 SuperhomeTowardsTarget(this Projectile projectile, NPC target, float homingSpeed, float inertia, float predictionStrength = 1f) { - Vector2 idealVelocity = CalculatePredictiveAimToTarget(projectile.Center, target, homingSpeed); + if (predictionStrength < 0.01f) { predictionStrength = 0.01f; } + Vector2 idealVelocity = CalculatePredictiveAimToTarget(projectile.Center, target, homingSpeed/predictionStrength) * predictionStrength; return (projectile.velocity * (inertia - 1f) + idealVelocity) / inertia; } #endregion