Commit 34f1c0db authored by nanahira's avatar nanahira Committed by GitHub

Merge pull request #2 from moecube/master

mg
parents 52cb8ca8 f8f793ac
using System;
using System.Collections.Generic;
using System.IO;
namespace WindBot
{
public static class Config
{
private static string CONFIG_FILE_OPTION = "Config";
private static char SEPARATOR_CHAR = '=';
private static char COMMENT_CHAR = '#';
private static Dictionary<string, string> _fields;
private static Dictionary<string, int> _integerCache;
private static Dictionary<string, bool> _booleanCache;
public static void Load(string[] args)
{
_integerCache = new Dictionary<string, int>();
_booleanCache = new Dictionary<string, bool>();
_fields = LoadArgs(args);
string filename = GetString(CONFIG_FILE_OPTION);
if (filename != null)
{
Dictionary<string, string> fileFields = LoadFile(filename);
foreach (var pair in fileFields)
{
if (!_fields.ContainsKey(pair.Key))
_fields.Add(pair.Key, pair.Value);
}
}
}
private static Dictionary<string, string> LoadArgs(string[] args)
{
Dictionary<string, string> fields = new Dictionary<string, string>();
for (int i = 0; i < args.Length; ++i)
{
string option = args[i];
int position = option.IndexOf(SEPARATOR_CHAR);
if (position == -1)
throw new Exception("Invalid argument '" + option + "': no key/value separator");
string key = option.Substring(0, position).Trim().ToUpper();
string value = option.Substring(position + 1).Trim();
if (fields.ContainsKey(key))
throw new Exception("Invalid argument '" + option + "': duplicate key '" + key + "'");
fields.Add(key, value);
}
return fields;
}
private static Dictionary<string, string> LoadFile(string filename)
{
Dictionary<string, string> fields = new Dictionary<string, string>();
using (StreamReader reader = new StreamReader(filename))
{
int lineNumber = 0;
while (!reader.EndOfStream)
{
string line = reader.ReadLine().Trim();
++lineNumber;
// Ignore empty lines and comments
if (line.Length == 0 || line[0] == COMMENT_CHAR)
continue;
int position = line.IndexOf(SEPARATOR_CHAR);
if (position == -1)
throw new Exception("Invalid configuration file: no key/value separator line " + lineNumber);
string key = line.Substring(0, position).Trim().ToUpper();
string value = line.Substring(position + 1).Trim();
if (fields.ContainsKey(key))
throw new Exception("Invalid configuration file: duplicate key '" + key + "' line " + lineNumber);
fields.Add(key, value);
}
}
return fields;
}
public static string GetString(string key, string defaultValue = null)
{
key = key.ToUpper();
if (_fields.ContainsKey(key))
return _fields[key];
return defaultValue;
}
public static int GetInt(string key, int defaultValue = 0)
{
key = key.ToUpper();
// Use a cache to prevent doing the string to int conversion over and over
if (_integerCache.ContainsKey(key))
return _integerCache[key];
int value = defaultValue;
if (_fields.ContainsKey(key))
{
if (_fields[key].StartsWith("0x"))
value = Convert.ToInt32(_fields[key], 16);
else
value = Convert.ToInt32(_fields[key]);
}
_integerCache.Add(key, value);
return value;
}
public static uint GetUInt(string key, uint defaultValue = 0)
{
return (uint)GetInt(key, (int)defaultValue);
}
public static bool GetBool(string key, bool defaultValue = false)
{
key = key.ToUpper();
// Same here, prevent from redoing the string to bool conversion
if (_booleanCache.ContainsKey(key))
return _booleanCache[key];
bool value = defaultValue;
if (_fields.ContainsKey(key))
{
value = Convert.ToBoolean(_fields[key]);
}
_booleanCache.Add(key, value);
return value;
}
}
}
......@@ -6,69 +6,63 @@
"Sorry, it seems that I have too much {0} in my deck."
],
"duelstart": [
"Good luck, have fun."
"It's time to duel!",
"Good luck, and have fun!"
],
"newturn": [
"It's my turn, draw.",
"My turn, draw.",
"I draw a card."
"It's my turn! Draw!",
"My turn. Draw!",
"I draw!"
],
"endturn": [
"I end my turn.",
"My turn is over.",
"Your turn."
"It's your turn."
],
"directattack": [
"{0}, direct attack!",
"{0}, attack him directly!",
"{0}, he's defenseless, attack!",
"{0}, attack his life points!",
"{0}, attack his life points directly!",
"{0}, attack him through a direct attack!",
"{0}, attack him using a direct attack!",
"{0}, unleash your power through a direct attack!",
"My {0} is going to smash your life points!",
"Show your power to my opponent, {0}!",
"You can't stop me. {0}, attack!"
"{0}, attack them directly!",
"You're defenseless. Attack, {0}!",
"{0}, attack their life points!",
"{0}, attack their life points directly!",
"{0}, unleash your power!",
"My {0} will decimate your life points!",
"Behold the power of my {0}!",
"You can't stop me! {0}, attack!"
],
"attack": [
"{0}, attack this {1}!",
"{0}, destroy this {1}!",
"{0}, charge the {1}!",
"{0}, strike that {1}!",
"{0}, unleash your power on this {1}!"
"{0}, attack their {1}!",
"{0}, destroy their {1}!",
"My {0} will annihilate your {1}!",
"Your {1} is no match for my {0}!",
"{0}, unleash your power on their {1}!"
],
"ondirectattack": [
"Ahhhhh...",
"Just {0} ...",
"Think you can defeat me?"
"Argh...!",
"Just {0}...",
"You think that's enough to defeat me?",
"It's just a scratch!"
],
"facedownmonstername": "monster",
"activate": [
"I'm activating {0}.",
"I'm using the effect of {0}.",
"I use the power of {0}."
"I activate {0}!",
"I'll use {0}."
],
"summon": [
"I'm summoning {0}.",
"I summon {0}!",
"Come on, {0}!",
"Appear, {0}!",
"I summon the powerful {0}.",
"I call {0} to the battle!",
"I'm calling {0}.",
"Let's summon {0}."
"{0}, show yourself!"
],
"setmonster": [
"I'm setting a monster.",
"I set a face-down monster.",
"I place a hidden monster."
"I set a monster face-down.",
"Whatever could this monster be?",
"Attack this monster, I dare you!"
],
"chaining": [
"Look at that! I'm activating {0}.",
"I use the power of {0}.",
"Get ready! I use {0}.",
"I don't think so. {0}, activation!",
"Looks like you forgot my {0}.",
"Did you consider the fact I have {0}?"
"Not so fast! I activate {0}!",
"Before you do that, I'll chain {0}!",
"Nice try, but I have {0}!",
"Didn't expect {0}, did you?"
]
}
\ No newline at end of file
......@@ -42,44 +42,40 @@ namespace WindBot.Game.AI
return 1;
}
public int GetBestAttack(ClientField field, bool onlyatk)
/// <summary>
/// Get the best ATK or DEF power of the field.
/// </summary>
/// <param name="field">Bot or Enemy.</param>
/// <param name="onlyATK">Only calculate attack.</param>
public int GetBestPower(ClientField field, bool onlyATK = false)
{
int bestAtk = -1;
int bestPower = -1;
for (int i = 0; i < 7; ++i)
{
ClientCard card = field.MonsterZone[i];
if (card == null) continue;
if (onlyatk && card.IsDefense()) continue;
int enemyValue = card.GetDefensePower();
if (enemyValue > bestAtk)
bestAtk = enemyValue;
if (card == null || card.Data == null) continue;
if (onlyATK && card.IsDefense()) continue;
int newPower = card.GetDefensePower();
if (newPower > bestPower)
bestPower = newPower;
}
return bestAtk;
return bestPower;
}
public bool IsEnemyBetter(bool onlyatk, bool all)
public int GetBestAttack(ClientField field)
{
if (Enemy.GetMonsterCount() == 0)
return false;
List<ClientCard> monsters = Bot.GetMonsters();
monsters.Sort(CompareCardAttack);
int bestAtk = -1;
if (monsters.Count > 0)
bestAtk = monsters[monsters.Count - 1].Attack;
if (all)
return IsAllEnemyBetterThanValue(bestAtk, onlyatk);
return IsOneEnemyBetterThanValue(bestAtk, onlyatk);
return GetBestPower(field, true);
}
public bool IsOneEnemyBetterThanValue(int value, bool onlyatk)
public bool IsOneEnemyBetterThanValue(int value, bool onlyATK)
{
int bestValue = -1;
bool nomonster = true;
for (int i = 0; i < 7; ++i)
{
ClientCard card = Enemy.MonsterZone[i];
if (card == null) continue;
if (onlyatk && card.IsDefense()) continue;
if (card == null || card.Data == null) continue;
if (onlyATK && card.IsDefense()) continue;
nomonster = false;
int enemyValue = card.GetDefensePower();
if (enemyValue > bestValue)
......@@ -89,14 +85,14 @@ namespace WindBot.Game.AI
return bestValue > value;
}
public bool IsAllEnemyBetterThanValue(int value, bool onlyatk)
public bool IsAllEnemyBetterThanValue(int value, bool onlyATK)
{
bool nomonster = true;
for (int i = 0; i < 7; ++i)
{
ClientCard card = Enemy.MonsterZone[i];
if (card == null || card.Data == null) continue;
if (onlyatk && card.IsDefense()) continue;
if (onlyATK && card.IsDefense()) continue;
nomonster = false;
int enemyValue = card.GetDefensePower();
if (enemyValue <= value)
......@@ -105,85 +101,160 @@ namespace WindBot.Game.AI
return !nomonster;
}
public ClientCard GetOneEnemyBetterThanValue(int value, bool onlyatk)
/// <summary>
/// Deprecated, use IsOneEnemyBetter and IsAllEnemyBetter instead.
/// </summary>
public bool IsEnemyBetter(bool onlyATK, bool all)
{
if (all)
return IsAllEnemyBetter(onlyATK);
else
return IsOneEnemyBetter(onlyATK);
}
/// <summary>
/// Is there an enemy monster who has better power than the best power of the bot's?
/// </summary>
/// <param name="onlyATK">Only calculate attack.</param>
public bool IsOneEnemyBetter(bool onlyATK = false)
{
int bestBotPower = GetBestPower(Bot, onlyATK);
return IsOneEnemyBetterThanValue(bestBotPower, onlyATK);
}
/// <summary>
/// Do all enemy monsters have better power than the best power of the bot's?
/// </summary>
/// <param name="onlyATK">Only calculate attack.</param>
public bool IsAllEnemyBetter(bool onlyATK = false)
{
int bestBotPower = GetBestPower(Bot, onlyATK);
return IsAllEnemyBetterThanValue(bestBotPower, onlyATK);
}
public ClientCard GetOneEnemyBetterThanValue(int value, bool onlyATK = false)
{
ClientCard bestCard = null;
int bestValue = value;
for (int i = 0; i < 7; ++i)
{
ClientCard card = Enemy.MonsterZone[i];
if (card == null) continue;
if (onlyatk && card.IsDefense()) continue;
if (card == null || card.Data == null) continue;
if (onlyATK && card.IsDefense()) continue;
int enemyValue = card.GetDefensePower();
if (enemyValue >= value)
return card;
if (enemyValue >= bestValue)
{
bestCard = card;
bestValue = enemyValue;
}
return null;
}
return bestCard;
}
public ClientCard GetAnyEnemyMonster()
public ClientCard GetOneEnemyBetterThanMyBest(bool onlyATK = false)
{
List<ClientCard> monsters = Enemy.GetMonsters();
ClientCard hmonster = monsters.GetHighestAttackMonster();
if (hmonster != null)
{
return hmonster;
int bestBotPower = GetBestPower(Bot, onlyATK);
return GetOneEnemyBetterThanValue(bestBotPower, onlyATK);
}
foreach (ClientCard monster in monsters)
public ClientCard GetProblematicEnemyCard(int attack = 0)
{
return monster;
}
return null;
ClientCard card = Enemy.MonsterZone.GetFloodgate();
if (card != null)
return card;
card = Enemy.SpellZone.GetFloodgate();
if (card != null)
return card;
card = Enemy.MonsterZone.GetDangerousMonster();
if (card != null)
return card;
card = Enemy.MonsterZone.GetInvincibleMonster();
if (card != null)
return card;
if (attack == 0)
attack = GetBestAttack(Bot);
return GetOneEnemyBetterThanValue(attack, true);
}
public ClientCard GetProblematicCard(int attack = 0)
public ClientCard GetProblematicEnemyMonster(int attack = 0)
{
ClientCard card = Enemy.MonsterZone.GetInvincibleMonster();
ClientCard card = Enemy.MonsterZone.GetFloodgate();
if (card != null)
return card;
card = Enemy.MonsterZone.GetFloodgate();
card = Enemy.MonsterZone.GetDangerousMonster();
if (card != null)
return card;
card = Enemy.SpellZone.GetFloodgate();
card = Enemy.MonsterZone.GetInvincibleMonster();
if (card != null)
return card;
if (attack == 0)
attack = GetBestAttack(Bot, true);
attack = GetBestAttack(Bot);
return GetOneEnemyBetterThanValue(attack, true);
}
public ClientCard GetBestEnemyCard()
public ClientCard GetProblematicEnemySpell()
{
ClientCard card = Enemy.SpellZone.GetFloodgate();
return card;
}
public ClientCard GetBestEnemyCard(bool onlyFaceup = false)
{
ClientCard card = GetProblematicCard();
ClientCard card = GetBestEnemyMonster(onlyFaceup);
if (card != null)
return card;
card = Enemy.MonsterZone.GetHighestAttackMonster();
card = GetBestEnemySpell(onlyFaceup);
if (card != null)
return card;
List<ClientCard> spells = Enemy.GetSpells();
if (spells.Count > 0)
return spells[0];
return null;
}
public ClientCard GetProblematicMonsterCard(int attack = 0)
public ClientCard GetBestEnemyMonster(bool onlyFaceup = false)
{
ClientCard card = Enemy.MonsterZone.GetInvincibleMonster();
ClientCard card = GetProblematicEnemyMonster();
if (card != null)
return card;
card = Enemy.MonsterZone.GetFloodgate();
card = Enemy.MonsterZone.GetHighestAttackMonster();
if (card != null)
return card;
if (attack == 0)
attack = GetBestAttack(Bot, true);
return GetOneEnemyBetterThanValue(attack, true);
List<ClientCard> monsters = Enemy.GetMonsters();
// after GetHighestAttackMonster, the left monsters must be face-down.
if (monsters.Count > 0 && !onlyFaceup)
return monsters[0];
return null;
}
public ClientCard GetProblematicSpellCard()
public ClientCard GetBestEnemySpell(bool onlyFaceup = false)
{
ClientCard card = Enemy.SpellZone.GetNegateAttackSpell();
ClientCard card = GetProblematicEnemySpell();
if (card != null)
return card;
card = Enemy.SpellZone.GetFloodgate();
return card;
List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard ecard in spells)
{
if (ecard.IsFaceup())
return ecard;
}
if (spells.Count > 0 && !onlyFaceup)
return spells[0];
return null;
}
public ClientCard GetPZone(int player, int id)
......@@ -207,5 +278,23 @@ namespace WindBot.Game.AI
{
return Duel.Turn == 1 || Duel.Phase == DuelPhase.Main2;
}
public bool IsChainTarget(ClientCard card)
{
foreach (ClientCard target in Duel.ChainTargets)
{
if (card.Equals(target))
{
return true;
}
}
return false;
}
public bool IsChainTargetOnly(ClientCard card)
{
return Duel.ChainTargets.Count == 1 && card.Equals(Duel.ChainTargets[0]);
}
}
}
\ No newline at end of file
......@@ -12,7 +12,7 @@ namespace WindBot.Game.AI
ClientCard selected = null;
foreach (ClientCard card in cards)
{
if (card == null || card.Data == null) continue;
if (card == null || card.Data == null || card.IsFacedown()) continue;
if (card.HasType(CardType.Monster) && card.Attack > highestAtk)
{
highestAtk = card.Attack;
......@@ -28,7 +28,7 @@ namespace WindBot.Game.AI
ClientCard selected = null;
foreach (ClientCard card in cards)
{
if (card == null || card.Data == null) continue;
if (card == null || card.Data == null || card.IsFacedown()) continue;
if (card.HasType(CardType.Monster) && card.Defense > highestDef)
{
highestDef = card.Defense;
......@@ -44,7 +44,7 @@ namespace WindBot.Game.AI
ClientCard selected = null;
foreach (ClientCard card in cards)
{
if (card == null || card.Data == null) continue;
if (card == null || card.Data == null || card.IsFacedown()) continue;
if (lowestAtk == 0 && card.HasType(CardType.Monster) ||
card.HasType(CardType.Monster) && card.Attack < lowestAtk)
{
......@@ -61,7 +61,7 @@ namespace WindBot.Game.AI
ClientCard selected = null;
foreach (ClientCard card in cards)
{
if (card == null || card.Data == null) continue;
if (card == null || card.Data == null || card.IsFacedown()) continue;
if (lowestDef == 0 && card.HasType(CardType.Monster) ||
card.HasType(CardType.Monster) && card.Defense < lowestDef)
{
......@@ -131,36 +131,39 @@ namespace WindBot.Game.AI
continue;
if (card.HasType(CardType.Monster))
cardlist.Add(card);
}
return cardlist;
}
public static ClientCard GetInvincibleMonster(this IEnumerable<ClientCard> cards)
public static IList<ClientCard> GetFaceupPendulumMonsters(this IEnumerable<ClientCard> cards)
{
IList<ClientCard> cardlist = new List<ClientCard>();
foreach (ClientCard card in cards)
{
if (card != null && card.IsMonsterInvincible())
return card;
if (card == null)
continue;
if (card.HasType(CardType.Monster) && card.IsFaceup() && card.HasType(CardType.Pendulum))
cardlist.Add(card);
}
return null;
return cardlist;
}
public static ClientCard GetDangerousMonster(this IEnumerable<ClientCard> cards)
public static ClientCard GetInvincibleMonster(this IEnumerable<ClientCard> cards)
{
foreach (ClientCard card in cards)
{
if (card != null && card.IsMonsterDangerous())
if (card != null && card.IsMonsterInvincible() && card.IsFaceup())
return card;
}
return null;
}
public static ClientCard GetNegateAttackSpell(this IEnumerable<ClientCard> cards)
public static ClientCard GetDangerousMonster(this IEnumerable<ClientCard> cards)
{
foreach (ClientCard card in cards)
{
if (card != null && card.IsSpellNegateAttack())
if (card != null && card.IsMonsterDangerous() && card.IsFaceup())
return card;
}
return null;
......@@ -170,7 +173,7 @@ namespace WindBot.Game.AI
{
foreach (ClientCard card in cards)
{
if (card != null && card.IsFloodgate())
if (card != null && card.IsFloodgate() && card.IsFaceup())
return card;
}
return null;
......
......@@ -5,21 +5,22 @@ namespace WindBot.Game.AI
{
public static class CardExtension
{
/// <summary>
/// Is this monster is invincible to battle?
/// </summary>
public static bool IsMonsterInvincible(this ClientCard card)
{
return Enum.IsDefined(typeof(InvincibleMonster), card.Id);
}
/// <summary>
/// Is this monster is dangerous to attack?
/// </summary>
public static bool IsMonsterDangerous(this ClientCard card)
{
return Enum.IsDefined(typeof(DangerousMonster), card.Id);
}
public static bool IsSpellNegateAttack(this ClientCard card)
{
return Enum.IsDefined(typeof(NegateAttackSpell), card.Id);
}
public static bool IsFloodgate(this ClientCard card)
{
return Enum.IsDefined(typeof(Floodgate), card.Id);
......
......@@ -7,14 +7,16 @@ namespace WindBot.Game.AI
{
public string Name { get; private set; }
public string File { get; private set; }
public string Level { get; private set; }
public DeckAttribute(string name, string file = null)
public DeckAttribute(string name, string file = null, string level = "Normal")
{
if (String.IsNullOrEmpty(file))
file = name;
Name = name;
File = file;
Level = level;
}
}
}
......@@ -6,31 +6,32 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Blackwing", "AI_Blackwing")]
// NOT FINISHED YET
[Deck("Blackwing", "AI_Blackwing", "NotFinished")]
public class BlackwingExecutor : DefaultExecutor
{
public enum CardId
public class CardId
{
KrisTheCrackOfDawn = 81105204,
SiroccoTheDawn = 75498415,
ShuraTheBlueFlame = 58820853,
BoraTheSpear = 49003716,
KalutTheMoonShadow = 85215458,
GaleTheWhirlwind = 2009101,
BlizzardTheFarNorth = 22835145,
MistralTheSilverShield = 46710683,
Raigeki = 12580477,
DarkHole = 53129443,
MysticalSpaceTyphoon = 5318639,
BlackWhirlwind = 91351370,
MirrorForce = 44095762,
DeltaCrowAntiReverse = 59839761,
DimensionalPrison = 70342110,
SilverwindTheAscendant = 33236860,
BlackWingedDragon = 9012916,
ArmorMaster = 69031175,
ArmedWing = 76913983,
GramTheShiningStar = 17377751
public static int KrisTheCrackOfDawn = 81105204;
public static int SiroccoTheDawn = 75498415;
public static int ShuraTheBlueFlame = 58820853;
public static int BoraTheSpear = 49003716;
public static int KalutTheMoonShadow = 85215458;
public static int GaleTheWhirlwind = 2009101;
public static int BlizzardTheFarNorth = 22835145;
public static int MistralTheSilverShield = 46710683;
public static int Raigeki = 12580477;
public static int DarkHole = 53129443;
public static int MysticalSpaceTyphoon = 5318639;
public static int BlackWhirlwind = 91351370;
public static int MirrorForce = 44095762;
public static int DeltaCrowAntiReverse = 59839761;
public static int DimensionalPrison = 70342110;
public static int SilverwindTheAscendant = 33236860;
public static int BlackWingedDragon = 9012916;
public static int ArmorMaster = 69031175;
public static int ArmedWing = 76913983;
public static int GramTheShiningStar = 17377751;
}
public BlackwingExecutor(GameAI ai, Duel duel)
......@@ -38,45 +39,45 @@ namespace WindBot.Game.AI.Decks
{
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, (int)CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, (int)CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, (int)CardId.BlackWhirlwind, BlackWhirlwindEffect);
AddExecutor(ExecutorType.SpSummon, (int)CardId.KrisTheCrackOfDawn);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.KrisTheCrackOfDawn);
AddExecutor(ExecutorType.Summon, (int)CardId.SiroccoTheDawn, SiroccoTheDawnSummon);
AddExecutor(ExecutorType.Summon, (int)CardId.ShuraTheBlueFlame, ShuraTheBlueFlameSummon);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.ShuraTheBlueFlame);
AddExecutor(ExecutorType.SpSummon, (int)CardId.BoraTheSpear);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.BoraTheSpear);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.KalutTheMoonShadow, KalutTheMoonShadowSummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.GaleTheWhirlwind);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.GaleTheWhirlwind);
AddExecutor(ExecutorType.Summon, (int)CardId.BlizzardTheFarNorth, BlizzardTheFarNorthSummon);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.MistralTheSilverShield);
AddExecutor(ExecutorType.SpSummon, (int)CardId.SilverwindTheAscendant);
AddExecutor(ExecutorType.SpSummon, (int)CardId.ArmorMaster);
AddExecutor(ExecutorType.SpSummon, (int)CardId.GramTheShiningStar);
AddExecutor(ExecutorType.SpSummon, (int)CardId.ArmedWing);
AddExecutor(ExecutorType.SpSummon, (int)CardId.BlackWingedDragon);
AddExecutor(ExecutorType.Activate, (int)CardId.MirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.DimensionalPrison, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.DeltaCrowAntiReverse, DeltaCrowAntiReverseEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.BlizzardTheFarNorth);
AddExecutor(ExecutorType.Activate, (int)CardId.ShuraTheBlueFlame);
AddExecutor(ExecutorType.Activate, (int)CardId.BoraTheSpear, BoraTheSpearEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.KalutTheMoonShadow, AttackUpEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.SiroccoTheDawn, AttackUpEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.GaleTheWhirlwind, GaleTheWhirlwindEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.SilverwindTheAscendant);
AddExecutor(ExecutorType.Activate, (int)CardId.BlackWingedDragon);
AddExecutor(ExecutorType.Activate, (int)CardId.ArmorMaster);
AddExecutor(ExecutorType.Activate, (int)CardId.ArmedWing);
AddExecutor(ExecutorType.Activate, (int)CardId.GramTheShiningStar);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, CardId.BlackWhirlwind, BlackWhirlwindEffect);
AddExecutor(ExecutorType.SpSummon, CardId.KrisTheCrackOfDawn);
AddExecutor(ExecutorType.SummonOrSet, CardId.KrisTheCrackOfDawn);
AddExecutor(ExecutorType.Summon, CardId.SiroccoTheDawn, SiroccoTheDawnSummon);
AddExecutor(ExecutorType.Summon, CardId.ShuraTheBlueFlame, ShuraTheBlueFlameSummon);
AddExecutor(ExecutorType.SummonOrSet, CardId.ShuraTheBlueFlame);
AddExecutor(ExecutorType.SpSummon, CardId.BoraTheSpear);
AddExecutor(ExecutorType.SummonOrSet, CardId.BoraTheSpear);
AddExecutor(ExecutorType.SummonOrSet, CardId.KalutTheMoonShadow, KalutTheMoonShadowSummon);
AddExecutor(ExecutorType.SpSummon, CardId.GaleTheWhirlwind);
AddExecutor(ExecutorType.SummonOrSet, CardId.GaleTheWhirlwind);
AddExecutor(ExecutorType.Summon, CardId.BlizzardTheFarNorth, BlizzardTheFarNorthSummon);
AddExecutor(ExecutorType.MonsterSet, CardId.MistralTheSilverShield);
AddExecutor(ExecutorType.SpSummon, CardId.SilverwindTheAscendant);
AddExecutor(ExecutorType.SpSummon, CardId.ArmorMaster);
AddExecutor(ExecutorType.SpSummon, CardId.GramTheShiningStar);
AddExecutor(ExecutorType.SpSummon, CardId.ArmedWing);
AddExecutor(ExecutorType.SpSummon, CardId.BlackWingedDragon);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.DimensionalPrison, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.DeltaCrowAntiReverse, DeltaCrowAntiReverseEffect);
AddExecutor(ExecutorType.Activate, CardId.BlizzardTheFarNorth);
AddExecutor(ExecutorType.Activate, CardId.ShuraTheBlueFlame);
AddExecutor(ExecutorType.Activate, CardId.BoraTheSpear, BoraTheSpearEffect);
AddExecutor(ExecutorType.Activate, CardId.KalutTheMoonShadow, AttackUpEffect);
AddExecutor(ExecutorType.Activate, CardId.SiroccoTheDawn, AttackUpEffect);
AddExecutor(ExecutorType.Activate, CardId.GaleTheWhirlwind, GaleTheWhirlwindEffect);
AddExecutor(ExecutorType.Activate, CardId.SilverwindTheAscendant);
AddExecutor(ExecutorType.Activate, CardId.BlackWingedDragon);
AddExecutor(ExecutorType.Activate, CardId.ArmorMaster);
AddExecutor(ExecutorType.Activate, CardId.ArmedWing);
AddExecutor(ExecutorType.Activate, CardId.GramTheShiningStar);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
......@@ -90,7 +91,7 @@ namespace WindBot.Game.AI.Decks
private bool ShuraTheBlueFlameSummon()
{
if (Bot.HasInMonstersZone((int)CardId.SiroccoTheDawn) && Bot.GetMonsters().GetHighestAttackMonster().Attack < 3800)
if (Bot.HasInMonstersZone(CardId.SiroccoTheDawn) && Bot.GetMonsters().GetHighestAttackMonster().Attack < 3800)
return true;
return false;
}
......@@ -100,7 +101,7 @@ namespace WindBot.Game.AI.Decks
if (Card.Location == CardLocation.Hand && Bot.HasInSpellZone(Card.Id))
return false;
if (ActivateDescription == AI.Utils.GetStringId((int)Card.Id,0))
AI.SelectCard((int)CardId.GaleTheWhirlwind);
AI.SelectCard(CardId.GaleTheWhirlwind);
return true;
}
......@@ -117,7 +118,7 @@ namespace WindBot.Game.AI.Decks
{
List<ClientCard> monster = Bot.GetMonsters();
foreach (ClientCard card in monster)
if (card != null && card.Id == (int)CardId.KrisTheCrackOfDawn || card.Id == (int)CardId.KalutTheMoonShadow || card.Id == (int)CardId.GaleTheWhirlwind || card.Id == (int)CardId.BoraTheSpear || card.Id == (int)CardId.SiroccoTheDawn || card.Id == (int)CardId.ShuraTheBlueFlame || card.Id == (int)CardId.BlizzardTheFarNorth)
if (card != null && card.Id == CardId.KrisTheCrackOfDawn || card.Id == CardId.KalutTheMoonShadow || card.Id == CardId.GaleTheWhirlwind || card.Id == CardId.BoraTheSpear || card.Id == CardId.SiroccoTheDawn || card.Id == CardId.ShuraTheBlueFlame || card.Id == CardId.BlizzardTheFarNorth)
return true;
return false;
}
......@@ -125,7 +126,7 @@ namespace WindBot.Game.AI.Decks
private bool KalutTheMoonShadowSummon()
{
foreach (ClientCard card in Bot.Hand)
if (card != null && card.Id == (int)CardId.KrisTheCrackOfDawn || card.Id == (int)CardId.GaleTheWhirlwind || card.Id == (int)CardId.BoraTheSpear || card.Id == (int)CardId.SiroccoTheDawn || card.Id == (int)CardId.ShuraTheBlueFlame || card.Id == (int)CardId.BlizzardTheFarNorth)
if (card != null && card.Id == CardId.KrisTheCrackOfDawn || card.Id == CardId.GaleTheWhirlwind || card.Id == CardId.BoraTheSpear || card.Id == CardId.SiroccoTheDawn || card.Id == CardId.ShuraTheBlueFlame || card.Id == CardId.BlizzardTheFarNorth)
return false;
return true;
}
......@@ -133,7 +134,7 @@ namespace WindBot.Game.AI.Decks
private bool BlizzardTheFarNorthSummon()
{
foreach (ClientCard card in Bot.Graveyard)
if (card != null && card.Id == (int)CardId.KalutTheMoonShadow || card.Id == (int)CardId.BoraTheSpear || card.Id == (int)CardId.ShuraTheBlueFlame || card.Id == (int)CardId.KrisTheCrackOfDawn)
if (card != null && card.Id == CardId.KalutTheMoonShadow || card.Id == CardId.BoraTheSpear || card.Id == CardId.ShuraTheBlueFlame || card.Id == CardId.KrisTheCrackOfDawn)
return true;
return false;
}
......@@ -144,7 +145,7 @@ namespace WindBot.Game.AI.Decks
List<ClientCard> monster = Bot.GetMonsters();
foreach (ClientCard card in monster)
if (card != null && card.Id == (int)CardId.KrisTheCrackOfDawn || card.Id == (int)CardId.KalutTheMoonShadow || card.Id == (int)CardId.GaleTheWhirlwind || card.Id == (int)CardId.BoraTheSpear || card.Id == (int)CardId.SiroccoTheDawn || card.Id == (int)CardId.ShuraTheBlueFlame || card.Id == (int)CardId.BlizzardTheFarNorth)
if (card != null && card.Id == CardId.KrisTheCrackOfDawn || card.Id == CardId.KalutTheMoonShadow || card.Id == CardId.GaleTheWhirlwind || card.Id == CardId.BoraTheSpear || card.Id == CardId.SiroccoTheDawn || card.Id == CardId.ShuraTheBlueFlame || card.Id == CardId.BlizzardTheFarNorth)
Count++;
if (Count == 3)
......
......@@ -9,37 +9,37 @@ namespace WindBot.Game.AI.Decks
[Deck("Blue-Eyes", "AI_BlueEyes")]
class BlueEyesExecutor : DefaultExecutor
{
public enum CardId
{
WhiteDragon = 89631139,
AlternativeWhiteDragon = 38517737,
DragonSpiritOfWhite = 45467446,
WhiteStoneOfAncients = 71039903,
WhiteStoneOfLegend = 79814787,
SageWithEyesOfBlue = 8240199,
EffectVeiler = 97268402,
GalaxyCyclone = 5133471,
HarpiesFeatherDuster = 18144506,
ReturnOfTheDragonLords = 6853254,
PotOfDesires = 35261759,
TradeIn = 38120068,
CardsOfConsonance = 39701395,
DragonShrine = 41620959,
MelodyOfAwakeningDragon = 48800175,
SoulCharge = 54447022,
MonsterReborn = 83764718,
SilversCry = 87025064,
Giganticastle = 63422098,
AzureEyesSilverDragon = 40908371,
BlueEyesSpiritDragon = 59822133,
GalaxyEyesDarkMatterDragon = 58820923,
GalaxyEyesCipherBladeDragon = 2530830,
GalaxyEyesFullArmorPhotonDragon = 39030163,
GalaxyEyesPrimePhotonDragon = 31801517,
GalaxyEyesCipherDragon = 18963306,
HopeHarbingerDragonTitanicGalaxy = 63767246,
SylvanPrincessprite = 33909817
public class CardId
{
public static int WhiteDragon = 89631139;
public static int AlternativeWhiteDragon = 38517737;
public static int DragonSpiritOfWhite = 45467446;
public static int WhiteStoneOfAncients = 71039903;
public static int WhiteStoneOfLegend = 79814787;
public static int SageWithEyesOfBlue = 8240199;
public static int EffectVeiler = 97268402;
public static int GalaxyCyclone = 5133471;
public static int HarpiesFeatherDuster = 18144506;
public static int ReturnOfTheDragonLords = 6853254;
public static int PotOfDesires = 35261759;
public static int TradeIn = 38120068;
public static int CardsOfConsonance = 39701395;
public static int DragonShrine = 41620959;
public static int MelodyOfAwakeningDragon = 48800175;
public static int SoulCharge = 54447022;
public static int MonsterReborn = 83764718;
public static int SilversCry = 87025064;
public static int Giganticastle = 63422098;
public static int AzureEyesSilverDragon = 40908371;
public static int BlueEyesSpiritDragon = 59822133;
public static int GalaxyEyesDarkMatterDragon = 58820923;
public static int GalaxyEyesCipherBladeDragon = 2530830;
public static int GalaxyEyesFullArmorPhotonDragon = 39030163;
public static int GalaxyEyesPrimePhotonDragon = 31801517;
public static int GalaxyEyesCipherDragon = 18963306;
public static int HopeHarbingerDragonTitanicGalaxy = 63767246;
public static int SylvanPrincessprite = 33909817;
}
private List<ClientCard> UsedAlternativeWhiteDragon = new List<ClientCard>();
......@@ -51,74 +51,74 @@ namespace WindBot.Game.AI.Decks
: base(ai, duel)
{
// destroy traps
AddExecutor(ExecutorType.Activate, (int)CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, (int)CardId.GalaxyCyclone, DefaultGalaxyCyclone);
AddExecutor(ExecutorType.Activate, (int)CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, CardId.GalaxyCyclone, DefaultGalaxyCyclone);
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, (int)CardId.DragonShrine, DragonShrineEffect);
AddExecutor(ExecutorType.Activate, CardId.DragonShrine, DragonShrineEffect);
// Sage search
AddExecutor(ExecutorType.Summon, (int)CardId.SageWithEyesOfBlue, SageWithEyesOfBlueSummon);
AddExecutor(ExecutorType.Summon, CardId.SageWithEyesOfBlue, SageWithEyesOfBlueSummon);
// search Alternative White Dragon
AddExecutor(ExecutorType.Activate, (int)CardId.MelodyOfAwakeningDragon, MelodyOfAwakeningDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.MelodyOfAwakeningDragon, MelodyOfAwakeningDragonEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.CardsOfConsonance, CardsOfConsonanceEffect);
AddExecutor(ExecutorType.Activate, CardId.CardsOfConsonance, CardsOfConsonanceEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.TradeIn, TradeInEffect);
AddExecutor(ExecutorType.Activate, CardId.TradeIn, TradeInEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.PotOfDesires, DefaultPotOfDesires);
AddExecutor(ExecutorType.Activate, CardId.PotOfDesires, DefaultPotOfDesires);
// spsummon Alternative White Dragon if possible
AddExecutor(ExecutorType.SpSummon, (int)CardId.AlternativeWhiteDragon, AlternativeWhiteDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.AlternativeWhiteDragon, AlternativeWhiteDragonSummon);
// reborn
AddExecutor(ExecutorType.Activate, (int)CardId.ReturnOfTheDragonLords, RebornEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.SilversCry, RebornEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.MonsterReborn, RebornEffect);
AddExecutor(ExecutorType.Activate, CardId.ReturnOfTheDragonLords, RebornEffect);
AddExecutor(ExecutorType.Activate, CardId.SilversCry, RebornEffect);
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, RebornEffect);
// monster effects
AddExecutor(ExecutorType.Activate, (int)CardId.AlternativeWhiteDragon, AlternativeWhiteDragonEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.SageWithEyesOfBlue, SageWithEyesOfBlueEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.WhiteStoneOfAncients, WhiteStoneOfAncientsEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.DragonSpiritOfWhite, DragonSpiritOfWhiteEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.BlueEyesSpiritDragon, BlueEyesSpiritDragonEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.HopeHarbingerDragonTitanicGalaxy, HopeHarbingerDragonTitanicGalaxyEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.GalaxyEyesCipherDragon, GalaxyEyesCipherDragonEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.GalaxyEyesPrimePhotonDragon, GalaxyEyesPrimePhotonDragonEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.GalaxyEyesFullArmorPhotonDragon, GalaxyEyesFullArmorPhotonDragonEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.GalaxyEyesCipherBladeDragon, GalaxyEyesCipherBladeDragonEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.GalaxyEyesDarkMatterDragon, GalaxyEyesDarkMatterDragonEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.AzureEyesSilverDragon, AzureEyesSilverDragonEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.SylvanPrincessprite, SylvanPrincesspriteEffect);
AddExecutor(ExecutorType.Activate, CardId.AlternativeWhiteDragon, AlternativeWhiteDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.SageWithEyesOfBlue, SageWithEyesOfBlueEffect);
AddExecutor(ExecutorType.Activate, CardId.WhiteStoneOfAncients, WhiteStoneOfAncientsEffect);
AddExecutor(ExecutorType.Activate, CardId.DragonSpiritOfWhite, DragonSpiritOfWhiteEffect);
AddExecutor(ExecutorType.Activate, CardId.BlueEyesSpiritDragon, BlueEyesSpiritDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.HopeHarbingerDragonTitanicGalaxy, HopeHarbingerDragonTitanicGalaxyEffect);
AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesCipherDragon, GalaxyEyesCipherDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesPrimePhotonDragon, GalaxyEyesPrimePhotonDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesFullArmorPhotonDragon, GalaxyEyesFullArmorPhotonDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesCipherBladeDragon, GalaxyEyesCipherBladeDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesDarkMatterDragon, GalaxyEyesDarkMatterDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.AzureEyesSilverDragon, AzureEyesSilverDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.SylvanPrincessprite, SylvanPrincesspriteEffect);
// normal summon
AddExecutor(ExecutorType.Summon, (int)CardId.SageWithEyesOfBlue, WhiteStoneSummon);
AddExecutor(ExecutorType.Summon, (int)CardId.WhiteStoneOfAncients, WhiteStoneSummon);
AddExecutor(ExecutorType.Summon, (int)CardId.WhiteStoneOfLegend, WhiteStoneSummon);
AddExecutor(ExecutorType.Summon, CardId.SageWithEyesOfBlue, WhiteStoneSummon);
AddExecutor(ExecutorType.Summon, CardId.WhiteStoneOfAncients, WhiteStoneSummon);
AddExecutor(ExecutorType.Summon, CardId.WhiteStoneOfLegend, WhiteStoneSummon);
// special summon from extra
AddExecutor(ExecutorType.SpSummon, (int)CardId.GalaxyEyesCipherDragon, GalaxyEyesCipherDragonSummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.GalaxyEyesPrimePhotonDragon, GalaxyEyesPrimePhotonDragonSumom);
AddExecutor(ExecutorType.SpSummon, (int)CardId.GalaxyEyesFullArmorPhotonDragon, GalaxyEyesFullArmorPhotonDragonSummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.GalaxyEyesCipherBladeDragon, GalaxyEyesCipherBladeDragonSummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.GalaxyEyesDarkMatterDragon, GalaxyEyesDarkMatterDragonSummom);
AddExecutor(ExecutorType.SpSummon, (int)CardId.Giganticastle, GiganticastleSummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.BlueEyesSpiritDragon, BlueEyesSpiritDragonSummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.HopeHarbingerDragonTitanicGalaxy, HopeHarbingerDragonTitanicGalaxySummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.SylvanPrincessprite, SylvanPrincesspriteSummon);
AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesCipherDragon, GalaxyEyesCipherDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesPrimePhotonDragon, GalaxyEyesPrimePhotonDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesFullArmorPhotonDragon, GalaxyEyesFullArmorPhotonDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesCipherBladeDragon, GalaxyEyesCipherBladeDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesDarkMatterDragon, GalaxyEyesDarkMatterDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.Giganticastle, GiganticastleSummon);
AddExecutor(ExecutorType.SpSummon, CardId.BlueEyesSpiritDragon, BlueEyesSpiritDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.HopeHarbingerDragonTitanicGalaxy, HopeHarbingerDragonTitanicGalaxySummon);
AddExecutor(ExecutorType.SpSummon, CardId.SylvanPrincessprite, SylvanPrincesspriteSummon);
// if we don't have other things to do...
AddExecutor(ExecutorType.Activate, (int)CardId.SoulCharge, SoulChargeEffect);
AddExecutor(ExecutorType.Activate, CardId.SoulCharge, SoulChargeEffect);
AddExecutor(ExecutorType.Repos, Repos);
// summon White Stone to use the hand effect of Sage
AddExecutor(ExecutorType.Summon, (int)CardId.WhiteStoneOfLegend, WhiteStoneSummonForSage);
AddExecutor(ExecutorType.Summon, (int)CardId.WhiteStoneOfAncients, WhiteStoneSummonForSage);
AddExecutor(ExecutorType.Summon, (int)CardId.SageWithEyesOfBlue, WhiteStoneSummonForSage);
AddExecutor(ExecutorType.Activate, (int)CardId.SageWithEyesOfBlue, SageWithEyesOfBlueEffectInHand);
AddExecutor(ExecutorType.Summon, CardId.WhiteStoneOfLegend, WhiteStoneSummonForSage);
AddExecutor(ExecutorType.Summon, CardId.WhiteStoneOfAncients, WhiteStoneSummonForSage);
AddExecutor(ExecutorType.Summon, CardId.SageWithEyesOfBlue, WhiteStoneSummonForSage);
AddExecutor(ExecutorType.Activate, CardId.SageWithEyesOfBlue, SageWithEyesOfBlueEffectInHand);
// set White Stone of Legend frist
AddExecutor(ExecutorType.MonsterSet, (int)CardId.WhiteStoneOfLegend);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.WhiteStoneOfAncients);
AddExecutor(ExecutorType.MonsterSet, CardId.WhiteStoneOfLegend);
AddExecutor(ExecutorType.MonsterSet, CardId.WhiteStoneOfAncients);
AddExecutor(ExecutorType.SpellSet, SpellSet);
}
......@@ -144,11 +144,11 @@ namespace WindBot.Game.AI.Decks
{
Logger.DebugWriteLine("OnSelectCard MelodyOfAwakeningDragon");
IList<ClientCard> result = new List<ClientCard>();
if (!Bot.HasInHand((int)CardId.WhiteDragon))
if (!Bot.HasInHand(CardId.WhiteDragon))
{
foreach (ClientCard card in cards)
{
if (card.Id == (int)CardId.WhiteDragon)
if (card.Id == CardId.WhiteDragon)
{
result.Add(card);
break;
......@@ -157,7 +157,7 @@ namespace WindBot.Game.AI.Decks
}
foreach (ClientCard card in cards)
{
if (card.Id == (int)CardId.AlternativeWhiteDragon && result.Count < max)
if (card.Id == CardId.AlternativeWhiteDragon && result.Count < max)
{
result.Add(card);
}
......@@ -245,22 +245,22 @@ namespace WindBot.Game.AI.Decks
{
AI.SelectCard(new[]
{
(int)CardId.DragonSpiritOfWhite,
(int)CardId.WhiteDragon,
(int)CardId.WhiteStoneOfAncients,
(int)CardId.WhiteStoneOfLegend
CardId.DragonSpiritOfWhite,
CardId.WhiteDragon,
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend
});
if (!Bot.HasInHand((int)CardId.WhiteDragon))
if (!Bot.HasInHand(CardId.WhiteDragon))
{
AI.SelectNextCard((int)CardId.WhiteStoneOfLegend);
AI.SelectNextCard(CardId.WhiteStoneOfLegend);
}
else
{
AI.SelectNextCard(new[]
{
(int)CardId.WhiteStoneOfAncients,
(int)CardId.DragonSpiritOfWhite,
(int)CardId.WhiteStoneOfLegend
CardId.WhiteStoneOfAncients,
CardId.DragonSpiritOfWhite,
CardId.WhiteStoneOfLegend
});
}
return true;
......@@ -270,57 +270,57 @@ namespace WindBot.Game.AI.Decks
{
AI.SelectCard(new[]
{
(int)CardId.WhiteStoneOfAncients,
(int)CardId.DragonSpiritOfWhite,
(int)CardId.WhiteStoneOfLegend,
(int)CardId.GalaxyCyclone,
(int)CardId.EffectVeiler,
(int)CardId.TradeIn,
(int)CardId.SageWithEyesOfBlue
CardId.WhiteStoneOfAncients,
CardId.DragonSpiritOfWhite,
CardId.WhiteStoneOfLegend,
CardId.GalaxyCyclone,
CardId.EffectVeiler,
CardId.TradeIn,
CardId.SageWithEyesOfBlue
});
return true;
}
private bool CardsOfConsonanceEffect()
{
if (!Bot.HasInHand((int)CardId.WhiteDragon))
if (!Bot.HasInHand(CardId.WhiteDragon))
{
AI.SelectCard((int)CardId.WhiteStoneOfLegend);
AI.SelectCard(CardId.WhiteStoneOfLegend);
}
else if (Bot.HasInHand((int)CardId.TradeIn))
else if (Bot.HasInHand(CardId.TradeIn))
{
AI.SelectCard((int)CardId.WhiteStoneOfLegend);
AI.SelectCard(CardId.WhiteStoneOfLegend);
}
else
{
AI.SelectCard((int)CardId.WhiteStoneOfAncients);
AI.SelectCard(CardId.WhiteStoneOfAncients);
}
return true;
}
private bool TradeInEffect()
{
if (Bot.HasInHand((int)CardId.DragonSpiritOfWhite))
if (Bot.HasInHand(CardId.DragonSpiritOfWhite))
{
AI.SelectCard((int)CardId.DragonSpiritOfWhite);
AI.SelectCard(CardId.DragonSpiritOfWhite);
return true;
}
else if (HasTwoInHand((int)CardId.WhiteDragon))
else if (HasTwoInHand(CardId.WhiteDragon))
{
AI.SelectCard((int)CardId.WhiteDragon);
AI.SelectCard(CardId.WhiteDragon);
return true;
}
else if (HasTwoInHand((int)CardId.AlternativeWhiteDragon))
else if (HasTwoInHand(CardId.AlternativeWhiteDragon))
{
AI.SelectCard((int)CardId.AlternativeWhiteDragon);
AI.SelectCard(CardId.AlternativeWhiteDragon);
return true;
}
else if (!Bot.HasInHand((int)CardId.WhiteDragon) || !Bot.HasInHand((int)CardId.AlternativeWhiteDragon))
else if (!Bot.HasInHand(CardId.WhiteDragon) || !Bot.HasInHand(CardId.AlternativeWhiteDragon))
{
AI.SelectCard(new[]
{
(int)CardId.WhiteDragon,
(int)CardId.AlternativeWhiteDragon
CardId.WhiteDragon,
CardId.AlternativeWhiteDragon
});
return true;
}
......@@ -332,28 +332,7 @@ namespace WindBot.Game.AI.Decks
private bool AlternativeWhiteDragonEffect()
{
ClientCard card = Enemy.MonsterZone.GetFloodgate();
if (card != null)
{
AI.SelectCard(card);
UsedAlternativeWhiteDragon.Add(Card);
return true;
}
card = Enemy.MonsterZone.GetInvincibleMonster();
if (card != null)
{
AI.SelectCard(card);
UsedAlternativeWhiteDragon.Add(Card);
return true;
}
card = Enemy.MonsterZone.GetDangerousMonster();
if (card != null)
{
AI.SelectCard(card);
UsedAlternativeWhiteDragon.Add(Card);
return true;
}
card = AI.Utils.GetOneEnemyBetterThanValue(Card.GetDefensePower(), false);
ClientCard card = AI.Utils.GetProblematicEnemyMonster(Card.GetDefensePower());
if (card != null)
{
AI.SelectCard(card);
......@@ -362,6 +341,8 @@ namespace WindBot.Game.AI.Decks
}
if (CanDealWithUsedAlternativeWhiteDragon())
{
card = AI.Utils.GetBestEnemyMonster();
AI.SelectCard(card);
UsedAlternativeWhiteDragon.Add(Card);
return true;
}
......@@ -381,22 +362,22 @@ namespace WindBot.Game.AI.Decks
return false;
}
List<int> targets = new List<int> {
(int)CardId.HopeHarbingerDragonTitanicGalaxy,
(int)CardId.GalaxyEyesDarkMatterDragon,
(int)CardId.AlternativeWhiteDragon,
(int)CardId.AzureEyesSilverDragon,
(int)CardId.BlueEyesSpiritDragon,
(int)CardId.WhiteDragon,
(int)CardId.DragonSpiritOfWhite
CardId.HopeHarbingerDragonTitanicGalaxy,
CardId.GalaxyEyesDarkMatterDragon,
CardId.AlternativeWhiteDragon,
CardId.AzureEyesSilverDragon,
CardId.BlueEyesSpiritDragon,
CardId.WhiteDragon,
CardId.DragonSpiritOfWhite
};
if (!Bot.HasInGraveyard(targets))
{
return false;
}
ClientCard floodgate = Enemy.SpellZone.GetFloodgate();
if (floodgate != null && Bot.HasInGraveyard((int)CardId.DragonSpiritOfWhite))
if (floodgate != null && Bot.HasInGraveyard(CardId.DragonSpiritOfWhite))
{
AI.SelectCard((int)CardId.DragonSpiritOfWhite);
AI.SelectCard(CardId.DragonSpiritOfWhite);
}
else
{
......@@ -409,11 +390,11 @@ namespace WindBot.Game.AI.Decks
{
if (Enemy.GetSpellCount() > 0)
{
AI.SelectCard((int)CardId.DragonSpiritOfWhite);
AI.SelectCard(CardId.DragonSpiritOfWhite);
}
else
{
AI.SelectCard((int)CardId.WhiteDragon);
AI.SelectCard(CardId.WhiteDragon);
}
return true;
}
......@@ -422,8 +403,8 @@ namespace WindBot.Game.AI.Decks
{
return !Bot.HasInHand(new List<int>
{
(int)CardId.WhiteStoneOfAncients,
(int)CardId.WhiteStoneOfLegend
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend
});
}
......@@ -435,16 +416,16 @@ namespace WindBot.Game.AI.Decks
}
AI.SelectCard(new[]
{
(int)CardId.WhiteStoneOfAncients,
(int)CardId.EffectVeiler,
(int)CardId.WhiteStoneOfLegend
CardId.WhiteStoneOfAncients,
CardId.EffectVeiler,
CardId.WhiteStoneOfLegend
});
return true;
}
private bool WhiteStoneSummonForSage()
{
return Bot.HasInHand((int)CardId.SageWithEyesOfBlue);
return Bot.HasInHand(CardId.SageWithEyesOfBlue);
}
private bool SageWithEyesOfBlueEffectInHand()
......@@ -455,30 +436,30 @@ namespace WindBot.Game.AI.Decks
}
if (!Bot.HasInMonstersZone(new List<int>
{
(int)CardId.WhiteStoneOfLegend,
(int)CardId.WhiteStoneOfAncients
CardId.WhiteStoneOfLegend,
CardId.WhiteStoneOfAncients
}) || Bot.HasInMonstersZone(new List<int>
{
(int)CardId.AlternativeWhiteDragon,
(int)CardId.WhiteDragon,
(int)CardId.DragonSpiritOfWhite
CardId.AlternativeWhiteDragon,
CardId.WhiteDragon,
CardId.DragonSpiritOfWhite
}))
{
return false;
}
AI.SelectCard(new[]
{
(int)CardId.WhiteStoneOfLegend,
(int)CardId.WhiteStoneOfAncients
CardId.WhiteStoneOfLegend,
CardId.WhiteStoneOfAncients
});
List<ClientCard> spells = Enemy.GetSpells();
if (spells.Count == 0)
{
AI.SelectNextCard((int)CardId.WhiteDragon);
AI.SelectNextCard(CardId.WhiteDragon);
}
else
{
AI.SelectNextCard((int)CardId.DragonSpiritOfWhite);
AI.SelectNextCard(CardId.DragonSpiritOfWhite);
}
return true;
}
......@@ -487,7 +468,7 @@ namespace WindBot.Game.AI.Decks
{
if (ActivateDescription == -1)
{
ClientCard target = Enemy.SpellZone.GetFloodgate();
ClientCard target = AI.Utils.GetBestEnemySpell();
AI.SelectCard(target);
return true;
}
......@@ -500,49 +481,43 @@ namespace WindBot.Game.AI.Decks
if (Duel.Player == 1 && Duel.Phase == DuelPhase.End)
{
return HaveEnoughWhiteDragonInHand()
&& Bot.HasInMonstersZone((int)CardId.AzureEyesSilverDragon, true)
&& !Bot.HasInGraveyard((int)CardId.DragonSpiritOfWhite)
&& !Bot.HasInGraveyard((int)CardId.WhiteDragon);
&& Bot.HasInMonstersZone(CardId.AzureEyesSilverDragon, true)
&& !Bot.HasInGraveyard(CardId.DragonSpiritOfWhite)
&& !Bot.HasInGraveyard(CardId.WhiteDragon);
}
foreach (ClientCard card in Duel.ChainTargets)
{
if (Card.Equals(card))
if (AI.Utils.IsChainTarget(Card))
{
return HaveEnoughWhiteDragonInHand();
}
}
return false;
}
}
private bool BlueEyesSpiritDragonEffect()
{
if (ActivateDescription == -1 || ActivateDescription == AI.Utils.GetStringId((int)CardId.BlueEyesSpiritDragon, 0))
if (ActivateDescription == -1 || ActivateDescription == AI.Utils.GetStringId(CardId.BlueEyesSpiritDragon, 0))
{
return LastChainPlayer == 1;
}
else if (Duel.Player == 1 && (Duel.Phase == DuelPhase.BattleStart || Duel.Phase == DuelPhase.End))
{
AI.SelectCard((int)CardId.AzureEyesSilverDragon);
AI.SelectCard(CardId.AzureEyesSilverDragon);
return true;
}
else
{
foreach (ClientCard card in Duel.ChainTargets)
if (AI.Utils.IsChainTarget(Card))
{
if (Card.Equals(card))
{
AI.SelectCard((int)CardId.AzureEyesSilverDragon);
AI.SelectCard(CardId.AzureEyesSilverDragon);
return true;
}
}
return false;
}
}
private bool HopeHarbingerDragonTitanicGalaxyEffect()
{
if (ActivateDescription == -1 || ActivateDescription == AI.Utils.GetStringId((int)CardId.HopeHarbingerDragonTitanicGalaxy, 0))
if (ActivateDescription == -1 || ActivateDescription == AI.Utils.GetStringId(CardId.HopeHarbingerDragonTitanicGalaxy, 0))
{
return LastChainPlayer == 1;
}
......@@ -551,31 +526,31 @@ namespace WindBot.Game.AI.Decks
private bool WhiteStoneOfAncientsEffect()
{
if (ActivateDescription == AI.Utils.GetStringId((int)CardId.WhiteStoneOfAncients, 0))
if (ActivateDescription == AI.Utils.GetStringId(CardId.WhiteStoneOfAncients, 0))
{
if (Bot.HasInHand((int)CardId.TradeIn)
&& !Bot.HasInHand((int)CardId.WhiteDragon)
&& !Bot.HasInHand((int)CardId.AlternativeWhiteDragon))
if (Bot.HasInHand(CardId.TradeIn)
&& !Bot.HasInHand(CardId.WhiteDragon)
&& !Bot.HasInHand(CardId.AlternativeWhiteDragon))
{
AI.SelectCard((int)CardId.WhiteDragon);
AI.SelectCard(CardId.WhiteDragon);
return true;
}
if (AlternativeWhiteDragonSummoned)
{
return false;
}
if (Bot.HasInHand((int)CardId.WhiteDragon)
&& !Bot.HasInHand((int)CardId.AlternativeWhiteDragon)
&& Bot.HasInGraveyard((int)CardId.AlternativeWhiteDragon))
if (Bot.HasInHand(CardId.WhiteDragon)
&& !Bot.HasInHand(CardId.AlternativeWhiteDragon)
&& Bot.HasInGraveyard(CardId.AlternativeWhiteDragon))
{
AI.SelectCard((int)CardId.AlternativeWhiteDragon);
AI.SelectCard(CardId.AlternativeWhiteDragon);
return true;
}
if (Bot.HasInHand((int)CardId.AlternativeWhiteDragon)
&& !Bot.HasInHand((int)CardId.WhiteDragon)
&& Bot.HasInGraveyard((int)CardId.WhiteDragon))
if (Bot.HasInHand(CardId.AlternativeWhiteDragon)
&& !Bot.HasInHand(CardId.WhiteDragon)
&& Bot.HasInGraveyard(CardId.WhiteDragon))
{
AI.SelectCard((int)CardId.WhiteDragon);
AI.SelectCard(CardId.WhiteDragon);
return true;
}
return false;
......@@ -585,11 +560,11 @@ namespace WindBot.Game.AI.Decks
List<ClientCard> spells = Enemy.GetSpells();
if (spells.Count == 0)
{
AI.SelectCard((int)CardId.WhiteDragon);
AI.SelectCard(CardId.WhiteDragon);
}
else
{
AI.SelectCard((int)CardId.DragonSpiritOfWhite);
AI.SelectCard(CardId.DragonSpiritOfWhite);
}
return true;
}
......@@ -605,12 +580,12 @@ namespace WindBot.Game.AI.Decks
{
return Bot.HasInMonstersZone(new List<int>
{
(int)CardId.SageWithEyesOfBlue,
(int)CardId.WhiteStoneOfAncients,
(int)CardId.WhiteStoneOfLegend,
(int)CardId.AlternativeWhiteDragon,
(int)CardId.WhiteDragon,
(int)CardId.DragonSpiritOfWhite
CardId.SageWithEyesOfBlue,
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend,
CardId.AlternativeWhiteDragon,
CardId.WhiteDragon,
CardId.DragonSpiritOfWhite
});
}
......@@ -638,7 +613,7 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool GalaxyEyesPrimePhotonDragonSumom()
private bool GalaxyEyesPrimePhotonDragonSummon()
{
if (Duel.Turn == 1)
{
......@@ -653,7 +628,7 @@ namespace WindBot.Game.AI.Decks
private bool GalaxyEyesFullArmorPhotonDragonSummon()
{
if (Bot.HasInMonstersZone((int)CardId.GalaxyEyesCipherDragon))
if (Bot.HasInMonstersZone(CardId.GalaxyEyesCipherDragon))
{
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
......@@ -666,11 +641,11 @@ namespace WindBot.Game.AI.Decks
}
}
}
if (Bot.HasInMonstersZone((int)CardId.GalaxyEyesPrimePhotonDragon))
if (Bot.HasInMonstersZone(CardId.GalaxyEyesPrimePhotonDragon))
{
if (!AI.Utils.IsOneEnemyBetterThanValue(4000, false))
{
AI.SelectCard((int)CardId.GalaxyEyesPrimePhotonDragon);
AI.SelectCard(CardId.GalaxyEyesPrimePhotonDragon);
return true;
}
}
......@@ -679,19 +654,19 @@ namespace WindBot.Game.AI.Decks
private bool GalaxyEyesCipherBladeDragonSummon()
{
if (Bot.HasInMonstersZone((int)CardId.GalaxyEyesFullArmorPhotonDragon) && AI.Utils.GetProblematicCard() != null)
if (Bot.HasInMonstersZone(CardId.GalaxyEyesFullArmorPhotonDragon) && AI.Utils.GetProblematicEnemyCard() != null)
{
AI.SelectCard((int)CardId.GalaxyEyesFullArmorPhotonDragon);
AI.SelectCard(CardId.GalaxyEyesFullArmorPhotonDragon);
return true;
}
return false;
}
private bool GalaxyEyesDarkMatterDragonSummom()
private bool GalaxyEyesDarkMatterDragonSummon()
{
if (Bot.HasInMonstersZone((int)CardId.GalaxyEyesFullArmorPhotonDragon))
if (Bot.HasInMonstersZone(CardId.GalaxyEyesFullArmorPhotonDragon))
{
AI.SelectCard((int)CardId.GalaxyEyesFullArmorPhotonDragon);
AI.SelectCard(CardId.GalaxyEyesFullArmorPhotonDragon);
return true;
}
return false;
......@@ -729,22 +704,22 @@ namespace WindBot.Game.AI.Decks
private bool GalaxyEyesFullArmorPhotonDragonEffect()
{
ClientCard floodgate = Enemy.SpellZone.GetFloodgate();
if (floodgate != null)
ClientCard target = AI.Utils.GetProblematicEnemySpell();
if (target != null)
{
AI.SelectCard(floodgate);
AI.SelectCard(target);
return true;
}
floodgate = Enemy.MonsterZone.GetFloodgate();
if (floodgate != null)
target = AI.Utils.GetProblematicEnemyMonster();
if (target != null)
{
AI.SelectCard(floodgate);
AI.SelectCard(target);
return true;
}
List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells)
{
if (!spell.IsFacedown())
if (spell.IsFaceup())
{
AI.SelectCard(spell);
return true;
......@@ -787,7 +762,7 @@ namespace WindBot.Game.AI.Decks
{
return true;
}
ClientCard target = AI.Utils.GetProblematicCard();
ClientCard target = AI.Utils.GetProblematicEnemyCard();
if (target != null)
{
AI.SelectCard(target);
......@@ -828,17 +803,17 @@ namespace WindBot.Game.AI.Decks
{
AI.SelectCard(new[]
{
(int)CardId.WhiteStoneOfAncients,
(int)CardId.WhiteStoneOfLegend,
(int)CardId.DragonSpiritOfWhite,
(int)CardId.WhiteDragon
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend,
CardId.DragonSpiritOfWhite,
CardId.WhiteDragon
});
AI.SelectNextCard(new[]
{
(int)CardId.WhiteStoneOfAncients,
(int)CardId.WhiteStoneOfLegend,
(int)CardId.DragonSpiritOfWhite,
(int)CardId.WhiteDragon
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend,
CardId.DragonSpiritOfWhite,
CardId.WhiteDragon
});
return true;
}
......@@ -847,8 +822,8 @@ namespace WindBot.Game.AI.Decks
{
if (Duel.Phase != DuelPhase.Main1 || Duel.Turn == 1 || SoulChargeUsed)
return false;
int bestSelfAttack = AI.Utils.GetBestAttack(Bot, false);
int bestEnemyAttack = AI.Utils.GetBestAttack(Enemy, false);
int bestSelfAttack = AI.Utils.GetBestAttack(Bot);
int bestEnemyAttack = AI.Utils.GetBestPower(Enemy);
return bestSelfAttack <= bestEnemyAttack && bestEnemyAttack > 2500 && bestEnemyAttack <= 3100;
}
......@@ -902,9 +877,9 @@ namespace WindBot.Game.AI.Decks
}
if (Duel.Phase == DuelPhase.Main1 && !Bot.HasInMonstersZone(new List<int>
{
(int)CardId.AlternativeWhiteDragon,
(int)CardId.WhiteDragon,
(int)CardId.DragonSpiritOfWhite
CardId.AlternativeWhiteDragon,
CardId.WhiteDragon,
CardId.DragonSpiritOfWhite
}))
{
return true;
......@@ -920,15 +895,15 @@ namespace WindBot.Game.AI.Decks
{
AI.SelectCard(new[]
{
(int)CardId.WhiteStoneOfLegend,
(int)CardId.WhiteStoneOfAncients
CardId.WhiteStoneOfLegend,
CardId.WhiteStoneOfAncients
});
return true;
}
private bool SoulChargeEffect()
{
if (Bot.HasInMonstersZone((int)CardId.BlueEyesSpiritDragon, true))
if (Bot.HasInMonstersZone(CardId.BlueEyesSpiritDragon, true))
return false;
int count = Bot.GetGraveyardMonsters().Count;
int space = 5 - Bot.GetMonsterCount();
......@@ -958,14 +933,14 @@ namespace WindBot.Game.AI.Decks
}
AI.SelectCard(new[]
{
(int)CardId.BlueEyesSpiritDragon,
(int)CardId.HopeHarbingerDragonTitanicGalaxy,
(int)CardId.AlternativeWhiteDragon,
(int)CardId.WhiteDragon,
(int)CardId.DragonSpiritOfWhite,
(int)CardId.AzureEyesSilverDragon,
(int)CardId.WhiteStoneOfAncients,
(int)CardId.WhiteStoneOfLegend
CardId.BlueEyesSpiritDragon,
CardId.HopeHarbingerDragonTitanicGalaxy,
CardId.AlternativeWhiteDragon,
CardId.WhiteDragon,
CardId.DragonSpiritOfWhite,
CardId.AzureEyesSilverDragon,
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend
});
SoulChargeUsed = true;
return true;
......@@ -973,7 +948,7 @@ namespace WindBot.Game.AI.Decks
private bool Repos()
{
bool enemyBetter = AI.Utils.IsEnemyBetter(true, true);
bool enemyBetter = AI.Utils.IsAllEnemyBetter(true);
if (Card.IsAttack() && enemyBetter)
return true;
......@@ -982,14 +957,14 @@ namespace WindBot.Game.AI.Decks
if (Card.IsDefense() && !enemyBetter && Card.Attack >= Card.Defense)
return true;
if (Card.IsDefense() && (
Card.Id == (int)CardId.BlueEyesSpiritDragon
|| Card.Id == (int)CardId.AzureEyesSilverDragon
Card.Id == CardId.BlueEyesSpiritDragon
|| Card.Id == CardId.AzureEyesSilverDragon
))
return true;
if (Card.IsAttack() && (
Card.Id == (int)CardId.SageWithEyesOfBlue
|| Card.Id == (int)CardId.WhiteStoneOfAncients
|| Card.Id == (int)CardId.WhiteStoneOfLegend
Card.Id == CardId.SageWithEyesOfBlue
|| Card.Id == CardId.WhiteStoneOfAncients
|| Card.Id == CardId.WhiteStoneOfLegend
))
return true;
return false;
......@@ -997,7 +972,7 @@ namespace WindBot.Game.AI.Decks
private bool SpellSet()
{
return (Card.IsTrap() || (Card.Id==(int)CardId.SilversCry)) && Bot.GetSpellCountWithoutField() < 4;
return (Card.IsTrap() || (Card.Id==CardId.SilversCry)) && Bot.GetSpellCountWithoutField() < 4;
}
private bool HasTwoInHand(int id)
......@@ -1015,19 +990,19 @@ namespace WindBot.Game.AI.Decks
{
return Bot.HasInMonstersZone(new List<int>
{
(int)CardId.SageWithEyesOfBlue,
(int)CardId.WhiteStoneOfAncients,
(int)CardId.WhiteStoneOfLegend,
(int)CardId.WhiteDragon,
(int)CardId.DragonSpiritOfWhite
}) || Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.AlternativeWhiteDragon)>=2 ;
CardId.SageWithEyesOfBlue,
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend,
CardId.WhiteDragon,
CardId.DragonSpiritOfWhite
}) || Bot.GetCountCardInZone(Bot.MonsterZone, CardId.AlternativeWhiteDragon)>=2 ;
}
private bool HaveEnoughWhiteDragonInHand()
{
return HasTwoInHand((int)CardId.WhiteDragon) || (
Bot.HasInGraveyard((int)CardId.WhiteDragon)
&& Bot.HasInGraveyard((int)CardId.WhiteStoneOfAncients)
return HasTwoInHand(CardId.WhiteDragon) || (
Bot.HasInGraveyard(CardId.WhiteDragon)
&& Bot.HasInGraveyard(CardId.WhiteStoneOfAncients)
);
}
}
......
......@@ -6,33 +6,33 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Burn", "AI_Burn")]
[Deck("Burn", "AI_Burn", "Easy")]
public class BurnExecutor : DefaultExecutor
{
public enum CardId
public class CardId
{
LavaGolem = 102380,
ReflectBounder = 2851070,
FencingFireFerret = 97396380,
BlastSphere = 26302522,
Marshmallon = 31305911,
SpiritReaper = 23205979,
NaturiaBeans = 44789585,
ThunderShort = 20264508,
Ookazi = 19523799,
GoblinThief = 45311864,
TremendousFire = 46918794,
SwordsOfRevealingLight = 72302403,
SupremacyBerry = 98380593,
ChainEnergy = 79323590,
DarkRoomofNightmare = 85562745,
PoisonOfTheOldMan = 8842266,
OjamaTrio = 29843091,
Ceasefire = 36468556,
MagicCylinder = 62279055,
MinorGoblinOfficial = 1918087,
ChainBurst = 48276469,
SkullInvitation = 98139712
public static int LavaGolem = 102380;
public static int ReflectBounder = 2851070;
public static int FencingFireFerret = 97396380;
public static int BlastSphere = 26302522;
public static int Marshmallon = 31305911;
public static int SpiritReaper = 23205979;
public static int NaturiaBeans = 44789585;
public static int ThunderShort = 20264508;
public static int Ookazi = 19523799;
public static int GoblinThief = 45311864;
public static int TremendousFire = 46918794;
public static int SwordsOfRevealingLight = 72302403;
public static int SupremacyBerry = 98380593;
public static int ChainEnergy = 79323590;
public static int DarkRoomofNightmare = 85562745;
public static int PoisonOfTheOldMan = 8842266;
public static int OjamaTrio = 29843091;
public static int Ceasefire = 36468556;
public static int MagicCylinder = 62279055;
public static int MinorGoblinOfficial = 1918087;
public static int ChainBurst = 48276469;
public static int SkullInvitation = 98139712;
}
public BurnExecutor(GameAI ai, Duel duel)
......@@ -42,39 +42,39 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
// Activate Spells
AddExecutor(ExecutorType.Activate, (int)CardId.DarkRoomofNightmare);
AddExecutor(ExecutorType.Activate, (int)CardId.Ookazi);
AddExecutor(ExecutorType.Activate, (int)CardId.GoblinThief);
AddExecutor(ExecutorType.Activate, (int)CardId.TremendousFire);
AddExecutor(ExecutorType.Activate, (int)CardId.SwordsOfRevealingLight, SwordsOfRevealingLight);
AddExecutor(ExecutorType.Activate, (int)CardId.SupremacyBerry, SupremacyBerry);
AddExecutor(ExecutorType.Activate, (int)CardId.PoisonOfTheOldMan, PoisonOfTheOldMan);
AddExecutor(ExecutorType.Activate, (int)CardId.ThunderShort, ThunderShort);
AddExecutor(ExecutorType.Activate, CardId.DarkRoomofNightmare);
AddExecutor(ExecutorType.Activate, CardId.Ookazi);
AddExecutor(ExecutorType.Activate, CardId.GoblinThief);
AddExecutor(ExecutorType.Activate, CardId.TremendousFire);
AddExecutor(ExecutorType.Activate, CardId.SwordsOfRevealingLight, SwordsOfRevealingLight);
AddExecutor(ExecutorType.Activate, CardId.SupremacyBerry, SupremacyBerry);
AddExecutor(ExecutorType.Activate, CardId.PoisonOfTheOldMan, PoisonOfTheOldMan);
AddExecutor(ExecutorType.Activate, CardId.ThunderShort, ThunderShort);
// Hello, my name is Lava Golem
AddExecutor(ExecutorType.SpSummon, (int)CardId.LavaGolem, LavaGolem);
AddExecutor(ExecutorType.SpSummon, CardId.LavaGolem, LavaGolem);
// Set an invincible monster
AddExecutor(ExecutorType.MonsterSet, (int)CardId.Marshmallon, SetInvincibleMonster);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.SpiritReaper, SetInvincibleMonster);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.BlastSphere);
AddExecutor(ExecutorType.MonsterSet, CardId.Marshmallon, SetInvincibleMonster);
AddExecutor(ExecutorType.MonsterSet, CardId.SpiritReaper, SetInvincibleMonster);
AddExecutor(ExecutorType.MonsterSet, CardId.BlastSphere);
// Set other monsters
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.FencingFireFerret);
AddExecutor(ExecutorType.Summon, (int)CardId.ReflectBounder);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.NaturiaBeans);
AddExecutor(ExecutorType.SummonOrSet, CardId.FencingFireFerret);
AddExecutor(ExecutorType.Summon, CardId.ReflectBounder);
AddExecutor(ExecutorType.MonsterSet, CardId.NaturiaBeans);
// We're a coward
AddExecutor(ExecutorType.Repos, ReposEverything);
// Chain traps
AddExecutor(ExecutorType.Activate, (int)CardId.MagicCylinder, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.Ceasefire, Ceasefire);
AddExecutor(ExecutorType.Activate, (int)CardId.OjamaTrio);
AddExecutor(ExecutorType.Activate, (int)CardId.MinorGoblinOfficial);
AddExecutor(ExecutorType.Activate, (int)CardId.ChainBurst);
AddExecutor(ExecutorType.Activate, (int)CardId.SkullInvitation);
AddExecutor(ExecutorType.Activate, (int)CardId.ChainEnergy);
AddExecutor(ExecutorType.Activate, CardId.MagicCylinder, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.Ceasefire, Ceasefire);
AddExecutor(ExecutorType.Activate, CardId.OjamaTrio);
AddExecutor(ExecutorType.Activate, CardId.MinorGoblinOfficial);
AddExecutor(ExecutorType.Activate, CardId.ChainBurst);
AddExecutor(ExecutorType.Activate, CardId.SkullInvitation);
AddExecutor(ExecutorType.Activate, CardId.ChainEnergy);
}
public override bool OnSelectHand()
......@@ -84,7 +84,7 @@ namespace WindBot.Game.AI.Decks
private bool SwordsOfRevealingLight()
{
int count = Bot.SpellZone.GetCardCount((int)CardId.SwordsOfRevealingLight);
int count = Bot.SpellZone.GetCardCount(CardId.SwordsOfRevealingLight);
return count == 0;
}
......@@ -108,7 +108,7 @@ namespace WindBot.Game.AI.Decks
{
foreach (ClientCard card in Bot.GetMonsters())
{
if (card.Id == (int)CardId.Marshmallon || card.Id == (int)CardId.SpiritReaper)
if (card.Id == CardId.Marshmallon || card.Id == CardId.SpiritReaper)
{
return false;
}
......@@ -134,9 +134,9 @@ namespace WindBot.Game.AI.Decks
private bool ReposEverything()
{
if (Card.Id == (int)CardId.ReflectBounder)
if (Card.Id == CardId.ReflectBounder)
return Card.IsDefense();
if (Card.Id == (int)CardId.FencingFireFerret)
if (Card.Id == CardId.FencingFireFerret)
return DefaultMonsterRepos();
if (Card.IsAttack())
return true;
......
......@@ -6,119 +6,120 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("CyberDragon", "AI_CyberDragon")]
// NOT FINISHED YET
[Deck("CyberDragon", "AI_CyberDragon", "NotFinished")]
public class CyberDragonExecutor : DefaultExecutor
{
bool PowerBondUsed = false;
public enum CardId
public class CardId
{
CyberLaserDragon = 4162088,
CyberBarrierDragon = 68774379,
CyberDragon = 70095154,
CyberDragonDrei = 59281922,
CyberPhoenix = 3370104,
ArmoredCybern = 67159705,
ProtoCyberDragon = 26439287,
CyberKirin = 76986005,
CyberDragonCore = 23893227,
CyberValley = 3657444,
Raigeki = 12580477,
DarkHole = 53129443,
DifferentDimensionCapsule = 11961740,
Polymerization = 24094653,
PowerBond = 37630732,
EvolutionBurst = 52875873,
PhotonGeneratorUnit = 66607691,
DeFusion = 95286165,
BottomlessTrapHole = 29401950,
MirrorForce = 44095762,
AttackReflectorUnit = 91989718,
CyberneticHiddenTechnology = 92773018,
CallOfTheHaunted = 97077563,
SevenToolsOfTheBandit = 3819470,
CyberTwinDragon = 74157028,
CyberEndDragon = 1546123,
CyberDragonNova = 58069384
public static int CyberLaserDragon = 4162088;
public static int CyberBarrierDragon = 68774379;
public static int CyberDragon = 70095154;
public static int CyberDragonDrei = 59281922;
public static int CyberPhoenix = 3370104;
public static int ArmoredCybern = 67159705;
public static int ProtoCyberDragon = 26439287;
public static int CyberKirin = 76986005;
public static int CyberDragonCore = 23893227;
public static int CyberValley = 3657444;
public static int Raigeki = 12580477;
public static int DarkHole = 53129443;
public static int DifferentDimensionCapsule = 11961740;
public static int Polymerization = 24094653;
public static int PowerBond = 37630732;
public static int EvolutionBurst = 52875873;
public static int PhotonGeneratorUnit = 66607691;
public static int DeFusion = 95286165;
public static int BottomlessTrapHole = 29401950;
public static int MirrorForce = 44095762;
public static int AttackReflectorUnit = 91989718;
public static int CyberneticHiddenTechnology = 92773018;
public static int CallOfTheHaunted = 97077563;
public static int SevenToolsOfTheBandit = 3819470;
public static int CyberTwinDragon = 74157028;
public static int CyberEndDragon = 1546123;
public static int CyberDragonNova = 58069384;
}
public CyberDragonExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.SpellSet, (int)CardId.DeFusion);
AddExecutor(ExecutorType.Activate, (int)CardId.DifferentDimensionCapsule, Capsule);
AddExecutor(ExecutorType.Activate, (int)CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, (int)CardId.Polymerization, PolymerizationEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.PowerBond, PowerBondEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.EvolutionBurst, EvolutionBurstEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.PhotonGeneratorUnit);
AddExecutor(ExecutorType.Activate, (int)CardId.DeFusion, DeFusionEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.BottomlessTrapHole, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.MirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.AttackReflectorUnit);
AddExecutor(ExecutorType.Activate, (int)CardId.SevenToolsOfTheBandit, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.CallOfTheHaunted, DefaultCallOfTheHaunted);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.CyberDragonDrei, NoCyberDragonSpsummon);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.CyberPhoenix, NoCyberDragonSpsummon);
AddExecutor(ExecutorType.Summon, (int)CardId.CyberValley, NoCyberDragonSpsummon);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.CyberDragonCore, NoCyberDragonSpsummon);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.ArmoredCybern, ArmoredCybernSet);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.ProtoCyberDragon, ProtoCyberDragonSummon);
AddExecutor(ExecutorType.Summon, (int)CardId.CyberKirin, CyberKirinSummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.CyberDragon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.CyberEndDragon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.CyberTwinDragon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.CyberBarrierDragon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.CyberLaserDragon);
AddExecutor(ExecutorType.Activate, (int)CardId.CyberBarrierDragon);
AddExecutor(ExecutorType.Activate, (int)CardId.CyberLaserDragon);
AddExecutor(ExecutorType.Activate, (int)CardId.CyberDragonDrei);
AddExecutor(ExecutorType.Activate, (int)CardId.CyberPhoenix);
AddExecutor(ExecutorType.Activate, (int)CardId.CyberKirin);
AddExecutor(ExecutorType.Activate, (int)CardId.ArmoredCybern, ArmoredCybernEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.CyberValley);
AddExecutor(ExecutorType.SpellSet, CardId.DeFusion);
AddExecutor(ExecutorType.Activate, CardId.DifferentDimensionCapsule, Capsule);
AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, CardId.Polymerization, PolymerizationEffect);
AddExecutor(ExecutorType.Activate, CardId.PowerBond, PowerBondEffect);
AddExecutor(ExecutorType.Activate, CardId.EvolutionBurst, EvolutionBurstEffect);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.PhotonGeneratorUnit);
AddExecutor(ExecutorType.Activate, CardId.DeFusion, DeFusionEffect);
AddExecutor(ExecutorType.Activate, CardId.BottomlessTrapHole, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.AttackReflectorUnit);
AddExecutor(ExecutorType.Activate, CardId.SevenToolsOfTheBandit, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.CallOfTheHaunted, DefaultCallOfTheHaunted);
AddExecutor(ExecutorType.SummonOrSet, CardId.CyberDragonDrei, NoCyberDragonSpsummon);
AddExecutor(ExecutorType.SummonOrSet, CardId.CyberPhoenix, NoCyberDragonSpsummon);
AddExecutor(ExecutorType.Summon, CardId.CyberValley, NoCyberDragonSpsummon);
AddExecutor(ExecutorType.MonsterSet, CardId.CyberDragonCore, NoCyberDragonSpsummon);
AddExecutor(ExecutorType.MonsterSet, CardId.ArmoredCybern, ArmoredCybernSet);
AddExecutor(ExecutorType.SummonOrSet, CardId.ProtoCyberDragon, ProtoCyberDragonSummon);
AddExecutor(ExecutorType.Summon, CardId.CyberKirin, CyberKirinSummon);
AddExecutor(ExecutorType.SpSummon, CardId.CyberDragon);
AddExecutor(ExecutorType.SpSummon, CardId.CyberEndDragon);
AddExecutor(ExecutorType.SpSummon, CardId.CyberTwinDragon);
AddExecutor(ExecutorType.SpSummon, CardId.CyberBarrierDragon);
AddExecutor(ExecutorType.SpSummon, CardId.CyberLaserDragon);
AddExecutor(ExecutorType.Activate, CardId.CyberBarrierDragon);
AddExecutor(ExecutorType.Activate, CardId.CyberLaserDragon);
AddExecutor(ExecutorType.Activate, CardId.CyberDragonDrei);
AddExecutor(ExecutorType.Activate, CardId.CyberPhoenix);
AddExecutor(ExecutorType.Activate, CardId.CyberKirin);
AddExecutor(ExecutorType.Activate, CardId.ArmoredCybern, ArmoredCybernEffect);
AddExecutor(ExecutorType.Activate, CardId.CyberValley);
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
private bool CyberDragonInHand() { return Bot.HasInHand((int)CardId.CyberDragon); }
private bool CyberDragonInGraveyard() { return Bot.HasInGraveyard((int)CardId.CyberDragon); }
private bool CyberDragonInMonsterZone() { return Bot.HasInMonstersZone((int)CardId.CyberDragon); }
private bool CyberDragonIsBanished() { return Bot.HasInBanished((int)CardId.CyberDragon); }
private bool CyberDragonInHand() { return Bot.HasInHand(CardId.CyberDragon); }
private bool CyberDragonInGraveyard() { return Bot.HasInGraveyard(CardId.CyberDragon); }
private bool CyberDragonInMonsterZone() { return Bot.HasInMonstersZone(CardId.CyberDragon); }
private bool CyberDragonIsBanished() { return Bot.HasInBanished(CardId.CyberDragon); }
private bool Capsule()
{
List<int> SelectedCard = new List<int>();
SelectedCard.Add((int)CardId.PowerBond);
SelectedCard.Add((int)CardId.DarkHole);
SelectedCard.Add((int)CardId.Raigeki);
SelectedCard.Add(CardId.PowerBond);
SelectedCard.Add(CardId.DarkHole);
SelectedCard.Add(CardId.Raigeki);
AI.SelectCard(SelectedCard);
return true;
}
private bool PolymerizationEffect()
{
if (Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.ProtoCyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.CyberDragonDrei) + Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.CyberDragonDrei) + Bot.GetCountCardInZone(Bot.Hand, (int)CardId.CyberDragon) >= 3)
AI.SelectCard((int)CardId.CyberEndDragon);
if (Bot.GetCountCardInZone(Bot.MonsterZone, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, CardId.ProtoCyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, CardId.CyberDragonDrei) + Bot.GetCountCardInZone(Bot.MonsterZone, CardId.CyberDragonDrei) + Bot.GetCountCardInZone(Bot.Hand, CardId.CyberDragon) >= 3)
AI.SelectCard(CardId.CyberEndDragon);
else
AI.SelectCard((int)CardId.CyberTwinDragon);
AI.SelectCard(CardId.CyberTwinDragon);
return true;
}
private bool PowerBondEffect()
{
PowerBondUsed = true;
if (Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.ProtoCyberDragon) + Bot.GetCountCardInZone(Bot.Hand, (int)CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.Graveyard, (int)CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.Hand, (int)CardId.CyberDragonCore) + Bot.GetCountCardInZone(Bot.Graveyard, (int)CardId.CyberDragonCore) + Bot.GetCountCardInZone(Bot.Graveyard, (int)CardId.CyberDragonDrei) + Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.CyberDragonDrei) >= 3)
AI.SelectCard((int)CardId.CyberEndDragon);
if (Bot.GetCountCardInZone(Bot.MonsterZone, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, CardId.ProtoCyberDragon) + Bot.GetCountCardInZone(Bot.Hand, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.Graveyard, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.Hand, CardId.CyberDragonCore) + Bot.GetCountCardInZone(Bot.Graveyard, CardId.CyberDragonCore) + Bot.GetCountCardInZone(Bot.Graveyard, CardId.CyberDragonDrei) + Bot.GetCountCardInZone(Bot.MonsterZone, CardId.CyberDragonDrei) >= 3)
AI.SelectCard(CardId.CyberEndDragon);
else
AI.SelectCard((int)CardId.CyberTwinDragon);
AI.SelectCard(CardId.CyberTwinDragon);
return true;
}
......@@ -141,16 +142,16 @@ namespace WindBot.Game.AI.Decks
private bool ArmoredCybernSet()
{
if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Enemy.GetMonsterCount() != 0) || (Bot.HasInHand((int)CardId.CyberDragonDrei) || Bot.HasInHand((int)CardId.CyberPhoenix)) && !AI.Utils.IsOneEnemyBetterThanValue(1800,true))
if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Enemy.GetMonsterCount() != 0) || (Bot.HasInHand(CardId.CyberDragonDrei) || Bot.HasInHand(CardId.CyberPhoenix)) && !AI.Utils.IsOneEnemyBetterThanValue(1800,true))
return false;
return true;
}
private bool ProtoCyberDragonSummon()
{
if (Bot.GetCountCardInZone(Bot.Hand, (int)CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.CyberDragonCore) >= 1 && Bot.HasInHand((int)CardId.Polymerization) || Bot.GetCountCardInZone(Bot.Hand, (int)CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, (int)CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.Graveyard, (int)CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.Graveyard, (int)CardId.CyberDragonCore) >= 1 && Bot.HasInHand((int)CardId.PowerBond))
if (Bot.GetCountCardInZone(Bot.Hand, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, CardId.CyberDragonCore) >= 1 && Bot.HasInHand(CardId.Polymerization) || Bot.GetCountCardInZone(Bot.Hand, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.Graveyard, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.Graveyard, CardId.CyberDragonCore) >= 1 && Bot.HasInHand(CardId.PowerBond))
return true;
if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Enemy.GetMonsterCount() != 0) || (Bot.HasInHand((int)CardId.CyberDragonDrei) || Bot.HasInHand((int)CardId.CyberPhoenix)) && !AI.Utils.IsOneEnemyBetterThanValue(1800, true))
if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Enemy.GetMonsterCount() != 0) || (Bot.HasInHand(CardId.CyberDragonDrei) || Bot.HasInHand(CardId.CyberPhoenix)) && !AI.Utils.IsOneEnemyBetterThanValue(1800, true))
return false;
return true;
}
......@@ -167,7 +168,7 @@ namespace WindBot.Game.AI.Decks
else if (Card.Location == CardLocation.SpellZone)
{
if (AI.Utils.IsOneEnemyBetterThanValue(Bot.GetMonsters().GetHighestAttackMonster().Attack, true))
if (ActivateDescription == AI.Utils.GetStringId((int)CardId.ArmoredCybern, 2))
if (ActivateDescription == AI.Utils.GetStringId(CardId.ArmoredCybern, 2))
return true;
return false;
}
......
......@@ -6,13 +6,13 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Test", "AI_Test")]
[Deck("Test", "AI_Test", "Test")]
public class DoEverythingExecutor : DefaultExecutor
{
public enum CardId
public class CardId
{
LeoWizard = 4392470,
Bunilla = 69380702
public static int LeoWizard = 4392470;
public static int Bunilla = 69380702;
}
public DoEverythingExecutor(GameAI ai, Duel duel)
......
......@@ -9,34 +9,34 @@ namespace WindBot.Game.AI.Decks
[Deck("Dragunity", "AI_Dragunity")]
public class DragunityExecutor : DefaultExecutor
{
public enum CardId
{
StardustDragonAssaultMode = 61257789,
DragunityArmaMysletainn = 876330,
AssaultBeast = 3431737,
DragunityDux = 28183605,
DragunityPhalanx = 59755122,
AssaultTeleport = 29863101,
CardsOfConsonance = 39701395,
UpstartGoblin = 70368879,
DragonsMirror = 71490127,
Terraforming = 73628505,
FoolishBurial = 81439173,
MonsterReborn = 83764718,
MysticalSpaceTyphoon = 5318639,
FireFormationTenki = 57103969,
DragunitySpearOfDestiny = 60004971,
DragonRavine = 62265044,
MirrorForce = 44095762,
StarlightRoad = 58120309,
DimensionalPrison = 70342110,
AssaultModeActivate = 80280737,
FiveHeadedDragon = 99267150,
CrystalWingSynchroDragon = 50954680,
ScrapDragon = 76774528,
StardustDragon = 44508094,
DragunityKnightGaeDearg = 34116027,
DragunityKnightVajrayana = 21249921
public class CardId
{
public static int StardustDragonAssaultMode = 61257789;
public static int DragunityArmaMysletainn = 876330;
public static int AssaultBeast = 3431737;
public static int DragunityDux = 28183605;
public static int DragunityPhalanx = 59755122;
public static int AssaultTeleport = 29863101;
public static int CardsOfConsonance = 39701395;
public static int UpstartGoblin = 70368879;
public static int DragonsMirror = 71490127;
public static int Terraforming = 73628505;
public static int FoolishBurial = 81439173;
public static int MonsterReborn = 83764718;
public static int MysticalSpaceTyphoon = 5318639;
public static int FireFormationTenki = 57103969;
public static int DragunitySpearOfDestiny = 60004971;
public static int DragonRavine = 62265044;
public static int MirrorForce = 44095762;
public static int StarlightRoad = 58120309;
public static int DimensionalPrison = 70342110;
public static int AssaultModeActivate = 80280737;
public static int FiveHeadedDragon = 99267150;
public static int CrystalWingSynchroDragon = 50954680;
public static int ScrapDragon = 76774528;
public static int StardustDragon = 44508094;
public static int DragunityKnightGaeDearg = 34116027;
public static int DragunityKnightVajrayana = 21249921;
}
public DragunityExecutor(GameAI ai, Duel duel)
......@@ -46,60 +46,60 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
// Execute spells
AddExecutor(ExecutorType.Activate, (int)CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, (int)CardId.AssaultTeleport);
AddExecutor(ExecutorType.Activate, (int)CardId.UpstartGoblin);
AddExecutor(ExecutorType.Activate, (int)CardId.DragonRavine, DragonRavineField);
AddExecutor(ExecutorType.Activate, (int)CardId.Terraforming, Terraforming);
AddExecutor(ExecutorType.Activate, (int)CardId.FoolishBurial, FoolishBurial);
AddExecutor(ExecutorType.Activate, (int)CardId.MonsterReborn, MonsterReborn);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.AssaultTeleport);
AddExecutor(ExecutorType.Activate, CardId.UpstartGoblin);
AddExecutor(ExecutorType.Activate, CardId.DragonRavine, DragonRavineField);
AddExecutor(ExecutorType.Activate, CardId.Terraforming, Terraforming);
AddExecutor(ExecutorType.Activate, CardId.FoolishBurial, FoolishBurial);
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, MonsterReborn);
// Execute monsters
AddExecutor(ExecutorType.Activate, (int)CardId.ScrapDragon, ScrapDragonEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.CrystalWingSynchroDragon, CrystalWingSynchroDragonEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.DragunityPhalanx);
AddExecutor(ExecutorType.Activate, (int)CardId.DragunityKnightVajrayana);
AddExecutor(ExecutorType.Activate, (int)CardId.DragunityArmaMysletainn, DragunityArmaMysletainnEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.DragunityDux);
AddExecutor(ExecutorType.Activate, CardId.ScrapDragon, ScrapDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.CrystalWingSynchroDragon, CrystalWingSynchroDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.DragunityPhalanx);
AddExecutor(ExecutorType.Activate, CardId.DragunityKnightVajrayana);
AddExecutor(ExecutorType.Activate, CardId.DragunityArmaMysletainn, DragunityArmaMysletainnEffect);
AddExecutor(ExecutorType.Activate, CardId.DragunityDux);
// Summon
AddExecutor(ExecutorType.Activate, (int)CardId.DragonsMirror, DragonsMirror);
AddExecutor(ExecutorType.SpSummon, (int)CardId.ScrapDragon, ScrapDragonSummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.CrystalWingSynchroDragon, CrystalWingSynchroDragonSummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.StardustDragon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.DragunityKnightVajrayana);
AddExecutor(ExecutorType.SpSummon, (int)CardId.DragunityKnightGaeDearg);
AddExecutor(ExecutorType.Summon, (int)CardId.DragunityPhalanx, DragunityPhalanxSummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.DragunityArmaMysletainn, DragunityArmaMysletainn);
AddExecutor(ExecutorType.Summon, (int)CardId.DragunityArmaMysletainn, DragunityArmaMysletainnTribute);
AddExecutor(ExecutorType.Activate, CardId.DragonsMirror, DragonsMirror);
AddExecutor(ExecutorType.SpSummon, CardId.ScrapDragon, ScrapDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.CrystalWingSynchroDragon, CrystalWingSynchroDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.StardustDragon);
AddExecutor(ExecutorType.SpSummon, CardId.DragunityKnightVajrayana);
AddExecutor(ExecutorType.SpSummon, CardId.DragunityKnightGaeDearg);
AddExecutor(ExecutorType.Summon, CardId.DragunityPhalanx, DragunityPhalanxSummon);
AddExecutor(ExecutorType.SpSummon, CardId.DragunityArmaMysletainn, DragunityArmaMysletainn);
AddExecutor(ExecutorType.Summon, CardId.DragunityArmaMysletainn, DragunityArmaMysletainnTribute);
// Use draw effects if we can't do anything else
AddExecutor(ExecutorType.Activate, (int)CardId.CardsOfConsonance);
AddExecutor(ExecutorType.Activate, (int)CardId.DragonRavine, DragonRavineEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.FireFormationTenki, FireFormationTenki);
AddExecutor(ExecutorType.Activate, (int)CardId.DragunitySpearOfDestiny);
AddExecutor(ExecutorType.Activate, CardId.CardsOfConsonance);
AddExecutor(ExecutorType.Activate, CardId.DragonRavine, DragonRavineEffect);
AddExecutor(ExecutorType.Activate, CardId.FireFormationTenki, FireFormationTenki);
AddExecutor(ExecutorType.Activate, CardId.DragunitySpearOfDestiny);
// Summon
AddExecutor(ExecutorType.Summon, (int)CardId.DragunityDux, DragunityDux);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.DragunityPhalanx, DragunityPhalanxSet);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.AssaultBeast);
AddExecutor(ExecutorType.Summon, CardId.DragunityDux, DragunityDux);
AddExecutor(ExecutorType.MonsterSet, CardId.DragunityPhalanx, DragunityPhalanxSet);
AddExecutor(ExecutorType.SummonOrSet, CardId.AssaultBeast);
// Draw assault mode if we don't have one
AddExecutor(ExecutorType.Activate, (int)CardId.AssaultBeast, AssaultBeast);
AddExecutor(ExecutorType.Activate, CardId.AssaultBeast, AssaultBeast);
// Set useless cards
AddExecutor(ExecutorType.SpellSet, (int)CardId.DragonsMirror, SetUselessCards);
AddExecutor(ExecutorType.SpellSet, (int)CardId.Terraforming, SetUselessCards);
AddExecutor(ExecutorType.SpellSet, (int)CardId.AssaultTeleport, SetUselessCards);
AddExecutor(ExecutorType.SpellSet, (int)CardId.CardsOfConsonance, SetUselessCards);
AddExecutor(ExecutorType.SpellSet, CardId.DragonsMirror, SetUselessCards);
AddExecutor(ExecutorType.SpellSet, CardId.Terraforming, SetUselessCards);
AddExecutor(ExecutorType.SpellSet, CardId.AssaultTeleport, SetUselessCards);
AddExecutor(ExecutorType.SpellSet, CardId.CardsOfConsonance, SetUselessCards);
// Chain traps and monsters
AddExecutor(ExecutorType.Activate, (int)CardId.StardustDragonAssaultMode, StardustDragon);
AddExecutor(ExecutorType.Activate, (int)CardId.StardustDragon, StardustDragon);
AddExecutor(ExecutorType.Activate, (int)CardId.StarlightRoad, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.MirrorForce, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.DimensionalPrison, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.AssaultModeActivate, AssaultModeActivate);
AddExecutor(ExecutorType.Activate, CardId.StardustDragonAssaultMode, DefaultStardustDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.StardustDragon, DefaultStardustDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.StarlightRoad, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.DimensionalPrison, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.AssaultModeActivate, AssaultModeActivate);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
......@@ -117,61 +117,61 @@ namespace WindBot.Game.AI.Decks
return false;
int tributeId = -1;
if (Bot.HasInHand((int)CardId.DragunityPhalanx))
tributeId = (int)CardId.DragunityPhalanx;
else if (Bot.HasInHand((int)CardId.FireFormationTenki))
tributeId = (int)CardId.FireFormationTenki;
else if (Bot.HasInHand((int)CardId.Terraforming))
tributeId = (int)CardId.Terraforming;
else if (Bot.HasInHand((int)CardId.DragonRavine))
tributeId = (int)CardId.DragonRavine;
else if (Bot.HasInHand((int)CardId.AssaultTeleport))
tributeId = (int)CardId.AssaultTeleport;
else if (Bot.HasInHand((int)CardId.AssaultBeast))
tributeId = (int)CardId.AssaultBeast;
if (Bot.HasInHand(CardId.DragunityPhalanx))
tributeId = CardId.DragunityPhalanx;
else if (Bot.HasInHand(CardId.FireFormationTenki))
tributeId = CardId.FireFormationTenki;
else if (Bot.HasInHand(CardId.Terraforming))
tributeId = CardId.Terraforming;
else if (Bot.HasInHand(CardId.DragonRavine))
tributeId = CardId.DragonRavine;
else if (Bot.HasInHand(CardId.AssaultTeleport))
tributeId = CardId.AssaultTeleport;
else if (Bot.HasInHand(CardId.AssaultBeast))
tributeId = CardId.AssaultBeast;
else if (Bot.HasInHand((int) CardId.DragunityArmaMysletainn))
tributeId = (int)CardId.DragunityArmaMysletainn;
tributeId = CardId.DragunityArmaMysletainn;
else
{
int count = 0;
foreach (ClientCard card in Bot.Hand)
{
if (card.Id == (int)CardId.DragunityDux)
if (card.Id == CardId.DragunityDux)
++count;
}
if (count >= 2)
tributeId = (int)CardId.DragunityDux;
tributeId = CardId.DragunityDux;
}
if (tributeId == -1 && Bot.HasInHand((int)CardId.StardustDragonAssaultMode))
tributeId = (int)CardId.StardustDragonAssaultMode;
if (tributeId == -1 && Bot.HasInHand((int)CardId.DragunitySpearOfDestiny))
tributeId = (int)CardId.StardustDragonAssaultMode;
if (tributeId == -1 && Bot.HasInHand((int)CardId.DragonsMirror)
if (tributeId == -1 && Bot.HasInHand(CardId.StardustDragonAssaultMode))
tributeId = CardId.StardustDragonAssaultMode;
if (tributeId == -1 && Bot.HasInHand(CardId.DragunitySpearOfDestiny))
tributeId = CardId.StardustDragonAssaultMode;
if (tributeId == -1 && Bot.HasInHand(CardId.DragonsMirror)
&& Bot.GetMonsterCount() == 0)
tributeId = (int)CardId.StardustDragonAssaultMode;
tributeId = CardId.StardustDragonAssaultMode;
if (tributeId == -1)
return false;
int needId = -1;
if (!Bot.HasInMonstersZone((int)CardId.DragunityPhalanx) &&
!Bot.HasInGraveyard((int)CardId.DragunityPhalanx))
needId = (int)CardId.DragunityPhalanx;
if (!Bot.HasInMonstersZone(CardId.DragunityPhalanx) &&
!Bot.HasInGraveyard(CardId.DragunityPhalanx))
needId = CardId.DragunityPhalanx;
else if (Bot.GetMonsterCount() == 0)
needId = (int)CardId.DragunityDux;
needId = CardId.DragunityDux;
else
{
/*bool hasRealMonster = false;
foreach (ClientCard card in Bot.GetMonsters())
{
if (card.Id != (int)CardId.AssaultBeast)
if (card.Id != CardId.AssaultBeast)
{
hasRealMonster = true;
break;
}
}
if (!hasRealMonster || AI.Utils.GetProblematicCard() != null)*/
needId = (int)CardId.DragunityDux;
needId = CardId.DragunityDux;
}
if (needId == -1)
......@@ -179,8 +179,8 @@ namespace WindBot.Game.AI.Decks
int option;
if (tributeId == (int)CardId.DragunityPhalanx)
needId = (int)CardId.DragunityDux;
if (tributeId == CardId.DragunityPhalanx)
needId = CardId.DragunityDux;
int remaining = 3;
foreach (ClientCard card in Bot.Hand)
......@@ -195,12 +195,12 @@ namespace WindBot.Game.AI.Decks
if (remaining <= 0)
return false;
if (needId == (int)CardId.DragunityPhalanx)
if (needId == CardId.DragunityPhalanx)
option = 2;
else
option = 1;
if (ActivateDescription != (int)CardId.DragonRavine*16 + option)
if (ActivateDescription != CardId.DragonRavine*16 + option)
return false;
AI.SelectCard(tributeId);
......@@ -211,7 +211,7 @@ namespace WindBot.Game.AI.Decks
private bool Terraforming()
{
if (Bot.HasInHand((int)CardId.DragonRavine))
if (Bot.HasInHand(CardId.DragonRavine))
return false;
if (Bot.SpellZone[5] != null)
return false;
......@@ -222,13 +222,13 @@ namespace WindBot.Game.AI.Decks
{
ClientField field = Bot;
if (field.HasInSpellZone((int)CardId.FireFormationTenki))
if (field.HasInSpellZone(CardId.FireFormationTenki))
return false;
if (field.HasInSpellZone((int)CardId.AssaultTeleport))
if (field.HasInSpellZone(CardId.AssaultTeleport))
return false;
if (field.HasInSpellZone((int)CardId.CardsOfConsonance))
if (field.HasInSpellZone(CardId.CardsOfConsonance))
return false;
if (field.HasInSpellZone((int)CardId.DragonsMirror))
if (field.HasInSpellZone(CardId.DragonsMirror))
return false;
return Bot.GetSpellCountWithoutField() < 4;
......@@ -243,17 +243,17 @@ namespace WindBot.Game.AI.Decks
private bool FoolishBurial()
{
if (Bot.HasInGraveyard((int)CardId.DragunityPhalanx))
if (Bot.HasInGraveyard(CardId.DragunityPhalanx))
return false;
if (Bot.HasInHand((int)CardId.DragunityPhalanx))
if (Bot.HasInHand(CardId.DragunityPhalanx))
return false;
int remaining = 3;
foreach (ClientCard card in Bot.Banished)
if (card.Id == (int)CardId.DragunityPhalanx)
if (card.Id == CardId.DragunityPhalanx)
remaining--;
if (remaining > 0)
{
AI.SelectCard((int)CardId.DragunityPhalanx);
AI.SelectCard(CardId.DragunityPhalanx);
return true;
}
return false;
......@@ -335,7 +335,7 @@ namespace WindBot.Game.AI.Decks
if (tributes.Count < 5)
return false;
AI.SelectCard((int)CardId.FiveHeadedDragon);
AI.SelectCard(CardId.FiveHeadedDragon);
AI.SelectNextCard(tributes);
return true;
}
......@@ -344,33 +344,31 @@ namespace WindBot.Game.AI.Decks
{
//if (AI.Utils.IsOneEnemyBetterThanValue(2500, true))
// return true;
ClientCard invincible = AI.Utils.GetProblematicCard();
ClientCard invincible = AI.Utils.GetProblematicEnemyCard();
return invincible != null;
}
private bool ScrapDragonEffect()
{
ClientCard invincible = AI.Utils.GetProblematicCard();
ClientCard invincible = AI.Utils.GetProblematicEnemyCard();
if (invincible == null && !AI.Utils.IsOneEnemyBetterThanValue(2800 - 1, false))
return false;
ClientField field = Bot;
int tributeId = -1;
if (field.HasInSpellZone((int)CardId.FireFormationTenki))
tributeId = (int)CardId.FireFormationTenki;
else if (field.HasInSpellZone((int)CardId.Terraforming))
tributeId = (int)CardId.Terraforming;
else if (field.HasInSpellZone((int)CardId.DragonsMirror))
tributeId = (int)CardId.DragonsMirror;
else if (field.HasInSpellZone((int)CardId.CardsOfConsonance))
tributeId = (int)CardId.CardsOfConsonance;
else if (field.HasInSpellZone((int)CardId.AssaultTeleport))
tributeId = (int)CardId.AssaultTeleport;
else if (field.HasInSpellZone((int)CardId.AssaultModeActivate))
tributeId = (int)CardId.AssaultModeActivate;
else if (field.HasInSpellZone((int)CardId.DragonRavine))
tributeId = (int)CardId.DragonRavine;
if (Bot.HasInSpellZone(CardId.FireFormationTenki))
tributeId = CardId.FireFormationTenki;
else if (Bot.HasInSpellZone(CardId.Terraforming))
tributeId = CardId.Terraforming;
else if (Bot.HasInSpellZone(CardId.DragonsMirror))
tributeId = CardId.DragonsMirror;
else if (Bot.HasInSpellZone(CardId.CardsOfConsonance))
tributeId = CardId.CardsOfConsonance;
else if (Bot.HasInSpellZone(CardId.AssaultTeleport))
tributeId = CardId.AssaultTeleport;
else if (Bot.HasInSpellZone(CardId.AssaultModeActivate))
tributeId = CardId.AssaultModeActivate;
else if (Bot.HasInSpellZone(CardId.DragonRavine))
tributeId = CardId.DragonRavine;
List<ClientCard> monsters = Enemy.GetMonsters();
monsters.Sort(AIFunctions.CompareCardAttack);
......@@ -401,9 +399,9 @@ namespace WindBot.Game.AI.Decks
private bool CrystalWingSynchroDragonSummon()
{
return !Bot.HasInHand((int)CardId.AssaultModeActivate)
&& !Bot.HasInHand((int)CardId.AssaultBeast)
&& !Bot.HasInSpellZone((int)CardId.AssaultModeActivate);
return !Bot.HasInHand(CardId.AssaultModeActivate)
&& !Bot.HasInHand(CardId.AssaultBeast)
&& !Bot.HasInSpellZone(CardId.AssaultModeActivate);
}
private bool CrystalWingSynchroDragonEffect()
......@@ -413,19 +411,19 @@ namespace WindBot.Game.AI.Decks
private bool DragunityPhalanxSummon()
{
return Bot.HasInHand((int)CardId.DragunityArmaMysletainn);
return Bot.HasInHand(CardId.DragunityArmaMysletainn);
}
private bool DragunityArmaMysletainn()
{
if (Bot.HasInMonstersZone((int)CardId.DragunityPhalanx))
if (Bot.HasInMonstersZone(CardId.DragunityPhalanx))
{
AI.SelectCard((int)CardId.DragunityPhalanx);
AI.SelectCard(CardId.DragunityPhalanx);
return true;
}
if (Bot.HasInMonstersZone((int)CardId.DragunityDux))
if (Bot.HasInMonstersZone(CardId.DragunityDux))
{
AI.SelectCard((int)CardId.DragunityDux);
AI.SelectCard(CardId.DragunityDux);
return true;
}
return false;
......@@ -433,46 +431,39 @@ namespace WindBot.Game.AI.Decks
private bool DragunityArmaMysletainnEffect()
{
AI.SelectCard((int)CardId.DragunityPhalanx);
AI.SelectCard(CardId.DragunityPhalanx);
return true;
}
private bool DragunityArmaMysletainnTribute()
{
if ((Bot.HasInMonstersZone((int)CardId.AssaultBeast)
&& Bot.HasInGraveyard((int)CardId.DragunityPhalanx))
|| Bot.HasInMonstersZone((int)CardId.DragunityPhalanx)
|| Bot.HasInHand((int)CardId.DragunitySpearOfDestiny))
if ((Bot.HasInMonstersZone(CardId.AssaultBeast)
&& Bot.HasInGraveyard(CardId.DragunityPhalanx))
|| Bot.HasInMonstersZone(CardId.DragunityPhalanx)
|| Bot.HasInHand(CardId.DragunitySpearOfDestiny))
return true;
return false;
}
private bool DragunityDux()
{
return Bot.HasInGraveyard((int)CardId.DragunityPhalanx) ||
(Bot.GetMonsterCount() == 0 && Bot.HasInHand((int)CardId.DragunityArmaMysletainn) ||
Bot.HasInHand((int)CardId.DragunitySpearOfDestiny));
return Bot.HasInGraveyard(CardId.DragunityPhalanx) ||
(Bot.GetMonsterCount() == 0 && Bot.HasInHand(CardId.DragunityArmaMysletainn) ||
Bot.HasInHand(CardId.DragunitySpearOfDestiny));
}
private bool DragunityPhalanxSet()
{
return Bot.GetMonsterCount() == 0 || !Bot.HasInGraveyard((int)CardId.DragunityPhalanx);
return Bot.GetMonsterCount() == 0 || !Bot.HasInGraveyard(CardId.DragunityPhalanx);
}
private bool AssaultBeast()
{
if (!Bot.HasInSpellZone((int)CardId.AssaultModeActivate))
if (!Bot.HasInSpellZone(CardId.AssaultModeActivate))
return true;
return false;
}
private bool StardustDragon()
{
if (Card.Location == CardLocation.Grave)
return true;
return LastChainPlayer == 1;
}
private bool AssaultModeActivate()
{
if (Duel.Player == 0 && Duel.Phase == DuelPhase.BattleStart)
......@@ -480,7 +471,7 @@ namespace WindBot.Game.AI.Decks
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (monster.Id == (int)CardId.StardustDragon && monster.Attacked)
if (monster.Id == CardId.StardustDragon && monster.Attacked)
{
AI.SelectCard(monster);
return true;
......
......@@ -6,28 +6,29 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Evilswarm", "AI_Evilswarm")]
// NOT FINISHED YET
[Deck("Evilswarm", "AI_Evilswarm", "NotFinished")]
public class EvilswarmExecutor : DefaultExecutor
{
public enum CardId
public class CardId
{
DarkHole = 53129443,
CosmicCyclone = 8267140,
InfestationPandemic = 27541267,
SolemnJudgment = 41420027,
SolemnWarning = 84749824,
SolemnStrike = 40605147
public static int DarkHole = 53129443;
public static int CosmicCyclone = 8267140;
public static int InfestationPandemic = 27541267;
public static int SolemnJudgment = 41420027;
public static int SolemnWarning = 84749824;
public static int SolemnStrike = 40605147;
}
public EvilswarmExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, (int)CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.CosmicCyclone, DefaultCosmicCyclone);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnJudgment, DefaultSolemnJudgment);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.SpellSet, (int)CardId.InfestationPandemic);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.CosmicCyclone, DefaultCosmicCyclone);
AddExecutor(ExecutorType.Activate, CardId.SolemnJudgment, DefaultSolemnJudgment);
AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.SpellSet, CardId.InfestationPandemic);
AddExecutor(ExecutorType.Activate, DefaultDontChainMyself);
AddExecutor(ExecutorType.Summon);
AddExecutor(ExecutorType.SpSummon);
......
......@@ -6,30 +6,30 @@ using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game.AI.Decks
{
[Deck("Frog", "AI_Frog")]
[Deck("Frog", "AI_Frog", "Easy")]
public class FrogExecutor : DefaultExecutor
{
public enum CardId
public class CardId
{
CryomancerOfTheIceBarrier = 23950192,
DewdarkOfTheIceBarrier = 90311614,
SubmarineFrog = 63948258,
SwapFrog = 9126351,
FlipFlopFrog = 81278754,
Unifrog = 56052205,
Ronintoadin = 1357146,
DupeFrog = 46239604,
Tradetoad = 23408872,
TreebornFrog = 12538374,
DarkHole = 53129443,
Raigeki = 12580477,
Terraforming = 73628505,
PotOfDuality = 98645731,
Solidarity = 86780027,
Wetlands = 2084239,
FroggyForcefield = 34351849,
GravityBind = 85742772,
TheHugeRevolutionIsOver = 99188141
public static int CryomancerOfTheIceBarrier = 23950192;
public static int DewdarkOfTheIceBarrier = 90311614;
public static int SubmarineFrog = 63948258;
public static int SwapFrog = 9126351;
public static int FlipFlopFrog = 81278754;
public static int Unifrog = 56052205;
public static int Ronintoadin = 1357146;
public static int DupeFrog = 46239604;
public static int Tradetoad = 23408872;
public static int TreebornFrog = 12538374;
public static int DarkHole = 53129443;
public static int Raigeki = 12580477;
public static int Terraforming = 73628505;
public static int PotOfDuality = 98645731;
public static int Solidarity = 86780027;
public static int Wetlands = 2084239;
public static int FroggyForcefield = 34351849;
public static int GravityBind = 85742772;
public static int TheHugeRevolutionIsOver = 99188141;
}
public FrogExecutor(GameAI ai, Duel duel)
......@@ -37,48 +37,48 @@ namespace WindBot.Game.AI.Decks
{
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, (int)CardId.Solidarity, Solidarity);
AddExecutor(ExecutorType.Activate, (int)CardId.Terraforming, Terraforming);
AddExecutor(ExecutorType.Activate, (int)CardId.Wetlands, DefaultField);
AddExecutor(ExecutorType.Activate, (int)CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, (int)CardId.PotOfDuality, PotOfDuality);
AddExecutor(ExecutorType.SpSummon, (int)CardId.SwapFrog, SwapFrogSummon);
AddExecutor(ExecutorType.Activate, (int)CardId.SwapFrog, SwapFrogActivate);
AddExecutor(ExecutorType.Activate, (int)CardId.DupeFrog, DupeFrog);
AddExecutor(ExecutorType.Activate, (int)CardId.FlipFlopFrog, FlipFlopFrog);
AddExecutor(ExecutorType.Activate, (int)CardId.Ronintoadin, Ronintoadin);
AddExecutor(ExecutorType.Activate, (int)CardId.TreebornFrog);
AddExecutor(ExecutorType.Activate, (int)CardId.Unifrog);
AddExecutor(ExecutorType.Summon, (int)CardId.CryomancerOfTheIceBarrier, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.DewdarkOfTheIceBarrier, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.SubmarineFrog, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.SwapFrog, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.Unifrog, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.Ronintoadin, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.DupeFrog, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.Tradetoad, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.TreebornFrog, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.FlipFlopFrog, SummonFrog);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.FlipFlopFrog);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.DupeFrog);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.Tradetoad);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.Ronintoadin);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.TreebornFrog);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.Unifrog);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.SwapFrog);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.SubmarineFrog);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.DewdarkOfTheIceBarrier);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.CryomancerOfTheIceBarrier);
AddExecutor(ExecutorType.Activate, CardId.Solidarity, Solidarity);
AddExecutor(ExecutorType.Activate, CardId.Terraforming, Terraforming);
AddExecutor(ExecutorType.Activate, CardId.Wetlands, DefaultField);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, CardId.PotOfDuality, PotOfDuality);
AddExecutor(ExecutorType.SpSummon, CardId.SwapFrog, SwapFrogSummon);
AddExecutor(ExecutorType.Activate, CardId.SwapFrog, SwapFrogActivate);
AddExecutor(ExecutorType.Activate, CardId.DupeFrog, DupeFrog);
AddExecutor(ExecutorType.Activate, CardId.FlipFlopFrog, FlipFlopFrog);
AddExecutor(ExecutorType.Activate, CardId.Ronintoadin, Ronintoadin);
AddExecutor(ExecutorType.Activate, CardId.TreebornFrog);
AddExecutor(ExecutorType.Activate, CardId.Unifrog);
AddExecutor(ExecutorType.Summon, CardId.CryomancerOfTheIceBarrier, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.DewdarkOfTheIceBarrier, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.SubmarineFrog, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.SwapFrog, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.Unifrog, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.Ronintoadin, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.DupeFrog, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.Tradetoad, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.TreebornFrog, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.FlipFlopFrog, SummonFrog);
AddExecutor(ExecutorType.MonsterSet, CardId.FlipFlopFrog);
AddExecutor(ExecutorType.MonsterSet, CardId.DupeFrog);
AddExecutor(ExecutorType.MonsterSet, CardId.Tradetoad);
AddExecutor(ExecutorType.MonsterSet, CardId.Ronintoadin);
AddExecutor(ExecutorType.MonsterSet, CardId.TreebornFrog);
AddExecutor(ExecutorType.MonsterSet, CardId.Unifrog);
AddExecutor(ExecutorType.MonsterSet, CardId.SwapFrog);
AddExecutor(ExecutorType.MonsterSet, CardId.SubmarineFrog);
AddExecutor(ExecutorType.MonsterSet, CardId.DewdarkOfTheIceBarrier);
AddExecutor(ExecutorType.MonsterSet, CardId.CryomancerOfTheIceBarrier);
AddExecutor(ExecutorType.Repos, FrogMonsterRepos);
AddExecutor(ExecutorType.Activate, (int)CardId.FroggyForcefield, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.TheHugeRevolutionIsOver, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.GravityBind, GravityBind);
AddExecutor(ExecutorType.Activate, CardId.FroggyForcefield, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.TheHugeRevolutionIsOver, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.GravityBind, GravityBind);
}
private int m_swapFrogSummoned;
......@@ -86,9 +86,9 @@ namespace WindBot.Game.AI.Decks
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (attacker.Id == (int)CardId.Unifrog || attacker.Id == (int)CardId.DewdarkOfTheIceBarrier)
if (attacker.Id == CardId.Unifrog || attacker.Id == CardId.DewdarkOfTheIceBarrier)
return true;
if (defender.IsMonsterInvincible() && !defender.IsMonsterDangerous() && attacker.Id == (int)CardId.SubmarineFrog)
if (defender.IsMonsterInvincible() && !defender.IsMonsterDangerous() && attacker.Id == CardId.SubmarineFrog)
return true;
return base.OnPreBattleBetween(attacker, defender);
}
......@@ -99,7 +99,7 @@ namespace WindBot.Game.AI.Decks
if (AI.Utils.IsAllEnemyBetterThanValue(atk, true))
return false;
AI.SelectCard((int)CardId.Ronintoadin);
AI.SelectCard(CardId.Ronintoadin);
m_swapFrogSummoned = Duel.Turn;
return true;
}
......@@ -110,10 +110,10 @@ namespace WindBot.Game.AI.Decks
return false;
m_swapFrogSummoned = -1;
if (Bot.GetRemainingCount((int)CardId.Ronintoadin, 2) == 0)
if (Bot.GetRemainingCount(CardId.Ronintoadin, 2) == 0)
return false;
AI.SelectCard((int)CardId.Ronintoadin);
AI.SelectCard(CardId.Ronintoadin);
return true;
}
......@@ -156,7 +156,7 @@ namespace WindBot.Game.AI.Decks
if (AI.Utils.IsOneEnemyBetterThanValue(atk, true))
return false;
if (Card.Id == (int)CardId.SwapFrog)
if (Card.Id == CardId.SwapFrog)
m_swapFrogSummoned = Duel.Turn;
return true;
}
......@@ -165,20 +165,20 @@ namespace WindBot.Game.AI.Decks
{
List<int> cards = new List<int>();
if (AI.Utils.IsEnemyBetter(false, false))
if (AI.Utils.IsOneEnemyBetter())
{
cards.Add((int)CardId.FlipFlopFrog);
cards.Add(CardId.FlipFlopFrog);
}
if (Bot.SpellZone[5] == null)
{
cards.Add((int)CardId.Terraforming);
cards.Add((int)CardId.Wetlands);
cards.Add(CardId.Terraforming);
cards.Add(CardId.Wetlands);
}
cards.Add((int)CardId.DarkHole);
cards.Add((int)CardId.SwapFrog);
cards.Add((int)CardId.GravityBind);
cards.Add(CardId.DarkHole);
cards.Add(CardId.SwapFrog);
cards.Add(CardId.GravityBind);
if (cards.Count > 0)
{
......@@ -191,7 +191,7 @@ namespace WindBot.Game.AI.Decks
private bool Terraforming()
{
if (Bot.HasInHand((int)CardId.Wetlands))
if (Bot.HasInHand(CardId.Wetlands))
return false;
if (Bot.SpellZone[5] != null)
return false;
......@@ -209,7 +209,7 @@ namespace WindBot.Game.AI.Decks
List<ClientCard> spells = Bot.GetSpells();
foreach (ClientCard spell in spells)
{
if (spell.Id == (int)CardId.GravityBind && !spell.IsFacedown())
if (spell.Id == CardId.GravityBind && !spell.IsFacedown())
return false;
}
return true;
......@@ -217,9 +217,9 @@ namespace WindBot.Game.AI.Decks
private bool FrogMonsterRepos()
{
if (Card.Id == (int)CardId.Unifrog)
if (Card.Id == CardId.Unifrog)
return Card.IsDefense();
if (Card.Id == (int)CardId.DewdarkOfTheIceBarrier)
if (Card.Id == CardId.DewdarkOfTheIceBarrier)
return Card.IsDefense();
bool enemyBetter = AI.Utils.IsOneEnemyBetterThanValue(Card.Attack + (Card.IsFacedown() ? GetSpellBonus() : 0), true);
......@@ -231,10 +231,10 @@ namespace WindBot.Game.AI.Decks
if (Card.IsDefense() && !enemyBetter)
result = true;
if (!result && Card.Id == (int)CardId.FlipFlopFrog && Enemy.GetMonsterCount() > 0 && Card.IsFacedown())
if (!result && Card.Id == CardId.FlipFlopFrog && Enemy.GetMonsterCount() > 0 && Card.IsFacedown())
result = true;
if (Card.Id == (int)CardId.FlipFlopFrog && Card.IsFacedown() && result)
if (Card.Id == CardId.FlipFlopFrog && Card.IsFacedown() && result)
m_flipFlopFrogSummoned = Duel.Turn;
return result;
......@@ -251,7 +251,7 @@ namespace WindBot.Game.AI.Decks
{
foreach (ClientCard card in Bot.GetSpells())
{
if (card.Id == (int)CardId.Solidarity)
if (card.Id == CardId.Solidarity)
atk += 800;
}
}
......
......@@ -6,35 +6,36 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Gravekeeper", "AI_Gravekeeper")]
// NOT FINISHED YET
[Deck("Gravekeeper", "AI_Gravekeeper", "NotFinished")]
public class GravekeeperExecutor : DefaultExecutor
{
public enum CardId
public class CardId
{
GravekeepersOracle = 25524823,
MaleficStardustDragon = 36521459,
GravekeepersVisionary = 3825890,
GravekeepersChief = 62473983,
ThunderKingRaiOh = 71564252,
GravekeepersCommandant = 17393207,
GravekeepersAssailant = 25262697,
GravekeepersDescendant = 30213599,
GravekeepersSpy = 24317029,
GravekeepersRecruiter = 93023479,
AllureOfDarkness = 1475311,
DarkHole = 53129443,
RoyalTribute = 72405967,
GravekeepersStele = 99523325,
MysticalSpaceTyphoon = 5318639,
BookofMoon = 14087893,
HiddenTemplesOfNecrovalley = 70000776,
Necrovalley = 47355498,
BottomlessTrapHole = 29401950,
RiteOfSpirit = 30450531,
TorrentialTribute = 53582587,
DimensionalPrison = 70342110,
SolemnWarning = 84749824,
ImperialTombsOfNecrovalley = 90434657
public static int GravekeepersOracle = 25524823;
public static int MaleficStardustDragon = 36521459;
public static int GravekeepersVisionary = 3825890;
public static int GravekeepersChief = 62473983;
public static int ThunderKingRaiOh = 71564252;
public static int GravekeepersCommandant = 17393207;
public static int GravekeepersAssailant = 25262697;
public static int GravekeepersDescendant = 30213599;
public static int GravekeepersSpy = 24317029;
public static int GravekeepersRecruiter = 93023479;
public static int AllureOfDarkness = 1475311;
public static int DarkHole = 53129443;
public static int RoyalTribute = 72405967;
public static int GravekeepersStele = 99523325;
public static int MysticalSpaceTyphoon = 5318639;
public static int BookofMoon = 14087893;
public static int HiddenTemplesOfNecrovalley = 70000776;
public static int Necrovalley = 47355498;
public static int BottomlessTrapHole = 29401950;
public static int RiteOfSpirit = 30450531;
public static int TorrentialTribute = 53582587;
public static int DimensionalPrison = 70342110;
public static int SolemnWarning = 84749824;
public static int ImperialTombsOfNecrovalley = 90434657;
}
public GravekeeperExecutor(GameAI ai, Duel duel)
......@@ -42,41 +43,41 @@ namespace WindBot.Game.AI.Decks
{
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, (int)CardId.AllureOfDarkness);
AddExecutor(ExecutorType.Activate, (int)CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.RoyalTribute);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersStele);
AddExecutor(ExecutorType.Activate, (int)CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, (int)CardId.BookofMoon, DefaultBookOfMoon);
AddExecutor(ExecutorType.Activate, (int)CardId.HiddenTemplesOfNecrovalley, HiddenTemplesOfNecrovalleyEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.Necrovalley, NecrovalleyActivate);
AddExecutor(ExecutorType.Activate, CardId.AllureOfDarkness);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.RoyalTribute);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersStele);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.BookofMoon, DefaultBookOfMoon);
AddExecutor(ExecutorType.Activate, CardId.HiddenTemplesOfNecrovalley, HiddenTemplesOfNecrovalleyEffect);
AddExecutor(ExecutorType.Activate, CardId.Necrovalley, NecrovalleyActivate);
AddExecutor(ExecutorType.Activate, (int)CardId.BottomlessTrapHole, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, (int)CardId.DimensionalPrison, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.RiteOfSpirit, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.ImperialTombsOfNecrovalley, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.TorrentialTribute, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Activate, CardId.BottomlessTrapHole, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, CardId.DimensionalPrison, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.RiteOfSpirit, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.ImperialTombsOfNecrovalley, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.TorrentialTribute, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Summon, (int)CardId.GravekeepersOracle);
AddExecutor(ExecutorType.SpSummon, (int)CardId.MaleficStardustDragon, MaleficStardustDragonSummon);
AddExecutor(ExecutorType.Summon, (int)CardId.GravekeepersVisionary);
AddExecutor(ExecutorType.Summon, (int)CardId.GravekeepersChief);
AddExecutor(ExecutorType.Summon, (int)CardId.ThunderKingRaiOh);
AddExecutor(ExecutorType.Summon, (int)CardId.GravekeepersCommandant, GravekeepersCommandantSummon);
AddExecutor(ExecutorType.Summon, (int)CardId.GravekeepersAssailant);
AddExecutor(ExecutorType.Summon, (int)CardId.GravekeepersDescendant);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.GravekeepersSpy);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.GravekeepersRecruiter);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersOracle);
AddExecutor(ExecutorType.SpSummon, CardId.MaleficStardustDragon, MaleficStardustDragonSummon);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersVisionary);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersChief);
AddExecutor(ExecutorType.Summon, CardId.ThunderKingRaiOh);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersCommandant, GravekeepersCommandantSummon);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersAssailant);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersDescendant);
AddExecutor(ExecutorType.MonsterSet, CardId.GravekeepersSpy);
AddExecutor(ExecutorType.MonsterSet, CardId.GravekeepersRecruiter);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersOracle);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersVisionary);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersChief);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersCommandant, GravekeepersCommandantEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersAssailant, GravekeepersAssailantEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersDescendant, GravekeepersDescendantEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersSpy, SearchForDescendant);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersRecruiter, SearchForDescendant);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersOracle);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersVisionary);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersChief);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersCommandant, GravekeepersCommandantEffect);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersAssailant, GravekeepersAssailantEffect);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersDescendant, GravekeepersDescendantEffect);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersSpy, SearchForDescendant);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersRecruiter, SearchForDescendant);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
......@@ -104,7 +105,7 @@ namespace WindBot.Game.AI.Decks
private bool GravekeepersCommandantEffect()
{
if (!Bot.HasInHand((int)CardId.Necrovalley) && !Bot.HasInSpellZone((int)CardId.Necrovalley))
if (!Bot.HasInHand(CardId.Necrovalley) && !Bot.HasInSpellZone(CardId.Necrovalley))
return true;
return false;
}
......@@ -139,7 +140,7 @@ namespace WindBot.Game.AI.Decks
private bool SearchForDescendant()
{
AI.SelectCard((int)CardId.GravekeepersDescendant);
AI.SelectCard(CardId.GravekeepersDescendant);
return true;
}
}
......
......@@ -6,26 +6,27 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Graydle", "AI_Graydle")]
// NOT FINISHED YET
[Deck("Graydle", "AI_Graydle", "NotFinished")]
public class GraydleExecutor : DefaultExecutor
{
public enum CardId
public class CardId
{
DarkHole = 53129443,
CosmicCyclone = 8267140,
SolemnJudgment = 41420027,
SolemnWarning = 84749824,
SolemnStrike = 40605147
public static int DarkHole = 53129443;
public static int CosmicCyclone = 8267140;
public static int SolemnJudgment = 41420027;
public static int SolemnWarning = 84749824;
public static int SolemnStrike = 40605147;
}
public GraydleExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, (int)CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.CosmicCyclone, DefaultCosmicCyclone);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnJudgment, DefaultSolemnJudgment);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.CosmicCyclone, DefaultCosmicCyclone);
AddExecutor(ExecutorType.Activate, CardId.SolemnJudgment, DefaultSolemnJudgment);
AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, DefaultDontChainMyself);
AddExecutor(ExecutorType.MonsterSet);
AddExecutor(ExecutorType.SpSummon);
......
......@@ -6,84 +6,84 @@ using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game.AI.Decks
{
[Deck("Horus", "AI_Horus")]
[Deck("Horus", "AI_Horus", "Easy")]
public class HorusExecutor : DefaultExecutor
{
public enum CardId
{
AlexandriteDragon = 43096270,
LusterDragon = 11091375,
WhiteNightDragon = 79473793,
HorusTheBlackFlameDragonLv8 = 48229808,
HorusTheBlackFlameDragonLv6 = 11224103,
CyberDragon = 70095154,
AxeDragonute = 84914462,
DodgerDragon = 47013502,
GolemDragon = 9666558,
Raigeki = 12580477,
HammerShot = 26412047,
DarkHole = 53129443,
Fissure = 66788016,
StampingDestruction = 81385346,
FoolishBurial = 81439173,
MonsterReborn = 83764718,
MysticalSpaceTyphoon = 5318639,
BellowOfTheSilverDragon = 80600103,
Mountain = 50913601,
DragonsRebirth = 20638610,
MirrorForce = 44095762,
DimensionalPrison = 70342110
public class CardId
{
public static int AlexandriteDragon = 43096270;
public static int LusterDragon = 11091375;
public static int WhiteNightDragon = 79473793;
public static int HorusTheBlackFlameDragonLv8 = 48229808;
public static int HorusTheBlackFlameDragonLv6 = 11224103;
public static int CyberDragon = 70095154;
public static int AxeDragonute = 84914462;
public static int DodgerDragon = 47013502;
public static int GolemDragon = 9666558;
public static int Raigeki = 12580477;
public static int HammerShot = 26412047;
public static int DarkHole = 53129443;
public static int Fissure = 66788016;
public static int StampingDestruction = 81385346;
public static int FoolishBurial = 81439173;
public static int MonsterReborn = 83764718;
public static int MysticalSpaceTyphoon = 5318639;
public static int BellowOfTheSilverDragon = 80600103;
public static int Mountain = 50913601;
public static int DragonsRebirth = 20638610;
public static int MirrorForce = 44095762;
public static int DimensionalPrison = 70342110;
}
public HorusExecutor(GameAI ai, Duel duel) : base(ai, duel)
{
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, (int)CardId.HorusTheBlackFlameDragonLv6);
AddExecutor(ExecutorType.Activate, (int)CardId.StampingDestruction, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, (int)CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, (int)CardId.FoolishBurial, FoolishBurial);
AddExecutor(ExecutorType.Activate, (int)CardId.Mountain, DefaultField);
AddExecutor(ExecutorType.Activate, (int)CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.HorusTheBlackFlameDragonLv6);
AddExecutor(ExecutorType.Activate, CardId.StampingDestruction, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.FoolishBurial, FoolishBurial);
AddExecutor(ExecutorType.Activate, CardId.Mountain, DefaultField);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.SpSummon, (int)CardId.CyberDragon);
AddExecutor(ExecutorType.SpSummon, CardId.CyberDragon);
AddExecutor(ExecutorType.Activate, (int)CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, (int)CardId.HammerShot, DefaultHammerShot);
AddExecutor(ExecutorType.Activate, (int)CardId.Fissure);
AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, CardId.HammerShot, DefaultHammerShot);
AddExecutor(ExecutorType.Activate, CardId.Fissure);
AddExecutor(ExecutorType.Activate, (int)CardId.BellowOfTheSilverDragon, BellowOfTheSilverDragon);
AddExecutor(ExecutorType.Activate, (int)CardId.MonsterReborn, MonsterReborn);
AddExecutor(ExecutorType.Activate, CardId.BellowOfTheSilverDragon, BellowOfTheSilverDragon);
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, MonsterReborn);
AddExecutor(ExecutorType.Summon, (int)CardId.WhiteNightDragon, WhiteNightDragon);
AddExecutor(ExecutorType.Summon, (int)CardId.HorusTheBlackFlameDragonLv6, DefaultTributeSummon);
AddExecutor(ExecutorType.Summon, (int)CardId.AlexandriteDragon);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.AxeDragonute);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.DodgerDragon);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.GolemDragon);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.LusterDragon);
AddExecutor(ExecutorType.Summon, CardId.WhiteNightDragon, WhiteNightDragon);
AddExecutor(ExecutorType.Summon, CardId.HorusTheBlackFlameDragonLv6, DefaultTributeSummon);
AddExecutor(ExecutorType.Summon, CardId.AlexandriteDragon);
AddExecutor(ExecutorType.SummonOrSet, CardId.AxeDragonute);
AddExecutor(ExecutorType.SummonOrSet, CardId.DodgerDragon);
AddExecutor(ExecutorType.MonsterSet, CardId.GolemDragon);
AddExecutor(ExecutorType.SummonOrSet, CardId.LusterDragon);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.Activate, (int)CardId.HorusTheBlackFlameDragonLv8, HorusTheBlackFlameDragonLv8);
AddExecutor(ExecutorType.Activate, (int)CardId.MirrorForce, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.DimensionalPrison, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.DragonsRebirth, DragonsRebirth);
AddExecutor(ExecutorType.Activate, CardId.HorusTheBlackFlameDragonLv8, HorusTheBlackFlameDragonLv8);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.DimensionalPrison, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.DragonsRebirth, DragonsRebirth);
}
private bool FoolishBurial()
{
if (Bot.HasInGraveyard((int)CardId.WhiteNightDragon))
if (Bot.HasInGraveyard(CardId.WhiteNightDragon))
return false;
if (Bot.HasInHand((int)CardId.WhiteNightDragon))
if (Bot.HasInHand(CardId.WhiteNightDragon))
return false;
int remaining = 2;
foreach (ClientCard card in Bot.Banished)
if (card.Id == (int)CardId.WhiteNightDragon)
if (card.Id == CardId.WhiteNightDragon)
remaining--;
if (remaining > 0)
{
AI.SelectCard((int)CardId.WhiteNightDragon);
AI.SelectCard(CardId.WhiteNightDragon);
return true;
}
return false;
......@@ -197,7 +197,7 @@ namespace WindBot.Game.AI.Decks
ClientCard monster = cards[i];
if (monster.Attack < 2300)
return false;
if (monster.Race == (int)CardRace.Dragon && monster.Id != (int)CardId.HorusTheBlackFlameDragonLv8)
if (monster.Race == (int)CardRace.Dragon && monster.Id != CardId.HorusTheBlackFlameDragonLv8)
{
summonCard = monster;
break;
......
......@@ -6,47 +6,47 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Lightsworn", "AI_Lightsworn")]
// NOT FINISHED YET
[Deck("Lightsworn", "AI_Lightsworn", "NotFinished")]
public class LightswornExecutor : DefaultExecutor
{
public enum CardId
{
JudgmentDragon = 57774843,
Wulf = 58996430,
Garoth = 59019082,
Raiden = 77558536,
Lyla = 22624373,
Felis = 73176465,
Lumina = 95503687,
Minerva = 40164421,
Ryko = 21502796,
PerformageTrickClown = 67696066,
Goblindbergh = 25259669,
ThousandBlades = 1833916,
Honest = 37742478,
GlowUpBulb = 67441435,
SolarRecharge = 691925,
GalaxyCyclone = 5133471,
HarpiesFeatherDuster = 18144506,
ReinforcementOfTheArmy = 32807846,
MetalfoesFusion = 73594093,
ChargeOfTheLightBrigade = 94886282,
Michael = 4779823,
MinervaTheExalted = 30100551,
TrishulaDragonOfTheIceBarrier = 52687916,
ScarlightRedDragonArchfiend = 80666118,
PSYFramelordOmega = 74586817,
PSYFramelordZeta = 37192109,
NumberS39UtopiatheLightning = 56832966,
Number39Utopia = 84013237,
CastelTheSkyblasterMusketeer = 82633039,
EvilswarmExcitonKnight = 46772449,
DanteTravelerOfTheBurningAbyss = 83531441,
DecodeTalker = 1861629,
MissusRadiant = 3987233
public class CardId
{
public static int JudgmentDragon = 57774843;
public static int Wulf = 58996430;
public static int Garoth = 59019082;
public static int Raiden = 77558536;
public static int Lyla = 22624373;
public static int Felis = 73176465;
public static int Lumina = 95503687;
public static int Minerva = 40164421;
public static int Ryko = 21502796;
public static int PerformageTrickClown = 67696066;
public static int Goblindbergh = 25259669;
public static int ThousandBlades = 1833916;
public static int Honest = 37742478;
public static int GlowUpBulb = 67441435;
public static int SolarRecharge = 691925;
public static int GalaxyCyclone = 5133471;
public static int HarpiesFeatherDuster = 18144506;
public static int ReinforcementOfTheArmy = 32807846;
public static int MetalfoesFusion = 73594093;
public static int ChargeOfTheLightBrigade = 94886282;
public static int Michael = 4779823;
public static int MinervaTheExalted = 30100551;
public static int TrishulaDragonOfTheIceBarrier = 52687916;
public static int ScarlightRedDragonArchfiend = 80666118;
public static int PSYFramelordOmega = 74586817;
public static int PSYFramelordZeta = 37192109;
public static int NumberS39UtopiatheLightning = 56832966;
public static int Number39Utopia = 84013237;
public static int CastelTheSkyblasterMusketeer = 82633039;
public static int EvilswarmExcitonKnight = 46772449;
public static int DanteTravelerOfTheBurningAbyss = 83531441;
public static int DecodeTalker = 1861629;
public static int MissusRadiant = 3987233;
}
bool ClownUsed = false;
......@@ -54,36 +54,36 @@ namespace WindBot.Game.AI.Decks
public LightswornExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, (int)CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, (int)CardId.GalaxyCyclone, DefaultGalaxyCyclone);
AddExecutor(ExecutorType.Activate, (int)CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, CardId.GalaxyCyclone, DefaultGalaxyCyclone);
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, (int)CardId.MetalfoesFusion);
AddExecutor(ExecutorType.Activate, (int)CardId.GlowUpBulb);
AddExecutor(ExecutorType.Activate, CardId.MetalfoesFusion);
AddExecutor(ExecutorType.Activate, CardId.GlowUpBulb);
AddExecutor(ExecutorType.Activate, (int)CardId.JudgmentDragon, DefaultDarkHole);
AddExecutor(ExecutorType.SpSummon, (int)CardId.JudgmentDragon);
AddExecutor(ExecutorType.Activate, CardId.JudgmentDragon, DefaultDarkHole);
AddExecutor(ExecutorType.SpSummon, CardId.JudgmentDragon);
AddExecutor(ExecutorType.Activate, (int)CardId.ReinforcementOfTheArmy, ReinforcementOfTheArmyEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.ChargeOfTheLightBrigade, ChargeOfTheLightBrigadeEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.SolarRecharge, SolarRechargeEffect);
AddExecutor(ExecutorType.Activate, CardId.ReinforcementOfTheArmy, ReinforcementOfTheArmyEffect);
AddExecutor(ExecutorType.Activate, CardId.ChargeOfTheLightBrigade, ChargeOfTheLightBrigadeEffect);
AddExecutor(ExecutorType.Activate, CardId.SolarRecharge, SolarRechargeEffect);
AddExecutor(ExecutorType.Summon, (int)CardId.Goblindbergh, GoblindberghSummon);
AddExecutor(ExecutorType.Activate, (int)CardId.Goblindbergh, GoblindberghEffect);
AddExecutor(ExecutorType.Summon, CardId.Goblindbergh, GoblindberghSummon);
AddExecutor(ExecutorType.Activate, CardId.Goblindbergh, GoblindberghEffect);
AddExecutor(ExecutorType.SpSummon, (int)CardId.EvilswarmExcitonKnight, EvilswarmExcitonKnightSummon);
AddExecutor(ExecutorType.Activate, (int)CardId.EvilswarmExcitonKnight, EvilswarmExcitonKnightEffect);
AddExecutor(ExecutorType.SpSummon, (int)CardId.CastelTheSkyblasterMusketeer, CastelTheSkyblasterMusketeerSummom);
AddExecutor(ExecutorType.Activate, (int)CardId.CastelTheSkyblasterMusketeer, CastelTheSkyblasterMusketeerEffect);
AddExecutor(ExecutorType.SpSummon, (int)CardId.ScarlightRedDragonArchfiend, ScarlightRedDragonArchfiendSummon);
AddExecutor(ExecutorType.Activate, (int)CardId.ScarlightRedDragonArchfiend, ScarlightRedDragonArchfiendEffect);
AddExecutor(ExecutorType.SpSummon, (int)CardId.Number39Utopia, NumberS39UtopiatheLightningSummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, (int)CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.SpSummon, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightSummon);
AddExecutor(ExecutorType.Activate, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightEffect);
AddExecutor(ExecutorType.SpSummon, CardId.CastelTheSkyblasterMusketeer, DefaultCastelTheSkyblasterMusketeerSummon);
AddExecutor(ExecutorType.Activate, CardId.CastelTheSkyblasterMusketeer, DefaultCastelTheSkyblasterMusketeerEffect);
AddExecutor(ExecutorType.SpSummon, CardId.ScarlightRedDragonArchfiend, DefaultScarlightRedDragonArchfiendSummon);
AddExecutor(ExecutorType.Activate, CardId.ScarlightRedDragonArchfiend, DefaultScarlightRedDragonArchfiendEffect);
AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, (int)CardId.PerformageTrickClown, PerformageTrickClownEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.ThousandBlades);
AddExecutor(ExecutorType.Activate, (int)CardId.Honest, HonestEffect);
AddExecutor(ExecutorType.Activate, CardId.PerformageTrickClown, PerformageTrickClownEffect);
AddExecutor(ExecutorType.Activate, CardId.ThousandBlades);
AddExecutor(ExecutorType.Activate, CardId.Honest, HonestEffect);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
......@@ -100,11 +100,11 @@ namespace WindBot.Game.AI.Decks
if (defender.IsMonsterDangerous() || defender.IsDefense())
return false;
}
if (!(defender.Id == (int)CardId.NumberS39UtopiatheLightning))
if (!(defender.Id == CardId.NumberS39UtopiatheLightning))
{
if (attacker.Attribute == (int)CardAttribute.Light && Bot.HasInHand((int)CardId.Honest))
if (attacker.Attribute == (int)CardAttribute.Light && Bot.HasInHand(CardId.Honest))
attacker.RealPower = attacker.RealPower + defender.Attack;
if (attacker.Id == (int)CardId.NumberS39UtopiatheLightning && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.Number39Utopia))
if (attacker.Id == CardId.NumberS39UtopiatheLightning && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, CardId.Number39Utopia))
attacker.RealPower = 5000;
}
return attacker.RealPower > defender.GetDefensePower();
......@@ -124,7 +124,7 @@ namespace WindBot.Game.AI.Decks
IList<ClientCard> result = new List<ClientCard>();
foreach (ClientCard card in cards)
{
if (!result.Contains(card) && (!ClownUsed || card.Id != (int)CardId.PerformageTrickClown))
if (!result.Contains(card) && (!ClownUsed || card.Id != CardId.PerformageTrickClown))
result.Add(card);
if (result.Count >= 2)
break;
......@@ -147,24 +147,24 @@ namespace WindBot.Game.AI.Decks
private bool ReinforcementOfTheArmyEffect()
{
if (!Bot.HasInHand((int)CardId.Goblindbergh))
AI.SelectCard((int)CardId.Goblindbergh);
else if (!Bot.HasInHand((int)CardId.Raiden))
AI.SelectCard((int)CardId.Raiden);
if (!Bot.HasInHand(CardId.Goblindbergh))
AI.SelectCard(CardId.Goblindbergh);
else if (!Bot.HasInHand(CardId.Raiden))
AI.SelectCard(CardId.Raiden);
return true;
}
private bool ChargeOfTheLightBrigadeEffect()
{
if (!Bot.HasInHand((int)CardId.Lumina))
AI.SelectCard((int)CardId.Lumina);
if (!Bot.HasInHand(CardId.Lumina))
AI.SelectCard(CardId.Lumina);
else
AI.SelectCard(new[]
{
(int)CardId.Raiden,
(int)CardId.Lumina,
(int)CardId.Minerva,
(int)CardId.Lyla
CardId.Raiden,
CardId.Lumina,
CardId.Minerva,
CardId.Lyla
});
return true;
}
......@@ -173,11 +173,11 @@ namespace WindBot.Game.AI.Decks
{
AI.SelectCard(new[]
{
(int)CardId.Wulf,
(int)CardId.Felis,
(int)CardId.Minerva,
(int)CardId.Lyla,
(int)CardId.Raiden
CardId.Wulf,
CardId.Felis,
CardId.Minerva,
CardId.Lyla,
CardId.Raiden
});
return true;
}
......@@ -196,11 +196,11 @@ namespace WindBot.Game.AI.Decks
{
AI.SelectCard(new[]
{
(int)CardId.Felis,
(int)CardId.Wulf,
(int)CardId.Raiden,
(int)CardId.PerformageTrickClown,
(int)CardId.ThousandBlades
CardId.Felis,
CardId.Wulf,
CardId.Raiden,
CardId.PerformageTrickClown,
CardId.ThousandBlades
});
return true;
}
......@@ -216,80 +216,5 @@ namespace WindBot.Game.AI.Decks
{
return Duel.Phase != DuelPhase.Main1;
}
private bool EvilswarmExcitonKnightSummon()
{
int selfCount = Bot.GetMonsterCount() + Bot.GetSpellCount() + Bot.GetHandCount();
int oppoCount = Enemy.GetMonsterCount() + Enemy.GetSpellCount() + Enemy.GetHandCount();
return (selfCount - 1 < oppoCount) && EvilswarmExcitonKnightEffect();
}
private bool EvilswarmExcitonKnightEffect()
{
int selfCount = Bot.GetMonsterCount() + Bot.GetSpellCount();
int oppoCount = Enemy.GetMonsterCount() + Enemy.GetSpellCount();
int selfAttack = 0;
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
{
selfAttack += monster.GetDefensePower();
}
int oppoAttack = 0;
monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters)
{
oppoAttack += monster.GetDefensePower();
}
return (selfCount < oppoCount) || (selfAttack < oppoAttack);
}
private bool ScarlightRedDragonArchfiendSummon()
{
int selfBestAttack = AI.Utils.GetBestAttack(Bot, true);
int oppoBestAttack = AI.Utils.GetBestAttack(Enemy, false);
return (selfBestAttack <= oppoBestAttack && oppoBestAttack <= 3000) || ScarlightRedDragonArchfiendEffect();
}
private bool ScarlightRedDragonArchfiendEffect()
{
int selfCount = 0;
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (!monster.Equals(Card) && monster.HasType(CardType.Effect) && monster.Attack <= Card.Attack)
selfCount++;
}
int oppoCount = 0;
monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (monster.HasType(CardType.Effect) && monster.Attack <= Card.Attack)
oppoCount++;
}
return (oppoCount > 0 && selfCount <= oppoCount) || oppoCount > 2;
}
private bool CastelTheSkyblasterMusketeerSummom()
{
return AI.Utils.GetProblematicCard() != null;
}
private bool CastelTheSkyblasterMusketeerEffect()
{
if (ActivateDescription == AI.Utils.GetStringId((int)CardId.CastelTheSkyblasterMusketeer, 0))
return false;
AI.SelectNextCard(AI.Utils.GetProblematicCard());
return true;
}
private bool NumberS39UtopiatheLightningSummon()
{
return AI.Utils.IsEnemyBetter(false, false);
}
}
}
\ No newline at end of file
......@@ -6,13 +6,13 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("MokeyMokey", "AI_MokeyMokey")]
[Deck("MokeyMokey", "AI_MokeyMokey", "Easy")]
public class MokeyMokeyExecutor : DefaultExecutor
{
public enum CardId
public class CardId
{
LeoWizard = 4392470,
Bunilla = 69380702
public static int LeoWizard = 4392470;
public static int Bunilla = 69380702;
}
private int RockCount = 0;
......
......@@ -6,13 +6,13 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("MokeyMokeyKing", "AI_MokeyMokeyKing")]
[Deck("MokeyMokeyKing", "AI_MokeyMokeyKing", "Easy")]
public class MokeyMokeyKingExecutor : DefaultExecutor
{
public enum CardId
public class CardId
{
LeoWizard = 4392470,
Bunilla = 69380702
public static int LeoWizard = 4392470;
public static int Bunilla = 69380702;
}
private int RockCount = 0;
......
......@@ -6,36 +6,37 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Nekroz", "AI_Nekroz")]
// NOT FINISHED YET
[Deck("Nekroz", "AI_Nekroz", "NotFinished")]
public class NekrozExecutor : DefaultExecutor
{
public enum CardId
{
DancePrincess = 52738610,
ThousandHands = 23401839,
TenThousandHands = 95492061,
Shurit = 90307777,
MaxxC = 23434538,
DecisiveArmor = 88240999,
Trishula = 52068432,
Valkyrus = 25857246,
Gungnir = 74122412,
Brionac = 26674724,
Unicore = 89463537,
Clausolas = 99185129,
PhantomOfChaos = 30312361,
public class CardId
{
public static int DancePrincess = 52738610;
public static int ThousandHands = 23401839;
public static int TenThousandHands = 95492061;
public static int Shurit = 90307777;
public static int MaxxC = 23434538;
public static int DecisiveArmor = 88240999;
public static int Trishula = 52068432;
public static int Valkyrus = 25857246;
public static int Gungnir = 74122412;
public static int Brionac = 26674724;
public static int Unicore = 89463537;
public static int Clausolas = 99185129;
public static int PhantomOfChaos = 30312361;
DarkHole = 53129443,
ReinforcementOfTheArmy = 32807846,
TradeIn = 38120068,
PreparationOfRites = 96729612,
Mirror = 14735698,
Kaleidoscope = 51124303,
Cycle = 97211663,
MysticalSpaceTyphoon = 5318639,
RoyalDecree = 51452091,
EvilswarmExcitonKnight = 46772449,
HeraldOfTheArcLight = 79606837
public static int DarkHole = 53129443;
public static int ReinforcementOfTheArmy = 32807846;
public static int TradeIn = 38120068;
public static int PreparationOfRites = 96729612;
public static int Mirror = 14735698;
public static int Kaleidoscope = 51124303;
public static int Cycle = 97211663;
public static int MysticalSpaceTyphoon = 5318639;
public static int RoyalDecree = 51452091;
public static int EvilswarmExcitonKnight = 46772449;
public static int HeraldOfTheArcLight = 79606837;
}
List<int> NekrozRituelCard = new List<int>();
......@@ -44,79 +45,79 @@ namespace WindBot.Game.AI.Decks
public NekrozExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
NekrozRituelCard.Add((int)CardId.Clausolas);
NekrozRituelCard.Add((int)CardId.Unicore);
NekrozRituelCard.Add((int)CardId.DecisiveArmor);
NekrozRituelCard.Add((int)CardId.Brionac);
NekrozRituelCard.Add((int)CardId.Trishula);
NekrozRituelCard.Add((int)CardId.Gungnir);
NekrozRituelCard.Add((int)CardId.Valkyrus);
NekrozRituelCard.Add(CardId.Clausolas);
NekrozRituelCard.Add(CardId.Unicore);
NekrozRituelCard.Add(CardId.DecisiveArmor);
NekrozRituelCard.Add(CardId.Brionac);
NekrozRituelCard.Add(CardId.Trishula);
NekrozRituelCard.Add(CardId.Gungnir);
NekrozRituelCard.Add(CardId.Valkyrus);
NekrozSpellCard.Add((int)CardId.Mirror);
NekrozSpellCard.Add((int)CardId.Kaleidoscope);
NekrozSpellCard.Add((int)CardId.Cycle);
NekrozSpellCard.Add(CardId.Mirror);
NekrozSpellCard.Add(CardId.Kaleidoscope);
NekrozSpellCard.Add(CardId.Cycle);
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.Activate, (int)CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.ReinforcementOfTheArmy, ReinforcementOfTheArmyEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.TradeIn);
AddExecutor(ExecutorType.Activate, (int)CardId.PreparationOfRites);
AddExecutor(ExecutorType.Activate, (int)CardId.Mirror);
AddExecutor(ExecutorType.Activate, (int)CardId.Kaleidoscope);
AddExecutor(ExecutorType.Activate, (int)CardId.Cycle);
AddExecutor(ExecutorType.Activate, (int)CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, (int)CardId.RoyalDecree);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.ReinforcementOfTheArmy, ReinforcementOfTheArmyEffect);
AddExecutor(ExecutorType.Activate, CardId.TradeIn);
AddExecutor(ExecutorType.Activate, CardId.PreparationOfRites);
AddExecutor(ExecutorType.Activate, CardId.Mirror);
AddExecutor(ExecutorType.Activate, CardId.Kaleidoscope);
AddExecutor(ExecutorType.Activate, CardId.Cycle);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.RoyalDecree);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.DancePrincess, DancePrincessSummon);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.Shurit, ShuritSet);
AddExecutor(ExecutorType.Summon, (int)CardId.ThousandHands, ThousandHandsSummom);
AddExecutor(ExecutorType.Summon, (int)CardId.TenThousandHands, TenThousandHandsSummon);
AddExecutor(ExecutorType.Summon, (int)CardId.PhantomOfChaos, PhantomOfChaosSummon);
AddExecutor(ExecutorType.SummonOrSet, CardId.DancePrincess, DancePrincessSummon);
AddExecutor(ExecutorType.MonsterSet, CardId.Shurit, ShuritSet);
AddExecutor(ExecutorType.Summon, CardId.ThousandHands, ThousandHandsSummon);
AddExecutor(ExecutorType.Summon, CardId.TenThousandHands, TenThousandHandsSummon);
AddExecutor(ExecutorType.Summon, CardId.PhantomOfChaos, PhantomOfChaosSummon);
AddExecutor(ExecutorType.Activate, (int)CardId.Unicore, UnicoreEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.DecisiveArmor, DecisiveArmorEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.Valkyrus, ValkyrusEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.Gungnir, GungnirEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.Brionac, BrionacEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.Clausolas, ClausolasEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.Trishula);
AddExecutor(ExecutorType.Activate, (int)CardId.EvilswarmExcitonKnight, EvilswarmExcitonKnightEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.PhantomOfChaos, PhantomOfChaosEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.MaxxC);
AddExecutor(ExecutorType.Activate, (int)CardId.ThousandHands, ThousandHandsEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.TenThousandHands, BrionacEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.HeraldOfTheArcLight);
AddExecutor(ExecutorType.Activate, (int)CardId.Shurit);
AddExecutor(ExecutorType.Activate, CardId.Unicore, UnicoreEffect);
AddExecutor(ExecutorType.Activate, CardId.DecisiveArmor, DecisiveArmorEffect);
AddExecutor(ExecutorType.Activate, CardId.Valkyrus, ValkyrusEffect);
AddExecutor(ExecutorType.Activate, CardId.Gungnir, GungnirEffect);
AddExecutor(ExecutorType.Activate, CardId.Brionac, BrionacEffect);
AddExecutor(ExecutorType.Activate, CardId.Clausolas, ClausolasEffect);
AddExecutor(ExecutorType.Activate, CardId.Trishula);
AddExecutor(ExecutorType.Activate, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightEffect);
AddExecutor(ExecutorType.Activate, CardId.PhantomOfChaos, PhantomOfChaosEffect);
AddExecutor(ExecutorType.Activate, CardId.MaxxC);
AddExecutor(ExecutorType.Activate, CardId.ThousandHands, ThousandHandsEffect);
AddExecutor(ExecutorType.Activate, CardId.TenThousandHands, BrionacEffect);
AddExecutor(ExecutorType.Activate, CardId.HeraldOfTheArcLight);
AddExecutor(ExecutorType.Activate, CardId.Shurit);
AddExecutor(ExecutorType.SpSummon, (int)CardId.Trishula);
AddExecutor(ExecutorType.SpSummon, (int)CardId.DecisiveArmor);
AddExecutor(ExecutorType.SpSummon, (int)CardId.Valkyrus);
AddExecutor(ExecutorType.SpSummon, (int)CardId.Gungnir);
AddExecutor(ExecutorType.SpSummon, (int)CardId.Brionac);
AddExecutor(ExecutorType.SpSummon, (int)CardId.Unicore);
AddExecutor(ExecutorType.SpSummon, (int)CardId.Clausolas);
AddExecutor(ExecutorType.SpSummon, (int)CardId.EvilswarmExcitonKnight, EvilswarmExcitonKnightSummon);
AddExecutor(ExecutorType.SpSummon, CardId.Trishula);
AddExecutor(ExecutorType.SpSummon, CardId.DecisiveArmor);
AddExecutor(ExecutorType.SpSummon, CardId.Valkyrus);
AddExecutor(ExecutorType.SpSummon, CardId.Gungnir);
AddExecutor(ExecutorType.SpSummon, CardId.Brionac);
AddExecutor(ExecutorType.SpSummon, CardId.Unicore);
AddExecutor(ExecutorType.SpSummon, CardId.Clausolas);
AddExecutor(ExecutorType.SpSummon, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightSummon);
}
private bool ThousandHandsSummom()
private bool ThousandHandsSummon()
{
if (!Bot.HasInHand(NekrozRituelCard) || Bot.HasInHand((int)CardId.Shurit) || !Bot.HasInHand(NekrozSpellCard))
if (!Bot.HasInHand(NekrozRituelCard) || Bot.HasInHand(CardId.Shurit) || !Bot.HasInHand(NekrozSpellCard))
return true;
foreach (ClientCard Card in Bot.Hand)
if (Card != null && Card.Id == (int)CardId.Kaleidoscope && !Bot.HasInHand((int)CardId.Unicore))
if (Card != null && Card.Id == CardId.Kaleidoscope && !Bot.HasInHand(CardId.Unicore))
return true;
else if (Card.Id == (int)CardId.Trishula || Card.Id == (int)CardId.DecisiveArmor && !Bot.HasInHand((int)CardId.Mirror) || !Bot.HasInHand((int)CardId.Shurit))
else if (Card.Id == CardId.Trishula || Card.Id == CardId.DecisiveArmor && !Bot.HasInHand(CardId.Mirror) || !Bot.HasInHand(CardId.Shurit))
return true;
return false;
}
private bool ReinforcementOfTheArmyEffect()
{
if (!Bot.HasInGraveyard((int)CardId.Shurit) && !Bot.HasInHand((int)CardId.Shurit))
if (!Bot.HasInGraveyard(CardId.Shurit) && !Bot.HasInHand(CardId.Shurit))
{
AI.SelectCard((int)CardId.Shurit);
AI.SelectCard(CardId.Shurit);
return true;
}
return false;
......@@ -124,34 +125,34 @@ namespace WindBot.Game.AI.Decks
private bool TenThousandHandsSummon()
{
if (!Bot.HasInHand((int)CardId.ThousandHands) || !Bot.HasInHand((int)CardId.Shurit))
if (!Bot.HasInHand(CardId.ThousandHands) || !Bot.HasInHand(CardId.Shurit))
return true;
return false;
}
private bool DancePrincessSummon()
{
if (!Bot.HasInHand((int)CardId.ThousandHands) && !Bot.HasInHand((int)CardId.TenThousandHands))
if (!Bot.HasInHand(CardId.ThousandHands) && !Bot.HasInHand(CardId.TenThousandHands))
return true;
return false;
}
private bool PhantomOfChaosSummon()
{
if (Bot.HasInGraveyard((int)CardId.Shurit) && Bot.HasInHand(NekrozSpellCard) && Bot.HasInHand(NekrozRituelCard))
if (Bot.HasInGraveyard(CardId.Shurit) && Bot.HasInHand(NekrozSpellCard) && Bot.HasInHand(NekrozRituelCard))
return true;
return false;
}
private bool PhantomOfChaosEffect()
{
AI.SelectCard((int)CardId.Shurit);
AI.SelectCard(CardId.Shurit);
return true;
}
private bool ShuritSet()
{
if (!Bot.HasInHand((int)CardId.ThousandHands) && !Bot.HasInHand((int)CardId.TenThousandHands) && !Bot.HasInHand((int)CardId.DancePrincess))
if (!Bot.HasInHand(CardId.ThousandHands) && !Bot.HasInHand(CardId.TenThousandHands) && !Bot.HasInHand(CardId.DancePrincess))
return true;
return false;
}
......@@ -160,26 +161,12 @@ namespace WindBot.Game.AI.Decks
{
if (AI.Utils.IsAllEnemyBetterThanValue(3300, true))
{
AI.SelectCard((int)CardId.DecisiveArmor);
AI.SelectCard(CardId.DecisiveArmor);
return true;
}
return false;
}
private bool EvilswarmExcitonKnightSummon()
{
int selfCount = Bot.GetMonsterCount() + Bot.GetSpellCount() + Bot.GetHandCount();
int oppoCount = Enemy.GetMonsterCount() + Enemy.GetSpellCount() + Enemy.GetHandCount();
return (selfCount - 1 < oppoCount) && EvilswarmExcitonKnightEffect();
}
private bool EvilswarmExcitonKnightEffect()
{
int selfCount = Bot.GetMonsterCount() + Bot.GetSpellCount();
int oppoCount = Enemy.GetMonsterCount() + Enemy.GetSpellCount();
return selfCount < oppoCount;
}
private bool ValkyrusEffect()
{
if (Duel.Phase == DuelPhase.Battle)
......@@ -189,7 +176,7 @@ namespace WindBot.Game.AI.Decks
private bool GungnirEffect()
{
if (AI.Utils.IsEnemyBetter(true, false) && Duel.Phase == DuelPhase.Main1)
if (AI.Utils.IsOneEnemyBetter(true) && Duel.Phase == DuelPhase.Main1)
{
AI.SelectCard(Enemy.GetMonsters().GetHighestAttackMonster());
return true;
......@@ -199,34 +186,34 @@ namespace WindBot.Game.AI.Decks
private bool BrionacEffect()
{
if (!Bot.HasInHand((int)CardId.Shurit))
if (!Bot.HasInHand(CardId.Shurit))
{
AI.SelectCard((int)CardId.Shurit);
AI.SelectCard(CardId.Shurit);
return true;
}
else if (!Bot.HasInHand(NekrozSpellCard))
{
AI.SelectCard((int)CardId.Mirror);
AI.SelectCard(CardId.Mirror);
return true;
}
else if (AI.Utils.IsOneEnemyBetterThanValue(3300, true) && !Bot.HasInHand((int)CardId.Trishula))
else if (AI.Utils.IsOneEnemyBetterThanValue(3300, true) && !Bot.HasInHand(CardId.Trishula))
{
AI.SelectCard((int)CardId.Trishula);
AI.SelectCard(CardId.Trishula);
return true;
}
else if (AI.Utils.IsAllEnemyBetterThanValue(2700,true) && !Bot.HasInHand((int)CardId.DecisiveArmor))
else if (AI.Utils.IsAllEnemyBetterThanValue(2700,true) && !Bot.HasInHand(CardId.DecisiveArmor))
{
AI.SelectCard((int)CardId.DecisiveArmor);
AI.SelectCard(CardId.DecisiveArmor);
return true;
}
else if (Bot.HasInHand((int)CardId.Unicore) && !Bot.HasInHand((int)CardId.Kaleidoscope))
else if (Bot.HasInHand(CardId.Unicore) && !Bot.HasInHand(CardId.Kaleidoscope))
{
AI.SelectCard((int)CardId.Kaleidoscope);
AI.SelectCard(CardId.Kaleidoscope);
return true;
}
else if (!Bot.HasInHand((int)CardId.Unicore) && Bot.HasInHand((int)CardId.Kaleidoscope))
else if (!Bot.HasInHand(CardId.Unicore) && Bot.HasInHand(CardId.Kaleidoscope))
{
AI.SelectCard((int)CardId.Unicore);
AI.SelectCard(CardId.Unicore);
return true;
}
return true;
......@@ -234,19 +221,19 @@ namespace WindBot.Game.AI.Decks
private bool ThousandHandsEffect()
{
if (AI.Utils.IsOneEnemyBetterThanValue(3300, true) && !Bot.HasInHand((int)CardId.Trishula))
if (AI.Utils.IsOneEnemyBetterThanValue(3300, true) && !Bot.HasInHand(CardId.Trishula))
{
AI.SelectCard((int)CardId.Trishula);
AI.SelectCard(CardId.Trishula);
return true;
}
else if (AI.Utils.IsAllEnemyBetterThanValue(2700, true) && !Bot.HasInHand((int)CardId.DecisiveArmor))
else if (AI.Utils.IsAllEnemyBetterThanValue(2700, true) && !Bot.HasInHand(CardId.DecisiveArmor))
{
AI.SelectCard((int)CardId.DecisiveArmor);
AI.SelectCard(CardId.DecisiveArmor);
return true;
}
else if (!Bot.HasInHand((int)CardId.Unicore) && Bot.HasInHand((int)CardId.Kaleidoscope))
else if (!Bot.HasInHand(CardId.Unicore) && Bot.HasInHand(CardId.Kaleidoscope))
{
AI.SelectCard((int)CardId.Unicore);
AI.SelectCard(CardId.Unicore);
return true;
}
return true;
......@@ -254,9 +241,9 @@ namespace WindBot.Game.AI.Decks
private bool UnicoreEffect()
{
if (Bot.HasInGraveyard((int)CardId.Shurit))
if (Bot.HasInGraveyard(CardId.Shurit))
{
AI.SelectCard((int)CardId.Shurit);
AI.SelectCard(CardId.Shurit);
return true;
}
return false;
......@@ -266,7 +253,7 @@ namespace WindBot.Game.AI.Decks
{
if (!Bot.HasInHand(NekrozSpellCard))
{
AI.SelectCard((int)CardId.Mirror);
AI.SelectCard(CardId.Mirror);
return true;
}
return false;
......@@ -274,7 +261,7 @@ namespace WindBot.Game.AI.Decks
private bool IsTheLastPossibility()
{
if (!Bot.HasInHand((int)CardId.DecisiveArmor) && !Bot.HasInHand((int)CardId.Trishula))
if (!Bot.HasInHand(CardId.DecisiveArmor) && !Bot.HasInHand(CardId.Trishula))
return true;
return false;
}
......@@ -290,42 +277,42 @@ namespace WindBot.Game.AI.Decks
foreach (int Id in NekrozCard)
{
if (Id == (int)CardId.Trishula && AI.Utils.IsAllEnemyBetterThanValue(2700, true) && Bot.HasInHand((int)CardId.DecisiveArmor))
if (Id == CardId.Trishula && AI.Utils.IsAllEnemyBetterThanValue(2700, true) && Bot.HasInHand(CardId.DecisiveArmor))
{
AI.SelectCard((int)CardId.Trishula);
AI.SelectCard(CardId.Trishula);
return true;
}
else if (Id == (int)CardId.DecisiveArmor)
else if (Id == CardId.DecisiveArmor)
{
AI.SelectCard((int)CardId.DecisiveArmor);
AI.SelectCard(CardId.DecisiveArmor);
return true;
}
else if (Id == (int)CardId.Unicore && Bot.HasInHand((int)CardId.Kaleidoscope) && !Bot.HasInGraveyard((int)CardId.Shurit))
else if (Id == CardId.Unicore && Bot.HasInHand(CardId.Kaleidoscope) && !Bot.HasInGraveyard(CardId.Shurit))
{
AI.SelectCard((int)CardId.Unicore);
AI.SelectCard(CardId.Unicore);
return true;
}
else if (Id == (int)CardId.Valkyrus)
else if (Id == CardId.Valkyrus)
{
if (IsTheLastPossibility())
{
AI.SelectCard((int)CardId.Valkyrus);
AI.SelectCard(CardId.Valkyrus);
return true;
}
}
else if (Id == (int)CardId.Gungnir)
else if (Id == CardId.Gungnir)
{
if (IsTheLastPossibility())
{
AI.SelectCard((int)CardId.Gungnir);
AI.SelectCard(CardId.Gungnir);
return true;
}
}
else if (Id == (int)CardId.Clausolas)
else if (Id == CardId.Clausolas)
{
if (IsTheLastPossibility())
{
AI.SelectCard((int)CardId.Clausolas);
AI.SelectCard(CardId.Clausolas);
return true;
}
}
......
......@@ -6,47 +6,67 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("OldSchool", "AI_OldSchool")]
[Deck("OldSchool", "AI_OldSchool", "Easy")]
public class OldSchoolExecutor : DefaultExecutor
{
public enum CardId
public class CardId
{
Raigeki = 12580477
public static int AncientGearGolem = 83104731;
public static int Frostosaurus = 6631034;
public static int AlexandriteDragon = 43096270;
public static int GeneWarpedWarwolf = 69247929;
public static int GearGolemTheMovingFortress = 30190809;
public static int EvilswarmHeliotrope = 77542832;
public static int LusterDragon = 11091375;
public static int InsectKnight = 35052053;
public static int ArchfiendSoldier = 49881766;
public static int HeavyStorm = 19613556;
public static int DarkHole = 53129443;
public static int Raigeki = 12580477;
public static int HammerShot = 26412047;
public static int Fissure = 66788016;
public static int SwordsOfRevealingLight = 72302403;
public static int DoubleSummon = 43422537;
public static int MirrorForce = 44095762;
public static int DimensionalPrison = 70342110;
}
public OldSchoolExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, 19613556, DefaultHeavyStorm);
AddExecutor(ExecutorType.Activate, CardId.HeavyStorm, DefaultHeavyStorm);
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, 53129443, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, 26412047, DefaultHammerShot);
AddExecutor(ExecutorType.Activate, 66788016);
AddExecutor(ExecutorType.Activate, 72302403, SwordsOfRevealingLight);
AddExecutor(ExecutorType.Activate, 43422537, DoubleSummon);
AddExecutor(ExecutorType.Summon, 83104731, DefaultTributeSummon);
AddExecutor(ExecutorType.Summon, 6631034, DefaultTributeSummon);
AddExecutor(ExecutorType.SummonOrSet, 43096270);
AddExecutor(ExecutorType.SummonOrSet, 69247929);
AddExecutor(ExecutorType.MonsterSet, 30190809);
AddExecutor(ExecutorType.SummonOrSet, 77542832);
AddExecutor(ExecutorType.SummonOrSet, 11091375);
AddExecutor(ExecutorType.SummonOrSet, 35052053);
AddExecutor(ExecutorType.SummonOrSet, 49881766);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, CardId.HammerShot, DefaultHammerShot);
AddExecutor(ExecutorType.Activate, CardId.Fissure);
AddExecutor(ExecutorType.Activate, CardId.SwordsOfRevealingLight, SwordsOfRevealingLight);
AddExecutor(ExecutorType.Activate, CardId.DoubleSummon, DoubleSummon);
AddExecutor(ExecutorType.Summon, CardId.AncientGearGolem, DefaultTributeSummon);
AddExecutor(ExecutorType.Summon, CardId.Frostosaurus, DefaultTributeSummon);
AddExecutor(ExecutorType.SummonOrSet, CardId.AlexandriteDragon);
AddExecutor(ExecutorType.SummonOrSet, CardId.GeneWarpedWarwolf);
AddExecutor(ExecutorType.MonsterSet, CardId.GearGolemTheMovingFortress);
AddExecutor(ExecutorType.SummonOrSet, CardId.EvilswarmHeliotrope);
AddExecutor(ExecutorType.SummonOrSet, CardId.LusterDragon);
AddExecutor(ExecutorType.SummonOrSet, CardId.InsectKnight);
AddExecutor(ExecutorType.SummonOrSet, CardId.ArchfiendSoldier);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.Activate, 44095762, DefaultTrap);
AddExecutor(ExecutorType.Activate, 70342110, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.DimensionalPrison, DefaultTrap);
}
private int _lastDoubleSummon;
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (defender.IsMonsterInvincible() && !defender.IsMonsterDangerous() && attacker.Id == 83104731)
if (defender.IsMonsterInvincible() && !defender.IsMonsterDangerous() && attacker.Id == CardId.AncientGearGolem)
return true;
return base.OnPreBattleBetween(attacker, defender);
}
......@@ -91,7 +111,7 @@ namespace WindBot.Game.AI.Decks
if (handCard.IsFacedown())
return true;
}
return AI.Utils.IsEnemyBetter(true, false);
return AI.Utils.IsOneEnemyBetter(true);
}
}
}
\ No newline at end of file
......@@ -9,113 +9,113 @@ namespace WindBot.Game.AI.Decks
[Deck("Qliphort", "AI_Qliphort")]
public class QliphortExecutor : DefaultExecutor
{
public enum CardId
{
Scout = 65518099,
Stealth = 13073850,
Shell = 90885155,
Helix = 37991342,
Carrier = 91907707,
DarkHole = 53129443,
CardOfDemise = 59750328,
SummonersArt = 79816536,
PotOfDuality = 98645731,
Saqlifice = 17639150,
MirrorForce = 44095762,
TorrentialTribute = 53582587,
DimensionalBarrier = 83326048,
CompulsoryEvacuationDevice = 94192409,
VanitysEmptiness = 5851097,
SkillDrain = 82732705,
SolemnStrike = 40605147,
TheHugeRevolutionIsOver = 99188141
public class CardId
{
public static int Scout = 65518099;
public static int Stealth = 13073850;
public static int Shell = 90885155;
public static int Helix = 37991342;
public static int Carrier = 91907707;
public static int DarkHole = 53129443;
public static int CardOfDemise = 59750328;
public static int SummonersArt = 79816536;
public static int PotOfDuality = 98645731;
public static int Saqlifice = 17639150;
public static int MirrorForce = 44095762;
public static int TorrentialTribute = 53582587;
public static int DimensionalBarrier = 83326048;
public static int CompulsoryEvacuationDevice = 94192409;
public static int VanitysEmptiness = 5851097;
public static int SkillDrain = 82732705;
public static int SolemnStrike = 40605147;
public static int TheHugeRevolutionIsOver = 99188141;
}
bool CardOfDemiseUsed = false;
List<int> LowScaleCards = new List<int>
{
(int)CardId.Stealth,
(int)CardId.Carrier
CardId.Stealth,
CardId.Carrier
};
List<int> HighScaleCards = new List<int>
{
(int)CardId.Scout,
(int)CardId.Shell,
(int)CardId.Helix
CardId.Scout,
CardId.Shell,
CardId.Helix
};
public QliphortExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, (int)CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.SummonersArt);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.SummonersArt);
AddExecutor(ExecutorType.Activate, (int)CardId.Scout, ScoutActivate);
AddExecutor(ExecutorType.Activate, (int)CardId.Scout, ScoutEffect);
AddExecutor(ExecutorType.Activate, CardId.Scout, ScoutActivate);
AddExecutor(ExecutorType.Activate, CardId.Scout, ScoutEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.Stealth, ScaleActivate);
AddExecutor(ExecutorType.Activate, (int)CardId.Shell, ScaleActivate);
AddExecutor(ExecutorType.Activate, (int)CardId.Helix, ScaleActivate);
AddExecutor(ExecutorType.Activate, (int)CardId.Carrier, ScaleActivate);
AddExecutor(ExecutorType.Activate, CardId.Stealth, ScaleActivate);
AddExecutor(ExecutorType.Activate, CardId.Shell, ScaleActivate);
AddExecutor(ExecutorType.Activate, CardId.Helix, ScaleActivate);
AddExecutor(ExecutorType.Activate, CardId.Carrier, ScaleActivate);
AddExecutor(ExecutorType.Summon, NormalSummon);
AddExecutor(ExecutorType.SpSummon);
AddExecutor(ExecutorType.Activate, (int)CardId.Saqlifice, SaqlificeEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.Stealth, StealthEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.Helix, HelixEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.Carrier, CarrierEffect);
AddExecutor(ExecutorType.SpellSet, (int)CardId.SkillDrain, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, (int)CardId.VanitysEmptiness, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, (int)CardId.DimensionalBarrier, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, (int)CardId.TorrentialTribute, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, (int)CardId.SolemnStrike, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, (int)CardId.MirrorForce, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, (int)CardId.CompulsoryEvacuationDevice, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, (int)CardId.TheHugeRevolutionIsOver, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, (int)CardId.Saqlifice, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, (int)CardId.SkillDrain, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, (int)CardId.VanitysEmptiness, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, (int)CardId.DimensionalBarrier, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, (int)CardId.TorrentialTribute, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, (int)CardId.SolemnStrike, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, (int)CardId.MirrorForce, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, (int)CardId.CompulsoryEvacuationDevice, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, (int)CardId.TheHugeRevolutionIsOver, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, (int)CardId.DarkHole, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, (int)CardId.SummonersArt, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, (int)CardId.PotOfDuality, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.Activate, (int)CardId.PotOfDuality, PotOfDualityEffect);
AddExecutor(ExecutorType.SpellSet, (int)CardId.CardOfDemise);
AddExecutor(ExecutorType.Activate, (int)CardId.CardOfDemise, CardOfDemiseEffect);
AddExecutor(ExecutorType.SpellSet, (int)CardId.Saqlifice, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, (int)CardId.SkillDrain, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, (int)CardId.VanitysEmptiness, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, (int)CardId.DimensionalBarrier, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, (int)CardId.TorrentialTribute, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, (int)CardId.SolemnStrike, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, (int)CardId.MirrorForce, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, (int)CardId.CompulsoryEvacuationDevice, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, (int)CardId.TheHugeRevolutionIsOver, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, (int)CardId.DarkHole, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, (int)CardId.SummonersArt, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, (int)CardId.PotOfDuality, CardOfDemiseAcivated);
AddExecutor(ExecutorType.Activate, (int)CardId.TheHugeRevolutionIsOver, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, (int)CardId.SkillDrain, SkillDrainEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.VanitysEmptiness, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.CompulsoryEvacuationDevice, DefaultCompulsoryEvacuationDevice);
AddExecutor(ExecutorType.Activate, (int)CardId.DimensionalBarrier, DefaultDimensionalBarrier);
AddExecutor(ExecutorType.Activate, (int)CardId.MirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.TorrentialTribute, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Activate, CardId.Saqlifice, SaqlificeEffect);
AddExecutor(ExecutorType.Activate, CardId.Stealth, StealthEffect);
AddExecutor(ExecutorType.Activate, CardId.Helix, HelixEffect);
AddExecutor(ExecutorType.Activate, CardId.Carrier, CarrierEffect);
AddExecutor(ExecutorType.SpellSet, CardId.SkillDrain, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.VanitysEmptiness, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.DimensionalBarrier, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.TorrentialTribute, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnStrike, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.MirrorForce, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.CompulsoryEvacuationDevice, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.TheHugeRevolutionIsOver, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.Saqlifice, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.SkillDrain, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.VanitysEmptiness, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.DimensionalBarrier, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.TorrentialTribute, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnStrike, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.MirrorForce, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.CompulsoryEvacuationDevice, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.TheHugeRevolutionIsOver, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.DarkHole, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.SummonersArt, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.PotOfDuality, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.Activate, CardId.PotOfDuality, PotOfDualityEffect);
AddExecutor(ExecutorType.SpellSet, CardId.CardOfDemise);
AddExecutor(ExecutorType.Activate, CardId.CardOfDemise, CardOfDemiseEffect);
AddExecutor(ExecutorType.SpellSet, CardId.Saqlifice, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.SkillDrain, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.VanitysEmptiness, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.DimensionalBarrier, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.TorrentialTribute, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnStrike, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.MirrorForce, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.CompulsoryEvacuationDevice, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.TheHugeRevolutionIsOver, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.DarkHole, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.SummonersArt, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.PotOfDuality, CardOfDemiseAcivated);
AddExecutor(ExecutorType.Activate, CardId.TheHugeRevolutionIsOver, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, CardId.SkillDrain, SkillDrainEffect);
AddExecutor(ExecutorType.Activate, CardId.VanitysEmptiness, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.CompulsoryEvacuationDevice, DefaultCompulsoryEvacuationDevice);
AddExecutor(ExecutorType.Activate, CardId.DimensionalBarrier, DefaultDimensionalBarrier);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.TorrentialTribute, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
......@@ -147,7 +147,7 @@ namespace WindBot.Game.AI.Decks
private bool NormalSummon()
{
if (Card.Id == (int)CardId.Scout)
if (Card.Id == CardId.Scout)
return false;
if (Card.Level < 8)
AI.SelectOption(1);
......@@ -163,16 +163,16 @@ namespace WindBot.Game.AI.Decks
{
AI.SelectCard(new[]
{
(int)CardId.Scout,
(int)CardId.SkillDrain,
(int)CardId.VanitysEmptiness,
(int)CardId.DimensionalBarrier,
(int)CardId.Stealth,
(int)CardId.Shell,
(int)CardId.Helix,
(int)CardId.Carrier,
(int)CardId.SolemnStrike,
(int)CardId.CardOfDemise
CardId.Scout,
CardId.SkillDrain,
CardId.VanitysEmptiness,
CardId.DimensionalBarrier,
CardId.Stealth,
CardId.Shell,
CardId.Helix,
CardId.Carrier,
CardId.SolemnStrike,
CardId.CardOfDemise
});
return !ShouldPendulum();
}
......@@ -214,7 +214,7 @@ namespace WindBot.Game.AI.Decks
ClientCard l = AI.Utils.GetPZone(0, 0);
ClientCard r = AI.Utils.GetPZone(0, 1);
if (l == null && r == null)
AI.SelectCard((int)CardId.Scout);
AI.SelectCard(CardId.Scout);
}
return true;
}
......@@ -244,9 +244,8 @@ namespace WindBot.Game.AI.Decks
if (!Card.Equals(card))
count++;
}
foreach (ClientCard card in Bot.ExtraDeck.GetMonsters())
foreach (ClientCard card in Bot.ExtraDeck.GetFaceupPendulumMonsters())
{
if (card.HasType(CardType.Pendulum) && card.IsFaceup())
count++;
}
ClientCard l = AI.Utils.GetPZone(0, 0);
......@@ -290,9 +289,8 @@ namespace WindBot.Game.AI.Decks
{
fieldcount++;
}
foreach (ClientCard card in Bot.ExtraDeck.GetMonsters())
foreach (ClientCard card in Bot.ExtraDeck.GetFaceupPendulumMonsters())
{
if (card.HasType(CardType.Pendulum) && card.IsFaceup())
count++;
}
if (count>0 && !Bot.HasInHand(LowScaleCards))
......@@ -303,9 +301,9 @@ namespace WindBot.Game.AI.Decks
{
AI.SelectCard(new[]
{
(int)CardId.Saqlifice,
(int)CardId.Shell,
(int)CardId.Helix
CardId.Saqlifice,
CardId.Shell,
CardId.Helix
});
}
else
......@@ -319,32 +317,12 @@ namespace WindBot.Game.AI.Decks
{
if (Card.Location == CardLocation.Hand)
return false;
ClientCard target = AI.Utils.GetProblematicCard();
ClientCard target = AI.Utils.GetBestEnemyCard();
if (target != null)
{
AI.SelectCard(target);
return true;
}
List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters)
{
AI.SelectCard(monster);
return true;
}
List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells)
{
if (spell.IsFacedown())
{
AI.SelectCard(spell);
return true;
}
}
foreach (ClientCard spell in spells)
{
AI.SelectCard(spell);
return true;
}
return false;
}
......@@ -352,18 +330,12 @@ namespace WindBot.Game.AI.Decks
{
if (Card.Location == CardLocation.Hand)
return false;
ClientCard target = AI.Utils.GetProblematicMonsterCard();
ClientCard target = AI.Utils.GetBestEnemyMonster();
if (target != null)
{
AI.SelectCard(target);
return true;
}
List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters)
{
AI.SelectCard(monster);
return true;
}
return false;
}
......@@ -371,26 +343,12 @@ namespace WindBot.Game.AI.Decks
{
if (Card.Location == CardLocation.Hand)
return false;
ClientCard target = AI.Utils.GetProblematicSpellCard();
ClientCard target = AI.Utils.GetBestEnemySpell();
if (target != null)
{
AI.SelectCard(target);
return true;
}
List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells)
{
if (spell.IsFacedown())
{
AI.SelectCard(spell);
return true;
}
}
foreach (ClientCard spell in spells)
{
AI.SelectCard(spell);
return true;
}
return false;
}
......@@ -405,9 +363,8 @@ namespace WindBot.Game.AI.Decks
{
count++;
}
foreach (ClientCard card in Bot.ExtraDeck.GetMonsters())
foreach (ClientCard card in Bot.ExtraDeck.GetFaceupPendulumMonsters())
{
if (card.HasType(CardType.Pendulum) && card.IsFaceup())
count++;
}
return count > 1;
......
......@@ -9,144 +9,142 @@ namespace WindBot.Game.AI.Decks
[Deck("Rainbow", "AI_Rainbow")]
class RainbowExecutor : DefaultExecutor
{
public enum CardId
{
幻壳龙 = 18108166,
幻之狮鹫 = 74852097,
龙剑士卓辉星灵摆 = 75195825,
曼陀罗天使号手 = 87979586,
炼装勇士金驰 = 33256280,
打喷嚏的河马龙 = 51934376,
救援兔 = 85138716,
粗人预料 = 911883,
鹰身女妖的羽毛扫 = 18144506,
强欲而贪欲之壶 = 35261759,
死者苏生 = 83764718,
地碎 = 97169186,
沙尘防护罩尘埃之力 = 40838625,
波纹防护罩波浪之力 = 47475363,
业炎防护罩火焰之力 = 75249652,
神风防护罩大气之力 = 5650082,
神圣防护罩反射镜力 = 44095762,
邪恶防护罩暗黑之力 = 20522190,
奈落的落穴 = 29401950,
虫惑的落穴 = 29616929,
星光大道 = 58120309,
红莲魔龙右红痕 = 80666118,
爆龙剑士点火星日珥 = 18239909,
星尘龙 = 44508094,
闪光No39希望皇霍普电光皇 = 56832966,
No37希望织龙蜘蛛鲨 = 37279508,
No39希望皇霍普 = 84013237,
进化帝半鸟龙 = 74294676,
No59背反之料理人 = 82697249,
鸟铳士卡斯泰尔 = 82633039,
辉光子帕拉迪奥斯 = 61344030,
电光千鸟 = 22653490,
励辉士入魔蝇王 = 46772449,
我我我枪手 = 12014404,
入魔梦魇骑士 = 359563,
芙莉西亚之虫惑魔 = 6511113
}
private bool 已通常召唤 = false;
public class CardId
{
public static int MysteryShellDragon = 18108166;
public static int PhantomGryphon = 74852097;
public static int MasterPendulumTheDracoslayer = 75195825;
public static int AngelTrumpeter = 87979586;
public static int MetalfoesGoldriver = 33256280;
public static int Kabazauls = 51934376;
public static int RescueRabbit = 85138716;
public static int UnexpectedDai = 911883;
public static int HarpiesFeatherDuster = 18144506;
public static int PotOfDesires = 35261759;
public static int MonsterReborn = 83764718;
public static int SmashingGround = 97169186;
public static int QuakingMirrorForce = 40838625;
public static int DrowningMirrorForce = 47475363;
public static int BlazingMirrorForce = 75249652;
public static int StormingMirrorForce = 5650082;
public static int MirrorForce = 44095762;
public static int DarkMirrorForce = 20522190;
public static int BottomlessTrapHole = 29401950;
public static int TraptrixTrapHoleNightmare = 29616929;
public static int StarlightRoad = 58120309;
public static int ScarlightRedDragonArchfiend = 80666118;
public static int IgnisterProminenceTheBlastingDracoslayer = 18239909;
public static int StardustDragon = 44508094;
public static int NumberS39UtopiatheLightning = 56832966;
public static int Number37HopeWovenDragonSpiderShark = 37279508;
public static int Number39Utopia = 84013237;
public static int EvolzarLaggia = 74294676;
public static int Number59CrookedCook = 82697249;
public static int CastelTheSkyblasterMusketeer = 82633039;
public static int StarliegePaladynamo = 61344030;
public static int LightningChidori = 22653490;
public static int EvilswarmExcitonKnight = 46772449;
public static int GagagaCowboy = 12014404;
public static int EvilswarmNightmare = 359563;
public static int TraptrixRafflesia = 6511113;
}
private bool NormalSummoned = false;
public RainbowExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, (int)CardId.鹰身女妖的羽毛扫);
AddExecutor(ExecutorType.Activate, (int)CardId.粗人预料, 粗人预料效果);
AddExecutor(ExecutorType.Summon, (int)CardId.救援兔);
AddExecutor(ExecutorType.Activate, (int)CardId.救援兔, 救援兔效果);
AddExecutor(ExecutorType.Activate, (int)CardId.强欲而贪欲之壶, DefaultPotOfDesires);
AddExecutor(ExecutorType.Summon, (int)CardId.曼陀罗天使号手, 曼陀罗天使号手通常召唤);
AddExecutor(ExecutorType.Summon, (int)CardId.打喷嚏的河马龙, 打喷嚏的河马龙通常召唤);
AddExecutor(ExecutorType.Summon, (int)CardId.龙剑士卓辉星灵摆, 龙剑士卓辉星灵摆通常召唤);
AddExecutor(ExecutorType.Summon, (int)CardId.幻壳龙, 幻壳龙通常召唤);
AddExecutor(ExecutorType.Summon, (int)CardId.幻之狮鹫, 幻之狮鹫通常召唤);
AddExecutor(ExecutorType.Summon, (int)CardId.炼装勇士金驰, 炼装勇士金驰通常召唤);
AddExecutor(ExecutorType.Summon, 通常召唤);
AddExecutor(ExecutorType.SpSummon, (int)CardId.爆龙剑士点火星日珥, 爆龙剑士点火星日珥特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.爆龙剑士点火星日珥, 爆龙剑士点火星日珥效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.我我我枪手, 我我我枪手特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.我我我枪手);
AddExecutor(ExecutorType.SpSummon, (int)CardId.励辉士入魔蝇王, 励辉士入魔蝇王特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.励辉士入魔蝇王, 励辉士入魔蝇王效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.进化帝半鸟龙, 进化帝半鸟龙特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.进化帝半鸟龙, 进化帝半鸟龙效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.入魔梦魇骑士, 入魔梦魇骑士特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.入魔梦魇骑士);
AddExecutor(ExecutorType.SpSummon, (int)CardId.辉光子帕拉迪奥斯, 辉光子帕拉迪奥斯特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.辉光子帕拉迪奥斯, 辉光子帕拉迪奥斯效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.电光千鸟, 电光千鸟特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.电光千鸟, 电光千鸟效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.No37希望织龙蜘蛛鲨, No37希望织龙蜘蛛鲨特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.No37希望织龙蜘蛛鲨);
AddExecutor(ExecutorType.SpSummon, (int)CardId.芙莉西亚之虫惑魔, 芙莉西亚之虫惑魔特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.芙莉西亚之虫惑魔);
AddExecutor(ExecutorType.Activate, (int)CardId.地碎, DefaultSmashingGround);
AddExecutor(ExecutorType.SpSummon, (int)CardId.鸟铳士卡斯泰尔, 鸟铳士卡斯泰尔特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.鸟铳士卡斯泰尔, 鸟铳士卡斯泰尔效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.爆龙剑士点火星日珥, 爆龙剑士点火星日珥特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.爆龙剑士点火星日珥, 爆龙剑士点火星日珥效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.红莲魔龙右红痕, 红莲魔龙右红痕特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.红莲魔龙右红痕, 红莲魔龙右红痕效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.No39希望皇霍普, 电光皇特殊召唤);
AddExecutor(ExecutorType.SpSummon, (int)CardId.闪光No39希望皇霍普电光皇);
AddExecutor(ExecutorType.Activate, (int)CardId.闪光No39希望皇霍普电光皇);
AddExecutor(ExecutorType.SpSummon, (int)CardId.星尘龙, 星尘龙特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.星尘龙, 星尘龙效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.No59背反之料理人, No59背反之料理人特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.No59背反之料理人, No59背反之料理人效果);
AddExecutor(ExecutorType.SpellSet, (int)CardId.星光大道, 陷阱卡覆盖);
AddExecutor(ExecutorType.SpellSet, (int)CardId.沙尘防护罩尘埃之力, 陷阱卡覆盖);
AddExecutor(ExecutorType.SpellSet, (int)CardId.波纹防护罩波浪之力, 陷阱卡覆盖);
AddExecutor(ExecutorType.SpellSet, (int)CardId.业炎防护罩火焰之力, 陷阱卡覆盖);
AddExecutor(ExecutorType.SpellSet, (int)CardId.神风防护罩大气之力, 陷阱卡覆盖);
AddExecutor(ExecutorType.SpellSet, (int)CardId.神圣防护罩反射镜力, 陷阱卡覆盖);
AddExecutor(ExecutorType.SpellSet, (int)CardId.邪恶防护罩暗黑之力, 陷阱卡覆盖);
AddExecutor(ExecutorType.SpellSet, (int)CardId.奈落的落穴, 陷阱卡覆盖);
AddExecutor(ExecutorType.SpellSet, (int)CardId.虫惑的落穴, 陷阱卡覆盖);
AddExecutor(ExecutorType.Activate, (int)CardId.星光大道, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.沙尘防护罩尘埃之力, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.波纹防护罩波浪之力, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.业炎防护罩火焰之力, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.神风防护罩大气之力, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.神圣防护罩反射镜力, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.邪恶防护罩暗黑之力, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.奈落的落穴, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.虫惑的落穴, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, CardId.UnexpectedDai, UnexpectedDaiEffect);
AddExecutor(ExecutorType.Summon, CardId.RescueRabbit);
AddExecutor(ExecutorType.Activate, CardId.RescueRabbit, RescueRabbitEffect);
AddExecutor(ExecutorType.Activate, CardId.PotOfDesires, DefaultPotOfDesires);
AddExecutor(ExecutorType.Summon, CardId.AngelTrumpeter, AngelTrumpeterSummon);
AddExecutor(ExecutorType.Summon, CardId.Kabazauls, KabazaulsSummon);
AddExecutor(ExecutorType.Summon, CardId.MasterPendulumTheDracoslayer, MasterPendulumTheDracoslayerSummon);
AddExecutor(ExecutorType.Summon, CardId.MysteryShellDragon, MysteryShellDragonSummon);
AddExecutor(ExecutorType.Summon, CardId.PhantomGryphon, PhantomGryphonSummon);
AddExecutor(ExecutorType.Summon, CardId.MetalfoesGoldriver, MetalfoesGoldriverSummon);
AddExecutor(ExecutorType.Summon, NormalSummon);
AddExecutor(ExecutorType.SpSummon, CardId.IgnisterProminenceTheBlastingDracoslayer, IgnisterProminenceTheBlastingDracoslayerSummon);
AddExecutor(ExecutorType.Activate, CardId.IgnisterProminenceTheBlastingDracoslayer, IgnisterProminenceTheBlastingDracoslayerEffect);
AddExecutor(ExecutorType.SpSummon, CardId.GagagaCowboy, GagagaCowboySummon);
AddExecutor(ExecutorType.Activate, CardId.GagagaCowboy);
AddExecutor(ExecutorType.SpSummon, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightSummon);
AddExecutor(ExecutorType.Activate, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightEffect);
AddExecutor(ExecutorType.SpSummon, CardId.EvolzarLaggia, EvolzarLaggiaSummon);
AddExecutor(ExecutorType.Activate, CardId.EvolzarLaggia, EvolzarLaggiaEffect);
AddExecutor(ExecutorType.SpSummon, CardId.EvilswarmNightmare, EvilswarmNightmareSummon);
AddExecutor(ExecutorType.Activate, CardId.EvilswarmNightmare);
AddExecutor(ExecutorType.SpSummon, CardId.StarliegePaladynamo, StarliegePaladynamoSummon);
AddExecutor(ExecutorType.Activate, CardId.StarliegePaladynamo, StarliegePaladynamoEffect);
AddExecutor(ExecutorType.SpSummon, CardId.LightningChidori, LightningChidoriSummon);
AddExecutor(ExecutorType.Activate, CardId.LightningChidori, LightningChidoriEffect);
AddExecutor(ExecutorType.SpSummon, CardId.Number37HopeWovenDragonSpiderShark, Number37HopeWovenDragonSpiderSharkSummon);
AddExecutor(ExecutorType.Activate, CardId.Number37HopeWovenDragonSpiderShark);
AddExecutor(ExecutorType.SpSummon, CardId.TraptrixRafflesia, TraptrixRafflesiaSummon);
AddExecutor(ExecutorType.Activate, CardId.TraptrixRafflesia);
AddExecutor(ExecutorType.Activate, CardId.SmashingGround, DefaultSmashingGround);
AddExecutor(ExecutorType.SpSummon, CardId.CastelTheSkyblasterMusketeer, DefaultCastelTheSkyblasterMusketeerSummon);
AddExecutor(ExecutorType.Activate, CardId.CastelTheSkyblasterMusketeer, DefaultCastelTheSkyblasterMusketeerEffect);
AddExecutor(ExecutorType.SpSummon, CardId.IgnisterProminenceTheBlastingDracoslayer, IgnisterProminenceTheBlastingDracoslayerSummon);
AddExecutor(ExecutorType.Activate, CardId.IgnisterProminenceTheBlastingDracoslayer, IgnisterProminenceTheBlastingDracoslayerEffect);
AddExecutor(ExecutorType.SpSummon, CardId.ScarlightRedDragonArchfiend, DefaultScarlightRedDragonArchfiendSummon);
AddExecutor(ExecutorType.Activate, CardId.ScarlightRedDragonArchfiend, DefaultScarlightRedDragonArchfiendEffect);
AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.SpSummon, CardId.StardustDragon, DefaultStardustDragonSummon);
AddExecutor(ExecutorType.Activate, CardId.StardustDragon, DefaultStardustDragonEffect);
AddExecutor(ExecutorType.SpSummon, CardId.Number59CrookedCook, Number59CrookedCookSummon);
AddExecutor(ExecutorType.Activate, CardId.Number59CrookedCook, Number59CrookedCookEffect);
AddExecutor(ExecutorType.SpellSet, CardId.StarlightRoad, TrapSet);
AddExecutor(ExecutorType.SpellSet, CardId.QuakingMirrorForce, TrapSet);
AddExecutor(ExecutorType.SpellSet, CardId.DrowningMirrorForce, TrapSet);
AddExecutor(ExecutorType.SpellSet, CardId.BlazingMirrorForce, TrapSet);
AddExecutor(ExecutorType.SpellSet, CardId.StormingMirrorForce, TrapSet);
AddExecutor(ExecutorType.SpellSet, CardId.MirrorForce, TrapSet);
AddExecutor(ExecutorType.SpellSet, CardId.DarkMirrorForce, TrapSet);
AddExecutor(ExecutorType.SpellSet, CardId.BottomlessTrapHole, TrapSet);
AddExecutor(ExecutorType.SpellSet, CardId.TraptrixTrapHoleNightmare, TrapSet);
AddExecutor(ExecutorType.Activate, CardId.StarlightRoad, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.QuakingMirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.DrowningMirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.BlazingMirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.StormingMirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.DarkMirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.BottomlessTrapHole, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.TraptrixTrapHoleNightmare, DefaultUniqueTrap);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
public override void OnNewTurn()
{
// 回合开始时重置状况
已通常召唤 = false;
NormalSummoned = false;
}
public override bool OnSelectHand()
{
// 随机先后攻
return Program.Rand.Next(2) > 0;
}
......@@ -157,101 +155,101 @@ namespace WindBot.Game.AI.Decks
if (defender.IsMonsterDangerous() || defender.IsDefense())
return false;
}
if (!(defender.Id == (int)CardId.闪光No39希望皇霍普电光皇))
if (!(defender.Id == CardId.NumberS39UtopiatheLightning))
{
if (attacker.Id == (int)CardId.闪光No39希望皇霍普电光皇 && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.No39希望皇霍普))
if (attacker.Id == CardId.NumberS39UtopiatheLightning && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, CardId.Number39Utopia))
attacker.RealPower = 5000;
if (Bot.HasInMonstersZone((int)CardId.No37希望织龙蜘蛛鲨, true, true))
if (Bot.HasInMonstersZone(CardId.Number37HopeWovenDragonSpiderShark, true, true))
attacker.RealPower = attacker.RealPower + 1000;
}
return attacker.RealPower > defender.GetDefensePower();
}
private bool 粗人预料效果()
private bool UnexpectedDaiEffect()
{
if (Bot.HasInHand((int)CardId.救援兔) || 已通常召唤)
if (Bot.HasInHand(CardId.RescueRabbit) || NormalSummoned)
AI.SelectCard(new[]
{
(int)CardId.幻壳龙,
(int)CardId.幻之狮鹫
CardId.MysteryShellDragon,
CardId.PhantomGryphon
});
else if (AI.Utils.IsTurn1OrMain2())
{
if (Bot.HasInHand((int)CardId.幻壳龙))
AI.SelectCard((int)CardId.幻壳龙);
else if (Bot.HasInHand((int)CardId.打喷嚏的河马龙))
AI.SelectCard((int)CardId.打喷嚏的河马龙);
else if (Bot.HasInHand((int)CardId.曼陀罗天使号手))
AI.SelectCard((int)CardId.曼陀罗天使号手);
if (Bot.HasInHand(CardId.MysteryShellDragon))
AI.SelectCard(CardId.MysteryShellDragon);
else if (Bot.HasInHand(CardId.Kabazauls))
AI.SelectCard(CardId.Kabazauls);
else if (Bot.HasInHand(CardId.AngelTrumpeter))
AI.SelectCard(CardId.AngelTrumpeter);
}
else
{
if (Bot.HasInHand((int)CardId.打喷嚏的河马龙))
AI.SelectCard((int)CardId.打喷嚏的河马龙);
else if (Bot.HasInHand((int)CardId.龙剑士卓辉星灵摆))
AI.SelectCard((int)CardId.龙剑士卓辉星灵摆);
else if (Bot.HasInHand((int)CardId.幻之狮鹫))
AI.SelectCard((int)CardId.幻之狮鹫);
else if (Bot.HasInHand((int)CardId.曼陀罗天使号手))
if (Bot.HasInHand(CardId.Kabazauls))
AI.SelectCard(CardId.Kabazauls);
else if (Bot.HasInHand(CardId.MasterPendulumTheDracoslayer))
AI.SelectCard(CardId.MasterPendulumTheDracoslayer);
else if (Bot.HasInHand(CardId.PhantomGryphon))
AI.SelectCard(CardId.PhantomGryphon);
else if (Bot.HasInHand(CardId.AngelTrumpeter))
AI.SelectCard(new[]
{
(int)CardId.炼装勇士金驰,
(int)CardId.龙剑士卓辉星灵摆
CardId.MetalfoesGoldriver,
CardId.MasterPendulumTheDracoslayer
});
}
return true;
}
private bool 救援兔效果()
private bool RescueRabbitEffect()
{
if (AI.Utils.IsTurn1OrMain2())
AI.SelectCard(new[]
{
(int)CardId.打喷嚏的河马龙,
(int)CardId.幻壳龙
CardId.Kabazauls,
CardId.MysteryShellDragon
});
else
AI.SelectCard(new[]
{
(int)CardId.龙剑士卓辉星灵摆,
(int)CardId.幻之狮鹫,
(int)CardId.打喷嚏的河马龙,
(int)CardId.炼装勇士金驰,
(int)CardId.曼陀罗天使号手
CardId.MasterPendulumTheDracoslayer,
CardId.PhantomGryphon,
CardId.Kabazauls,
CardId.MetalfoesGoldriver,
CardId.AngelTrumpeter
});
return true;
}
private bool 幻壳龙通常召唤()
private bool MysteryShellDragonSummon()
{
return Bot.HasInMonstersZone((int)CardId.幻壳龙);
return Bot.HasInMonstersZone(CardId.MysteryShellDragon);
}
private bool 幻之狮鹫通常召唤()
private bool PhantomGryphonSummon()
{
return Bot.HasInMonstersZone((int)CardId.幻之狮鹫);
return Bot.HasInMonstersZone(CardId.PhantomGryphon);
}
private bool 龙剑士卓辉星灵摆通常召唤()
private bool MasterPendulumTheDracoslayerSummon()
{
return Bot.HasInMonstersZone((int)CardId.龙剑士卓辉星灵摆);
return Bot.HasInMonstersZone(CardId.MasterPendulumTheDracoslayer);
}
private bool 曼陀罗天使号手通常召唤()
private bool AngelTrumpeterSummon()
{
return Bot.HasInMonstersZone((int)CardId.曼陀罗天使号手);
return Bot.HasInMonstersZone(CardId.AngelTrumpeter);
}
private bool 炼装勇士金驰通常召唤()
private bool MetalfoesGoldriverSummon()
{
return Bot.HasInMonstersZone((int)CardId.炼装勇士金驰);
return Bot.HasInMonstersZone(CardId.MetalfoesGoldriver);
}
private bool 打喷嚏的河马龙通常召唤()
private bool KabazaulsSummon()
{
return Bot.HasInMonstersZone((int)CardId.打喷嚏的河马龙);
return Bot.HasInMonstersZone(CardId.Kabazauls);
}
private bool 通常召唤()
private bool NormalSummon()
{
return true;
}
private bool 我我我枪手特殊召唤()
private bool GagagaCowboySummon()
{
if (Duel.LifePoints[1] <= 800)
{
......@@ -261,88 +259,17 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 励辉士入魔蝇王特殊召唤()
private bool IgnisterProminenceTheBlastingDracoslayerSummon()
{
int selfCount = Bot.GetMonsterCount() + Bot.GetSpellCount() + Bot.GetHandCount();
int oppoCount = Enemy.GetMonsterCount() + Enemy.GetSpellCount() + Enemy.GetHandCount();
return (selfCount - 1 < oppoCount) && 励辉士入魔蝇王效果();
return AI.Utils.GetProblematicEnemyCard() != null;
}
private bool 励辉士入魔蝇王效果()
private bool IgnisterProminenceTheBlastingDracoslayerEffect()
{
int selfCount = Bot.GetMonsterCount() + Bot.GetSpellCount();
int oppoCount = Enemy.GetMonsterCount() + Enemy.GetSpellCount();
int selfAttack = 0;
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
{
selfAttack += monster.GetDefensePower();
}
int oppoAttack = 0;
monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters)
{
oppoAttack += monster.GetDefensePower();
}
return (selfCount < oppoCount) || (selfAttack < oppoAttack);
}
private bool 红莲魔龙右红痕特殊召唤()
{
int selfBestAttack = AI.Utils.GetBestAttack(Bot, true);
int oppoBestAttack = AI.Utils.GetBestAttack(Enemy, false);
return (selfBestAttack <= oppoBestAttack && oppoBestAttack <= 3000) || 红莲魔龙右红痕效果();
}
private bool 红莲魔龙右红痕效果()
{
int selfCount = 0;
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (!monster.Equals(Card) && monster.HasType(CardType.Effect) && monster.Attack <= Card.Attack)
selfCount++;
}
int oppoCount = 0;
monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters)
{
// 没有办法获取特殊召唤的状态,只好默认全部是特招的
if (monster.HasType(CardType.Effect) && monster.Attack <= Card.Attack)
oppoCount++;
}
return (oppoCount > 0 && selfCount <= oppoCount) || oppoCount > 2;
}
private bool 鸟铳士卡斯泰尔特殊召唤()
{
return AI.Utils.GetProblematicCard() != null;
}
private bool 鸟铳士卡斯泰尔效果()
{
if (ActivateDescription == AI.Utils.GetStringId((int)CardId.鸟铳士卡斯泰尔, 0))
return false;
AI.SelectNextCard(AI.Utils.GetProblematicCard());
return true;
}
private bool 爆龙剑士点火星日珥特殊召唤()
{
return AI.Utils.GetProblematicCard() != null;
}
private bool 爆龙剑士点火星日珥效果()
{
if (ActivateDescription == AI.Utils.GetStringId((int)CardId.爆龙剑士点火星日珥, 1))
if (ActivateDescription == AI.Utils.GetStringId(CardId.IgnisterProminenceTheBlastingDracoslayer, 1))
return true;
ClientCard target1 = null;
ClientCard target2 = AI.Utils.GetProblematicCard();
ClientCard target2 = AI.Utils.GetProblematicEnemyCard();
List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells)
{
......@@ -363,7 +290,6 @@ namespace WindBot.Game.AI.Decks
}
if (target2 == null && target1 != null)
{
// 对面有P卡,随便吹另一张
foreach (ClientCard spell in spells)
{
if (!spell.Equals(target1))
......@@ -388,12 +314,12 @@ namespace WindBot.Game.AI.Decks
return true;
}
private bool No37希望织龙蜘蛛鲨特殊召唤()
private bool Number37HopeWovenDragonSpiderSharkSummon()
{
return AI.Utils.IsAllEnemyBetterThanValue(1700, false) && !AI.Utils.IsOneEnemyBetterThanValue(3600, true);
}
private bool 电光千鸟特殊召唤()
private bool LightningChidoriSummon()
{
List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters)
......@@ -412,32 +338,22 @@ namespace WindBot.Game.AI.Decks
}
}
return AI.Utils.GetProblematicCard() != null;
return AI.Utils.GetProblematicEnemyCard() != null;
}
private bool 电光千鸟效果()
private bool LightningChidoriEffect()
{
ClientCard problematicCard = AI.Utils.GetProblematicCard();
ClientCard problematicCard = AI.Utils.GetProblematicEnemyCard();
AI.SelectNextCard(problematicCard);
return true;
}
private bool 星尘龙特殊召唤()
{
return (AI.Utils.IsEnemyBetter(false, false) && !AI.Utils.IsOneEnemyBetterThanValue(2400, true)) || AI.Utils.IsTurn1OrMain2();
}
private bool 星尘龙效果()
{
return (Card.Location == CardLocation.Grave) || DefaultTrap();
}
private bool 进化帝半鸟龙特殊召唤()
private bool EvolzarLaggiaSummon()
{
return (AI.Utils.IsAllEnemyBetterThanValue(1700, false) && !AI.Utils.IsOneEnemyBetterThanValue(2400, true)) || AI.Utils.IsTurn1OrMain2();
}
private bool 入魔梦魇骑士特殊召唤()
private bool EvilswarmNightmareSummon()
{
if (AI.Utils.IsTurn1OrMain2())
{
......@@ -447,9 +363,9 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 芙莉西亚之虫惑魔特殊召唤()
private bool TraptrixRafflesiaSummon()
{
if (AI.Utils.IsTurn1OrMain2() && (Bot.GetRemainingCount((int)CardId.奈落的落穴, 1) + Bot.GetRemainingCount((int)CardId.虫惑的落穴, 1)) > 0)
if (AI.Utils.IsTurn1OrMain2() && (Bot.GetRemainingCount(CardId.BottomlessTrapHole, 1) + Bot.GetRemainingCount(CardId.TraptrixTrapHoleNightmare, 1)) > 0)
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
......@@ -457,22 +373,19 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool No59背反之料理人特殊召唤()
private bool Number59CrookedCookSummon()
{
return ((Bot.GetMonsterCount() + Bot.GetSpellCount() - 2) <= 1) &&
((AI.Utils.IsEnemyBetter(false, false) && !AI.Utils.IsOneEnemyBetterThanValue(2300, true)) || AI.Utils.IsTurn1OrMain2());
((AI.Utils.IsOneEnemyBetter() && !AI.Utils.IsOneEnemyBetterThanValue(2300, true)) || AI.Utils.IsTurn1OrMain2());
}
private bool No59背反之料理人效果()
private bool Number59CrookedCookEffect()
{
if (Duel.Player == 0)
{
foreach (ClientCard card in Duel.ChainTargets)
{
if (Card.Equals(card))
if (AI.Utils.IsChainTarget(Card))
return true;
}
}
else
{
if ((Bot.GetMonsterCount() + Bot.GetSpellCount() -1) <= 1)
......@@ -481,17 +394,17 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 进化帝半鸟龙效果()
private bool EvolzarLaggiaEffect()
{
return DefaultTrap();
}
private bool 辉光子帕拉迪奥斯特殊召唤()
private bool StarliegePaladynamoSummon()
{
return 辉光子帕拉迪奥斯效果();
return StarliegePaladynamoEffect();
}
private bool 辉光子帕拉迪奥斯效果()
private bool StarliegePaladynamoEffect()
{
ClientCard result = AI.Utils.GetOneEnemyBetterThanValue(2000, true);
if (result != null)
......@@ -502,14 +415,9 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 电光皇特殊召唤()
{
return AI.Utils.IsEnemyBetter(false, false);
}
private bool 陷阱卡覆盖()
private bool TrapSet()
{
return !Bot.HasInMonstersZone((int)CardId.No59背反之料理人, true, true);
return !Bot.HasInMonstersZone(CardId.Number59CrookedCook, true, true);
}
}
}
......@@ -9,88 +9,89 @@ namespace WindBot.Game.AI.Decks
[Deck("Rank V", "AI_Rank5")]
public class Rank5Executor : DefaultExecutor
{
public enum CardId
{
迷雾恶魔 = 28601770,
电子龙 = 70095154,
异热同心武器荒鹫激神爪 = 29353756,
太阳风帆船 = 33911264,
速攻同调士 = 20932152,
发条士兵 = 12299841,
画星宝宝 = 24610207,
先史遗产黄金航天飞机 = 88552992,
简易融合 = 1845204,
二重召唤 = 43422537,
旋风 = 5318639,
月之书 = 14087893,
超量组件 = 13032689,
超量苏生 = 26708437,
神圣防护罩反射镜力 = 44095762,
激流葬 = 53582587,
超量遮护罩 = 96457619,
重装机甲装甲车龙 = 72959823,
迅雷之骑士盖亚龙骑士 = 91949988,
电子龙无限 = 10443957,
始祖守护者提拉斯 = 31386180,
No61火山恐龙 = 29669359,
鲨鱼要塞 = 50449881,
电子龙新星 = 58069384
}
private bool 已通常召唤 = false;
private bool 已发动简易融合 = false;
private bool 已发动二重召唤 = false;
private bool 已特殊召唤电子龙无限 = false;
private bool 已发动火山恐龙 = false;
public class CardId
{
public static int MistArchfiend = 28601770;
public static int CyberDragon = 70095154;
public static int ZWEagleClaw = 29353756;
public static int SolarWindJammer = 33911264;
public static int QuickdrawSynchron = 20932152;
public static int WindUpSoldier = 12299841;
public static int StarDrawing = 24610207;
public static int ChronomalyGoldenJet = 88552992;
public static int InstantFusion = 1845204;
public static int DoubleSummon = 43422537;
public static int MysticalSpaceTyphoon = 5318639;
public static int BookOfMoon = 14087893;
public static int XyzUnit = 13032689;
public static int XyzReborn = 26708437;
public static int MirrorForce = 44095762;
public static int TorrentialTribute = 53582587;
public static int XyzVeil = 96457619;
public static int PanzerDragon = 72959823;
public static int GaiaDragonTheThunderCharger = 91949988;
public static int CyberDragonInfinity = 10443957;
public static int TirasKeeperOfGenesis = 31386180;
public static int Number61Volcasaurus = 29669359;
public static int SharkFortress = 50449881;
public static int CyberDragonNova = 58069384;
}
private bool NormalSummoned = false;
private bool InstantFusionUsed = false;
private bool DoubleSummonUsed = false;
private bool CyberDragonInfinitySummoned = false;
private bool Number61VolcasaurusUsed = false;
public Rank5Executor(GameAI ai, Duel duel)
: base(ai, duel)
{
// Quick spells
AddExecutor(ExecutorType.Activate, (int)CardId.月之书, DefaultBookOfMoon);
AddExecutor(ExecutorType.Activate, (int)CardId.旋风, DefaultMysticalSpaceTyphoon);
// 优先出的超量怪兽
AddExecutor(ExecutorType.SpSummon, (int)CardId.电子龙新星, 电子龙新星特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.电子龙新星, 电子龙新星效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.电子龙无限, 电子龙无限特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.电子龙无限, 电子龙无限效果);
// 无副作用的5星怪兽
AddExecutor(ExecutorType.SpSummon, (int)CardId.电子龙);
AddExecutor(ExecutorType.SpSummon, (int)CardId.太阳风帆船, 太阳风帆船特殊召唤);
AddExecutor(ExecutorType.SpSummon, (int)CardId.异热同心武器荒鹫激神爪);
AddExecutor(ExecutorType.Summon, (int)CardId.先史遗产黄金航天飞机, 通常召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.先史遗产黄金航天飞机, 先史遗产黄金航天飞机效果);
AddExecutor(ExecutorType.Summon, (int)CardId.画星宝宝, 通常召唤);
AddExecutor(ExecutorType.Summon, (int)CardId.发条士兵, 通常召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.发条士兵, 发条士兵效果);
AddExecutor(ExecutorType.Activate, CardId.BookOfMoon, DefaultBookOfMoon);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
// Cyber Dragon Infinity first
AddExecutor(ExecutorType.SpSummon, CardId.CyberDragonNova, CyberDragonNovaSummon);
AddExecutor(ExecutorType.Activate, CardId.CyberDragonNova, CyberDragonNovaEffect);
AddExecutor(ExecutorType.SpSummon, CardId.CyberDragonInfinity, CyberDragonInfinitySummon);
AddExecutor(ExecutorType.Activate, CardId.CyberDragonInfinity, CyberDragonInfinityEffect);
// Level 5 monsters without side effects
AddExecutor(ExecutorType.SpSummon, CardId.CyberDragon);
AddExecutor(ExecutorType.SpSummon, CardId.SolarWindJammer, SolarWindJammerSummon);
AddExecutor(ExecutorType.SpSummon, CardId.ZWEagleClaw);
AddExecutor(ExecutorType.Summon, CardId.ChronomalyGoldenJet, NormalSummon);
AddExecutor(ExecutorType.Activate, CardId.ChronomalyGoldenJet, ChronomalyGoldenJetEffect);
AddExecutor(ExecutorType.Summon, CardId.StarDrawing, NormalSummon);
AddExecutor(ExecutorType.Summon, CardId.WindUpSoldier, NormalSummon);
AddExecutor(ExecutorType.Activate, CardId.WindUpSoldier, WindUpSoldierEffect);
// XYZ Monsters: Summon
AddExecutor(ExecutorType.SpSummon, (int)CardId.No61火山恐龙, No61火山恐龙特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.No61火山恐龙, No61火山恐龙效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.始祖守护者提拉斯);
AddExecutor(ExecutorType.Activate, (int)CardId.始祖守护者提拉斯, 始祖守护者提拉斯效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.鲨鱼要塞);
AddExecutor(ExecutorType.Activate, (int)CardId.鲨鱼要塞);
AddExecutor(ExecutorType.SpSummon, CardId.Number61Volcasaurus, Number61VolcasaurusSummon);
AddExecutor(ExecutorType.Activate, CardId.Number61Volcasaurus, Number61VolcasaurusEffect);
AddExecutor(ExecutorType.SpSummon, CardId.TirasKeeperOfGenesis);
AddExecutor(ExecutorType.Activate, CardId.TirasKeeperOfGenesis, TirasKeeperOfGenesisEffect);
AddExecutor(ExecutorType.SpSummon, CardId.SharkFortress);
AddExecutor(ExecutorType.Activate, CardId.SharkFortress);
AddExecutor(ExecutorType.SpSummon, (int)CardId.迅雷之骑士盖亚龙骑士, 迅雷之骑士盖亚龙骑士特殊召唤);
AddExecutor(ExecutorType.SpSummon, CardId.GaiaDragonTheThunderCharger, GaiaDragonTheThunderChargerSummon);
// 有副作用的5星怪兽
AddExecutor(ExecutorType.SpSummon, (int)CardId.速攻同调士, 速攻同调士特殊召唤);
AddExecutor(ExecutorType.Summon, (int)CardId.迷雾恶魔, 迷雾恶魔通常召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.简易融合, 简易融合效果);
// Level 5 monsters with side effects
AddExecutor(ExecutorType.SpSummon, CardId.QuickdrawSynchron, QuickdrawSynchronSummon);
AddExecutor(ExecutorType.Summon, CardId.MistArchfiend, MistArchfiendSummon);
AddExecutor(ExecutorType.Activate, CardId.InstantFusion, InstantFusionEffect);
// Useful spells
AddExecutor(ExecutorType.Activate, (int)CardId.二重召唤, 二重召唤效果);
AddExecutor(ExecutorType.Activate, (int)CardId.超量组件, 超量组件效果);
AddExecutor(ExecutorType.Activate, CardId.DoubleSummon, DoubleSummonEffect);
AddExecutor(ExecutorType.Activate, CardId.XyzUnit, XyzUnitEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.超量苏生, 超量苏生效果);
AddExecutor(ExecutorType.Activate, CardId.XyzReborn, XyzRebornEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.重装机甲装甲车龙, 重装机甲装甲车龙效果);
AddExecutor(ExecutorType.Activate, CardId.PanzerDragon, PanzerDragonEffect);
// Reposition
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
......@@ -98,9 +99,9 @@ namespace WindBot.Game.AI.Decks
// Set and activate traps
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, (int)CardId.超量遮护罩, 超量遮护罩效果);
AddExecutor(ExecutorType.Activate, (int)CardId.激流葬, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Activate, (int)CardId.神圣防护罩反射镜力, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.XyzVeil, XyzVeilEffect);
AddExecutor(ExecutorType.Activate, CardId.TorrentialTribute, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultTrap);
}
public override bool OnSelectHand()
......@@ -110,130 +111,120 @@ namespace WindBot.Game.AI.Decks
public override void OnNewTurn()
{
// 回合开始时重置状况
已通常召唤 = false;
已发动简易融合 = false;
已发动二重召唤 = false;
已特殊召唤电子龙无限 = false;
已发动火山恐龙 = false;
NormalSummoned = false;
InstantFusionUsed = false;
DoubleSummonUsed = false;
CyberDragonInfinitySummoned = false;
Number61VolcasaurusUsed = false;
}
private bool 特殊召唤不重复的超量怪兽()
private bool NormalSummon()
{
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
if (monster.Id == Card.Id)
return false;
return true;
}
private bool 通常召唤()
{
已通常召唤 = true;
NormalSummoned = true;
return true;
}
private bool 太阳风帆船特殊召唤()
private bool SolarWindJammerSummon()
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool 速攻同调士特殊召唤()
private bool QuickdrawSynchronSummon()
{
if (!需要出5())
if (!needLV5())
return false;
AI.SelectCard(new[]
{
(int)CardId.速攻同调士,
(int)CardId.异热同心武器荒鹫激神爪,
(int)CardId.太阳风帆船,
(int)CardId.电子龙,
(int)CardId.迷雾恶魔,
(int)CardId.发条士兵,
(int)CardId.画星宝宝,
(int)CardId.先史遗产黄金航天飞机
CardId.QuickdrawSynchron,
CardId.ZWEagleClaw,
CardId.SolarWindJammer,
CardId.CyberDragon,
CardId.MistArchfiend,
CardId.WindUpSoldier,
CardId.StarDrawing,
CardId.ChronomalyGoldenJet
});
return true;
}
private bool 迷雾恶魔通常召唤()
private bool MistArchfiendSummon()
{
if (!需要出5())
if (!needLV5())
return false;
AI.SelectOption(1);
已通常召唤 = true;
NormalSummoned = true;
return true;
}
private bool 简易融合效果()
private bool InstantFusionEffect()
{
if (!需要出5())
if (!needLV5())
return false;
已发动简易融合 = true;
InstantFusionUsed = true;
return true;
}
private bool 需要出5()
private bool needLV5()
{
if (场上有5星怪兽())
if (HaveLV5OnField())
return true;
int 其他的5星资源数量 = 0;
int lv5Count = 0;
IList<ClientCard> hand = Bot.Hand;
foreach (ClientCard card in hand)
{
if (card.Id == (int)CardId.简易融合 && !已发动简易融合)
++其他的5星资源数量;
if (card.Id == (int)CardId.速攻同调士 && Bot.Hand.ContainsMonsterWithLevel(4))
++其他的5星资源数量;
if (card.Id == (int)CardId.迷雾恶魔 && !已通常召唤)
++其他的5星资源数量;
if (card.Id == (int)CardId.二重召唤 && 二重召唤效果())
++其他的5星资源数量;
if (card.Id == CardId.InstantFusion && !InstantFusionUsed)
++lv5Count;
if (card.Id == CardId.QuickdrawSynchron && Bot.Hand.ContainsMonsterWithLevel(4))
++lv5Count;
if (card.Id == CardId.MistArchfiend && !NormalSummoned)
++lv5Count;
if (card.Id == CardId.DoubleSummon && DoubleSummonEffect())
++lv5Count;
}
if (其他的5星资源数量 >= 2)
if (lv5Count >= 2)
return true;
return false;
}
private bool 发条士兵效果()
private bool WindUpSoldierEffect()
{
return 场上有5星怪兽();
return HaveLV5OnField();
}
private bool 先史遗产黄金航天飞机效果()
private bool ChronomalyGoldenJetEffect()
{
return Card.Level == 4;
}
private bool 二重召唤效果()
private bool DoubleSummonEffect()
{
if (!已通常召唤 || 已发动二重召唤)
if (!NormalSummoned || DoubleSummonUsed)
return false;
IList<ClientCard> hand = Bot.Hand;
foreach (ClientCard card in hand)
{
if (card.Id == (int)CardId.迷雾恶魔 ||
card.Id == (int)CardId.发条士兵 ||
card.Id == (int)CardId.画星宝宝 ||
card.Id == (int)CardId.先史遗产黄金航天飞机)
if (card.Id == CardId.MistArchfiend ||
card.Id == CardId.WindUpSoldier ||
card.Id == CardId.StarDrawing ||
card.Id == CardId.ChronomalyGoldenJet)
{
已通常召唤 = false;
已发动二重召唤 = true;
NormalSummoned = false;
DoubleSummonUsed = true;
return true;
}
}
return false;
}
private bool 电子龙新星特殊召唤()
private bool CyberDragonNovaSummon()
{
return !已特殊召唤电子龙无限;
return !CyberDragonInfinitySummoned;
}
private bool 电子龙新星效果()
private bool CyberDragonNovaEffect()
{
if (ActivateDescription == AI.Utils.GetStringId((int)CardId.电子龙新星, 0))
if (ActivateDescription == AI.Utils.GetStringId(CardId.CyberDragonNova, 0))
{
return true;
}
......@@ -248,13 +239,13 @@ namespace WindBot.Game.AI.Decks
}
}
private bool 电子龙无限特殊召唤()
private bool CyberDragonInfinitySummon()
{
已特殊召唤电子龙无限 = true;
CyberDragonInfinitySummoned = true;
return true;
}
private bool 电子龙无限效果()
private bool CyberDragonInfinityEffect()
{
if (CurrentChain.Count > 0)
{
......@@ -278,29 +269,27 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool No61火山恐龙特殊召唤()
private bool Number61VolcasaurusSummon()
{
return AI.Utils.IsOneEnemyBetterThanValue(2000, false);
}
private bool No61火山恐龙效果()
private bool Number61VolcasaurusEffect()
{
ClientCard target = Enemy.MonsterZone.GetFloodgate();
if (target == null)
target = AI.Utils.GetOneEnemyBetterThanValue(2000, false);
ClientCard target = AI.Utils.GetProblematicEnemyMonster(2000);
if (target != null)
{
AI.SelectCard((int)CardId.电子龙);
AI.SelectCard(CardId.CyberDragon);
AI.SelectNextCard(target);
已发动火山恐龙 = true;
Number61VolcasaurusUsed = true;
return true;
}
return false;
}
private bool 始祖守护者提拉斯效果()
private bool TirasKeeperOfGenesisEffect()
{
ClientCard target = AI.Utils.GetProblematicCard();
ClientCard target = AI.Utils.GetProblematicEnemyCard();
if (target != null)
{
AI.SelectCard(target);
......@@ -308,11 +297,11 @@ namespace WindBot.Game.AI.Decks
return true;
}
private bool 迅雷之骑士盖亚龙骑士特殊召唤()
private bool GaiaDragonTheThunderChargerSummon()
{
if (已发动火山恐龙 && Bot.HasInMonstersZone((int)CardId.No61火山恐龙))
if (Number61VolcasaurusUsed && Bot.HasInMonstersZone(CardId.Number61Volcasaurus))
{
AI.SelectCard((int)CardId.No61火山恐龙);
AI.SelectCard(CardId.Number61Volcasaurus);
return true;
}
List<ClientCard> monsters = Bot.GetMonsters();
......@@ -327,7 +316,7 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 超量苏生效果()
private bool XyzRebornEffect()
{
foreach (ClientCard card in Bot.SpellZone)
{
......@@ -338,58 +327,38 @@ namespace WindBot.Game.AI.Decks
}
AI.SelectCard(new[]
{
(int)CardId.电子龙无限,
(int)CardId.电子龙新星,
(int)CardId.始祖守护者提拉斯,
(int)CardId.鲨鱼要塞,
(int)CardId.No61火山恐龙
CardId.CyberDragonInfinity,
CardId.CyberDragonNova,
CardId.TirasKeeperOfGenesis,
CardId.SharkFortress,
CardId.Number61Volcasaurus
});
return true;
}
private bool 超量组件效果()
private bool XyzUnitEffect()
{
List<ClientCard> monsters = Bot.GetMonsters();
return monsters.Exists(p => p.HasType(CardType.Xyz));
}
private bool 重装机甲装甲车龙效果()
private bool PanzerDragonEffect()
{
ClientCard target = AI.Utils.GetProblematicCard();
ClientCard target = AI.Utils.GetBestEnemyCard();
if (target != null)
{
AI.SelectCard(target);
return true;
}
List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters)
{
AI.SelectCard(monster);
return true;
}
List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells)
{
if (spell.IsFacedown())
{
AI.SelectCard(spell);
return true;
}
}
foreach (ClientCard spell in spells)
{
AI.SelectCard(spell);
return true;
}
return false;
}
private bool 超量遮护罩效果()
private bool XyzVeilEffect()
{
List<ClientCard> spells = Bot.GetSpells();
foreach (ClientCard spell in spells)
{
if (spell.Id == (int)CardId.超量遮护罩 && !spell.IsFacedown())
if (spell.Id == CardId.XyzVeil && !spell.IsFacedown())
return false;
}
List<ClientCard> monsters = Bot.GetMonsters();
......@@ -401,7 +370,7 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 场上有5星怪兽()
private bool HaveLV5OnField()
{
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
......@@ -409,8 +378,8 @@ namespace WindBot.Game.AI.Decks
if (monster.HasType(CardType.Monster) &&
!monster.HasType(CardType.Xyz) &&
(monster.Level == 5
|| monster.Id == (int)CardId.画星宝宝
|| (monster.Id == (int)CardId.发条士兵) && !monster.Equals(Card)))
|| monster.Id == CardId.StarDrawing
|| (monster.Id == CardId.WindUpSoldier) && !monster.Equals(Card)))
return true;
}
return false;
......
......@@ -6,179 +6,180 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("ST1732", "AI_ST1732")]
[Deck("ST1732", "AI_ST1732", "Normal")]
public class ST1732Executor : DefaultExecutor
{
public enum CardId
{
数字机灵 = 32295838,
比特机灵 = 36211150,
双汇编亚龙 = 7445307,
引导交错鹿 = 70950698,
猞猁连接杀手 = 35595518,
RAM云雄羊 = 9190563,
ROM云雌羊 = 44956694,
均衡负载王 = 8567955,
反向连接兽 = 71172240,
克莱因客户端蚁 = 45778242,
网络小龙 = 62706865,
点阵图跳离士 = 18789533,
精神操作 = 37520316,
黑洞 = 53129443,
死者苏生 = 83764718,
旋风 = 5318639,
宇宙旋风 = 8267140,
月之书 = 14087893,
电脑网后门 = 43839002,
月镜盾 = 19508728,
电脑网宇宙 = 61583217,
奈落的落穴 = 29401950,
神圣防护罩反射镜力 = 44095762,
激流葬 = 53582587,
重编码存活 = 70238111,
次元障壁 = 83326048,
强制脱出装置 = 94192409,
神之通告 = 40605147,
解码语者 = 1861629,
编码语者 = 6622715,
三栅极男巫 = 32617464,
蜜罐机器人 = 34472920,
二进制女巫 = 79016563,
连接蜘蛛 = 98978921,
引导鹿衍生物 = 70950699
}
bool 已发动均衡负载王 = false;
public class CardId
{
public static int Digitron = 32295838;
public static int Bitron = 36211150;
public static int DualAssembloom = 7445307;
public static int BootStagguard = 70950698;
public static int Linkslayer = 35595518;
public static int RAMClouder = 9190563;
public static int ROMCloudia = 44956694;
public static int BalancerLord = 8567955;
public static int Backlinker = 71172240;
public static int Kleinant = 45778242;
public static int Draconnet = 62706865;
public static int DotScaper = 18789533;
public static int MindControl = 37520316;
public static int DarkHole = 53129443;
public static int MonsterReborn = 83764718;
public static int MysticalSpaceTyphoon = 5318639;
public static int CosmicCyclone = 8267140;
public static int BookOfMoon = 14087893;
public static int CynetBackdoor = 43839002;
public static int MoonMirrorShield = 19508728;
public static int CynetUniverse = 61583217;
public static int BottomlessTrapHole = 29401950;
public static int MirrorForce = 44095762;
public static int TorrentialTribute = 53582587;
public static int RecodedAlive = 70238111;
public static int DimensionalBarrier = 83326048;
public static int CompulsoryEvacuationDevice = 94192409;
public static int SolemnStrike = 40605147;
public static int DecodeTalker = 1861629;
public static int EncodeTalker = 6622715;
public static int TriGateWizard = 32617464;
public static int Honeybot = 34472920;
public static int BinarySorceress = 79016563;
public static int LinkSpider = 98978921;
public static int StagToken = 70950699;
}
bool BalancerLordUsed = false;
public ST1732Executor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, (int)CardId.宇宙旋风, DefaultCosmicCyclone);
AddExecutor(ExecutorType.Activate, (int)CardId.旋风, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, (int)CardId.黑洞, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.月之书, DefaultBookOfMoon);
AddExecutor(ExecutorType.Activate, CardId.CosmicCyclone, DefaultCosmicCyclone);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.BookOfMoon, DefaultBookOfMoon);
AddExecutor(ExecutorType.Activate, (int)CardId.电脑网宇宙, 电脑网宇宙效果);
AddExecutor(ExecutorType.Activate, CardId.CynetUniverse, CynetUniverseEffect);
AddExecutor(ExecutorType.SpSummon, (int)CardId.猞猁连接杀手);
AddExecutor(ExecutorType.Activate, (int)CardId.猞猁连接杀手, 猞猁连接杀手效果);
AddExecutor(ExecutorType.SpSummon, CardId.Linkslayer);
AddExecutor(ExecutorType.Activate, CardId.Linkslayer, LinkslayerEffect);
AddExecutor(ExecutorType.SpSummon, (int)CardId.连接蜘蛛);
AddExecutor(ExecutorType.Activate, (int)CardId.连接蜘蛛);
AddExecutor(ExecutorType.SpSummon, CardId.LinkSpider);
AddExecutor(ExecutorType.Activate, CardId.LinkSpider);
AddExecutor(ExecutorType.Activate, (int)CardId.精神操作, 精神操作效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.反向连接兽);
AddExecutor(ExecutorType.Activate, (int)CardId.反向连接兽, 反向连接兽效果);
AddExecutor(ExecutorType.Activate, CardId.MindControl, MindControlEffect);
AddExecutor(ExecutorType.SpSummon, CardId.Backlinker);
AddExecutor(ExecutorType.Activate, CardId.Backlinker, BacklinkerEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.引导交错鹿, 引导交错鹿效果);
AddExecutor(ExecutorType.Activate, CardId.BootStagguard, BootStagguardEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.死者苏生, 死者苏生效果);
AddExecutor(ExecutorType.Activate, (int)CardId.月镜盾, 月镜盾效果);
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, MonsterRebornEffect);
AddExecutor(ExecutorType.Activate, CardId.MoonMirrorShield, MoonMirrorShieldEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.电脑网后门, 电脑网后门效果);
AddExecutor(ExecutorType.Activate, (int)CardId.重编码存活);
AddExecutor(ExecutorType.Activate, CardId.CynetBackdoor, CynetBackdoorEffect);
AddExecutor(ExecutorType.Activate, CardId.RecodedAlive);
AddExecutor(ExecutorType.Summon, (int)CardId.均衡负载王, 均衡负载王通常召唤);
AddExecutor(ExecutorType.Summon, CardId.BalancerLord, BalancerLordSummon);
AddExecutor(ExecutorType.Summon, (int)CardId.ROM云雌羊, ROM云雌羊通常召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.ROM云雌羊, ROM云雌羊效果);
AddExecutor(ExecutorType.Summon, CardId.ROMCloudia, ROMCloudiaSummon);
AddExecutor(ExecutorType.Activate, CardId.ROMCloudia, ROMCloudiaEffect);
AddExecutor(ExecutorType.Summon, (int)CardId.网络小龙, 网络小龙通常召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.网络小龙, 网络小龙效果);
AddExecutor(ExecutorType.Summon, CardId.Draconnet, DraconnetSummon);
AddExecutor(ExecutorType.Activate, CardId.Draconnet, DraconnetEffect);
AddExecutor(ExecutorType.Summon, (int)CardId.克莱因客户端蚁);
AddExecutor(ExecutorType.Activate, (int)CardId.克莱因客户端蚁, 克莱因客户端蚁效果);
AddExecutor(ExecutorType.Summon, CardId.Kleinant);
AddExecutor(ExecutorType.Activate, CardId.Kleinant, KleinantEffect);
AddExecutor(ExecutorType.Summon, (int)CardId.RAM云雄羊);
AddExecutor(ExecutorType.Activate, (int)CardId.RAM云雄羊, RAM云雄羊效果);
AddExecutor(ExecutorType.Summon, CardId.RAMClouder);
AddExecutor(ExecutorType.Activate, CardId.RAMClouder, RAMClouderEffect);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.点阵图跳离士);
AddExecutor(ExecutorType.Activate, (int)CardId.点阵图跳离士, 点阵图跳离士效果);
AddExecutor(ExecutorType.SummonOrSet, CardId.DotScaper);
AddExecutor(ExecutorType.Activate, CardId.DotScaper, DotScaperEffect);
AddExecutor(ExecutorType.Summon, (int)CardId.均衡负载王);
AddExecutor(ExecutorType.Summon, (int)CardId.ROM云雌羊);
AddExecutor(ExecutorType.Summon, (int)CardId.网络小龙);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.反向连接兽);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.数字机灵);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.比特机灵);
AddExecutor(ExecutorType.Summon, CardId.BalancerLord);
AddExecutor(ExecutorType.Summon, CardId.ROMCloudia);
AddExecutor(ExecutorType.Summon, CardId.Draconnet);
AddExecutor(ExecutorType.SummonOrSet, CardId.Backlinker);
AddExecutor(ExecutorType.SummonOrSet, CardId.Digitron);
AddExecutor(ExecutorType.SummonOrSet, CardId.Bitron);
AddExecutor(ExecutorType.Activate, (int)CardId.均衡负载王, 均衡负载王效果);
AddExecutor(ExecutorType.Activate, CardId.BalancerLord, BalancerLordEffect);
AddExecutor(ExecutorType.SpSummon, (int)CardId.解码语者, 连接召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.解码语者);
AddExecutor(ExecutorType.SpSummon, CardId.DecodeTalker, LinkSummon);
AddExecutor(ExecutorType.Activate, CardId.DecodeTalker);
AddExecutor(ExecutorType.SpSummon, (int)CardId.三栅极男巫, 连接召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.三栅极男巫);
AddExecutor(ExecutorType.SpSummon, CardId.TriGateWizard, LinkSummon);
AddExecutor(ExecutorType.Activate, CardId.TriGateWizard);
AddExecutor(ExecutorType.SpSummon, (int)CardId.编码语者, 连接召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.编码语者);
AddExecutor(ExecutorType.SpSummon, CardId.EncodeTalker, LinkSummon);
AddExecutor(ExecutorType.Activate, CardId.EncodeTalker);
AddExecutor(ExecutorType.SpSummon, (int)CardId.蜜罐机器人, 连接召唤);
AddExecutor(ExecutorType.SpSummon, (int)CardId.二进制女巫, 连接召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.二进制女巫);
AddExecutor(ExecutorType.SpSummon, CardId.Honeybot, LinkSummon);
AddExecutor(ExecutorType.SpSummon, CardId.BinarySorceress, LinkSummon);
AddExecutor(ExecutorType.Activate, CardId.BinarySorceress);
AddExecutor(ExecutorType.SpellSet, (int)CardId.电脑网后门, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, (int)CardId.重编码存活, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.CynetBackdoor, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.RecodedAlive, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, (int)CardId.神之通告, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, (int)CardId.强制脱出装置, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, (int)CardId.次元障壁, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, (int)CardId.激流葬, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, (int)CardId.神圣防护罩反射镜力, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, (int)CardId.奈落的落穴, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, (int)CardId.月之书, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, (int)CardId.宇宙旋风, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, (int)CardId.旋风, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnStrike, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.CompulsoryEvacuationDevice, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.DimensionalBarrier, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.TorrentialTribute, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.MirrorForce, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.BottomlessTrapHole, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.BookOfMoon, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.CosmicCyclone, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.MysticalSpaceTyphoon, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, (int)CardId.神之通告, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, (int)CardId.强制脱出装置, DefaultCompulsoryEvacuationDevice);
AddExecutor(ExecutorType.Activate, (int)CardId.次元障壁, DefaultDimensionalBarrier);
AddExecutor(ExecutorType.Activate, (int)CardId.激流葬, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Activate, (int)CardId.神圣防护罩反射镜力, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.奈落的落穴, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, CardId.CompulsoryEvacuationDevice, DefaultCompulsoryEvacuationDevice);
AddExecutor(ExecutorType.Activate, CardId.DimensionalBarrier, DefaultDimensionalBarrier);
AddExecutor(ExecutorType.Activate, CardId.TorrentialTribute, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.BottomlessTrapHole, DefaultUniqueTrap);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
public override bool OnSelectHand()
{
// 抢后攻
// go second
return false;
}
public override void OnNewTurn()
{
// 回合开始时重置状况
已发动均衡负载王 = false;
// reset
BalancerLordUsed = false;
}
public override int OnSelectOption(IList<int> options)
{
// 月镜盾回卡组底
// put Moon Mirror Shield to the bottom of deck
return options.Count == 2 ? 1 : 0;
}
public override bool OnSelectYesNo(int desc)
{
if (desc == 210) //是否要继续选择?
if (desc == 210) // Continue selecting? (Link Summoning)
return false;
if (desc == 31) //是否直接攻击?
if (desc == 31) // Direct Attack?
return true;
return base.OnSelectYesNo(desc);
}
private bool 猞猁连接杀手效果()
private bool LinkslayerEffect()
{
IList<ClientCard> targets = Enemy.GetSpells();
if (targets.Count > 0)
{
AI.SelectCard(new[]{
(int)CardId.双汇编亚龙,
(int)CardId.比特机灵,
(int)CardId.数字机灵,
(int)CardId.重编码存活
CardId.DualAssembloom,
CardId.Bitron,
CardId.Digitron,
CardId.RecodedAlive
});
AI.SelectNextCard(targets);
return true;
......@@ -186,9 +187,9 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 精神操作效果()
private bool MindControlEffect()
{
ClientCard target = AI.Utils.GetAnyEnemyMonster();
ClientCard target = AI.Utils.GetBestEnemyMonster();
if (target != null)
{
AI.SelectCard(target);
......@@ -197,34 +198,34 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 反向连接兽效果()
private bool BacklinkerEffect()
{
return (Bot.MonsterZone[5] == null) && (Bot.MonsterZone[6] == null);
}
private bool 引导交错鹿效果()
private bool BootStagguardEffect()
{
if (Card.Location != CardLocation.Hand)
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool 死者苏生效果()
private bool MonsterRebornEffect()
{
List<int> targets = new List<int> {
(int)CardId.解码语者,
(int)CardId.编码语者,
(int)CardId.三栅极男巫,
(int)CardId.二进制女巫,
(int)CardId.蜜罐机器人,
(int)CardId.双汇编亚龙,
(int)CardId.引导交错鹿,
(int)CardId.均衡负载王,
(int)CardId.ROM云雌羊,
(int)CardId.猞猁连接杀手,
(int)CardId.RAM云雄羊,
(int)CardId.反向连接兽,
(int)CardId.克莱因客户端蚁
CardId.DecodeTalker,
CardId.EncodeTalker,
CardId.TriGateWizard,
CardId.BinarySorceress,
CardId.Honeybot,
CardId.DualAssembloom,
CardId.BootStagguard,
CardId.BalancerLord,
CardId.ROMCloudia,
CardId.Linkslayer,
CardId.RAMClouder,
CardId.Backlinker,
CardId.Kleinant
};
if (!Bot.HasInGraveyard(targets))
{
......@@ -234,7 +235,7 @@ namespace WindBot.Game.AI.Decks
return true;
}
private bool 月镜盾效果()
private bool MoonMirrorShieldEffect()
{
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
......@@ -245,7 +246,7 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 电脑网宇宙效果()
private bool CynetUniverseEffect()
{
if (Card.Location == CardLocation.Hand)
return DefaultField();
......@@ -261,7 +262,7 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 电脑网后门效果()
private bool CynetBackdoorEffect()
{
if (!(Duel.Player == 0 && Duel.Phase == DuelPhase.Main2) &&
!(Duel.Player == 1 && (Duel.Phase == DuelPhase.BattleStart || Duel.Phase == DuelPhase.End)))
......@@ -291,7 +292,7 @@ namespace WindBot.Game.AI.Decks
monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (monster.Id == (int)CardId.均衡负载王)
if (monster.Id == CardId.BalancerLord)
{
AI.SelectCard(monster);
selected = true;
......@@ -315,99 +316,99 @@ namespace WindBot.Game.AI.Decks
{
AI.SelectNextCard(new[]
{
(int)CardId.ROM云雌羊,
(int)CardId.均衡负载王,
(int)CardId.克莱因客户端蚁,
(int)CardId.网络小龙,
(int)CardId.反向连接兽
CardId.ROMCloudia,
CardId.BalancerLord,
CardId.Kleinant,
CardId.Draconnet,
CardId.Backlinker
});
return true;
}
return false;
}
private bool 均衡负载王通常召唤()
private bool BalancerLordSummon()
{
return !已发动均衡负载王;
return !BalancerLordUsed;
}
private bool 均衡负载王效果()
private bool BalancerLordEffect()
{
if (Card.Location == CardLocation.Removed)
return true;
bool hastarget = Bot.HasInHand(new List<int> {
(int)CardId.网络小龙,
(int)CardId.克莱因客户端蚁,
(int)CardId.均衡负载王,
(int)CardId.ROM云雌羊,
(int)CardId.RAM云雄羊,
(int)CardId.点阵图跳离士
CardId.Draconnet,
CardId.Kleinant,
CardId.BalancerLord,
CardId.ROMCloudia,
CardId.RAMClouder,
CardId.DotScaper
});
if (hastarget && !已发动均衡负载王)
if (hastarget && !BalancerLordUsed)
{
已发动均衡负载王 = true;
BalancerLordUsed = true;
return true;
}
return false;
}
private bool ROM云雌羊通常召唤()
private bool ROMCloudiaSummon()
{
return Bot.HasInGraveyard(new List<int> {
(int)CardId.引导交错鹿,
(int)CardId.均衡负载王,
(int)CardId.克莱因客户端蚁,
(int)CardId.猞猁连接杀手,
(int)CardId.网络小龙,
(int)CardId.RAM云雄羊
CardId.BootStagguard,
CardId.BalancerLord,
CardId.Kleinant,
CardId.Linkslayer,
CardId.Draconnet,
CardId.RAMClouder
});
}
private bool ROM云雌羊效果()
private bool ROMCloudiaEffect()
{
if (Card.Location == CardLocation.MonsterZone)
{
AI.SelectCard(new[]{
(int)CardId.引导交错鹿,
(int)CardId.均衡负载王,
(int)CardId.克莱因客户端蚁,
(int)CardId.猞猁连接杀手,
(int)CardId.网络小龙,
(int)CardId.RAM云雄羊
CardId.BootStagguard,
CardId.BalancerLord,
CardId.Kleinant,
CardId.Linkslayer,
CardId.Draconnet,
CardId.RAMClouder
});
return true;
}
else
{
AI.SelectCard(new[]{
(int)CardId.均衡负载王,
(int)CardId.克莱因客户端蚁,
(int)CardId.RAM云雄羊,
(int)CardId.点阵图跳离士
CardId.BalancerLord,
CardId.Kleinant,
CardId.RAMClouder,
CardId.DotScaper
});
return true;
}
}
private bool 网络小龙通常召唤()
private bool DraconnetSummon()
{
return Bot.GetRemainingCount((int)CardId.数字机灵, 1) > 0
|| Bot.GetRemainingCount((int)CardId.比特机灵, 1) > 0;
return Bot.GetRemainingCount(CardId.Digitron, 1) > 0
|| Bot.GetRemainingCount(CardId.Bitron, 1) > 0;
}
private bool 网络小龙效果()
private bool DraconnetEffect()
{
AI.SelectCard((int)CardId.比特机灵);
AI.SelectCard(CardId.Bitron);
return true;
}
private bool 克莱因客户端蚁效果()
private bool KleinantEffect()
{
IList<int> targets = new[] {
(int)CardId.双汇编亚龙,
(int)CardId.比特机灵,
(int)CardId.数字机灵,
(int)CardId.点阵图跳离士
CardId.DualAssembloom,
CardId.Bitron,
CardId.Digitron,
CardId.DotScaper
};
foreach (ClientCard monster in Bot.Hand)
{
......@@ -418,10 +419,10 @@ namespace WindBot.Game.AI.Decks
}
}
IList<int> targets2 = new[] {
(int)CardId.引导鹿衍生物,
(int)CardId.比特机灵,
(int)CardId.数字机灵,
(int)CardId.点阵图跳离士
CardId.StagToken,
CardId.Bitron,
CardId.Digitron,
CardId.DotScaper
};
foreach (ClientCard monster in Bot.GetMonsters())
{
......@@ -434,43 +435,43 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool RAM云雄羊效果()
private bool RAMClouderEffect()
{
AI.SelectCard(new[]{
(int)CardId.引导鹿衍生物,
(int)CardId.比特机灵,
(int)CardId.数字机灵,
(int)CardId.点阵图跳离士,
(int)CardId.网络小龙,
(int)CardId.反向连接兽,
(int)CardId.RAM云雄羊
CardId.StagToken,
CardId.Bitron,
CardId.Digitron,
CardId.DotScaper,
CardId.Draconnet,
CardId.Backlinker,
CardId.RAMClouder
});
AI.SelectNextCard(new[]{
(int)CardId.解码语者,
(int)CardId.编码语者,
(int)CardId.三栅极男巫,
(int)CardId.二进制女巫,
(int)CardId.蜜罐机器人,
(int)CardId.双汇编亚龙,
(int)CardId.引导交错鹿,
(int)CardId.均衡负载王,
(int)CardId.ROM云雌羊,
(int)CardId.猞猁连接杀手,
(int)CardId.RAM云雄羊
CardId.DecodeTalker,
CardId.EncodeTalker,
CardId.TriGateWizard,
CardId.BinarySorceress,
CardId.Honeybot,
CardId.DualAssembloom,
CardId.BootStagguard,
CardId.BalancerLord,
CardId.ROMCloudia,
CardId.Linkslayer,
CardId.RAMClouder
});
return true;
}
private bool 点阵图跳离士效果()
private bool DotScaperEffect()
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool 连接召唤()
private bool LinkSummon()
{
return (AI.Utils.IsTurn1OrMain2() || AI.Utils.IsEnemyBetter(false, false))
&& AI.Utils.GetBestAttack(Bot, true) < Card.Attack;
return (AI.Utils.IsTurn1OrMain2() || AI.Utils.IsOneEnemyBetter())
&& AI.Utils.GetBestAttack(Bot) < Card.Attack;
}
}
}
\ No newline at end of file
......@@ -6,104 +6,107 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Toadally Awesome", "AI_ToadallyAwesome")]
[Deck("Toadally Awesome", "AI_ToadallyAwesome", "OutDated")]
public class ToadallyAwesomeExecutor : DefaultExecutor
{
public enum CardId
{
冰结界的术者 = 23950192,
冰结界的水影 = 90311614,
鬼青蛙 = 9126351,
冰结界的传道师 = 50088247,
粹蛙 = 1357146,
魔知青蛙 = 46239604,
小灰篮史莱姆 = 80250319,
银河旋风 = 5133471,
鹰身女妖的羽毛扫 = 18144506,
浮上 = 33057951,
黑洞 = 53129443,
手札抹杀 = 72892473,
愚蠢的埋葬 = 81439173,
死者苏生 = 83764718,
冰结界的纹章 = 84206435,
海上打捞 = 96947648,
水舞台 = 29047353,
虹光之宣告者 = 79606837,
饼蛙 = 90809975,
神骑矢车菊圣人马 = 36776089,
大薰风凤凰 = 2766877,
猫鲨 = 84224627,
旋风 = 5318639,
月之书 = 14087893,
活死人的呼声 = 97077563,
激流葬 = 53582587,
闪光No39希望皇霍普电光皇 = 56832966
public class CardId
{
public static int CryomancerOfTheIceBarrier = 23950192;
public static int DewdarkOfTheIceBarrier = 90311614;
public static int SwapFrog = 9126351;
public static int PriorOfTheIceBarrier = 50088247;
public static int Ronintoadin = 1357146;
public static int DupeFrog = 46239604;
public static int GraydleSlimeJr = 80250319;
public static int GalaxyCyclone = 5133471;
public static int HarpiesFeatherDuster = 18144506;
public static int Surface = 33057951;
public static int DarkHole = 53129443;
public static int CardDestruction = 72892473;
public static int FoolishBurial = 81439173;
public static int MonsterReborn = 83764718;
public static int MedallionOfTheIceBarrier = 84206435;
public static int Salvage = 96947648;
public static int AquariumStage = 29047353;
public static int HeraldOfTheArcLight = 79606837;
public static int ToadallyAwesome = 90809975;
public static int SkyCavalryCentaurea = 36776089;
public static int DaigustoPhoenix = 2766877;
public static int CatShark = 84224627;
public static int MysticalSpaceTyphoon = 5318639;
public static int BookOfMoon = 14087893;
public static int CallOfTheHaunted = 97077563;
public static int TorrentialTribute = 53582587;
public static int NumberS39UtopiatheLightning = 56832966;
}
public ToadallyAwesomeExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, (int)CardId.鹰身女妖的羽毛扫, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, (int)CardId.银河旋风, DefaultGalaxyCyclone);
AddExecutor(ExecutorType.Activate, (int)CardId.鹰身女妖的羽毛扫);
AddExecutor(ExecutorType.Activate, (int)CardId.黑洞, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.水舞台, 水舞台效果);
AddExecutor(ExecutorType.Activate, (int)CardId.冰结界的纹章, 冰结界的纹章效果);
AddExecutor(ExecutorType.Activate, (int)CardId.愚蠢的埋葬, 愚蠢的埋葬效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.冰结界的传道师);
AddExecutor(ExecutorType.Summon, (int)CardId.小灰篮史莱姆, 小灰篮史莱姆优先通常召唤);
AddExecutor(ExecutorType.SpSummon, (int)CardId.鬼青蛙, 鬼青蛙特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.鬼青蛙, 鬼青蛙效果);
AddExecutor(ExecutorType.Activate, (int)CardId.小灰篮史莱姆, 小灰篮史莱姆效果);
AddExecutor(ExecutorType.Activate, (int)CardId.粹蛙, 粹蛙效果);
AddExecutor(ExecutorType.Activate, (int)CardId.冰结界的传道师);
AddExecutor(ExecutorType.Activate, (int)CardId.魔知青蛙);
AddExecutor(ExecutorType.Activate, (int)CardId.浮上, 死者苏生效果);
AddExecutor(ExecutorType.Activate, (int)CardId.死者苏生, 死者苏生效果);
AddExecutor(ExecutorType.Activate, (int)CardId.海上打捞, 海上打捞效果);
AddExecutor(ExecutorType.Summon, (int)CardId.鬼青蛙);
AddExecutor(ExecutorType.Summon, (int)CardId.冰结界的水影, 冰结界下级通常召唤);
AddExecutor(ExecutorType.Summon, (int)CardId.冰结界的术者, 冰结界下级通常召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.手札抹杀);
AddExecutor(ExecutorType.Summon, (int)CardId.小灰篮史莱姆, 低攻怪兽通常召唤);
AddExecutor(ExecutorType.Summon, (int)CardId.冰结界的传道师, 低攻怪兽通常召唤);
AddExecutor(ExecutorType.Summon, (int)CardId.粹蛙, 低攻怪兽通常召唤);
AddExecutor(ExecutorType.Summon, (int)CardId.魔知青蛙, 低攻怪兽通常召唤);
AddExecutor(ExecutorType.Summon, (int)CardId.冰结界的传道师, 冰结界的传道师通常召唤);
AddExecutor(ExecutorType.SpSummon, (int)CardId.猫鲨, 猫鲨特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.猫鲨, 猫鲨效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.神骑矢车菊圣人马, 神骑矢车菊圣人马特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.神骑矢车菊圣人马);
AddExecutor(ExecutorType.SpSummon, (int)CardId.大薰风凤凰, 大薰风凤凰特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.大薰风凤凰);
AddExecutor(ExecutorType.SpSummon, (int)CardId.饼蛙);
AddExecutor(ExecutorType.Activate, (int)CardId.饼蛙, 饼蛙效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.虹光之宣告者, 虹光之宣告者特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.虹光之宣告者);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.小灰篮史莱姆);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.魔知青蛙);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.粹蛙);
AddExecutor(ExecutorType.Repos, 改变攻守表示);
// 饼蛙抢来的卡的发动
AddExecutor(ExecutorType.Activate, (int)CardId.旋风, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, (int)CardId.月之书, DefaultBookOfMoon);
AddExecutor(ExecutorType.Activate, (int)CardId.活死人的呼声, 死者苏生效果);
AddExecutor(ExecutorType.Activate, (int)CardId.激流葬, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Activate, 其他魔法发动);
AddExecutor(ExecutorType.Activate, 其他陷阱发动);
AddExecutor(ExecutorType.Activate, 其他怪兽发动);
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, CardId.GalaxyCyclone, DefaultGalaxyCyclone);
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.AquariumStage, AquariumStageEffect);
AddExecutor(ExecutorType.Activate, CardId.MedallionOfTheIceBarrier, MedallionOfTheIceBarrierEffect);
AddExecutor(ExecutorType.Activate, CardId.FoolishBurial, FoolishBurialEffect);
AddExecutor(ExecutorType.SpSummon, CardId.PriorOfTheIceBarrier);
AddExecutor(ExecutorType.Summon, CardId.GraydleSlimeJr, GraydleSlimeJrSummon);
AddExecutor(ExecutorType.SpSummon, CardId.SwapFrog, SwapFrogSpsummon);
AddExecutor(ExecutorType.Activate, CardId.SwapFrog, SwapFrogEffect);
AddExecutor(ExecutorType.Activate, CardId.GraydleSlimeJr, GraydleSlimeJrEffect);
AddExecutor(ExecutorType.Activate, CardId.Ronintoadin, RonintoadinEffect);
AddExecutor(ExecutorType.Activate, CardId.PriorOfTheIceBarrier);
AddExecutor(ExecutorType.Activate, CardId.DupeFrog);
AddExecutor(ExecutorType.Activate, CardId.Surface, SurfaceEffect);
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, SurfaceEffect);
AddExecutor(ExecutorType.Activate, CardId.Salvage, SalvageEffect);
AddExecutor(ExecutorType.Summon, CardId.SwapFrog);
AddExecutor(ExecutorType.Summon, CardId.DewdarkOfTheIceBarrier, IceBarrierSummon);
AddExecutor(ExecutorType.Summon, CardId.CryomancerOfTheIceBarrier, IceBarrierSummon);
AddExecutor(ExecutorType.Activate, CardId.CardDestruction);
AddExecutor(ExecutorType.Summon, CardId.GraydleSlimeJr, NormalSummon);
AddExecutor(ExecutorType.Summon, CardId.PriorOfTheIceBarrier, NormalSummon);
AddExecutor(ExecutorType.Summon, CardId.Ronintoadin, NormalSummon);
AddExecutor(ExecutorType.Summon, CardId.DupeFrog, NormalSummon);
AddExecutor(ExecutorType.Summon, CardId.PriorOfTheIceBarrier, PriorOfTheIceBarrierSummon);
AddExecutor(ExecutorType.SpSummon, CardId.CatShark, CatSharkSummon);
AddExecutor(ExecutorType.Activate, CardId.CatShark, CatSharkEffect);
AddExecutor(ExecutorType.SpSummon, CardId.SkyCavalryCentaurea, SkyCavalryCentaureaSummon);
AddExecutor(ExecutorType.Activate, CardId.SkyCavalryCentaurea);
AddExecutor(ExecutorType.SpSummon, CardId.DaigustoPhoenix, DaigustoPhoenixSummon);
AddExecutor(ExecutorType.Activate, CardId.DaigustoPhoenix);
AddExecutor(ExecutorType.SpSummon, CardId.ToadallyAwesome);
AddExecutor(ExecutorType.Activate, CardId.ToadallyAwesome, ToadallyAwesomeEffect);
AddExecutor(ExecutorType.SpSummon, CardId.HeraldOfTheArcLight, HeraldOfTheArcLightSummon);
AddExecutor(ExecutorType.Activate, CardId.HeraldOfTheArcLight);
AddExecutor(ExecutorType.MonsterSet, CardId.GraydleSlimeJr);
AddExecutor(ExecutorType.MonsterSet, CardId.DupeFrog);
AddExecutor(ExecutorType.MonsterSet, CardId.Ronintoadin);
AddExecutor(ExecutorType.Repos, Repos);
// cards got by Toadall yAwesome
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.BookOfMoon, DefaultBookOfMoon);
AddExecutor(ExecutorType.Activate, CardId.CallOfTheHaunted, SurfaceEffect);
AddExecutor(ExecutorType.Activate, CardId.TorrentialTribute, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Activate, OtherSpellEffect);
AddExecutor(ExecutorType.Activate, OtherTrapEffect);
AddExecutor(ExecutorType.Activate, OtherMonsterEffect);
}
public override bool OnSelectHand()
......@@ -118,136 +121,136 @@ namespace WindBot.Game.AI.Decks
if (defender.IsMonsterDangerous() || defender.IsDefense())
return false;
}
if (!(defender.Id == (int)CardId.闪光No39希望皇霍普电光皇))
if (!(defender.Id == CardId.NumberS39UtopiatheLightning))
{
if (attacker.Id == (int)CardId.神骑矢车菊圣人马 && !attacker.IsDisabled() && attacker.HasXyzMaterial())
if (attacker.Id == CardId.SkyCavalryCentaurea && !attacker.IsDisabled() && attacker.HasXyzMaterial())
attacker.RealPower = Duel.LifePoints[0] + attacker.Attack;
}
return attacker.RealPower >= defender.GetDefensePower();
}
private bool 冰结界的纹章效果()
private bool MedallionOfTheIceBarrierEffect()
{
if (Bot.HasInHand(new List<int>
{
(int)CardId.冰结界的术者,
(int)CardId.冰结界的水影
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier
}) || Bot.HasInMonstersZone(new List<int>
{
(int)CardId.冰结界的术者,
(int)CardId.冰结界的水影
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier
}))
{
AI.SelectCard((int)CardId.冰结界的传道师);
AI.SelectCard(CardId.PriorOfTheIceBarrier);
}
else
{
AI.SelectCard(new[]
{
(int)CardId.冰结界的术者,
(int)CardId.冰结界的水影
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier
});
}
return true;
}
private bool 死者苏生效果()
private bool SurfaceEffect()
{
AI.SelectCard(new[]
{
(int)CardId.饼蛙,
(int)CardId.虹光之宣告者,
(int)CardId.鬼青蛙,
(int)CardId.冰结界的水影,
(int)CardId.冰结界的术者,
(int)CardId.魔知青蛙,
(int)CardId.粹蛙,
(int)CardId.小灰篮史莱姆
CardId.ToadallyAwesome,
CardId.HeraldOfTheArcLight,
CardId.SwapFrog,
CardId.DewdarkOfTheIceBarrier,
CardId.CryomancerOfTheIceBarrier,
CardId.DupeFrog,
CardId.Ronintoadin,
CardId.GraydleSlimeJr
});
return true;
}
private bool 水舞台效果()
private bool AquariumStageEffect()
{
if (Card.Location == CardLocation.Grave)
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return 死者苏生效果();
return SurfaceEffect();
}
return true;
}
private bool 愚蠢的埋葬效果()
private bool FoolishBurialEffect()
{
if (Bot.HasInHand((int)CardId.小灰篮史莱姆) && !Bot.HasInGraveyard((int)CardId.小灰篮史莱姆))
AI.SelectCard((int)CardId.小灰篮史莱姆);
else if (Bot.HasInGraveyard((int)CardId.粹蛙) && !Bot.HasInGraveyard((int)CardId.魔知青蛙))
AI.SelectCard((int)CardId.魔知青蛙);
else if (Bot.HasInGraveyard((int)CardId.魔知青蛙) && !Bot.HasInGraveyard((int)CardId.粹蛙))
AI.SelectCard((int)CardId.粹蛙);
if (Bot.HasInHand(CardId.GraydleSlimeJr) && !Bot.HasInGraveyard(CardId.GraydleSlimeJr))
AI.SelectCard(CardId.GraydleSlimeJr);
else if (Bot.HasInGraveyard(CardId.Ronintoadin) && !Bot.HasInGraveyard(CardId.DupeFrog))
AI.SelectCard(CardId.DupeFrog);
else if (Bot.HasInGraveyard(CardId.DupeFrog) && !Bot.HasInGraveyard(CardId.Ronintoadin))
AI.SelectCard(CardId.Ronintoadin);
else
AI.SelectCard(new[]
{
(int)CardId.小灰篮史莱姆,
(int)CardId.粹蛙,
(int)CardId.魔知青蛙,
(int)CardId.冰结界的术者,
(int)CardId.冰结界的水影,
(int)CardId.冰结界的传道师,
(int)CardId.鬼青蛙
CardId.GraydleSlimeJr,
CardId.Ronintoadin,
CardId.DupeFrog,
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier,
CardId.PriorOfTheIceBarrier,
CardId.SwapFrog
});
return true;
}
private bool 海上打捞效果()
private bool SalvageEffect()
{
AI.SelectCard(new[]
{
(int)CardId.鬼青蛙,
(int)CardId.冰结界的传道师,
(int)CardId.小灰篮史莱姆
CardId.SwapFrog,
CardId.PriorOfTheIceBarrier,
CardId.GraydleSlimeJr
});
return true;
}
private bool 鬼青蛙特殊召唤()
private bool SwapFrogSpsummon()
{
if (Bot.GetCountCardInZone(Bot.Hand, (int)CardId.小灰篮史莱姆)>=2 && !Bot.HasInGraveyard((int)CardId.小灰篮史莱姆))
AI.SelectCard((int)CardId.小灰篮史莱姆);
else if (Bot.HasInGraveyard((int)CardId.粹蛙) && !Bot.HasInGraveyard((int)CardId.魔知青蛙))
AI.SelectCard((int)CardId.魔知青蛙);
else if (Bot.HasInGraveyard((int)CardId.魔知青蛙) && !Bot.HasInGraveyard((int)CardId.粹蛙))
AI.SelectCard((int)CardId.粹蛙);
if (Bot.GetCountCardInZone(Bot.Hand, CardId.GraydleSlimeJr)>=2 && !Bot.HasInGraveyard(CardId.GraydleSlimeJr))
AI.SelectCard(CardId.GraydleSlimeJr);
else if (Bot.HasInGraveyard(CardId.Ronintoadin) && !Bot.HasInGraveyard(CardId.DupeFrog))
AI.SelectCard(CardId.DupeFrog);
else if (Bot.HasInGraveyard(CardId.DupeFrog) && !Bot.HasInGraveyard(CardId.Ronintoadin))
AI.SelectCard(CardId.Ronintoadin);
else
AI.SelectCard(new[]
{
(int)CardId.粹蛙,
(int)CardId.魔知青蛙,
(int)CardId.冰结界的术者,
(int)CardId.冰结界的水影,
(int)CardId.冰结界的传道师,
(int)CardId.小灰篮史莱姆,
(int)CardId.鬼青蛙
CardId.Ronintoadin,
CardId.DupeFrog,
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier,
CardId.PriorOfTheIceBarrier,
CardId.GraydleSlimeJr,
CardId.SwapFrog
});
return true;
}
private bool 鬼青蛙效果()
private bool SwapFrogEffect()
{
if (ActivateDescription == -1)
{
return 愚蠢的埋葬效果();
return FoolishBurialEffect();
}
else
{
if (Bot.HasInHand((int)CardId.魔知青蛙))
if (Bot.HasInHand(CardId.DupeFrog))
{
AI.SelectCard(new[]
{
(int)CardId.冰结界的传道师,
(int)CardId.小灰篮史莱姆,
(int)CardId.鬼青蛙
CardId.PriorOfTheIceBarrier,
CardId.GraydleSlimeJr,
CardId.SwapFrog
});
return true;
}
......@@ -255,35 +258,35 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 小灰篮史莱姆优先通常召唤()
private bool GraydleSlimeJrSummon()
{
return Bot.HasInGraveyard((int)CardId.小灰篮史莱姆);
return Bot.HasInGraveyard(CardId.GraydleSlimeJr);
}
private bool 小灰篮史莱姆效果()
private bool GraydleSlimeJrEffect()
{
AI.SelectCard((int)CardId.小灰篮史莱姆);
AI.SelectCard(CardId.GraydleSlimeJr);
AI.SelectPosition(CardPosition.FaceUpDefence);
AI.SelectNextCard(new[]
{
(int)CardId.鬼青蛙,
(int)CardId.冰结界的术者,
(int)CardId.冰结界的水影,
(int)CardId.粹蛙,
(int)CardId.魔知青蛙,
(int)CardId.冰结界的传道师,
(int)CardId.小灰篮史莱姆
CardId.SwapFrog,
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier,
CardId.Ronintoadin,
CardId.DupeFrog,
CardId.PriorOfTheIceBarrier,
CardId.GraydleSlimeJr
});
return true;
}
private bool 粹蛙效果()
private bool RonintoadinEffect()
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool 低攻怪兽通常召唤()
private bool NormalSummon()
{
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
......@@ -296,59 +299,60 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 冰结界下级通常召唤()
private bool IceBarrierSummon()
{
return Bot.GetCountCardInZone(Bot.Hand, (int)CardId.冰结界的传道师) > 0;
return Bot.GetCountCardInZone(Bot.Hand, CardId.PriorOfTheIceBarrier) > 0;
}
private bool 冰结界的传道师通常召唤()
private bool PriorOfTheIceBarrierSummon()
{
return Bot.GetCountCardInZone(Bot.Hand, (int)CardId.冰结界的传道师) >= 2;
return Bot.GetCountCardInZone(Bot.Hand, CardId.PriorOfTheIceBarrier) >= 2;
}
private bool 饼蛙效果()
private bool ToadallyAwesomeEffect()
{
if (CurrentChain.Count > 0)
{
// negate effect, select a cost for it
List<ClientCard> monsters = Bot.GetMonsters();
List<int> 合适的COST = new List<int> {
(int)CardId.鬼青蛙,
(int)CardId.粹蛙,
(int)CardId.小灰篮史莱姆,
(int)CardId.冰结界的术者,
(int)CardId.冰结界的水影
List<int> suitableCost = new List<int> {
CardId.SwapFrog,
CardId.Ronintoadin,
CardId.GraydleSlimeJr,
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier
};
foreach (ClientCard monster in monsters)
{
if (合适的COST.Contains(monster.Id))
if (suitableCost.Contains(monster.Id))
{
AI.SelectCard(monster);
return true;
}
}
bool 有水舞台 = Bot.HasInSpellZone((int)CardId.水舞台, true);
bool haveAquariumStage = Bot.HasInSpellZone(CardId.AquariumStage, true);
foreach (ClientCard monster in monsters)
{
if (monster.Id == (int)CardId.魔知青蛙 && !有水舞台)
if (monster.Id == CardId.DupeFrog && !haveAquariumStage)
{
AI.SelectCard(monster);
return true;
}
}
monsters = (List<ClientCard>)Bot.Hand;
bool 手里有2个史莱姆 = Bot.GetCountCardInZone(Bot.Hand, (int)CardId.小灰篮史莱姆) >= 2;
bool HaveTwoGraydleSlimeJrInHand = Bot.GetCountCardInZone(Bot.Hand, CardId.GraydleSlimeJr) >= 2;
foreach (ClientCard monster in monsters)
{
if (monster.Id == (int)CardId.小灰篮史莱姆 && 手里有2个史莱姆)
if (monster.Id == CardId.GraydleSlimeJr && HaveTwoGraydleSlimeJrInHand)
{
AI.SelectCard(monster);
return true;
}
}
bool 需要丢魔知 = Bot.HasInGraveyard((int)CardId.粹蛙) && !Bot.HasInGraveyard((int)CardId.魔知青蛙) && !Bot.HasInGraveyard((int)CardId.鬼青蛙);
bool NeedDupeFrogInGrave = Bot.HasInGraveyard(CardId.Ronintoadin) && !Bot.HasInGraveyard(CardId.DupeFrog) && !Bot.HasInGraveyard(CardId.SwapFrog);
foreach (ClientCard monster in monsters)
{
if (monster.Id == (int)CardId.魔知青蛙 && 需要丢魔知)
if (monster.Id == CardId.DupeFrog && NeedDupeFrogInGrave)
{
AI.SelectCard(monster);
return true;
......@@ -356,7 +360,7 @@ namespace WindBot.Game.AI.Decks
}
foreach (ClientCard monster in monsters)
{
if (monster.Id == (int)CardId.粹蛙 || monster.Id == (int)CardId.魔知青蛙)
if (monster.Id == CardId.Ronintoadin || monster.Id == CardId.DupeFrog)
{
AI.SelectCard(monster);
return true;
......@@ -371,46 +375,46 @@ namespace WindBot.Game.AI.Decks
}
else if (Card.Location == CardLocation.Grave)
{
if (!Bot.HasInExtra((int)CardId.饼蛙))
if (!Bot.HasInExtra(CardId.ToadallyAwesome))
{
AI.SelectCard((int)CardId.饼蛙);
AI.SelectCard(CardId.ToadallyAwesome);
}
else
{
AI.SelectCard(new[]
{
(int)CardId.鬼青蛙,
(int)CardId.冰结界的传道师,
(int)CardId.小灰篮史莱姆
CardId.SwapFrog,
CardId.PriorOfTheIceBarrier,
CardId.GraydleSlimeJr
});
}
return true;
}
else if (Duel.Phase == DuelPhase.Standby)
{
选择取除超量素材(Card.Overlays);
SelectXYZDetach(Card.Overlays);
if (Duel.Player == 0)
{
AI.SelectNextCard(new[]
{
(int)CardId.鬼青蛙,
(int)CardId.冰结界的术者,
(int)CardId.冰结界的水影,
(int)CardId.粹蛙,
(int)CardId.魔知青蛙,
(int)CardId.小灰篮史莱姆
CardId.SwapFrog,
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier,
CardId.Ronintoadin,
CardId.DupeFrog,
CardId.GraydleSlimeJr
});
}
else
{
AI.SelectNextCard(new[]
{
(int)CardId.魔知青蛙,
(int)CardId.鬼青蛙,
(int)CardId.粹蛙,
(int)CardId.小灰篮史莱姆,
(int)CardId.冰结界的术者,
(int)CardId.冰结界的水影
CardId.DupeFrog,
CardId.SwapFrog,
CardId.Ronintoadin,
CardId.GraydleSlimeJr,
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier
});
AI.SelectPosition(CardPosition.FaceUpDefence);
}
......@@ -419,16 +423,16 @@ namespace WindBot.Game.AI.Decks
return true;
}
private bool 猫鲨特殊召唤()
private bool CatSharkSummon()
{
bool should = Bot.HasInMonstersZone((int)CardId.饼蛙)
&& ((AI.Utils.IsEnemyBetter(true, false)
bool should = Bot.HasInMonstersZone(CardId.ToadallyAwesome)
&& ((AI.Utils.IsOneEnemyBetter(true)
&& !Bot.HasInMonstersZone(new List<int>
{
(int)CardId.猫鲨,
(int)CardId.神骑矢车菊圣人马
CardId.CatShark,
CardId.SkyCavalryCentaurea
}, true, true))
|| !Bot.HasInExtra((int)CardId.饼蛙));
|| !Bot.HasInExtra(CardId.ToadallyAwesome));
if (should)
{
AI.SelectPosition(CardPosition.FaceUpDefence);
......@@ -437,32 +441,32 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 猫鲨效果()
private bool CatSharkEffect()
{
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (monster.Id == (int)CardId.饼蛙 && monster.Attack <= 2200)
if (monster.Id == CardId.ToadallyAwesome && monster.Attack <= 2200)
{
选择取除超量素材(Card.Overlays);
SelectXYZDetach(Card.Overlays);
AI.SelectNextCard(monster);
return true;
}
}
foreach (ClientCard monster in monsters)
{
if (monster.Id == (int)CardId.神骑矢车菊圣人马 && monster.Attack <= 2000)
if (monster.Id == CardId.SkyCavalryCentaurea && monster.Attack <= 2000)
{
选择取除超量素材(Card.Overlays);
SelectXYZDetach(Card.Overlays);
AI.SelectNextCard(monster);
return true;
}
}
foreach (ClientCard monster in monsters)
{
if (monster.Id == (int)CardId.大薰风凤凰 && monster.Attack <= 1500)
if (monster.Id == CardId.DaigustoPhoenix && monster.Attack <= 1500)
{
选择取除超量素材(Card.Overlays);
SelectXYZDetach(Card.Overlays);
AI.SelectNextCard(monster);
return true;
}
......@@ -470,7 +474,7 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 神骑矢车菊圣人马特殊召唤()
private bool SkyCavalryCentaureaSummon()
{
int num = 0;
List<ClientCard> monsters = Bot.GetMonsters();
......@@ -481,16 +485,16 @@ namespace WindBot.Game.AI.Decks
num++;
}
}
return AI.Utils.IsEnemyBetter(true, false)
&& AI.Utils.GetBestAttack(Enemy, true) > 2200
return AI.Utils.IsOneEnemyBetter(true)
&& AI.Utils.GetBestAttack(Enemy) > 2200
&& num < 4
&& !Bot.HasInMonstersZone(new List<int>
{
(int)CardId.神骑矢车菊圣人马
CardId.SkyCavalryCentaurea
}, true, true);
}
private bool 大薰风凤凰特殊召唤()
private bool DaigustoPhoenixSummon()
{
if (Duel.Turn != 1)
{
......@@ -509,21 +513,21 @@ namespace WindBot.Game.AI.Decks
{
defence += monster.GetDefensePower();
}
if (attack - 2000 - defence > Duel.LifePoints[1] && !AI.Utils.IsEnemyBetter(true, false))
if (attack - 2000 - defence > Duel.LifePoints[1] && !AI.Utils.IsOneEnemyBetter(true))
return true;
}
return false;
}
private bool 虹光之宣告者特殊召唤()
private bool HeraldOfTheArcLightSummon()
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool 改变攻守表示()
private bool Repos()
{
bool enemyBetter = AI.Utils.IsEnemyBetter(true, true);
bool enemyBetter = AI.Utils.IsAllEnemyBetter(true);
if (Card.IsFacedown())
return true;
......@@ -532,7 +536,7 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 其他魔法发动()
private bool OtherSpellEffect()
{
foreach (CardExecutor exec in Executors)
{
......@@ -542,7 +546,7 @@ namespace WindBot.Game.AI.Decks
return Card.IsSpell();
}
private bool 其他陷阱发动()
private bool OtherTrapEffect()
{
foreach (CardExecutor exec in Executors)
{
......@@ -552,7 +556,7 @@ namespace WindBot.Game.AI.Decks
return Card.IsTrap() && DefaultTrap();
}
private bool 其他怪兽发动()
private bool OtherMonsterEffect()
{
foreach (CardExecutor exec in Executors)
{
......@@ -562,24 +566,24 @@ namespace WindBot.Game.AI.Decks
return Card.IsMonster();
}
private void 选择取除超量素材(List<int> Overlays)
private void SelectXYZDetach(List<int> Overlays)
{
if (Overlays.Contains((int)CardId.小灰篮史莱姆) && Bot.HasInHand((int)CardId.小灰篮史莱姆) && !Bot.HasInGraveyard((int)CardId.小灰篮史莱姆))
AI.SelectCard((int)CardId.小灰篮史莱姆);
else if (Overlays.Contains((int)CardId.魔知青蛙) && Bot.HasInGraveyard((int)CardId.粹蛙) && !Bot.HasInGraveyard((int)CardId.魔知青蛙))
AI.SelectCard((int)CardId.魔知青蛙);
else if (Overlays.Contains((int)CardId.粹蛙) && Bot.HasInGraveyard((int)CardId.魔知青蛙) && !Bot.HasInGraveyard((int)CardId.粹蛙))
AI.SelectCard((int)CardId.粹蛙);
if (Overlays.Contains(CardId.GraydleSlimeJr) && Bot.HasInHand(CardId.GraydleSlimeJr) && !Bot.HasInGraveyard(CardId.GraydleSlimeJr))
AI.SelectCard(CardId.GraydleSlimeJr);
else if (Overlays.Contains(CardId.DupeFrog) && Bot.HasInGraveyard(CardId.Ronintoadin) && !Bot.HasInGraveyard(CardId.DupeFrog))
AI.SelectCard(CardId.DupeFrog);
else if (Overlays.Contains(CardId.Ronintoadin) && Bot.HasInGraveyard(CardId.DupeFrog) && !Bot.HasInGraveyard(CardId.Ronintoadin))
AI.SelectCard(CardId.Ronintoadin);
else
AI.SelectCard(new[]
{
(int)CardId.小灰篮史莱姆,
(int)CardId.粹蛙,
(int)CardId.魔知青蛙,
(int)CardId.冰结界的术者,
(int)CardId.冰结界的水影,
(int)CardId.冰结界的传道师,
(int)CardId.鬼青蛙
CardId.GraydleSlimeJr,
CardId.Ronintoadin,
CardId.DupeFrog,
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier,
CardId.PriorOfTheIceBarrier,
CardId.SwapFrog
});
}
}
......
......@@ -9,168 +9,161 @@ namespace WindBot.Game.AI.Decks
[Deck("Yosenju", "AI_Yosenju")]
public class YosenjuExecutor : DefaultExecutor
{
public enum CardId
{
妖仙兽镰壹太刀 = 65247798,
妖仙兽镰贰太刀 = 92246806,
妖仙兽镰叁太刀 = 28630501,
妖仙兽辻斩风 = 25244515,
鹰身女妖的羽毛扫 = 18144507,
黑洞 = 53129443,
削命的宝札 = 59750328,
强欲而谦虚之壶 = 98645731,
宇宙旋风 = 8267140,
沙尘防护罩尘埃之力 = 40838625,
波纹防护罩波浪之力 = 47475363,
星光大道 = 58120309,
虚无空间 = 5851097,
大宇宙 = 30241314,
神之通告 = 40605147,
神之警告 = 84749824,
神之宣告 = 41420027,
魔力抽取 = 59344077,
星尘龙 = 44508094,
闪光No39希望皇霍普电光皇 = 56832966,
闪光No39希望皇霍普一 = 86532744,
暗叛逆超量龙 = 16195942,
No39希望皇霍普 = 84013237,
No103神葬零娘暮零 = 94380860,
魁炎星王宋虎 = 96381979,
No106巨岩掌巨手 = 63746411,
鸟铳士卡斯泰尔 = 82633039,
恐牙狼钻石恐狼 = 95169481,
电光千鸟 = 22653490,
励辉士入魔蝇王 = 46772449,
深渊的潜伏者 = 21044178,
我我我枪手 = 12014404
public class CardId
{
public static int YosenjuKama1 = 65247798;
public static int YosenjuKama2 = 92246806;
public static int YosenjuKama3 = 28630501;
public static int YosenjuTsujik = 25244515;
public static int HarpiesFeatherDuster = 18144507;
public static int DarkHole = 53129443;
public static int CardOfDemise = 59750328;
public static int PotOfDuality = 98645731;
public static int CosmicCyclone = 8267140;
public static int QuakingMirrorForce = 40838625;
public static int DrowningMirrorForce = 47475363;
public static int StarlightRoad = 58120309;
public static int VanitysEmptiness = 5851097;
public static int MacroCosmos = 30241314;
public static int SolemnStrike = 40605147;
public static int SolemnWarning = 84749824;
public static int SolemnJudgment = 41420027;
public static int MagicDrain = 59344077;
public static int StardustDragon = 44508094;
public static int NumberS39UtopiatheLightning = 56832966;
public static int NumberS39UtopiaOne = 86532744;
public static int DarkRebellionXyzDragon = 16195942;
public static int Number39Utopia = 84013237;
public static int Number103Ragnazero = 94380860;
public static int BrotherhoodOfTheFireFistTigerKing = 96381979;
public static int Number106GiantHand = 63746411;
public static int CastelTheSkyblasterMusketeer = 82633039;
public static int DiamondDireWolf = 95169481;
public static int LightningChidori = 22653490;
public static int EvilswarmExcitonKnight = 46772449;
public static int AbyssDweller = 21044178;
public static int GagagaCowboy = 12014404;
}
bool 已发动削命 = false;
bool CardOfDemiseUsed = false;
public YosenjuExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
// 结束阶段优先丢卡
AddExecutor(ExecutorType.Activate, (int)CardId.削命的宝札, 削命的宝札结束阶段);
// 能烧就烧
AddExecutor(ExecutorType.SpSummon, (int)CardId.我我我枪手, 我我我枪手特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.我我我枪手);
// 清场
AddExecutor(ExecutorType.Activate, (int)CardId.鹰身女妖的羽毛扫, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, (int)CardId.宇宙旋风, DefaultCosmicCyclone);
AddExecutor(ExecutorType.Activate, (int)CardId.鹰身女妖的羽毛扫);
AddExecutor(ExecutorType.Activate, (int)CardId.黑洞, DefaultDarkHole);
// 开壶
AddExecutor(ExecutorType.Activate, (int)CardId.强欲而谦虚之壶, 强欲而谦虚之壶);
// 通招
AddExecutor(ExecutorType.Summon, (int)CardId.妖仙兽镰壹太刀, 优先出重复的妖仙兽);
AddExecutor(ExecutorType.Summon, (int)CardId.妖仙兽镰贰太刀, 优先出重复的妖仙兽);
AddExecutor(ExecutorType.Summon, (int)CardId.妖仙兽镰叁太刀, 优先出重复的妖仙兽);
AddExecutor(ExecutorType.Summon, (int)CardId.妖仙兽镰壹太刀);
AddExecutor(ExecutorType.Summon, (int)CardId.妖仙兽镰贰太刀);
AddExecutor(ExecutorType.Summon, (int)CardId.妖仙兽镰叁太刀);
AddExecutor(ExecutorType.Summon, (int)CardId.妖仙兽辻斩风);
// 妖仙兽效果无脑发动
AddExecutor(ExecutorType.Activate, (int)CardId.妖仙兽镰壹太刀, 妖仙兽效果);
AddExecutor(ExecutorType.Activate, (int)CardId.妖仙兽镰贰太刀, 妖仙兽效果);
AddExecutor(ExecutorType.Activate, (int)CardId.妖仙兽镰叁太刀, 妖仙兽效果);
AddExecutor(ExecutorType.Activate, (int)CardId.妖仙兽辻斩风, 妖仙兽效果);
// 盖坑
AddExecutor(ExecutorType.SpellSet, (int)CardId.神之宣告, 优先盖不重复的坑);
AddExecutor(ExecutorType.SpellSet, (int)CardId.神之通告, 优先盖不重复的坑);
AddExecutor(ExecutorType.SpellSet, (int)CardId.神之警告, 优先盖不重复的坑);
AddExecutor(ExecutorType.SpellSet, (int)CardId.大宇宙, 优先盖不重复的坑);
AddExecutor(ExecutorType.SpellSet, (int)CardId.虚无空间, 优先盖不重复的坑);
AddExecutor(ExecutorType.SpellSet, (int)CardId.魔力抽取, 优先盖不重复的坑);
AddExecutor(ExecutorType.SpellSet, (int)CardId.波纹防护罩波浪之力, 优先盖不重复的坑);
AddExecutor(ExecutorType.SpellSet, (int)CardId.沙尘防护罩尘埃之力, 优先盖不重复的坑);
AddExecutor(ExecutorType.SpellSet, (int)CardId.星光大道, 优先盖不重复的坑);
AddExecutor(ExecutorType.SpellSet, (int)CardId.神之宣告, 魔陷区有空余格子);
AddExecutor(ExecutorType.SpellSet, (int)CardId.神之通告, 魔陷区有空余格子);
AddExecutor(ExecutorType.SpellSet, (int)CardId.神之警告, 魔陷区有空余格子);
AddExecutor(ExecutorType.SpellSet, (int)CardId.大宇宙, 魔陷区有空余格子);
AddExecutor(ExecutorType.SpellSet, (int)CardId.虚无空间, 魔陷区有空余格子);
AddExecutor(ExecutorType.SpellSet, (int)CardId.魔力抽取, 魔陷区有空余格子);
AddExecutor(ExecutorType.SpellSet, (int)CardId.波纹防护罩波浪之力, 魔陷区有空余格子);
AddExecutor(ExecutorType.SpellSet, (int)CardId.沙尘防护罩尘埃之力, 魔陷区有空余格子);
AddExecutor(ExecutorType.SpellSet, (int)CardId.星光大道, 魔陷区有空余格子);
AddExecutor(ExecutorType.SpellSet, (int)CardId.鹰身女妖的羽毛扫, 魔陷区有空余格子);
AddExecutor(ExecutorType.SpellSet, (int)CardId.黑洞, 魔陷区有空余格子);
AddExecutor(ExecutorType.SpellSet, (int)CardId.强欲而谦虚之壶, 魔陷区有空余格子);
AddExecutor(ExecutorType.SpellSet, (int)CardId.宇宙旋风, 魔陷区有空余格子);
// 开完削命继续盖坑
AddExecutor(ExecutorType.SpellSet, (int)CardId.削命的宝札);
AddExecutor(ExecutorType.Activate, (int)CardId.削命的宝札, 削命的宝札);
AddExecutor(ExecutorType.SpellSet, (int)CardId.神之宣告, 已发动过削命);
AddExecutor(ExecutorType.SpellSet, (int)CardId.神之通告, 已发动过削命);
AddExecutor(ExecutorType.SpellSet, (int)CardId.神之警告, 已发动过削命);
AddExecutor(ExecutorType.SpellSet, (int)CardId.大宇宙, 已发动过削命);
AddExecutor(ExecutorType.SpellSet, (int)CardId.虚无空间, 已发动过削命);
AddExecutor(ExecutorType.SpellSet, (int)CardId.魔力抽取, 已发动过削命);
AddExecutor(ExecutorType.SpellSet, (int)CardId.波纹防护罩波浪之力, 已发动过削命);
AddExecutor(ExecutorType.SpellSet, (int)CardId.沙尘防护罩尘埃之力, 已发动过削命);
AddExecutor(ExecutorType.SpellSet, (int)CardId.星光大道, 已发动过削命);
AddExecutor(ExecutorType.SpellSet, (int)CardId.鹰身女妖的羽毛扫, 已发动过削命);
AddExecutor(ExecutorType.SpellSet, (int)CardId.黑洞, 已发动过削命);
AddExecutor(ExecutorType.SpellSet, (int)CardId.强欲而谦虚之壶, 已发动过削命);
AddExecutor(ExecutorType.SpellSet, (int)CardId.宇宙旋风, 已发动过削命);
// 常用额外
AddExecutor(ExecutorType.SpSummon, (int)CardId.励辉士入魔蝇王, 励辉士入魔蝇王特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.励辉士入魔蝇王, 励辉士入魔蝇王效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.暗叛逆超量龙, 暗叛逆超量龙特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.暗叛逆超量龙, 暗叛逆超量龙效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.No39希望皇霍普, 电光皇特殊召唤);
AddExecutor(ExecutorType.SpSummon, (int)CardId.闪光No39希望皇霍普一);
AddExecutor(ExecutorType.SpSummon, (int)CardId.闪光No39希望皇霍普电光皇);
AddExecutor(ExecutorType.Activate, (int)CardId.闪光No39希望皇霍普电光皇);
AddExecutor(ExecutorType.Activate, (int)CardId.星尘龙, 星尘龙效果);
// 坑人
AddExecutor(ExecutorType.Activate, (int)CardId.星光大道, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.魔力抽取);
AddExecutor(ExecutorType.Activate, (int)CardId.神之警告, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, (int)CardId.神之通告, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, (int)CardId.神之宣告, DefaultSolemnJudgment);
AddExecutor(ExecutorType.Activate, (int)CardId.大宇宙, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.虚无空间, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.波纹防护罩波浪之力, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.沙尘防护罩尘埃之力, DefaultUniqueTrap);
// do the end phase effect of Card Of Demise before Yosenjus return to hand
AddExecutor(ExecutorType.Activate, CardId.CardOfDemise, CardOfDemiseEPEffect);
// burn if enemy's LP is below 800
AddExecutor(ExecutorType.SpSummon, CardId.GagagaCowboy, GagagaCowboySummon);
AddExecutor(ExecutorType.Activate, CardId.GagagaCowboy);
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, CardId.CosmicCyclone, DefaultCosmicCyclone);
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.PotOfDuality, PotOfDualityEffect);
AddExecutor(ExecutorType.Summon, CardId.YosenjuKama1, HaveAnotherYosenjuWithSameNameInHand);
AddExecutor(ExecutorType.Summon, CardId.YosenjuKama2, HaveAnotherYosenjuWithSameNameInHand);
AddExecutor(ExecutorType.Summon, CardId.YosenjuKama3, HaveAnotherYosenjuWithSameNameInHand);
AddExecutor(ExecutorType.Summon, CardId.YosenjuKama1);
AddExecutor(ExecutorType.Summon, CardId.YosenjuKama2);
AddExecutor(ExecutorType.Summon, CardId.YosenjuKama3);
AddExecutor(ExecutorType.Summon, CardId.YosenjuTsujik);
AddExecutor(ExecutorType.Activate, CardId.YosenjuKama1, YosenjuEffect);
AddExecutor(ExecutorType.Activate, CardId.YosenjuKama2, YosenjuEffect);
AddExecutor(ExecutorType.Activate, CardId.YosenjuKama3, YosenjuEffect);
AddExecutor(ExecutorType.Activate, CardId.YosenjuTsujik, YosenjuEffect);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnJudgment, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnStrike, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnWarning, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.MacroCosmos, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.VanitysEmptiness, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.MagicDrain, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.DrowningMirrorForce, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.QuakingMirrorForce, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.StarlightRoad, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnJudgment, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnStrike, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnWarning, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.MacroCosmos, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.VanitysEmptiness, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.MagicDrain, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.DrowningMirrorForce, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.QuakingMirrorForce, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.StarlightRoad, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.HarpiesFeatherDuster, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.DarkHole, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.PotOfDuality, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.CosmicCyclone, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.CardOfDemise);
AddExecutor(ExecutorType.Activate, CardId.CardOfDemise, CardOfDemiseEffect);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnJudgment, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnStrike, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnWarning, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.MacroCosmos, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.VanitysEmptiness, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.MagicDrain, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.DrowningMirrorForce, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.QuakingMirrorForce, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.StarlightRoad, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.HarpiesFeatherDuster, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.DarkHole, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.PotOfDuality, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.CosmicCyclone, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpSummon, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightSummon);
AddExecutor(ExecutorType.Activate, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightEffect);
AddExecutor(ExecutorType.SpSummon, CardId.DarkRebellionXyzDragon, DarkRebellionXyzDragonSummon);
AddExecutor(ExecutorType.Activate, CardId.DarkRebellionXyzDragon, DarkRebellionXyzDragonEffect);
AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiaOne);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.StardustDragon, DefaultStardustDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.StarlightRoad, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.MagicDrain);
AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, CardId.SolemnJudgment, DefaultSolemnJudgment);
AddExecutor(ExecutorType.Activate, CardId.MacroCosmos, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.VanitysEmptiness, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.DrowningMirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.QuakingMirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
public override bool OnSelectHand()
{
// 抢先攻
// go first
return true;
}
public override void OnNewTurn()
{
// 回合开始时重置状况
已发动削命 = false;
CardOfDemiseUsed = false;
}
public override bool OnSelectYesNo(int desc)
{
// 镰贰太刀能不直击就不直击
// Yosenju Kama 2 shouldn't attack directly at most times
if (Card == null)
return true;
Logger.DebugWriteLine(Card.Name);
if (Card.Id == (int)CardId.妖仙兽镰贰太刀)
// Logger.DebugWriteLine(Card.Name);
if (Card.Id == CardId.YosenjuKama2)
return Card.ShouldDirectAttack;
else
return true;
......@@ -183,69 +176,69 @@ namespace WindBot.Game.AI.Decks
if (defender.IsMonsterDangerous() || defender.IsDefense())
return false;
}
if (!(defender.Id == (int)CardId.闪光No39希望皇霍普电光皇))
if (!(defender.Id == CardId.NumberS39UtopiatheLightning))
{
if (attacker.Attribute == (int)CardAttribute.Wind && Bot.HasInHand((int)CardId.妖仙兽辻斩风))
if (attacker.Attribute == (int)CardAttribute.Wind && Bot.HasInHand(CardId.YosenjuTsujik))
attacker.RealPower = attacker.RealPower + 1000;
if (attacker.Id == (int)CardId.闪光No39希望皇霍普电光皇 && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.No39希望皇霍普))
if (attacker.Id == CardId.NumberS39UtopiatheLightning && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, CardId.Number39Utopia))
attacker.RealPower = 5000;
}
return attacker.RealPower > defender.GetDefensePower();
}
private bool 强欲而谦虚之壶()
private bool PotOfDualityEffect()
{
if (已发动削命)
if (CardOfDemiseUsed)
{
AI.SelectCard(new[]
{
(int)CardId.星光大道,
(int)CardId.魔力抽取,
(int)CardId.神之宣告,
(int)CardId.虚无空间,
(int)CardId.鹰身女妖的羽毛扫,
(int)CardId.波纹防护罩波浪之力,
(int)CardId.沙尘防护罩尘埃之力,
(int)CardId.神之通告,
(int)CardId.神之警告,
(int)CardId.大宇宙,
(int)CardId.削命的宝札
CardId.StarlightRoad,
CardId.MagicDrain,
CardId.SolemnJudgment,
CardId.VanitysEmptiness,
CardId.HarpiesFeatherDuster,
CardId.DrowningMirrorForce,
CardId.QuakingMirrorForce,
CardId.SolemnStrike,
CardId.SolemnWarning,
CardId.MacroCosmos,
CardId.CardOfDemise
});
}
else
{
AI.SelectCard(new[]
{
(int)CardId.妖仙兽镰叁太刀,
(int)CardId.妖仙兽镰壹太刀,
(int)CardId.妖仙兽镰贰太刀,
(int)CardId.星光大道,
(int)CardId.魔力抽取,
(int)CardId.虚无空间,
(int)CardId.鹰身女妖的羽毛扫,
(int)CardId.波纹防护罩波浪之力,
(int)CardId.沙尘防护罩尘埃之力,
(int)CardId.神之通告,
(int)CardId.神之宣告,
(int)CardId.神之警告,
(int)CardId.大宇宙,
(int)CardId.削命的宝札,
CardId.YosenjuKama3,
CardId.YosenjuKama1,
CardId.YosenjuKama2,
CardId.StarlightRoad,
CardId.MagicDrain,
CardId.VanitysEmptiness,
CardId.HarpiesFeatherDuster,
CardId.DrowningMirrorForce,
CardId.QuakingMirrorForce,
CardId.SolemnStrike,
CardId.SolemnJudgment,
CardId.SolemnWarning,
CardId.MacroCosmos,
CardId.CardOfDemise,
});
}
return true;
}
private bool 削命的宝札()
private bool CardOfDemiseEffect()
{
if (AI.Utils.IsTurn1OrMain2())
{
已发动削命 = true;
CardOfDemiseUsed = true;
return true;
}
return false;
}
private bool 优先出重复的妖仙兽()
private bool HaveAnotherYosenjuWithSameNameInHand()
{
foreach (ClientCard card in Bot.Hand)
{
......@@ -255,48 +248,47 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 优先盖不重复的坑()
private bool TrapSetUnique()
{
foreach (ClientCard card in Bot.SpellZone)
{
if (card != null && card.Id == Card.Id)
return false;
}
return 魔陷区有空余格子();
return TrapSetWhenZoneFree();
}
private bool 魔陷区有空余格子()
private bool TrapSetWhenZoneFree()
{
return Bot.GetSpellCountWithoutField() < 4;
}
private bool 已发动过削命()
private bool CardOfDemiseAcivated()
{
return 已发动削命;
return CardOfDemiseUsed;
}
private bool 妖仙兽效果()
private bool YosenjuEffect()
{
// 妖仙兽结束阶段不优先回手
// Don't activate the return to hand effect first
if (Duel.Phase == DuelPhase.End)
return false;
AI.SelectCard(new[]
{
(int)CardId.妖仙兽镰壹太刀,
(int)CardId.妖仙兽镰贰太刀,
(int)CardId.妖仙兽镰叁太刀
CardId.YosenjuKama1,
CardId.YosenjuKama2,
CardId.YosenjuKama3
});
return true;
}
private bool 削命的宝札结束阶段()
private bool CardOfDemiseEPEffect()
{
// 削命宝札结束阶段在妖仙回手前丢手卡
Logger.DebugWriteLine("削命的宝札" + (Duel.Phase == DuelPhase.End));
// do the end phase effect of Card Of Demise before Yosenjus return to hand
return Duel.Phase == DuelPhase.End;
}
private bool 我我我枪手特殊召唤()
private bool GagagaCowboySummon()
{
if (Duel.LifePoints[1] <= 800 || (Bot.GetMonsterCount()>=4 && Duel.LifePoints[1] <= 1600))
{
......@@ -306,30 +298,16 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 励辉士入魔蝇王特殊召唤()
{
int selfCount = Bot.GetMonsterCount() + Bot.GetSpellCount() + Bot.GetHandCount();
int oppoCount = Enemy.GetMonsterCount() + Enemy.GetSpellCount() + Enemy.GetHandCount();
return (selfCount - 1 < oppoCount) && 励辉士入魔蝇王效果();
}
private bool 励辉士入魔蝇王效果()
private bool DarkRebellionXyzDragonSummon()
{
int selfCount = Bot.GetMonsterCount() + Bot.GetSpellCount();
int oppoCount = Enemy.GetMonsterCount() + Enemy.GetSpellCount();
return selfCount < oppoCount;
}
private bool 暗叛逆超量龙特殊召唤()
{
int selfBestAttack = AI.Utils.GetBestAttack(Bot, true);
int oppoBestAttack = AI.Utils.GetBestAttack(Enemy, true);
int selfBestAttack = AI.Utils.GetBestAttack(Bot);
int oppoBestAttack = AI.Utils.GetBestAttack(Enemy);
return selfBestAttack <= oppoBestAttack;
}
private bool 暗叛逆超量龙效果()
private bool DarkRebellionXyzDragonEffect()
{
int oppoBestAttack = AI.Utils.GetBestAttack(Enemy, true);
int oppoBestAttack = AI.Utils.GetBestAttack(Enemy);
ClientCard target = AI.Utils.GetOneEnemyBetterThanValue(oppoBestAttack, true);
if (target != null)
{
......@@ -338,17 +316,11 @@ namespace WindBot.Game.AI.Decks
return true;
}
private bool 电光皇特殊召唤()
private bool NumberS39UtopiatheLightningSummon()
{
int selfBestAttack = AI.Utils.GetBestAttack(Bot, true);
int oppoBestAttack = AI.Utils.GetBestAttack(Enemy, false);
int selfBestAttack = AI.Utils.GetBestAttack(Bot);
int oppoBestAttack = AI.Utils.GetBestPower(Enemy);
return selfBestAttack <= oppoBestAttack;
}
private bool 星尘龙效果()
{
return LastChainPlayer == 1;
}
}
}
\ No newline at end of file
......@@ -9,116 +9,116 @@ namespace WindBot.Game.AI.Decks
[Deck("Zexal Weapons", "AI_ZexalWeapons")]
class ZexalWeaponsExecutor : DefaultExecutor
{
public enum CardId
public class CardId
{
CyberDragon = 70095155,
ZwTornadoBringer = 81471108,
ZwLightningBlade = 45082499,
ZwAsuraStrike = 40941889,
SolarWindJammer = 33911264,
PhotonTrasher = 65367484,
StarDrawing = 24610207,
SacredCrane = 30914564,
Goblindbergh = 25259669,
Honest = 37742478,
Kagetokage = 94656263,
HeroicChallengerExtraSword = 34143852,
TinGoldfish = 18063928,
SummonerMonk = 423585,
InstantFusion = 1845204,
Raigeki = 12580477,
ReinforcementOfTheArmy = 32807846,
DarkHole = 53129443,
MysticalSpaceTyphoon = 5318639,
BreakthroughSkill = 78474168,
SolemnWarning = 84749824,
SolemnStrike = 40605147,
XyzChangeTactics = 11705261,
public static int CyberDragon = 70095155;
public static int ZwTornadoBringer = 81471108;
public static int ZwLightningBlade = 45082499;
public static int ZwAsuraStrike = 40941889;
public static int SolarWindJammer = 33911264;
public static int PhotonTrasher = 65367484;
public static int StarDrawing = 24610207;
public static int SacredCrane = 30914564;
public static int Goblindbergh = 25259669;
public static int Honest = 37742478;
public static int Kagetokage = 94656263;
public static int HeroicChallengerExtraSword = 34143852;
public static int TinGoldfish = 18063928;
public static int SummonerMonk = 423585;
public static int InstantFusion = 1845204;
public static int Raigeki = 12580477;
public static int ReinforcementOfTheArmy = 32807846;
public static int DarkHole = 53129443;
public static int MysticalSpaceTyphoon = 5318639;
public static int BreakthroughSkill = 78474168;
public static int SolemnWarning = 84749824;
public static int SolemnStrike = 40605147;
public static int XyzChangeTactics = 11705261;
FlameSwordsman = 45231177,
DarkfireDragon = 17881964,
GaiaDragonTheThunderCharger = 91949988,
ZwLionArms = 60992364,
AdreusKeeperOfArmageddon = 94119480,
Number61Volcasaurus = 29669359,
GemKnightPearl = 71594310,
Number39Utopia = 84013237,
NumberS39UtopiaOne= 86532744,
NumberS39UtopiatheLightning = 56832966,
MaestrokeTheSymphonyDjinn = 25341652,
GagagaCowboy = 12014404
public static int FlameSwordsman = 45231177;
public static int DarkfireDragon = 17881964;
public static int GaiaDragonTheThunderCharger = 91949988;
public static int ZwLionArms = 60992364;
public static int AdreusKeeperOfArmageddon = 94119480;
public static int Number61Volcasaurus = 29669359;
public static int GemKnightPearl = 71594310;
public static int Number39Utopia = 84013237;
public static int NumberS39UtopiaOne = 86532744;
public static int NumberS39UtopiatheLightning = 56832966;
public static int MaestrokeTheSymphonyDjinn = 25341652;
public static int GagagaCowboy = 12014404;
}
public ZexalWeaponsExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
// Quick spells
AddExecutor(ExecutorType.Activate, (int)CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
// Spell cards
AddExecutor(ExecutorType.Activate, (int)CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, (int)CardId.ReinforcementOfTheArmy, ReinforcementOfTheArmy);
AddExecutor(ExecutorType.Activate, (int)CardId.XyzChangeTactics, XyzChangeTactics);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, CardId.ReinforcementOfTheArmy, ReinforcementOfTheArmy);
AddExecutor(ExecutorType.Activate, CardId.XyzChangeTactics, XyzChangeTactics);
// XYZ summons
AddExecutor(ExecutorType.SpSummon, (int)CardId.Number39Utopia);
AddExecutor(ExecutorType.SpSummon, (int)CardId.NumberS39UtopiaOne);
AddExecutor(ExecutorType.SpSummon, (int)CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.SpSummon, (int)CardId.Number61Volcasaurus, Number61Volcasaurus);
AddExecutor(ExecutorType.SpSummon, (int)CardId.ZwLionArms);
AddExecutor(ExecutorType.SpSummon, (int)CardId.AdreusKeeperOfArmageddon);
AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiaOne);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.SpSummon, CardId.Number61Volcasaurus, Number61Volcasaurus);
AddExecutor(ExecutorType.SpSummon, CardId.ZwLionArms);
AddExecutor(ExecutorType.SpSummon, CardId.AdreusKeeperOfArmageddon);
// XYZ effects
AddExecutor(ExecutorType.Activate, (int)CardId.Number39Utopia, Number39Utopia);
AddExecutor(ExecutorType.Activate, (int)CardId.NumberS39UtopiaOne);
AddExecutor(ExecutorType.Activate, (int)CardId.NumberS39UtopiatheLightning, NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, (int)CardId.ZwLionArms, ZwLionArms);
AddExecutor(ExecutorType.Activate, (int)CardId.AdreusKeeperOfArmageddon);
AddExecutor(ExecutorType.Activate, (int)CardId.Number61Volcasaurus);
AddExecutor(ExecutorType.Activate, CardId.Number39Utopia, Number39Utopia);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiaOne);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning, NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.ZwLionArms, ZwLionArms);
AddExecutor(ExecutorType.Activate, CardId.AdreusKeeperOfArmageddon);
AddExecutor(ExecutorType.Activate, CardId.Number61Volcasaurus);
// Weapons
AddExecutor(ExecutorType.Activate, (int)CardId.ZwTornadoBringer);
AddExecutor(ExecutorType.Activate, (int)CardId.ZwLightningBlade);
AddExecutor(ExecutorType.Activate, (int)CardId.ZwAsuraStrike);
AddExecutor(ExecutorType.Activate, CardId.ZwTornadoBringer);
AddExecutor(ExecutorType.Activate, CardId.ZwLightningBlade);
AddExecutor(ExecutorType.Activate, CardId.ZwAsuraStrike);
// Special summons
AddExecutor(ExecutorType.SpSummon, (int)CardId.PhotonTrasher);
AddExecutor(ExecutorType.SpSummon, (int)CardId.CyberDragon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.SolarWindJammer, SolarWindJammer);
AddExecutor(ExecutorType.SpSummon, CardId.PhotonTrasher);
AddExecutor(ExecutorType.SpSummon, CardId.CyberDragon);
AddExecutor(ExecutorType.SpSummon, CardId.SolarWindJammer, SolarWindJammer);
AddExecutor(ExecutorType.Activate, (int)CardId.InstantFusion, InstantFusion);
AddExecutor(ExecutorType.Activate, CardId.InstantFusion, InstantFusion);
// Normal summons
AddExecutor(ExecutorType.Summon, (int)CardId.Goblindbergh, GoblindberghFirst);
AddExecutor(ExecutorType.Summon, (int)CardId.TinGoldfish, GoblindberghFirst);
AddExecutor(ExecutorType.Summon, (int)CardId.StarDrawing);
AddExecutor(ExecutorType.Summon, (int)CardId.SacredCrane);
AddExecutor(ExecutorType.Summon, (int)CardId.HeroicChallengerExtraSword);
AddExecutor(ExecutorType.Summon, (int)CardId.Goblindbergh);
AddExecutor(ExecutorType.Summon, (int)CardId.TinGoldfish);
AddExecutor(ExecutorType.Summon, (int)CardId.SummonerMonk);
AddExecutor(ExecutorType.Summon, CardId.Goblindbergh, GoblindberghFirst);
AddExecutor(ExecutorType.Summon, CardId.TinGoldfish, GoblindberghFirst);
AddExecutor(ExecutorType.Summon, CardId.StarDrawing);
AddExecutor(ExecutorType.Summon, CardId.SacredCrane);
AddExecutor(ExecutorType.Summon, CardId.HeroicChallengerExtraSword);
AddExecutor(ExecutorType.Summon, CardId.Goblindbergh);
AddExecutor(ExecutorType.Summon, CardId.TinGoldfish);
AddExecutor(ExecutorType.Summon, CardId.SummonerMonk);
// Summons: Effects
AddExecutor(ExecutorType.Activate, (int)CardId.Goblindbergh, GoblindberghEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.TinGoldfish, GoblindberghEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.Kagetokage);
AddExecutor(ExecutorType.Activate, (int)CardId.SummonerMonk, SummonerMonkEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.Honest, Honest);
AddExecutor(ExecutorType.Activate, CardId.Goblindbergh, GoblindberghEffect);
AddExecutor(ExecutorType.Activate, CardId.TinGoldfish, GoblindberghEffect);
AddExecutor(ExecutorType.Activate, CardId.Kagetokage);
AddExecutor(ExecutorType.Activate, CardId.SummonerMonk, SummonerMonkEffect);
AddExecutor(ExecutorType.Activate, CardId.Honest, Honest);
// Reposition
AddExecutor(ExecutorType.Repos, MonsterRepos);
// Spummon GaiaDragonTheThunderCharger if Volcasaurus or ZwLionArms had been used
AddExecutor(ExecutorType.SpSummon, (int)CardId.GaiaDragonTheThunderCharger);
AddExecutor(ExecutorType.SpSummon, CardId.GaiaDragonTheThunderCharger);
// Set and activate traps
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, (int)CardId.BreakthroughSkill, DefaultBreakthroughSkill);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, CardId.BreakthroughSkill, DefaultBreakthroughSkill);
AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
}
public override bool OnSelectHand()
......@@ -133,11 +133,11 @@ namespace WindBot.Game.AI.Decks
if (defender.IsMonsterDangerous() || defender.IsDefense())
return false;
}
if (!(defender.Id == (int)CardId.NumberS39UtopiatheLightning))
if (!(defender.Id == CardId.NumberS39UtopiatheLightning))
{
if (attacker.Attribute == (int)CardAttribute.Light && Bot.HasInHand((int)CardId.Honest))
if (attacker.Attribute == (int)CardAttribute.Light && Bot.HasInHand(CardId.Honest))
attacker.RealPower = attacker.RealPower + defender.Attack;
if (attacker.Id == (int)CardId.NumberS39UtopiatheLightning && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.Number39Utopia))
if (attacker.Id == CardId.NumberS39UtopiatheLightning && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, CardId.Number39Utopia))
attacker.RealPower = 5000;
}
return attacker.RealPower > defender.GetDefensePower();
......@@ -157,9 +157,9 @@ namespace WindBot.Game.AI.Decks
private bool ZwLionArms()
{
if (ActivateDescription == AI.Utils.GetStringId((int)CardId.ZwLionArms, 0))
if (ActivateDescription == AI.Utils.GetStringId(CardId.ZwLionArms, 0))
return true;
if (ActivateDescription == AI.Utils.GetStringId((int)CardId.ZwLionArms, 1))
if (ActivateDescription == AI.Utils.GetStringId(CardId.ZwLionArms, 1))
return !Card.IsDisabled();
return false;
}
......@@ -168,11 +168,11 @@ namespace WindBot.Game.AI.Decks
{
AI.SelectCard(new[]
{
(int)CardId.Goblindbergh,
(int)CardId.TinGoldfish,
(int)CardId.StarDrawing,
(int)CardId.Kagetokage,
(int)CardId.SacredCrane
CardId.Goblindbergh,
CardId.TinGoldfish,
CardId.StarDrawing,
CardId.Kagetokage,
CardId.SacredCrane
});
return true;
}
......@@ -193,12 +193,12 @@ namespace WindBot.Game.AI.Decks
}
if (count5 == 1)
{
AI.SelectCard((int)CardId.FlameSwordsman);
AI.SelectCard(CardId.FlameSwordsman);
return true;
}
else if (count4 == 1)
{
AI.SelectCard((int)CardId.DarkfireDragon);
AI.SelectCard(CardId.DarkfireDragon);
return true;
}
return false;
......@@ -234,33 +234,33 @@ namespace WindBot.Game.AI.Decks
{
AI.SelectCard(new[]
{
(int)CardId.SacredCrane,
(int)CardId.HeroicChallengerExtraSword,
(int)CardId.StarDrawing,
(int)CardId.SummonerMonk
CardId.SacredCrane,
CardId.HeroicChallengerExtraSword,
CardId.StarDrawing,
CardId.SummonerMonk
});
return true;
}
private bool SummonerMonkEffect()
{
if (Bot.HasInHand((int)CardId.InstantFusion) ||
Bot.HasInHand((int)CardId.MysticalSpaceTyphoon))
if (Bot.HasInHand(CardId.InstantFusion) ||
Bot.HasInHand(CardId.MysticalSpaceTyphoon))
{
AI.SelectCard(new[]
{
(int)CardId.InstantFusion,
(int)CardId.MysticalSpaceTyphoon
CardId.InstantFusion,
CardId.MysticalSpaceTyphoon
});
return true;
}
AI.SelectNextCard(new[]
{
(int)CardId.Goblindbergh,
(int)CardId.TinGoldfish,
(int)CardId.StarDrawing,
(int)CardId.Kagetokage,
(int)CardId.SacredCrane
CardId.Goblindbergh,
CardId.TinGoldfish,
CardId.StarDrawing,
CardId.Kagetokage,
CardId.SacredCrane
});
return false;
}
......@@ -268,8 +268,8 @@ namespace WindBot.Game.AI.Decks
private bool SolarWindJammer()
{
if (!Bot.HasInHand(new List<int> {
(int)CardId.StarDrawing,
(int)CardId.InstantFusion
CardId.StarDrawing,
CardId.InstantFusion
}))
return false;
AI.SelectPosition(CardPosition.FaceUpDefence);
......@@ -278,7 +278,7 @@ namespace WindBot.Game.AI.Decks
private bool MonsterRepos()
{
if (Card.Id == (int)CardId.NumberS39UtopiatheLightning)
if (Card.Id == CardId.NumberS39UtopiatheLightning)
return false;
return base.DefaultMonsterRepos();
}
......
......@@ -6,127 +6,129 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Zoodiac", "AI_Zoodiac")]
[Deck("Zoodiac", "AI_Zoodiac", "OutDated")]
class ZoodiacExecutor : DefaultExecutor
{
public enum CardId
{
坏星坏兽席兹奇埃鲁 = 63941210,
怪粉坏兽加达拉 = 36956512,
海龟坏兽加美西耶勒 = 55063751,
多次元坏兽拉迪安 = 28674152,
黏丝坏兽库莫古斯 = 29726552,
光子斩击者 = 65367484,
十二兽马剑 = 77150143,
十二兽蛇笞 = 31755044,
召唤师阿莱斯特 = 86120751,
十二兽鼠骑 = 78872731,
鹰身女妖的羽毛扫 = 18144506,
黑洞 = 53129443,
星球改造 = 73628505,
召唤魔术 = 74063034,
死者苏生 = 83764718,
遭受妨碍的坏兽安眠 = 99330325,
十二兽的会局 = 46060017,
炎舞天玑 = 57103969,
暴走魔法阵 = 47679935,
十二兽的方合 = 73881652,
召唤兽梅尔卡巴 = 75286621,
召唤兽墨瓦腊泥加 = 48791583,
闪光No39希望皇霍普电光皇 = 56832966,
No39希望皇霍普 = 84013237,
大薰风骑士翠玉 = 581014,
十二兽虎炮 = 11510448,
十二兽狗环 = 41375811,
十二兽龙枪 = 48905153,
十二兽牛犄 = 85115440
}
bool 已特殊召唤虎炮 = false;
bool 已特殊召唤狗环 = false;
bool 已特殊召唤牛犄 = false;
int 蛇笞发动次数 = 0;
public class CardId
{
public static int JizukirutheStarDestroyingKaiju = 63941210;
public static int GadarlatheMysteryDustKaiju = 36956512;
public static int GamecieltheSeaTurtleKaiju = 55063751;
public static int RadiantheMultidimensionalKaiju = 28674152;
public static int KumongoustheStickyStringKaiju = 29726552;
public static int PhotonThrasher = 65367484;
public static int Thoroughblade = 77150143;
public static int Whiptail = 31755044;
public static int Ratpier = 78872731;
public static int AleisterTheInvoker = 86120751;
public static int HarpiesFeatherDuster = 18144506;
public static int DarkHole = 53129443;
public static int Terraforming = 73628505;
public static int Invocation = 74063034;
public static int MonsterReborn = 83764718;
public static int InterruptedKaijuSlumber = 99330325;
public static int ZoodiacBarrage = 46060017;
public static int FireFormationTenki = 57103969;
public static int MagicalMeltdown = 47679935;
public static int ZoodiacCombo = 73881652;
public static int InvokedMechaba = 75286621;
public static int InvokedMagellanica = 48791583;
public static int NumberS39UtopiatheLightning = 56832966;
public static int Number39Utopia = 84013237;
public static int DaigustoEmeral = 581014;
public static int Tigermortar = 11510448;
public static int Chakanine = 41375811;
public static int Drident = 48905153;
public static int Broadbull = 85115440;
}
bool TigermortarSpsummoned = false;
bool ChakanineSpsummoned = false;
bool BroadbullSpsummoned = false;
int WhiptailEffectCount = 0;
public ZoodiacExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
// Quick spells
AddExecutor(ExecutorType.Activate, (int)CardId.鹰身女妖的羽毛扫);
AddExecutor(ExecutorType.Activate, (int)CardId.遭受妨碍的坏兽安眠, DefaultInterruptedKaijuSlumber);
AddExecutor(ExecutorType.Activate, (int)CardId.黑洞, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, CardId.InterruptedKaijuSlumber, DefaultInterruptedKaijuSlumber);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.SpSummon, (int)CardId.海龟坏兽加美西耶勒, DefaultKaijuSpsummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.黏丝坏兽库莫古斯, DefaultKaijuSpsummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.怪粉坏兽加达拉, DefaultKaijuSpsummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.多次元坏兽拉迪安, DefaultKaijuSpsummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.坏星坏兽席兹奇埃鲁, DefaultKaijuSpsummon);
AddExecutor(ExecutorType.SpSummon, CardId.GamecieltheSeaTurtleKaiju, DefaultKaijuSpsummon);
AddExecutor(ExecutorType.SpSummon, CardId.KumongoustheStickyStringKaiju, DefaultKaijuSpsummon);
AddExecutor(ExecutorType.SpSummon, CardId.GadarlatheMysteryDustKaiju, DefaultKaijuSpsummon);
AddExecutor(ExecutorType.SpSummon, CardId.RadiantheMultidimensionalKaiju, DefaultKaijuSpsummon);
AddExecutor(ExecutorType.SpSummon, CardId.JizukirutheStarDestroyingKaiju, DefaultKaijuSpsummon);
AddExecutor(ExecutorType.Activate, (int)CardId.星球改造);
AddExecutor(ExecutorType.Activate, (int)CardId.暴走魔法阵);
AddExecutor(ExecutorType.Activate, (int)CardId.炎舞天玑, 炎舞天玑效果);
AddExecutor(ExecutorType.Activate, (int)CardId.十二兽的会局, 十二兽的会局效果);
AddExecutor(ExecutorType.Activate, (int)CardId.大薰风骑士翠玉);
AddExecutor(ExecutorType.Activate, CardId.Terraforming);
AddExecutor(ExecutorType.Activate, CardId.MagicalMeltdown);
AddExecutor(ExecutorType.Activate, CardId.FireFormationTenki, FireFormationTenkiEffect);
AddExecutor(ExecutorType.Activate, CardId.ZoodiacBarrage, ZoodiacBarrageEffect);
AddExecutor(ExecutorType.Activate, CardId.DaigustoEmeral, DaigustoEmeralEffect);
AddExecutor(ExecutorType.SpSummon, (int)CardId.光子斩击者, 光子斩击者特殊召唤);
AddExecutor(ExecutorType.SpSummon, CardId.PhotonThrasher, PhotonThrasherSummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.No39希望皇霍普, 电光皇特殊召唤);
AddExecutor(ExecutorType.SpSummon, (int)CardId.闪光No39希望皇霍普电光皇);
AddExecutor(ExecutorType.Activate, (int)CardId.闪光No39希望皇霍普电光皇);
AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, (int)CardId.召唤兽梅尔卡巴, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.InvokedMechaba, DefaultTrap);
AddExecutor(ExecutorType.Activate, 十二兽鼠骑素材效果);
AddExecutor(ExecutorType.Activate, RatpierMaterialEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.十二兽龙枪, 十二兽龙枪效果);
AddExecutor(ExecutorType.Activate, (int)CardId.十二兽牛犄, 十二兽牛犄效果);
AddExecutor(ExecutorType.Activate, (int)CardId.十二兽虎炮, 十二兽虎炮效果);
AddExecutor(ExecutorType.Activate, (int)CardId.十二兽狗环, 十二兽狗环效果);
AddExecutor(ExecutorType.Activate, CardId.Drident, DridentEffect);
AddExecutor(ExecutorType.Activate, CardId.Broadbull, BroadbullEffect);
AddExecutor(ExecutorType.Activate, CardId.Tigermortar, TigermortarEffect);
AddExecutor(ExecutorType.Activate, CardId.Chakanine, ChakanineEffect);
AddExecutor(ExecutorType.SpSummon, (int)CardId.十二兽狗环, 十二兽狗环特殊召唤);
AddExecutor(ExecutorType.SpSummon, (int)CardId.十二兽虎炮, 十二兽虎炮特殊召唤);
AddExecutor(ExecutorType.SpSummon, (int)CardId.十二兽牛犄, 十二兽牛犄特殊召唤);
AddExecutor(ExecutorType.SpSummon, (int)CardId.十二兽龙枪, 十二兽龙枪特殊召唤);
AddExecutor(ExecutorType.SpSummon, CardId.Chakanine, ChakanineSummon);
AddExecutor(ExecutorType.SpSummon, CardId.Tigermortar, TigermortarSummon);
AddExecutor(ExecutorType.SpSummon, CardId.Broadbull, BroadbullSummon);
AddExecutor(ExecutorType.SpSummon, CardId.Drident, DridentSummon);
AddExecutor(ExecutorType.Summon, (int)CardId.十二兽鼠骑);
AddExecutor(ExecutorType.Activate, (int)CardId.十二兽鼠骑, 十二兽鼠骑效果);
AddExecutor(ExecutorType.Summon, (int)CardId.十二兽马剑);
AddExecutor(ExecutorType.Activate, (int)CardId.十二兽马剑, 十二兽鼠骑效果);
AddExecutor(ExecutorType.Summon, (int)CardId.召唤师阿莱斯特);
AddExecutor(ExecutorType.Activate, (int)CardId.召唤师阿莱斯特, 召唤师阿莱斯特效果);
AddExecutor(ExecutorType.Summon, CardId.Ratpier);
AddExecutor(ExecutorType.Activate, CardId.Ratpier, RatpierEffect);
AddExecutor(ExecutorType.Summon, CardId.Thoroughblade);
AddExecutor(ExecutorType.Activate, CardId.Thoroughblade, RatpierEffect);
AddExecutor(ExecutorType.Summon, CardId.AleisterTheInvoker);
AddExecutor(ExecutorType.Activate, CardId.AleisterTheInvoker, AleisterTheInvokerEffect);
AddExecutor(ExecutorType.SpSummon, (int)CardId.大薰风骑士翠玉, 大薰风骑士翠玉特殊召唤);
AddExecutor(ExecutorType.SpSummon, CardId.DaigustoEmeral, DaigustoEmeralSummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.十二兽牛犄, 十二兽牛犄超量召唤);
AddExecutor(ExecutorType.SpSummon, CardId.Broadbull, BroadbullXYZSummon);
AddExecutor(ExecutorType.Activate, (int)CardId.死者苏生, 死者苏生效果);
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, MonsterRebornEffect);
AddExecutor(ExecutorType.SpSummon, (int)CardId.光子斩击者);
AddExecutor(ExecutorType.Summon, (int)CardId.十二兽蛇笞);
AddExecutor(ExecutorType.SpSummon, CardId.PhotonThrasher);
AddExecutor(ExecutorType.Summon, CardId.Whiptail);
AddExecutor(ExecutorType.Activate, (int)CardId.召唤魔术, 召唤魔术效果);
AddExecutor(ExecutorType.Activate, CardId.Invocation, InvocationEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.十二兽蛇笞, 十二兽蛇笞效果);
AddExecutor(ExecutorType.Activate, CardId.Whiptail, WhiptailEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.十二兽的方合, 十二兽的方合效果);
AddExecutor(ExecutorType.Activate, CardId.ZoodiacCombo, ZoodiacComboEffect);
AddExecutor(ExecutorType.SpellSet, (int)CardId.十二兽的方合);
AddExecutor(ExecutorType.SpellSet, CardId.ZoodiacCombo);
AddExecutor(ExecutorType.Repos, MonsterRepos);
}
public override bool OnSelectHand()
{
// 抢先攻
// go first
return true;
}
public override void OnNewTurn()
{
// 回合开始时重置状况
已特殊召唤虎炮 = false;
已特殊召唤狗环 = false;
已特殊召唤牛犄 = false;
蛇笞发动次数 = 0;
// reset
TigermortarSpsummoned = false;
ChakanineSpsummoned = false;
BroadbullSpsummoned = false;
WhiptailEffectCount = 0;
}
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
......@@ -136,32 +138,24 @@ namespace WindBot.Game.AI.Decks
if (defender.IsMonsterDangerous() || defender.IsDefense())
return false;
}
if (!(defender.Id == (int)CardId.闪光No39希望皇霍普电光皇))
if (!(defender.Id == CardId.NumberS39UtopiatheLightning))
{
//if (attacker.HasType(CardType.Fusion) && Bot.HasInHand((int)CardId.召唤师阿莱斯特))
//if (attacker.HasType(CardType.Fusion) && Bot.HasInHand(CardId.AleisterTheInvoker))
// attacker.RealPower = attacker.RealPower + 1000;
if (attacker.Id == (int)CardId.闪光No39希望皇霍普电光皇 && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.No39希望皇霍普))
if (attacker.Id == CardId.NumberS39UtopiatheLightning && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, CardId.Number39Utopia))
attacker.RealPower = 5000;
}
return attacker.RealPower > defender.GetDefensePower();
}
private bool 电光皇特殊召唤()
{
int selfBestAttack = AI.Utils.GetBestAttack(Bot, true);
int oppoBestAttack = AI.Utils.GetBestAttack(Enemy, false);
return selfBestAttack < oppoBestAttack;
}
private bool 光子斩击者特殊召唤()
private bool PhotonThrasherSummon()
{
return Bot.HasInHand((int)CardId.召唤师阿莱斯特)
&& !Bot.HasInHand((int)CardId.十二兽鼠骑)
&& !Bot.HasInHand((int)CardId.十二兽马剑);
return Bot.HasInHand(CardId.AleisterTheInvoker)
&& !Bot.HasInHand(CardId.Ratpier)
&& !Bot.HasInHand(CardId.Thoroughblade);
}
private bool 召唤师阿莱斯特效果()
private bool AleisterTheInvokerEffect()
{
if (Card.Location == CardLocation.Hand)
{
......@@ -170,12 +164,12 @@ namespace WindBot.Game.AI.Decks
|| Duel.Phase == DuelPhase.Damage))
return false;
return Duel.Player==0
|| AI.Utils.IsEnemyBetter(false, false);
|| AI.Utils.IsOneEnemyBetter();
}
return true;
}
private bool 召唤魔术效果()
private bool InvocationEffect()
{
if (Card.Location == CardLocation.Grave)
return true;
......@@ -200,8 +194,8 @@ namespace WindBot.Game.AI.Decks
}
if (mat != null)
{
AI.SelectCard((int)CardId.召唤兽梅尔卡巴);
选择墓地里的召唤师();
AI.SelectCard(CardId.InvokedMechaba);
SelectAleisterInGrave();
AI.SelectThirdCard(mat);
AI.SelectPosition(CardPosition.FaceUpAttack);
return true;
......@@ -224,8 +218,8 @@ namespace WindBot.Game.AI.Decks
}
if (mat != null)
{
AI.SelectCard((int)CardId.召唤兽墨瓦腊泥加);
选择墓地里的召唤师();
AI.SelectCard(CardId.InvokedMagellanica);
SelectAleisterInGrave();
AI.SelectThirdCard(mat);
AI.SelectPosition(CardPosition.FaceUpAttack);
return true;
......@@ -233,13 +227,13 @@ namespace WindBot.Game.AI.Decks
return false;
}
private void 选择墓地里的召唤师()
private void SelectAleisterInGrave()
{
IList<ClientCard> materials0 = Bot.Graveyard;
IList<ClientCard> materials1 = Enemy.Graveyard;
foreach (ClientCard card in materials1)
{
if (card.Id == (int)CardId.召唤师阿莱斯特)
if (card.Id == CardId.AleisterTheInvoker)
{
AI.SelectNextCard(card);
return;
......@@ -247,198 +241,198 @@ namespace WindBot.Game.AI.Decks
}
foreach (ClientCard card in materials0)
{
if (card.Id == (int)CardId.召唤师阿莱斯特)
if (card.Id == CardId.AleisterTheInvoker)
{
AI.SelectNextCard(card);
return;
}
}
AI.SelectNextCard((int)CardId.召唤师阿莱斯特);
AI.SelectNextCard(CardId.AleisterTheInvoker);
}
private bool 十二兽狗环特殊召唤()
private bool ChakanineSummon()
{
if (Bot.HasInMonstersZone((int)CardId.十二兽鼠骑) && !已特殊召唤狗环)
if (Bot.HasInMonstersZone(CardId.Ratpier) && !ChakanineSpsummoned)
{
AI.SelectCard((int)CardId.十二兽鼠骑);
AI.SelectCard(CardId.Ratpier);
AI.SelectYesNo(true);
AI.SelectPosition(CardPosition.FaceUpDefence);
已特殊召唤狗环 = true;
ChakanineSpsummoned = true;
return true;
}
if (Bot.HasInMonstersZone((int)CardId.十二兽牛犄) && !已特殊召唤狗环)
if (Bot.HasInMonstersZone(CardId.Broadbull) && !ChakanineSpsummoned)
{
AI.SelectCard((int)CardId.十二兽牛犄);
AI.SelectCard(CardId.Broadbull);
AI.SelectYesNo(true);
AI.SelectPosition(CardPosition.FaceUpDefence);
已特殊召唤狗环 = true;
ChakanineSpsummoned = true;
return true;
}
return false;
}
private bool 十二兽狗环效果()
private bool ChakanineEffect()
{
if (Bot.HasInGraveyard((int)CardId.十二兽蛇笞) || Bot.HasInGraveyard((int)CardId.十二兽马剑))
if (Bot.HasInGraveyard(CardId.Whiptail) || Bot.HasInGraveyard(CardId.Thoroughblade))
{
AI.SelectCard(new[]
{
(int)CardId.十二兽牛犄,
(int)CardId.十二兽虎炮,
(int)CardId.十二兽狗环,
(int)CardId.十二兽马剑,
(int)CardId.十二兽鼠骑,
(int)CardId.十二兽蛇笞
CardId.Broadbull,
CardId.Tigermortar,
CardId.Chakanine,
CardId.Thoroughblade,
CardId.Ratpier,
CardId.Whiptail
});
AI.SelectNextCard(new[]
{
(int)CardId.十二兽蛇笞,
(int)CardId.十二兽马剑
CardId.Whiptail,
CardId.Thoroughblade
});
return true;
}
return false;
}
private bool 十二兽虎炮特殊召唤()
private bool TigermortarSummon()
{
if (Bot.HasInMonstersZone((int)CardId.十二兽狗环) && !已特殊召唤虎炮)
if (Bot.HasInMonstersZone(CardId.Chakanine) && !TigermortarSpsummoned)
{
AI.SelectCard((int)CardId.十二兽狗环);
AI.SelectCard(CardId.Chakanine);
AI.SelectYesNo(true);
AI.SelectPosition(CardPosition.FaceUpDefence);
已特殊召唤虎炮 = true;
TigermortarSpsummoned = true;
return true;
}
if (Bot.HasInMonstersZone((int)CardId.十二兽鼠骑) && !已特殊召唤虎炮)
if (Bot.HasInMonstersZone(CardId.Ratpier) && !TigermortarSpsummoned)
{
AI.SelectCard((int)CardId.十二兽鼠骑);
AI.SelectCard(CardId.Ratpier);
AI.SelectYesNo(true);
AI.SelectPosition(CardPosition.FaceUpDefence);
已特殊召唤虎炮 = true;
TigermortarSpsummoned = true;
return true;
}
if (Bot.HasInMonstersZone((int)CardId.十二兽马剑) && !已特殊召唤虎炮
if (Bot.HasInMonstersZone(CardId.Thoroughblade) && !TigermortarSpsummoned
&& Bot.HasInGraveyard(new List<int>
{
(int)CardId.十二兽蛇笞,
(int)CardId.十二兽鼠骑
CardId.Whiptail,
CardId.Ratpier
}))
{
AI.SelectCard((int)CardId.十二兽马剑);
AI.SelectCard(CardId.Thoroughblade);
AI.SelectYesNo(true);
已特殊召唤虎炮 = true;
TigermortarSpsummoned = true;
return true;
}
if (Bot.HasInMonstersZone((int)CardId.十二兽蛇笞) && !已特殊召唤虎炮
&& Bot.HasInGraveyard((int)CardId.十二兽鼠骑))
if (Bot.HasInMonstersZone(CardId.Whiptail) && !TigermortarSpsummoned
&& Bot.HasInGraveyard(CardId.Ratpier))
{
AI.SelectCard((int)CardId.十二兽蛇笞);
AI.SelectCard(CardId.Whiptail);
AI.SelectYesNo(true);
已特殊召唤虎炮 = true;
TigermortarSpsummoned = true;
return true;
}
return false;
}
private bool 十二兽虎炮效果()
private bool TigermortarEffect()
{
//if (Card.HasXyzMaterial((int)CardId.十二兽鼠骑) || !Bot.HasInGraveyard((int)CardId.十二兽鼠骑))
//if (Card.HasXyzMaterial(CardId.Ratpier) || !Bot.HasInGraveyard(CardId.Ratpier))
// return false;
AI.SelectCard((int)CardId.十二兽狗环);
AI.SelectNextCard((int)CardId.十二兽虎炮);
AI.SelectCard(CardId.Chakanine);
AI.SelectNextCard(CardId.Tigermortar);
AI.SelectThirdCard(new[]
{
(int)CardId.十二兽鼠骑,
(int)CardId.十二兽蛇笞,
(int)CardId.十二兽马剑
CardId.Ratpier,
CardId.Whiptail,
CardId.Thoroughblade
});
return true;
}
private bool 十二兽牛犄特殊召唤()
private bool BroadbullSummon()
{
if (Bot.HasInMonstersZone((int)CardId.十二兽虎炮) && !已特殊召唤牛犄)
if (Bot.HasInMonstersZone(CardId.Tigermortar) && !BroadbullSpsummoned)
{
AI.SelectCard((int)CardId.十二兽虎炮);
AI.SelectCard(CardId.Tigermortar);
AI.SelectYesNo(true);
AI.SelectPosition(CardPosition.FaceUpDefence);
已特殊召唤牛犄 = true;
BroadbullSpsummoned = true;
return true;
}
if (Bot.HasInMonstersZone((int)CardId.十二兽狗环) && !已特殊召唤牛犄)
if (Bot.HasInMonstersZone(CardId.Chakanine) && !BroadbullSpsummoned)
{
AI.SelectCard((int)CardId.十二兽狗环);
AI.SelectCard(CardId.Chakanine);
AI.SelectYesNo(true);
AI.SelectPosition(CardPosition.FaceUpDefence);
已特殊召唤牛犄 = true;
BroadbullSpsummoned = true;
return true;
}
if (Bot.HasInMonstersZone((int)CardId.十二兽鼠骑) && !已特殊召唤牛犄)
if (Bot.HasInMonstersZone(CardId.Ratpier) && !BroadbullSpsummoned)
{
AI.SelectCard((int)CardId.十二兽鼠骑);
AI.SelectCard(CardId.Ratpier);
AI.SelectYesNo(true);
AI.SelectPosition(CardPosition.FaceUpDefence);
已特殊召唤牛犄 = true;
BroadbullSpsummoned = true;
return true;
}
if (Bot.HasInMonstersZone((int)CardId.十二兽马剑) && !已特殊召唤牛犄)
if (Bot.HasInMonstersZone(CardId.Thoroughblade) && !BroadbullSpsummoned)
{
AI.SelectCard((int)CardId.十二兽马剑);
AI.SelectCard(CardId.Thoroughblade);
AI.SelectYesNo(true);
AI.SelectPosition(CardPosition.FaceUpDefence);
已特殊召唤牛犄 = true;
BroadbullSpsummoned = true;
return true;
}
return false;
}
private bool 十二兽牛犄效果()
private bool BroadbullEffect()
{
AI.SelectCard(new[]
{
(int)CardId.十二兽虎炮,
(int)CardId.十二兽狗环,
(int)CardId.十二兽龙枪,
(int)CardId.召唤师阿莱斯特,
(int)CardId.光子斩击者
CardId.Tigermortar,
CardId.Chakanine,
CardId.Drident,
CardId.AleisterTheInvoker,
CardId.PhotonThrasher
});
if (Bot.HasInHand((int)CardId.十二兽蛇笞) && !Bot.HasInHand((int)CardId.十二兽鼠骑))
AI.SelectNextCard((int)CardId.十二兽鼠骑);
if (Bot.HasInHand(CardId.Whiptail) && !Bot.HasInHand(CardId.Ratpier))
AI.SelectNextCard(CardId.Ratpier);
else
AI.SelectNextCard((int)CardId.十二兽蛇笞);
AI.SelectNextCard(CardId.Whiptail);
return true;
}
private bool 十二兽牛犄超量召唤()
private bool BroadbullXYZSummon()
{
AI.SelectYesNo(false);
AI.SelectPosition(CardPosition.FaceUpDefence);
AI.SelectCard(new[]
{
(int)CardId.十二兽鼠骑,
(int)CardId.光子斩击者,
(int)CardId.十二兽蛇笞,
(int)CardId.召唤师阿莱斯特
CardId.Ratpier,
CardId.PhotonThrasher,
CardId.Whiptail,
CardId.AleisterTheInvoker
});
return true;
}
private bool 十二兽龙枪特殊召唤()
private bool DridentSummon()
{
AI.SelectCard(new[]
{
(int)CardId.十二兽牛犄,
(int)CardId.十二兽虎炮,
(int)CardId.十二兽狗环,
(int)CardId.十二兽马剑
CardId.Broadbull,
CardId.Tigermortar,
CardId.Chakanine,
CardId.Thoroughblade
});
return true;
}
private bool 十二兽鼠骑素材效果()
private bool RatpierMaterialEffect()
{
if (ActivateDescription == AI.Utils.GetStringId((int)CardId.十二兽鼠骑, 1))
if (ActivateDescription == AI.Utils.GetStringId(CardId.Ratpier, 1))
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
......@@ -446,17 +440,17 @@ namespace WindBot.Game.AI.Decks
return false;
}
private bool 十二兽蛇笞效果()
private bool WhiptailEffect()
{
if (Duel.Phase == DuelPhase.Main1 || Duel.Phase == DuelPhase.Main2)
return false;
if (Card.IsDisabled() || 蛇笞发动次数 >= 3)
if (Card.IsDisabled() || WhiptailEffectCount >= 3)
return false;
ClientCard target = null;
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (monster.IsFaceup() && monster.Id == (int)CardId.十二兽龙枪 && !monster.HasXyzMaterial())
if (monster.IsFaceup() && monster.Id == CardId.Drident && !monster.HasXyzMaterial())
{
target = monster;
break;
......@@ -466,7 +460,7 @@ namespace WindBot.Game.AI.Decks
{
foreach (ClientCard monster in monsters)
{
if (monster.IsFaceup() && monster.Type == (int)CardType.Xyz && monster.Id != (int)CardId.大薰风骑士翠玉 && !monster.HasXyzMaterial())
if (monster.IsFaceup() && monster.Type == (int)CardType.Xyz && monster.Id != CardId.DaigustoEmeral && !monster.HasXyzMaterial())
{
target = monster;
break;
......@@ -477,180 +471,141 @@ namespace WindBot.Game.AI.Decks
{
AI.SelectCard(new[]
{
(int)CardId.十二兽龙枪
CardId.Drident
});
}
蛇笞发动次数++;
WhiptailEffectCount++;
return true;
}
private bool 十二兽鼠骑效果()
private bool RatpierEffect()
{
AI.SelectCard(new[]
{
(int)CardId.十二兽的方合,
(int)CardId.十二兽马剑,
(int)CardId.十二兽的会局
CardId.ZoodiacCombo,
CardId.Thoroughblade,
CardId.ZoodiacBarrage
});
return true;
}
private bool 十二兽龙枪效果()
private bool DridentEffect()
{
if (LastChainPlayer == 0)
return false;
ClientCard target = AI.Utils.GetProblematicCard();
if (target == null)
{
List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (monster.IsFaceup())
{
target=monster;
break;
}
}
}
if (target == null)
{
List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells)
{
if (spell.IsFaceup() && spell.IsSpellNegateAttack())
{
target = spell;
break;
}
}
}
if (target == null)
{
List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells)
{
if (spell.IsFaceup() && (spell.HasType(CardType.Continuous)
|| spell.HasType(CardType.Equip)
|| spell.HasType(CardType.Field)
|| spell.HasType(CardType.Pendulum)))
{
target = spell;
break;
}
}
}
ClientCard target = AI.Utils.GetBestEnemyCard(true);
if (target == null)
return false;
AI.SelectCard(new[]
{
(int)CardId.十二兽牛犄,
(int)CardId.十二兽虎炮,
(int)CardId.十二兽狗环,
(int)CardId.十二兽马剑,
(int)CardId.十二兽鼠骑,
(int)CardId.十二兽蛇笞
CardId.Broadbull,
CardId.Tigermortar,
CardId.Chakanine,
CardId.Thoroughblade,
CardId.Ratpier,
CardId.Whiptail
});
AI.SelectNextCard(target);
return true;
}
private bool 大薰风骑士翠玉特殊召唤()
private bool DaigustoEmeralSummon()
{
return Bot.GetGraveyardMonsters().Count >= 3;
}
private bool 大薰风骑士翠玉效果()
private bool DaigustoEmeralEffect()
{
AI.SelectCard(new[]
{
(int)CardId.十二兽鼠骑,
(int)CardId.召唤师阿莱斯特,
(int)CardId.十二兽蛇笞
CardId.Ratpier,
CardId.AleisterTheInvoker,
CardId.Whiptail
});
AI.SelectNextCard(new[]
{
(int)CardId.十二兽鼠骑,
(int)CardId.大薰风骑士翠玉
CardId.Ratpier,
CardId.DaigustoEmeral
});
return true;
}
private bool 炎舞天玑效果()
private bool FireFormationTenkiEffect()
{
if (Bot.HasInHand((int)CardId.十二兽的会局)
|| Bot.HasInSpellZone((int)CardId.十二兽的会局)
|| Bot.HasInHand((int)CardId.十二兽鼠骑))
if (Bot.HasInHand(CardId.ZoodiacBarrage)
|| Bot.HasInSpellZone(CardId.ZoodiacBarrage)
|| Bot.HasInHand(CardId.Ratpier))
{
AI.SelectCard((int)CardId.十二兽蛇笞);
AI.SelectCard(CardId.Whiptail);
}
else
{
AI.SelectCard((int)CardId.十二兽鼠骑);
AI.SelectCard(CardId.Ratpier);
}
AI.SelectYesNo(true);
return true;
}
private bool 十二兽的会局效果()
private bool ZoodiacBarrageEffect()
{
IList<ClientCard> spells = Bot.GetSpells();
foreach (ClientCard spell in spells)
{
if (spell.Id == (int)CardId.十二兽的会局 && !Card.Equals(spell))
if (spell.Id == CardId.ZoodiacBarrage && !Card.Equals(spell))
return false;
}
AI.SelectCard(new[]
{
(int)CardId.炎舞天玑,
(int)CardId.暴走魔法阵,
(int)CardId.十二兽的会局
CardId.FireFormationTenki,
CardId.MagicalMeltdown,
CardId.ZoodiacBarrage
});
AI.SelectNextCard(new[]
{
(int)CardId.十二兽鼠骑,
(int)CardId.十二兽蛇笞,
(int)CardId.十二兽马剑
CardId.Ratpier,
CardId.Whiptail,
CardId.Thoroughblade
});
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool 十二兽的方合效果()
private bool ZoodiacComboEffect()
{
if (CurrentChain.Count > 0)
return false;
if (Card.Location != CardLocation.Grave)
{
AI.SelectCard((int)CardId.十二兽龙枪);
AI.SelectCard(CardId.Drident);
AI.SelectNextCard(new[]
{
(int)CardId.十二兽蛇笞,
(int)CardId.十二兽鼠骑,
(int)CardId.十二兽马剑
CardId.Whiptail,
CardId.Ratpier,
CardId.Thoroughblade
});
}
return true;
}
private bool 死者苏生效果()
private bool MonsterRebornEffect()
{
AI.SelectCard(new[]
{
(int)CardId.十二兽鼠骑,
(int)CardId.十二兽蛇笞,
(int)CardId.召唤兽梅尔卡巴,
(int)CardId.坏星坏兽席兹奇埃鲁,
(int)CardId.召唤兽墨瓦腊泥加,
(int)CardId.十二兽虎炮,
(int)CardId.十二兽狗环,
(int)CardId.十二兽牛犄
CardId.Ratpier,
CardId.Whiptail,
CardId.InvokedMechaba,
CardId.JizukirutheStarDestroyingKaiju,
CardId.InvokedMagellanica,
CardId.Tigermortar,
CardId.Chakanine,
CardId.Broadbull
});
return true;
}
private bool MonsterRepos()
{
if (Card.Id == (int)CardId.闪光No39希望皇霍普电光皇)
if (Card.Id == CardId.NumberS39UtopiatheLightning)
return false;
return base.DefaultMonsterRepos();
}
......
......@@ -10,11 +10,13 @@ namespace WindBot.Game.AI
{
public string Deck { get; private set; }
public Type Type { get; private set; }
public string Level { get; private set; }
public DeckInstance(string deck, Type type)
public DeckInstance(string deck, Type type, string level)
{
Deck = deck;
Type = type;
Level = level;
}
}
......@@ -39,7 +41,7 @@ namespace WindBot.Game.AI
if (attribute is DeckAttribute)
{
DeckAttribute deck = (DeckAttribute)attribute;
_decks.Add(deck.Name, new DeckInstance(deck.File, type));
_decks.Add(deck.Name, new DeckInstance(deck.File, type, deck.Level));
}
}
}
......@@ -59,7 +61,13 @@ namespace WindBot.Game.AI
if (deck != null && _decks.ContainsKey(deck))
infos = _decks[deck];
else
{
do
{
infos = _list[_rand.Next(_list.Count)];
}
while (infos.Level != "Normal");
}
Executor executor = (Executor)Activator.CreateInstance(infos.Type, ai, duel);
executor.Deck = infos.Deck;
......
......@@ -9,25 +9,28 @@ namespace WindBot.Game.AI
{
public abstract class DefaultExecutor : Executor
{
private enum CardId
protected class _CardId
{
JizukirutheStarDestroyingKaiju = 63941210,
GadarlatheMysteryDustKaiju = 36956512,
GamecieltheSeaTurtleKaiju = 55063751,
RadiantheMultidimensionalKaiju = 28674152,
KumongoustheStickyStringKaiju = 29726552,
ThunderKingtheLightningstrikeKaiju = 48770333,
DogorantheMadFlameKaiju = 93332803,
SuperAntiKaijuWarMachineMechaDogoran = 84769941,
MysticalSpaceTyphoon = 5318639,
CosmicCyclone = 8267140,
ChickenGame = 67616300
public static int JizukirutheStarDestroyingKaiju = 63941210;
public static int GadarlatheMysteryDustKaiju = 36956512;
public static int GamecieltheSeaTurtleKaiju = 55063751;
public static int RadiantheMultidimensionalKaiju = 28674152;
public static int KumongoustheStickyStringKaiju = 29726552;
public static int ThunderKingtheLightningstrikeKaiju = 48770333;
public static int DogorantheMadFlameKaiju = 93332803;
public static int SuperAntiKaijuWarMachineMechaDogoran = 84769941;
public static int MysticalSpaceTyphoon = 5318639;
public static int CosmicCyclone = 8267140;
public static int ChickenGame = 67616300;
public static int CastelTheSkyblasterMusketeer = 82633039;
}
protected DefaultExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, (int)CardId.ChickenGame, DefaultChickenGame);
AddExecutor(ExecutorType.Activate, _CardId.ChickenGame, DefaultChickenGame);
}
/// <summary>
......@@ -36,7 +39,7 @@ namespace WindBot.Game.AI
protected bool DefaultMysticalSpaceTyphoon()
{
foreach (ClientCard card in CurrentChain)
if (card.Id == (int)CardId.MysticalSpaceTyphoon)
if (card.Id == _CardId.MysticalSpaceTyphoon)
return false;
List<ClientCard> spells = Enemy.GetSpells();
......@@ -69,7 +72,7 @@ namespace WindBot.Game.AI
protected bool DefaultCosmicCyclone()
{
foreach (ClientCard card in CurrentChain)
if (card.Id == (int)CardId.CosmicCyclone)
if (card.Id == _CardId.CosmicCyclone)
return false;
return (Duel.LifePoints[0] > 1000) && DefaultMysticalSpaceTyphoon();
}
......@@ -124,7 +127,7 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultBookOfMoon()
{
if (AI.Utils.IsEnemyBetter(true, true))
if (AI.Utils.IsAllEnemyBetter(true))
{
ClientCard monster = Enemy.GetMonsters().GetHighestAttackMonster();
if (monster != null && monster.HasType(CardType.Effect) && (monster.HasType(CardType.Xyz) || monster.Level > 4))
......@@ -141,24 +144,21 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultCompulsoryEvacuationDevice()
{
ClientCard target = AI.Utils.GetProblematicMonsterCard();
ClientCard target = AI.Utils.GetProblematicEnemyMonster();
if (target != null)
{
AI.SelectCard(target);
return true;
}
foreach (ClientCard card in Duel.ChainTargets)
{
if (Card.Equals(card))
if (AI.Utils.IsChainTarget(Card))
{
ClientCard monster = AI.Utils.GetAnyEnemyMonster();
ClientCard monster = AI.Utils.GetBestEnemyMonster();
if (monster != null)
{
AI.SelectCard(monster);
return true;
}
}
}
return false;
}
......@@ -167,7 +167,7 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultCallOfTheHaunted()
{
if (!AI.Utils.IsEnemyBetter(true, true))
if (!AI.Utils.IsAllEnemyBetter(true))
return false;
ClientCard selected = null;
int BestAtk = 0;
......@@ -201,7 +201,7 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultSolemnJudgment()
{
return !(Duel.ChainTargets.Count == 1 && Card.Equals(Duel.ChainTargets[0])) && !(Duel.Player == 0 && LastChainPlayer == -1) && DefaultTrap();
return !AI.Utils.IsChainTargetOnly(Card) && !(Duel.Player == 0 && LastChainPlayer == -1) && DefaultTrap();
}
/// <summary>
......@@ -225,7 +225,7 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultTorrentialTribute()
{
return !HasChainedTrap(0) && AI.Utils.IsEnemyBetter(true, true);
return !HasChainedTrap(0) && AI.Utils.IsAllEnemyBetter(true);
}
/// <summary>
......@@ -249,7 +249,7 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultHammerShot()
{
return AI.Utils.IsEnemyBetter(true, false);
return AI.Utils.IsOneEnemyBetter(true);
}
/// <summary>
......@@ -257,7 +257,7 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultDarkHole()
{
return AI.Utils.IsEnemyBetter(false, false);
return AI.Utils.IsOneEnemyBetter();
}
/// <summary>
......@@ -265,7 +265,7 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultRaigeki()
{
return AI.Utils.IsEnemyBetter(false, false);
return AI.Utils.IsOneEnemyBetter();
}
/// <summary>
......@@ -273,7 +273,7 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultSmashingGround()
{
return AI.Utils.IsEnemyBetter(false, false);
return AI.Utils.IsOneEnemyBetter();
}
/// <summary>
......@@ -328,7 +328,7 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultMonsterRepos()
{
bool enemyBetter = AI.Utils.IsEnemyBetter(true, true);
bool enemyBetter = AI.Utils.IsAllEnemyBetter(true);
if (Card.IsAttack() && enemyBetter)
return true;
......@@ -390,9 +390,9 @@ namespace WindBot.Game.AI
}
if (count > 1 || Duel.LifePoints[0] <= 1000)
return false;
if (Duel.LifePoints[0] <= Duel.LifePoints[1] && ActivateDescription == AI.Utils.GetStringId((int)CardId.ChickenGame, 0))
if (Duel.LifePoints[0] <= Duel.LifePoints[1] && ActivateDescription == AI.Utils.GetStringId(_CardId.ChickenGame, 0))
return true;
if (Duel.LifePoints[0] > Duel.LifePoints[1] && ActivateDescription == AI.Utils.GetStringId((int)CardId.ChickenGame, 1))
if (Duel.LifePoints[0] > Duel.LifePoints[1] && ActivateDescription == AI.Utils.GetStringId(_CardId.ChickenGame, 1))
return true;
return false;
}
......@@ -476,14 +476,11 @@ namespace WindBot.Game.AI
return true;
}
}
foreach (ClientCard card in Duel.ChainTargets)
{
if (Card.Equals(card))
if (AI.Utils.IsChainTarget(Card))
{
AI.SelectOption(XYZ);
return true;
}
}
return false;
}
......@@ -496,26 +493,26 @@ namespace WindBot.Game.AI
{
AI.SelectCard(new[]
{
(int)CardId.GamecieltheSeaTurtleKaiju,
(int)CardId.KumongoustheStickyStringKaiju,
(int)CardId.RadiantheMultidimensionalKaiju,
(int)CardId.GadarlatheMysteryDustKaiju
_CardId.GamecieltheSeaTurtleKaiju,
_CardId.KumongoustheStickyStringKaiju,
_CardId.RadiantheMultidimensionalKaiju,
_CardId.GadarlatheMysteryDustKaiju
});
return true;
}
AI.SelectCard(new[]
{
(int)CardId.JizukirutheStarDestroyingKaiju,
(int)CardId.RadiantheMultidimensionalKaiju,
(int)CardId.GadarlatheMysteryDustKaiju,
(int)CardId.KumongoustheStickyStringKaiju
_CardId.JizukirutheStarDestroyingKaiju,
_CardId.RadiantheMultidimensionalKaiju,
_CardId.GadarlatheMysteryDustKaiju,
_CardId.KumongoustheStickyStringKaiju
});
AI.SelectNextCard(new[]
{
(int)CardId.GamecieltheSeaTurtleKaiju,
(int)CardId.KumongoustheStickyStringKaiju,
(int)CardId.GadarlatheMysteryDustKaiju,
(int)CardId.RadiantheMultidimensionalKaiju
_CardId.GamecieltheSeaTurtleKaiju,
_CardId.KumongoustheStickyStringKaiju,
_CardId.GadarlatheMysteryDustKaiju,
_CardId.RadiantheMultidimensionalKaiju
});
return DefaultDarkHole();
}
......@@ -526,14 +523,14 @@ namespace WindBot.Game.AI
protected bool DefaultKaijuSpsummon()
{
IList<int> kaijus = new[] {
(int)CardId.JizukirutheStarDestroyingKaiju,
(int)CardId.GadarlatheMysteryDustKaiju,
(int)CardId.GamecieltheSeaTurtleKaiju,
(int)CardId.RadiantheMultidimensionalKaiju,
(int)CardId.KumongoustheStickyStringKaiju,
(int)CardId.ThunderKingtheLightningstrikeKaiju,
(int)CardId.DogorantheMadFlameKaiju,
(int)CardId.SuperAntiKaijuWarMachineMechaDogoran
_CardId.JizukirutheStarDestroyingKaiju,
_CardId.GadarlatheMysteryDustKaiju,
_CardId.GamecieltheSeaTurtleKaiju,
_CardId.RadiantheMultidimensionalKaiju,
_CardId.KumongoustheStickyStringKaiju,
_CardId.ThunderKingtheLightningstrikeKaiju,
_CardId.DogorantheMadFlameKaiju,
_CardId.SuperAntiKaijuWarMachineMechaDogoran
};
foreach (ClientCard monster in Enemy.GetMonsters())
{
......@@ -552,7 +549,7 @@ namespace WindBot.Game.AI
AI.SelectCard(card);
return true;
}
card = AI.Utils.GetOneEnemyBetterThanValue(Card.GetDefensePower(), false);
card = AI.Utils.GetOneEnemyBetterThanValue(Card.GetDefensePower());
if (card != null)
{
AI.SelectCard(card);
......@@ -561,5 +558,129 @@ namespace WindBot.Game.AI
return false;
}
/// <summary>
/// Summon when we don't have monster attack higher than enemy's.
/// </summary>
protected bool DefaultNumberS39UtopiaTheLightningSummon()
{
int bestBotAttack = AI.Utils.GetBestAttack(Bot);
return AI.Utils.IsOneEnemyBetterThanValue(bestBotAttack, false);
}
/// <summary>
/// Summon when it can and should use effect.
/// </summary>
protected bool DefaultEvilswarmExcitonKnightSummon()
{
int selfCount = Bot.GetMonsterCount() + Bot.GetSpellCount() + Bot.GetHandCount();
int oppoCount = Enemy.GetMonsterCount() + Enemy.GetSpellCount() + Enemy.GetHandCount();
return (selfCount - 1 < oppoCount) && DefaultEvilswarmExcitonKnightEffect();
}
/// <summary>
/// Activate when we have less cards than enemy's, or the atk sum of we is lower than enemy's.
/// </summary>
protected bool DefaultEvilswarmExcitonKnightEffect()
{
int selfCount = Bot.GetMonsterCount() + Bot.GetSpellCount();
int oppoCount = Enemy.GetMonsterCount() + Enemy.GetSpellCount();
if (selfCount < oppoCount)
return true;
int selfAttack = 0;
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
{
selfAttack += monster.GetDefensePower();
}
int oppoAttack = 0;
monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters)
{
oppoAttack += monster.GetDefensePower();
}
return selfAttack < oppoAttack;
}
/// <summary>
/// Summon in main2, or when the attack of we is lower than enemy's, but not when enemy have monster higher than 2500.
/// </summary>
protected bool DefaultStardustDragonSummon()
{
int selfBestAttack = AI.Utils.GetBestAttack(Bot);
int oppoBestAttack = AI.Utils.GetBestPower(Enemy);
return (selfBestAttack <= oppoBestAttack && oppoBestAttack <= 2500) || AI.Utils.IsTurn1OrMain2();
}
/// <summary>
/// Negate enemy's destroy effect, and revive from grave.
/// </summary>
protected bool DefaultStardustDragonEffect()
{
return (Card.Location == CardLocation.Grave) || LastChainPlayer == 1;
}
/// <summary>
/// Summon when enemy have card which we must solve.
/// </summary>
protected bool DefaultCastelTheSkyblasterMusketeerSummon()
{
return AI.Utils.GetProblematicEnemyCard() != null;
}
/// <summary>
/// Bounce the problematic enemy card. Ignore the 1st effect.
/// </summary>
protected bool DefaultCastelTheSkyblasterMusketeerEffect()
{
if (ActivateDescription == AI.Utils.GetStringId(_CardId.CastelTheSkyblasterMusketeer, 0))
return false;
ClientCard target = AI.Utils.GetProblematicEnemyCard();
if (target != null)
{
AI.SelectNextCard(target);
return true;
}
return false;
}
/// <summary>
/// Summon when it should use effect, or when the attack of we is lower than enemy's, but not when enemy have monster higher than 3000.
/// </summary>
protected bool DefaultScarlightRedDragonArchfiendSummon()
{
int selfBestAttack = AI.Utils.GetBestAttack(Bot);
int oppoBestAttack = AI.Utils.GetBestPower(Enemy);
return (selfBestAttack <= oppoBestAttack && oppoBestAttack <= 3000) || DefaultScarlightRedDragonArchfiendEffect();
}
/// <summary>
/// Activate when we have less monsters than enemy, or when enemy have more than 3 monsters.
/// </summary>
protected bool DefaultScarlightRedDragonArchfiendEffect()
{
int selfCount = 0;
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
{
// The bot don't know if the card is special summoned, so let we assume all monsters are special summoned
if (!monster.Equals(Card) && monster.HasType(CardType.Effect) && monster.Attack <= Card.Attack)
selfCount++;
}
int oppoCount = 0;
monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (monster.HasType(CardType.Effect) && monster.Attack <= Card.Attack)
oppoCount++;
}
return (oppoCount > 0 && selfCount <= oppoCount) || oppoCount >= 3;
}
}
}
namespace WindBot.Game.AI.Enums
{
/// <summary>
/// Cards that are dangerous to attack.
/// </summary>
public enum DangerousMonster
{
LionHeart = 54366836,
Yubel = 78371393,
YubelIncarnate = 4779091,
YubelNightmare = 31764700,
MetaionTheTimelord = 74530899,
Number39Utopia = 84013237,
NumberS39UtopiatheLightning = 56832966
MetaionTheTimelord = 74530899
}
}
namespace WindBot.Game.AI.Enums
{
/// <summary>
/// Cards that restrict player from performing some action. Bot will preferentially destroy them.
/// </summary>
public enum Floodgate
{
BarrierStatueoftheTorrent = 10963799,
......@@ -24,11 +27,13 @@
LevelLimitAreaB = 3136426,
DimensionalFissure = 81674782,
Necrovalley = 47355498,
SavageColosseum = 32391631,
SecretVillageoftheSpellcasters = 68462976,
SwordsofRevealingLight = 72302403,
MessengerofPeace = 44656491,
KaiserColosseum = 35059553,
DomainoftheTrueMonarchs = 84171830,
ZombieWorld = 4064256,
ImperialOrder = 61740673,
MacroCosmos = 30241314,
MindDrain = 68937720,
......@@ -41,6 +46,7 @@
LightImprisoningMirror = 53341729,
ShadowImprisoningMirror = 99735427,
WallofRevealingLight = 17078030,
GravityBind = 85742772,
VanitysEmptiness = 5851097,
Lose1Turn = 24348804,
Reqliate = 20426907,
......
namespace WindBot.Game.AI.Enums
{
/// <summary>
/// Cards that are invincible to battle.
/// </summary>
public enum InvincibleMonster
{
SpiritReaper = 23205979,
......
namespace WindBot.Game.AI.Enums
{
public enum NegateAttackSpell
{
MessengerOfPeace = 44656491,
SavageColosseum = 32391631,
GravityBind = 85742772,
LevelLimitAreaB = 3136426
}
}
namespace WindBot.Game.AI.Enums
{
public enum NegatesEffects
{
SkillDrain = 82732705,
SoulDrain = 73599290
}
}
namespace WindBot.Game.AI.Enums
{
public enum NegatesSpells
{
HorusLv6 = 11224103,
HorusLv8 = 48229808
}
}
namespace WindBot.Game.AI.Enums
{
public enum NegatesSummons
{
Necrovalley = 47355498,
ImperialIronWall = 30459350,
ZombieWorld = 4064256,
DnaSurgery = 74701381,
MacroCosmos = 30241314,
DimensionalFissure = 81674782
}
}
namespace WindBot.Game.AI.Enums
{
public enum NegatesTraps
{
Jinzo = 77585513,
RoyalDecree = 51452091
}
}
......@@ -50,6 +50,12 @@ namespace WindBot.Game.AI
return Program.Rand.Next(2) > 0;
}
/// <summary>
/// Called when the AI has to decide if it should attack
/// </summary>
/// <param name="attackers">List of monsters that can attcack.</param>
/// <param name="defenders">List of monsters of enemy.</param>
/// <returns>A new BattlePhaseAction containing the action to do.</returns>
public virtual BattlePhaseAction OnBattle(IList<ClientCard> attackers, IList<ClientCard> defenders)
{
if (attackers.Count == 0)
......@@ -86,6 +92,13 @@ namespace WindBot.Game.AI
return AI.ToMainPhase2();
}
/// <summary>
/// Decide whether to declare attack between attacker and defender.
/// Can be overrided to update the RealPower of attacker for cards like Honest.
/// </summary>
/// <param name="attacker">Card that attack.</param>
/// <param name="defender">Card that defend.</param>
/// <returns>true if the attack can be done.</returns>
public virtual bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (defender.IsMonsterInvincible())
......@@ -115,11 +128,13 @@ namespace WindBot.Game.AI
public virtual IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, bool cancelable)
{
// For overriding
return null;
}
public virtual IList<ClientCard> OnSelectSum(IList<ClientCard> cards, int sum, int min, int max, bool mode)
{
// For overriding
return null;
}
......@@ -181,6 +196,9 @@ namespace WindBot.Game.AI
Battle = battle;
}
/// <summary>
/// Set global variables Type, Card, ActivateDescription for Executor
/// </summary>
public void SetCard(ExecutorType type, ClientCard card, int description)
{
Type = type;
......@@ -188,21 +206,33 @@ namespace WindBot.Game.AI
ActivateDescription = description;
}
/// <summary>
/// Do the action for the card if func return true.
/// </summary>
public void AddExecutor(ExecutorType type, int cardId, Func<bool> func)
{
Executors.Add(new CardExecutor(type, cardId, func));
}
/// <summary>
/// Do the action for the card if available.
/// </summary>
public void AddExecutor(ExecutorType type, int cardId)
{
Executors.Add(new CardExecutor(type, cardId, null));
}
/// <summary>
/// Do the action for every card if func return true.
/// </summary>
public void AddExecutor(ExecutorType type, Func<bool> func)
{
Executors.Add(new CardExecutor(type, -1, func));
}
/// <summary>
/// Do the action for every card if no other Executor is added to it.
/// </summary>
public void AddExecutor(ExecutorType type)
{
Executors.Add(new CardExecutor(type, -1, DefaultNoExecutor));
......
......@@ -75,6 +75,7 @@ namespace WindBot.Game
/// </summary>
public void OnNewTurn()
{
Executor.OnNewTurn();
}
/// <summary>
......@@ -91,7 +92,6 @@ namespace WindBot.Game
if (Duel.Player == 0 && Duel.Phase == DuelPhase.Draw)
{
_dialogs.SendNewTurn();
Executor.OnNewTurn();
}
}
......@@ -102,10 +102,6 @@ namespace WindBot.Game
{
_dialogs.SendOnDirectAttack(card.Name);
}
public void OnDirectAttack()
{
_dialogs.SendOnDirectAttack();
}
/// <summary>
/// Called when a chain is executed.
......@@ -308,7 +304,7 @@ namespace WindBot.Game
}
if (ShouldExecute(exec, card, ExecutorType.SummonOrSet))
{
if (Utils.IsEnemyBetter(true, true) && Utils.IsAllEnemyBetterThanValue(card.Attack + 300, false) &&
if (Utils.IsAllEnemyBetter(true) && Utils.IsAllEnemyBetterThanValue(card.Attack + 300, false) &&
main.MonsterSetableCards.Contains(card))
{
_dialogs.SendSetMonster();
......@@ -369,13 +365,13 @@ namespace WindBot.Game
}
/// <summary>
/// Called when the AI has to tribute for a synchro monster.
/// Called when the AI has to tribute for a synchro monster or ritual monster.
/// </summary>
/// <param name="cards">Available cards.</param>
/// <param name="sum">Result of the operation.</param>
/// <param name="min">Minimum cards.</param>
/// <param name="max">Maximum cards.</param>
/// <param name="mode">True for equal.</param>
/// <param name="mode">True for exact equal.</param>
/// <returns></returns>
public IList<ClientCard> OnSelectSum(IList<ClientCard> cards, int sum, int min, int max, bool mode)
{
......
......@@ -118,6 +118,8 @@ namespace WindBot.Game
_messages.Add(GameMessage.AnnounceCard, OnAnnounceCard);
_messages.Add(GameMessage.AnnounceNumber, OnAnnounceNumber);
_messages.Add(GameMessage.AnnounceRace, OnAnnounceRace);
_messages.Add(GameMessage.AnnounceCardFilter, OnAnnounceCard);
_messages.Add(GameMessage.RockPaperScissors, OnRockPaperScissors);
}
private void OnJoinGame(BinaryReader packet)
......@@ -259,15 +261,10 @@ namespace WindBot.Game
{
int player = packet.ReadInt16();
string message = packet.ReadUnicode(256);
if (!Program.DebugMode)
{
string myName = _room.Position == 0 ? _room.Names[0] : _room.Names[1];
string otherName = _room.Position == 0 ? _room.Names[1] : _room.Names[0];
if (player < 4)
Logger.WriteLine(otherName + " say to " + myName + ": " + message);
//else
// Logger.WriteLine(myName + " System or Watch : " + message);
}
Logger.DebugWriteLine(otherName + " say to " + myName + ": " + message);
}
private void OnErrorMsg(BinaryReader packet)
......@@ -1085,6 +1082,7 @@ namespace WindBot.Game
private void OnAnnounceCard(BinaryReader packet)
{
// not fully implemented
Connection.Send(CtosMessage.Response, _ai.OnAnnounceCard());
}
......@@ -1117,5 +1115,16 @@ namespace WindBot.Game
reply += (int)races[i];
Connection.Send(CtosMessage.Response, reply);
}
private void OnRockPaperScissors(BinaryReader packet)
{
packet.ReadByte(); // player
int result;
if (_hand > 0)
result = _hand;
else
result = _ai.OnRockPaperScissors();
Connection.Send(CtosMessage.Response, result);
}
}
}
\ No newline at end of file
......@@ -10,8 +10,9 @@ namespace WindBot
}
public static void DebugWriteLine(string message)
{
if (Program.DebugMode)
#if DEBUG
Console.WriteLine("[" + DateTime.Now.ToString("yy-MM-dd HH:mm:ss") + "] " + message);
#endif
}
public static void WriteErrorLine(string message)
{
......
......@@ -11,82 +11,36 @@ namespace WindBot
{
public class Program
{
#if DEBUG
public static bool DebugMode = true;
#else
public static bool DebugMode = false;
#endif
internal static Random Rand;
internal static void Main(string[] args)
{
Logger.WriteLine("WindBot starting...");
InitDatas("cards.cdb");
Config.Load(args);
int argc = args.Length;
string databasePath = Config.GetString("DbPath", "cards.cdb");
// If the first commandline parameter is DebugMode
if (argc > 0 && args[0] == "DebugMode")
{
DebugMode = true;
// Shift the args array to skip the first parameter
argc--;
Array.Copy(args, 1, args, 0, argc);
}
InitDatas(databasePath);
// Only one parameter will make Windbot run as a server, use the parameter as port
// provide a http interface to create bot.
// eg. http://127.0.0.1:2399/?name=%E2%91%A8&deck=Blue-Eyes&host=127.0.0.1&port=7911&dialog=cirno.zh-CN&version=4922
if (argc == 1)
{
RunAsServer(Int32.Parse(args[0]));
}
bool serverMode = Config.GetBool("ServerMode", false);
// Use all five parameters to run Windbot
// The parameters should be name, deck, server ip, server port, password
// eg. WindBot.exe "My Bot" "Zexal Weapons" 127.0.0.1 7911 ""
else if (argc == 5)
if (serverMode)
{
RunFromArgs(args);
Logger.WriteLine("WindBot ended.");
// Run in server mode, provide a http interface to create bot.
int serverPort = Config.GetInt("ServerPort", 2399);
RunAsServer(serverPort);
}
// Use environment variables to run Windbot
// List of variables required:
// YGOPRO_HOST
// YGOPRO_PORT
// YGOPRO_NAME
//
// List of variables optional:
// YGOPRO_DECK
// YGOPRO_VERSION
// YGOPRO_DIALOG
// YGOPRO_PASSWORD
//
// eg. (cmd)
// set YGOPRO_VERSION=4922
// set YGOPRO_HOST=127.0.0.1
// set YGOPRO_PORT=7911
// set YGOPRO_NAME=Meow
// set YGOPRO_DECK=Blue-Eyes
// set YGOPRO_DIALOG=zh-CN
// WindBot.exe
else if (Environment.GetEnvironmentVariable("YGOPRO_NAME") != null)
{
RunFromEnv();
Logger.WriteLine("WindBot ended.");
}
// Else, tell the user to run it correctly
else
{
Logger.WriteLine("");
Logger.WriteLine("See the readme for how to run WindBot!");
Logger.WriteLine("Press any key to quit...");
Logger.WriteLine("");
Console.ReadKey();
// Join the host specified on the command line.
if (args.Length == 0)
{
Logger.WriteLine("=== WARN ===");
Logger.WriteLine("No input found, tring to connect to localhost YGOPro host.");
Logger.WriteLine("If it fail, the program will quit sliently.");
}
RunFromArgs();
}
}
......@@ -96,37 +50,24 @@ namespace WindBot
DecksManager.Init();
string absolutePath = Path.GetFullPath(databasePath);
if (!File.Exists(absolutePath))
// In case windbot is placed in a folder under ygopro folder
absolutePath = Path.GetFullPath("../" + databasePath);
if (!File.Exists(absolutePath))
Logger.WriteErrorLine("Can't find cards database file. Please place cards.cdb next to WindBot.exe .");
NamedCardsManager.Init(absolutePath);
}
private static void RunFromArgs(string[] args)
private static void RunFromArgs()
{
WindBotInfo Info = new WindBotInfo();
Info.Name = args[0];
Info.Deck = args[1];
Info.Host = args[2];
Info.Port = Int32.Parse(args[3]);
Info.HostInfo = args[4];
Run(Info);
}
private static void RunFromEnv()
{
WindBotInfo Info = new WindBotInfo();
Info.Name = Environment.GetEnvironmentVariable("YGOPRO_NAME");
Info.Deck = Environment.GetEnvironmentVariable("YGOPRO_DECK");
Info.Host = Environment.GetEnvironmentVariable("YGOPRO_HOST");
Info.Port = Int32.Parse(Environment.GetEnvironmentVariable("YGOPRO_PORT"));
string EnvDialog = Environment.GetEnvironmentVariable("YGOPRO_DIALOG");
if (EnvDialog != null)
Info.Dialog = EnvDialog;
string EnvVersion = Environment.GetEnvironmentVariable("YGOPRO_VERSION");
if (EnvVersion != null)
Info.Version = Int16.Parse(EnvVersion);
string EnvPassword = Environment.GetEnvironmentVariable("YGOPRO_PASSWORD");
if (EnvPassword != null)
Info.HostInfo = EnvPassword;
Info.Name = Config.GetString("Name", Info.Name);
Info.Deck = Config.GetString("Deck", Info.Deck);
Info.Dialog = Config.GetString("Dialog", Info.Dialog);
Info.Host = Config.GetString("Host", Info.Host);
Info.Port = Config.GetInt("Port", Info.Port);
Info.HostInfo = Config.GetString("HostInfo", Info.HostInfo);
Info.Version = Config.GetInt("Version", Info.Version);
Info.Hand = Config.GetInt("Hand", Info.Hand);
Run(Info);
}
......@@ -141,8 +82,10 @@ namespace WindBot
Logger.WriteLine("HTTP GET http://127.0.0.1:" + ServerPort + "/?name=WindBot&host=127.0.0.1&port=7911 to call the bot.");
while (true)
{
#if !DEBUG
try
{
#endif
HttpListenerContext ctx = MainServer.GetContext();
WindBotInfo Info = new WindBotInfo();
......@@ -173,53 +116,68 @@ namespace WindBot
}
else
{
#if !DEBUG
try
{
#endif
Thread workThread = new Thread(new ParameterizedThreadStart(Run));
workThread.Start(Info);
#if !DEBUG
}
catch (Exception ex) when (!DebugMode)
catch (Exception ex)
{
Logger.WriteErrorLine("Start Thread Error: " + ex);
}
#endif
ctx.Response.StatusCode = 200;
ctx.Response.Close();
}
#if !DEBUG
}
catch (Exception ex) when (!DebugMode)
catch (Exception ex)
{
Logger.WriteErrorLine("Parse Http Request Error: " + ex);
}
#endif
}
}
}
private static void Run(object o)
{
#if !DEBUG
try
{
//all errors will be catched instead of causing the program to crash.
#endif
WindBotInfo Info = (WindBotInfo)o;
GameClient client = new GameClient(Info);
client.Start();
Logger.DebugWriteLine(client.Username + " started.");
while (client.Connection.IsConnected)
{
#if !DEBUG
try
{
#endif
client.Tick();
Thread.Sleep(30);
#if !DEBUG
}
catch (Exception ex) when (!DebugMode)
catch (Exception ex)
{
Logger.WriteErrorLine("Tick Error: " + ex);
}
#endif
}
Logger.DebugWriteLine(client.Username + " end.");
#if !DEBUG
}
catch (Exception ex) when (!DebugMode)
catch (Exception ex)
{
Logger.WriteErrorLine("Run Error: " + ex);
}
#endif
}
}
}
# WindBot
A C# bot for ygopro, compatible with the ygosharp server.
A C# bot for ygopro, compatible with the [YGOSharp](https://github.com/IceYGO/ygosharp) and [SRVPro](https://github.com/moecube/srvpro) server.
### How to use:
* Code whatever you want to code in the `Program.cs` file.
* Compile `WindBot.sln` using Visual Studio or Mono.
* Put `cards.cdb` next to the compiled `WindBot.exe`.
* Run and observe.
* Run YGOPro, create a host.
* Run WindBot and observe.
### Supported commandlines
`Name`
The nickname for the bot.
`Deck`
The deck to be used by the bot. Available decks are listed below. Keep empty to use random deck.
`Dialog`
The dialog texts to be used by the bot. See Dialogs folder for list.
`Host`
The IP of the host to be connected to.
`Port`
The port of the host to be connected to.
`HostInfo`
The host info (password) to be used.
`Version`
The version of YGOPro.
`Hand`
If you are testing deck, you may want to make sure the bot go first or second. `Hand=1` will make the bot always show Scissors, 2 for Rock, 3 for Paper.
`ServerMode` and `ServerPort`
WindBot can run as a "server", provide a http interface to create bot.
### Available decks
**Easy**:
* Burn
* Frog
* Horus
* MokeyMokey
* MokeyMokeyKing
* OldSchool
**Normal**:
* Blue-Eyes
* Dragunity
* Qliphort
* Rainbow
* Rank V
* ST1732
* Toadally Awesome (old lflist)
* Yosenju
* Zexal Weapons
* Zoodiac (old lflist, master rule 3 only)
### Unfinished decks
* Blackwing
* CyberDragon
* Evilswarm
* Gravekeeper
* Graydle
* Lightsworn
* Nekroz
### Server mode
WindBot can run as a "server", provide a http interface to create bot.
eg. `http://127.0.0.1:2399/?name=%E2%91%A8&deck=Blue-Eyes&host=127.0.0.1&port=7911&dialog=cirno.zh-CN&version=4928`
In this situation, it will be multi-threaded. This can be useful for servers, since it don't use large amount memory.
The parameters are same as commandlines, but low cased.
### Known issues
* The bot will attack synchro monsters next to _Ultimaya Tzolkin_ because it don't know _Ultimaya Tzolkin_ can't be attacked.
* The attack won't be canceled when battle replay happens.
* If one chain includes two activation that use `AI.SelectCard`, the second one won't select correctly.
### TODO list
* More decks
* Documents for creating AI
* `AI.SelectZone`
* `AI.SelectMaterials` which select a set of cards for F/S/X/L summon
* `AI.SelectTribute`
* Better new master rule support
* Update the known card enums
* More default common cards executor
......@@ -75,6 +75,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Config.cs" />
<Compile Include="Game\AI\AIFunctions.cs" />
<Compile Include="Game\AI\CardContainer.cs" />
<Compile Include="Game\AI\CardExecutor.cs" />
......@@ -113,11 +114,6 @@
<Compile Include="Game\AI\Enums\OneForXyz.cs" />
<Compile Include="Game\AI\Enums\InvincibleMonster.cs" />
<Compile Include="Game\AI\Enums\Floodgate.cs" />
<Compile Include="Game\AI\Enums\NegateAttackSpell.cs" />
<Compile Include="Game\AI\Enums\NegatesEffects.cs" />
<Compile Include="Game\AI\Enums\NegatesSpells.cs" />
<Compile Include="Game\AI\Enums\NegatesSummons.cs" />
<Compile Include="Game\AI\Enums\NegatesTraps.cs" />
<Compile Include="Game\AI\Executor.cs" />
<Compile Include="Game\AI\ExecutorType.cs" />
<Compile Include="Game\BattlePhase.cs" />
......
No preview for this file type
No preview for this file type
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