Commit 9201368f authored by mercury233's avatar mercury233

update LuckyExecutor select deck's card first

parent 5c389425
......@@ -89,6 +89,11 @@ namespace WindBot.Game.AI.Decks
HintMsg.FusionMaterial, HintMsg.SynchroMaterial, HintMsg.XyzMaterial, HintMsg.LinkMaterial, HintMsg.Disable
};
private List<int> HintMsgForDeck = new List<int>
{
HintMsg.SpSummon, HintMsg.ToGrave, HintMsg.Remove, HintMsg.AddToHand, HintMsg.FusionMaterial
};
public override IList<ClientCard> OnSelectCard(IList<ClientCard> _cards, int min, int max, int hint, bool cancelable)
{
if (Duel.Phase == DuelPhase.BattleStart)
......@@ -115,6 +120,20 @@ namespace WindBot.Game.AI.Decks
}
}
if (HintMsgForDeck.Contains(hint))
{
IList<ClientCard> deckCards = cards.Where(card => card.Location == CardLocation.Deck).ToList();
// select deck's card first
while (deckCards.Count > 0 && selected.Count < max)
{
ClientCard card = deckCards[Program.Rand.Next(deckCards.Count)];
selected.Add(card);
deckCards.Remove(card);
cards.Remove(card);
}
}
// select random cards
while (selected.Count < min)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment