Changed to SimpleFlyMovement for fly away.

This commit is contained in:
mountaindrew10 committed 2024-09-14 15:04:13 -05:00
1 parent 57620ddf10
commit dfb2ebb3e3
1 file changed
+4 -3
+4 -3
View File
@@ -339,18 +339,19 @@ namespace CalamityMod.NPCs.SlimeGod
if (NPC.ai[1] == 0f)
{
Vector2 velocity = (player.Center - NPC.Center).SafeNormalize(new Vector2(NPC.direction, 0f)) * maxChargeVelocity;
NPC.velocity = velocity * chargeVelocityMult;
if (NPC.Distance(player.Center) < minChargeSafeDistance)
{
// Avoid cheap bullshit
NPC.damage = 0;
// Move away if too close
NPC.velocity /= chargeVelocityMult * -1f;
NPC.SimpleFlyMovement(velocity * -1f, 0.25f);
}
else
{
// Set initial charge velocity
NPC.velocity = velocity * chargeVelocityMult;
// Set damage
NPC.damage = setDamage;