Changed to SimpleFlyMovement for fly away.
This commit is contained in:
1 parent
57620ddf10
commit
dfb2ebb3e3
1 file changed
+4
-3
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user