Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
 public void TryToJump()
 {
     if (!InVehicle && Upward && !IsFlying && !pup && CBody.SupportFinder.HasSupport)
     {
         CBody.Jump();
         pup = true;
     }
     else if (!Upward)
     {
         pup = false;
     }
 }