Commit 6b4c0ccb authored by mercury233's avatar mercury233

ai tweaks

parent e7486c04
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
70368879 70368879
71490127 71490127
73628505 73628505
73628505
81439173 81439173
5318639 5318639
5318639 5318639
...@@ -32,6 +31,7 @@ ...@@ -32,6 +31,7 @@
60004971 60004971
62265044 62265044
62265044 62265044
62265044
44095762 44095762
58120309 58120309
58120309 58120309
......
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
74852097 74852097
74852097 74852097
74852097 74852097
81823360
81823360
81823360
75195825 75195825
75195825 75195825
75195825 75195825
...@@ -15,9 +18,6 @@ ...@@ -15,9 +18,6 @@
33256280 33256280
33256280 33256280
33256280 33256280
51934376
51934376
51934376
85138716 85138716
85138716 85138716
85138716 85138716
......
...@@ -121,9 +121,9 @@ namespace WindBot.Game.AI ...@@ -121,9 +121,9 @@ namespace WindBot.Game.AI
return count; return count;
} }
public static IList<ClientCard> GetMonsters(this IEnumerable<ClientCard> cards) public static List<ClientCard> GetMonsters(this IEnumerable<ClientCard> cards)
{ {
IList<ClientCard> cardlist = new List<ClientCard>(); List<ClientCard> cardlist = new List<ClientCard>();
foreach (ClientCard card in cards) foreach (ClientCard card in cards)
{ {
...@@ -135,9 +135,9 @@ namespace WindBot.Game.AI ...@@ -135,9 +135,9 @@ namespace WindBot.Game.AI
return cardlist; return cardlist;
} }
public static IList<ClientCard> GetFaceupPendulumMonsters(this IEnumerable<ClientCard> cards) public static List<ClientCard> GetFaceupPendulumMonsters(this IEnumerable<ClientCard> cards)
{ {
IList<ClientCard> cardlist = new List<ClientCard>(); List<ClientCard> cardlist = new List<ClientCard>();
foreach (ClientCard card in cards) foreach (ClientCard card in cards)
{ {
......
...@@ -123,11 +123,6 @@ namespace WindBot.Game.AI.Decks ...@@ -123,11 +123,6 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.SpellSet, SpellSet); AddExecutor(ExecutorType.SpellSet, SpellSet);
} }
public override bool OnSelectHand()
{
return Program.Rand.Next(2) > 0;
}
public override void OnNewTurn() public override void OnNewTurn()
{ {
// reset // reset
...@@ -322,17 +317,17 @@ namespace WindBot.Game.AI.Decks ...@@ -322,17 +317,17 @@ namespace WindBot.Game.AI.Decks
private bool AlternativeWhiteDragonEffect() private bool AlternativeWhiteDragonEffect()
{ {
ClientCard card = AI.Utils.GetProblematicEnemyMonster(Card.GetDefensePower()); ClientCard target = AI.Utils.GetProblematicEnemyMonster(Card.GetDefensePower());
if (card != null) if (target != null)
{ {
AI.SelectCard(card); AI.SelectCard(target);
UsedAlternativeWhiteDragon.Add(Card); UsedAlternativeWhiteDragon.Add(Card);
return true; return true;
} }
if (CanDealWithUsedAlternativeWhiteDragon()) if (CanDealWithUsedAlternativeWhiteDragon())
{ {
card = AI.Utils.GetBestEnemyMonster(); target = AI.Utils.GetBestEnemyMonster();
AI.SelectCard(card); AI.SelectCard(target);
UsedAlternativeWhiteDragon.Add(Card); UsedAlternativeWhiteDragon.Add(Card);
return true; return true;
} }
...@@ -442,14 +437,13 @@ namespace WindBot.Game.AI.Decks ...@@ -442,14 +437,13 @@ namespace WindBot.Game.AI.Decks
CardId.WhiteStoneOfLegend, CardId.WhiteStoneOfLegend,
CardId.WhiteStoneOfAncients CardId.WhiteStoneOfAncients
}); });
List<ClientCard> spells = Enemy.GetSpells(); if (Enemy.GetSpellCount() > 0)
if (spells.Count == 0)
{ {
AI.SelectNextCard(CardId.WhiteDragon); AI.SelectNextCard(CardId.DragonSpiritOfWhite);
} }
else else
{ {
AI.SelectNextCard(CardId.DragonSpiritOfWhite); AI.SelectNextCard(CardId.WhiteDragon);
} }
return true; return true;
} }
...@@ -462,25 +456,24 @@ namespace WindBot.Game.AI.Decks ...@@ -462,25 +456,24 @@ namespace WindBot.Game.AI.Decks
AI.SelectCard(target); AI.SelectCard(target);
return true; return true;
} }
else else if (HaveEnoughWhiteDragonInHand())
{ {
if (Duel.Player == 0 && Duel.Phase == DuelPhase.BattleStart) if (Duel.Player == 0 && Duel.Phase == DuelPhase.BattleStart)
{ {
return HaveEnoughWhiteDragonInHand() && Card.Attacked; return Card.Attacked;
} }
if (Duel.Player == 1 && Duel.Phase == DuelPhase.End) if (Duel.Player == 1 && Duel.Phase == DuelPhase.End)
{ {
return HaveEnoughWhiteDragonInHand() return Bot.HasInMonstersZone(CardId.AzureEyesSilverDragon, true)
&& Bot.HasInMonstersZone(CardId.AzureEyesSilverDragon, true)
&& !Bot.HasInGraveyard(CardId.DragonSpiritOfWhite) && !Bot.HasInGraveyard(CardId.DragonSpiritOfWhite)
&& !Bot.HasInGraveyard(CardId.WhiteDragon); && !Bot.HasInGraveyard(CardId.WhiteDragon);
} }
if (AI.Utils.IsChainTarget(Card)) if (AI.Utils.IsChainTarget(Card))
{ {
return HaveEnoughWhiteDragonInHand(); return true;
} }
return false;
} }
return false;
} }
private bool BlueEyesSpiritDragonEffect() private bool BlueEyesSpiritDragonEffect()
...@@ -547,14 +540,13 @@ namespace WindBot.Game.AI.Decks ...@@ -547,14 +540,13 @@ namespace WindBot.Game.AI.Decks
} }
else else
{ {
List<ClientCard> spells = Enemy.GetSpells(); if (Enemy.GetSpellCount() > 0)
if (spells.Count == 0)
{ {
AI.SelectCard(CardId.WhiteDragon); AI.SelectCard(CardId.DragonSpiritOfWhite);
} }
else else
{ {
AI.SelectCard(CardId.DragonSpiritOfWhite); AI.SelectCard(CardId.WhiteDragon);
} }
return true; return true;
} }
...@@ -620,8 +612,7 @@ namespace WindBot.Game.AI.Decks ...@@ -620,8 +612,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Bot.HasInMonstersZone(CardId.GalaxyEyesCipherDragon)) if (Bot.HasInMonstersZone(CardId.GalaxyEyesCipherDragon))
{ {
List<ClientCard> monsters = Bot.GetMonsters(); foreach (ClientCard monster in Bot.GetMonsters())
foreach (ClientCard monster in monsters)
{ {
if ((monster.IsDisabled() && monster.HasType(CardType.Xyz) && !monster.Equals(UsedGalaxyEyesCipherDragon)) if ((monster.IsDisabled() && monster.HasType(CardType.Xyz) && !monster.Equals(UsedGalaxyEyesCipherDragon))
|| (Duel.Phase == DuelPhase.Main2 && monster.Equals(UsedGalaxyEyesCipherDragon))) || (Duel.Phase == DuelPhase.Main2 && monster.Equals(UsedGalaxyEyesCipherDragon)))
...@@ -706,8 +697,7 @@ namespace WindBot.Game.AI.Decks ...@@ -706,8 +697,7 @@ namespace WindBot.Game.AI.Decks
AI.SelectCard(target); AI.SelectCard(target);
return true; return true;
} }
List<ClientCard> spells = Enemy.GetSpells(); foreach (ClientCard spell in Enemy.GetSpells())
foreach (ClientCard spell in spells)
{ {
if (spell.IsFaceup()) if (spell.IsFaceup())
{ {
...@@ -896,7 +886,7 @@ namespace WindBot.Game.AI.Decks ...@@ -896,7 +886,7 @@ namespace WindBot.Game.AI.Decks
if (Bot.HasInMonstersZone(CardId.BlueEyesSpiritDragon, true)) if (Bot.HasInMonstersZone(CardId.BlueEyesSpiritDragon, true))
return false; return false;
int count = Bot.GetGraveyardMonsters().Count; int count = Bot.GetGraveyardMonsters().Count;
int space = 5 - Bot.GetMonsterCount(); int space = 5 - Bot.GetMonstersInMainZone().Count;
if (count < space) if (count < space)
count = space; count = space;
if (count < 2 || Duel.LifePoints[0] < count*1000) if (count < 2 || Duel.LifePoints[0] < count*1000)
...@@ -905,16 +895,14 @@ namespace WindBot.Game.AI.Decks ...@@ -905,16 +895,14 @@ namespace WindBot.Game.AI.Decks
{ {
int attack = 0; int attack = 0;
int defence = 0; int defence = 0;
List<ClientCard> monsters = Bot.GetMonsters(); foreach (ClientCard monster in Bot.GetMonsters())
foreach (ClientCard monster in monsters)
{ {
if (!monster.IsDefense()) if (!monster.IsDefense())
{ {
attack += monster.Attack; attack += monster.Attack;
} }
} }
monsters = Enemy.GetMonsters(); foreach (ClientCard monster in Enemy.GetMonsters())
foreach (ClientCard monster in monsters)
{ {
defence += monster.GetDefensePower(); defence += monster.GetDefensePower();
} }
......
...@@ -200,7 +200,7 @@ namespace WindBot.Game.AI.Decks ...@@ -200,7 +200,7 @@ namespace WindBot.Game.AI.Decks
else else
option = 1; option = 1;
if (ActivateDescription != CardId.DragonRavine*16 + option) if (ActivateDescription != AI.Utils.GetStringId(CardId.DragonRavine, option))
return false; return false;
AI.SelectCard(tributeId); AI.SelectCard(tributeId);
...@@ -243,20 +243,13 @@ namespace WindBot.Game.AI.Decks ...@@ -243,20 +243,13 @@ namespace WindBot.Game.AI.Decks
private bool FoolishBurial() private bool FoolishBurial()
{ {
if (Bot.HasInGraveyard(CardId.DragunityPhalanx)) AI.SelectCard(new[]
return false;
if (Bot.HasInHand(CardId.DragunityPhalanx))
return false;
int remaining = 3;
foreach (ClientCard card in Bot.Banished)
if (card.Id == CardId.DragunityPhalanx)
remaining--;
if (remaining > 0)
{ {
AI.SelectCard(CardId.DragunityPhalanx); CardId.DragunityPhalanx,
return true; CardId.AssaultBeast,
} CardId.StardustDragonAssaultMode
return false; });
return true;
} }
private bool MonsterReborn() private bool MonsterReborn()
......
...@@ -16,11 +16,13 @@ namespace WindBot.Game.AI.Decks ...@@ -16,11 +16,13 @@ namespace WindBot.Game.AI.Decks
public const int Shell = 90885155; public const int Shell = 90885155;
public const int Helix = 37991342; public const int Helix = 37991342;
public const int Carrier = 91907707; public const int Carrier = 91907707;
public const int DarkHole = 53129443; public const int DarkHole = 53129443;
public const int CardOfDemise = 59750328; public const int CardOfDemise = 59750328;
public const int SummonersArt = 79816536; public const int SummonersArt = 79816536;
public const int PotOfDuality = 98645731; public const int PotOfDuality = 98645731;
public const int Saqlifice = 17639150; public const int Saqlifice = 17639150;
public const int MirrorForce = 44095762; public const int MirrorForce = 44095762;
public const int TorrentialTribute = 53582587; public const int TorrentialTribute = 53582587;
public const int DimensionalBarrier = 83326048; public const int DimensionalBarrier = 83326048;
...@@ -136,11 +138,18 @@ namespace WindBot.Game.AI.Decks ...@@ -136,11 +138,18 @@ namespace WindBot.Game.AI.Decks
{ {
return null; return null;
} }
IList<ClientCard> selected = new List<ClientCard>();
// select the last cards // pendulum summon, select the last cards
IList<ClientCard> selected = new List<ClientCard>();
for (int i = 1; i <= max; ++i) for (int i = 1; i <= max; ++i)
selected.Add(cards[cards.Count - i]); {
ClientCard card = cards[cards.Count - i];
if (card.Id != CardId.Scout || (card.Location == CardLocation.Extra && !Duel.IsNewRule))
selected.Add(card);
}
if (selected.Count == 0)
selected.Add(cards[cards.Count - 1]);
return selected; return selected;
} }
...@@ -189,9 +198,9 @@ namespace WindBot.Game.AI.Decks ...@@ -189,9 +198,9 @@ namespace WindBot.Game.AI.Decks
private bool TrapSetUnique() private bool TrapSetUnique()
{ {
foreach (ClientCard card in Bot.SpellZone) foreach (ClientCard card in Bot.GetSpells())
{ {
if (card != null && card.Id == Card.Id) if (card.Id == Card.Id)
return false; return false;
} }
return TrapSetWhenZoneFree(); return TrapSetWhenZoneFree();
......
...@@ -16,7 +16,7 @@ namespace WindBot.Game.AI.Decks ...@@ -16,7 +16,7 @@ namespace WindBot.Game.AI.Decks
public const int MasterPendulumTheDracoslayer = 75195825; public const int MasterPendulumTheDracoslayer = 75195825;
public const int AngelTrumpeter = 87979586; public const int AngelTrumpeter = 87979586;
public const int MetalfoesGoldriver = 33256280; public const int MetalfoesGoldriver = 33256280;
public const int Kabazauls = 51934376; public const int MegalosmasherX = 81823360;
public const int RescueRabbit = 85138716; public const int RescueRabbit = 85138716;
public const int UnexpectedDai = 911883; public const int UnexpectedDai = 911883;
...@@ -67,7 +67,7 @@ namespace WindBot.Game.AI.Decks ...@@ -67,7 +67,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.PotOfDesires, DefaultPotOfDesires); AddExecutor(ExecutorType.Activate, CardId.PotOfDesires, DefaultPotOfDesires);
AddExecutor(ExecutorType.Summon, CardId.AngelTrumpeter, AngelTrumpeterSummon); AddExecutor(ExecutorType.Summon, CardId.AngelTrumpeter, AngelTrumpeterSummon);
AddExecutor(ExecutorType.Summon, CardId.Kabazauls, KabazaulsSummon); AddExecutor(ExecutorType.Summon, CardId.MegalosmasherX, KabazaulsSummon);
AddExecutor(ExecutorType.Summon, CardId.MasterPendulumTheDracoslayer, MasterPendulumTheDracoslayerSummon); AddExecutor(ExecutorType.Summon, CardId.MasterPendulumTheDracoslayer, MasterPendulumTheDracoslayerSummon);
AddExecutor(ExecutorType.Summon, CardId.MysteryShellDragon, MysteryShellDragonSummon); AddExecutor(ExecutorType.Summon, CardId.MysteryShellDragon, MysteryShellDragonSummon);
AddExecutor(ExecutorType.Summon, CardId.PhantomGryphon, PhantomGryphonSummon); AddExecutor(ExecutorType.Summon, CardId.PhantomGryphon, PhantomGryphonSummon);
...@@ -142,11 +142,6 @@ namespace WindBot.Game.AI.Decks ...@@ -142,11 +142,6 @@ namespace WindBot.Game.AI.Decks
{ {
NormalSummoned = false; NormalSummoned = false;
} }
public override bool OnSelectHand()
{
return Program.Rand.Next(2) > 0;
}
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{ {
...@@ -164,21 +159,22 @@ namespace WindBot.Game.AI.Decks ...@@ -164,21 +159,22 @@ namespace WindBot.Game.AI.Decks
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.MysteryShellDragon, CardId.MysteryShellDragon,
CardId.PhantomGryphon CardId.PhantomGryphon,
CardId.MegalosmasherX
}); });
else if (AI.Utils.IsTurn1OrMain2()) else if (AI.Utils.IsTurn1OrMain2())
{ {
if (Bot.HasInHand(CardId.MysteryShellDragon)) if (Bot.HasInHand(CardId.MysteryShellDragon))
AI.SelectCard(CardId.MysteryShellDragon); AI.SelectCard(CardId.MysteryShellDragon);
else if (Bot.HasInHand(CardId.Kabazauls)) else if (Bot.HasInHand(CardId.MegalosmasherX))
AI.SelectCard(CardId.Kabazauls); AI.SelectCard(CardId.MegalosmasherX);
else if (Bot.HasInHand(CardId.AngelTrumpeter)) else if (Bot.HasInHand(CardId.AngelTrumpeter))
AI.SelectCard(CardId.AngelTrumpeter); AI.SelectCard(CardId.AngelTrumpeter);
} }
else else
{ {
if (Bot.HasInHand(CardId.Kabazauls)) if (Bot.HasInHand(CardId.MegalosmasherX))
AI.SelectCard(CardId.Kabazauls); AI.SelectCard(CardId.MegalosmasherX);
else if (Bot.HasInHand(CardId.MasterPendulumTheDracoslayer)) else if (Bot.HasInHand(CardId.MasterPendulumTheDracoslayer))
AI.SelectCard(CardId.MasterPendulumTheDracoslayer); AI.SelectCard(CardId.MasterPendulumTheDracoslayer);
else if (Bot.HasInHand(CardId.PhantomGryphon)) else if (Bot.HasInHand(CardId.PhantomGryphon))
...@@ -196,20 +192,24 @@ namespace WindBot.Game.AI.Decks ...@@ -196,20 +192,24 @@ namespace WindBot.Game.AI.Decks
private bool RescueRabbitEffect() private bool RescueRabbitEffect()
{ {
if (AI.Utils.IsTurn1OrMain2()) if (AI.Utils.IsTurn1OrMain2())
{
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.Kabazauls, CardId.MegalosmasherX,
CardId.MysteryShellDragon CardId.MysteryShellDragon
}); });
}
else else
{
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.MasterPendulumTheDracoslayer, CardId.MasterPendulumTheDracoslayer,
CardId.PhantomGryphon, CardId.PhantomGryphon,
CardId.Kabazauls, CardId.MegalosmasherX,
CardId.MetalfoesGoldriver, CardId.MetalfoesGoldriver,
CardId.AngelTrumpeter CardId.AngelTrumpeter
}); });
}
return true; return true;
} }
...@@ -235,7 +235,7 @@ namespace WindBot.Game.AI.Decks ...@@ -235,7 +235,7 @@ namespace WindBot.Game.AI.Decks
} }
private bool KabazaulsSummon() private bool KabazaulsSummon()
{ {
return Bot.HasInMonstersZone(CardId.Kabazauls); return Bot.HasInMonstersZone(CardId.MegalosmasherX);
} }
private bool NormalSummon() private bool NormalSummon()
{ {
...@@ -314,16 +314,14 @@ namespace WindBot.Game.AI.Decks ...@@ -314,16 +314,14 @@ namespace WindBot.Game.AI.Decks
private bool LightningChidoriSummon() private bool LightningChidoriSummon()
{ {
List<ClientCard> monsters = Enemy.GetMonsters(); foreach (ClientCard monster in Enemy.GetMonsters())
foreach (ClientCard monster in monsters)
{ {
if (monster.IsFacedown()) if (monster.IsFacedown())
{ {
return true; return true;
} }
} }
List<ClientCard> spells = Enemy.GetSpells(); foreach (ClientCard spell in Enemy.GetSpells())
foreach (ClientCard spell in spells)
{ {
if (spell.IsFacedown()) if (spell.IsFacedown())
{ {
...@@ -343,7 +341,7 @@ namespace WindBot.Game.AI.Decks ...@@ -343,7 +341,7 @@ namespace WindBot.Game.AI.Decks
private bool EvolzarLaggiaSummon() private bool EvolzarLaggiaSummon()
{ {
return (AI.Utils.IsAllEnemyBetterThanValue(1700, false) && !AI.Utils.IsOneEnemyBetterThanValue(2400, true)) || AI.Utils.IsTurn1OrMain2(); return (AI.Utils.IsAllEnemyBetterThanValue(2000, false) && !AI.Utils.IsOneEnemyBetterThanValue(2400, true)) || AI.Utils.IsTurn1OrMain2();
} }
private bool EvilswarmNightmareSummon() private bool EvilswarmNightmareSummon()
......
...@@ -60,7 +60,6 @@ namespace WindBot.Game.AI.Decks ...@@ -60,7 +60,6 @@ namespace WindBot.Game.AI.Decks
// Level 5 monsters without side effects // Level 5 monsters without side effects
AddExecutor(ExecutorType.SpSummon, CardId.CyberDragon); AddExecutor(ExecutorType.SpSummon, CardId.CyberDragon);
AddExecutor(ExecutorType.SpSummon, CardId.SolarWindJammer, SolarWindJammerSummon);
AddExecutor(ExecutorType.SpSummon, CardId.ZWEagleClaw); AddExecutor(ExecutorType.SpSummon, CardId.ZWEagleClaw);
AddExecutor(ExecutorType.Summon, CardId.ChronomalyGoldenJet, NormalSummon); AddExecutor(ExecutorType.Summon, CardId.ChronomalyGoldenJet, NormalSummon);
AddExecutor(ExecutorType.Activate, CardId.ChronomalyGoldenJet, ChronomalyGoldenJetEffect); AddExecutor(ExecutorType.Activate, CardId.ChronomalyGoldenJet, ChronomalyGoldenJetEffect);
...@@ -80,6 +79,7 @@ namespace WindBot.Game.AI.Decks ...@@ -80,6 +79,7 @@ namespace WindBot.Game.AI.Decks
// Level 5 monsters with side effects // Level 5 monsters with side effects
AddExecutor(ExecutorType.SpSummon, CardId.SolarWindJammer, SolarWindJammerSummon);
AddExecutor(ExecutorType.SpSummon, CardId.QuickdrawSynchron, QuickdrawSynchronSummon); AddExecutor(ExecutorType.SpSummon, CardId.QuickdrawSynchron, QuickdrawSynchronSummon);
AddExecutor(ExecutorType.Summon, CardId.MistArchfiend, MistArchfiendSummon); AddExecutor(ExecutorType.Summon, CardId.MistArchfiend, MistArchfiendSummon);
AddExecutor(ExecutorType.Activate, CardId.InstantFusion, InstantFusionEffect); AddExecutor(ExecutorType.Activate, CardId.InstantFusion, InstantFusionEffect);
...@@ -126,13 +126,15 @@ namespace WindBot.Game.AI.Decks ...@@ -126,13 +126,15 @@ namespace WindBot.Game.AI.Decks
private bool SolarWindJammerSummon() private bool SolarWindJammerSummon()
{ {
if (!NeedLV5())
return false;
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
return true; return true;
} }
private bool QuickdrawSynchronSummon() private bool QuickdrawSynchronSummon()
{ {
if (!needLV5()) if (!NeedLV5())
return false; return false;
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
...@@ -150,7 +152,7 @@ namespace WindBot.Game.AI.Decks ...@@ -150,7 +152,7 @@ namespace WindBot.Game.AI.Decks
private bool MistArchfiendSummon() private bool MistArchfiendSummon()
{ {
if (!needLV5()) if (!NeedLV5())
return false; return false;
AI.SelectOption(1); AI.SelectOption(1);
NormalSummoned = true; NormalSummoned = true;
...@@ -159,20 +161,21 @@ namespace WindBot.Game.AI.Decks ...@@ -159,20 +161,21 @@ namespace WindBot.Game.AI.Decks
private bool InstantFusionEffect() private bool InstantFusionEffect()
{ {
if (!needLV5()) if (!NeedLV5())
return false; return false;
InstantFusionUsed = true; InstantFusionUsed = true;
return true; return true;
} }
private bool needLV5() private bool NeedLV5()
{ {
if (HaveLV5OnField()) if (HaveOtherLV5OnField())
return true; return true;
int lv5Count = 0; int lv5Count = 0;
IList<ClientCard> hand = Bot.Hand; foreach (ClientCard card in Bot.Hand)
foreach (ClientCard card in hand)
{ {
if (card.Id == CardId.SolarWindJammer && Bot.GetMonsterCount() == 0)
++lv5Count;
if (card.Id == CardId.InstantFusion && !InstantFusionUsed) if (card.Id == CardId.InstantFusion && !InstantFusionUsed)
++lv5Count; ++lv5Count;
if (card.Id == CardId.QuickdrawSynchron && Bot.Hand.ContainsMonsterWithLevel(4)) if (card.Id == CardId.QuickdrawSynchron && Bot.Hand.ContainsMonsterWithLevel(4))
...@@ -189,7 +192,7 @@ namespace WindBot.Game.AI.Decks ...@@ -189,7 +192,7 @@ namespace WindBot.Game.AI.Decks
private bool WindUpSoldierEffect() private bool WindUpSoldierEffect()
{ {
return HaveLV5OnField(); return HaveOtherLV5OnField();
} }
private bool ChronomalyGoldenJetEffect() private bool ChronomalyGoldenJetEffect()
...@@ -201,18 +204,17 @@ namespace WindBot.Game.AI.Decks ...@@ -201,18 +204,17 @@ namespace WindBot.Game.AI.Decks
{ {
if (!NormalSummoned || DoubleSummonUsed) if (!NormalSummoned || DoubleSummonUsed)
return false; return false;
IList<ClientCard> hand = Bot.Hand; if (Bot.HasInHand(new[]
foreach (ClientCard card in hand)
{
if (card.Id == CardId.MistArchfiend ||
card.Id == CardId.WindUpSoldier ||
card.Id == CardId.StarDrawing ||
card.Id == CardId.ChronomalyGoldenJet)
{ {
NormalSummoned = false; CardId.MistArchfiend,
DoubleSummonUsed = true; CardId.WindUpSoldier,
return true; CardId.StarDrawing,
} CardId.ChronomalyGoldenJet
}))
{
NormalSummoned = false;
DoubleSummonUsed = true;
return true;
} }
return false; return false;
} }
...@@ -253,9 +255,8 @@ namespace WindBot.Game.AI.Decks ...@@ -253,9 +255,8 @@ namespace WindBot.Game.AI.Decks
} }
else else
{ {
List<ClientCard> monsters = Enemy.GetMonsters();
ClientCard bestmonster = null; ClientCard bestmonster = null;
foreach (ClientCard monster in monsters) foreach (ClientCard monster in Enemy.GetMonsters())
{ {
if (monster.IsAttack() && (bestmonster == null || monster.Attack >= bestmonster.Attack)) if (monster.IsAttack() && (bestmonster == null || monster.Attack >= bestmonster.Attack))
bestmonster = monster; bestmonster = monster;
...@@ -290,6 +291,8 @@ namespace WindBot.Game.AI.Decks ...@@ -290,6 +291,8 @@ namespace WindBot.Game.AI.Decks
private bool TirasKeeperOfGenesisEffect() private bool TirasKeeperOfGenesisEffect()
{ {
ClientCard target = AI.Utils.GetProblematicEnemyCard(); ClientCard target = AI.Utils.GetProblematicEnemyCard();
if (target == null)
target = AI.Utils.GetBestEnemyCard();
if (target != null) if (target != null)
{ {
AI.SelectCard(target); AI.SelectCard(target);
...@@ -304,8 +307,7 @@ namespace WindBot.Game.AI.Decks ...@@ -304,8 +307,7 @@ namespace WindBot.Game.AI.Decks
AI.SelectCard(CardId.Number61Volcasaurus); AI.SelectCard(CardId.Number61Volcasaurus);
return true; return true;
} }
List<ClientCard> monsters = Bot.GetMonsters(); foreach (ClientCard monster in Bot.GetMonsters())
foreach (ClientCard monster in monsters)
{ {
if (monster.HasType(CardType.Xyz) && !monster.HasXyzMaterial()) if (monster.HasType(CardType.Xyz) && !monster.HasXyzMaterial())
{ {
...@@ -318,13 +320,8 @@ namespace WindBot.Game.AI.Decks ...@@ -318,13 +320,8 @@ namespace WindBot.Game.AI.Decks
private bool XyzRebornEffect() private bool XyzRebornEffect()
{ {
foreach (ClientCard card in Bot.SpellZone) if (!UniqueFaceupSpell())
{ return false;
if (card != null &&
card.Id == Card.Id &&
card.HasPosition(CardPosition.FaceUp))
return false;
}
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.CyberDragonInfinity, CardId.CyberDragonInfinity,
...@@ -338,8 +335,15 @@ namespace WindBot.Game.AI.Decks ...@@ -338,8 +335,15 @@ namespace WindBot.Game.AI.Decks
private bool XyzUnitEffect() private bool XyzUnitEffect()
{ {
List<ClientCard> monsters = Bot.GetMonsters(); foreach (ClientCard monster in Bot.GetMonsters())
return monsters.Exists(p => p.HasType(CardType.Xyz)); {
if (monster.HasType(CardType.Xyz))
{
AI.SelectCard(monster);
return true;
}
}
return false;
} }
private bool PanzerDragonEffect() private bool PanzerDragonEffect()
...@@ -355,14 +359,9 @@ namespace WindBot.Game.AI.Decks ...@@ -355,14 +359,9 @@ namespace WindBot.Game.AI.Decks
private bool XyzVeilEffect() private bool XyzVeilEffect()
{ {
List<ClientCard> spells = Bot.GetSpells(); if (!UniqueFaceupSpell())
foreach (ClientCard spell in spells) return false;
{ foreach (ClientCard monster in Bot.GetMonsters())
if (spell.Id == CardId.XyzVeil && !spell.IsFacedown())
return false;
}
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
{ {
if (monster.HasType(CardType.Xyz)) if (monster.HasType(CardType.Xyz))
return true; return true;
...@@ -370,10 +369,9 @@ namespace WindBot.Game.AI.Decks ...@@ -370,10 +369,9 @@ namespace WindBot.Game.AI.Decks
return false; return false;
} }
private bool HaveLV5OnField() private bool HaveOtherLV5OnField()
{ {
List<ClientCard> monsters = Bot.GetMonsters(); foreach (ClientCard monster in Bot.GetMonsters())
foreach (ClientCard monster in monsters)
{ {
if (monster.HasType(CardType.Monster) && if (monster.HasType(CardType.Monster) &&
!monster.HasType(CardType.Xyz) && !monster.HasType(CardType.Xyz) &&
......
...@@ -237,8 +237,7 @@ namespace WindBot.Game.AI.Decks ...@@ -237,8 +237,7 @@ namespace WindBot.Game.AI.Decks
private bool MoonMirrorShieldEffect() private bool MoonMirrorShieldEffect()
{ {
List<ClientCard> monsters = Bot.GetMonsters(); foreach (ClientCard monster in Bot.GetMonsters())
foreach (ClientCard monster in monsters)
{ {
AI.SelectCard(monster); AI.SelectCard(monster);
return true; return true;
...@@ -250,8 +249,7 @@ namespace WindBot.Game.AI.Decks ...@@ -250,8 +249,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Card.Location == CardLocation.Hand) if (Card.Location == CardLocation.Hand)
return DefaultField(); return DefaultField();
IList<ClientCard> cards = Enemy.Graveyard; foreach (ClientCard card in Enemy.Graveyard)
foreach (ClientCard card in cards)
{ {
if (card.IsMonster()) if (card.IsMonster())
{ {
...@@ -269,16 +267,10 @@ namespace WindBot.Game.AI.Decks ...@@ -269,16 +267,10 @@ namespace WindBot.Game.AI.Decks
{ {
return false; return false;
} }
foreach (ClientCard card in Bot.SpellZone) if (!UniqueFaceupSpell())
{ return false;
if (card != null &&
card.Id == Card.Id &&
card.HasPosition(CardPosition.FaceUp))
return false;
}
bool selected = false; bool selected = false;
List<ClientCard> monsters = Bot.GetMonstersInExtraZone(); foreach (ClientCard monster in Bot.GetMonstersInExtraZone())
foreach (ClientCard monster in monsters)
{ {
if (monster.Attack > 1000) if (monster.Attack > 1000)
{ {
...@@ -289,7 +281,7 @@ namespace WindBot.Game.AI.Decks ...@@ -289,7 +281,7 @@ namespace WindBot.Game.AI.Decks
} }
if (!selected) if (!selected)
{ {
monsters = Bot.GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.Id == CardId.BalancerLord) if (monster.Id == CardId.BalancerLord)
......
...@@ -173,7 +173,6 @@ namespace WindBot.Game.AI.Decks ...@@ -173,7 +173,6 @@ namespace WindBot.Game.AI.Decks
return true; return true;
} }
private bool FoolishBurialEffect() private bool FoolishBurialEffect()
{ {
if (Bot.HasInHand(CardId.GraydleSlimeJr) && !Bot.HasInGraveyard(CardId.GraydleSlimeJr)) if (Bot.HasInHand(CardId.GraydleSlimeJr) && !Bot.HasInGraveyard(CardId.GraydleSlimeJr))
...@@ -281,8 +280,7 @@ namespace WindBot.Game.AI.Decks ...@@ -281,8 +280,7 @@ namespace WindBot.Game.AI.Decks
private bool NormalSummon() private bool NormalSummon()
{ {
List<ClientCard> monsters = Bot.GetMonsters(); foreach (ClientCard monster in Bot.GetMonsters())
foreach (ClientCard monster in monsters)
{ {
if (monster.Level==2) if (monster.Level==2)
{ {
...@@ -323,35 +321,41 @@ namespace WindBot.Game.AI.Decks ...@@ -323,35 +321,41 @@ namespace WindBot.Game.AI.Decks
return true; return true;
} }
} }
bool haveAquariumStage = Bot.HasInSpellZone(CardId.AquariumStage, true); if (!Bot.HasInSpellZone(CardId.AquariumStage, true))
foreach (ClientCard monster in monsters)
{ {
if (monster.Id == CardId.DupeFrog && !haveAquariumStage) foreach (ClientCard monster in monsters)
{ {
AI.SelectCard(monster); if (monster.Id == CardId.DupeFrog)
return true; {
AI.SelectCard(monster);
return true;
}
} }
} }
monsters = (List<ClientCard>)Bot.Hand; List<ClientCard> hands = Bot.Hand.GetMonsters();
bool HaveTwoGraydleSlimeJrInHand = Bot.GetCountCardInZone(Bot.Hand, CardId.GraydleSlimeJr) >= 2; if (Bot.GetCountCardInZone(Bot.Hand, CardId.GraydleSlimeJr) >= 2)
foreach (ClientCard monster in monsters)
{ {
if (monster.Id == CardId.GraydleSlimeJr && HaveTwoGraydleSlimeJrInHand) foreach (ClientCard monster in hands)
{ {
AI.SelectCard(monster); if (monster.Id == CardId.GraydleSlimeJr)
return true; {
AI.SelectCard(monster);
return true;
}
} }
} }
bool NeedDupeFrogInGrave = Bot.HasInGraveyard(CardId.Ronintoadin) && !Bot.HasInGraveyard(CardId.DupeFrog) && !Bot.HasInGraveyard(CardId.SwapFrog); if (Bot.HasInGraveyard(CardId.Ronintoadin) && !Bot.HasInGraveyard(CardId.DupeFrog) && !Bot.HasInGraveyard(CardId.SwapFrog))
foreach (ClientCard monster in monsters)
{ {
if (monster.Id == CardId.DupeFrog && NeedDupeFrogInGrave) foreach (ClientCard monster in hands)
{ {
AI.SelectCard(monster); if (monster.Id == CardId.DupeFrog)
return true; {
AI.SelectCard(monster);
return true;
}
} }
} }
foreach (ClientCard monster in monsters) foreach (ClientCard monster in hands)
{ {
if (monster.Id == CardId.Ronintoadin || monster.Id == CardId.DupeFrog) if (monster.Id == CardId.Ronintoadin || monster.Id == CardId.DupeFrog)
{ {
...@@ -359,7 +363,7 @@ namespace WindBot.Game.AI.Decks ...@@ -359,7 +363,7 @@ namespace WindBot.Game.AI.Decks
return true; return true;
} }
} }
foreach (ClientCard monster in monsters) foreach (ClientCard monster in hands)
{ {
AI.SelectCard(monster); AI.SelectCard(monster);
return true; return true;
...@@ -418,15 +422,14 @@ namespace WindBot.Game.AI.Decks ...@@ -418,15 +422,14 @@ namespace WindBot.Game.AI.Decks
private bool CatSharkSummon() private bool CatSharkSummon()
{ {
bool should = Bot.HasInMonstersZone(CardId.ToadallyAwesome) if (Bot.HasInMonstersZone(CardId.ToadallyAwesome)
&& ((AI.Utils.IsOneEnemyBetter(true) && ((AI.Utils.IsOneEnemyBetter(true)
&& !Bot.HasInMonstersZone(new[] && !Bot.HasInMonstersZone(new[]
{ {
CardId.CatShark, CardId.CatShark,
CardId.SkyCavalryCentaurea CardId.SkyCavalryCentaurea
}, true, true)) }, true, true))
|| !Bot.HasInExtra(CardId.ToadallyAwesome)); || !Bot.HasInExtra(CardId.ToadallyAwesome)))
if (should)
{ {
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
return true; return true;
...@@ -470,8 +473,7 @@ namespace WindBot.Game.AI.Decks ...@@ -470,8 +473,7 @@ namespace WindBot.Game.AI.Decks
private bool SkyCavalryCentaureaSummon() private bool SkyCavalryCentaureaSummon()
{ {
int num = 0; int num = 0;
List<ClientCard> monsters = Bot.GetMonsters(); foreach (ClientCard monster in Bot.GetMonsters())
foreach (ClientCard monster in monsters)
{ {
if (monster.Level ==2) if (monster.Level ==2)
{ {
...@@ -493,16 +495,14 @@ namespace WindBot.Game.AI.Decks ...@@ -493,16 +495,14 @@ namespace WindBot.Game.AI.Decks
{ {
int attack = 0; int attack = 0;
int defence = 0; int defence = 0;
List<ClientCard> monsters = Bot.GetMonsters(); foreach (ClientCard monster in Bot.GetMonsters())
foreach (ClientCard monster in monsters)
{ {
if (!monster.IsDefense()) if (!monster.IsDefense())
{ {
attack += monster.Attack; attack += monster.Attack;
} }
} }
monsters = Enemy.GetMonsters(); foreach (ClientCard monster in Enemy.GetMonsters())
foreach (ClientCard monster in monsters)
{ {
defence += monster.GetDefensePower(); defence += monster.GetDefensePower();
} }
...@@ -520,11 +520,9 @@ namespace WindBot.Game.AI.Decks ...@@ -520,11 +520,9 @@ namespace WindBot.Game.AI.Decks
private bool Repos() private bool Repos()
{ {
bool enemyBetter = AI.Utils.IsAllEnemyBetter(true);
if (Card.IsFacedown()) if (Card.IsFacedown())
return true; return true;
if (Card.IsDefense() && !enemyBetter && Card.Attack >= Card.Defense) if (Card.IsDefense() && !AI.Utils.IsAllEnemyBetter(true) && Card.Attack >= Card.Defense)
return true; return true;
return false; return false;
} }
......
...@@ -233,9 +233,9 @@ namespace WindBot.Game.AI.Decks ...@@ -233,9 +233,9 @@ namespace WindBot.Game.AI.Decks
private bool HaveAnotherYosenjuWithSameNameInHand() private bool HaveAnotherYosenjuWithSameNameInHand()
{ {
foreach (ClientCard card in Bot.Hand) foreach (ClientCard card in Bot.Hand.GetMonsters())
{ {
if (card != null && !card.Equals(Card) && card.Id == Card.Id) if (!card.Equals(Card) && card.Id == Card.Id)
return true; return true;
} }
return false; return false;
...@@ -243,9 +243,9 @@ namespace WindBot.Game.AI.Decks ...@@ -243,9 +243,9 @@ namespace WindBot.Game.AI.Decks
private bool TrapSetUnique() private bool TrapSetUnique()
{ {
foreach (ClientCard card in Bot.SpellZone) foreach (ClientCard card in Bot.GetSpells())
{ {
if (card != null && card.Id == Card.Id) if (card.Id == Card.Id)
return false; return false;
} }
return TrapSetWhenZoneFree(); return TrapSetWhenZoneFree();
...@@ -308,12 +308,5 @@ namespace WindBot.Game.AI.Decks ...@@ -308,12 +308,5 @@ namespace WindBot.Game.AI.Decks
} }
return true; return true;
} }
private bool NumberS39UtopiatheLightningSummon()
{
int selfBestAttack = AI.Utils.GetBestAttack(Bot);
int oppoBestAttack = AI.Utils.GetBestPower(Enemy);
return selfBestAttack <= oppoBestAttack;
}
} }
} }
\ No newline at end of file
...@@ -174,10 +174,9 @@ namespace WindBot.Game.AI.Decks ...@@ -174,10 +174,9 @@ namespace WindBot.Game.AI.Decks
{ {
if (Duel.LifePoints[0] <= 1000) if (Duel.LifePoints[0] <= 1000)
return false; return false;
List<ClientCard> monsters = Bot.GetMonsters();
int count4 = 0; int count4 = 0;
int count5 = 0; int count5 = 0;
foreach (ClientCard card in monsters) foreach (ClientCard card in Bot.GetMonsters())
{ {
if (card.Level == 5) if (card.Level == 5)
++count5; ++count5;
...@@ -214,10 +213,9 @@ namespace WindBot.Game.AI.Decks ...@@ -214,10 +213,9 @@ namespace WindBot.Game.AI.Decks
private bool GoblindberghFirst() private bool GoblindberghFirst()
{ {
IList<ClientCard> hand = Bot.Hand; foreach (ClientCard card in Bot.Hand.GetMonsters())
foreach (ClientCard card in hand)
{ {
if (card != Card && card.IsMonster() && card.Level == 4) if (!card.Equals(Card) && card.Level == 4)
return true; return true;
} }
return false; return false;
...@@ -237,24 +235,26 @@ namespace WindBot.Game.AI.Decks ...@@ -237,24 +235,26 @@ namespace WindBot.Game.AI.Decks
private bool SummonerMonkEffect() private bool SummonerMonkEffect()
{ {
if (Bot.HasInHand(CardId.InstantFusion) || IList<int> costs = new[]
Bot.HasInHand(CardId.MysticalSpaceTyphoon)) {
CardId.XyzChangeTactics,
CardId.DarkHole,
CardId.MysticalSpaceTyphoon,
CardId.InstantFusion
};
if (Bot.HasInHand(costs))
{ {
AI.SelectCard(new[] AI.SelectCard(costs);
AI.SelectNextCard(new[]
{ {
CardId.InstantFusion, CardId.SacredCrane,
CardId.MysticalSpaceTyphoon CardId.StarDrawing,
CardId.Goblindbergh,
CardId.TinGoldfish
}); });
AI.SelectPosition(CardPosition.FaceUpDefence);
return true; return true;
} }
AI.SelectNextCard(new[]
{
CardId.Goblindbergh,
CardId.TinGoldfish,
CardId.StarDrawing,
CardId.Kagetokage,
CardId.SacredCrane
});
return false; return false;
} }
......
...@@ -222,9 +222,7 @@ namespace WindBot.Game.AI.Decks ...@@ -222,9 +222,7 @@ namespace WindBot.Game.AI.Decks
private void SelectAleisterInGrave() private void SelectAleisterInGrave()
{ {
IList<ClientCard> materials0 = Bot.Graveyard; foreach (ClientCard card in Enemy.Graveyard)
IList<ClientCard> materials1 = Enemy.Graveyard;
foreach (ClientCard card in materials1)
{ {
if (card.Id == CardId.AleisterTheInvoker) if (card.Id == CardId.AleisterTheInvoker)
{ {
...@@ -232,7 +230,7 @@ namespace WindBot.Game.AI.Decks ...@@ -232,7 +230,7 @@ namespace WindBot.Game.AI.Decks
return; return;
} }
} }
foreach (ClientCard card in materials0) foreach (ClientCard card in Bot.Graveyard)
{ {
if (card.Id == CardId.AleisterTheInvoker) if (card.Id == CardId.AleisterTheInvoker)
{ {
...@@ -541,8 +539,7 @@ namespace WindBot.Game.AI.Decks ...@@ -541,8 +539,7 @@ namespace WindBot.Game.AI.Decks
private bool ZoodiacBarrageEffect() private bool ZoodiacBarrageEffect()
{ {
IList<ClientCard> spells = Bot.GetSpells(); foreach (ClientCard spell in Bot.GetSpells())
foreach (ClientCard spell in spells)
{ {
if (spell.Id == CardId.ZoodiacBarrage && !Card.Equals(spell)) if (spell.Id == CardId.ZoodiacBarrage && !Card.Equals(spell))
return false; return false;
......
...@@ -47,7 +47,7 @@ namespace WindBot.Game.AI ...@@ -47,7 +47,7 @@ namespace WindBot.Game.AI
/// </summary> /// </summary>
/// <param name="attacker">Card that attack.</param> /// <param name="attacker">Card that attack.</param>
/// <param name="defender">Card that defend.</param> /// <param name="defender">Card that defend.</param>
/// <returns>true if the attack can be done.</returns> /// <returns>false if the attack can't be done.</returns>
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{ {
if (attacker.RealPower <= 0) if (attacker.RealPower <= 0)
...@@ -56,14 +56,10 @@ namespace WindBot.Game.AI ...@@ -56,14 +56,10 @@ namespace WindBot.Game.AI
if (!attacker.IsMonsterHasPreventActivationEffectInBattle()) if (!attacker.IsMonsterHasPreventActivationEffectInBattle())
{ {
if (defender.IsMonsterDangerous() || (defender.IsMonsterInvincible() && defender.IsDefense())) if (defender.IsMonsterDangerous() || (defender.IsMonsterInvincible() && defender.IsDefense()))
{
return false; return false;
}
if (defender.Id == _CardId.CrystalWingSynchroDragon && !defender.IsDisabled() && attacker.Level >= 5) if (defender.Id == _CardId.CrystalWingSynchroDragon && !defender.IsDisabled() && attacker.Level >= 5)
{
return false; return false;
}
if (defender.Id == _CardId.NumberS39UtopiaTheLightning && !defender.IsDisabled() && defender.HasXyzMaterial(2, _CardId.Number39Utopia)) if (defender.Id == _CardId.NumberS39UtopiaTheLightning && !defender.IsDisabled() && defender.HasXyzMaterial(2, _CardId.Number39Utopia))
defender.RealPower = 5000; defender.RealPower = 5000;
...@@ -358,13 +354,8 @@ namespace WindBot.Game.AI ...@@ -358,13 +354,8 @@ namespace WindBot.Game.AI
/// </summary> /// </summary>
protected bool DefaultTributeSummon() protected bool DefaultTributeSummon()
{ {
foreach (ClientCard card in Bot.MonsterZone) if (!UniqueFaceupMonster())
{ return false;
if (card != null &&
card.Id == Card.Id &&
card.HasPosition(CardPosition.FaceUp))
return false;
}
int tributecount = (int)Math.Ceiling((Card.Level - 4.0d) / 2.0d); int tributecount = (int)Math.Ceiling((Card.Level - 4.0d) / 2.0d);
for (int j = 0; j < 7; ++j) for (int j = 0; j < 7; ++j)
{ {
...@@ -414,14 +405,32 @@ namespace WindBot.Game.AI ...@@ -414,14 +405,32 @@ namespace WindBot.Game.AI
if (HasChainedTrap(0)) if (HasChainedTrap(0))
return false; return false;
foreach (ClientCard card in Bot.SpellZone) return UniqueFaceupSpell();
}
/// <summary>
/// Check no other our spell or trap card with same name face-up.
/// </summary>
protected bool UniqueFaceupSpell()
{
foreach (ClientCard card in Bot.GetSpells())
{ {
if (card != null && if (card.Id == Card.Id && card.IsFaceup())
card.Id == Card.Id &&
card.HasPosition(CardPosition.FaceUp))
return false; return false;
} }
return true;
}
/// <summary>
/// Check no other our monster card with same name face-up.
/// </summary>
protected bool UniqueFaceupMonster()
{
foreach (ClientCard card in Bot.GetMonsters())
{
if (card.Id == Card.Id && card.IsFaceup())
return false;
}
return true; return true;
} }
......
...@@ -99,6 +99,17 @@ namespace WindBot.Game ...@@ -99,6 +99,17 @@ namespace WindBot.Game
return cards; return cards;
} }
public List<ClientCard> GetMonstersInMainZone()
{
List<ClientCard> cards = new List<ClientCard>();
for (int i = 0; i < 5; i++)
{
if (MonsterZone[i] != null)
cards.Add(MonsterZone[i]);
}
return cards;
}
public bool HasInHand(int cardId) public bool HasInHand(int cardId)
{ {
return HasInCards(Hand, cardId); return HasInCards(Hand, cardId);
......
...@@ -123,6 +123,10 @@ The parameters are same as commandlines, but low cased. ...@@ -123,6 +123,10 @@ The parameters are same as commandlines, but low cased.
* `AI.SelectTribute` * `AI.SelectTribute`
* Select cards to pendulum summon in executor.
* Get equip of card.
* Better new master rule support * Better new master rule support
* Update the known card enums * Update the known card enums
......
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