示例#1
0
 public static void CleanUp()
 {
     Drafting.CleanUp();
     Action.CleanUp();
     Strategy.CleanUp();
     Player.CleanUp();
     MonsterTrading.CleanUp();
     SummonGroup.CleanUp();
 }
示例#2
0
        public static void Attack()
        {
            MonsterTrading.StartSimulation();

            //Execute Simulation

            var orderedSimulations = Player.me.tradeGroups.OrderByDescending(sim => sim.finalScore);
            var best = orderedSimulations.FirstOrDefault();

            /*foreach (var sim in orderedSimulations)
             * {
             *  sim.Print();
             * }*/

            if (best != null && best.GetScore() > 0)
            {
                foreach (var trade in best.simulations)
                {
                    if (trade.spellCardTarget != null && trade.spellCardTarget.location == CardLocation.PlayerHands)
                    {
                        var summonAction = new Action(trade.spellCardTarget);
                        summonAction.ApplyAction();
                    }

                    foreach (var card in trade.myCards)
                    {
                        if (card.location == CardLocation.PlayerHands)
                        {
                            if (card.type == CardType.Creature && card.hasCharge)
                            {
                                var summonAction = new Action(card);
                                summonAction.ApplyAction();
                            }
                            else if (card.type == CardType.Green && trade.spellCardTarget != null)
                            {
                                var newSpell = new Action(MoveType.UseItem, card, trade.spellCardTarget);
                                newSpell.ApplyAction();
                                continue;
                            }
                        }

                        var newAction = new Action(MoveType.Attack, card, trade.target);
                        newAction.ApplyAction();
                    }
                }

                best.Print();

                if (best.bestSummonGroup != null)
                {
                    BestSummon(best.bestSummonGroup);
                }
            }
        }
示例#3
0
        public static void GetSummonValues(List <Card> summons)
        {
            foreach (var card in summons)
            {
                List <Trade> possibleTrades = new List <Trade>();

                //Get enemy possible trade against this summon
                MonsterTrading.GetTradeOptions(Player.enemy.usableCards, Player.enemy, card, null, possibleTrades);

                var best = possibleTrades.OrderByDescending(t => t.GetScore()).FirstOrDefault();
                if (best != null)
                {
                    summonValues.Add(card, best.GetScore());
                }
            }
        }