예제 #1
0
        private void MonsterMenu(Battler b, Monster mon)
        {
            Battler opponent = GetOpponent(b);

            if (mon == null)
            {
                return;
            }
            SelectCard(mon);

            List <string> choices = new List <string>();

            if (mon.CanAttack && !mon.Facedown && turn > 0)
            {
                if (b.CanStealMana(opponent))
                {
                    choices.Add("Steal Mana");
                }
                else
                {
                    choices.Add("Attack");
                }
            }

            //TODO: Check for monster effect

            if (mon.Facedown)
            {
                choices.Add("Flip");
            }
            if (mon.CanAttack)
            {
                choices.Add("Retire");
            }
            choices.Add("Cancel");

            string choice = choices[ShowChoices("What should " + mon.Name + " do?", choices.ToArray())];

            //BattleCardEventArgs args;
            switch (choice.ToLower())
            {
            case "attack":
                if (!opponent.HasMonstersSummoned())
                {
                    ShowText(opponent.Name + " has no monsters summoned.");
                }
                Monster target = SelectAttackTarget(b);
                if (target != null)
                {
                    MonsterAttacking(b, mon, target, heldCardLocation[0], cursorLocation[1]);

                    heldCard         = null;
                    heldCardLocation = null;
                }
                break;

            case "steal mana":
                StealingMana(b, mon, heldCardLocation[0]);
                break;

            case "flip":
                FlippingMonster(b, mon, heldCardLocation[0]);
                break;

            case "retire":
                b.Field.Monsters[heldCardLocation[1]] = null;
                b.Discard.Add(mon);
                b.ManaAllotment += mon.Level;
                ShowText("Retired " + mon.Name + ". Restored " + mon.Level + " Mana.");
                break;

            case "cancel":
                break;
            }

            DeselectCard();
        }