コード例 #1
0
        private HREngine.API.Actions.ActionBase HandleBattleMulliganPhase()
        {
            HRLog.Write("handle mulligan");
            if (HRMulligan.IsMulliganActive())
            {
                var list = HRCard.GetCards(HRPlayer.GetLocalPlayer(), HRCardZone.HAND);

                foreach (var item in list)
                {
                    if (item.GetEntity().GetCost() >= 4)
                    {
                        HRLog.Write("Rejecting Mulligan Card " + item.GetEntity().GetName() + " because it cost is >= 4.");
                        HRMulligan.ToggleCard(item);
                    }
                    if (item.GetEntity().GetCardId() == "EX1_308" || item.GetEntity().GetCardId() == "EX1_622" || item.GetEntity().GetCardId() == "EX1_005")
                    {
                        HRLog.Write("Rejecting Mulligan Card " + item.GetEntity().GetName() + " because it is soulfire or shadow word: death");
                        HRMulligan.ToggleCard(item);
                    }
                }

                sf.setnewLoggFile();
                return(null);
                //HRMulligan.EndMulligan();
            }
            return(null);
        }
コード例 #2
0
 protected HREngine.API.Actions.ActionBase UpdateMulliganState()
 {
     if (HRMulligan.IsMulliganActive())
     {
         var list = HRCard.GetCards(HRPlayer.GetLocalPlayer(), HRCardZone.HAND);
         foreach (var item in list)
         {
             if (!RejectedCardList.ContainsKey(item.GetEntity().GetEntityId()) && item.GetEntity().GetCost() >= 4)
             {
                 RejectedCardList.Add(item.GetEntity().GetEntityId(), item);
                 return(new RejectCardsAction(item));
             }
         }
     }
     return(null);
 }
コード例 #3
0
        private HREngine.API.Actions.ActionBase HandleBattleMulliganPhase()
        {
            SmartCc = new Simulation();


            SmartCc.CreateLogFolder();
            SmartCc.TurnCount = 0;

            if (HRMulligan.IsMulliganActive())
            {
                List <HRCard> Choices       = HRCard.GetCards(HRPlayer.GetLocalPlayer(), HRCardZone.HAND);
                List <Card>   ParsedChoices = new List <Card>();
                foreach (HRCard card in Choices)
                {
                    HREntity entity = card.GetEntity();
                    Card     c      = Card.Create(entity.GetCardId(), true, entity.GetEntityId());
                    c.CurrentCost = entity.GetCost();
                    ParsedChoices.Add(c);
                }

                List <HRCard> CardsToKeep = new List <HRCard>();
                foreach (Card c in ProfileInterface.Behavior.HandleMulligan(ParsedChoices))
                {
                    foreach (HRCard card in Choices)
                    {
                        if (c.Id == card.GetEntity().GetEntityId())
                        {
                            CardsToKeep.Add(card);
                        }
                    }
                }

                foreach (HRCard card in Choices)
                {
                    if (!CardsToKeep.Contains(card))
                    {
                        HRMulligan.ToggleCard(card);
                    }
                }
                return(null);
            }
            return(null);
        }
コード例 #4
0
        private HREngine.API.Actions.ActionBase HandleBattleMulliganPhase()
        {
            HRLog.Write("handle mulligan");
            if (HRMulligan.IsMulliganActive())
            {
                var list = HRCard.GetCards(HRPlayer.GetLocalPlayer(), HRCardZone.HAND);

                foreach (var item in list)
                {
                    if (item.GetEntity().GetCost() >= 4)
                    {
                        HRLog.Write("Rejecting Mulligan Card " + item.GetEntity().GetName() + " because it cost is >= 4.");
                        HRMulligan.ToggleCard(item);
                    }
                }

                return(null);
                //HRMulligan.EndMulligan();
            }
            return(null);
        }
コード例 #5
0
        private HREngine.API.Actions.ActionBase HandleBattleMulliganPhase()
        {
            if (Settings.Instance.learnmode)
            {
                return(new HREngine.API.Actions.MakeNothingAction());
            }
            //Helpfunctions.Instance.ErrorLog("handle mulligan");


            if (HRMulligan.IsMulliganActive())
            {
                var      list        = HRCard.GetCards(HRPlayer.GetLocalPlayer(), HRCardZone.HAND);
                HRPlayer enemyPlayer = HRPlayer.GetEnemyPlayer();
                HRPlayer ownPlayer   = HRPlayer.GetLocalPlayer();
                string   enemName    = Hrtprozis.Instance.heroIDtoName(enemyPlayer.GetHeroCard().GetEntity().GetCardId());
                string   ownName     = Hrtprozis.Instance.heroIDtoName(ownPlayer.GetHeroCard().GetEntity().GetCardId());
                if (Mulligan.Instance.hasmulliganrules(ownName, enemName))
                {
                    List <Mulligan.CardIDEntity> celist = new List <Mulligan.CardIDEntity>();
                    foreach (var item in list)
                    {
                        if (item.GetEntity().GetCardId() != "GAME_005")// dont mulligan coin
                        {
                            celist.Add(new Mulligan.CardIDEntity(item.GetEntity().GetCardId(), item.GetEntity().GetEntityId()));
                        }
                    }
                    List <int> mullientitys = Mulligan.Instance.whatShouldIMulligan(celist, ownName, enemName);
                    foreach (var item in list)
                    {
                        if (mullientitys.Contains(item.GetEntity().GetEntityId()))
                        {
                            Helpfunctions.Instance.ErrorLog("Rejecting Mulligan Card " + item.GetEntity().GetName() + " because of your rules");
                            HRMulligan.ToggleCard(item);
                        }
                    }
                }
                else
                {
                    foreach (var item in list)
                    {
                        if (item.GetEntity().GetCost() >= 4)
                        {
                            Helpfunctions.Instance.ErrorLog("Rejecting Mulligan Card " + item.GetEntity().GetName() + " because it cost is >= 4.");
                            HRMulligan.ToggleCard(item);
                        }
                        if (item.GetEntity().GetCardId() == "EX1_308" || item.GetEntity().GetCardId() == "EX1_622" || item.GetEntity().GetCardId() == "EX1_005")
                        {
                            Helpfunctions.Instance.ErrorLog("Rejecting Mulligan Card " + item.GetEntity().GetName() + " because it is soulfire or shadow word: death");
                            HRMulligan.ToggleCard(item);
                        }
                    }
                }


                sf.setnewLoggFile();

                //writeSettings();

                if (Mulligan.Instance.loserLoserLoser)
                {
                    if (!autoconcede())
                    {
                        concedeVSenemy(ownName, enemName);
                    }
                }

                return(null);
                //HRMulligan.EndMulligan();
            }
            return(null);
        }