void Start()
 {
     this.board.LoadLayout(testLayout);
     this.testOrbInstance = this.board.Spawn(
         testOrbPrefab, new BoardPosition(-2, -2));
     this.board.Spawn(testObstaclePrefab, new BoardPosition(0, 0));
 }
 public void Clear()
 {
     this.selectedUnit    = null;
     this.moveDest        = null;
     this.action          = null;
     this.selectedTargets = new List <BoardCell>();
     this.aoe             = null;
 }
 void Start()
 {
     board.LoadLayout(layout);
     this.unitInstanceCellContent = this.board.Spawn(
         unitPrefab,
         new BoardPosition(-2, 3));
     ShowMoveArea();
 }
 public override void Perform(
     BoardCellContent actor,
     IEnumerable <BoardCell> targets,
     IEnumerable <BoardCell> aoe)
 {
     foreach (var cell in aoe)
     {
         Debug.Log(cell);
         Debug.Log(cell.Content);
         var hp = cell.Content?.GetComponent <HP>();
         if (hp == null)
         {
             continue;
         }
         hp.Decrease(this.damage);
         hp.Commit();                 // don't actually do this in the real thing
     }
 }
Example #5
0
		/// <summary>
		/// Returns which cells can be used as targets.
		/// </summary>
		/// <param name="actor">The entity trying to perform the action.</param>
		/// <param name="partialTargets">The targets selected so far.</param>
		/// <returns>The cells which could be used as targets.</returns>
		public abstract IEnumerable<BoardCell> ValidTargets(
			BoardCellContent actor,
			IEnumerable<BoardCell> partialTargets);
Example #6
0
 void Awake()
 {
     this.asCellContent = GetComponent <BoardCellContent>();
 }
 void SelectUnit(BoardCellContent unit)
 {
     this.playerOrder.selectedUnit = unit;
     this.fsm.Transition <ActionsTestSelectMoveDestState>();
 }
Example #8
0
 public override IEnumerable <BoardCell> ValidTargets(
     BoardCellContent actor,
     IEnumerable <BoardCell> partialTargets)
 {
     return(actor.Cell.Neighborhood(1));
 }
Example #9
0
 /// <summary>
 /// Executes the action.
 /// </summary>
 /// <param name="actor"></param>
 /// <param name="targets"></param>
 /// <param name="aoe"></param>
 public abstract void Perform(
     BoardCellContent actor,
     IEnumerable <BoardCell> targets,
     IEnumerable <BoardCell> aoe);