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 @@ ...@@ -6,69 +6,63 @@
"Sorry, it seems that I have too much {0} in my deck." "Sorry, it seems that I have too much {0} in my deck."
], ],
"duelstart": [ "duelstart": [
"Good luck, have fun." "It's time to duel!",
"Good luck, and have fun!"
], ],
"newturn": [ "newturn": [
"It's my turn, draw.", "It's my turn! Draw!",
"My turn, draw.", "My turn. Draw!",
"I draw a card." "I draw!"
], ],
"endturn": [ "endturn": [
"I end my turn.", "I end my turn.",
"My turn is over.", "My turn is over.",
"Your turn." "It's your turn."
], ],
"directattack": [ "directattack": [
"{0}, direct attack!", "{0}, direct attack!",
"{0}, attack him directly!", "{0}, attack them directly!",
"{0}, he's defenseless, attack!", "You're defenseless. Attack, {0}!",
"{0}, attack his life points!", "{0}, attack their life points!",
"{0}, attack his life points directly!", "{0}, attack their life points directly!",
"{0}, attack him through a direct attack!", "{0}, unleash your power!",
"{0}, attack him using a direct attack!", "My {0} will decimate your life points!",
"{0}, unleash your power through a direct attack!", "Behold the power of my {0}!",
"My {0} is going to smash your life points!", "You can't stop me! {0}, attack!"
"Show your power to my opponent, {0}!",
"You can't stop me. {0}, attack!"
], ],
"attack": [ "attack": [
"{0}, attack this {1}!", "{0}, attack their {1}!",
"{0}, destroy this {1}!", "{0}, destroy their {1}!",
"{0}, charge the {1}!", "My {0} will annihilate your {1}!",
"{0}, strike that {1}!", "Your {1} is no match for my {0}!",
"{0}, unleash your power on this {1}!" "{0}, unleash your power on their {1}!"
], ],
"ondirectattack": [ "ondirectattack": [
"Ahhhhh...", "Argh...!",
"Just {0} ...", "Just {0}...",
"Think you can defeat me?" "You think that's enough to defeat me?",
"It's just a scratch!"
], ],
"facedownmonstername": "monster", "facedownmonstername": "monster",
"activate": [ "activate": [
"I'm activating {0}.", "I activate {0}!",
"I'm using the effect of {0}.", "I'll use {0}."
"I use the power of {0}."
], ],
"summon": [ "summon": [
"I'm summoning {0}.", "I summon {0}!",
"Come on, {0}!", "Come on, {0}!",
"Appear, {0}!", "Appear, {0}!",
"I summon the powerful {0}.", "{0}, show yourself!"
"I call {0} to the battle!",
"I'm calling {0}.",
"Let's summon {0}."
], ],
"setmonster": [ "setmonster": [
"I'm setting a monster.", "I set a monster face-down.",
"I set a face-down monster.", "Whatever could this monster be?",
"I place a hidden monster." "Attack this monster, I dare you!"
], ],
"chaining": [ "chaining": [
"Look at that! I'm activating {0}.", "Not so fast! I activate {0}!",
"I use the power of {0}.", "Before you do that, I'll chain {0}!",
"Get ready! I use {0}.", "Nice try, but I have {0}!",
"I don't think so. {0}, activation!", "Didn't expect {0}, did you?"
"Looks like you forgot my {0}.",
"Did you consider the fact I have {0}?"
] ]
} }
\ No newline at end of file
This diff is collapsed.
...@@ -12,7 +12,7 @@ namespace WindBot.Game.AI ...@@ -12,7 +12,7 @@ namespace WindBot.Game.AI
ClientCard selected = null; ClientCard selected = null;
foreach (ClientCard card in cards) 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) if (card.HasType(CardType.Monster) && card.Attack > highestAtk)
{ {
highestAtk = card.Attack; highestAtk = card.Attack;
...@@ -28,7 +28,7 @@ namespace WindBot.Game.AI ...@@ -28,7 +28,7 @@ namespace WindBot.Game.AI
ClientCard selected = null; ClientCard selected = null;
foreach (ClientCard card in cards) 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) if (card.HasType(CardType.Monster) && card.Defense > highestDef)
{ {
highestDef = card.Defense; highestDef = card.Defense;
...@@ -44,7 +44,7 @@ namespace WindBot.Game.AI ...@@ -44,7 +44,7 @@ namespace WindBot.Game.AI
ClientCard selected = null; ClientCard selected = null;
foreach (ClientCard card in cards) 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) || if (lowestAtk == 0 && card.HasType(CardType.Monster) ||
card.HasType(CardType.Monster) && card.Attack < lowestAtk) card.HasType(CardType.Monster) && card.Attack < lowestAtk)
{ {
...@@ -61,7 +61,7 @@ namespace WindBot.Game.AI ...@@ -61,7 +61,7 @@ namespace WindBot.Game.AI
ClientCard selected = null; ClientCard selected = null;
foreach (ClientCard card in cards) 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) || if (lowestDef == 0 && card.HasType(CardType.Monster) ||
card.HasType(CardType.Monster) && card.Defense < lowestDef) card.HasType(CardType.Monster) && card.Defense < lowestDef)
{ {
...@@ -131,36 +131,39 @@ namespace WindBot.Game.AI ...@@ -131,36 +131,39 @@ namespace WindBot.Game.AI
continue; continue;
if (card.HasType(CardType.Monster)) if (card.HasType(CardType.Monster))
cardlist.Add(card); cardlist.Add(card);
} }
return cardlist; 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) foreach (ClientCard card in cards)
{ {
if (card != null && card.IsMonsterInvincible()) if (card == null)
return card; 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) foreach (ClientCard card in cards)
{ {
if (card != null && card.IsMonsterDangerous()) if (card != null && card.IsMonsterInvincible() && card.IsFaceup())
return card; return card;
} }
return null; return null;
} }
public static ClientCard GetNegateAttackSpell(this IEnumerable<ClientCard> cards) public static ClientCard GetDangerousMonster(this IEnumerable<ClientCard> cards)
{ {
foreach (ClientCard card in cards) foreach (ClientCard card in cards)
{ {
if (card != null && card.IsSpellNegateAttack()) if (card != null && card.IsMonsterDangerous() && card.IsFaceup())
return card; return card;
} }
return null; return null;
...@@ -170,7 +173,7 @@ namespace WindBot.Game.AI ...@@ -170,7 +173,7 @@ namespace WindBot.Game.AI
{ {
foreach (ClientCard card in cards) foreach (ClientCard card in cards)
{ {
if (card != null && card.IsFloodgate()) if (card != null && card.IsFloodgate() && card.IsFaceup())
return card; return card;
} }
return null; return null;
......
...@@ -5,21 +5,22 @@ namespace WindBot.Game.AI ...@@ -5,21 +5,22 @@ namespace WindBot.Game.AI
{ {
public static class CardExtension public static class CardExtension
{ {
/// <summary>
/// Is this monster is invincible to battle?
/// </summary>
public static bool IsMonsterInvincible(this ClientCard card) public static bool IsMonsterInvincible(this ClientCard card)
{ {
return Enum.IsDefined(typeof(InvincibleMonster), card.Id); return Enum.IsDefined(typeof(InvincibleMonster), card.Id);
} }
/// <summary>
/// Is this monster is dangerous to attack?
/// </summary>
public static bool IsMonsterDangerous(this ClientCard card) public static bool IsMonsterDangerous(this ClientCard card)
{ {
return Enum.IsDefined(typeof(DangerousMonster), card.Id); 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) public static bool IsFloodgate(this ClientCard card)
{ {
return Enum.IsDefined(typeof(Floodgate), card.Id); return Enum.IsDefined(typeof(Floodgate), card.Id);
......
...@@ -7,14 +7,16 @@ namespace WindBot.Game.AI ...@@ -7,14 +7,16 @@ namespace WindBot.Game.AI
{ {
public string Name { get; private set; } public string Name { get; private set; }
public string File { 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)) if (String.IsNullOrEmpty(file))
file = name; file = name;
Name = name; Name = name;
File = file; File = file;
Level = level;
} }
} }
} }
This diff is collapsed.
This diff is collapsed.
...@@ -6,33 +6,33 @@ using WindBot.Game.AI; ...@@ -6,33 +6,33 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
[Deck("Burn", "AI_Burn")] [Deck("Burn", "AI_Burn", "Easy")]
public class BurnExecutor : DefaultExecutor public class BurnExecutor : DefaultExecutor
{ {
public enum CardId public class CardId
{ {
LavaGolem = 102380, public static int LavaGolem = 102380;
ReflectBounder = 2851070, public static int ReflectBounder = 2851070;
FencingFireFerret = 97396380, public static int FencingFireFerret = 97396380;
BlastSphere = 26302522, public static int BlastSphere = 26302522;
Marshmallon = 31305911, public static int Marshmallon = 31305911;
SpiritReaper = 23205979, public static int SpiritReaper = 23205979;
NaturiaBeans = 44789585, public static int NaturiaBeans = 44789585;
ThunderShort = 20264508, public static int ThunderShort = 20264508;
Ookazi = 19523799, public static int Ookazi = 19523799;
GoblinThief = 45311864, public static int GoblinThief = 45311864;
TremendousFire = 46918794, public static int TremendousFire = 46918794;
SwordsOfRevealingLight = 72302403, public static int SwordsOfRevealingLight = 72302403;
SupremacyBerry = 98380593, public static int SupremacyBerry = 98380593;
ChainEnergy = 79323590, public static int ChainEnergy = 79323590;
DarkRoomofNightmare = 85562745, public static int DarkRoomofNightmare = 85562745;
PoisonOfTheOldMan = 8842266, public static int PoisonOfTheOldMan = 8842266;
OjamaTrio = 29843091, public static int OjamaTrio = 29843091;
Ceasefire = 36468556, public static int Ceasefire = 36468556;
MagicCylinder = 62279055, public static int MagicCylinder = 62279055;
MinorGoblinOfficial = 1918087, public static int MinorGoblinOfficial = 1918087;
ChainBurst = 48276469, public static int ChainBurst = 48276469;
SkullInvitation = 98139712 public static int SkullInvitation = 98139712;
} }
public BurnExecutor(GameAI ai, Duel duel) public BurnExecutor(GameAI ai, Duel duel)
...@@ -42,39 +42,39 @@ namespace WindBot.Game.AI.Decks ...@@ -42,39 +42,39 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet); AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
// Activate Spells // Activate Spells
AddExecutor(ExecutorType.Activate, (int)CardId.DarkRoomofNightmare); AddExecutor(ExecutorType.Activate, CardId.DarkRoomofNightmare);
AddExecutor(ExecutorType.Activate, (int)CardId.Ookazi); AddExecutor(ExecutorType.Activate, CardId.Ookazi);
AddExecutor(ExecutorType.Activate, (int)CardId.GoblinThief); AddExecutor(ExecutorType.Activate, CardId.GoblinThief);
AddExecutor(ExecutorType.Activate, (int)CardId.TremendousFire); AddExecutor(ExecutorType.Activate, CardId.TremendousFire);
AddExecutor(ExecutorType.Activate, (int)CardId.SwordsOfRevealingLight, SwordsOfRevealingLight); AddExecutor(ExecutorType.Activate, CardId.SwordsOfRevealingLight, SwordsOfRevealingLight);
AddExecutor(ExecutorType.Activate, (int)CardId.SupremacyBerry, SupremacyBerry); AddExecutor(ExecutorType.Activate, CardId.SupremacyBerry, SupremacyBerry);
AddExecutor(ExecutorType.Activate, (int)CardId.PoisonOfTheOldMan, PoisonOfTheOldMan); AddExecutor(ExecutorType.Activate, CardId.PoisonOfTheOldMan, PoisonOfTheOldMan);
AddExecutor(ExecutorType.Activate, (int)CardId.ThunderShort, ThunderShort); AddExecutor(ExecutorType.Activate, CardId.ThunderShort, ThunderShort);
// Hello, my name is Lava Golem // Hello, my name is Lava Golem
AddExecutor(ExecutorType.SpSummon, (int)CardId.LavaGolem, LavaGolem); AddExecutor(ExecutorType.SpSummon, CardId.LavaGolem, LavaGolem);
// Set an invincible monster // Set an invincible monster
AddExecutor(ExecutorType.MonsterSet, (int)CardId.Marshmallon, SetInvincibleMonster); AddExecutor(ExecutorType.MonsterSet, CardId.Marshmallon, SetInvincibleMonster);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.SpiritReaper, SetInvincibleMonster); AddExecutor(ExecutorType.MonsterSet, CardId.SpiritReaper, SetInvincibleMonster);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.BlastSphere); AddExecutor(ExecutorType.MonsterSet, CardId.BlastSphere);
// Set other monsters // Set other monsters
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.FencingFireFerret); AddExecutor(ExecutorType.SummonOrSet, CardId.FencingFireFerret);
AddExecutor(ExecutorType.Summon, (int)CardId.ReflectBounder); AddExecutor(ExecutorType.Summon, CardId.ReflectBounder);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.NaturiaBeans); AddExecutor(ExecutorType.MonsterSet, CardId.NaturiaBeans);
// We're a coward // We're a coward
AddExecutor(ExecutorType.Repos, ReposEverything); AddExecutor(ExecutorType.Repos, ReposEverything);
// Chain traps // Chain traps
AddExecutor(ExecutorType.Activate, (int)CardId.MagicCylinder, DefaultTrap); AddExecutor(ExecutorType.Activate, CardId.MagicCylinder, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.Ceasefire, Ceasefire); AddExecutor(ExecutorType.Activate, CardId.Ceasefire, Ceasefire);
AddExecutor(ExecutorType.Activate, (int)CardId.OjamaTrio); AddExecutor(ExecutorType.Activate, CardId.OjamaTrio);
AddExecutor(ExecutorType.Activate, (int)CardId.MinorGoblinOfficial); AddExecutor(ExecutorType.Activate, CardId.MinorGoblinOfficial);
AddExecutor(ExecutorType.Activate, (int)CardId.ChainBurst); AddExecutor(ExecutorType.Activate, CardId.ChainBurst);
AddExecutor(ExecutorType.Activate, (int)CardId.SkullInvitation); AddExecutor(ExecutorType.Activate, CardId.SkullInvitation);
AddExecutor(ExecutorType.Activate, (int)CardId.ChainEnergy); AddExecutor(ExecutorType.Activate, CardId.ChainEnergy);
} }
public override bool OnSelectHand() public override bool OnSelectHand()
...@@ -84,7 +84,7 @@ namespace WindBot.Game.AI.Decks ...@@ -84,7 +84,7 @@ namespace WindBot.Game.AI.Decks
private bool SwordsOfRevealingLight() private bool SwordsOfRevealingLight()
{ {
int count = Bot.SpellZone.GetCardCount((int)CardId.SwordsOfRevealingLight); int count = Bot.SpellZone.GetCardCount(CardId.SwordsOfRevealingLight);
return count == 0; return count == 0;
} }
...@@ -108,7 +108,7 @@ namespace WindBot.Game.AI.Decks ...@@ -108,7 +108,7 @@ namespace WindBot.Game.AI.Decks
{ {
foreach (ClientCard card in Bot.GetMonsters()) 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; return false;
} }
...@@ -134,9 +134,9 @@ namespace WindBot.Game.AI.Decks ...@@ -134,9 +134,9 @@ namespace WindBot.Game.AI.Decks
private bool ReposEverything() private bool ReposEverything()
{ {
if (Card.Id == (int)CardId.ReflectBounder) if (Card.Id == CardId.ReflectBounder)
return Card.IsDefense(); return Card.IsDefense();
if (Card.Id == (int)CardId.FencingFireFerret) if (Card.Id == CardId.FencingFireFerret)
return DefaultMonsterRepos(); return DefaultMonsterRepos();
if (Card.IsAttack()) if (Card.IsAttack())
return true; return true;
......
This diff is collapsed.
...@@ -6,13 +6,13 @@ using WindBot.Game.AI; ...@@ -6,13 +6,13 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
[Deck("Test", "AI_Test")] [Deck("Test", "AI_Test", "Test")]
public class DoEverythingExecutor : DefaultExecutor public class DoEverythingExecutor : DefaultExecutor
{ {
public enum CardId public class CardId
{ {
LeoWizard = 4392470, public static int LeoWizard = 4392470;
Bunilla = 69380702 public static int Bunilla = 69380702;
} }
public DoEverythingExecutor(GameAI ai, Duel duel) public DoEverythingExecutor(GameAI ai, Duel duel)
......
This diff is collapsed.
...@@ -6,28 +6,29 @@ using WindBot.Game.AI; ...@@ -6,28 +6,29 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
[Deck("Evilswarm", "AI_Evilswarm")] // NOT FINISHED YET
[Deck("Evilswarm", "AI_Evilswarm", "NotFinished")]
public class EvilswarmExecutor : DefaultExecutor public class EvilswarmExecutor : DefaultExecutor
{ {
public enum CardId public class CardId
{ {
DarkHole = 53129443, public static int DarkHole = 53129443;
CosmicCyclone = 8267140, public static int CosmicCyclone = 8267140;
InfestationPandemic = 27541267, public static int InfestationPandemic = 27541267;
SolemnJudgment = 41420027, public static int SolemnJudgment = 41420027;
SolemnWarning = 84749824, public static int SolemnWarning = 84749824;
SolemnStrike = 40605147 public static int SolemnStrike = 40605147;
} }
public EvilswarmExecutor(GameAI ai, Duel duel) public EvilswarmExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
AddExecutor(ExecutorType.Activate, (int)CardId.DarkHole, DefaultDarkHole); AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.CosmicCyclone, DefaultCosmicCyclone); AddExecutor(ExecutorType.Activate, CardId.CosmicCyclone, DefaultCosmicCyclone);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnJudgment, DefaultSolemnJudgment); AddExecutor(ExecutorType.Activate, CardId.SolemnJudgment, DefaultSolemnJudgment);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnWarning, DefaultSolemnWarning); AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnStrike, DefaultSolemnStrike); AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.SpellSet, (int)CardId.InfestationPandemic); AddExecutor(ExecutorType.SpellSet, CardId.InfestationPandemic);
AddExecutor(ExecutorType.Activate, DefaultDontChainMyself); AddExecutor(ExecutorType.Activate, DefaultDontChainMyself);
AddExecutor(ExecutorType.Summon); AddExecutor(ExecutorType.Summon);
AddExecutor(ExecutorType.SpSummon); AddExecutor(ExecutorType.SpSummon);
......
This diff is collapsed.
...@@ -6,35 +6,36 @@ using WindBot.Game.AI; ...@@ -6,35 +6,36 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
[Deck("Gravekeeper", "AI_Gravekeeper")] // NOT FINISHED YET
[Deck("Gravekeeper", "AI_Gravekeeper", "NotFinished")]
public class GravekeeperExecutor : DefaultExecutor public class GravekeeperExecutor : DefaultExecutor
{ {
public enum CardId public class CardId
{ {
GravekeepersOracle = 25524823, public static int GravekeepersOracle = 25524823;
MaleficStardustDragon = 36521459, public static int MaleficStardustDragon = 36521459;
GravekeepersVisionary = 3825890, public static int GravekeepersVisionary = 3825890;
GravekeepersChief = 62473983, public static int GravekeepersChief = 62473983;
ThunderKingRaiOh = 71564252, public static int ThunderKingRaiOh = 71564252;
GravekeepersCommandant = 17393207, public static int GravekeepersCommandant = 17393207;
GravekeepersAssailant = 25262697, public static int GravekeepersAssailant = 25262697;
GravekeepersDescendant = 30213599, public static int GravekeepersDescendant = 30213599;
GravekeepersSpy = 24317029, public static int GravekeepersSpy = 24317029;
GravekeepersRecruiter = 93023479, public static int GravekeepersRecruiter = 93023479;
AllureOfDarkness = 1475311, public static int AllureOfDarkness = 1475311;
DarkHole = 53129443, public static int DarkHole = 53129443;
RoyalTribute = 72405967, public static int RoyalTribute = 72405967;
GravekeepersStele = 99523325, public static int GravekeepersStele = 99523325;
MysticalSpaceTyphoon = 5318639, public static int MysticalSpaceTyphoon = 5318639;
BookofMoon = 14087893, public static int BookofMoon = 14087893;
HiddenTemplesOfNecrovalley = 70000776, public static int HiddenTemplesOfNecrovalley = 70000776;
Necrovalley = 47355498, public static int Necrovalley = 47355498;
BottomlessTrapHole = 29401950, public static int BottomlessTrapHole = 29401950;
RiteOfSpirit = 30450531, public static int RiteOfSpirit = 30450531;
TorrentialTribute = 53582587, public static int TorrentialTribute = 53582587;
DimensionalPrison = 70342110, public static int DimensionalPrison = 70342110;
SolemnWarning = 84749824, public static int SolemnWarning = 84749824;
ImperialTombsOfNecrovalley = 90434657 public static int ImperialTombsOfNecrovalley = 90434657;
} }
public GravekeeperExecutor(GameAI ai, Duel duel) public GravekeeperExecutor(GameAI ai, Duel duel)
...@@ -42,41 +43,41 @@ namespace WindBot.Game.AI.Decks ...@@ -42,41 +43,41 @@ namespace WindBot.Game.AI.Decks
{ {
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet); AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, (int)CardId.AllureOfDarkness); AddExecutor(ExecutorType.Activate, CardId.AllureOfDarkness);
AddExecutor(ExecutorType.Activate, (int)CardId.DarkHole, DefaultDarkHole); AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.RoyalTribute); AddExecutor(ExecutorType.Activate, CardId.RoyalTribute);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersStele); AddExecutor(ExecutorType.Activate, CardId.GravekeepersStele);
AddExecutor(ExecutorType.Activate, (int)CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon); AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, (int)CardId.BookofMoon, DefaultBookOfMoon); AddExecutor(ExecutorType.Activate, CardId.BookofMoon, DefaultBookOfMoon);
AddExecutor(ExecutorType.Activate, (int)CardId.HiddenTemplesOfNecrovalley, HiddenTemplesOfNecrovalleyEffect); AddExecutor(ExecutorType.Activate, CardId.HiddenTemplesOfNecrovalley, HiddenTemplesOfNecrovalleyEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.Necrovalley, NecrovalleyActivate); AddExecutor(ExecutorType.Activate, CardId.Necrovalley, NecrovalleyActivate);
AddExecutor(ExecutorType.Activate, (int)CardId.BottomlessTrapHole, DefaultUniqueTrap); AddExecutor(ExecutorType.Activate, CardId.BottomlessTrapHole, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnWarning, DefaultSolemnWarning); AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, (int)CardId.DimensionalPrison, DefaultUniqueTrap); AddExecutor(ExecutorType.Activate, CardId.DimensionalPrison, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.RiteOfSpirit, DefaultUniqueTrap); AddExecutor(ExecutorType.Activate, CardId.RiteOfSpirit, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.ImperialTombsOfNecrovalley, DefaultUniqueTrap); AddExecutor(ExecutorType.Activate, CardId.ImperialTombsOfNecrovalley, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.TorrentialTribute, DefaultTorrentialTribute); AddExecutor(ExecutorType.Activate, CardId.TorrentialTribute, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Summon, (int)CardId.GravekeepersOracle); AddExecutor(ExecutorType.Summon, CardId.GravekeepersOracle);
AddExecutor(ExecutorType.SpSummon, (int)CardId.MaleficStardustDragon, MaleficStardustDragonSummon); AddExecutor(ExecutorType.SpSummon, CardId.MaleficStardustDragon, MaleficStardustDragonSummon);
AddExecutor(ExecutorType.Summon, (int)CardId.GravekeepersVisionary); AddExecutor(ExecutorType.Summon, CardId.GravekeepersVisionary);
AddExecutor(ExecutorType.Summon, (int)CardId.GravekeepersChief); AddExecutor(ExecutorType.Summon, CardId.GravekeepersChief);
AddExecutor(ExecutorType.Summon, (int)CardId.ThunderKingRaiOh); AddExecutor(ExecutorType.Summon, CardId.ThunderKingRaiOh);
AddExecutor(ExecutorType.Summon, (int)CardId.GravekeepersCommandant, GravekeepersCommandantSummon); AddExecutor(ExecutorType.Summon, CardId.GravekeepersCommandant, GravekeepersCommandantSummon);
AddExecutor(ExecutorType.Summon, (int)CardId.GravekeepersAssailant); AddExecutor(ExecutorType.Summon, CardId.GravekeepersAssailant);
AddExecutor(ExecutorType.Summon, (int)CardId.GravekeepersDescendant); AddExecutor(ExecutorType.Summon, CardId.GravekeepersDescendant);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.GravekeepersSpy); AddExecutor(ExecutorType.MonsterSet, CardId.GravekeepersSpy);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.GravekeepersRecruiter); AddExecutor(ExecutorType.MonsterSet, CardId.GravekeepersRecruiter);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersOracle); AddExecutor(ExecutorType.Activate, CardId.GravekeepersOracle);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersVisionary); AddExecutor(ExecutorType.Activate, CardId.GravekeepersVisionary);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersChief); AddExecutor(ExecutorType.Activate, CardId.GravekeepersChief);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersCommandant, GravekeepersCommandantEffect); AddExecutor(ExecutorType.Activate, CardId.GravekeepersCommandant, GravekeepersCommandantEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersAssailant, GravekeepersAssailantEffect); AddExecutor(ExecutorType.Activate, CardId.GravekeepersAssailant, GravekeepersAssailantEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersDescendant, GravekeepersDescendantEffect); AddExecutor(ExecutorType.Activate, CardId.GravekeepersDescendant, GravekeepersDescendantEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersSpy, SearchForDescendant); AddExecutor(ExecutorType.Activate, CardId.GravekeepersSpy, SearchForDescendant);
AddExecutor(ExecutorType.Activate, (int)CardId.GravekeepersRecruiter, SearchForDescendant); AddExecutor(ExecutorType.Activate, CardId.GravekeepersRecruiter, SearchForDescendant);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos); AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
} }
...@@ -104,7 +105,7 @@ namespace WindBot.Game.AI.Decks ...@@ -104,7 +105,7 @@ namespace WindBot.Game.AI.Decks
private bool GravekeepersCommandantEffect() 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 true;
return false; return false;
} }
...@@ -139,7 +140,7 @@ namespace WindBot.Game.AI.Decks ...@@ -139,7 +140,7 @@ namespace WindBot.Game.AI.Decks
private bool SearchForDescendant() private bool SearchForDescendant()
{ {
AI.SelectCard((int)CardId.GravekeepersDescendant); AI.SelectCard(CardId.GravekeepersDescendant);
return true; return true;
} }
} }
......
...@@ -6,26 +6,27 @@ using WindBot.Game.AI; ...@@ -6,26 +6,27 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
[Deck("Graydle", "AI_Graydle")] // NOT FINISHED YET
[Deck("Graydle", "AI_Graydle", "NotFinished")]
public class GraydleExecutor : DefaultExecutor public class GraydleExecutor : DefaultExecutor
{ {
public enum CardId public class CardId
{ {
DarkHole = 53129443, public static int DarkHole = 53129443;
CosmicCyclone = 8267140, public static int CosmicCyclone = 8267140;
SolemnJudgment = 41420027, public static int SolemnJudgment = 41420027;
SolemnWarning = 84749824, public static int SolemnWarning = 84749824;
SolemnStrike = 40605147 public static int SolemnStrike = 40605147;
} }
public GraydleExecutor(GameAI ai, Duel duel) public GraydleExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
AddExecutor(ExecutorType.Activate, (int)CardId.DarkHole, DefaultDarkHole); AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.CosmicCyclone, DefaultCosmicCyclone); AddExecutor(ExecutorType.Activate, CardId.CosmicCyclone, DefaultCosmicCyclone);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnJudgment, DefaultSolemnJudgment); AddExecutor(ExecutorType.Activate, CardId.SolemnJudgment, DefaultSolemnJudgment);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnWarning, DefaultSolemnWarning); AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnStrike, DefaultSolemnStrike); AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, DefaultDontChainMyself); AddExecutor(ExecutorType.Activate, DefaultDontChainMyself);
AddExecutor(ExecutorType.MonsterSet); AddExecutor(ExecutorType.MonsterSet);
AddExecutor(ExecutorType.SpSummon); AddExecutor(ExecutorType.SpSummon);
......
...@@ -6,84 +6,84 @@ using YGOSharp.OCGWrapper.Enums; ...@@ -6,84 +6,84 @@ using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
[Deck("Horus", "AI_Horus")] [Deck("Horus", "AI_Horus", "Easy")]
public class HorusExecutor : DefaultExecutor public class HorusExecutor : DefaultExecutor
{ {
public enum CardId public class CardId
{ {
AlexandriteDragon = 43096270, public static int AlexandriteDragon = 43096270;
LusterDragon = 11091375, public static int LusterDragon = 11091375;
WhiteNightDragon = 79473793, public static int WhiteNightDragon = 79473793;
HorusTheBlackFlameDragonLv8 = 48229808, public static int HorusTheBlackFlameDragonLv8 = 48229808;
HorusTheBlackFlameDragonLv6 = 11224103, public static int HorusTheBlackFlameDragonLv6 = 11224103;
CyberDragon = 70095154, public static int CyberDragon = 70095154;
AxeDragonute = 84914462, public static int AxeDragonute = 84914462;
DodgerDragon = 47013502, public static int DodgerDragon = 47013502;
GolemDragon = 9666558, public static int GolemDragon = 9666558;
Raigeki = 12580477, public static int Raigeki = 12580477;
HammerShot = 26412047, public static int HammerShot = 26412047;
DarkHole = 53129443, public static int DarkHole = 53129443;
Fissure = 66788016, public static int Fissure = 66788016;
StampingDestruction = 81385346, public static int StampingDestruction = 81385346;
FoolishBurial = 81439173, public static int FoolishBurial = 81439173;
MonsterReborn = 83764718, public static int MonsterReborn = 83764718;
MysticalSpaceTyphoon = 5318639, public static int MysticalSpaceTyphoon = 5318639;
BellowOfTheSilverDragon = 80600103, public static int BellowOfTheSilverDragon = 80600103;
Mountain = 50913601, public static int Mountain = 50913601;
DragonsRebirth = 20638610, public static int DragonsRebirth = 20638610;
MirrorForce = 44095762, public static int MirrorForce = 44095762;
DimensionalPrison = 70342110 public static int DimensionalPrison = 70342110;
} }
public HorusExecutor(GameAI ai, Duel duel) : base(ai, duel) public HorusExecutor(GameAI ai, Duel duel) : base(ai, duel)
{ {
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet); AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, (int)CardId.HorusTheBlackFlameDragonLv6); AddExecutor(ExecutorType.Activate, CardId.HorusTheBlackFlameDragonLv6);
AddExecutor(ExecutorType.Activate, (int)CardId.StampingDestruction, DefaultMysticalSpaceTyphoon); AddExecutor(ExecutorType.Activate, CardId.StampingDestruction, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, (int)CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon); AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, (int)CardId.FoolishBurial, FoolishBurial); AddExecutor(ExecutorType.Activate, CardId.FoolishBurial, FoolishBurial);
AddExecutor(ExecutorType.Activate, (int)CardId.Mountain, DefaultField); AddExecutor(ExecutorType.Activate, CardId.Mountain, DefaultField);
AddExecutor(ExecutorType.Activate, (int)CardId.DarkHole, DefaultDarkHole); 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, CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, (int)CardId.HammerShot, DefaultHammerShot); AddExecutor(ExecutorType.Activate, CardId.HammerShot, DefaultHammerShot);
AddExecutor(ExecutorType.Activate, (int)CardId.Fissure); AddExecutor(ExecutorType.Activate, CardId.Fissure);
AddExecutor(ExecutorType.Activate, (int)CardId.BellowOfTheSilverDragon, BellowOfTheSilverDragon); AddExecutor(ExecutorType.Activate, CardId.BellowOfTheSilverDragon, BellowOfTheSilverDragon);
AddExecutor(ExecutorType.Activate, (int)CardId.MonsterReborn, MonsterReborn); AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, MonsterReborn);
AddExecutor(ExecutorType.Summon, (int)CardId.WhiteNightDragon, WhiteNightDragon); AddExecutor(ExecutorType.Summon, CardId.WhiteNightDragon, WhiteNightDragon);
AddExecutor(ExecutorType.Summon, (int)CardId.HorusTheBlackFlameDragonLv6, DefaultTributeSummon); AddExecutor(ExecutorType.Summon, CardId.HorusTheBlackFlameDragonLv6, DefaultTributeSummon);
AddExecutor(ExecutorType.Summon, (int)CardId.AlexandriteDragon); AddExecutor(ExecutorType.Summon, CardId.AlexandriteDragon);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.AxeDragonute); AddExecutor(ExecutorType.SummonOrSet, CardId.AxeDragonute);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.DodgerDragon); AddExecutor(ExecutorType.SummonOrSet, CardId.DodgerDragon);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.GolemDragon); AddExecutor(ExecutorType.MonsterSet, CardId.GolemDragon);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.LusterDragon); AddExecutor(ExecutorType.SummonOrSet, CardId.LusterDragon);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos); AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.Activate, (int)CardId.HorusTheBlackFlameDragonLv8, HorusTheBlackFlameDragonLv8); AddExecutor(ExecutorType.Activate, CardId.HorusTheBlackFlameDragonLv8, HorusTheBlackFlameDragonLv8);
AddExecutor(ExecutorType.Activate, (int)CardId.MirrorForce, DefaultTrap); AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.DimensionalPrison, DefaultTrap); AddExecutor(ExecutorType.Activate, CardId.DimensionalPrison, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.DragonsRebirth, DragonsRebirth); AddExecutor(ExecutorType.Activate, CardId.DragonsRebirth, DragonsRebirth);
} }
private bool FoolishBurial() private bool FoolishBurial()
{ {
if (Bot.HasInGraveyard((int)CardId.WhiteNightDragon)) if (Bot.HasInGraveyard(CardId.WhiteNightDragon))
return false; return false;
if (Bot.HasInHand((int)CardId.WhiteNightDragon)) if (Bot.HasInHand(CardId.WhiteNightDragon))
return false; return false;
int remaining = 2; int remaining = 2;
foreach (ClientCard card in Bot.Banished) foreach (ClientCard card in Bot.Banished)
if (card.Id == (int)CardId.WhiteNightDragon) if (card.Id == CardId.WhiteNightDragon)
remaining--; remaining--;
if (remaining > 0) if (remaining > 0)
{ {
AI.SelectCard((int)CardId.WhiteNightDragon); AI.SelectCard(CardId.WhiteNightDragon);
return true; return true;
} }
return false; return false;
...@@ -197,7 +197,7 @@ namespace WindBot.Game.AI.Decks ...@@ -197,7 +197,7 @@ namespace WindBot.Game.AI.Decks
ClientCard monster = cards[i]; ClientCard monster = cards[i];
if (monster.Attack < 2300) if (monster.Attack < 2300)
return false; 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; summonCard = monster;
break; break;
......
This diff is collapsed.
...@@ -6,13 +6,13 @@ using WindBot.Game.AI; ...@@ -6,13 +6,13 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
[Deck("MokeyMokey", "AI_MokeyMokey")] [Deck("MokeyMokey", "AI_MokeyMokey", "Easy")]
public class MokeyMokeyExecutor : DefaultExecutor public class MokeyMokeyExecutor : DefaultExecutor
{ {
public enum CardId public class CardId
{ {
LeoWizard = 4392470, public static int LeoWizard = 4392470;
Bunilla = 69380702 public static int Bunilla = 69380702;
} }
private int RockCount = 0; private int RockCount = 0;
......
...@@ -6,13 +6,13 @@ using WindBot.Game.AI; ...@@ -6,13 +6,13 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
[Deck("MokeyMokeyKing", "AI_MokeyMokeyKing")] [Deck("MokeyMokeyKing", "AI_MokeyMokeyKing", "Easy")]
public class MokeyMokeyKingExecutor : DefaultExecutor public class MokeyMokeyKingExecutor : DefaultExecutor
{ {
public enum CardId public class CardId
{ {
LeoWizard = 4392470, public static int LeoWizard = 4392470;
Bunilla = 69380702 public static int Bunilla = 69380702;
} }
private int RockCount = 0; private int RockCount = 0;
......
This diff is collapsed.
...@@ -6,47 +6,67 @@ using WindBot.Game.AI; ...@@ -6,47 +6,67 @@ using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
[Deck("OldSchool", "AI_OldSchool")] [Deck("OldSchool", "AI_OldSchool", "Easy")]
public class OldSchoolExecutor : DefaultExecutor 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) public OldSchoolExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
AddExecutor(ExecutorType.Activate, 19613556, DefaultHeavyStorm); AddExecutor(ExecutorType.Activate, CardId.HeavyStorm, DefaultHeavyStorm);
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet); AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, 53129443, DefaultDarkHole); AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.Raigeki, DefaultRaigeki); AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, 26412047, DefaultHammerShot); AddExecutor(ExecutorType.Activate, CardId.HammerShot, DefaultHammerShot);
AddExecutor(ExecutorType.Activate, 66788016); AddExecutor(ExecutorType.Activate, CardId.Fissure);
AddExecutor(ExecutorType.Activate, 72302403, SwordsOfRevealingLight); AddExecutor(ExecutorType.Activate, CardId.SwordsOfRevealingLight, SwordsOfRevealingLight);
AddExecutor(ExecutorType.Activate, 43422537, DoubleSummon); AddExecutor(ExecutorType.Activate, CardId.DoubleSummon, DoubleSummon);
AddExecutor(ExecutorType.Summon, 83104731, DefaultTributeSummon); AddExecutor(ExecutorType.Summon, CardId.AncientGearGolem, DefaultTributeSummon);
AddExecutor(ExecutorType.Summon, 6631034, DefaultTributeSummon); AddExecutor(ExecutorType.Summon, CardId.Frostosaurus, DefaultTributeSummon);
AddExecutor(ExecutorType.SummonOrSet, 43096270); AddExecutor(ExecutorType.SummonOrSet, CardId.AlexandriteDragon);
AddExecutor(ExecutorType.SummonOrSet, 69247929); AddExecutor(ExecutorType.SummonOrSet, CardId.GeneWarpedWarwolf);
AddExecutor(ExecutorType.MonsterSet, 30190809); AddExecutor(ExecutorType.MonsterSet, CardId.GearGolemTheMovingFortress);
AddExecutor(ExecutorType.SummonOrSet, 77542832); AddExecutor(ExecutorType.SummonOrSet, CardId.EvilswarmHeliotrope);
AddExecutor(ExecutorType.SummonOrSet, 11091375); AddExecutor(ExecutorType.SummonOrSet, CardId.LusterDragon);
AddExecutor(ExecutorType.SummonOrSet, 35052053); AddExecutor(ExecutorType.SummonOrSet, CardId.InsectKnight);
AddExecutor(ExecutorType.SummonOrSet, 49881766); AddExecutor(ExecutorType.SummonOrSet, CardId.ArchfiendSoldier);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos); AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.Activate, 44095762, DefaultTrap); AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultTrap);
AddExecutor(ExecutorType.Activate, 70342110, DefaultTrap); AddExecutor(ExecutorType.Activate, CardId.DimensionalPrison, DefaultTrap);
} }
private int _lastDoubleSummon; private int _lastDoubleSummon;
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) 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 true;
return base.OnPreBattleBetween(attacker, defender); return base.OnPreBattleBetween(attacker, defender);
} }
...@@ -91,7 +111,7 @@ namespace WindBot.Game.AI.Decks ...@@ -91,7 +111,7 @@ namespace WindBot.Game.AI.Decks
if (handCard.IsFacedown()) if (handCard.IsFacedown())
return true; return true;
} }
return AI.Utils.IsEnemyBetter(true, false); return AI.Utils.IsOneEnemyBetter(true);
} }
} }
} }
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -10,11 +10,13 @@ namespace WindBot.Game.AI ...@@ -10,11 +10,13 @@ namespace WindBot.Game.AI
{ {
public string Deck { get; private set; } public string Deck { get; private set; }
public Type Type { 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; Deck = deck;
Type = type; Type = type;
Level = level;
} }
} }
...@@ -39,7 +41,7 @@ namespace WindBot.Game.AI ...@@ -39,7 +41,7 @@ namespace WindBot.Game.AI
if (attribute is DeckAttribute) if (attribute is DeckAttribute)
{ {
DeckAttribute deck = (DeckAttribute)attribute; 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 ...@@ -59,7 +61,13 @@ namespace WindBot.Game.AI
if (deck != null && _decks.ContainsKey(deck)) if (deck != null && _decks.ContainsKey(deck))
infos = _decks[deck]; infos = _decks[deck];
else else
infos = _list[_rand.Next(_list.Count)]; {
do
{
infos = _list[_rand.Next(_list.Count)];
}
while (infos.Level != "Normal");
}
Executor executor = (Executor)Activator.CreateInstance(infos.Type, ai, duel); Executor executor = (Executor)Activator.CreateInstance(infos.Type, ai, duel);
executor.Deck = infos.Deck; executor.Deck = infos.Deck;
......
This diff is collapsed.
namespace WindBot.Game.AI.Enums namespace WindBot.Game.AI.Enums
{ {
/// <summary>
/// Cards that are dangerous to attack.
/// </summary>
public enum DangerousMonster public enum DangerousMonster
{ {
LionHeart = 54366836, LionHeart = 54366836,
Yubel = 78371393, Yubel = 78371393,
YubelIncarnate = 4779091, YubelIncarnate = 4779091,
YubelNightmare = 31764700, YubelNightmare = 31764700,
MetaionTheTimelord = 74530899, MetaionTheTimelord = 74530899
Number39Utopia = 84013237,
NumberS39UtopiatheLightning = 56832966
} }
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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