Commit 3bd53ba5 authored by nanahira's avatar nanahira

Merge branch 'master' of github.com:IceYGO/windbot

parents fd9b4610 a927ee30
Pipeline #2708 passed with stages
in 1 minute and 1 second
...@@ -83,7 +83,7 @@ namespace WindBot.Game.AI.Decks ...@@ -83,7 +83,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Summon, _CardId.ExodiaTheForbiddenOne, JustDontIt); AddExecutor(ExecutorType.Summon, _CardId.ExodiaTheForbiddenOne, JustDontIt);
} }
private List<int> HintMsgForRemove = new List<int> private List<int> HintMsgForEnemy = new List<int>
{ {
HintMsg.Release, HintMsg.Destroy, HintMsg.Remove, HintMsg.ToGrave, HintMsg.ReturnToHand, HintMsg.ToDeck, HintMsg.Release, HintMsg.Destroy, HintMsg.Remove, HintMsg.ToGrave, HintMsg.ReturnToHand, HintMsg.ToDeck,
HintMsg.FusionMaterial, HintMsg.SynchroMaterial, HintMsg.XyzMaterial, HintMsg.LinkMaterial, HintMsg.Disable HintMsg.FusionMaterial, HintMsg.SynchroMaterial, HintMsg.XyzMaterial, HintMsg.LinkMaterial, HintMsg.Disable
...@@ -94,6 +94,16 @@ namespace WindBot.Game.AI.Decks ...@@ -94,6 +94,16 @@ namespace WindBot.Game.AI.Decks
HintMsg.SpSummon, HintMsg.ToGrave, HintMsg.Remove, HintMsg.AddToHand, HintMsg.FusionMaterial HintMsg.SpSummon, HintMsg.ToGrave, HintMsg.Remove, HintMsg.AddToHand, HintMsg.FusionMaterial
}; };
private List<int> HintMsgForSelf = new List<int>
{
HintMsg.Equip
};
private List<int> HintMsgForMaterial = new List<int>
{
HintMsg.FusionMaterial, HintMsg.SynchroMaterial, HintMsg.XyzMaterial, HintMsg.LinkMaterial, HintMsg.Release
};
private List<int> HintMsgForMaxSelect = new List<int> private List<int> HintMsgForMaxSelect = new List<int>
{ {
HintMsg.SpSummon, HintMsg.ToGrave, HintMsg.AddToHand, HintMsg.FusionMaterial, HintMsg.Destroy HintMsg.SpSummon, HintMsg.ToGrave, HintMsg.AddToHand, HintMsg.FusionMaterial, HintMsg.Destroy
...@@ -111,7 +121,7 @@ namespace WindBot.Game.AI.Decks ...@@ -111,7 +121,7 @@ namespace WindBot.Game.AI.Decks
if (max > cards.Count) if (max > cards.Count)
max = cards.Count; max = cards.Count;
if (HintMsgForRemove.Contains(hint)) if (HintMsgForEnemy.Contains(hint))
{ {
IList<ClientCard> enemyCards = cards.Where(card => card.Controller == 1).ToList(); IList<ClientCard> enemyCards = cards.Where(card => card.Controller == 1).ToList();
...@@ -139,6 +149,34 @@ namespace WindBot.Game.AI.Decks ...@@ -139,6 +149,34 @@ namespace WindBot.Game.AI.Decks
} }
} }
if (HintMsgForSelf.Contains(hint))
{
IList<ClientCard> botCards = cards.Where(card => card.Controller == 0).ToList();
// select bot's card first
while (botCards.Count > 0 && selected.Count < max)
{
ClientCard card = botCards[Program.Rand.Next(botCards.Count)];
selected.Add(card);
botCards.Remove(card);
cards.Remove(card);
}
}
if (HintMsgForMaterial.Contains(hint))
{
IList<ClientCard> materials = cards.OrderBy(card => card.Attack).ToList();
// select low attack first
while (materials.Count > 0 && selected.Count < min)
{
ClientCard card = materials[0];
selected.Add(card);
materials.Remove(card);
cards.Remove(card);
}
}
// select random cards // select random cards
while (selected.Count < min) while (selected.Count < min)
{ {
......
...@@ -195,11 +195,8 @@ namespace WindBot.Game ...@@ -195,11 +195,8 @@ namespace WindBot.Game
if (defenders.Count == 0) if (defenders.Count == 0)
{ {
// Attack with the monster with the lowest attack first // Attack with the monster with the lowest attack first
for (int i = attackers.Count - 1; i >= 0; --i) ClientCard attacker = attackers[attackers.Count - 1];
{ return Attack(attacker, null);
ClientCard attacker = attackers[i];
Attack(attacker, null);
}
} }
else else
{ {
......
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