Beispiel #1
0
        private void TryProcessNextTile(CTile tile)
        {
            var ap      = this._data.Char.Proxy.GetPoints(ESecondaryStat.AP);
            var stamina = this._data.Char.Proxy.GetPoints(ESecondaryStat.Stamina);
            var model   = (MTile)this._data.TargetPath.GetNextTile(tile.Model);

            if (model != null)
            {
                this._next = model.Controller;
                var apCost   = this._next.Model.GetCost();
                var stamCost = this._next.Model.GetStaminaCost();
                if (apCost <= ap && stamCost <= stamina)
                {
                    var data = new EvTileMoveData();
                    data.Cost       = apCost;
                    data.Char       = this._data.Char;
                    data.ParentMove = this;
                    data.Source     = this._current;
                    data.StamCost   = this._data.Target.Model.GetStaminaCost();
                    data.Target     = this._next;
                    var e = new EvTileMove(data);
                    e.AddCallback(this.TileMoveDone);
                    e.TryProcess();
                }
                else
                {
                    this.TryDone(null);
                }
            }
            else
            {
                this.TryDone(null);
            }
        }
Beispiel #2
0
 private void TryProcessFirstTile()
 {
     if (this._data.Source != null)
     {
         var ap      = this._data.Char.Proxy.GetPoints(ESecondaryStat.AP);
         var stamina = this._data.Char.Proxy.GetPoints(ESecondaryStat.Stamina);
         var tile    = this._data.TargetPath.GetFirstTile() as MTile;
         this._next = tile.Controller;
         var apCost   = this._next.Model.GetCost();
         var stamCost = this._next.Model.GetStaminaCost();
         if (apCost <= ap && stamCost <= stamina)
         {
             var data = new EvTileMoveData();
             data.Cost       = apCost;
             data.Char       = this._data.Char;
             data.ParentMove = this;
             data.Source     = this._data.Source;
             data.Target     = this._next;
             var e = new EvTileMove(data);
             e.AddCallback(this.TileMoveDone);
             this.AddChildAction(e);
             e.TryProcess();
         }
         else
         {
             this.TryDone(null);
         }
     }
 }
Beispiel #3
0
 public EvTileMove(EvTileMoveData d) : base(ECombatEv.TileMove)
 {
     this._data            = d;
     this._pathInterrupted = false;
     if (this._data.ParentMove != null)
     {
         this._data.ParentMove.AddChildAction(this);
     }
 }
Beispiel #4
0
 public void SetData(EvTileMoveData d)
 {
     this._data = d;
 }