Пример #1
0
        public void updateAllRowWeatherAndValues()
        {
            for (int i = 0; i < allRowLines.Count; ++i)
            {
                swapColor(_lightPlayerColors[i], ConsoleColor.White);
                Player     p = _context.players[i];
                int        playerCardAllignLeft = Utils.fieldStartHorizontal + i * Utils.fieldPerPlayerHorizontal;
                List <int> rowLines             = allRowLines[i];
                for (int j = 0; j < 3; ++j)
                {
                    RowEffect re = _context._rowEffectOn(j, p);

                    clearLine(i, rowLines[j] - 1, rowLines[j]);
                    Console.SetCursorPosition(playerCardAllignLeft, rowLines[j] + Utils.fieldStartVerticalOffset);
                    Console.Write(String.Format("{2}{0}{1}", Utils.allRows[j], (re != null ? ("  " + re.ToString()) : ""), (_context._scoreAtPlayersRow(p, j) + "").PadRight(4)));
                }
                Console.SetCursorPosition(playerCardAllignLeft, Utils.fieldStartVerticalOffset);
                Console.Write(String.Format("{1}{0}",
                                            p.ToString(),
                                            String.Format("{0} {2} {1}", _context._scoreOf(p), (p.passed ? "PASSED" : ""),
                                                          ("".PadLeft(p.roundsWin, '*'))).PadRight(Utils.fieldPerPlayerHorizontal / 2 - 3)),
                              Utils.fieldPerPlayerHorizontal);
                popColor();
            }
        }
Пример #2
0
        public void _removeRowEffect(Player player, int row, params CardPredicat[] filters)
        {
            RowEffect conflict = null;

            foreach (RowEffect r in rowEffects)
            {
                if (r.row == row && r.PlayerUnderEffect == player)
                {
                    bool accepted = true;
                    foreach (CardPredicat f in filters)
                    {
                        if (!f(r.Source))
                        {
                            accepted = false;
                        }
                    }
                    if (accepted)
                    {
                        conflict = r;
                    }
                }
            }
            if (conflict != null)
            {
                rowEffects.Remove(conflict);
            }
        }
Пример #3
0
        static Special Boon(string name, string description, TriggerTurnRowEffect trigger)
        {
            Special spec = new Special();

            spec.setAttributes(Clan.neutral, Rarity.bronze, name);
            spec.setSpecialAttributes(Tag.boon);
            spec.setOnDeploy((s, f) =>
            {
                RowEffect boon = new RowEffect(s, s.host, s.host.chooseRow(BoonQuestionRow(s.name)));
                boon.SetBehaviour(trigger);
            }, description);
            return(spec);
        }
Пример #4
0
        static Special Hazard(string name, string description, TriggerTurnRowEffect trigger, Rarity rarity = Rarity.bronze)
        {
            Special spec = new Special();

            spec.setAttributes(Clan.neutral, rarity, name);
            spec.setSpecialAttributes(Tag.hazard);
            spec.setOnDeploy((s, f) =>
            {
                Player enemy = s.host.chooseEnemy(s.context, HazardQuestionPlayer(s.name));
                int row      = s.host.chooseEnemyRow(enemy, HazardQuestionRow(s.name));

                RowEffect hazz = new RowEffect(s, enemy, row);
                hazz.SetBehaviour(trigger);
            }, description);
            return(spec);
        }
Пример #5
0
        public void _addRowEffect(RowEffect rowEffect)
        {
            RowEffect conflict = null;

            foreach (RowEffect r in rowEffects)
            {
                if (r.isConflictWith(rowEffect))
                {
                    conflict = r;
                }
            }
            if (conflict != null)
            {
                rowEffects.Remove(conflict);
            }
            rowEffects.Add(rowEffect);
        }
Пример #6
0
        public static void applyHazzardOnDeployWithoutCard(Card s, Special analogCard, TriggerTurnRowEffect hazzardEffect)
        {
            Player enemy = s.host.chooseEnemy(s.context, s.QestionString());
            int    row   = s.host.chooseEnemyRow(enemy, s.QestionString());

            // there is a little trick
            // instead of creating unique birna roweffect,
            // we create a DOOMed version of skelligian storm
            // and apply (DO NOT PLAY) it to choosen row
            // after it it will dissappear in banish

            Special st = SpawnSpecial.addSpecialToGame(analogCard, s);

            st.move(Place.banish);
            RowEffect hazz = new RowEffect(st, enemy, row);

            hazz.SetBehaviour(hazzardEffect);
        }
Пример #7
0
 public bool isConflictWith(RowEffect another)
 {
     return(row == another.row && _onPlayer == another._onPlayer);
 }