Commit ddbdbd85 authored by mercury233's avatar mercury233

ennemy -> enemy

parent 811e3d61
...@@ -46,14 +46,14 @@ namespace WindBot.Game.AI ...@@ -46,14 +46,14 @@ namespace WindBot.Game.AI
ClientCard card = field.MonsterZone[i]; ClientCard card = field.MonsterZone[i];
if (card == null) continue; if (card == null) continue;
if (onlyatk && card.IsDefense()) continue; if (onlyatk && card.IsDefense()) continue;
int ennemyValue = card.GetDefensePower(); int enemyValue = card.GetDefensePower();
if (ennemyValue > bestAtk) if (enemyValue > bestAtk)
bestAtk = ennemyValue; bestAtk = enemyValue;
} }
return bestAtk; return bestAtk;
} }
public bool IsEnnemyBetter(bool onlyatk, bool all) public bool IsEnemyBetter(bool onlyatk, bool all)
{ {
if (Duel.Fields[1].GetMonsterCount() == 0) if (Duel.Fields[1].GetMonsterCount() == 0)
return false; return false;
...@@ -63,11 +63,11 @@ namespace WindBot.Game.AI ...@@ -63,11 +63,11 @@ namespace WindBot.Game.AI
if (monsters.Count > 0) if (monsters.Count > 0)
bestAtk = monsters[monsters.Count - 1].Attack; bestAtk = monsters[monsters.Count - 1].Attack;
if (all) if (all)
return IsAllEnnemyBetterThanValue(bestAtk, onlyatk); return IsAllEnemyBetterThanValue(bestAtk, onlyatk);
return IsOneEnnemyBetterThanValue(bestAtk, onlyatk); return IsOneEnemyBetterThanValue(bestAtk, onlyatk);
} }
public bool IsOneEnnemyBetterThanValue(int value, bool onlyatk) public bool IsOneEnemyBetterThanValue(int value, bool onlyatk)
{ {
int bestValue = -1; int bestValue = -1;
bool nomonster = true; bool nomonster = true;
...@@ -77,15 +77,15 @@ namespace WindBot.Game.AI ...@@ -77,15 +77,15 @@ namespace WindBot.Game.AI
if (card == null) continue; if (card == null) continue;
if (onlyatk && card.IsDefense()) continue; if (onlyatk && card.IsDefense()) continue;
nomonster = false; nomonster = false;
int ennemyValue = card.GetDefensePower(); int enemyValue = card.GetDefensePower();
if (ennemyValue > bestValue) if (enemyValue > bestValue)
bestValue = ennemyValue; bestValue = enemyValue;
} }
if (nomonster) return false; if (nomonster) return false;
return bestValue > value; return bestValue > value;
} }
public bool IsAllEnnemyBetterThanValue(int value, bool onlyatk) public bool IsAllEnemyBetterThanValue(int value, bool onlyatk)
{ {
bool nomonster = true; bool nomonster = true;
for (int i = 0; i < 7; ++i) for (int i = 0; i < 7; ++i)
...@@ -94,22 +94,22 @@ namespace WindBot.Game.AI ...@@ -94,22 +94,22 @@ namespace WindBot.Game.AI
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;
int ennemyValue = card.GetDefensePower(); int enemyValue = card.GetDefensePower();
if (ennemyValue <= value) if (enemyValue <= value)
return false; return false;
} }
return !nomonster; return !nomonster;
} }
public ClientCard GetOneEnnemyBetterThanValue(int value, bool onlyatk) public ClientCard GetOneEnemyBetterThanValue(int value, bool onlyatk)
{ {
for (int i = 0; i < 7; ++i) for (int i = 0; i < 7; ++i)
{ {
ClientCard card = Duel.Fields[1].MonsterZone[i]; ClientCard card = Duel.Fields[1].MonsterZone[i];
if (card == null) continue; if (card == null) continue;
if (onlyatk && card.IsDefense()) continue; if (onlyatk && card.IsDefense()) continue;
int ennemyValue = card.GetDefensePower(); int enemyValue = card.GetDefensePower();
if (ennemyValue >= value) if (enemyValue >= value)
return card; return card;
} }
return null; return null;
...@@ -128,7 +128,7 @@ namespace WindBot.Game.AI ...@@ -128,7 +128,7 @@ namespace WindBot.Game.AI
return card; return card;
if (attack == 0) if (attack == 0)
attack = GetBestAttack(Duel.Fields[0], true); attack = GetBestAttack(Duel.Fields[0], true);
return GetOneEnnemyBetterThanValue(attack, true); return GetOneEnemyBetterThanValue(attack, true);
} }
public ClientCard GetProblematicMonsterCard(int attack = 0) public ClientCard GetProblematicMonsterCard(int attack = 0)
...@@ -141,7 +141,7 @@ namespace WindBot.Game.AI ...@@ -141,7 +141,7 @@ namespace WindBot.Game.AI
return card; return card;
if (attack == 0) if (attack == 0)
attack = GetBestAttack(Duel.Fields[0], true); attack = GetBestAttack(Duel.Fields[0], true);
return GetOneEnnemyBetterThanValue(attack, true); return GetOneEnemyBetterThanValue(attack, true);
} }
public ClientCard GetProblematicSpellCard() public ClientCard GetProblematicSpellCard()
......
...@@ -430,7 +430,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -430,7 +430,7 @@ namespace MycardBot.Game.AI.Decks
使用过的青眼亚白龙.Add(Card); 使用过的青眼亚白龙.Add(Card);
return true; return true;
} }
card = AI.Utils.GetOneEnnemyBetterThanValue(Card.GetDefensePower(), false); card = AI.Utils.GetOneEnemyBetterThanValue(Card.GetDefensePower(), false);
if (card != null) if (card != null)
{ {
Logger.DebugWriteLine("炸比自己强的怪."); Logger.DebugWriteLine("炸比自己强的怪.");
...@@ -771,7 +771,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -771,7 +771,7 @@ namespace MycardBot.Game.AI.Decks
Logger.DebugWriteLine("先攻不叠银河眼,叠银河巨神."); Logger.DebugWriteLine("先攻不叠银河眼,叠银河巨神.");
return false; return false;
} }
if (AI.Utils.IsOneEnnemyBetterThanValue(2999, false)) if (AI.Utils.IsOneEnemyBetterThanValue(2999, false))
{ {
Logger.DebugWriteLine("有高攻怪兽,出银河眼."); Logger.DebugWriteLine("有高攻怪兽,出银河眼.");
return true; return true;
...@@ -797,7 +797,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -797,7 +797,7 @@ namespace MycardBot.Game.AI.Decks
} }
if (Duel.Fields[0].HasInMonstersZone((int)CardId.银河眼光子龙皇)) if (Duel.Fields[0].HasInMonstersZone((int)CardId.银河眼光子龙皇))
{ {
if (!AI.Utils.IsOneEnnemyBetterThanValue(4000, false)) if (!AI.Utils.IsOneEnemyBetterThanValue(4000, false))
{ {
Logger.DebugWriteLine("没有高攻怪兽,出重铠."); Logger.DebugWriteLine("没有高攻怪兽,出重铠.");
AI.SelectCard((int)CardId.银河眼光子龙皇); AI.SelectCard((int)CardId.银河眼光子龙皇);
...@@ -1122,13 +1122,13 @@ namespace MycardBot.Game.AI.Decks ...@@ -1122,13 +1122,13 @@ namespace MycardBot.Game.AI.Decks
private bool 改变攻守表示() private bool 改变攻守表示()
{ {
bool ennemyBetter = AI.Utils.IsEnnemyBetter(true, true); bool enemyBetter = AI.Utils.IsEnemyBetter(true, true);
if (Card.IsAttack() && ennemyBetter) if (Card.IsAttack() && enemyBetter)
return true; return true;
if (Card.IsFacedown()) if (Card.IsFacedown())
return true; return true;
if (Card.IsDefense() && !ennemyBetter && Card.Attack >= Card.Defense) if (Card.IsDefense() && !enemyBetter && Card.Attack >= Card.Defense)
return true; return true;
if (Card.IsDefense() && ( if (Card.IsDefense() && (
Card.Id == (int)CardId.青眼精灵龙 Card.Id == (int)CardId.青眼精灵龙
......
...@@ -127,7 +127,7 @@ namespace WindBot.Game.AI.Decks ...@@ -127,7 +127,7 @@ namespace WindBot.Game.AI.Decks
private bool 进化光焰() private bool 进化光焰()
{ {
if (!AI.Utils.IsOneEnnemyBetterThanValue(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(Duel.Fields[1].MonsterZone.GetHighestAttackMonster());
...@@ -143,7 +143,7 @@ namespace WindBot.Game.AI.Decks ...@@ -143,7 +143,7 @@ namespace WindBot.Game.AI.Decks
private bool 装甲电子翼() private bool 装甲电子翼()
{ {
if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Duel.Fields[1].GetMonsterCount() != 0) || (Bot.HasInHand((int)CardId.电子龙三型) || Bot.HasInHand((int)CardId.电子凤凰)) && !AI.Utils.IsOneEnnemyBetterThanValue(1800,true)) if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Duel.Fields[1].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 +152,7 @@ namespace WindBot.Game.AI.Decks ...@@ -152,7 +152,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.IsOneEnnemyBetterThanValue(1800, true)) if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Duel.Fields[1].GetMonsterCount() != 0) || (Bot.HasInHand((int)CardId.电子龙三型) || Bot.HasInHand((int)CardId.电子凤凰)) && !AI.Utils.IsOneEnemyBetterThanValue(1800, true))
return false; return false;
return true; return true;
} }
...@@ -168,7 +168,7 @@ namespace WindBot.Game.AI.Decks ...@@ -168,7 +168,7 @@ namespace WindBot.Game.AI.Decks
return true; return true;
else if (Card.Location == CardLocation.SpellZone) else if (Card.Location == CardLocation.SpellZone)
{ {
if (AI.Utils.IsOneEnnemyBetterThanValue(Bot.GetMonsters().GetHighestAttackMonster().Attack, true)) if (AI.Utils.IsOneEnemyBetterThanValue(Bot.GetMonsters().GetHighestAttackMonster().Attack, true))
if (ActivateDescription == AI.Utils.GetStringId((int)CardId.装甲电子翼, 2)) if (ActivateDescription == AI.Utils.GetStringId((int)CardId.装甲电子翼, 2))
return true; return true;
return false; return false;
......
...@@ -344,7 +344,7 @@ namespace DevBot.Game.AI.Decks ...@@ -344,7 +344,7 @@ namespace DevBot.Game.AI.Decks
private bool ScrapDragonSummon() private bool ScrapDragonSummon()
{ {
//if (AI.Utils.IsOneEnnemyBetterThanValue(2500, true)) //if (AI.Utils.IsOneEnemyBetterThanValue(2500, true))
// return true; // return true;
ClientCard invincible = GetProblematicCard(); ClientCard invincible = GetProblematicCard();
return invincible != null; return invincible != null;
...@@ -353,7 +353,7 @@ namespace DevBot.Game.AI.Decks ...@@ -353,7 +353,7 @@ namespace DevBot.Game.AI.Decks
private bool ScrapDragonEffect() private bool ScrapDragonEffect()
{ {
ClientCard invincible = GetProblematicCard(); ClientCard invincible = GetProblematicCard();
if (invincible == null && !AI.Utils.IsOneEnnemyBetterThanValue(2800 - 1, false)) if (invincible == null && !AI.Utils.IsOneEnemyBetterThanValue(2800 - 1, false))
return false; return false;
ClientField field = Duel.Fields[0]; ClientField field = Duel.Fields[0];
......
...@@ -95,7 +95,7 @@ namespace DevBot.Game.AI.Decks ...@@ -95,7 +95,7 @@ namespace DevBot.Game.AI.Decks
private bool SwapFrogSummon() private bool SwapFrogSummon()
{ {
int atk = Card.Attack + GetSpellBonus(); int atk = Card.Attack + GetSpellBonus();
if (AI.Utils.IsAllEnnemyBetterThanValue(atk, true)) if (AI.Utils.IsAllEnemyBetterThanValue(atk, true))
return false; return false;
AI.SelectCard((int)CardId.Ronintoadin); AI.SelectCard((int)CardId.Ronintoadin);
...@@ -152,7 +152,7 @@ namespace DevBot.Game.AI.Decks ...@@ -152,7 +152,7 @@ namespace DevBot.Game.AI.Decks
{ {
int atk = Card.Attack + GetSpellBonus(); int atk = Card.Attack + GetSpellBonus();
if (AI.Utils.IsOneEnnemyBetterThanValue(atk, true)) if (AI.Utils.IsOneEnemyBetterThanValue(atk, true))
return false; return false;
if (Card.Id == (int)CardId.SwapFrog) if (Card.Id == (int)CardId.SwapFrog)
...@@ -164,7 +164,7 @@ namespace DevBot.Game.AI.Decks ...@@ -164,7 +164,7 @@ namespace DevBot.Game.AI.Decks
{ {
List<int> cards = new List<int>(); List<int> cards = new List<int>();
if (AI.Utils.IsEnnemyBetter(false, false)) if (AI.Utils.IsEnemyBetter(false, false))
{ {
cards.Add((int)CardId.FlipFlopFrog); cards.Add((int)CardId.FlipFlopFrog);
} }
...@@ -190,7 +190,7 @@ namespace DevBot.Game.AI.Decks ...@@ -190,7 +190,7 @@ namespace DevBot.Game.AI.Decks
private bool DarkHole() private bool DarkHole()
{ {
return AI.Utils.IsEnnemyBetter(false, false); return AI.Utils.IsEnemyBetter(false, false);
} }
private bool Terraforming() private bool Terraforming()
...@@ -226,13 +226,13 @@ namespace DevBot.Game.AI.Decks ...@@ -226,13 +226,13 @@ namespace DevBot.Game.AI.Decks
if (Card.Id == (int)CardId.DewdarkOfTheIceBarrier) if (Card.Id == (int)CardId.DewdarkOfTheIceBarrier)
return Card.IsDefense(); return Card.IsDefense();
bool ennemyBetter = AI.Utils.IsOneEnnemyBetterThanValue(Card.Attack + (Card.IsFacedown() ? GetSpellBonus() : 0), true); bool enemyBetter = AI.Utils.IsOneEnemyBetterThanValue(Card.Attack + (Card.IsFacedown() ? GetSpellBonus() : 0), true);
if (Card.Attack < 800) if (Card.Attack < 800)
ennemyBetter = true; enemyBetter = true;
bool result = false; bool result = false;
if (Card.IsAttack() && ennemyBetter) if (Card.IsAttack() && enemyBetter)
result = true; result = true;
if (Card.IsDefense() && !ennemyBetter) 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 && Duel.Fields[1].GetMonsterCount() > 0 && Card.IsFacedown())
......
...@@ -127,7 +127,7 @@ namespace WindBot.Game.AI.Decks ...@@ -127,7 +127,7 @@ namespace WindBot.Game.AI.Decks
private bool 守墓的末裔() private bool 守墓的末裔()
{ {
int bestatk = Duel.Fields[0].GetMonsters().GetHighestAttackMonster().Attack; int bestatk = Duel.Fields[0].GetMonsters().GetHighestAttackMonster().Attack;
if (AI.Utils.IsOneEnnemyBetterThanValue(bestatk, true)) if (AI.Utils.IsOneEnemyBetterThanValue(bestatk, true))
{ {
AI.SelectCard(Duel.Fields[1].GetMonsters().GetHighestAttackMonster()); AI.SelectCard(Duel.Fields[1].GetMonsters().GetHighestAttackMonster());
return true; return true;
......
...@@ -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.IsAllEnnemyBetterThanValue(2300 - 1, false)) if (Duel.Fields[1].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;
......
...@@ -291,7 +291,7 @@ namespace WindBot.Game.AI.Decks ...@@ -291,7 +291,7 @@ namespace WindBot.Game.AI.Decks
private bool 辉光子帕拉迪奥斯效果() private bool 辉光子帕拉迪奥斯效果()
{ {
ClientCard result = AI.Utils.GetOneEnnemyBetterThanValue(2000, true); ClientCard result = AI.Utils.GetOneEnemyBetterThanValue(2000, true);
if (result != null) if (result != null)
{ {
AI.SelectNextCard(result); AI.SelectNextCard(result);
...@@ -302,7 +302,7 @@ namespace WindBot.Game.AI.Decks ...@@ -302,7 +302,7 @@ namespace WindBot.Game.AI.Decks
private bool 电光皇特殊召唤() private bool 电光皇特殊召唤()
{ {
return AI.Utils.IsEnnemyBetter(false, false); return AI.Utils.IsEnemyBetter(false, false);
} }
} }
} }
\ No newline at end of file
...@@ -156,14 +156,14 @@ namespace WindBot.Game.AI.Decks ...@@ -156,14 +156,14 @@ namespace WindBot.Game.AI.Decks
private bool 三叉龙之影灵衣() private bool 三叉龙之影灵衣()
{ {
if (AI.Utils.IsAllEnnemyBetterThanValue(2700, true) && Duel.Fields[0].HasInHand((int)CardId.决战兵器之影灵衣)) if (AI.Utils.IsAllEnemyBetterThanValue(2700, true) && Duel.Fields[0].HasInHand((int)CardId.决战兵器之影灵衣))
return false; return false;
return true; return true;
} }
private bool 决战兵器之影灵衣() private bool 决战兵器之影灵衣()
{ {
if (AI.Utils.IsAllEnnemyBetterThanValue(3300, true)) if (AI.Utils.IsAllEnemyBetterThanValue(3300, true))
{ {
AI.SelectCard((int)CardId.决战兵器之影灵衣); AI.SelectCard((int)CardId.决战兵器之影灵衣);
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.IsAllEnnemyBetterThanValue(Duel.Fields[0].GetMonsters().GetHighestAttackMonster().Attack, true)) if (AI.Utils.IsAllEnemyBetterThanValue(Duel.Fields[0].GetMonsters().GetHighestAttackMonster().Attack, true))
{ {
return true; return true;
} }
...@@ -189,7 +189,7 @@ namespace WindBot.Game.AI.Decks ...@@ -189,7 +189,7 @@ namespace WindBot.Game.AI.Decks
private bool 天枪龙之影灵衣() private bool 天枪龙之影灵衣()
{ {
if (AI.Utils.IsOneEnnemyBetterThanValue(Duel.Fields[0].GetMonsters().GetHighestAttackMonster().Attack,true) && Duel.Phase == DuelPhase.Main1) if (AI.Utils.IsOneEnemyBetterThanValue(Duel.Fields[0].GetMonsters().GetHighestAttackMonster().Attack,true) && Duel.Phase == DuelPhase.Main1)
{ {
AI.SelectCard(Duel.Fields[1].GetMonsters().GetHighestAttackMonster()); AI.SelectCard(Duel.Fields[1].GetMonsters().GetHighestAttackMonster());
return true; return true;
...@@ -209,12 +209,12 @@ namespace WindBot.Game.AI.Decks ...@@ -209,12 +209,12 @@ namespace WindBot.Game.AI.Decks
AI.SelectCard((int)CardId.影灵衣的降魔镜); AI.SelectCard((int)CardId.影灵衣的降魔镜);
return true; return true;
} }
else if (AI.Utils.IsOneEnnemyBetterThanValue(3300, true) && !Duel.Fields[0].HasInHand((int)CardId.三叉龙之影灵衣)) else if (AI.Utils.IsOneEnemyBetterThanValue(3300, true) && !Duel.Fields[0].HasInHand((int)CardId.三叉龙之影灵衣))
{ {
AI.SelectCard((int)CardId.三叉龙之影灵衣); AI.SelectCard((int)CardId.三叉龙之影灵衣);
return true; return true;
} }
else if (AI.Utils.IsAllEnnemyBetterThanValue(2700,true) && !Duel.Fields[0].HasInHand((int)CardId.决战兵器之影灵衣)) else if (AI.Utils.IsAllEnemyBetterThanValue(2700,true) && !Duel.Fields[0].HasInHand((int)CardId.决战兵器之影灵衣))
{ {
AI.SelectCard((int)CardId.决战兵器之影灵衣); AI.SelectCard((int)CardId.决战兵器之影灵衣);
return true; return true;
...@@ -234,12 +234,12 @@ namespace WindBot.Game.AI.Decks ...@@ -234,12 +234,12 @@ namespace WindBot.Game.AI.Decks
private bool 千手神效果() private bool 千手神效果()
{ {
if (AI.Utils.IsOneEnnemyBetterThanValue(3300, true) && !Duel.Fields[0].HasInHand((int)CardId.三叉龙之影灵衣)) if (AI.Utils.IsOneEnemyBetterThanValue(3300, true) && !Duel.Fields[0].HasInHand((int)CardId.三叉龙之影灵衣))
{ {
AI.SelectCard((int)CardId.三叉龙之影灵衣); AI.SelectCard((int)CardId.三叉龙之影灵衣);
return true; return true;
} }
else if (AI.Utils.IsAllEnnemyBetterThanValue(2700, true) && !Duel.Fields[0].HasInHand((int)CardId.决战兵器之影灵衣)) else if (AI.Utils.IsAllEnemyBetterThanValue(2700, true) && !Duel.Fields[0].HasInHand((int)CardId.决战兵器之影灵衣))
{ {
AI.SelectCard((int)CardId.决战兵器之影灵衣); AI.SelectCard((int)CardId.决战兵器之影灵衣);
return true; return true;
...@@ -290,7 +290,7 @@ namespace WindBot.Game.AI.Decks ...@@ -290,7 +290,7 @@ namespace WindBot.Game.AI.Decks
foreach (int Id in NekrozCard) foreach (int Id in NekrozCard)
{ {
if (Id == (int)CardId.三叉龙之影灵衣 && AI.Utils.IsAllEnnemyBetterThanValue(2700, true) && Duel.Fields[0].HasInHand((int)CardId.决战兵器之影灵衣)) if (Id == (int)CardId.三叉龙之影灵衣 && AI.Utils.IsAllEnemyBetterThanValue(2700, true) && Duel.Fields[0].HasInHand((int)CardId.决战兵器之影灵衣))
{ {
AI.SelectCard((int)CardId.三叉龙之影灵衣); AI.SelectCard((int)CardId.三叉龙之影灵衣);
return true; return true;
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
if (handCard.IsFacedown()) if (handCard.IsFacedown())
return true; return true;
} }
return AI.Utils.IsEnnemyBetter(true, false); return AI.Utils.IsEnemyBetter(true, false);
} }
} }
} }
\ No newline at end of file
...@@ -390,7 +390,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -390,7 +390,7 @@ namespace MycardBot.Game.AI.Decks
private bool No37希望织龙蜘蛛鲨特殊召唤() private bool No37希望织龙蜘蛛鲨特殊召唤()
{ {
return AI.Utils.IsAllEnnemyBetterThanValue(1700, false) && !AI.Utils.IsOneEnnemyBetterThanValue(3600, true); return AI.Utils.IsAllEnemyBetterThanValue(1700, false) && !AI.Utils.IsOneEnemyBetterThanValue(3600, true);
} }
private bool 电光千鸟特殊召唤() private bool 电光千鸟特殊召唤()
...@@ -424,7 +424,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -424,7 +424,7 @@ namespace MycardBot.Game.AI.Decks
private bool 星尘龙特殊召唤() private bool 星尘龙特殊召唤()
{ {
return (AI.Utils.IsEnnemyBetter(false, false) && !AI.Utils.IsOneEnnemyBetterThanValue(2400, true)) || AI.Utils.IsTurn1OrMain2(); return (AI.Utils.IsEnemyBetter(false, false) && !AI.Utils.IsOneEnemyBetterThanValue(2400, true)) || AI.Utils.IsTurn1OrMain2();
} }
private bool 星尘龙效果() private bool 星尘龙效果()
...@@ -434,7 +434,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -434,7 +434,7 @@ namespace MycardBot.Game.AI.Decks
private bool 进化帝半鸟龙特殊召唤() private bool 进化帝半鸟龙特殊召唤()
{ {
return (AI.Utils.IsAllEnnemyBetterThanValue(1700, false) && !AI.Utils.IsOneEnnemyBetterThanValue(2400, true)) || AI.Utils.IsTurn1OrMain2(); return (AI.Utils.IsAllEnemyBetterThanValue(1700, false) && !AI.Utils.IsOneEnemyBetterThanValue(2400, true)) || AI.Utils.IsTurn1OrMain2();
} }
private bool 入魔梦魇骑士特殊召唤() private bool 入魔梦魇骑士特殊召唤()
...@@ -460,7 +460,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -460,7 +460,7 @@ namespace MycardBot.Game.AI.Decks
private bool No59背反之料理人特殊召唤() private bool No59背反之料理人特殊召唤()
{ {
return ((Duel.Fields[0].GetMonsterCount() + Duel.Fields[0].GetSpellCount() - 2) <= 1) && return ((Duel.Fields[0].GetMonsterCount() + Duel.Fields[0].GetSpellCount() - 2) <= 1) &&
((AI.Utils.IsEnnemyBetter(false, false) && !AI.Utils.IsOneEnnemyBetterThanValue(2300, true)) || AI.Utils.IsTurn1OrMain2()); ((AI.Utils.IsEnemyBetter(false, false) && !AI.Utils.IsOneEnemyBetterThanValue(2300, true)) || AI.Utils.IsTurn1OrMain2());
} }
private bool No59背反之料理人效果() private bool No59背反之料理人效果()
...@@ -493,7 +493,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -493,7 +493,7 @@ namespace MycardBot.Game.AI.Decks
private bool 辉光子帕拉迪奥斯效果() private bool 辉光子帕拉迪奥斯效果()
{ {
ClientCard result = AI.Utils.GetOneEnnemyBetterThanValue(2000, true); ClientCard result = AI.Utils.GetOneEnemyBetterThanValue(2000, true);
if (result != null) if (result != null)
{ {
AI.SelectNextCard(result); AI.SelectNextCard(result);
...@@ -504,7 +504,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -504,7 +504,7 @@ namespace MycardBot.Game.AI.Decks
private bool 电光皇特殊召唤() private bool 电光皇特殊召唤()
{ {
return AI.Utils.IsEnnemyBetter(false, false); return AI.Utils.IsEnemyBetter(false, false);
} }
private bool 强欲而贪欲之壶效果() private bool 强欲而贪欲之壶效果()
...@@ -514,7 +514,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -514,7 +514,7 @@ namespace MycardBot.Game.AI.Decks
private bool 地碎效果() private bool 地碎效果()
{ {
return AI.Utils.IsEnnemyBetter(false, false); return AI.Utils.IsEnemyBetter(false, false);
} }
private bool 陷阱卡覆盖() private bool 陷阱卡覆盖()
......
...@@ -280,14 +280,14 @@ namespace DevBot.Game.AI.Decks ...@@ -280,14 +280,14 @@ namespace DevBot.Game.AI.Decks
private bool No61火山恐龙特殊召唤() private bool No61火山恐龙特殊召唤()
{ {
return AI.Utils.IsOneEnnemyBetterThanValue(2000, false); return AI.Utils.IsOneEnemyBetterThanValue(2000, false);
} }
private bool No61火山恐龙效果() private bool No61火山恐龙效果()
{ {
ClientCard target = Duel.Fields[1].MonsterZone.GetFloodgate(); ClientCard target = Duel.Fields[1].MonsterZone.GetFloodgate();
if (target == null) if (target == null)
target = AI.Utils.GetOneEnnemyBetterThanValue(2000, false); target = AI.Utils.GetOneEnemyBetterThanValue(2000, false);
if (target != null) if (target != null)
{ {
AI.SelectCard((int)CardId.电子龙); AI.SelectCard((int)CardId.电子龙);
...@@ -416,7 +416,7 @@ namespace DevBot.Game.AI.Decks ...@@ -416,7 +416,7 @@ namespace DevBot.Game.AI.Decks
return false; return false;
} }
private ClientCard GetBestEnnemyCard() private ClientCard GetBestEnemyCard()
{ {
ClientCard card = AI.Utils.GetProblematicCard(); ClientCard card = AI.Utils.GetProblematicCard();
if (card != null) if (card != null)
......
...@@ -421,7 +421,7 @@ namespace WindBot.Game.AI.Decks ...@@ -421,7 +421,7 @@ namespace WindBot.Game.AI.Decks
private bool 猫鲨特殊召唤() private bool 猫鲨特殊召唤()
{ {
bool should = Duel.Fields[0].HasInMonstersZone((int)CardId.饼蛙) bool should = Duel.Fields[0].HasInMonstersZone((int)CardId.饼蛙)
&& ((AI.Utils.IsEnnemyBetter(true, false) && ((AI.Utils.IsEnemyBetter(true, false)
&& !Duel.Fields[0].HasInMonstersZone(new List<int> && !Duel.Fields[0].HasInMonstersZone(new List<int>
{ {
(int)CardId.猫鲨, (int)CardId.猫鲨,
...@@ -480,7 +480,7 @@ namespace WindBot.Game.AI.Decks ...@@ -480,7 +480,7 @@ namespace WindBot.Game.AI.Decks
num++; num++;
} }
} }
return AI.Utils.IsEnnemyBetter(true, false) return AI.Utils.IsEnemyBetter(true, false)
&& AI.Utils.GetBestAttack(Duel.Fields[1], true) > 2200 && AI.Utils.GetBestAttack(Duel.Fields[1], true) > 2200
&& num < 4 && num < 4
&& !Duel.Fields[0].HasInMonstersZone(new List<int> && !Duel.Fields[0].HasInMonstersZone(new List<int>
...@@ -508,7 +508,7 @@ namespace WindBot.Game.AI.Decks ...@@ -508,7 +508,7 @@ namespace WindBot.Game.AI.Decks
{ {
defence += monster.GetDefensePower(); defence += monster.GetDefensePower();
} }
if (attack - 2000 - defence > Duel.LifePoints[1] && !AI.Utils.IsEnnemyBetter(true, false)) if (attack - 2000 - defence > Duel.LifePoints[1] && !AI.Utils.IsEnemyBetter(true, false))
return true; return true;
} }
return false; return false;
...@@ -522,11 +522,11 @@ namespace WindBot.Game.AI.Decks ...@@ -522,11 +522,11 @@ namespace WindBot.Game.AI.Decks
private bool 改变攻守表示() private bool 改变攻守表示()
{ {
bool ennemyBetter = AI.Utils.IsEnnemyBetter(true, true); bool enemyBetter = AI.Utils.IsEnemyBetter(true, true);
if (Card.IsFacedown()) if (Card.IsFacedown())
return true; return true;
if (Card.IsDefense() && !ennemyBetter && Card.Attack >= Card.Defense) if (Card.IsDefense() && !enemyBetter && Card.Attack >= Card.Defense)
return true; return true;
return false; return false;
} }
......
...@@ -352,7 +352,7 @@ namespace WindBot.Game.AI.Decks ...@@ -352,7 +352,7 @@ namespace WindBot.Game.AI.Decks
private bool 暗叛逆超量龙效果() private bool 暗叛逆超量龙效果()
{ {
int oppoBestAttack = AI.Utils.GetBestAttack(Duel.Fields[1], true); int oppoBestAttack = AI.Utils.GetBestAttack(Duel.Fields[1], true);
ClientCard target = AI.Utils.GetOneEnnemyBetterThanValue(oppoBestAttack, true); ClientCard target = AI.Utils.GetOneEnemyBetterThanValue(oppoBestAttack, true);
if (target != null) if (target != null)
{ {
AI.SelectNextCard(target); AI.SelectNextCard(target);
......
...@@ -151,7 +151,7 @@ namespace DevBot.Game.AI.Decks ...@@ -151,7 +151,7 @@ namespace DevBot.Game.AI.Decks
private bool Number61Volcasaurus() private bool Number61Volcasaurus()
{ {
return AI.Utils.IsOneEnnemyBetterThanValue(2000, false); return AI.Utils.IsOneEnemyBetterThanValue(2000, false);
} }
private bool ZwLionArms() private bool ZwLionArms()
......
...@@ -209,7 +209,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -209,7 +209,7 @@ namespace MycardBot.Game.AI.Decks
AI.SelectCard(card); AI.SelectCard(card);
return true; return true;
} }
card = AI.Utils.GetOneEnnemyBetterThanValue(Card.GetDefensePower(), false); card = AI.Utils.GetOneEnemyBetterThanValue(Card.GetDefensePower(), false);
if (card != null) if (card != null)
{ {
AI.SelectCard(card); AI.SelectCard(card);
...@@ -241,7 +241,7 @@ namespace MycardBot.Game.AI.Decks ...@@ -241,7 +241,7 @@ namespace MycardBot.Game.AI.Decks
|| Duel.Phase == DuelPhase.Damage)) || Duel.Phase == DuelPhase.Damage))
return false; return false;
return Duel.Player==0 return Duel.Player==0
|| AI.Utils.IsEnnemyBetter(false, false); || AI.Utils.IsEnemyBetter(false, false);
} }
return true; return true;
} }
......
...@@ -96,7 +96,7 @@ namespace WindBot.Game.AI ...@@ -96,7 +96,7 @@ namespace WindBot.Game.AI
protected bool DefaultBookOfMoon() protected bool DefaultBookOfMoon()
{ {
if (AI.Utils.IsEnnemyBetter(true, true)) if (AI.Utils.IsEnemyBetter(true, true))
{ {
ClientCard monster = Duel.Fields[1].GetMonsters().GetHighestAttackMonster(); ClientCard monster = Duel.Fields[1].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))
...@@ -133,7 +133,7 @@ namespace WindBot.Game.AI ...@@ -133,7 +133,7 @@ namespace WindBot.Game.AI
protected bool DefaultCallOfTheHaunted() protected bool DefaultCallOfTheHaunted()
{ {
if (!AI.Utils.IsEnnemyBetter(true, true)) if (!AI.Utils.IsEnemyBetter(true, true))
return false; return false;
ClientCard selected = null; ClientCard selected = null;
int BestAtk = 0; int BestAtk = 0;
...@@ -151,7 +151,7 @@ namespace WindBot.Game.AI ...@@ -151,7 +151,7 @@ namespace WindBot.Game.AI
protected bool DefaultTorrentialTribute() protected bool DefaultTorrentialTribute()
{ {
return (AI.Utils.IsEnnemyBetter(true, true)); return (AI.Utils.IsEnemyBetter(true, true));
} }
protected bool DefaultHeavyStorm() protected bool DefaultHeavyStorm()
...@@ -161,17 +161,17 @@ namespace WindBot.Game.AI ...@@ -161,17 +161,17 @@ namespace WindBot.Game.AI
protected bool DefaultHammerShot() protected bool DefaultHammerShot()
{ {
return AI.Utils.IsEnnemyBetter(true, false); return AI.Utils.IsEnemyBetter(true, false);
} }
protected bool DefaultDarkHole() protected bool DefaultDarkHole()
{ {
return AI.Utils.IsEnnemyBetter(false, false); return AI.Utils.IsEnemyBetter(false, false);
} }
protected bool DefaultRaigeki() protected bool DefaultRaigeki()
{ {
return AI.Utils.IsEnnemyBetter(false, false); return AI.Utils.IsEnemyBetter(false, false);
} }
protected bool DefaultSpellSet() protected bool DefaultSpellSet()
...@@ -206,11 +206,11 @@ namespace WindBot.Game.AI ...@@ -206,11 +206,11 @@ namespace WindBot.Game.AI
protected bool DefaultMonsterRepos() protected bool DefaultMonsterRepos()
{ {
bool ennemyBetter = AI.Utils.IsEnnemyBetter(true, true); bool enemyBetter = AI.Utils.IsEnemyBetter(true, true);
if (Card.IsAttack() && ennemyBetter) if (Card.IsAttack() && enemyBetter)
return true; return true;
if (Card.IsDefense() && !ennemyBetter && Card.Attack >= Card.Defense) if (Card.IsDefense() && !enemyBetter && Card.Attack >= Card.Defense)
return true; return true;
return false; return false;
} }
......
...@@ -298,7 +298,7 @@ namespace WindBot.Game ...@@ -298,7 +298,7 @@ namespace WindBot.Game
} }
if (ShouldExecute(exec, card, ExecutorType.SummonOrSet)) if (ShouldExecute(exec, card, ExecutorType.SummonOrSet))
{ {
if (Utils.IsEnnemyBetter(true, true) && Utils.IsAllEnnemyBetterThanValue(card.Attack + 300, false) && if (Utils.IsEnemyBetter(true, true) && Utils.IsAllEnemyBetterThanValue(card.Attack + 300, false) &&
main.MonsterSetableCards.Contains(card)) main.MonsterSetableCards.Contains(card))
{ {
_dialogs.SendSetMonster(); _dialogs.SendSetMonster();
......
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