Commit 9d28e904 authored by mercury233's avatar mercury233

update AI.SelectMaterials, fix EaterOfMillions

parent 296c7a5e
...@@ -523,7 +523,7 @@ namespace WindBot.Game.AI.Decks ...@@ -523,7 +523,7 @@ namespace WindBot.Game.AI.Decks
targets.Add(e_c); targets.Add(e_c);
if (targets.Count >= 5) if (targets.Count >= 5)
{ {
AI.SelectCard(targets); AI.SelectMaterials(targets, HintMsg.Remove);
/*AI.SelectCard(new[] { /*AI.SelectCard(new[] {
CardId.BingirsuTheWorldChaliceWarrior, CardId.BingirsuTheWorldChaliceWarrior,
CardId.TopologicTrisbaena, CardId.TopologicTrisbaena,
...@@ -547,8 +547,8 @@ namespace WindBot.Game.AI.Decks ...@@ -547,8 +547,8 @@ namespace WindBot.Game.AI.Decks
{ {
targets.Add(s_c); targets.Add(s_c);
if (targets.Count >= 5) if (targets.Count >= 5)
{ {
AI.SelectCard(targets); AI.SelectMaterials(targets, HintMsg.Remove);
return true; return true;
} }
} }
......
...@@ -468,13 +468,13 @@ namespace WindBot.Game.AI.Decks ...@@ -468,13 +468,13 @@ namespace WindBot.Game.AI.Decks
IList<ClientCard> material_list = new List<ClientCard>(); IList<ClientCard> material_list = new List<ClientCard>();
if(Bot.HasInExtra(CardId.BorreloadDragon)) if(Bot.HasInExtra(CardId.BorreloadDragon))
{ {
AI.SelectCard( AI.SelectMaterials(new[] {
CardId.TopologicBomberDragon, CardId.TopologicBomberDragon,
CardId.TopologicTrisbaena, CardId.TopologicTrisbaena,
CardId.KnightmareGryphon, CardId.KnightmareGryphon,
CardId.SummonSorceress, CardId.SummonSorceress,
CardId.BorreloadDragon CardId.BorreloadDragon
); }, HintMsg.Remove);
} }
else else
{ {
...@@ -482,7 +482,8 @@ namespace WindBot.Game.AI.Decks ...@@ -482,7 +482,8 @@ namespace WindBot.Game.AI.Decks
{ {
if (material_list.Count == 5) break; if (material_list.Count == 5) break;
material_list.Add(m); material_list.Add(m);
} }
AI.SelectMaterials(material_list, HintMsg.Remove);
} }
return true; return true;
} }
......
...@@ -709,7 +709,7 @@ namespace WindBot.Game.AI.Decks ...@@ -709,7 +709,7 @@ namespace WindBot.Game.AI.Decks
targets.Add(e_c); targets.Add(e_c);
if (targets.Count >= 5) if (targets.Count >= 5)
{ {
AI.SelectCard(targets); AI.SelectMaterials(targets, HintMsg.Remove);
return true; return true;
} }
} }
...@@ -719,7 +719,7 @@ namespace WindBot.Game.AI.Decks ...@@ -719,7 +719,7 @@ namespace WindBot.Game.AI.Decks
targets.Add(s_c); targets.Add(s_c);
if (targets.Count >= 5) if (targets.Count >= 5)
{ {
AI.SelectCard(targets); AI.SelectMaterials(targets, HintMsg.Remove);
return true; return true;
} }
} }
......
...@@ -98,6 +98,7 @@ namespace WindBot.Game ...@@ -98,6 +98,7 @@ namespace WindBot.Game
m_position.Clear(); m_position.Clear();
m_selector_pointer = -1; m_selector_pointer = -1;
m_materialSelector = null; m_materialSelector = null;
m_materialSelectorHint = 0;
m_option = -1; m_option = -1;
m_yesno = -1; m_yesno = -1;
m_announce = 0; m_announce = 0;
...@@ -267,8 +268,16 @@ namespace WindBot.Game ...@@ -267,8 +268,16 @@ namespace WindBot.Game
} }
else else
{ {
// Update the next selector. if (m_materialSelector != null && hint == m_materialSelectorHint)
selector = GetSelectedCards(); {
//Logger.DebugWriteLine("m_materialSelector hint match");
selector = m_materialSelector;
}
else
{
// Update the next selector.
selector = GetSelectedCards();
}
} }
// If we selected a card, use this card. // If we selected a card, use this card.
...@@ -745,6 +754,7 @@ namespace WindBot.Game ...@@ -745,6 +754,7 @@ namespace WindBot.Game
private CardSelector m_materialSelector; private CardSelector m_materialSelector;
private int m_materialSelectorHint;
private int m_place; private int m_place;
private int m_option; private int m_option;
private int m_number; private int m_number;
...@@ -912,34 +922,40 @@ namespace WindBot.Game ...@@ -912,34 +922,40 @@ namespace WindBot.Game
m_selector.Insert(m_selector_pointer, new CardSelector(loc)); m_selector.Insert(m_selector_pointer, new CardSelector(loc));
} }
public void SelectMaterials(ClientCard card) public void SelectMaterials(ClientCard card, int hint = 0)
{ {
m_materialSelector = new CardSelector(card); m_materialSelector = new CardSelector(card);
m_materialSelectorHint = hint;
} }
public void SelectMaterials(IList<ClientCard> cards) public void SelectMaterials(IList<ClientCard> cards, int hint = 0)
{ {
m_materialSelector = new CardSelector(cards); m_materialSelector = new CardSelector(cards);
m_materialSelectorHint = hint;
} }
public void SelectMaterials(int cardId) public void SelectMaterials(int cardId, int hint = 0)
{ {
m_materialSelector = new CardSelector(cardId); m_materialSelector = new CardSelector(cardId);
m_materialSelectorHint = hint;
} }
public void SelectMaterials(IList<int> ids) public void SelectMaterials(IList<int> ids, int hint = 0)
{ {
m_materialSelector = new CardSelector(ids); m_materialSelector = new CardSelector(ids);
m_materialSelectorHint = hint;
} }
public void SelectMaterials(CardLocation loc) public void SelectMaterials(CardLocation loc, int hint = 0)
{ {
m_materialSelector = new CardSelector(loc); m_materialSelector = new CardSelector(loc);
m_materialSelectorHint = hint;
} }
public void CleanSelectMaterials() public void CleanSelectMaterials()
{ {
m_materialSelector = null; m_materialSelector = null;
m_materialSelectorHint = 0;
} }
public bool HaveSelectedCards() public bool HaveSelectedCards()
......
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