public override void Do() { if (CloseToPosition(TargetMob.Position)) { Finish(); return; } SetVelocityVector(); OwnerMob.MoveAndSlide(VelocityVector); }
public override void Do() { if (TargetMob.IsDead()) { Finish(); return; } if (TargetIsNotClose()) { OwnerMob.AttackMob(TargetMob); return; } if (AttackTimer.IsStopped()) { PerformAttack(); } }
private Vector2 GetPathDirection() { if (Path == null) { SetNavigationPath(); } if (Path == null) { OwnerMob.Log("Path is null after calculation"); } while (Path.Count > 0) { if (CloseToPosition(Path[0])) { Path.RemoveAt(0); continue; } return(OwnerMob.Position.DirectionTo(Path[0])); } return(Vector2.Zero); }
public override void Finish() { Finished = true; OwnerMob.Log("finished moving to " + TargetMob.Name); }