Exemplo n.º 1
0
        public void StartRound(int roundIndex)
        {
            // remove all units from field
            _clearAllRowEffects();
            foreach (Unit u in Select.Units(cards, Filter.anyUnitInBattlefield()))
            {
                u.move(Place.graveyard);
            }
            if (roundIndex == 1)
            {
                _createTacticalAdvantage();
                _makeLeadersVisibleToAll();
            }
            foreach (Player player in players)
            {
                player.passed = false;
                switch (roundIndex)
                {
                case 1: _drawCard(player, 10); _mulliganOnRoundStart(player, 3); continue;

                case 2: _drawCard(player, 2); _mulliganOnRoundStart(player, 2); continue;

                case 3: _drawCard(player, 1); _mulliganOnRoundStart(player, 1); continue;

                default: continue;
                }
            }
        }
Exemplo n.º 2
0
        public int _scoreAtPlayersRow(Player p, int row)
        {
            int summ = 0;

            foreach (Unit u in Select.Units(cards, Filter.anyUnitInBattlefield(), Filter.anyUnitHostBy(p), Filter.anyUnitInRow(row)))
            {
                summ += u.power;
            }
            return(summ);
        }
Exemplo n.º 3
0
        public static bool dealDamage(Card self, int damageValue)
        {
            Unit t = self.host.selectUnit(
                Select.Units(self.context.cards, Filter.anyOtherUnitInBattlefield(self as Unit)),
                self.QestionString());

            if (t != null)
            {
                return(t.damage(self, damageValue));
            }
            return(false);
        }
Exemplo n.º 4
0
        public static void resurrectAllyUnit(Card self, params UnitPredicat[] filters)
        {
            // select one card from discard
            List <UnitPredicat> fs = new List <UnitPredicat>();

            fs.Add(Filter.anyAllyUnitInDiscard(self as Unit));
            fs.AddRange(filters);

            Unit u = self.host.selectUnit(
                Select.Units(self.context.cards,
                             fs.ToArray()), self.QestionString());

            // the player plays a card if its exists
            if (u != null)
            {
                self.host.playCard(u);
            }
        }
Exemplo n.º 5
0
        public Unit _topUnitOfDeck(Player player, params UnitPredicat[] filters)
        {
            var anyAccepted = Select.Units(_deckOf(player), filters);

            return(anyAccepted.Count == 0 ? null : anyAccepted.First());
        }
Exemplo n.º 6
0
 public List <Unit> _allUnitsInRow(int row, Player p)
 {
     return(Select.Units(cards, Filter.anyUnitInBattlefield(), Filter.anyUnitHostBy(p), Filter.anyUnitInRow(row)));
 }