Exemplo n.º 1
0
 public override ActionDist Execute(ActionInfo info)
 {
     ActionWeightPair[] weightedActions = new ActionWeightPair[4];
     if (info.targetId != World.InvalidId && info.originId != World.InvalidId)
     {
         weightedActions[0] = new ActionWeightPair(new SwapAction(info), 1);
         weightedActions[1] = new ActionWeightPair(new NonAction(), 0);
         weightedActions[2] = new ActionWeightPair(new NonAction(), 0);
         weightedActions[3] = new ActionWeightPair(new NonAction(), 0);
         return(new ActionDist(weightedActions));
     }
     else
     {
         return(ActionDist.DegeneratedNonActions());
     }
 }
Exemplo n.º 2
0
 public override ActionDist Execute(ActionInfo info)
 {
     ActionWeightPair[] weightedActions = new ActionWeightPair[4];
     if (info.targetId != World.InvalidId && info.originId != World.InvalidId)
     {
         Vector2Int[] moves = { new Vector2Int(0, 1), new Vector2Int(0, -1), new Vector2Int(1, 0), new Vector2Int(-1, 0), };
         for (int i = 0; i < moves.Length; i++)
         {
             weightedActions[i] = new ActionWeightPair
                                  (
                 new MoveAction(info, moves[i]),
                 0.25f
                                  );
         }
         return(new ActionDist(weightedActions));
     }
     else
     {
         return(ActionDist.DegeneratedNonActions());
     }
 }