Exemple #1
0
 public void AssignDroidPath(DroidNode droid)
 {
     if (droid != null && droid.IsValid())
     {
         int                x = droid.Transform.X;
         int                z = droid.Transform.Z;
         BoardController    boardController = Service.BoardController;
         BoardCell          startCell       = boardController.Board.GetCellAt(x, z);
         SmartEntity        smartEntity     = (SmartEntity)droid.Droid.Target;
         TransformComponent transformComp   = smartEntity.TransformComp;
         if (transformComp == null)
         {
             return;
         }
         int num  = transformComp.X - 1;
         int num2 = transformComp.Z - 1;
         int num3 = Service.Rand.ViewRangeInt(0, transformComp.BoardWidth + transformComp.BoardDepth + 1);
         if (num3 <= transformComp.BoardWidth)
         {
             num += num3;
         }
         else
         {
             num2 += num3 - transformComp.BoardWidth;
         }
         BoardCell cellAt = boardController.Board.GetCellAt(num, num2);
         if (!droid.Droid.AnimateTravel)
         {
             startCell = cellAt;
         }
         if (cellAt != null)
         {
             Service.PathingManager.StartPathingWorkerOrPatrol((SmartEntity)droid.Entity, smartEntity, startCell, cellAt, droid.Size.Width, true);
         }
         droid.Droid.AnimateTravel = true;
     }
 }
 public TroopController()
 {
     Service.Set <TroopController>(this);
     this.boardController = Service.Get <BoardController>();
 }
Exemple #3
0
 public AbstractAttackController()
 {
     this.shooterController = Service.ShooterController;
     this.boardController   = Service.BoardController;
 }
 public AbstractAttackController()
 {
     this.shooterController = Service.Get <ShooterController>();
     this.boardController   = Service.Get <BoardController>();
 }
Exemple #5
0
 public TroopController()
 {
     Service.TroopController = this;
     this.boardController    = Service.BoardController;
 }