Commit f0e083d5 authored by mercury233's avatar mercury233

shortcut for Duel.Fields

parent ddbdbd85
...@@ -6,10 +6,14 @@ namespace WindBot.Game.AI ...@@ -6,10 +6,14 @@ namespace WindBot.Game.AI
public class AIFunctions public class AIFunctions
{ {
public Duel Duel { get; private set; } public Duel Duel { get; private set; }
public ClientField Bot { get; private set; }
public ClientField Enemy { get; private set; }
public AIFunctions(Duel duel) public AIFunctions(Duel duel)
{ {
Duel = duel; Duel = duel;
Bot = Duel.Fields[0];
Enemy = Duel.Fields[1];
} }
public static int CompareCardAttack(ClientCard cardA, ClientCard cardB) public static int CompareCardAttack(ClientCard cardA, ClientCard cardB)
...@@ -55,9 +59,9 @@ namespace WindBot.Game.AI ...@@ -55,9 +59,9 @@ namespace WindBot.Game.AI
public bool IsEnemyBetter(bool onlyatk, bool all) public bool IsEnemyBetter(bool onlyatk, bool all)
{ {
if (Duel.Fields[1].GetMonsterCount() == 0) if (Enemy.GetMonsterCount() == 0)
return false; return false;
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
monsters.Sort(CompareCardAttack); monsters.Sort(CompareCardAttack);
int bestAtk = -1; int bestAtk = -1;
if (monsters.Count > 0) if (monsters.Count > 0)
...@@ -73,7 +77,7 @@ namespace WindBot.Game.AI ...@@ -73,7 +77,7 @@ namespace WindBot.Game.AI
bool nomonster = true; bool nomonster = true;
for (int i = 0; i < 7; ++i) for (int i = 0; i < 7; ++i)
{ {
ClientCard card = Duel.Fields[1].MonsterZone[i]; ClientCard card = Enemy.MonsterZone[i];
if (card == null) continue; if (card == null) continue;
if (onlyatk && card.IsDefense()) continue; if (onlyatk && card.IsDefense()) continue;
nomonster = false; nomonster = false;
...@@ -90,7 +94,7 @@ namespace WindBot.Game.AI ...@@ -90,7 +94,7 @@ namespace WindBot.Game.AI
bool nomonster = true; bool nomonster = true;
for (int i = 0; i < 7; ++i) for (int i = 0; i < 7; ++i)
{ {
ClientCard card = Duel.Fields[1].MonsterZone[i]; ClientCard card = Enemy.MonsterZone[i];
if (card == null || card.Data == null) continue; if (card == null || card.Data == null) continue;
if (onlyatk && card.IsDefense()) continue; if (onlyatk && card.IsDefense()) continue;
nomonster = false; nomonster = false;
...@@ -105,7 +109,7 @@ namespace WindBot.Game.AI ...@@ -105,7 +109,7 @@ namespace WindBot.Game.AI
{ {
for (int i = 0; i < 7; ++i) for (int i = 0; i < 7; ++i)
{ {
ClientCard card = Duel.Fields[1].MonsterZone[i]; ClientCard card = Enemy.MonsterZone[i];
if (card == null) continue; if (card == null) continue;
if (onlyatk && card.IsDefense()) continue; if (onlyatk && card.IsDefense()) continue;
int enemyValue = card.GetDefensePower(); int enemyValue = card.GetDefensePower();
...@@ -117,39 +121,39 @@ namespace WindBot.Game.AI ...@@ -117,39 +121,39 @@ namespace WindBot.Game.AI
public ClientCard GetProblematicCard(int attack = 0) public ClientCard GetProblematicCard(int attack = 0)
{ {
ClientCard card = Duel.Fields[1].MonsterZone.GetInvincibleMonster(); ClientCard card = Enemy.MonsterZone.GetInvincibleMonster();
if (card != null) if (card != null)
return card; return card;
card = Duel.Fields[1].MonsterZone.GetFloodgate(); card = Enemy.MonsterZone.GetFloodgate();
if (card != null) if (card != null)
return card; return card;
card = Duel.Fields[1].SpellZone.GetFloodgate(); card = Enemy.SpellZone.GetFloodgate();
if (card != null) if (card != null)
return card; return card;
if (attack == 0) if (attack == 0)
attack = GetBestAttack(Duel.Fields[0], true); attack = GetBestAttack(Bot, true);
return GetOneEnemyBetterThanValue(attack, true); return GetOneEnemyBetterThanValue(attack, true);
} }
public ClientCard GetProblematicMonsterCard(int attack = 0) public ClientCard GetProblematicMonsterCard(int attack = 0)
{ {
ClientCard card = Duel.Fields[1].MonsterZone.GetInvincibleMonster(); ClientCard card = Enemy.MonsterZone.GetInvincibleMonster();
if (card != null) if (card != null)
return card; return card;
card = Duel.Fields[1].MonsterZone.GetFloodgate(); card = Enemy.MonsterZone.GetFloodgate();
if (card != null) if (card != null)
return card; return card;
if (attack == 0) if (attack == 0)
attack = GetBestAttack(Duel.Fields[0], true); attack = GetBestAttack(Bot, true);
return GetOneEnemyBetterThanValue(attack, true); return GetOneEnemyBetterThanValue(attack, true);
} }
public ClientCard GetProblematicSpellCard() public ClientCard GetProblematicSpellCard()
{ {
ClientCard card = Duel.Fields[1].SpellZone.GetNegateAttackSpell(); ClientCard card = Enemy.SpellZone.GetNegateAttackSpell();
if (card != null) if (card != null)
return card; return card;
card = Duel.Fields[1].SpellZone.GetFloodgate(); card = Enemy.SpellZone.GetFloodgate();
return card; return card;
} }
......
...@@ -90,14 +90,14 @@ namespace WindBot.Game.AI.Decks ...@@ -90,14 +90,14 @@ namespace WindBot.Game.AI.Decks
private bool 苍炎之修罗() private bool 苍炎之修罗()
{ {
if (Duel.Fields[0].HasInMonstersZone((int)CardId.晓之希洛克) && Duel.Fields[0].GetMonsters().GetHighestAttackMonster().Attack < 3800) if (Bot.HasInMonstersZone((int)CardId.晓之希洛克) && Bot.GetMonsters().GetHighestAttackMonster().Attack < 3800)
return true; return true;
return false; return false;
} }
private bool 黑旋风() private bool 黑旋风()
{ {
if (Card.Location == CardLocation.Hand && Duel.Fields[0].HasInSpellZone(Card.Id)) if (Card.Location == CardLocation.Hand && Bot.HasInSpellZone(Card.Id))
return false; return false;
if (ActivateDescription == AI.Utils.GetStringId((int)Card.Id,0)) if (ActivateDescription == AI.Utils.GetStringId((int)Card.Id,0))
AI.SelectCard((int)CardId.疾风之盖尔); AI.SelectCard((int)CardId.疾风之盖尔);
...@@ -106,8 +106,8 @@ namespace WindBot.Game.AI.Decks ...@@ -106,8 +106,8 @@ namespace WindBot.Game.AI.Decks
private bool 晓之希洛克() private bool 晓之希洛克()
{ {
int OpponentMonster = Duel.Fields[1].GetMonsterCount(); int OpponentMonster = Enemy.GetMonsterCount();
int AIMonster = Duel.Fields[0].GetMonsterCount(); int AIMonster = Bot.GetMonsterCount();
if (OpponentMonster != 0 && AIMonster == 0) if (OpponentMonster != 0 && AIMonster == 0)
return true; return true;
return false; return false;
...@@ -115,7 +115,7 @@ namespace WindBot.Game.AI.Decks ...@@ -115,7 +115,7 @@ namespace WindBot.Game.AI.Decks
private bool 黑枪之布拉斯特() private bool 黑枪之布拉斯特()
{ {
List<ClientCard> monster = Duel.Fields[0].GetMonsters(); List<ClientCard> monster = Bot.GetMonsters();
foreach (ClientCard card in monster) foreach (ClientCard card in monster)
if (card != null && card.Id == (int)CardId.残夜之波刃剑鸟 || card.Id == (int)CardId.月影之卡鲁特 || card.Id == (int)CardId.疾风之盖尔 || card.Id == (int)CardId.黑枪之布拉斯特 || card.Id == (int)CardId.晓之希洛克 || card.Id == (int)CardId.苍炎之修罗 || card.Id == (int)CardId.极北之布利扎德) if (card != null && card.Id == (int)CardId.残夜之波刃剑鸟 || card.Id == (int)CardId.月影之卡鲁特 || card.Id == (int)CardId.疾风之盖尔 || card.Id == (int)CardId.黑枪之布拉斯特 || card.Id == (int)CardId.晓之希洛克 || card.Id == (int)CardId.苍炎之修罗 || card.Id == (int)CardId.极北之布利扎德)
return true; return true;
...@@ -124,7 +124,7 @@ namespace WindBot.Game.AI.Decks ...@@ -124,7 +124,7 @@ namespace WindBot.Game.AI.Decks
private bool 月影之卡鲁特() private bool 月影之卡鲁特()
{ {
foreach (ClientCard card in Duel.Fields[0].Hand) foreach (ClientCard card in Bot.Hand)
if (card != null && card.Id == (int)CardId.残夜之波刃剑鸟 || card.Id == (int)CardId.疾风之盖尔 || card.Id == (int)CardId.黑枪之布拉斯特 || card.Id == (int)CardId.晓之希洛克 || card.Id == (int)CardId.苍炎之修罗 || card.Id == (int)CardId.极北之布利扎德) if (card != null && card.Id == (int)CardId.残夜之波刃剑鸟 || card.Id == (int)CardId.疾风之盖尔 || card.Id == (int)CardId.黑枪之布拉斯特 || card.Id == (int)CardId.晓之希洛克 || card.Id == (int)CardId.苍炎之修罗 || card.Id == (int)CardId.极北之布利扎德)
return false; return false;
return true; return true;
...@@ -132,7 +132,7 @@ namespace WindBot.Game.AI.Decks ...@@ -132,7 +132,7 @@ namespace WindBot.Game.AI.Decks
private bool 极北之布利扎德() private bool 极北之布利扎德()
{ {
foreach (ClientCard card in Duel.Fields[0].Graveyard) foreach (ClientCard card in Bot.Graveyard)
if (card != null && card.Id == (int)CardId.月影之卡鲁特 || card.Id == (int)CardId.黑枪之布拉斯特 || card.Id == (int)CardId.苍炎之修罗 || card.Id == (int)CardId.残夜之波刃剑鸟) if (card != null && card.Id == (int)CardId.月影之卡鲁特 || card.Id == (int)CardId.黑枪之布拉斯特 || card.Id == (int)CardId.苍炎之修罗 || card.Id == (int)CardId.残夜之波刃剑鸟)
return true; return true;
return false; return false;
...@@ -142,7 +142,7 @@ namespace WindBot.Game.AI.Decks ...@@ -142,7 +142,7 @@ namespace WindBot.Game.AI.Decks
{ {
int Count = 0; int Count = 0;
List<ClientCard> monster = Duel.Fields[0].GetMonsters(); List<ClientCard> monster = Bot.GetMonsters();
foreach (ClientCard card in monster) foreach (ClientCard card in monster)
if (card != null && card.Id == (int)CardId.残夜之波刃剑鸟 || card.Id == (int)CardId.月影之卡鲁特 || card.Id == (int)CardId.疾风之盖尔 || card.Id == (int)CardId.黑枪之布拉斯特 || card.Id == (int)CardId.晓之希洛克 || card.Id == (int)CardId.苍炎之修罗 || card.Id == (int)CardId.极北之布利扎德) if (card != null && card.Id == (int)CardId.残夜之波刃剑鸟 || card.Id == (int)CardId.月影之卡鲁特 || card.Id == (int)CardId.疾风之盖尔 || card.Id == (int)CardId.黑枪之布拉斯特 || card.Id == (int)CardId.晓之希洛克 || card.Id == (int)CardId.苍炎之修罗 || card.Id == (int)CardId.极北之布利扎德)
Count++; Count++;
...@@ -156,7 +156,7 @@ namespace WindBot.Game.AI.Decks ...@@ -156,7 +156,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Card.Position == (int)CardPosition.FaceUp) if (Card.Position == (int)CardPosition.FaceUp)
{ {
AI.SelectCard(Duel.Fields[1].GetMonsters().GetHighestAttackMonster()); AI.SelectCard(Enemy.GetMonsters().GetHighestAttackMonster());
return true; return true;
} }
return false; return false;
...@@ -164,11 +164,11 @@ namespace WindBot.Game.AI.Decks ...@@ -164,11 +164,11 @@ namespace WindBot.Game.AI.Decks
private bool 攻击力上升效果() private bool 攻击力上升效果()
{ {
if (Duel.Fields[1].GetMonsters().GetHighestAttackMonster().IsFacedown() || Duel.Fields[1].GetMonsters().GetHighestDefenseMonster().IsFacedown() || Duel.Fields[1].GetMonsterCount() == 0) if (Enemy.GetMonsters().GetHighestAttackMonster().IsFacedown() || Enemy.GetMonsters().GetHighestDefenseMonster().IsFacedown() || Enemy.GetMonsterCount() == 0)
return false; return false;
if (Duel.Fields[0].GetMonsters().GetHighestAttackMonster().Attack < Duel.Fields[1].GetMonsters().GetHighestAttackMonster().Attack) if (Bot.GetMonsters().GetHighestAttackMonster().Attack < Enemy.GetMonsters().GetHighestAttackMonster().Attack)
return true; return true;
if (Duel.Fields[0].GetMonsters().GetHighestAttackMonster().Attack < Duel.Fields[1].GetMonsters().GetHighestDefenseMonster().Defense) if (Bot.GetMonsters().GetHighestAttackMonster().Attack < Enemy.GetMonsters().GetHighestDefenseMonster().Defense)
return true; return true;
return false; return false;
} }
......
...@@ -149,7 +149,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -149,7 +149,7 @@ namespace MycardBot.Game.AI.Decks
{ {
Logger.DebugWriteLine("龙觉醒检索."); Logger.DebugWriteLine("龙觉醒检索.");
IList<ClientCard> result = new List<ClientCard>(); IList<ClientCard> result = new List<ClientCard>();
if (!Duel.Fields[0].HasInHand((int)CardId.青眼白龙)) if (!Bot.HasInHand((int)CardId.青眼白龙))
{ {
foreach (ClientCard card in cards) foreach (ClientCard card in cards)
{ {
...@@ -310,7 +310,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -310,7 +310,7 @@ namespace MycardBot.Game.AI.Decks
(int)CardId.太古的白石, (int)CardId.太古的白石,
(int)CardId.传说的白石 (int)CardId.传说的白石
}); });
if (!Duel.Fields[0].HasInHand((int)CardId.青眼白龙)) if (!Bot.HasInHand((int)CardId.青眼白龙))
{ {
Logger.DebugWriteLine("手里没有本体,堆白石."); Logger.DebugWriteLine("手里没有本体,堆白石.");
AI.SelectNextCard((int)CardId.传说的白石); AI.SelectNextCard((int)CardId.传说的白石);
...@@ -347,12 +347,12 @@ namespace MycardBot.Game.AI.Decks ...@@ -347,12 +347,12 @@ namespace MycardBot.Game.AI.Decks
private bool 调和的宝札效果() private bool 调和的宝札效果()
{ {
Logger.DebugWriteLine("调和选要丢的卡."); Logger.DebugWriteLine("调和选要丢的卡.");
if (!Duel.Fields[0].HasInHand((int)CardId.青眼白龙)) if (!Bot.HasInHand((int)CardId.青眼白龙))
{ {
Logger.DebugWriteLine("手里没有本体,丢白石."); Logger.DebugWriteLine("手里没有本体,丢白石.");
AI.SelectCard((int)CardId.传说的白石); AI.SelectCard((int)CardId.传说的白石);
} }
else if (Duel.Fields[0].HasInHand((int)CardId.抵价购物)) else if (Bot.HasInHand((int)CardId.抵价购物))
{ {
Logger.DebugWriteLine("手里有本体,再拿一个喂八抽."); Logger.DebugWriteLine("手里有本体,再拿一个喂八抽.");
AI.SelectCard((int)CardId.传说的白石); AI.SelectCard((int)CardId.传说的白石);
...@@ -368,7 +368,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -368,7 +368,7 @@ namespace MycardBot.Game.AI.Decks
private bool 抵价购物效果() private bool 抵价购物效果()
{ {
Logger.DebugWriteLine("抵价购物发动."); Logger.DebugWriteLine("抵价购物发动.");
if (Duel.Fields[0].HasInHand((int)CardId.白色灵龙)) if (Bot.HasInHand((int)CardId.白色灵龙))
{ {
Logger.DebugWriteLine("手里有白灵龙,优先丢掉."); Logger.DebugWriteLine("手里有白灵龙,优先丢掉.");
AI.SelectCard((int)CardId.白色灵龙); AI.SelectCard((int)CardId.白色灵龙);
...@@ -386,7 +386,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -386,7 +386,7 @@ namespace MycardBot.Game.AI.Decks
AI.SelectCard((int)CardId.青眼亚白龙); AI.SelectCard((int)CardId.青眼亚白龙);
return true; return true;
} }
else if (!Duel.Fields[0].HasInHand((int)CardId.青眼白龙) || !Duel.Fields[0].HasInHand((int)CardId.青眼亚白龙)) else if (!Bot.HasInHand((int)CardId.青眼白龙) || !Bot.HasInHand((int)CardId.青眼亚白龙))
{ {
Logger.DebugWriteLine("手里没有成对的青眼和亚白,丢1个."); Logger.DebugWriteLine("手里没有成对的青眼和亚白,丢1个.");
AI.SelectCard(new[] AI.SelectCard(new[]
...@@ -406,7 +406,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -406,7 +406,7 @@ namespace MycardBot.Game.AI.Decks
private bool 青眼亚白龙效果() private bool 青眼亚白龙效果()
{ {
Logger.DebugWriteLine("亚白龙效果."); Logger.DebugWriteLine("亚白龙效果.");
ClientCard card = Duel.Fields[1].MonsterZone.GetFloodgate(); ClientCard card = Enemy.MonsterZone.GetFloodgate();
if (card != null) if (card != null)
{ {
Logger.DebugWriteLine("炸坑怪."); Logger.DebugWriteLine("炸坑怪.");
...@@ -414,7 +414,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -414,7 +414,7 @@ namespace MycardBot.Game.AI.Decks
使用过的青眼亚白龙.Add(Card); 使用过的青眼亚白龙.Add(Card);
return true; return true;
} }
card = Duel.Fields[1].MonsterZone.GetInvincibleMonster(); card = Enemy.MonsterZone.GetInvincibleMonster();
if (card != null) if (card != null)
{ {
Logger.DebugWriteLine("炸打不死的怪."); Logger.DebugWriteLine("炸打不死的怪.");
...@@ -422,7 +422,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -422,7 +422,7 @@ namespace MycardBot.Game.AI.Decks
使用过的青眼亚白龙.Add(Card); 使用过的青眼亚白龙.Add(Card);
return true; return true;
} }
card = Duel.Fields[1].MonsterZone.GetDangerousMonster(); card = Enemy.MonsterZone.GetDangerousMonster();
if (card != null) if (card != null)
{ {
Logger.DebugWriteLine("炸厉害的怪."); Logger.DebugWriteLine("炸厉害的怪.");
...@@ -468,12 +468,12 @@ namespace MycardBot.Game.AI.Decks ...@@ -468,12 +468,12 @@ namespace MycardBot.Game.AI.Decks
(int)CardId.青眼白龙, (int)CardId.青眼白龙,
(int)CardId.白色灵龙 (int)CardId.白色灵龙
}; };
if (!Duel.Fields[0].HasInGraveyard(targets)) if (!Bot.HasInGraveyard(targets))
{ {
return false; return false;
} }
ClientCard floodgate = Duel.Fields[1].SpellZone.GetFloodgate(); ClientCard floodgate = Enemy.SpellZone.GetFloodgate();
if (floodgate != null && Duel.Fields[0].HasInGraveyard((int)CardId.白色灵龙)) if (floodgate != null && Bot.HasInGraveyard((int)CardId.白色灵龙))
{ {
AI.SelectCard((int)CardId.白色灵龙); AI.SelectCard((int)CardId.白色灵龙);
} }
...@@ -486,13 +486,13 @@ namespace MycardBot.Game.AI.Decks ...@@ -486,13 +486,13 @@ namespace MycardBot.Game.AI.Decks
private bool 强欲而贪欲之壶效果() private bool 强欲而贪欲之壶效果()
{ {
return Duel.Fields[0].Deck.Count > 15; return Bot.Deck.Count > 15;
} }
private bool 苍眼银龙效果() private bool 苍眼银龙效果()
{ {
Logger.DebugWriteLine("苍眼银龙效果."); Logger.DebugWriteLine("苍眼银龙效果.");
if (Duel.Fields[1].GetSpellCount() > 0) if (Enemy.GetSpellCount() > 0)
{ {
AI.SelectCard((int)CardId.白色灵龙); AI.SelectCard((int)CardId.白色灵龙);
} }
...@@ -506,7 +506,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -506,7 +506,7 @@ namespace MycardBot.Game.AI.Decks
private bool 青色眼睛的贤士通常召唤() private bool 青色眼睛的贤士通常召唤()
{ {
Logger.DebugWriteLine("手里没有白石,先贤士检索."); Logger.DebugWriteLine("手里没有白石,先贤士检索.");
return !Duel.Fields[0].HasInHand(new List<int> return !Bot.HasInHand(new List<int>
{ {
(int)CardId.太古的白石, (int)CardId.太古的白石,
(int)CardId.传说的白石 (int)CardId.传说的白石
...@@ -531,7 +531,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -531,7 +531,7 @@ namespace MycardBot.Game.AI.Decks
private bool 传说的白石通常召唤() private bool 传说的白石通常召唤()
{ {
Logger.DebugWriteLine("通招白石给贤士发手卡效果."); Logger.DebugWriteLine("通招白石给贤士发手卡效果.");
return Duel.Fields[0].HasInHand((int)CardId.青色眼睛的贤士); return Bot.HasInHand((int)CardId.青色眼睛的贤士);
} }
private bool 青色眼睛的贤士手卡效果() private bool 青色眼睛的贤士手卡效果()
...@@ -540,11 +540,11 @@ namespace MycardBot.Game.AI.Decks ...@@ -540,11 +540,11 @@ namespace MycardBot.Game.AI.Decks
{ {
return false; return false;
} }
if (!Duel.Fields[0].HasInMonstersZone(new List<int> if (!Bot.HasInMonstersZone(new List<int>
{ {
(int)CardId.传说的白石, (int)CardId.传说的白石,
(int)CardId.太古的白石 (int)CardId.太古的白石
}) || Duel.Fields[0].HasInMonstersZone(new List<int> }) || Bot.HasInMonstersZone(new List<int>
{ {
(int)CardId.青眼亚白龙, (int)CardId.青眼亚白龙,
(int)CardId.青眼白龙, (int)CardId.青眼白龙,
...@@ -559,7 +559,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -559,7 +559,7 @@ namespace MycardBot.Game.AI.Decks
(int)CardId.传说的白石, (int)CardId.传说的白石,
(int)CardId.太古的白石 (int)CardId.太古的白石
}); });
List<ClientCard> spells = Duel.Fields[1].GetSpells(); List<ClientCard> spells = Enemy.GetSpells();
if (spells.Count == 0) if (spells.Count == 0)
{ {
Logger.DebugWriteLine("对面没坑,跳个本体."); Logger.DebugWriteLine("对面没坑,跳个本体.");
...@@ -579,7 +579,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -579,7 +579,7 @@ namespace MycardBot.Game.AI.Decks
if (ActivateDescription == -1) if (ActivateDescription == -1)
{ {
Logger.DebugWriteLine("白色灵龙拆后场."); Logger.DebugWriteLine("白色灵龙拆后场.");
ClientCard target = Duel.Fields[1].SpellZone.GetFloodgate(); ClientCard target = Enemy.SpellZone.GetFloodgate();
AI.SelectCard(target); AI.SelectCard(target);
return true; return true;
} }
...@@ -599,9 +599,9 @@ namespace MycardBot.Game.AI.Decks ...@@ -599,9 +599,9 @@ namespace MycardBot.Game.AI.Decks
{ {
Logger.DebugWriteLine("白色灵龙回合结束变身"); Logger.DebugWriteLine("白色灵龙回合结束变身");
return 手里有足够的青眼白龙() return 手里有足够的青眼白龙()
&& Duel.Fields[0].HasInMonstersZone((int)CardId.苍眼银龙, true) && Bot.HasInMonstersZone((int)CardId.苍眼银龙, true)
&& !Duel.Fields[0].HasInGraveyard((int)CardId.白色灵龙) && !Bot.HasInGraveyard((int)CardId.白色灵龙)
&& !Duel.Fields[0].HasInGraveyard((int)CardId.青眼白龙); && !Bot.HasInGraveyard((int)CardId.青眼白龙);
} }
Logger.DebugWriteLine("白色灵龙特招手卡. 对象数量" + Duel.ChainTargets.Count); Logger.DebugWriteLine("白色灵龙特招手卡. 对象数量" + Duel.ChainTargets.Count);
foreach (ClientCard card in Duel.ChainTargets) foreach (ClientCard card in Duel.ChainTargets)
...@@ -664,9 +664,9 @@ namespace MycardBot.Game.AI.Decks ...@@ -664,9 +664,9 @@ namespace MycardBot.Game.AI.Decks
if (ActivateDescription == AI.Utils.GetStringId((int)CardId.太古的白石, 0)) if (ActivateDescription == AI.Utils.GetStringId((int)CardId.太古的白石, 0))
{ {
Logger.DebugWriteLine("太古白石回收效果."); Logger.DebugWriteLine("太古白石回收效果.");
if (Duel.Fields[0].HasInHand((int)CardId.抵价购物) if (Bot.HasInHand((int)CardId.抵价购物)
&& !Duel.Fields[0].HasInHand((int)CardId.青眼白龙) && !Bot.HasInHand((int)CardId.青眼白龙)
&& !Duel.Fields[0].HasInHand((int)CardId.青眼亚白龙)) && !Bot.HasInHand((int)CardId.青眼亚白龙))
{ {
Logger.DebugWriteLine("回收喂八抽."); Logger.DebugWriteLine("回收喂八抽.");
AI.SelectCard((int)CardId.青眼白龙); AI.SelectCard((int)CardId.青眼白龙);
...@@ -677,17 +677,17 @@ namespace MycardBot.Game.AI.Decks ...@@ -677,17 +677,17 @@ namespace MycardBot.Game.AI.Decks
Logger.DebugWriteLine("已经跳过亚白龙,下回合再回收."); Logger.DebugWriteLine("已经跳过亚白龙,下回合再回收.");
return false; return false;
} }
if (Duel.Fields[0].HasInHand((int)CardId.青眼白龙) if (Bot.HasInHand((int)CardId.青眼白龙)
&& !Duel.Fields[0].HasInHand((int)CardId.青眼亚白龙) && !Bot.HasInHand((int)CardId.青眼亚白龙)
&& Duel.Fields[0].HasInGraveyard((int)CardId.青眼亚白龙)) && Bot.HasInGraveyard((int)CardId.青眼亚白龙))
{ {
Logger.DebugWriteLine("缺亚白龙,回收."); Logger.DebugWriteLine("缺亚白龙,回收.");
AI.SelectCard((int)CardId.青眼亚白龙); AI.SelectCard((int)CardId.青眼亚白龙);
return true; return true;
} }
if (Duel.Fields[0].HasInHand((int)CardId.青眼亚白龙) if (Bot.HasInHand((int)CardId.青眼亚白龙)
&& !Duel.Fields[0].HasInHand((int)CardId.青眼白龙) && !Bot.HasInHand((int)CardId.青眼白龙)
&& Duel.Fields[0].HasInGraveyard((int)CardId.青眼白龙)) && Bot.HasInGraveyard((int)CardId.青眼白龙))
{ {
Logger.DebugWriteLine("有亚白龙缺本体,回收."); Logger.DebugWriteLine("有亚白龙缺本体,回收.");
AI.SelectCard((int)CardId.青眼白龙); AI.SelectCard((int)CardId.青眼白龙);
...@@ -699,7 +699,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -699,7 +699,7 @@ namespace MycardBot.Game.AI.Decks
else else
{ {
Logger.DebugWriteLine("太古白石特招效果."); Logger.DebugWriteLine("太古白石特招效果.");
List<ClientCard> spells = Duel.Fields[1].GetSpells(); List<ClientCard> spells = Enemy.GetSpells();
if (spells.Count == 0) if (spells.Count == 0)
{ {
Logger.DebugWriteLine("对面没坑,跳个本体."); Logger.DebugWriteLine("对面没坑,跳个本体.");
...@@ -724,7 +724,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -724,7 +724,7 @@ namespace MycardBot.Game.AI.Decks
private bool 太古的白石通常召唤() private bool 太古的白石通常召唤()
{ {
Logger.DebugWriteLine("1星怪兽通常召唤."); Logger.DebugWriteLine("1星怪兽通常召唤.");
return Duel.Fields[0].HasInMonstersZone(new List<int> return Bot.HasInMonstersZone(new List<int>
{ {
(int)CardId.青色眼睛的贤士, (int)CardId.青色眼睛的贤士,
(int)CardId.太古的白石, (int)CardId.太古的白石,
...@@ -743,7 +743,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -743,7 +743,7 @@ namespace MycardBot.Game.AI.Decks
Logger.DebugWriteLine("先攻不叠银河眼,叠银河巨神."); Logger.DebugWriteLine("先攻不叠银河眼,叠银河巨神.");
return false; return false;
} }
List<ClientCard> monsters = Duel.Fields[1].GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
if (monsters.Count == 1 && !monsters[0].IsFacedown() && ((monsters[0].IsDefense() && monsters[0].GetDefensePower() >= 3000) && monsters[0].HasType(CardType.Xyz))) if (monsters.Count == 1 && !monsters[0].IsFacedown() && ((monsters[0].IsDefense() && monsters[0].GetDefensePower() >= 3000) && monsters[0].HasType(CardType.Xyz)))
{ {
Logger.DebugWriteLine("只有一个大怪兽,光波龙抢之."); Logger.DebugWriteLine("只有一个大怪兽,光波龙抢之.");
...@@ -782,9 +782,9 @@ namespace MycardBot.Game.AI.Decks ...@@ -782,9 +782,9 @@ namespace MycardBot.Game.AI.Decks
private bool 银河眼重铠光子龙超量召唤() private bool 银河眼重铠光子龙超量召唤()
{ {
Logger.DebugWriteLine("银河眼重铠光子龙超量召唤."); Logger.DebugWriteLine("银河眼重铠光子龙超量召唤.");
if (Duel.Fields[0].HasInMonstersZone((int)CardId.银河眼光波龙)) if (Bot.HasInMonstersZone((int)CardId.银河眼光波龙))
{ {
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if ((monster.IsDisabled() && monster.HasType(CardType.Xyz) && !monster.Equals(使用过的光波龙)) if ((monster.IsDisabled() && monster.HasType(CardType.Xyz) && !monster.Equals(使用过的光波龙))
...@@ -795,7 +795,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -795,7 +795,7 @@ namespace MycardBot.Game.AI.Decks
} }
} }
} }
if (Duel.Fields[0].HasInMonstersZone((int)CardId.银河眼光子龙皇)) if (Bot.HasInMonstersZone((int)CardId.银河眼光子龙皇))
{ {
if (!AI.Utils.IsOneEnemyBetterThanValue(4000, false)) if (!AI.Utils.IsOneEnemyBetterThanValue(4000, false))
{ {
...@@ -810,7 +810,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -810,7 +810,7 @@ namespace MycardBot.Game.AI.Decks
private bool 银河眼光波刃龙超量召唤() private bool 银河眼光波刃龙超量召唤()
{ {
Logger.DebugWriteLine("银河眼光波刃龙超量召唤."); Logger.DebugWriteLine("银河眼光波刃龙超量召唤.");
if (Duel.Fields[0].HasInMonstersZone((int)CardId.银河眼重铠光子龙) && AI.Utils.GetProblematicCard() != null) if (Bot.HasInMonstersZone((int)CardId.银河眼重铠光子龙) && AI.Utils.GetProblematicCard() != null)
{ {
AI.SelectCard((int)CardId.银河眼重铠光子龙); AI.SelectCard((int)CardId.银河眼重铠光子龙);
return true; return true;
...@@ -821,7 +821,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -821,7 +821,7 @@ namespace MycardBot.Game.AI.Decks
private bool 银河眼暗物质龙超量召唤() private bool 银河眼暗物质龙超量召唤()
{ {
Logger.DebugWriteLine("银河眼暗物质龙超量召唤."); Logger.DebugWriteLine("银河眼暗物质龙超量召唤.");
if (Duel.Fields[0].HasInMonstersZone((int)CardId.银河眼重铠光子龙)) if (Bot.HasInMonstersZone((int)CardId.银河眼重铠光子龙))
{ {
AI.SelectCard((int)CardId.银河眼重铠光子龙); AI.SelectCard((int)CardId.银河眼重铠光子龙);
return true; return true;
...@@ -837,7 +837,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -837,7 +837,7 @@ namespace MycardBot.Game.AI.Decks
private bool 银河眼光波龙效果() private bool 银河眼光波龙效果()
{ {
Logger.DebugWriteLine("银河眼光波龙效果."); Logger.DebugWriteLine("银河眼光波龙效果.");
List<ClientCard> monsters = Duel.Fields[1].GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.HasType(CardType.Xyz)) if (monster.HasType(CardType.Xyz))
...@@ -863,19 +863,19 @@ namespace MycardBot.Game.AI.Decks ...@@ -863,19 +863,19 @@ namespace MycardBot.Game.AI.Decks
private bool 银河眼重铠光子龙效果() private bool 银河眼重铠光子龙效果()
{ {
Logger.DebugWriteLine("重铠优先炸后场."); Logger.DebugWriteLine("重铠优先炸后场.");
ClientCard floodgate = Duel.Fields[1].SpellZone.GetFloodgate(); ClientCard floodgate = Enemy.SpellZone.GetFloodgate();
if (floodgate != null) if (floodgate != null)
{ {
AI.SelectCard(floodgate); AI.SelectCard(floodgate);
return true; return true;
} }
floodgate = Duel.Fields[1].MonsterZone.GetFloodgate(); floodgate = Enemy.MonsterZone.GetFloodgate();
if (floodgate != null) if (floodgate != null)
{ {
AI.SelectCard(floodgate); AI.SelectCard(floodgate);
return true; return true;
} }
List<ClientCard> spells = Duel.Fields[1].GetSpells(); List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells) foreach (ClientCard spell in spells)
{ {
if (!spell.IsFacedown()) if (!spell.IsFacedown())
...@@ -884,7 +884,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -884,7 +884,7 @@ namespace MycardBot.Game.AI.Decks
return true; return true;
} }
} }
List<ClientCard> monsters = Duel.Fields[1].GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
if (monsters.Count >= 2) if (monsters.Count >= 2)
{ {
Logger.DebugWriteLine("怪多就先炸守备的."); Logger.DebugWriteLine("怪多就先炸守备的.");
...@@ -930,7 +930,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -930,7 +930,7 @@ namespace MycardBot.Game.AI.Decks
AI.SelectCard(target); AI.SelectCard(target);
return true; return true;
} }
List<ClientCard> monsters = Duel.Fields[1].GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.IsDefense()) if (monster.IsDefense())
...@@ -944,7 +944,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -944,7 +944,7 @@ namespace MycardBot.Game.AI.Decks
AI.SelectCard(monster); AI.SelectCard(monster);
return true; return true;
} }
List<ClientCard> spells = Duel.Fields[1].GetSpells(); List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells) foreach (ClientCard spell in spells)
{ {
if (spell.IsFacedown()) if (spell.IsFacedown())
...@@ -984,8 +984,8 @@ namespace MycardBot.Game.AI.Decks ...@@ -984,8 +984,8 @@ namespace MycardBot.Game.AI.Decks
{ {
if (Duel.Phase != DuelPhase.Main1 || Duel.Turn == 1 || 已发动灵魂补充) if (Duel.Phase != DuelPhase.Main1 || Duel.Turn == 1 || 已发动灵魂补充)
return false; return false;
int bestSelfAttack = AI.Utils.GetBestAttack(Duel.Fields[0], false); int bestSelfAttack = AI.Utils.GetBestAttack(Bot, false);
int bestEnemyAttack = AI.Utils.GetBestAttack(Duel.Fields[1], false); int bestEnemyAttack = AI.Utils.GetBestAttack(Enemy, false);
return bestSelfAttack <= bestEnemyAttack && bestEnemyAttack > 2500 && bestEnemyAttack <= 3100; return bestSelfAttack <= bestEnemyAttack && bestEnemyAttack > 2500 && bestEnemyAttack <= 3100;
} }
...@@ -1046,7 +1046,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -1046,7 +1046,7 @@ namespace MycardBot.Game.AI.Decks
Logger.DebugWriteLine("先攻可以超量森罗的姬芽宫."); Logger.DebugWriteLine("先攻可以超量森罗的姬芽宫.");
return true; return true;
} }
if (Duel.Phase == DuelPhase.Main1 && !Duel.Fields[0].HasInMonstersZone(new List<int> if (Duel.Phase == DuelPhase.Main1 && !Bot.HasInMonstersZone(new List<int>
{ {
(int)CardId.青眼亚白龙, (int)CardId.青眼亚白龙,
(int)CardId.青眼白龙, (int)CardId.青眼白龙,
...@@ -1077,10 +1077,10 @@ namespace MycardBot.Game.AI.Decks ...@@ -1077,10 +1077,10 @@ namespace MycardBot.Game.AI.Decks
private bool 灵魂补充() private bool 灵魂补充()
{ {
Logger.DebugWriteLine("灵魂补充."); Logger.DebugWriteLine("灵魂补充.");
if (Duel.Fields[0].HasInMonstersZone((int)CardId.青眼精灵龙, true)) if (Bot.HasInMonstersZone((int)CardId.青眼精灵龙, true))
return false; return false;
int count = Duel.Fields[0].GetGraveyardMonsters().Count; int count = Bot.GetGraveyardMonsters().Count;
int space = 5 - Duel.Fields[0].GetMonsterCount(); int space = 5 - Bot.GetMonsterCount();
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)
...@@ -1089,7 +1089,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -1089,7 +1089,7 @@ namespace MycardBot.Game.AI.Decks
{ {
int attack = 0; int attack = 0;
int defence = 0; int defence = 0;
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (!monster.IsDefense()) if (!monster.IsDefense())
...@@ -1097,7 +1097,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -1097,7 +1097,7 @@ namespace MycardBot.Game.AI.Decks
attack += monster.Attack; attack += monster.Attack;
} }
} }
monsters = Duel.Fields[1].GetMonsters(); monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
defence += monster.GetDefensePower(); defence += monster.GetDefensePower();
...@@ -1146,13 +1146,13 @@ namespace MycardBot.Game.AI.Decks ...@@ -1146,13 +1146,13 @@ namespace MycardBot.Game.AI.Decks
private bool 盖卡() private bool 盖卡()
{ {
return (Card.IsTrap() || (Card.Id==(int)CardId.银龙的轰咆)) && Duel.Fields[0].GetSpellCountWithoutField() < 4; return (Card.IsTrap() || (Card.Id==(int)CardId.银龙的轰咆)) && Bot.GetSpellCountWithoutField() < 4;
} }
private bool 手里有2(int id) private bool 手里有2(int id)
{ {
int num = 0; int num = 0;
foreach (ClientCard card in Duel.Fields[0].Hand) foreach (ClientCard card in Bot.Hand)
{ {
if (card != null && card.Id == id) if (card != null && card.Id == id)
num++; num++;
...@@ -1162,21 +1162,21 @@ namespace MycardBot.Game.AI.Decks ...@@ -1162,21 +1162,21 @@ namespace MycardBot.Game.AI.Decks
private bool 能处理青眼亚白龙() private bool 能处理青眼亚白龙()
{ {
return Duel.Fields[0].HasInMonstersZone(new List<int> return Bot.HasInMonstersZone(new List<int>
{ {
(int)CardId.青色眼睛的贤士, (int)CardId.青色眼睛的贤士,
(int)CardId.太古的白石, (int)CardId.太古的白石,
(int)CardId.传说的白石, (int)CardId.传说的白石,
(int)CardId.青眼白龙, (int)CardId.青眼白龙,
(int)CardId.白色灵龙 (int)CardId.白色灵龙
}) || Duel.Fields[0].GetCountCardInZone(Duel.Fields[0].MonsterZone, (int)CardId.青眼亚白龙)>=2 ; }) || Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.青眼亚白龙)>=2 ;
} }
private bool 手里有足够的青眼白龙() private bool 手里有足够的青眼白龙()
{ {
return 手里有2((int)CardId.青眼白龙) || ( return 手里有2((int)CardId.青眼白龙) || (
Duel.Fields[0].HasInGraveyard((int)CardId.青眼白龙) Bot.HasInGraveyard((int)CardId.青眼白龙)
&& Duel.Fields[0].HasInGraveyard((int)CardId.太古的白石) && Bot.HasInGraveyard((int)CardId.太古的白石)
); );
} }
} }
......
...@@ -81,7 +81,7 @@ namespace DevBot.Game.AI.Decks ...@@ -81,7 +81,7 @@ namespace DevBot.Game.AI.Decks
private bool SwordsOfRevealingLight() private bool SwordsOfRevealingLight()
{ {
int count = Duel.Fields[0].SpellZone.GetCardCount((int)CardId.SwordsOfRevealingLight); int count = Bot.SpellZone.GetCardCount((int)CardId.SwordsOfRevealingLight);
return count == 0; return count == 0;
} }
...@@ -98,12 +98,12 @@ namespace DevBot.Game.AI.Decks ...@@ -98,12 +98,12 @@ namespace DevBot.Game.AI.Decks
private bool ThunderShort() private bool ThunderShort()
{ {
return Duel.Fields[1].GetMonsterCount() >= 3; return Enemy.GetMonsterCount() >= 3;
} }
private bool SetInvincibleMonster() private bool SetInvincibleMonster()
{ {
foreach (ClientCard card in Duel.Fields[0].GetMonsters()) foreach (ClientCard card in Bot.GetMonsters())
{ {
if (card.Id == (int)CardId.Marshmallon || card.Id == (int)CardId.SpiritReaper) if (card.Id == (int)CardId.Marshmallon || card.Id == (int)CardId.SpiritReaper)
{ {
...@@ -116,7 +116,7 @@ namespace DevBot.Game.AI.Decks ...@@ -116,7 +116,7 @@ namespace DevBot.Game.AI.Decks
private bool LavaGolem() private bool LavaGolem()
{ {
bool found = false; bool found = false;
foreach (ClientCard card in Duel.Fields[1].GetMonsters()) foreach (ClientCard card in Enemy.GetMonsters())
{ {
if (card.Attack > 2000) if (card.Attack > 2000)
found = true; found = true;
...@@ -126,7 +126,7 @@ namespace DevBot.Game.AI.Decks ...@@ -126,7 +126,7 @@ namespace DevBot.Game.AI.Decks
private bool Ceasefire() private bool Ceasefire()
{ {
return Duel.Fields[0].GetMonsterCount() + Duel.Fields[1].GetMonsterCount() >= 3; return Bot.GetMonsterCount() + Enemy.GetMonsterCount() >= 3;
} }
private bool ReposEverything() private bool ReposEverything()
......
...@@ -9,7 +9,6 @@ namespace WindBot.Game.AI.Decks ...@@ -9,7 +9,6 @@ namespace WindBot.Game.AI.Decks
[Deck("CyberDragon", "AI_CyberDragon")] [Deck("CyberDragon", "AI_CyberDragon")]
public class CyberDragonExecutor : DefaultExecutor public class CyberDragonExecutor : DefaultExecutor
{ {
ClientField Bot;
bool 力量结合效果 = false; bool 力量结合效果 = false;
public enum CardId public enum CardId
...@@ -46,8 +45,6 @@ namespace WindBot.Game.AI.Decks ...@@ -46,8 +45,6 @@ namespace WindBot.Game.AI.Decks
public CyberDragonExecutor(GameAI ai, Duel duel) public CyberDragonExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
Bot = Duel.Fields[0];
AddExecutor(ExecutorType.SpellSet, (int)CardId.融合解除); AddExecutor(ExecutorType.SpellSet, (int)CardId.融合解除);
AddExecutor(ExecutorType.Activate, (int)CardId.时间胶囊, Capsule); AddExecutor(ExecutorType.Activate, (int)CardId.时间胶囊, Capsule);
...@@ -91,10 +88,10 @@ namespace WindBot.Game.AI.Decks ...@@ -91,10 +88,10 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos); AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
} }
private bool CyberDragonInHand() { return Duel.Fields[0].HasInHand((int)CardId.电子龙); } private bool CyberDragonInHand() { return Bot.HasInHand((int)CardId.电子龙); }
private bool CyberDragonInGraveyard() { return Duel.Fields[0].HasInGraveyard((int)CardId.电子龙); } private bool CyberDragonInGraveyard() { return Bot.HasInGraveyard((int)CardId.电子龙); }
private bool CyberDragonInMonsterZone() { return Duel.Fields[0].HasInMonstersZone((int)CardId.电子龙); } private bool CyberDragonInMonsterZone() { return Bot.HasInMonstersZone((int)CardId.电子龙); }
private bool CyberDragonIsBanished() { return Duel.Fields[0].HasInBanished((int)CardId.电子龙); } private bool CyberDragonIsBanished() { return Bot.HasInBanished((int)CardId.电子龙); }
private bool Capsule() private bool Capsule()
{ {
...@@ -130,20 +127,20 @@ namespace WindBot.Game.AI.Decks ...@@ -130,20 +127,20 @@ namespace WindBot.Game.AI.Decks
if (!AI.Utils.IsOneEnemyBetterThanValue(Bot.MonsterZone.GetHighestAttackMonster().Attack, false)) if (!AI.Utils.IsOneEnemyBetterThanValue(Bot.MonsterZone.GetHighestAttackMonster().Attack, false))
return false; return false;
else else
AI.SelectCard(Duel.Fields[1].MonsterZone.GetHighestAttackMonster()); AI.SelectCard(Enemy.MonsterZone.GetHighestAttackMonster());
return true; return true;
} }
private bool 没有电子龙可特殊召唤() private bool 没有电子龙可特殊召唤()
{ {
if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Duel.Fields[1].GetMonsterCount() != 0)) if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Enemy.GetMonsterCount() != 0))
return false; return false;
return true; return true;
} }
private bool 装甲电子翼() private bool 装甲电子翼()
{ {
if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Duel.Fields[1].GetMonsterCount() != 0) || (Bot.HasInHand((int)CardId.电子龙三型) || Bot.HasInHand((int)CardId.电子凤凰)) && !AI.Utils.IsOneEnemyBetterThanValue(1800,true)) if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Enemy.GetMonsterCount() != 0) || (Bot.HasInHand((int)CardId.电子龙三型) || Bot.HasInHand((int)CardId.电子凤凰)) && !AI.Utils.IsOneEnemyBetterThanValue(1800,true))
return false; return false;
return true; return true;
} }
...@@ -152,7 +149,7 @@ namespace WindBot.Game.AI.Decks ...@@ -152,7 +149,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Bot.GetCountCardInZone(Bot.Hand, (int)CardId.电子龙) + Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.电子龙) + Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.电子龙核) >= 1 && Bot.HasInHand((int)CardId.融合) || Bot.GetCountCardInZone(Bot.Hand, (int)CardId.电子龙) + Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.电子龙) + Bot.GetCountCardInZone(Bot.Graveyard, (int)CardId.电子龙) + Bot.GetCountCardInZone(Bot.Graveyard, (int)CardId.电子龙核) >= 1 && Bot.HasInHand((int)CardId.力量结合)) if (Bot.GetCountCardInZone(Bot.Hand, (int)CardId.电子龙) + Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.电子龙) + Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.电子龙核) >= 1 && Bot.HasInHand((int)CardId.融合) || Bot.GetCountCardInZone(Bot.Hand, (int)CardId.电子龙) + Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.电子龙) + Bot.GetCountCardInZone(Bot.Graveyard, (int)CardId.电子龙) + Bot.GetCountCardInZone(Bot.Graveyard, (int)CardId.电子龙核) >= 1 && Bot.HasInHand((int)CardId.力量结合))
return true; return true;
if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Duel.Fields[1].GetMonsterCount() != 0) || (Bot.HasInHand((int)CardId.电子龙三型) || Bot.HasInHand((int)CardId.电子凤凰)) && !AI.Utils.IsOneEnemyBetterThanValue(1800, true)) if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Enemy.GetMonsterCount() != 0) || (Bot.HasInHand((int)CardId.电子龙三型) || Bot.HasInHand((int)CardId.电子凤凰)) && !AI.Utils.IsOneEnemyBetterThanValue(1800, true))
return false; return false;
return true; return true;
} }
......
...@@ -116,27 +116,25 @@ namespace DevBot.Game.AI.Decks ...@@ -116,27 +116,25 @@ namespace DevBot.Game.AI.Decks
if (Card.Location != CardLocation.SpellZone) if (Card.Location != CardLocation.SpellZone)
return false; return false;
ClientField field = Duel.Fields[0];
int tributeId = -1; int tributeId = -1;
if (field.HasInHand((int)CardId.DragunityPhalanx)) if (Bot.HasInHand((int)CardId.DragunityPhalanx))
tributeId = (int)CardId.DragunityPhalanx; tributeId = (int)CardId.DragunityPhalanx;
else if (field.HasInHand((int)CardId.FireFormationTenki)) else if (Bot.HasInHand((int)CardId.FireFormationTenki))
tributeId = (int)CardId.FireFormationTenki; tributeId = (int)CardId.FireFormationTenki;
else if (field.HasInHand((int)CardId.Terraforming)) else if (Bot.HasInHand((int)CardId.Terraforming))
tributeId = (int)CardId.Terraforming; tributeId = (int)CardId.Terraforming;
else if (field.HasInHand((int)CardId.DragonRavine)) else if (Bot.HasInHand((int)CardId.DragonRavine))
tributeId = (int)CardId.DragonRavine; tributeId = (int)CardId.DragonRavine;
else if (field.HasInHand((int)CardId.AssaultTeleport)) else if (Bot.HasInHand((int)CardId.AssaultTeleport))
tributeId = (int)CardId.AssaultTeleport; tributeId = (int)CardId.AssaultTeleport;
else if (field.HasInHand((int)CardId.AssaultBeast)) else if (Bot.HasInHand((int)CardId.AssaultBeast))
tributeId = (int)CardId.AssaultBeast; tributeId = (int)CardId.AssaultBeast;
else if (field.HasInHand((int) CardId.DragunityArmaMysletainn)) else if (Bot.HasInHand((int) CardId.DragunityArmaMysletainn))
tributeId = (int)CardId.DragunityArmaMysletainn; tributeId = (int)CardId.DragunityArmaMysletainn;
else else
{ {
int count = 0; int count = 0;
foreach (ClientCard card in Duel.Fields[0].Hand) foreach (ClientCard card in Bot.Hand)
{ {
if (card.Id == (int)CardId.DragunityDux) if (card.Id == (int)CardId.DragunityDux)
++count; ++count;
...@@ -144,27 +142,27 @@ namespace DevBot.Game.AI.Decks ...@@ -144,27 +142,27 @@ namespace DevBot.Game.AI.Decks
if (count >= 2) if (count >= 2)
tributeId = (int)CardId.DragunityDux; tributeId = (int)CardId.DragunityDux;
} }
if (tributeId == -1 && field.HasInHand((int)CardId.StardustDragonAssaultMode)) if (tributeId == -1 && Bot.HasInHand((int)CardId.StardustDragonAssaultMode))
tributeId = (int)CardId.StardustDragonAssaultMode; tributeId = (int)CardId.StardustDragonAssaultMode;
if (tributeId == -1 && field.HasInHand((int)CardId.DragunitySpearOfDestiny)) if (tributeId == -1 && Bot.HasInHand((int)CardId.DragunitySpearOfDestiny))
tributeId = (int)CardId.StardustDragonAssaultMode; tributeId = (int)CardId.StardustDragonAssaultMode;
if (tributeId == -1 && field.HasInHand((int)CardId.DragonsMirror) if (tributeId == -1 && Bot.HasInHand((int)CardId.DragonsMirror)
&& Duel.Fields[0].GetMonsterCount() == 0) && Bot.GetMonsterCount() == 0)
tributeId = (int)CardId.StardustDragonAssaultMode; tributeId = (int)CardId.StardustDragonAssaultMode;
if (tributeId == -1) if (tributeId == -1)
return false; return false;
int needId = -1; int needId = -1;
if (!field.HasInMonstersZone((int)CardId.DragunityPhalanx) && if (!Bot.HasInMonstersZone((int)CardId.DragunityPhalanx) &&
!field.HasInGraveyard((int)CardId.DragunityPhalanx)) !Bot.HasInGraveyard((int)CardId.DragunityPhalanx))
needId = (int)CardId.DragunityPhalanx; needId = (int)CardId.DragunityPhalanx;
else if (field.GetMonsterCount() == 0) else if (Bot.GetMonsterCount() == 0)
needId = (int)CardId.DragunityDux; needId = (int)CardId.DragunityDux;
else else
{ {
/*bool hasRealMonster = false; /*bool hasRealMonster = false;
foreach (ClientCard card in field.GetMonsters()) foreach (ClientCard card in Bot.GetMonsters())
{ {
if (card.Id != (int)CardId.AssaultBeast) if (card.Id != (int)CardId.AssaultBeast)
{ {
...@@ -185,13 +183,13 @@ namespace DevBot.Game.AI.Decks ...@@ -185,13 +183,13 @@ namespace DevBot.Game.AI.Decks
needId = (int)CardId.DragunityDux; needId = (int)CardId.DragunityDux;
int remaining = 3; int remaining = 3;
foreach (ClientCard card in Duel.Fields[0].Hand) foreach (ClientCard card in Bot.Hand)
if (card.Id == needId) if (card.Id == needId)
remaining--; remaining--;
foreach (ClientCard card in Duel.Fields[0].Graveyard) foreach (ClientCard card in Bot.Graveyard)
if (card.Id == needId) if (card.Id == needId)
remaining--; remaining--;
foreach (ClientCard card in Duel.Fields[0].Banished) foreach (ClientCard card in Bot.Banished)
if (card.Id == needId) if (card.Id == needId)
remaining--; remaining--;
if (remaining <= 0) if (remaining <= 0)
...@@ -213,16 +211,16 @@ namespace DevBot.Game.AI.Decks ...@@ -213,16 +211,16 @@ namespace DevBot.Game.AI.Decks
private bool Terraforming() private bool Terraforming()
{ {
if (Duel.Fields[0].HasInHand((int)CardId.DragonRavine)) if (Bot.HasInHand((int)CardId.DragonRavine))
return false; return false;
if (Duel.Fields[0].SpellZone[5] != null) if (Bot.SpellZone[5] != null)
return false; return false;
return true; return true;
} }
private bool SetUselessCards() private bool SetUselessCards()
{ {
ClientField field = Duel.Fields[0]; ClientField field = Bot;
if (field.HasInSpellZone((int)CardId.FireFormationTenki)) if (field.HasInSpellZone((int)CardId.FireFormationTenki))
return false; return false;
...@@ -233,24 +231,24 @@ namespace DevBot.Game.AI.Decks ...@@ -233,24 +231,24 @@ namespace DevBot.Game.AI.Decks
if (field.HasInSpellZone((int)CardId.DragonsMirror)) if (field.HasInSpellZone((int)CardId.DragonsMirror))
return false; return false;
return Duel.Fields[0].GetSpellCountWithoutField() < 4; return Bot.GetSpellCountWithoutField() < 4;
} }
private bool FireFormationTenki() private bool FireFormationTenki()
{ {
if (Card.Location == CardLocation.Hand) if (Card.Location == CardLocation.Hand)
return Duel.Fields[0].GetSpellCountWithoutField() < 4; return Bot.GetSpellCountWithoutField() < 4;
return true; return true;
} }
private bool FoolishBurial() private bool FoolishBurial()
{ {
if (Duel.Fields[0].HasInGraveyard((int)CardId.DragunityPhalanx)) if (Bot.HasInGraveyard((int)CardId.DragunityPhalanx))
return false; return false;
if (Duel.Fields[0].HasInHand((int)CardId.DragunityPhalanx)) if (Bot.HasInHand((int)CardId.DragunityPhalanx))
return false; return false;
int remaining = 3; int remaining = 3;
foreach (ClientCard card in Duel.Fields[0].Banished) foreach (ClientCard card in Bot.Banished)
if (card.Id == (int)CardId.DragunityPhalanx) if (card.Id == (int)CardId.DragunityPhalanx)
remaining--; remaining--;
if (remaining > 0) if (remaining > 0)
...@@ -263,7 +261,7 @@ namespace DevBot.Game.AI.Decks ...@@ -263,7 +261,7 @@ namespace DevBot.Game.AI.Decks
private bool MonsterReborn() private bool MonsterReborn()
{ {
List<ClientCard> cards = new List<ClientCard>(Duel.Fields[0].Graveyard); List<ClientCard> cards = new List<ClientCard>(Bot.Graveyard);
cards.Sort(AIFunctions.CompareCardAttack); cards.Sort(AIFunctions.CompareCardAttack);
ClientCard selectedCard = null; ClientCard selectedCard = null;
for (int i = cards.Count - 1; i >= 0; --i) for (int i = cards.Count - 1; i >= 0; --i)
...@@ -280,7 +278,7 @@ namespace DevBot.Game.AI.Decks ...@@ -280,7 +278,7 @@ namespace DevBot.Game.AI.Decks
break; break;
} }
} }
cards = new List<ClientCard>(Duel.Fields[1].Graveyard); cards = new List<ClientCard>(Enemy.Graveyard);
cards.Sort(AIFunctions.CompareCardAttack); cards.Sort(AIFunctions.CompareCardAttack);
for (int i = cards.Count - 1; i >= 0; --i) for (int i = cards.Count - 1; i >= 0; --i)
{ {
...@@ -305,7 +303,7 @@ namespace DevBot.Game.AI.Decks ...@@ -305,7 +303,7 @@ namespace DevBot.Game.AI.Decks
{ {
IList<ClientCard> tributes = new List<ClientCard>(); IList<ClientCard> tributes = new List<ClientCard>();
int phalanxCount = 0; int phalanxCount = 0;
foreach (ClientCard card in Duel.Fields[0].Graveyard) foreach (ClientCard card in Bot.Graveyard)
{ {
if (card.Id == (int) CardId.DragunityPhalanx) if (card.Id == (int) CardId.DragunityPhalanx)
{ {
...@@ -322,7 +320,7 @@ namespace DevBot.Game.AI.Decks ...@@ -322,7 +320,7 @@ namespace DevBot.Game.AI.Decks
// if we have more than one in the graveyard. // if we have more than one in the graveyard.
if (tributes.Count < 5 && phalanxCount > 1) if (tributes.Count < 5 && phalanxCount > 1)
{ {
foreach (ClientCard card in Duel.Fields[0].Graveyard) foreach (ClientCard card in Bot.Graveyard)
{ {
if (card.Id == (int) CardId.DragunityPhalanx) if (card.Id == (int) CardId.DragunityPhalanx)
{ {
...@@ -356,7 +354,7 @@ namespace DevBot.Game.AI.Decks ...@@ -356,7 +354,7 @@ namespace DevBot.Game.AI.Decks
if (invincible == null && !AI.Utils.IsOneEnemyBetterThanValue(2800 - 1, false)) if (invincible == null && !AI.Utils.IsOneEnemyBetterThanValue(2800 - 1, false))
return false; return false;
ClientField field = Duel.Fields[0]; ClientField field = Bot;
int tributeId = -1; int tributeId = -1;
if (field.HasInSpellZone((int)CardId.FireFormationTenki)) if (field.HasInSpellZone((int)CardId.FireFormationTenki))
...@@ -374,7 +372,7 @@ namespace DevBot.Game.AI.Decks ...@@ -374,7 +372,7 @@ namespace DevBot.Game.AI.Decks
else if (field.HasInSpellZone((int)CardId.DragonRavine)) else if (field.HasInSpellZone((int)CardId.DragonRavine))
tributeId = (int)CardId.DragonRavine; tributeId = (int)CardId.DragonRavine;
List<ClientCard> monsters = Duel.Fields[1].GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
monsters.Sort(AIFunctions.CompareCardAttack); monsters.Sort(AIFunctions.CompareCardAttack);
ClientCard destroyCard = invincible; ClientCard destroyCard = invincible;
...@@ -403,9 +401,9 @@ namespace DevBot.Game.AI.Decks ...@@ -403,9 +401,9 @@ namespace DevBot.Game.AI.Decks
private bool CrystalWingSynchroDragonSummon() private bool CrystalWingSynchroDragonSummon()
{ {
return !Duel.Fields[0].HasInHand((int)CardId.AssaultModeActivate) return !Bot.HasInHand((int)CardId.AssaultModeActivate)
&& !Duel.Fields[0].HasInHand((int)CardId.AssaultBeast) && !Bot.HasInHand((int)CardId.AssaultBeast)
&& !Duel.Fields[0].HasInSpellZone((int)CardId.AssaultModeActivate); && !Bot.HasInSpellZone((int)CardId.AssaultModeActivate);
} }
private bool CrystalWingSynchroDragonEffect() private bool CrystalWingSynchroDragonEffect()
...@@ -415,17 +413,17 @@ namespace DevBot.Game.AI.Decks ...@@ -415,17 +413,17 @@ namespace DevBot.Game.AI.Decks
private bool DragunityPhalanxSummon() private bool DragunityPhalanxSummon()
{ {
return Duel.Fields[0].HasInHand((int)CardId.DragunityArmaMysletainn); return Bot.HasInHand((int)CardId.DragunityArmaMysletainn);
} }
private bool DragunityArmaMysletainn() private bool DragunityArmaMysletainn()
{ {
if (Duel.Fields[0].HasInMonstersZone((int)CardId.DragunityPhalanx)) if (Bot.HasInMonstersZone((int)CardId.DragunityPhalanx))
{ {
AI.SelectCard((int)CardId.DragunityPhalanx); AI.SelectCard((int)CardId.DragunityPhalanx);
return true; return true;
} }
if (Duel.Fields[0].HasInMonstersZone((int)CardId.DragunityDux)) if (Bot.HasInMonstersZone((int)CardId.DragunityDux))
{ {
AI.SelectCard((int)CardId.DragunityDux); AI.SelectCard((int)CardId.DragunityDux);
return true; return true;
...@@ -441,29 +439,29 @@ namespace DevBot.Game.AI.Decks ...@@ -441,29 +439,29 @@ namespace DevBot.Game.AI.Decks
private bool DragunityArmaMysletainnTribute() private bool DragunityArmaMysletainnTribute()
{ {
if ((Duel.Fields[0].HasInMonstersZone((int)CardId.AssaultBeast) if ((Bot.HasInMonstersZone((int)CardId.AssaultBeast)
&& Duel.Fields[0].HasInGraveyard((int)CardId.DragunityPhalanx)) && Bot.HasInGraveyard((int)CardId.DragunityPhalanx))
|| Duel.Fields[0].HasInMonstersZone((int)CardId.DragunityPhalanx) || Bot.HasInMonstersZone((int)CardId.DragunityPhalanx)
|| Duel.Fields[0].HasInHand((int)CardId.DragunitySpearOfDestiny)) || Bot.HasInHand((int)CardId.DragunitySpearOfDestiny))
return true; return true;
return false; return false;
} }
private bool DragunityDux() private bool DragunityDux()
{ {
return Duel.Fields[0].HasInGraveyard((int)CardId.DragunityPhalanx) || return Bot.HasInGraveyard((int)CardId.DragunityPhalanx) ||
(Duel.Fields[0].GetMonsterCount() == 0 && Duel.Fields[0].HasInHand((int)CardId.DragunityArmaMysletainn) || (Bot.GetMonsterCount() == 0 && Bot.HasInHand((int)CardId.DragunityArmaMysletainn) ||
Duel.Fields[0].HasInHand((int)CardId.DragunitySpearOfDestiny)); Bot.HasInHand((int)CardId.DragunitySpearOfDestiny));
} }
private bool DragunityPhalanxSet() private bool DragunityPhalanxSet()
{ {
return Duel.Fields[0].GetMonsterCount() == 0 || !Duel.Fields[0].HasInGraveyard((int)CardId.DragunityPhalanx); return Bot.GetMonsterCount() == 0 || !Bot.HasInGraveyard((int)CardId.DragunityPhalanx);
} }
private bool AssaultBeast() private bool AssaultBeast()
{ {
if (!Duel.Fields[0].HasInSpellZone((int)CardId.AssaultModeActivate)) if (!Bot.HasInSpellZone((int)CardId.AssaultModeActivate))
return true; return true;
return false; return false;
} }
...@@ -479,7 +477,7 @@ namespace DevBot.Game.AI.Decks ...@@ -479,7 +477,7 @@ namespace DevBot.Game.AI.Decks
{ {
if (Duel.Player == 0 && Duel.Phase == DuelPhase.BattleStart) if (Duel.Player == 0 && Duel.Phase == DuelPhase.BattleStart)
{ {
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.Id == (int)CardId.StardustDragon && monster.Attacked) if (monster.Id == (int)CardId.StardustDragon && monster.Attacked)
...@@ -494,8 +492,8 @@ namespace DevBot.Game.AI.Decks ...@@ -494,8 +492,8 @@ namespace DevBot.Game.AI.Decks
private ClientCard GetProblematicCard() private ClientCard GetProblematicCard()
{ {
ClientCard card = Duel.Fields[1].MonsterZone.GetInvincibleMonster(); ClientCard card = Enemy.MonsterZone.GetInvincibleMonster();
return card ?? Duel.Fields[1].SpellZone.GetFloodgate(); return card ?? Enemy.SpellZone.GetFloodgate();
} }
} }
} }
\ No newline at end of file
...@@ -109,7 +109,7 @@ namespace DevBot.Game.AI.Decks ...@@ -109,7 +109,7 @@ namespace DevBot.Game.AI.Decks
return false; return false;
m_swapFrogSummoned = -1; m_swapFrogSummoned = -1;
if (Duel.Fields[0].GetRemainingCount((int)CardId.Ronintoadin, 2) == 0) if (Bot.GetRemainingCount((int)CardId.Ronintoadin, 2) == 0)
return false; return false;
AI.SelectCard((int)CardId.Ronintoadin); AI.SelectCard((int)CardId.Ronintoadin);
...@@ -127,7 +127,7 @@ namespace DevBot.Game.AI.Decks ...@@ -127,7 +127,7 @@ namespace DevBot.Game.AI.Decks
if (Card.IsDefense() || m_flipFlopFrogSummoned == Duel.Turn || Duel.Phase == DuelPhase.Main2) if (Card.IsDefense() || m_flipFlopFrogSummoned == Duel.Turn || Duel.Phase == DuelPhase.Main2)
{ {
m_flipFlopFrogSummoned = -1; m_flipFlopFrogSummoned = -1;
List<ClientCard> monsters = Duel.Fields[1].GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
monsters.Sort(AIFunctions.CompareCardAttack); monsters.Sort(AIFunctions.CompareCardAttack);
monsters.Reverse(); monsters.Reverse();
AI.SelectCard(monsters); AI.SelectCard(monsters);
...@@ -138,7 +138,7 @@ namespace DevBot.Game.AI.Decks ...@@ -138,7 +138,7 @@ namespace DevBot.Game.AI.Decks
private bool Ronintoadin() private bool Ronintoadin()
{ {
List<ClientCard> monsters = Duel.Fields[0].GetGraveyardMonsters(); List<ClientCard> monsters = Bot.GetGraveyardMonsters();
if (monsters.Count > 2) if (monsters.Count > 2)
{ {
if (GetSpellBonus() == 0) if (GetSpellBonus() == 0)
...@@ -169,7 +169,7 @@ namespace DevBot.Game.AI.Decks ...@@ -169,7 +169,7 @@ namespace DevBot.Game.AI.Decks
cards.Add((int)CardId.FlipFlopFrog); cards.Add((int)CardId.FlipFlopFrog);
} }
if (Duel.Fields[0].SpellZone[5] == null) if (Bot.SpellZone[5] == null)
{ {
cards.Add((int)CardId.Terraforming); cards.Add((int)CardId.Terraforming);
cards.Add((int)CardId.Wetlands); cards.Add((int)CardId.Wetlands);
...@@ -195,22 +195,22 @@ namespace DevBot.Game.AI.Decks ...@@ -195,22 +195,22 @@ namespace DevBot.Game.AI.Decks
private bool Terraforming() private bool Terraforming()
{ {
if (Duel.Fields[0].HasInHand((int)CardId.Wetlands)) if (Bot.HasInHand((int)CardId.Wetlands))
return false; return false;
if (Duel.Fields[0].SpellZone[5] != null) if (Bot.SpellZone[5] != null)
return false; return false;
return true; return true;
} }
private bool Solidarity() private bool Solidarity()
{ {
List<ClientCard> monsters = Duel.Fields[0].GetGraveyardMonsters(); List<ClientCard> monsters = Bot.GetGraveyardMonsters();
return monsters.Count != 0; return monsters.Count != 0;
} }
private bool GravityBind() private bool GravityBind()
{ {
List<ClientCard> spells = Duel.Fields[0].GetSpells(); List<ClientCard> spells = Bot.GetSpells();
foreach (ClientCard spell in spells) foreach (ClientCard spell in spells)
{ {
if (spell.Id == (int)CardId.GravityBind && !spell.IsFacedown()) if (spell.Id == (int)CardId.GravityBind && !spell.IsFacedown())
...@@ -235,7 +235,7 @@ namespace DevBot.Game.AI.Decks ...@@ -235,7 +235,7 @@ namespace DevBot.Game.AI.Decks
if (Card.IsDefense() && !enemyBetter) if (Card.IsDefense() && !enemyBetter)
result = true; result = true;
if (!result && Card.Id == (int)CardId.FlipFlopFrog && Duel.Fields[1].GetMonsterCount() > 0 && Card.IsFacedown()) if (!result && Card.Id == (int)CardId.FlipFlopFrog && Enemy.GetMonsterCount() > 0 && Card.IsFacedown())
result = true; result = true;
if (Card.Id == (int)CardId.FlipFlopFrog && Card.IsFacedown() && result) if (Card.Id == (int)CardId.FlipFlopFrog && Card.IsFacedown() && result)
...@@ -247,13 +247,13 @@ namespace DevBot.Game.AI.Decks ...@@ -247,13 +247,13 @@ namespace DevBot.Game.AI.Decks
private int GetSpellBonus() private int GetSpellBonus()
{ {
int atk = 0; int atk = 0;
if (Duel.Fields[0].SpellZone[5] != null) if (Bot.SpellZone[5] != null)
atk += 1200; atk += 1200;
List<ClientCard> monsters = Duel.Fields[0].GetGraveyardMonsters(); List<ClientCard> monsters = Bot.GetGraveyardMonsters();
if (monsters.Count != 0) if (monsters.Count != 0)
{ {
foreach (ClientCard card in Duel.Fields[0].GetSpells()) foreach (ClientCard card in Bot.GetSpells())
{ {
if (card.Id == (int)CardId.Solidarity) if (card.Id == (int)CardId.Solidarity)
atk += 800; atk += 800;
......
...@@ -83,28 +83,28 @@ namespace WindBot.Game.AI.Decks ...@@ -83,28 +83,28 @@ namespace WindBot.Game.AI.Decks
private bool 王家长眠之谷的祭殿() private bool 王家长眠之谷的祭殿()
{ {
if (Card.Location == CardLocation.Hand && Duel.Fields[0].HasInSpellZone((int)Card.Id)) if (Card.Location == CardLocation.Hand && Bot.HasInSpellZone((int)Card.Id))
return false; return false;
return true; return true;
} }
private bool 王家长眠之谷() private bool 王家长眠之谷()
{ {
if (Duel.Fields[0].SpellZone[5] != null) if (Bot.SpellZone[5] != null)
return false; return false;
return true; return true;
} }
private bool 罪星尘龙() private bool 罪星尘龙()
{ {
if (Duel.Fields[0].SpellZone[5] != null) if (Bot.SpellZone[5] != null)
return true; return true;
return false; return false;
} }
private bool 守墓的司令官() private bool 守墓的司令官()
{ {
if (!Duel.Fields[0].HasInHand((int)CardId.王家长眠之谷) && !Duel.Fields[0].HasInSpellZone((int)CardId.王家长眠之谷)) if (!Bot.HasInHand((int)CardId.王家长眠之谷) && !Bot.HasInSpellZone((int)CardId.王家长眠之谷))
return true; return true;
return false; return false;
} }
...@@ -118,7 +118,7 @@ namespace WindBot.Game.AI.Decks ...@@ -118,7 +118,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (!Card.IsAttack()) if (!Card.IsAttack())
return false; return false;
foreach (ClientCard card in Duel.Fields[1].MonsterZone) foreach (ClientCard card in Enemy.MonsterZone)
if (card != null && card.IsDefense() && card.Defense > 1500 && card.Attack < 1500 || card.Attack > 1500 && card.Defense < 1500) if (card != null && card.IsDefense() && card.Defense > 1500 && card.Attack < 1500 || card.Attack > 1500 && card.Defense < 1500)
return true; return true;
return false; return false;
...@@ -126,10 +126,10 @@ namespace WindBot.Game.AI.Decks ...@@ -126,10 +126,10 @@ namespace WindBot.Game.AI.Decks
private bool 守墓的末裔() private bool 守墓的末裔()
{ {
int bestatk = Duel.Fields[0].GetMonsters().GetHighestAttackMonster().Attack; int bestatk = Bot.GetMonsters().GetHighestAttackMonster().Attack;
if (AI.Utils.IsOneEnemyBetterThanValue(bestatk, true)) if (AI.Utils.IsOneEnemyBetterThanValue(bestatk, true))
{ {
AI.SelectCard(Duel.Fields[1].GetMonsters().GetHighestAttackMonster()); AI.SelectCard(Enemy.GetMonsters().GetHighestAttackMonster());
return true; return true;
} }
return false; return false;
......
...@@ -68,12 +68,12 @@ namespace WindBot.Game.AI.Decks ...@@ -68,12 +68,12 @@ namespace WindBot.Game.AI.Decks
private bool FoolishBurial() private bool FoolishBurial()
{ {
if (Duel.Fields[0].HasInGraveyard((int)CardId.WhiteNightDragon)) if (Bot.HasInGraveyard((int)CardId.WhiteNightDragon))
return false; return false;
if (Duel.Fields[0].HasInHand((int)CardId.WhiteNightDragon)) if (Bot.HasInHand((int)CardId.WhiteNightDragon))
return false; return false;
int remaining = 2; int remaining = 2;
foreach (ClientCard card in Duel.Fields[0].Banished) foreach (ClientCard card in Bot.Banished)
if (card.Id == (int)CardId.WhiteNightDragon) if (card.Id == (int)CardId.WhiteNightDragon)
remaining--; remaining--;
if (remaining > 0) if (remaining > 0)
...@@ -91,7 +91,7 @@ namespace WindBot.Game.AI.Decks ...@@ -91,7 +91,7 @@ namespace WindBot.Game.AI.Decks
if (Duel.Player == 1 && Duel.Phase == DuelPhase.End) if (Duel.Player == 1 && Duel.Phase == DuelPhase.End)
return false; return false;
List<ClientCard> cards = new List<ClientCard>(Duel.Fields[0].Graveyard); List<ClientCard> cards = new List<ClientCard>(Bot.Graveyard);
cards.Sort(AIFunctions.CompareCardAttack); cards.Sort(AIFunctions.CompareCardAttack);
for (int i = cards.Count - 1; i >= 0; --i) for (int i = cards.Count - 1; i >= 0; --i)
{ {
...@@ -109,7 +109,7 @@ namespace WindBot.Game.AI.Decks ...@@ -109,7 +109,7 @@ namespace WindBot.Game.AI.Decks
private bool MonsterReborn() private bool MonsterReborn()
{ {
List<ClientCard> cards = new List<ClientCard>(Duel.Fields[0].Graveyard); List<ClientCard> cards = new List<ClientCard>(Bot.Graveyard);
cards.Sort(AIFunctions.CompareCardAttack); cards.Sort(AIFunctions.CompareCardAttack);
ClientCard selectedCard = null; ClientCard selectedCard = null;
for (int i = cards.Count - 1; i >= 0; --i) for (int i = cards.Count - 1; i >= 0; --i)
...@@ -123,7 +123,7 @@ namespace WindBot.Game.AI.Decks ...@@ -123,7 +123,7 @@ namespace WindBot.Game.AI.Decks
break; break;
} }
} }
cards = new List<ClientCard>(Duel.Fields[1].Graveyard); cards = new List<ClientCard>(Enemy.Graveyard);
cards.Sort(AIFunctions.CompareCardAttack); cards.Sort(AIFunctions.CompareCardAttack);
for (int i = cards.Count - 1; i >= 0; --i) for (int i = cards.Count - 1; i >= 0; --i)
{ {
...@@ -147,7 +147,7 @@ namespace WindBot.Game.AI.Decks ...@@ -147,7 +147,7 @@ namespace WindBot.Game.AI.Decks
private bool WhiteNightDragon() private bool WhiteNightDragon()
{ {
// We should summon Horus the Black Flame Dragon LV6 if he can lvlup. // We should summon Horus the Black Flame Dragon LV6 if he can lvlup.
if (Duel.Fields[1].GetMonsterCount() != 0 && !AI.Utils.IsAllEnemyBetterThanValue(2300 - 1, false)) if (Enemy.GetMonsterCount() != 0 && !AI.Utils.IsAllEnemyBetterThanValue(2300 - 1, false))
foreach (ClientCard card in Main.SummonableCards) foreach (ClientCard card in Main.SummonableCards)
if (card.Id == 11224103) if (card.Id == 11224103)
return false; return false;
...@@ -162,7 +162,7 @@ namespace WindBot.Game.AI.Decks ...@@ -162,7 +162,7 @@ namespace WindBot.Game.AI.Decks
private bool DragonsRebirth() private bool DragonsRebirth()
{ {
List<ClientCard> cards = new List<ClientCard>(Duel.Fields[0].GetMonsters()); List<ClientCard> cards = new List<ClientCard>(Bot.GetMonsters());
if (cards.Count == 0) if (cards.Count == 0)
return false; return false;
cards.Sort(AIFunctions.CompareCardAttack); cards.Sort(AIFunctions.CompareCardAttack);
...@@ -181,8 +181,8 @@ namespace WindBot.Game.AI.Decks ...@@ -181,8 +181,8 @@ namespace WindBot.Game.AI.Decks
if (tributeCard == null) if (tributeCard == null)
return false; return false;
cards = new List<ClientCard>(Duel.Fields[0].Hand); cards = new List<ClientCard>(Bot.Hand);
cards.AddRange(Duel.Fields[0].Graveyard); cards.AddRange(Bot.Graveyard);
if (cards.Count == 0) if (cards.Count == 0)
return false; return false;
cards.Sort(AIFunctions.CompareCardAttack); cards.Sort(AIFunctions.CompareCardAttack);
......
...@@ -97,7 +97,7 @@ namespace WindBot.Game.AI.Decks ...@@ -97,7 +97,7 @@ namespace WindBot.Game.AI.Decks
} }
if (!(defender.Id == (int)CardId.闪光No39希望皇霍普电光皇)) if (!(defender.Id == (int)CardId.闪光No39希望皇霍普电光皇))
{ {
if (attacker.Attribute == (int)CardAttribute.Light && Duel.Fields[0].HasInHand((int)CardId.欧尼斯特)) if (attacker.Attribute == (int)CardAttribute.Light && Bot.HasInHand((int)CardId.欧尼斯特))
attacker.RealPower = attacker.RealPower + defender.Attack; attacker.RealPower = attacker.RealPower + defender.Attack;
if (attacker.Id == (int)CardId.闪光No39希望皇霍普电光皇 && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.No39希望皇霍普)) if (attacker.Id == (int)CardId.闪光No39希望皇霍普电光皇 && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.No39希望皇霍普))
attacker.RealPower = 5000; attacker.RealPower = 5000;
...@@ -142,16 +142,16 @@ namespace WindBot.Game.AI.Decks ...@@ -142,16 +142,16 @@ namespace WindBot.Game.AI.Decks
private bool 增援效果() private bool 增援效果()
{ {
if (!Duel.Fields[0].HasInHand((int)CardId.哥布林德伯格)) if (!Bot.HasInHand((int)CardId.哥布林德伯格))
AI.SelectCard((int)CardId.哥布林德伯格); AI.SelectCard((int)CardId.哥布林德伯格);
else if (!Duel.Fields[0].HasInHand((int)CardId.光道暗杀者莱登)) else if (!Bot.HasInHand((int)CardId.光道暗杀者莱登))
AI.SelectCard((int)CardId.光道暗杀者莱登); AI.SelectCard((int)CardId.光道暗杀者莱登);
return true; return true;
} }
private bool 光之援军效果() private bool 光之援军效果()
{ {
if (!Duel.Fields[0].HasInHand((int)CardId.光道召唤师露米娜丝)) if (!Bot.HasInHand((int)CardId.光道召唤师露米娜丝))
AI.SelectCard((int)CardId.光道召唤师露米娜丝); AI.SelectCard((int)CardId.光道召唤师露米娜丝);
else else
AI.SelectCard(new[] AI.SelectCard(new[]
...@@ -179,7 +179,7 @@ namespace WindBot.Game.AI.Decks ...@@ -179,7 +179,7 @@ namespace WindBot.Game.AI.Decks
private bool 哥布林德伯格通常召唤() private bool 哥布林德伯格通常召唤()
{ {
foreach (ClientCard card in Duel.Fields[0].Hand) foreach (ClientCard card in Bot.Hand)
{ {
if (card != Card && card.IsMonster() && card.Level == 4) if (card != Card && card.IsMonster() && card.Level == 4)
return true; return true;
...@@ -215,25 +215,25 @@ namespace WindBot.Game.AI.Decks ...@@ -215,25 +215,25 @@ namespace WindBot.Game.AI.Decks
private bool 励辉士入魔蝇王特殊召唤() private bool 励辉士入魔蝇王特殊召唤()
{ {
int selfCount = Duel.Fields[0].GetMonsterCount() + Duel.Fields[0].GetSpellCount() + Duel.Fields[0].GetHandCount(); int selfCount = Bot.GetMonsterCount() + Bot.GetSpellCount() + Bot.GetHandCount();
int oppoCount = Duel.Fields[1].GetMonsterCount() + Duel.Fields[1].GetSpellCount() + Duel.Fields[1].GetHandCount(); int oppoCount = Enemy.GetMonsterCount() + Enemy.GetSpellCount() + Enemy.GetHandCount();
return (selfCount - 1 < oppoCount) && 励辉士入魔蝇王效果(); return (selfCount - 1 < oppoCount) && 励辉士入魔蝇王效果();
} }
private bool 励辉士入魔蝇王效果() private bool 励辉士入魔蝇王效果()
{ {
int selfCount = Duel.Fields[0].GetMonsterCount() + Duel.Fields[0].GetSpellCount(); int selfCount = Bot.GetMonsterCount() + Bot.GetSpellCount();
int oppoCount = Duel.Fields[1].GetMonsterCount() + Duel.Fields[1].GetSpellCount(); int oppoCount = Enemy.GetMonsterCount() + Enemy.GetSpellCount();
int selfAttack = 0; int selfAttack = 0;
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
selfAttack += monster.GetDefensePower(); selfAttack += monster.GetDefensePower();
} }
int oppoAttack = 0; int oppoAttack = 0;
monsters = Duel.Fields[1].GetMonsters(); monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
oppoAttack += monster.GetDefensePower(); oppoAttack += monster.GetDefensePower();
...@@ -244,15 +244,15 @@ namespace WindBot.Game.AI.Decks ...@@ -244,15 +244,15 @@ namespace WindBot.Game.AI.Decks
private bool 红莲魔龙右红痕特殊召唤() private bool 红莲魔龙右红痕特殊召唤()
{ {
int selfBestAttack = AI.Utils.GetBestAttack(Duel.Fields[0], true); int selfBestAttack = AI.Utils.GetBestAttack(Bot, true);
int oppoBestAttack = AI.Utils.GetBestAttack(Duel.Fields[1], false); int oppoBestAttack = AI.Utils.GetBestAttack(Enemy, false);
return (selfBestAttack <= oppoBestAttack && oppoBestAttack <= 3000) || 红莲魔龙右红痕效果(); return (selfBestAttack <= oppoBestAttack && oppoBestAttack <= 3000) || 红莲魔龙右红痕效果();
} }
private bool 红莲魔龙右红痕效果() private bool 红莲魔龙右红痕效果()
{ {
int selfCount = 0; int selfCount = 0;
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (!monster.Equals(Card) && monster.HasType(CardType.Effect) && monster.Attack <= Card.Attack) if (!monster.Equals(Card) && monster.HasType(CardType.Effect) && monster.Attack <= Card.Attack)
...@@ -260,7 +260,7 @@ namespace WindBot.Game.AI.Decks ...@@ -260,7 +260,7 @@ namespace WindBot.Game.AI.Decks
} }
int oppoCount = 0; int oppoCount = 0;
monsters = Duel.Fields[1].GetMonsters(); monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
// 没有办法获取特殊召唤的状态,只好默认全部是特招的 // 没有办法获取特殊召唤的状态,只好默认全部是特招的
......
...@@ -100,19 +100,19 @@ namespace WindBot.Game.AI.Decks ...@@ -100,19 +100,19 @@ namespace WindBot.Game.AI.Decks
private bool 千手神召唤() private bool 千手神召唤()
{ {
if (!Duel.Fields[0].HasInHand(NekrozRituelCard) || Duel.Fields[0].HasInHand((int)CardId.影灵衣术士施里特) || !Duel.Fields[0].HasInHand(NekrozSpellCard)) if (!Bot.HasInHand(NekrozRituelCard) || Bot.HasInHand((int)CardId.影灵衣术士施里特) || !Bot.HasInHand(NekrozSpellCard))
return true; return true;
foreach (ClientCard Card in Duel.Fields[0].Hand) foreach (ClientCard Card in Bot.Hand)
if (Card != null && Card.Id == (int)CardId.影灵衣的万华镜 && !Duel.Fields[0].HasInHand((int)CardId.尤尼科之影灵衣)) if (Card != null && Card.Id == (int)CardId.影灵衣的万华镜 && !Bot.HasInHand((int)CardId.尤尼科之影灵衣))
return true; return true;
else if (Card.Id == (int)CardId.三叉龙之影灵衣 || Card.Id == (int)CardId.决战兵器之影灵衣 && !Duel.Fields[0].HasInHand((int)CardId.影灵衣的降魔镜) || !Duel.Fields[0].HasInHand((int)CardId.影灵衣术士施里特)) else if (Card.Id == (int)CardId.三叉龙之影灵衣 || Card.Id == (int)CardId.决战兵器之影灵衣 && !Bot.HasInHand((int)CardId.影灵衣的降魔镜) || !Bot.HasInHand((int)CardId.影灵衣术士施里特))
return true; return true;
return false; return false;
} }
private bool 增援() private bool 增援()
{ {
if (!Duel.Fields[0].HasInGraveyard((int)CardId.影灵衣术士施里特) && !Duel.Fields[0].HasInHand((int)CardId.影灵衣术士施里特)) if (!Bot.HasInGraveyard((int)CardId.影灵衣术士施里特) && !Bot.HasInHand((int)CardId.影灵衣术士施里特))
{ {
AI.SelectCard((int)CardId.影灵衣术士施里特); AI.SelectCard((int)CardId.影灵衣术士施里特);
return true; return true;
...@@ -122,21 +122,21 @@ namespace WindBot.Game.AI.Decks ...@@ -122,21 +122,21 @@ namespace WindBot.Game.AI.Decks
private bool 万手神召唤() private bool 万手神召唤()
{ {
if (!Duel.Fields[0].HasInHand((int)CardId.千手神) || !Duel.Fields[0].HasInHand((int)CardId.影灵衣术士施里特)) if (!Bot.HasInHand((int)CardId.千手神) || !Bot.HasInHand((int)CardId.影灵衣术士施里特))
return true; return true;
return false; return false;
} }
private bool 影灵衣舞姬召唤() private bool 影灵衣舞姬召唤()
{ {
if (!Duel.Fields[0].HasInHand((int)CardId.千手神) && !Duel.Fields[0].HasInHand((int)CardId.万手神)) if (!Bot.HasInHand((int)CardId.千手神) && !Bot.HasInHand((int)CardId.万手神))
return true; return true;
return false; return false;
} }
private bool 混沌幻影() private bool 混沌幻影()
{ {
if (Duel.Fields[0].HasInGraveyard((int)CardId.影灵衣术士施里特) && Duel.Fields[0].HasInHand(NekrozSpellCard) && Duel.Fields[0].HasInHand(NekrozRituelCard)) if (Bot.HasInGraveyard((int)CardId.影灵衣术士施里特) && Bot.HasInHand(NekrozSpellCard) && Bot.HasInHand(NekrozRituelCard))
return true; return true;
return false; return false;
} }
...@@ -149,14 +149,14 @@ namespace WindBot.Game.AI.Decks ...@@ -149,14 +149,14 @@ namespace WindBot.Game.AI.Decks
private bool 影灵衣术士施里特() private bool 影灵衣术士施里特()
{ {
if (!Duel.Fields[0].HasInHand((int)CardId.千手神) && !Duel.Fields[0].HasInHand((int)CardId.万手神) && !Duel.Fields[0].HasInHand((int)CardId.影灵衣舞姬)) if (!Bot.HasInHand((int)CardId.千手神) && !Bot.HasInHand((int)CardId.万手神) && !Bot.HasInHand((int)CardId.影灵衣舞姬))
return true; return true;
return false; return false;
} }
private bool 三叉龙之影灵衣() private bool 三叉龙之影灵衣()
{ {
if (AI.Utils.IsAllEnemyBetterThanValue(2700, true) && Duel.Fields[0].HasInHand((int)CardId.决战兵器之影灵衣)) if (AI.Utils.IsAllEnemyBetterThanValue(2700, true) && Bot.HasInHand((int)CardId.决战兵器之影灵衣))
return false; return false;
return true; return true;
} }
...@@ -173,7 +173,7 @@ namespace WindBot.Game.AI.Decks ...@@ -173,7 +173,7 @@ namespace WindBot.Game.AI.Decks
private bool 励辉士入魔蝇王() private bool 励辉士入魔蝇王()
{ {
if (AI.Utils.IsAllEnemyBetterThanValue(Duel.Fields[0].GetMonsters().GetHighestAttackMonster().Attack, true)) if (AI.Utils.IsAllEnemyBetterThanValue(Bot.GetMonsters().GetHighestAttackMonster().Attack, true))
{ {
return true; return true;
} }
...@@ -189,9 +189,9 @@ namespace WindBot.Game.AI.Decks ...@@ -189,9 +189,9 @@ namespace WindBot.Game.AI.Decks
private bool 天枪龙之影灵衣() private bool 天枪龙之影灵衣()
{ {
if (AI.Utils.IsOneEnemyBetterThanValue(Duel.Fields[0].GetMonsters().GetHighestAttackMonster().Attack,true) && Duel.Phase == DuelPhase.Main1) if (AI.Utils.IsOneEnemyBetterThanValue(Bot.GetMonsters().GetHighestAttackMonster().Attack,true) && Duel.Phase == DuelPhase.Main1)
{ {
AI.SelectCard(Duel.Fields[1].GetMonsters().GetHighestAttackMonster()); AI.SelectCard(Enemy.GetMonsters().GetHighestAttackMonster());
return true; return true;
} }
return false; return false;
...@@ -199,32 +199,32 @@ namespace WindBot.Game.AI.Decks ...@@ -199,32 +199,32 @@ namespace WindBot.Game.AI.Decks
private bool 光枪龙之影灵衣() private bool 光枪龙之影灵衣()
{ {
if (!Duel.Fields[0].HasInHand((int)CardId.影灵衣术士施里特)) if (!Bot.HasInHand((int)CardId.影灵衣术士施里特))
{ {
AI.SelectCard((int)CardId.影灵衣术士施里特); AI.SelectCard((int)CardId.影灵衣术士施里特);
return true; return true;
} }
else if (!Duel.Fields[0].HasInHand(NekrozSpellCard)) else if (!Bot.HasInHand(NekrozSpellCard))
{ {
AI.SelectCard((int)CardId.影灵衣的降魔镜); AI.SelectCard((int)CardId.影灵衣的降魔镜);
return true; return true;
} }
else if (AI.Utils.IsOneEnemyBetterThanValue(3300, true) && !Duel.Fields[0].HasInHand((int)CardId.三叉龙之影灵衣)) else if (AI.Utils.IsOneEnemyBetterThanValue(3300, true) && !Bot.HasInHand((int)CardId.三叉龙之影灵衣))
{ {
AI.SelectCard((int)CardId.三叉龙之影灵衣); AI.SelectCard((int)CardId.三叉龙之影灵衣);
return true; return true;
} }
else if (AI.Utils.IsAllEnemyBetterThanValue(2700,true) && !Duel.Fields[0].HasInHand((int)CardId.决战兵器之影灵衣)) else if (AI.Utils.IsAllEnemyBetterThanValue(2700,true) && !Bot.HasInHand((int)CardId.决战兵器之影灵衣))
{ {
AI.SelectCard((int)CardId.决战兵器之影灵衣); AI.SelectCard((int)CardId.决战兵器之影灵衣);
return true; return true;
} }
else if (Duel.Fields[0].HasInHand((int)CardId.尤尼科之影灵衣) && !Duel.Fields[0].HasInHand((int)CardId.影灵衣的万华镜)) else if (Bot.HasInHand((int)CardId.尤尼科之影灵衣) && !Bot.HasInHand((int)CardId.影灵衣的万华镜))
{ {
AI.SelectCard((int)CardId.影灵衣的万华镜); AI.SelectCard((int)CardId.影灵衣的万华镜);
return true; return true;
} }
else if (!Duel.Fields[0].HasInHand((int)CardId.尤尼科之影灵衣) && Duel.Fields[0].HasInHand((int)CardId.影灵衣的万华镜)) else if (!Bot.HasInHand((int)CardId.尤尼科之影灵衣) && Bot.HasInHand((int)CardId.影灵衣的万华镜))
{ {
AI.SelectCard((int)CardId.尤尼科之影灵衣); AI.SelectCard((int)CardId.尤尼科之影灵衣);
return true; return true;
...@@ -234,17 +234,17 @@ namespace WindBot.Game.AI.Decks ...@@ -234,17 +234,17 @@ namespace WindBot.Game.AI.Decks
private bool 千手神效果() private bool 千手神效果()
{ {
if (AI.Utils.IsOneEnemyBetterThanValue(3300, true) && !Duel.Fields[0].HasInHand((int)CardId.三叉龙之影灵衣)) if (AI.Utils.IsOneEnemyBetterThanValue(3300, true) && !Bot.HasInHand((int)CardId.三叉龙之影灵衣))
{ {
AI.SelectCard((int)CardId.三叉龙之影灵衣); AI.SelectCard((int)CardId.三叉龙之影灵衣);
return true; return true;
} }
else if (AI.Utils.IsAllEnemyBetterThanValue(2700, true) && !Duel.Fields[0].HasInHand((int)CardId.决战兵器之影灵衣)) else if (AI.Utils.IsAllEnemyBetterThanValue(2700, true) && !Bot.HasInHand((int)CardId.决战兵器之影灵衣))
{ {
AI.SelectCard((int)CardId.决战兵器之影灵衣); AI.SelectCard((int)CardId.决战兵器之影灵衣);
return true; return true;
} }
else if (!Duel.Fields[0].HasInHand((int)CardId.尤尼科之影灵衣) && Duel.Fields[0].HasInHand((int)CardId.影灵衣的万华镜)) else if (!Bot.HasInHand((int)CardId.尤尼科之影灵衣) && Bot.HasInHand((int)CardId.影灵衣的万华镜))
{ {
AI.SelectCard((int)CardId.尤尼科之影灵衣); AI.SelectCard((int)CardId.尤尼科之影灵衣);
return true; return true;
...@@ -254,7 +254,7 @@ namespace WindBot.Game.AI.Decks ...@@ -254,7 +254,7 @@ namespace WindBot.Game.AI.Decks
private bool 尤尼科之影灵衣() private bool 尤尼科之影灵衣()
{ {
if (Duel.Fields[0].HasInGraveyard((int)CardId.影灵衣术士施里特)) if (Bot.HasInGraveyard((int)CardId.影灵衣术士施里特))
{ {
AI.SelectCard((int)CardId.影灵衣术士施里特); AI.SelectCard((int)CardId.影灵衣术士施里特);
return true; return true;
...@@ -264,7 +264,7 @@ namespace WindBot.Game.AI.Decks ...@@ -264,7 +264,7 @@ namespace WindBot.Game.AI.Decks
private bool 辉剑鸟之影灵衣() private bool 辉剑鸟之影灵衣()
{ {
if (!Duel.Fields[0].HasInHand(NekrozSpellCard)) if (!Bot.HasInHand(NekrozSpellCard))
{ {
AI.SelectCard((int)CardId.影灵衣的降魔镜); AI.SelectCard((int)CardId.影灵衣的降魔镜);
return true; return true;
...@@ -274,7 +274,7 @@ namespace WindBot.Game.AI.Decks ...@@ -274,7 +274,7 @@ namespace WindBot.Game.AI.Decks
private bool IsTheLastPossibility() private bool IsTheLastPossibility()
{ {
if (!Duel.Fields[0].HasInHand((int)CardId.决战兵器之影灵衣) && !Duel.Fields[0].HasInHand((int)CardId.三叉龙之影灵衣)) if (!Bot.HasInHand((int)CardId.决战兵器之影灵衣) && !Bot.HasInHand((int)CardId.三叉龙之影灵衣))
return true; return true;
return false; return false;
} }
...@@ -284,13 +284,13 @@ namespace WindBot.Game.AI.Decks ...@@ -284,13 +284,13 @@ namespace WindBot.Game.AI.Decks
List<int> NekrozCard = new List<int>(); List<int> NekrozCard = new List<int>();
try try
{ {
foreach (ClientCard Card in Duel.Fields[0].Hand) foreach (ClientCard Card in Bot.Hand)
if (Card != null && NekrozRituelCard.Contains((int)Card.Id)) if (Card != null && NekrozRituelCard.Contains((int)Card.Id))
NekrozCard.Add(Card.Id); NekrozCard.Add(Card.Id);
foreach (int Id in NekrozCard) foreach (int Id in NekrozCard)
{ {
if (Id == (int)CardId.三叉龙之影灵衣 && AI.Utils.IsAllEnemyBetterThanValue(2700, true) && Duel.Fields[0].HasInHand((int)CardId.决战兵器之影灵衣)) if (Id == (int)CardId.三叉龙之影灵衣 && AI.Utils.IsAllEnemyBetterThanValue(2700, true) && Bot.HasInHand((int)CardId.决战兵器之影灵衣))
{ {
AI.SelectCard((int)CardId.三叉龙之影灵衣); AI.SelectCard((int)CardId.三叉龙之影灵衣);
return true; return true;
...@@ -300,7 +300,7 @@ namespace WindBot.Game.AI.Decks ...@@ -300,7 +300,7 @@ namespace WindBot.Game.AI.Decks
AI.SelectCard((int)CardId.决战兵器之影灵衣); AI.SelectCard((int)CardId.决战兵器之影灵衣);
return true; return true;
} }
else if (Id == (int)CardId.尤尼科之影灵衣 && Duel.Fields[0].HasInHand((int)CardId.影灵衣的万华镜) && !Duel.Fields[0].HasInGraveyard((int)CardId.影灵衣术士施里特)) else if (Id == (int)CardId.尤尼科之影灵衣 && Bot.HasInHand((int)CardId.影灵衣的万华镜) && !Bot.HasInGraveyard((int)CardId.影灵衣术士施里特))
{ {
AI.SelectCard((int)CardId.尤尼科之影灵衣); AI.SelectCard((int)CardId.尤尼科之影灵衣);
return true; return true;
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
if (Main.SummonableCards.Count == 1 && Main.SummonableCards[0].Level < 5) if (Main.SummonableCards.Count == 1 && Main.SummonableCards[0].Level < 5)
{ {
bool canTribute = false; bool canTribute = false;
foreach (ClientCard handCard in Duel.Fields[0].Hand) foreach (ClientCard handCard in Bot.Hand)
{ {
if (handCard.IsMonster() && handCard.Level > 4 && handCard.Level < 6) if (handCard.IsMonster() && handCard.Level > 4 && handCard.Level < 6)
canTribute = true; canTribute = true;
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
} }
int monsters = 0; int monsters = 0;
foreach (ClientCard handCard in Duel.Fields[0].Hand) foreach (ClientCard handCard in Bot.Hand)
{ {
if (handCard.IsMonster()) if (handCard.IsMonster())
monsters++; monsters++;
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
private bool SwordsOfRevealingLight() private bool SwordsOfRevealingLight()
{ {
foreach (ClientCard handCard in Duel.Fields[1].GetMonsters()) foreach (ClientCard handCard in Enemy.GetMonsters())
{ {
if (handCard.IsFacedown()) if (handCard.IsFacedown())
return true; return true;
......
...@@ -199,7 +199,7 @@ namespace WindBot.Game.AI.Decks ...@@ -199,7 +199,7 @@ namespace WindBot.Game.AI.Decks
private bool 优先盖不重复的坑() private bool 优先盖不重复的坑()
{ {
foreach (ClientCard card in Duel.Fields[0].SpellZone) foreach (ClientCard card in Bot.SpellZone)
{ {
if (card != null && card.Id == Card.Id) if (card != null && card.Id == Card.Id)
return false; return false;
...@@ -209,7 +209,7 @@ namespace WindBot.Game.AI.Decks ...@@ -209,7 +209,7 @@ namespace WindBot.Game.AI.Decks
private bool 魔陷区有空余格子() private bool 魔陷区有空余格子()
{ {
return Duel.Fields[0].GetSpellCountWithoutField() < 4; return Bot.GetSpellCountWithoutField() < 4;
} }
private bool 已发动过削命() private bool 已发动过削命()
...@@ -249,12 +249,12 @@ namespace WindBot.Game.AI.Decks ...@@ -249,12 +249,12 @@ namespace WindBot.Game.AI.Decks
if (!Card.HasType(CardType.Pendulum) || Card.Location != CardLocation.Hand) if (!Card.HasType(CardType.Pendulum) || Card.Location != CardLocation.Hand)
return false; return false;
int count = 0; int count = 0;
foreach (ClientCard card in Duel.Fields[0].Hand.GetMonsters()) foreach (ClientCard card in Bot.Hand.GetMonsters())
{ {
if (!Card.Equals(card)) if (!Card.Equals(card))
count++; count++;
} }
foreach (ClientCard card in Duel.Fields[0].ExtraDeck.GetMonsters()) foreach (ClientCard card in Bot.ExtraDeck.GetMonsters())
{ {
if (card.HasType(CardType.Pendulum) && card.IsFaceup()) if (card.HasType(CardType.Pendulum) && card.IsFaceup())
count++; count++;
...@@ -266,7 +266,7 @@ namespace WindBot.Game.AI.Decks ...@@ -266,7 +266,7 @@ namespace WindBot.Game.AI.Decks
if (已发动削命) if (已发动削命)
return true; return true;
bool pair = false; bool pair = false;
foreach (ClientCard card in Duel.Fields[0].Hand.GetMonsters()) foreach (ClientCard card in Bot.Hand.GetMonsters())
{ {
if (card.RScale != Card.LScale) if (card.RScale != Card.LScale)
{ {
...@@ -291,21 +291,21 @@ namespace WindBot.Game.AI.Decks ...@@ -291,21 +291,21 @@ namespace WindBot.Game.AI.Decks
int count = 0; int count = 0;
int handcount = 0; int handcount = 0;
int fieldcount = 0; int fieldcount = 0;
foreach (ClientCard card in Duel.Fields[0].Hand.GetMonsters()) foreach (ClientCard card in Bot.Hand.GetMonsters())
{ {
count++; count++;
handcount++; handcount++;
} }
foreach (ClientCard card in Duel.Fields[0].MonsterZone.GetMonsters()) foreach (ClientCard card in Bot.MonsterZone.GetMonsters())
{ {
fieldcount++; fieldcount++;
} }
foreach (ClientCard card in Duel.Fields[0].ExtraDeck.GetMonsters()) foreach (ClientCard card in Bot.ExtraDeck.GetMonsters())
{ {
if (card.HasType(CardType.Pendulum) && card.IsFaceup()) if (card.HasType(CardType.Pendulum) && card.IsFaceup())
count++; count++;
} }
if (count>0 && !Duel.Fields[0].HasInHand(低刻度)) if (count>0 && !Bot.HasInHand(低刻度))
{ {
AI.SelectCard(低刻度); AI.SelectCard(低刻度);
} }
...@@ -335,13 +335,13 @@ namespace WindBot.Game.AI.Decks ...@@ -335,13 +335,13 @@ namespace WindBot.Game.AI.Decks
AI.SelectCard(target); AI.SelectCard(target);
return true; return true;
} }
List<ClientCard> monsters = Duel.Fields[1].GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
AI.SelectCard(monster); AI.SelectCard(monster);
return true; return true;
} }
List<ClientCard> spells = Duel.Fields[1].GetSpells(); List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells) foreach (ClientCard spell in spells)
{ {
if (spell.IsFacedown()) if (spell.IsFacedown())
...@@ -368,7 +368,7 @@ namespace WindBot.Game.AI.Decks ...@@ -368,7 +368,7 @@ namespace WindBot.Game.AI.Decks
AI.SelectCard(target); AI.SelectCard(target);
return true; return true;
} }
List<ClientCard> monsters = Duel.Fields[1].GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
AI.SelectCard(monster); AI.SelectCard(monster);
...@@ -387,7 +387,7 @@ namespace WindBot.Game.AI.Decks ...@@ -387,7 +387,7 @@ namespace WindBot.Game.AI.Decks
AI.SelectCard(target); AI.SelectCard(target);
return true; return true;
} }
List<ClientCard> spells = Duel.Fields[1].GetSpells(); List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells) foreach (ClientCard spell in spells)
{ {
if (spell.IsFacedown()) if (spell.IsFacedown())
...@@ -411,11 +411,11 @@ namespace WindBot.Game.AI.Decks ...@@ -411,11 +411,11 @@ namespace WindBot.Game.AI.Decks
if (l != null && r != null && l.LScale != r.RScale) if (l != null && r != null && l.LScale != r.RScale)
{ {
int count = 0; int count = 0;
foreach (ClientCard card in Duel.Fields[0].Hand.GetMonsters()) foreach (ClientCard card in Bot.Hand.GetMonsters())
{ {
count++; count++;
} }
foreach (ClientCard card in Duel.Fields[0].ExtraDeck.GetMonsters()) foreach (ClientCard card in Bot.ExtraDeck.GetMonsters())
{ {
if (card.HasType(CardType.Pendulum) && card.IsFaceup()) if (card.HasType(CardType.Pendulum) && card.IsFaceup())
count++; count++;
......
...@@ -161,7 +161,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -161,7 +161,7 @@ namespace MycardBot.Game.AI.Decks
{ {
if (attacker.Id == (int)CardId.闪光No39希望皇霍普电光皇 && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.No39希望皇霍普)) if (attacker.Id == (int)CardId.闪光No39希望皇霍普电光皇 && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.No39希望皇霍普))
attacker.RealPower = 5000; attacker.RealPower = 5000;
if (Duel.Fields[0].HasInMonstersZone((int)CardId.No37希望织龙蜘蛛鲨, true, true)) if (Bot.HasInMonstersZone((int)CardId.No37希望织龙蜘蛛鲨, true, true))
attacker.RealPower = attacker.RealPower + 1000; attacker.RealPower = attacker.RealPower + 1000;
} }
return attacker.RealPower > defender.GetDefensePower(); return attacker.RealPower > defender.GetDefensePower();
...@@ -169,7 +169,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -169,7 +169,7 @@ namespace MycardBot.Game.AI.Decks
private bool 粗人预料效果() private bool 粗人预料效果()
{ {
if (Duel.Fields[0].HasInHand((int)CardId.救援兔) || 已通常召唤) if (Bot.HasInHand((int)CardId.救援兔) || 已通常召唤)
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
(int)CardId.幻壳龙, (int)CardId.幻壳龙,
...@@ -177,22 +177,22 @@ namespace MycardBot.Game.AI.Decks ...@@ -177,22 +177,22 @@ namespace MycardBot.Game.AI.Decks
}); });
else if (AI.Utils.IsTurn1OrMain2()) else if (AI.Utils.IsTurn1OrMain2())
{ {
if (Duel.Fields[0].HasInHand((int)CardId.幻壳龙)) if (Bot.HasInHand((int)CardId.幻壳龙))
AI.SelectCard((int)CardId.幻壳龙); AI.SelectCard((int)CardId.幻壳龙);
else if (Duel.Fields[0].HasInHand((int)CardId.打喷嚏的河马龙)) else if (Bot.HasInHand((int)CardId.打喷嚏的河马龙))
AI.SelectCard((int)CardId.打喷嚏的河马龙); AI.SelectCard((int)CardId.打喷嚏的河马龙);
else if (Duel.Fields[0].HasInHand((int)CardId.曼陀罗天使号手)) else if (Bot.HasInHand((int)CardId.曼陀罗天使号手))
AI.SelectCard((int)CardId.曼陀罗天使号手); AI.SelectCard((int)CardId.曼陀罗天使号手);
} }
else else
{ {
if (Duel.Fields[0].HasInHand((int)CardId.打喷嚏的河马龙)) if (Bot.HasInHand((int)CardId.打喷嚏的河马龙))
AI.SelectCard((int)CardId.打喷嚏的河马龙); AI.SelectCard((int)CardId.打喷嚏的河马龙);
else if (Duel.Fields[0].HasInHand((int)CardId.龙剑士卓辉星灵摆)) else if (Bot.HasInHand((int)CardId.龙剑士卓辉星灵摆))
AI.SelectCard((int)CardId.龙剑士卓辉星灵摆); AI.SelectCard((int)CardId.龙剑士卓辉星灵摆);
else if (Duel.Fields[0].HasInHand((int)CardId.幻之狮鹫)) else if (Bot.HasInHand((int)CardId.幻之狮鹫))
AI.SelectCard((int)CardId.幻之狮鹫); AI.SelectCard((int)CardId.幻之狮鹫);
else if (Duel.Fields[0].HasInHand((int)CardId.曼陀罗天使号手)) else if (Bot.HasInHand((int)CardId.曼陀罗天使号手))
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
(int)CardId.炼装勇士金驰, (int)CardId.炼装勇士金驰,
...@@ -224,27 +224,27 @@ namespace MycardBot.Game.AI.Decks ...@@ -224,27 +224,27 @@ namespace MycardBot.Game.AI.Decks
private bool 幻壳龙通常召唤() private bool 幻壳龙通常召唤()
{ {
return Duel.Fields[0].HasInMonstersZone((int)CardId.幻壳龙); return Bot.HasInMonstersZone((int)CardId.幻壳龙);
} }
private bool 幻之狮鹫通常召唤() private bool 幻之狮鹫通常召唤()
{ {
return Duel.Fields[0].HasInMonstersZone((int)CardId.幻之狮鹫); return Bot.HasInMonstersZone((int)CardId.幻之狮鹫);
} }
private bool 龙剑士卓辉星灵摆通常召唤() private bool 龙剑士卓辉星灵摆通常召唤()
{ {
return Duel.Fields[0].HasInMonstersZone((int)CardId.龙剑士卓辉星灵摆); return Bot.HasInMonstersZone((int)CardId.龙剑士卓辉星灵摆);
} }
private bool 曼陀罗天使号手通常召唤() private bool 曼陀罗天使号手通常召唤()
{ {
return Duel.Fields[0].HasInMonstersZone((int)CardId.曼陀罗天使号手); return Bot.HasInMonstersZone((int)CardId.曼陀罗天使号手);
} }
private bool 炼装勇士金驰通常召唤() private bool 炼装勇士金驰通常召唤()
{ {
return Duel.Fields[0].HasInMonstersZone((int)CardId.炼装勇士金驰); return Bot.HasInMonstersZone((int)CardId.炼装勇士金驰);
} }
private bool 打喷嚏的河马龙通常召唤() private bool 打喷嚏的河马龙通常召唤()
{ {
return Duel.Fields[0].HasInMonstersZone((int)CardId.打喷嚏的河马龙); return Bot.HasInMonstersZone((int)CardId.打喷嚏的河马龙);
} }
private bool 通常召唤() private bool 通常召唤()
{ {
...@@ -263,25 +263,25 @@ namespace MycardBot.Game.AI.Decks ...@@ -263,25 +263,25 @@ namespace MycardBot.Game.AI.Decks
private bool 励辉士入魔蝇王特殊召唤() private bool 励辉士入魔蝇王特殊召唤()
{ {
int selfCount = Duel.Fields[0].GetMonsterCount() + Duel.Fields[0].GetSpellCount() + Duel.Fields[0].GetHandCount(); int selfCount = Bot.GetMonsterCount() + Bot.GetSpellCount() + Bot.GetHandCount();
int oppoCount = Duel.Fields[1].GetMonsterCount() + Duel.Fields[1].GetSpellCount() + Duel.Fields[1].GetHandCount(); int oppoCount = Enemy.GetMonsterCount() + Enemy.GetSpellCount() + Enemy.GetHandCount();
return (selfCount - 1 < oppoCount) && 励辉士入魔蝇王效果(); return (selfCount - 1 < oppoCount) && 励辉士入魔蝇王效果();
} }
private bool 励辉士入魔蝇王效果() private bool 励辉士入魔蝇王效果()
{ {
int selfCount = Duel.Fields[0].GetMonsterCount() + Duel.Fields[0].GetSpellCount(); int selfCount = Bot.GetMonsterCount() + Bot.GetSpellCount();
int oppoCount = Duel.Fields[1].GetMonsterCount() + Duel.Fields[1].GetSpellCount(); int oppoCount = Enemy.GetMonsterCount() + Enemy.GetSpellCount();
int selfAttack = 0; int selfAttack = 0;
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
selfAttack += monster.GetDefensePower(); selfAttack += monster.GetDefensePower();
} }
int oppoAttack = 0; int oppoAttack = 0;
monsters = Duel.Fields[1].GetMonsters(); monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
oppoAttack += monster.GetDefensePower(); oppoAttack += monster.GetDefensePower();
...@@ -292,15 +292,15 @@ namespace MycardBot.Game.AI.Decks ...@@ -292,15 +292,15 @@ namespace MycardBot.Game.AI.Decks
private bool 红莲魔龙右红痕特殊召唤() private bool 红莲魔龙右红痕特殊召唤()
{ {
int selfBestAttack = AI.Utils.GetBestAttack(Duel.Fields[0], true); int selfBestAttack = AI.Utils.GetBestAttack(Bot, true);
int oppoBestAttack = AI.Utils.GetBestAttack(Duel.Fields[1], false); int oppoBestAttack = AI.Utils.GetBestAttack(Enemy, false);
return (selfBestAttack <= oppoBestAttack && oppoBestAttack <= 3000) || 红莲魔龙右红痕效果(); return (selfBestAttack <= oppoBestAttack && oppoBestAttack <= 3000) || 红莲魔龙右红痕效果();
} }
private bool 红莲魔龙右红痕效果() private bool 红莲魔龙右红痕效果()
{ {
int selfCount = 0; int selfCount = 0;
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (!monster.Equals(Card) && monster.HasType(CardType.Effect) && monster.Attack <= Card.Attack) if (!monster.Equals(Card) && monster.HasType(CardType.Effect) && monster.Attack <= Card.Attack)
...@@ -308,7 +308,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -308,7 +308,7 @@ namespace MycardBot.Game.AI.Decks
} }
int oppoCount = 0; int oppoCount = 0;
monsters = Duel.Fields[1].GetMonsters(); monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
// 没有办法获取特殊召唤的状态,只好默认全部是特招的 // 没有办法获取特殊召唤的状态,只好默认全部是特招的
...@@ -343,7 +343,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -343,7 +343,7 @@ namespace MycardBot.Game.AI.Decks
return true; return true;
ClientCard target1 = null; ClientCard target1 = null;
ClientCard target2 = AI.Utils.GetProblematicCard(); ClientCard target2 = AI.Utils.GetProblematicCard();
List<ClientCard> spells = Duel.Fields[1].GetSpells(); List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells) foreach (ClientCard spell in spells)
{ {
if (spell.HasType(CardType.Pendulum) && !spell.Equals(target2)) if (spell.HasType(CardType.Pendulum) && !spell.Equals(target2))
...@@ -352,7 +352,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -352,7 +352,7 @@ namespace MycardBot.Game.AI.Decks
break; break;
} }
} }
List<ClientCard> monsters = Duel.Fields[1].GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.HasType(CardType.Pendulum) && !monster.Equals(target2)) if (monster.HasType(CardType.Pendulum) && !monster.Equals(target2))
...@@ -395,7 +395,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -395,7 +395,7 @@ namespace MycardBot.Game.AI.Decks
private bool 电光千鸟特殊召唤() private bool 电光千鸟特殊召唤()
{ {
List<ClientCard> monsters = Duel.Fields[1].GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.IsFacedown()) if (monster.IsFacedown())
...@@ -403,7 +403,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -403,7 +403,7 @@ namespace MycardBot.Game.AI.Decks
return true; return true;
} }
} }
List<ClientCard> spells = Duel.Fields[1].GetSpells(); List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells) foreach (ClientCard spell in spells)
{ {
if (spell.IsFacedown()) if (spell.IsFacedown())
...@@ -449,7 +449,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -449,7 +449,7 @@ namespace MycardBot.Game.AI.Decks
private bool 芙莉西亚之虫惑魔特殊召唤() private bool 芙莉西亚之虫惑魔特殊召唤()
{ {
if (AI.Utils.IsTurn1OrMain2() && (Duel.Fields[0].GetRemainingCount((int)CardId.奈落的落穴, 1) + Duel.Fields[0].GetRemainingCount((int)CardId.虫惑的落穴, 1)) > 0) if (AI.Utils.IsTurn1OrMain2() && (Bot.GetRemainingCount((int)CardId.奈落的落穴, 1) + Bot.GetRemainingCount((int)CardId.虫惑的落穴, 1)) > 0)
{ {
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
return true; return true;
...@@ -459,7 +459,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -459,7 +459,7 @@ namespace MycardBot.Game.AI.Decks
private bool No59背反之料理人特殊召唤() private bool No59背反之料理人特殊召唤()
{ {
return ((Duel.Fields[0].GetMonsterCount() + Duel.Fields[0].GetSpellCount() - 2) <= 1) && return ((Bot.GetMonsterCount() + Bot.GetSpellCount() - 2) <= 1) &&
((AI.Utils.IsEnemyBetter(false, false) && !AI.Utils.IsOneEnemyBetterThanValue(2300, true)) || AI.Utils.IsTurn1OrMain2()); ((AI.Utils.IsEnemyBetter(false, false) && !AI.Utils.IsOneEnemyBetterThanValue(2300, true)) || AI.Utils.IsTurn1OrMain2());
} }
...@@ -475,7 +475,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -475,7 +475,7 @@ namespace MycardBot.Game.AI.Decks
} }
else else
{ {
if ((Duel.Fields[0].GetMonsterCount() + Duel.Fields[0].GetSpellCount() -1) <= 1) if ((Bot.GetMonsterCount() + Bot.GetSpellCount() -1) <= 1)
return true; return true;
} }
return false; return false;
...@@ -509,7 +509,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -509,7 +509,7 @@ namespace MycardBot.Game.AI.Decks
private bool 强欲而贪欲之壶效果() private bool 强欲而贪欲之壶效果()
{ {
return Duel.Fields[0].Deck.Count > 15; return Bot.Deck.Count > 15;
} }
private bool 地碎效果() private bool 地碎效果()
...@@ -519,7 +519,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -519,7 +519,7 @@ namespace MycardBot.Game.AI.Decks
private bool 陷阱卡覆盖() private bool 陷阱卡覆盖()
{ {
return !Duel.Fields[0].HasInMonstersZone((int)CardId.No59背反之料理人, true, true); return !Bot.HasInMonstersZone((int)CardId.No59背反之料理人, true, true);
} }
} }
} }
...@@ -120,7 +120,7 @@ namespace DevBot.Game.AI.Decks ...@@ -120,7 +120,7 @@ namespace DevBot.Game.AI.Decks
private bool 特殊召唤不重复的超量怪兽() private bool 特殊召唤不重复的超量怪兽()
{ {
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
if (monster.Id == Card.Id) if (monster.Id == Card.Id)
return false; return false;
...@@ -179,12 +179,12 @@ namespace DevBot.Game.AI.Decks ...@@ -179,12 +179,12 @@ namespace DevBot.Game.AI.Decks
if (场上有5星怪兽()) if (场上有5星怪兽())
return true; return true;
int 其他的5星资源数量 = 0; int 其他的5星资源数量 = 0;
IList<ClientCard> hand = Duel.Fields[0].Hand; IList<ClientCard> hand = Bot.Hand;
foreach (ClientCard card in hand) foreach (ClientCard card in hand)
{ {
if (card.Id == (int)CardId.简易融合 && !已发动简易融合) if (card.Id == (int)CardId.简易融合 && !已发动简易融合)
++其他的5星资源数量; ++其他的5星资源数量;
if (card.Id == (int)CardId.速攻同调士 && Duel.Fields[0].Hand.ContainsMonsterWithLevel(4)) if (card.Id == (int)CardId.速攻同调士 && Bot.Hand.ContainsMonsterWithLevel(4))
++其他的5星资源数量; ++其他的5星资源数量;
if (card.Id == (int)CardId.迷雾恶魔 && !已通常召唤) if (card.Id == (int)CardId.迷雾恶魔 && !已通常召唤)
++其他的5星资源数量; ++其他的5星资源数量;
...@@ -210,7 +210,7 @@ namespace DevBot.Game.AI.Decks ...@@ -210,7 +210,7 @@ namespace DevBot.Game.AI.Decks
{ {
if (!已通常召唤 || 已发动二重召唤) if (!已通常召唤 || 已发动二重召唤)
return false; return false;
IList<ClientCard> hand = Duel.Fields[0].Hand; IList<ClientCard> hand = Bot.Hand;
foreach (ClientCard card in hand) foreach (ClientCard card in hand)
{ {
if (card.Id == (int)CardId.迷雾恶魔 || if (card.Id == (int)CardId.迷雾恶魔 ||
...@@ -262,7 +262,7 @@ namespace DevBot.Game.AI.Decks ...@@ -262,7 +262,7 @@ namespace DevBot.Game.AI.Decks
} }
else else
{ {
List<ClientCard> monsters = Duel.Fields[1].GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
ClientCard bestmonster = null; ClientCard bestmonster = null;
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
...@@ -285,7 +285,7 @@ namespace DevBot.Game.AI.Decks ...@@ -285,7 +285,7 @@ namespace DevBot.Game.AI.Decks
private bool No61火山恐龙效果() private bool No61火山恐龙效果()
{ {
ClientCard target = Duel.Fields[1].MonsterZone.GetFloodgate(); ClientCard target = Enemy.MonsterZone.GetFloodgate();
if (target == null) if (target == null)
target = AI.Utils.GetOneEnemyBetterThanValue(2000, false); target = AI.Utils.GetOneEnemyBetterThanValue(2000, false);
if (target != null) if (target != null)
...@@ -310,12 +310,12 @@ namespace DevBot.Game.AI.Decks ...@@ -310,12 +310,12 @@ namespace DevBot.Game.AI.Decks
private bool 迅雷之骑士盖亚龙骑士特殊召唤() private bool 迅雷之骑士盖亚龙骑士特殊召唤()
{ {
if (已发动火山恐龙 && Duel.Fields[0].HasInMonstersZone((int)CardId.No61火山恐龙)) if (已发动火山恐龙 && Bot.HasInMonstersZone((int)CardId.No61火山恐龙))
{ {
AI.SelectCard((int)CardId.No61火山恐龙); AI.SelectCard((int)CardId.No61火山恐龙);
return true; return true;
} }
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.HasType(CardType.Xyz) && !monster.HasXyzMaterial()) if (monster.HasType(CardType.Xyz) && !monster.HasXyzMaterial())
...@@ -329,7 +329,7 @@ namespace DevBot.Game.AI.Decks ...@@ -329,7 +329,7 @@ namespace DevBot.Game.AI.Decks
private bool 超量苏生效果() private bool 超量苏生效果()
{ {
foreach (ClientCard card in Duel.Fields[0].SpellZone) foreach (ClientCard card in Bot.SpellZone)
{ {
if (card != null && if (card != null &&
card.Id == Card.Id && card.Id == Card.Id &&
...@@ -349,7 +349,7 @@ namespace DevBot.Game.AI.Decks ...@@ -349,7 +349,7 @@ namespace DevBot.Game.AI.Decks
private bool 超量组件效果() private bool 超量组件效果()
{ {
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
return monsters.Exists(p => p.HasType(CardType.Xyz)); return monsters.Exists(p => p.HasType(CardType.Xyz));
} }
...@@ -361,13 +361,13 @@ namespace DevBot.Game.AI.Decks ...@@ -361,13 +361,13 @@ namespace DevBot.Game.AI.Decks
AI.SelectCard(target); AI.SelectCard(target);
return true; return true;
} }
List<ClientCard> monsters = Duel.Fields[1].GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
AI.SelectCard(monster); AI.SelectCard(monster);
return true; return true;
} }
List<ClientCard> spells = Duel.Fields[1].GetSpells(); List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells) foreach (ClientCard spell in spells)
{ {
if (spell.IsFacedown()) if (spell.IsFacedown())
...@@ -386,13 +386,13 @@ namespace DevBot.Game.AI.Decks ...@@ -386,13 +386,13 @@ namespace DevBot.Game.AI.Decks
private bool 超量遮护罩效果() private bool 超量遮护罩效果()
{ {
List<ClientCard> spells = Duel.Fields[0].GetSpells(); List<ClientCard> spells = Bot.GetSpells();
foreach (ClientCard spell in spells) foreach (ClientCard spell in spells)
{ {
if (spell.Id == (int)CardId.超量遮护罩 && !spell.IsFacedown()) if (spell.Id == (int)CardId.超量遮护罩 && !spell.IsFacedown())
return false; return false;
} }
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.HasType(CardType.Xyz)) if (monster.HasType(CardType.Xyz))
...@@ -403,7 +403,7 @@ namespace DevBot.Game.AI.Decks ...@@ -403,7 +403,7 @@ namespace DevBot.Game.AI.Decks
private bool 场上有5星怪兽() private bool 场上有5星怪兽()
{ {
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.HasType(CardType.Monster) && if (monster.HasType(CardType.Monster) &&
...@@ -421,10 +421,10 @@ namespace DevBot.Game.AI.Decks ...@@ -421,10 +421,10 @@ namespace DevBot.Game.AI.Decks
ClientCard card = AI.Utils.GetProblematicCard(); ClientCard card = AI.Utils.GetProblematicCard();
if (card != null) if (card != null)
return card; return card;
card = Duel.Fields[1].MonsterZone.GetHighestAttackMonster(); card = Enemy.MonsterZone.GetHighestAttackMonster();
if (card != null) if (card != null)
return card; return card;
List<ClientCard> spells = Duel.Fields[1].GetSpells(); List<ClientCard> spells = Enemy.GetSpells();
if (spells.Count > 0) if (spells.Count > 0)
return spells[0]; return spells[0];
return null; return null;
......
...@@ -127,11 +127,11 @@ namespace WindBot.Game.AI.Decks ...@@ -127,11 +127,11 @@ namespace WindBot.Game.AI.Decks
private bool 冰结界的纹章效果() private bool 冰结界的纹章效果()
{ {
if (Duel.Fields[0].HasInHand(new List<int> if (Bot.HasInHand(new List<int>
{ {
(int)CardId.冰结界的术者, (int)CardId.冰结界的术者,
(int)CardId.冰结界的水影 (int)CardId.冰结界的水影
}) || Duel.Fields[0].HasInMonstersZone(new List<int> }) || Bot.HasInMonstersZone(new List<int>
{ {
(int)CardId.冰结界的术者, (int)CardId.冰结界的术者,
(int)CardId.冰结界的水影 (int)CardId.冰结界的水影
...@@ -179,11 +179,11 @@ namespace WindBot.Game.AI.Decks ...@@ -179,11 +179,11 @@ namespace WindBot.Game.AI.Decks
private bool 愚蠢的埋葬效果() private bool 愚蠢的埋葬效果()
{ {
if (Duel.Fields[0].HasInHand((int)CardId.小灰篮史莱姆) && !Duel.Fields[0].HasInGraveyard((int)CardId.小灰篮史莱姆)) if (Bot.HasInHand((int)CardId.小灰篮史莱姆) && !Bot.HasInGraveyard((int)CardId.小灰篮史莱姆))
AI.SelectCard((int)CardId.小灰篮史莱姆); AI.SelectCard((int)CardId.小灰篮史莱姆);
else if (Duel.Fields[0].HasInGraveyard((int)CardId.粹蛙) && !Duel.Fields[0].HasInGraveyard((int)CardId.魔知青蛙)) else if (Bot.HasInGraveyard((int)CardId.粹蛙) && !Bot.HasInGraveyard((int)CardId.魔知青蛙))
AI.SelectCard((int)CardId.魔知青蛙); AI.SelectCard((int)CardId.魔知青蛙);
else if (Duel.Fields[0].HasInGraveyard((int)CardId.魔知青蛙) && !Duel.Fields[0].HasInGraveyard((int)CardId.粹蛙)) else if (Bot.HasInGraveyard((int)CardId.魔知青蛙) && !Bot.HasInGraveyard((int)CardId.粹蛙))
AI.SelectCard((int)CardId.粹蛙); AI.SelectCard((int)CardId.粹蛙);
else else
AI.SelectCard(new[] AI.SelectCard(new[]
...@@ -212,11 +212,11 @@ namespace WindBot.Game.AI.Decks ...@@ -212,11 +212,11 @@ namespace WindBot.Game.AI.Decks
private bool 鬼青蛙特殊召唤() private bool 鬼青蛙特殊召唤()
{ {
if (Duel.Fields[0].GetCountCardInZone(Duel.Fields[0].Hand, (int)CardId.小灰篮史莱姆)>=2 && !Duel.Fields[0].HasInGraveyard((int)CardId.小灰篮史莱姆)) if (Bot.GetCountCardInZone(Bot.Hand, (int)CardId.小灰篮史莱姆)>=2 && !Bot.HasInGraveyard((int)CardId.小灰篮史莱姆))
AI.SelectCard((int)CardId.小灰篮史莱姆); AI.SelectCard((int)CardId.小灰篮史莱姆);
else if (Duel.Fields[0].HasInGraveyard((int)CardId.粹蛙) && !Duel.Fields[0].HasInGraveyard((int)CardId.魔知青蛙)) else if (Bot.HasInGraveyard((int)CardId.粹蛙) && !Bot.HasInGraveyard((int)CardId.魔知青蛙))
AI.SelectCard((int)CardId.魔知青蛙); AI.SelectCard((int)CardId.魔知青蛙);
else if (Duel.Fields[0].HasInGraveyard((int)CardId.魔知青蛙) && !Duel.Fields[0].HasInGraveyard((int)CardId.粹蛙)) else if (Bot.HasInGraveyard((int)CardId.魔知青蛙) && !Bot.HasInGraveyard((int)CardId.粹蛙))
AI.SelectCard((int)CardId.粹蛙); AI.SelectCard((int)CardId.粹蛙);
else else
AI.SelectCard(new[] AI.SelectCard(new[]
...@@ -240,7 +240,7 @@ namespace WindBot.Game.AI.Decks ...@@ -240,7 +240,7 @@ namespace WindBot.Game.AI.Decks
} }
else else
{ {
if (Duel.Fields[0].HasInHand((int)CardId.魔知青蛙)) if (Bot.HasInHand((int)CardId.魔知青蛙))
{ {
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
...@@ -256,7 +256,7 @@ namespace WindBot.Game.AI.Decks ...@@ -256,7 +256,7 @@ namespace WindBot.Game.AI.Decks
private bool 小灰篮史莱姆优先通常召唤() private bool 小灰篮史莱姆优先通常召唤()
{ {
return Duel.Fields[0].HasInGraveyard((int)CardId.小灰篮史莱姆); return Bot.HasInGraveyard((int)CardId.小灰篮史莱姆);
} }
private bool 小灰篮史莱姆效果() private bool 小灰篮史莱姆效果()
...@@ -284,7 +284,7 @@ namespace WindBot.Game.AI.Decks ...@@ -284,7 +284,7 @@ namespace WindBot.Game.AI.Decks
private bool 低攻怪兽通常召唤() private bool 低攻怪兽通常召唤()
{ {
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.Level==2) if (monster.Level==2)
...@@ -297,19 +297,19 @@ namespace WindBot.Game.AI.Decks ...@@ -297,19 +297,19 @@ namespace WindBot.Game.AI.Decks
private bool 冰结界下级通常召唤() private bool 冰结界下级通常召唤()
{ {
return Duel.Fields[0].GetCountCardInZone(Duel.Fields[0].Hand, (int)CardId.冰结界的传道师) > 0; return Bot.GetCountCardInZone(Bot.Hand, (int)CardId.冰结界的传道师) > 0;
} }
private bool 冰结界的传道师通常召唤() private bool 冰结界的传道师通常召唤()
{ {
return Duel.Fields[0].GetCountCardInZone(Duel.Fields[0].Hand, (int)CardId.冰结界的传道师) >= 2; return Bot.GetCountCardInZone(Bot.Hand, (int)CardId.冰结界的传道师) >= 2;
} }
private bool 饼蛙效果() private bool 饼蛙效果()
{ {
if (CurrentChain.Count > 0) if (CurrentChain.Count > 0)
{ {
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
List<int> 合适的COST = new List<int> { List<int> 合适的COST = new List<int> {
(int)CardId.鬼青蛙, (int)CardId.鬼青蛙,
(int)CardId.粹蛙, (int)CardId.粹蛙,
...@@ -325,7 +325,7 @@ namespace WindBot.Game.AI.Decks ...@@ -325,7 +325,7 @@ namespace WindBot.Game.AI.Decks
return true; return true;
} }
} }
bool 有水舞台 = Duel.Fields[0].HasInSpellZone((int)CardId.水舞台, true); bool 有水舞台 = Bot.HasInSpellZone((int)CardId.水舞台, true);
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.Id == (int)CardId.魔知青蛙 && !有水舞台) if (monster.Id == (int)CardId.魔知青蛙 && !有水舞台)
...@@ -334,8 +334,8 @@ namespace WindBot.Game.AI.Decks ...@@ -334,8 +334,8 @@ namespace WindBot.Game.AI.Decks
return true; return true;
} }
} }
monsters = (List<ClientCard>)Duel.Fields[0].Hand; monsters = (List<ClientCard>)Bot.Hand;
bool 手里有2个史莱姆 = Duel.Fields[0].GetCountCardInZone(Duel.Fields[0].Hand, (int)CardId.小灰篮史莱姆) >= 2; bool 手里有2个史莱姆 = Bot.GetCountCardInZone(Bot.Hand, (int)CardId.小灰篮史莱姆) >= 2;
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.Id == (int)CardId.小灰篮史莱姆 && 手里有2个史莱姆) if (monster.Id == (int)CardId.小灰篮史莱姆 && 手里有2个史莱姆)
...@@ -344,7 +344,7 @@ namespace WindBot.Game.AI.Decks ...@@ -344,7 +344,7 @@ namespace WindBot.Game.AI.Decks
return true; return true;
} }
} }
bool 需要丢魔知 = Duel.Fields[0].HasInGraveyard((int)CardId.粹蛙) && !Duel.Fields[0].HasInGraveyard((int)CardId.魔知青蛙) && !Duel.Fields[0].HasInGraveyard((int)CardId.鬼青蛙); bool 需要丢魔知 = Bot.HasInGraveyard((int)CardId.粹蛙) && !Bot.HasInGraveyard((int)CardId.魔知青蛙) && !Bot.HasInGraveyard((int)CardId.鬼青蛙);
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.Id == (int)CardId.魔知青蛙 && 需要丢魔知) if (monster.Id == (int)CardId.魔知青蛙 && 需要丢魔知)
...@@ -370,7 +370,7 @@ namespace WindBot.Game.AI.Decks ...@@ -370,7 +370,7 @@ namespace WindBot.Game.AI.Decks
} }
else if (Card.Location == CardLocation.Grave) else if (Card.Location == CardLocation.Grave)
{ {
if (!Duel.Fields[0].HasInExtra((int)CardId.饼蛙)) if (!Bot.HasInExtra((int)CardId.饼蛙))
{ {
AI.SelectCard((int)CardId.饼蛙); AI.SelectCard((int)CardId.饼蛙);
} }
...@@ -420,14 +420,14 @@ namespace WindBot.Game.AI.Decks ...@@ -420,14 +420,14 @@ namespace WindBot.Game.AI.Decks
private bool 猫鲨特殊召唤() private bool 猫鲨特殊召唤()
{ {
bool should = Duel.Fields[0].HasInMonstersZone((int)CardId.饼蛙) bool should = Bot.HasInMonstersZone((int)CardId.饼蛙)
&& ((AI.Utils.IsEnemyBetter(true, false) && ((AI.Utils.IsEnemyBetter(true, false)
&& !Duel.Fields[0].HasInMonstersZone(new List<int> && !Bot.HasInMonstersZone(new List<int>
{ {
(int)CardId.猫鲨, (int)CardId.猫鲨,
(int)CardId.神骑矢车菊圣人马 (int)CardId.神骑矢车菊圣人马
}, true, true)) }, true, true))
|| !Duel.Fields[0].HasInExtra((int)CardId.饼蛙)); || !Bot.HasInExtra((int)CardId.饼蛙));
if (should) if (should)
{ {
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
...@@ -438,7 +438,7 @@ namespace WindBot.Game.AI.Decks ...@@ -438,7 +438,7 @@ namespace WindBot.Game.AI.Decks
private bool 猫鲨效果() private bool 猫鲨效果()
{ {
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.Id == (int)CardId.饼蛙 && monster.Attack <= 2200) if (monster.Id == (int)CardId.饼蛙 && monster.Attack <= 2200)
...@@ -472,7 +472,7 @@ namespace WindBot.Game.AI.Decks ...@@ -472,7 +472,7 @@ namespace WindBot.Game.AI.Decks
private bool 神骑矢车菊圣人马特殊召唤() private bool 神骑矢车菊圣人马特殊召唤()
{ {
int num = 0; int num = 0;
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.Level ==2) if (monster.Level ==2)
...@@ -481,9 +481,9 @@ namespace WindBot.Game.AI.Decks ...@@ -481,9 +481,9 @@ namespace WindBot.Game.AI.Decks
} }
} }
return AI.Utils.IsEnemyBetter(true, false) return AI.Utils.IsEnemyBetter(true, false)
&& AI.Utils.GetBestAttack(Duel.Fields[1], true) > 2200 && AI.Utils.GetBestAttack(Enemy, true) > 2200
&& num < 4 && num < 4
&& !Duel.Fields[0].HasInMonstersZone(new List<int> && !Bot.HasInMonstersZone(new List<int>
{ {
(int)CardId.神骑矢车菊圣人马 (int)CardId.神骑矢车菊圣人马
}, true, true); }, true, true);
...@@ -495,7 +495,7 @@ namespace WindBot.Game.AI.Decks ...@@ -495,7 +495,7 @@ namespace WindBot.Game.AI.Decks
{ {
int attack = 0; int attack = 0;
int defence = 0; int defence = 0;
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (!monster.IsDefense()) if (!monster.IsDefense())
...@@ -503,7 +503,7 @@ namespace WindBot.Game.AI.Decks ...@@ -503,7 +503,7 @@ namespace WindBot.Game.AI.Decks
attack += monster.Attack; attack += monster.Attack;
} }
} }
monsters = Duel.Fields[1].GetMonsters(); monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
defence += monster.GetDefensePower(); defence += monster.GetDefensePower();
...@@ -563,11 +563,11 @@ namespace WindBot.Game.AI.Decks ...@@ -563,11 +563,11 @@ namespace WindBot.Game.AI.Decks
private void 选择取除超量素材(List<int> Overlays) private void 选择取除超量素材(List<int> Overlays)
{ {
if (Overlays.Contains((int)CardId.小灰篮史莱姆) && Duel.Fields[0].HasInHand((int)CardId.小灰篮史莱姆) && !Duel.Fields[0].HasInGraveyard((int)CardId.小灰篮史莱姆)) if (Overlays.Contains((int)CardId.小灰篮史莱姆) && Bot.HasInHand((int)CardId.小灰篮史莱姆) && !Bot.HasInGraveyard((int)CardId.小灰篮史莱姆))
AI.SelectCard((int)CardId.小灰篮史莱姆); AI.SelectCard((int)CardId.小灰篮史莱姆);
else if (Overlays.Contains((int)CardId.魔知青蛙) && Duel.Fields[0].HasInGraveyard((int)CardId.粹蛙) && !Duel.Fields[0].HasInGraveyard((int)CardId.魔知青蛙)) else if (Overlays.Contains((int)CardId.魔知青蛙) && Bot.HasInGraveyard((int)CardId.粹蛙) && !Bot.HasInGraveyard((int)CardId.魔知青蛙))
AI.SelectCard((int)CardId.魔知青蛙); AI.SelectCard((int)CardId.魔知青蛙);
else if (Overlays.Contains((int)CardId.粹蛙) && Duel.Fields[0].HasInGraveyard((int)CardId.魔知青蛙) && !Duel.Fields[0].HasInGraveyard((int)CardId.粹蛙)) else if (Overlays.Contains((int)CardId.粹蛙) && Bot.HasInGraveyard((int)CardId.魔知青蛙) && !Bot.HasInGraveyard((int)CardId.粹蛙))
AI.SelectCard((int)CardId.粹蛙); AI.SelectCard((int)CardId.粹蛙);
else else
AI.SelectCard(new[] AI.SelectCard(new[]
......
...@@ -184,7 +184,7 @@ namespace WindBot.Game.AI.Decks ...@@ -184,7 +184,7 @@ namespace WindBot.Game.AI.Decks
} }
if (!(defender.Id == (int)CardId.闪光No39希望皇霍普电光皇)) if (!(defender.Id == (int)CardId.闪光No39希望皇霍普电光皇))
{ {
if (attacker.Attribute == (int)CardAttribute.Wind && Duel.Fields[0].HasInHand((int)CardId.妖仙兽辻斩风)) if (attacker.Attribute == (int)CardAttribute.Wind && Bot.HasInHand((int)CardId.妖仙兽辻斩风))
attacker.RealPower = attacker.RealPower + 1000; attacker.RealPower = attacker.RealPower + 1000;
if (attacker.Id == (int)CardId.闪光No39希望皇霍普电光皇 && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.No39希望皇霍普)) if (attacker.Id == (int)CardId.闪光No39希望皇霍普电光皇 && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.No39希望皇霍普))
attacker.RealPower = 5000; attacker.RealPower = 5000;
...@@ -269,7 +269,7 @@ namespace WindBot.Game.AI.Decks ...@@ -269,7 +269,7 @@ namespace WindBot.Game.AI.Decks
private bool 优先出重复的妖仙兽() private bool 优先出重复的妖仙兽()
{ {
foreach (ClientCard card in Duel.Fields[0].Hand) foreach (ClientCard card in Bot.Hand)
{ {
if (card != null && !card.Equals(Card) && card.Id == Card.Id) if (card != null && !card.Equals(Card) && card.Id == Card.Id)
return true; return true;
...@@ -279,7 +279,7 @@ namespace WindBot.Game.AI.Decks ...@@ -279,7 +279,7 @@ namespace WindBot.Game.AI.Decks
private bool 优先盖不重复的坑() private bool 优先盖不重复的坑()
{ {
foreach (ClientCard card in Duel.Fields[0].SpellZone) foreach (ClientCard card in Bot.SpellZone)
{ {
if (card != null && card.Id == Card.Id) if (card != null && card.Id == Card.Id)
return false; return false;
...@@ -289,7 +289,7 @@ namespace WindBot.Game.AI.Decks ...@@ -289,7 +289,7 @@ namespace WindBot.Game.AI.Decks
private bool 魔陷区有空余格子() private bool 魔陷区有空余格子()
{ {
return Duel.Fields[0].GetSpellCountWithoutField() < 4; return Bot.GetSpellCountWithoutField() < 4;
} }
private bool 已发动过削命() private bool 已发动过削命()
...@@ -320,7 +320,7 @@ namespace WindBot.Game.AI.Decks ...@@ -320,7 +320,7 @@ namespace WindBot.Game.AI.Decks
private bool 我我我枪手特殊召唤() private bool 我我我枪手特殊召唤()
{ {
if (Duel.LifePoints[1] <= 800 || (Duel.Fields[0].GetMonsterCount()>=4 && Duel.LifePoints[1] <= 1600)) if (Duel.LifePoints[1] <= 800 || (Bot.GetMonsterCount()>=4 && Duel.LifePoints[1] <= 1600))
{ {
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
return true; return true;
...@@ -330,28 +330,28 @@ namespace WindBot.Game.AI.Decks ...@@ -330,28 +330,28 @@ namespace WindBot.Game.AI.Decks
private bool 励辉士入魔蝇王特殊召唤() private bool 励辉士入魔蝇王特殊召唤()
{ {
int selfCount = Duel.Fields[0].GetMonsterCount() + Duel.Fields[0].GetSpellCount() + Duel.Fields[0].GetHandCount(); int selfCount = Bot.GetMonsterCount() + Bot.GetSpellCount() + Bot.GetHandCount();
int oppoCount = Duel.Fields[1].GetMonsterCount() + Duel.Fields[1].GetSpellCount() + Duel.Fields[1].GetHandCount(); int oppoCount = Enemy.GetMonsterCount() + Enemy.GetSpellCount() + Enemy.GetHandCount();
return (selfCount - 1 < oppoCount) && 励辉士入魔蝇王效果(); return (selfCount - 1 < oppoCount) && 励辉士入魔蝇王效果();
} }
private bool 励辉士入魔蝇王效果() private bool 励辉士入魔蝇王效果()
{ {
int selfCount = Duel.Fields[0].GetMonsterCount() + Duel.Fields[0].GetSpellCount(); int selfCount = Bot.GetMonsterCount() + Bot.GetSpellCount();
int oppoCount = Duel.Fields[1].GetMonsterCount() + Duel.Fields[1].GetSpellCount(); int oppoCount = Enemy.GetMonsterCount() + Enemy.GetSpellCount();
return selfCount < oppoCount; return selfCount < oppoCount;
} }
private bool 暗叛逆超量龙特殊召唤() private bool 暗叛逆超量龙特殊召唤()
{ {
int selfBestAttack = AI.Utils.GetBestAttack(Duel.Fields[0], true); int selfBestAttack = AI.Utils.GetBestAttack(Bot, true);
int oppoBestAttack = AI.Utils.GetBestAttack(Duel.Fields[1], true); int oppoBestAttack = AI.Utils.GetBestAttack(Enemy, true);
return selfBestAttack <= oppoBestAttack; return selfBestAttack <= oppoBestAttack;
} }
private bool 暗叛逆超量龙效果() private bool 暗叛逆超量龙效果()
{ {
int oppoBestAttack = AI.Utils.GetBestAttack(Duel.Fields[1], true); int oppoBestAttack = AI.Utils.GetBestAttack(Enemy, true);
ClientCard target = AI.Utils.GetOneEnemyBetterThanValue(oppoBestAttack, true); ClientCard target = AI.Utils.GetOneEnemyBetterThanValue(oppoBestAttack, true);
if (target != null) if (target != null)
{ {
...@@ -362,8 +362,8 @@ namespace WindBot.Game.AI.Decks ...@@ -362,8 +362,8 @@ namespace WindBot.Game.AI.Decks
private bool 电光皇特殊召唤() private bool 电光皇特殊召唤()
{ {
int selfBestAttack = AI.Utils.GetBestAttack(Duel.Fields[0], true); int selfBestAttack = AI.Utils.GetBestAttack(Bot, true);
int oppoBestAttack = AI.Utils.GetBestAttack(Duel.Fields[1], false); int oppoBestAttack = AI.Utils.GetBestAttack(Enemy, false);
return selfBestAttack <= oppoBestAttack; return selfBestAttack <= oppoBestAttack;
} }
......
...@@ -134,7 +134,7 @@ namespace DevBot.Game.AI.Decks ...@@ -134,7 +134,7 @@ namespace DevBot.Game.AI.Decks
} }
if (!(defender.Id == (int)CardId.NumberS39UtopiatheLightning)) if (!(defender.Id == (int)CardId.NumberS39UtopiatheLightning))
{ {
if (attacker.Attribute == (int)CardAttribute.Light && Duel.Fields[0].HasInHand((int)CardId.Honest)) if (attacker.Attribute == (int)CardAttribute.Light && Bot.HasInHand((int)CardId.Honest))
attacker.RealPower = attacker.RealPower + defender.Attack; attacker.RealPower = attacker.RealPower + defender.Attack;
if (attacker.Id == (int)CardId.NumberS39UtopiatheLightning && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.Number39Utopia)) if (attacker.Id == (int)CardId.NumberS39UtopiatheLightning && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.Number39Utopia))
attacker.RealPower = 5000; attacker.RealPower = 5000;
...@@ -180,7 +180,7 @@ namespace DevBot.Game.AI.Decks ...@@ -180,7 +180,7 @@ namespace DevBot.Game.AI.Decks
{ {
if (Duel.LifePoints[0] <= 1000) if (Duel.LifePoints[0] <= 1000)
return false; return false;
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); 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 monsters)
...@@ -220,7 +220,7 @@ namespace DevBot.Game.AI.Decks ...@@ -220,7 +220,7 @@ namespace DevBot.Game.AI.Decks
private bool GoblindberghFirst() private bool GoblindberghFirst()
{ {
IList<ClientCard> hand = Duel.Fields[0].Hand; IList<ClientCard> hand = Bot.Hand;
foreach (ClientCard card in hand) foreach (ClientCard card in hand)
{ {
if (card != Card && card.IsMonster() && card.Level == 4) if (card != Card && card.IsMonster() && card.Level == 4)
...@@ -243,8 +243,8 @@ namespace DevBot.Game.AI.Decks ...@@ -243,8 +243,8 @@ namespace DevBot.Game.AI.Decks
private bool SummonerMonkEffect() private bool SummonerMonkEffect()
{ {
if (Duel.Fields[0].HasInHand((int)CardId.InstantFusion) || if (Bot.HasInHand((int)CardId.InstantFusion) ||
Duel.Fields[0].HasInHand((int)CardId.MysticalSpaceTyphoon)) Bot.HasInHand((int)CardId.MysticalSpaceTyphoon))
{ {
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
...@@ -266,7 +266,7 @@ namespace DevBot.Game.AI.Decks ...@@ -266,7 +266,7 @@ namespace DevBot.Game.AI.Decks
private bool SolarWindJammer() private bool SolarWindJammer()
{ {
if (!Duel.Fields[0].HasInHand(new List<int> { if (!Bot.HasInHand(new List<int> {
(int)CardId.StarDrawing, (int)CardId.StarDrawing,
(int)CardId.InstantFusion (int)CardId.InstantFusion
})) }))
......
...@@ -142,7 +142,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -142,7 +142,7 @@ namespace MycardBot.Game.AI.Decks
} }
if (!(defender.Id == (int)CardId.闪光No39希望皇霍普电光皇)) if (!(defender.Id == (int)CardId.闪光No39希望皇霍普电光皇))
{ {
//if (attacker.HasType(CardType.Fusion) && Duel.Fields[0].HasInHand((int)CardId.召唤师阿莱斯特)) //if (attacker.HasType(CardType.Fusion) && Bot.HasInHand((int)CardId.召唤师阿莱斯特))
// attacker.RealPower = attacker.RealPower + 1000; // attacker.RealPower = attacker.RealPower + 1000;
if (attacker.Id == (int)CardId.闪光No39希望皇霍普电光皇 && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.No39希望皇霍普)) if (attacker.Id == (int)CardId.闪光No39希望皇霍普电光皇 && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.No39希望皇霍普))
attacker.RealPower = 5000; attacker.RealPower = 5000;
...@@ -192,18 +192,18 @@ namespace MycardBot.Game.AI.Decks ...@@ -192,18 +192,18 @@ namespace MycardBot.Game.AI.Decks
(int)CardId.怒炎坏兽多哥兰, (int)CardId.怒炎坏兽多哥兰,
(int)CardId.对坏兽用决战兵器超级机械多哥兰 (int)CardId.对坏兽用决战兵器超级机械多哥兰
}; };
foreach (ClientCard monster in Duel.Fields[1].GetMonsters()) foreach (ClientCard monster in Enemy.GetMonsters())
{ {
if (kaijus.Contains(monster.Id)) if (kaijus.Contains(monster.Id))
return Card.GetDefensePower() > monster.GetDefensePower(); return Card.GetDefensePower() > monster.GetDefensePower();
} }
ClientCard card = Duel.Fields[1].MonsterZone.GetFloodgate(); ClientCard card = Enemy.MonsterZone.GetFloodgate();
if (card != null) if (card != null)
{ {
AI.SelectCard(card); AI.SelectCard(card);
return true; return true;
} }
card = Duel.Fields[1].MonsterZone.GetDangerousMonster(); card = Enemy.MonsterZone.GetDangerousMonster();
if (card != null) if (card != null)
{ {
AI.SelectCard(card); AI.SelectCard(card);
...@@ -220,16 +220,16 @@ namespace MycardBot.Game.AI.Decks ...@@ -220,16 +220,16 @@ namespace MycardBot.Game.AI.Decks
private bool 电光皇特殊召唤() private bool 电光皇特殊召唤()
{ {
int selfBestAttack = AI.Utils.GetBestAttack(Duel.Fields[0], true); int selfBestAttack = AI.Utils.GetBestAttack(Bot, true);
int oppoBestAttack = AI.Utils.GetBestAttack(Duel.Fields[1], false); int oppoBestAttack = AI.Utils.GetBestAttack(Enemy, false);
return selfBestAttack < oppoBestAttack; return selfBestAttack < oppoBestAttack;
} }
private bool 光子斩击者特殊召唤() private bool 光子斩击者特殊召唤()
{ {
return Duel.Fields[0].HasInHand((int)CardId.召唤师阿莱斯特) return Bot.HasInHand((int)CardId.召唤师阿莱斯特)
&& !Duel.Fields[0].HasInHand((int)CardId.十二兽鼠骑) && !Bot.HasInHand((int)CardId.十二兽鼠骑)
&& !Duel.Fields[0].HasInHand((int)CardId.十二兽马剑); && !Bot.HasInHand((int)CardId.十二兽马剑);
} }
private bool 召唤师阿莱斯特效果() private bool 召唤师阿莱斯特效果()
...@@ -250,8 +250,8 @@ namespace MycardBot.Game.AI.Decks ...@@ -250,8 +250,8 @@ namespace MycardBot.Game.AI.Decks
{ {
if (Card.Location == CardLocation.Grave) if (Card.Location == CardLocation.Grave)
return true; return true;
IList<ClientCard> materials0 = Duel.Fields[0].Graveyard; IList<ClientCard> materials0 = Bot.Graveyard;
IList<ClientCard> materials1 = Duel.Fields[1].Graveyard; IList<ClientCard> materials1 = Enemy.Graveyard;
ClientCard mat = null; ClientCard mat = null;
foreach (ClientCard card in materials0) foreach (ClientCard card in materials0)
{ {
...@@ -306,8 +306,8 @@ namespace MycardBot.Game.AI.Decks ...@@ -306,8 +306,8 @@ namespace MycardBot.Game.AI.Decks
private void 选择墓地里的召唤师() private void 选择墓地里的召唤师()
{ {
IList<ClientCard> materials0 = Duel.Fields[0].Graveyard; IList<ClientCard> materials0 = Bot.Graveyard;
IList<ClientCard> materials1 = Duel.Fields[1].Graveyard; IList<ClientCard> materials1 = Enemy.Graveyard;
foreach (ClientCard card in materials1) foreach (ClientCard card in materials1)
{ {
if (card.Id == (int)CardId.召唤师阿莱斯特) if (card.Id == (int)CardId.召唤师阿莱斯特)
...@@ -329,7 +329,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -329,7 +329,7 @@ namespace MycardBot.Game.AI.Decks
private bool 十二兽狗环特殊召唤() private bool 十二兽狗环特殊召唤()
{ {
if (Duel.Fields[0].HasInMonstersZone((int)CardId.十二兽鼠骑) && !已特殊召唤狗环) if (Bot.HasInMonstersZone((int)CardId.十二兽鼠骑) && !已特殊召唤狗环)
{ {
AI.SelectCard((int)CardId.十二兽鼠骑); AI.SelectCard((int)CardId.十二兽鼠骑);
AI.SelectYesNo(true); AI.SelectYesNo(true);
...@@ -337,7 +337,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -337,7 +337,7 @@ namespace MycardBot.Game.AI.Decks
已特殊召唤狗环 = true; 已特殊召唤狗环 = true;
return true; return true;
} }
if (Duel.Fields[0].HasInMonstersZone((int)CardId.十二兽牛犄) && !已特殊召唤狗环) if (Bot.HasInMonstersZone((int)CardId.十二兽牛犄) && !已特殊召唤狗环)
{ {
AI.SelectCard((int)CardId.十二兽牛犄); AI.SelectCard((int)CardId.十二兽牛犄);
AI.SelectYesNo(true); AI.SelectYesNo(true);
...@@ -350,7 +350,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -350,7 +350,7 @@ namespace MycardBot.Game.AI.Decks
private bool 十二兽狗环效果() private bool 十二兽狗环效果()
{ {
if (Duel.Fields[0].HasInGraveyard((int)CardId.十二兽蛇笞) || Duel.Fields[0].HasInGraveyard((int)CardId.十二兽马剑)) if (Bot.HasInGraveyard((int)CardId.十二兽蛇笞) || Bot.HasInGraveyard((int)CardId.十二兽马剑))
{ {
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
...@@ -373,7 +373,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -373,7 +373,7 @@ namespace MycardBot.Game.AI.Decks
private bool 十二兽虎炮特殊召唤() private bool 十二兽虎炮特殊召唤()
{ {
if (Duel.Fields[0].HasInMonstersZone((int)CardId.十二兽狗环) && !已特殊召唤虎炮) if (Bot.HasInMonstersZone((int)CardId.十二兽狗环) && !已特殊召唤虎炮)
{ {
AI.SelectCard((int)CardId.十二兽狗环); AI.SelectCard((int)CardId.十二兽狗环);
AI.SelectYesNo(true); AI.SelectYesNo(true);
...@@ -381,7 +381,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -381,7 +381,7 @@ namespace MycardBot.Game.AI.Decks
已特殊召唤虎炮 = true; 已特殊召唤虎炮 = true;
return true; return true;
} }
if (Duel.Fields[0].HasInMonstersZone((int)CardId.十二兽鼠骑) && !已特殊召唤虎炮) if (Bot.HasInMonstersZone((int)CardId.十二兽鼠骑) && !已特殊召唤虎炮)
{ {
AI.SelectCard((int)CardId.十二兽鼠骑); AI.SelectCard((int)CardId.十二兽鼠骑);
AI.SelectYesNo(true); AI.SelectYesNo(true);
...@@ -389,8 +389,8 @@ namespace MycardBot.Game.AI.Decks ...@@ -389,8 +389,8 @@ namespace MycardBot.Game.AI.Decks
已特殊召唤虎炮 = true; 已特殊召唤虎炮 = true;
return true; return true;
} }
if (Duel.Fields[0].HasInMonstersZone((int)CardId.十二兽马剑) && !已特殊召唤虎炮 if (Bot.HasInMonstersZone((int)CardId.十二兽马剑) && !已特殊召唤虎炮
&& Duel.Fields[0].HasInGraveyard(new List<int> && Bot.HasInGraveyard(new List<int>
{ {
(int)CardId.十二兽蛇笞, (int)CardId.十二兽蛇笞,
(int)CardId.十二兽鼠骑 (int)CardId.十二兽鼠骑
...@@ -401,8 +401,8 @@ namespace MycardBot.Game.AI.Decks ...@@ -401,8 +401,8 @@ namespace MycardBot.Game.AI.Decks
已特殊召唤虎炮 = true; 已特殊召唤虎炮 = true;
return true; return true;
} }
if (Duel.Fields[0].HasInMonstersZone((int)CardId.十二兽蛇笞) && !已特殊召唤虎炮 if (Bot.HasInMonstersZone((int)CardId.十二兽蛇笞) && !已特殊召唤虎炮
&& Duel.Fields[0].HasInGraveyard((int)CardId.十二兽鼠骑)) && Bot.HasInGraveyard((int)CardId.十二兽鼠骑))
{ {
AI.SelectCard((int)CardId.十二兽蛇笞); AI.SelectCard((int)CardId.十二兽蛇笞);
AI.SelectYesNo(true); AI.SelectYesNo(true);
...@@ -414,7 +414,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -414,7 +414,7 @@ namespace MycardBot.Game.AI.Decks
private bool 十二兽虎炮效果() private bool 十二兽虎炮效果()
{ {
//if (Card.HasXyzMaterial((int)CardId.十二兽鼠骑) || !Duel.Fields[0].HasInGraveyard((int)CardId.十二兽鼠骑)) //if (Card.HasXyzMaterial((int)CardId.十二兽鼠骑) || !Bot.HasInGraveyard((int)CardId.十二兽鼠骑))
// return false; // return false;
AI.SelectCard((int)CardId.十二兽狗环); AI.SelectCard((int)CardId.十二兽狗环);
AI.SelectNextCard((int)CardId.十二兽虎炮); AI.SelectNextCard((int)CardId.十二兽虎炮);
...@@ -429,7 +429,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -429,7 +429,7 @@ namespace MycardBot.Game.AI.Decks
private bool 十二兽牛犄特殊召唤() private bool 十二兽牛犄特殊召唤()
{ {
if (Duel.Fields[0].HasInMonstersZone((int)CardId.十二兽虎炮) && !已特殊召唤牛犄) if (Bot.HasInMonstersZone((int)CardId.十二兽虎炮) && !已特殊召唤牛犄)
{ {
AI.SelectCard((int)CardId.十二兽虎炮); AI.SelectCard((int)CardId.十二兽虎炮);
AI.SelectYesNo(true); AI.SelectYesNo(true);
...@@ -437,7 +437,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -437,7 +437,7 @@ namespace MycardBot.Game.AI.Decks
已特殊召唤牛犄 = true; 已特殊召唤牛犄 = true;
return true; return true;
} }
if (Duel.Fields[0].HasInMonstersZone((int)CardId.十二兽狗环) && !已特殊召唤牛犄) if (Bot.HasInMonstersZone((int)CardId.十二兽狗环) && !已特殊召唤牛犄)
{ {
AI.SelectCard((int)CardId.十二兽狗环); AI.SelectCard((int)CardId.十二兽狗环);
AI.SelectYesNo(true); AI.SelectYesNo(true);
...@@ -445,7 +445,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -445,7 +445,7 @@ namespace MycardBot.Game.AI.Decks
已特殊召唤牛犄 = true; 已特殊召唤牛犄 = true;
return true; return true;
} }
if (Duel.Fields[0].HasInMonstersZone((int)CardId.十二兽鼠骑) && !已特殊召唤牛犄) if (Bot.HasInMonstersZone((int)CardId.十二兽鼠骑) && !已特殊召唤牛犄)
{ {
AI.SelectCard((int)CardId.十二兽鼠骑); AI.SelectCard((int)CardId.十二兽鼠骑);
AI.SelectYesNo(true); AI.SelectYesNo(true);
...@@ -453,7 +453,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -453,7 +453,7 @@ namespace MycardBot.Game.AI.Decks
已特殊召唤牛犄 = true; 已特殊召唤牛犄 = true;
return true; return true;
} }
if (Duel.Fields[0].HasInMonstersZone((int)CardId.十二兽马剑) && !已特殊召唤牛犄) if (Bot.HasInMonstersZone((int)CardId.十二兽马剑) && !已特殊召唤牛犄)
{ {
AI.SelectCard((int)CardId.十二兽马剑); AI.SelectCard((int)CardId.十二兽马剑);
AI.SelectYesNo(true); AI.SelectYesNo(true);
...@@ -474,7 +474,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -474,7 +474,7 @@ namespace MycardBot.Game.AI.Decks
(int)CardId.召唤师阿莱斯特, (int)CardId.召唤师阿莱斯特,
(int)CardId.光子斩击者 (int)CardId.光子斩击者
}); });
if (Duel.Fields[0].HasInHand((int)CardId.十二兽蛇笞) && !Duel.Fields[0].HasInHand((int)CardId.十二兽鼠骑)) if (Bot.HasInHand((int)CardId.十二兽蛇笞) && !Bot.HasInHand((int)CardId.十二兽鼠骑))
AI.SelectNextCard((int)CardId.十二兽鼠骑); AI.SelectNextCard((int)CardId.十二兽鼠骑);
else else
AI.SelectNextCard((int)CardId.十二兽蛇笞); AI.SelectNextCard((int)CardId.十二兽蛇笞);
...@@ -524,7 +524,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -524,7 +524,7 @@ namespace MycardBot.Game.AI.Decks
if (Card.IsDisabled() || 蛇笞发动次数 >= 3) if (Card.IsDisabled() || 蛇笞发动次数 >= 3)
return false; return false;
ClientCard target = null; ClientCard target = null;
List<ClientCard> monsters = Duel.Fields[0].GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.IsFaceup() && monster.Id == (int)CardId.十二兽龙枪 && !monster.HasXyzMaterial()) if (monster.IsFaceup() && monster.Id == (int)CardId.十二兽龙枪 && !monster.HasXyzMaterial())
...@@ -573,7 +573,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -573,7 +573,7 @@ namespace MycardBot.Game.AI.Decks
ClientCard target = AI.Utils.GetProblematicCard(); ClientCard target = AI.Utils.GetProblematicCard();
if (target == null) if (target == null)
{ {
List<ClientCard> monsters = Duel.Fields[1].GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.IsFaceup()) if (monster.IsFaceup())
...@@ -585,7 +585,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -585,7 +585,7 @@ namespace MycardBot.Game.AI.Decks
} }
if (target == null) if (target == null)
{ {
List<ClientCard> spells = Duel.Fields[1].GetSpells(); List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells) foreach (ClientCard spell in spells)
{ {
if (spell.IsFaceup() && spell.IsSpellNegateAttack()) if (spell.IsFaceup() && spell.IsSpellNegateAttack())
...@@ -597,7 +597,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -597,7 +597,7 @@ namespace MycardBot.Game.AI.Decks
} }
if (target == null) if (target == null)
{ {
List<ClientCard> spells = Duel.Fields[1].GetSpells(); List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells) foreach (ClientCard spell in spells)
{ {
if (spell.IsFaceup() && (spell.HasType(CardType.Continuous) if (spell.IsFaceup() && (spell.HasType(CardType.Continuous)
...@@ -627,7 +627,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -627,7 +627,7 @@ namespace MycardBot.Game.AI.Decks
private bool 大薰风骑士翠玉特殊召唤() private bool 大薰风骑士翠玉特殊召唤()
{ {
return Duel.Fields[0].GetGraveyardMonsters().Count >= 3; return Bot.GetGraveyardMonsters().Count >= 3;
} }
private bool 大薰风骑士翠玉效果() private bool 大薰风骑士翠玉效果()
...@@ -648,9 +648,9 @@ namespace MycardBot.Game.AI.Decks ...@@ -648,9 +648,9 @@ namespace MycardBot.Game.AI.Decks
private bool 炎舞天玑效果() private bool 炎舞天玑效果()
{ {
if (Duel.Fields[0].HasInHand((int)CardId.十二兽的会局) if (Bot.HasInHand((int)CardId.十二兽的会局)
|| Duel.Fields[0].HasInSpellZone((int)CardId.十二兽的会局) || Bot.HasInSpellZone((int)CardId.十二兽的会局)
|| Duel.Fields[0].HasInHand((int)CardId.十二兽鼠骑)) || Bot.HasInHand((int)CardId.十二兽鼠骑))
{ {
AI.SelectCard((int)CardId.十二兽蛇笞); AI.SelectCard((int)CardId.十二兽蛇笞);
} }
...@@ -664,7 +664,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -664,7 +664,7 @@ namespace MycardBot.Game.AI.Decks
private bool 十二兽的会局效果() private bool 十二兽的会局效果()
{ {
IList<ClientCard> spells = Duel.Fields[0].GetSpells(); IList<ClientCard> spells = Bot.GetSpells();
foreach (ClientCard spell in spells) foreach (ClientCard spell in spells)
{ {
if (spell.Id == (int)CardId.十二兽的会局 && !Card.Equals(spell)) if (spell.Id == (int)CardId.十二兽的会局 && !Card.Equals(spell))
......
...@@ -29,11 +29,11 @@ namespace WindBot.Game.AI ...@@ -29,11 +29,11 @@ namespace WindBot.Game.AI
protected bool DefaultStampingDestruction() protected bool DefaultStampingDestruction()
{ {
List<ClientCard> spells = Duel.Fields[1].GetSpells(); List<ClientCard> spells = Enemy.GetSpells();
if (spells.Count == 0) if (spells.Count == 0)
return false; return false;
ClientCard selected = Duel.Fields[1].SpellZone.GetFloodgate(); ClientCard selected = Enemy.SpellZone.GetFloodgate();
if (selected == null) if (selected == null)
{ {
...@@ -55,14 +55,14 @@ namespace WindBot.Game.AI ...@@ -55,14 +55,14 @@ namespace WindBot.Game.AI
protected bool DefaultGalaxyCyclone() protected bool DefaultGalaxyCyclone()
{ {
List<ClientCard> spells = Duel.Fields[1].GetSpells(); List<ClientCard> spells = Enemy.GetSpells();
if (spells.Count == 0) if (spells.Count == 0)
return false; return false;
ClientCard selected = null; ClientCard selected = null;
if (Card.Location == CardLocation.Grave) if (Card.Location == CardLocation.Grave)
{ {
selected = Duel.Fields[1].SpellZone.GetFloodgate(); selected = Enemy.SpellZone.GetFloodgate();
if (selected == null) if (selected == null)
{ {
foreach (ClientCard card in spells) foreach (ClientCard card in spells)
...@@ -98,7 +98,7 @@ namespace WindBot.Game.AI ...@@ -98,7 +98,7 @@ namespace WindBot.Game.AI
{ {
if (AI.Utils.IsEnemyBetter(true, true)) if (AI.Utils.IsEnemyBetter(true, true))
{ {
ClientCard monster = Duel.Fields[1].GetMonsters().GetHighestAttackMonster(); ClientCard monster = Enemy.GetMonsters().GetHighestAttackMonster();
if (monster != null && monster.HasType(CardType.Effect) && (monster.HasType(CardType.Xyz) || monster.Level > 4)) if (monster != null && monster.HasType(CardType.Effect) && (monster.HasType(CardType.Xyz) || monster.Level > 4))
{ {
AI.SelectCard(monster); AI.SelectCard(monster);
...@@ -120,7 +120,7 @@ namespace WindBot.Game.AI ...@@ -120,7 +120,7 @@ namespace WindBot.Game.AI
{ {
if (Card.Equals(card)) if (Card.Equals(card))
{ {
List<ClientCard> monsters = Duel.Fields[1].GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
AI.SelectCard(monster); AI.SelectCard(monster);
...@@ -137,7 +137,7 @@ namespace WindBot.Game.AI ...@@ -137,7 +137,7 @@ namespace WindBot.Game.AI
return false; return false;
ClientCard selected = null; ClientCard selected = null;
int BestAtk = 0; int BestAtk = 0;
foreach (ClientCard card in Duel.Fields[0].Graveyard) foreach (ClientCard card in Bot.Graveyard)
{ {
if (card.Attack > BestAtk) if (card.Attack > BestAtk)
{ {
...@@ -156,7 +156,7 @@ namespace WindBot.Game.AI ...@@ -156,7 +156,7 @@ namespace WindBot.Game.AI
protected bool DefaultHeavyStorm() protected bool DefaultHeavyStorm()
{ {
return Duel.Fields[0].GetSpellCount() < Duel.Fields[1].GetSpellCount(); return Bot.GetSpellCount() < Enemy.GetSpellCount();
} }
protected bool DefaultHammerShot() protected bool DefaultHammerShot()
...@@ -176,12 +176,12 @@ namespace WindBot.Game.AI ...@@ -176,12 +176,12 @@ namespace WindBot.Game.AI
protected bool DefaultSpellSet() protected bool DefaultSpellSet()
{ {
return Card.IsTrap() && Duel.Fields[0].GetSpellCountWithoutField() < 4; return Card.IsTrap() && Bot.GetSpellCountWithoutField() < 4;
} }
protected bool DefaultTributeSummon() protected bool DefaultTributeSummon()
{ {
foreach (ClientCard card in Duel.Fields[0].SpellZone) foreach (ClientCard card in Bot.SpellZone)
{ {
if (card != null && if (card != null &&
card.Id == Card.Id && card.Id == Card.Id &&
...@@ -191,7 +191,7 @@ namespace WindBot.Game.AI ...@@ -191,7 +191,7 @@ namespace WindBot.Game.AI
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)
{ {
ClientCard tributeCard = Duel.Fields[0].MonsterZone[j]; ClientCard tributeCard = Bot.MonsterZone[j];
if (tributeCard == null) continue; if (tributeCard == null) continue;
if (tributeCard.Attack < Card.Attack) if (tributeCard.Attack < Card.Attack)
tributecount--; tributecount--;
...@@ -201,7 +201,7 @@ namespace WindBot.Game.AI ...@@ -201,7 +201,7 @@ namespace WindBot.Game.AI
protected bool DefaultField() protected bool DefaultField()
{ {
return Duel.Fields[0].SpellZone[5] == null; return Bot.SpellZone[5] == null;
} }
protected bool DefaultMonsterRepos() protected bool DefaultMonsterRepos()
...@@ -225,7 +225,7 @@ namespace WindBot.Game.AI ...@@ -225,7 +225,7 @@ namespace WindBot.Game.AI
if (HasChainedTrap(0)) if (HasChainedTrap(0))
return false; return false;
foreach (ClientCard card in Duel.Fields[0].SpellZone) foreach (ClientCard card in Bot.SpellZone)
{ {
if (card != null && if (card != null &&
card.Id == Card.Id && card.Id == Card.Id &&
...@@ -257,7 +257,7 @@ namespace WindBot.Game.AI ...@@ -257,7 +257,7 @@ namespace WindBot.Game.AI
{ {
if (Duel.Player != 0) if (Duel.Player != 0)
{ {
List<ClientCard> monsters = Duel.Fields[1].GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
int[] levels = new int[13]; int[] levels = new int[13];
bool tuner = false; bool tuner = false;
bool nontuner = false; bool nontuner = false;
...@@ -287,8 +287,8 @@ namespace WindBot.Game.AI ...@@ -287,8 +287,8 @@ namespace WindBot.Game.AI
return true; return true;
} }
} }
ClientCard l = Duel.Fields[1].SpellZone[6]; ClientCard l = Enemy.SpellZone[6];
ClientCard r = Duel.Fields[1].SpellZone[7]; ClientCard r = Enemy.SpellZone[7];
if (l != null && r != null && l.LScale != r.RScale) if (l != null && r != null && l.LScale != r.RScale)
{ {
AI.SelectOption(4); AI.SelectOption(4);
......
...@@ -21,6 +21,9 @@ namespace WindBot.Game.AI ...@@ -21,6 +21,9 @@ namespace WindBot.Game.AI
protected int LastChainPlayer { get; private set; } protected int LastChainPlayer { get; private set; }
protected IList<ClientCard> CurrentChain { get; private set; } protected IList<ClientCard> CurrentChain { get; private set; }
public ClientField Bot { get; private set; }
public ClientField Enemy { get; private set; }
protected Executor(GameAI ai, Duel duel) protected Executor(GameAI ai, Duel duel)
{ {
Duel = duel; Duel = duel;
...@@ -29,6 +32,9 @@ namespace WindBot.Game.AI ...@@ -29,6 +32,9 @@ namespace WindBot.Game.AI
LastChainPlayer = -1; LastChainPlayer = -1;
CurrentChain = new List<ClientCard>(); CurrentChain = new List<ClientCard>();
Bot = Duel.Fields[0];
Enemy = Duel.Fields[1];
} }
public virtual bool OnSelectHand() public virtual bool OnSelectHand()
......
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