Esempio n. 1
0
        public ChooseTargetHandler(Player.PublicInfo[] info, NeedTargetAction action, InputHandler success, InputHandler failure)
        {
            this.info    = info;
            this.action  = action;
            this.success = success;
            this.failure = failure;

            TargetFilter filter = action.filter;

            int[] playerPattern = new int[] { Action.SELF, Action.OPP };
            for (int i = 0; i < 2; ++i)
            {
                if (filter(playerPattern[i] | Action.FACE, info[i].face))
                {
                    indexList[i].Add(-1);
                }
                for (int j = 0; j < info[i].board.Count; ++j)
                {
                    if (filter(playerPattern[i] | Action.BOARD | (j & Action.INDEX_MASK), info[i].board[j]))
                    {
                        indexList[i].Add(j);
                    }
                }
            }

            if (indexList[0].Count > 0)
            {
                focusIndex = 0;
            }
            else if (indexList[1].Count > 0)
            {
                focusIndex = 1;
            }
        }
Esempio n. 2
0
        public SCard_DivineSpirit() : base("Divine Spirit", 2)
        {
            TargetFixer fixer = (TargetObject x) => {
                (x as Monster).maxHp *= 2;
                (x as Monster).hp    *= 2;
            };

            needTargetAction   = new NeedTargetAction((int pattern, TargetObject x) => x is Monster, fixer);
            chooseTargetAction = new ChooseTargetAction(needTargetAction);
        }
Esempio n. 3
0
 public ChooseTargetAction(NeedTargetAction action)
 {
     this.needTargetAction = action;
 }