public override void Tick() { if (Math.Abs(XMove) > 0.1 || Math.Abs(YMove) > 0.1) { CBody.Jump(); } if (ApplyDamage > 0) { ApplyDamage -= TheRegion.Delta; } TargetPlayers -= TheRegion.Delta; if (TargetPlayers <= 0) { PlayerEntity player = NearestPlayer(out double dist); if (player != null && dist < MaxPathFindDistance * MaxPathFindDistance) { GoTo(player); CBody.Jump(); ApplyForce((player.GetCenter() - GetCenter()).Normalize() * GetMass()); } else { GoTo(null); } TargetPlayers = 1; } base.Tick(); }
public void TryToJump() { if (!InVehicle && Upward && !IsFlying && !pup && CBody.SupportFinder.HasSupport) { CBody.Jump(); pup = true; } else if (!Upward) { pup = false; } }