Commit e6585bbf authored by nanahira's avatar nanahira

Merge branch 'master' of github.com:IceYGO/windbot

parents bb7f6a1b bbb765d1
Pipeline #2687 failed with stages
in 41 seconds
using YGOSharp.OCGWrapper; using YGOSharp.OCGWrapper;
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic; using System.Collections.Generic;
using WindBot; using WindBot;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
using System.Linq; using System.Linq;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
[Deck("FamiliarPossessed", "AI_FamiliarPossessed")] [Deck("FamiliarPossessed", "AI_FamiliarPossessed")]
public class FamiliarPossessedExecutor : DefaultExecutor public class FamiliarPossessedExecutor : DefaultExecutor
{ {
public class CardId public class CardId
{ {
public const int MetalSnake = 71197066; public const int MetalSnake = 71197066;
public const int InspectBoarder = 15397015; public const int InspectBoarder = 15397015;
public const int AshBlossomAndJoyousSpring = 14558127; public const int AshBlossomAndJoyousSpring = 14558127;
public const int GrenMajuDaEizo = 36584821; public const int GrenMajuDaEizo = 36584821;
public const int MaxxC = 23434538; public const int MaxxC = 23434538;
public const int Aussa = 31887906; public const int Aussa = 31887906;
public const int Eria = 68881650; public const int Eria = 68881650;
public const int Wynn = 31764354; public const int Wynn = 31764354;
public const int Hiita = 4376659; public const int Hiita = 4376659;
public const int Lyna = 40542825; public const int Lyna = 40542825;
public const int Awakening = 62256492; public const int Awakening = 62256492;
public const int Unpossessed = 25704359; public const int Unpossessed = 25704359;
public const int NaturalExterio = 99916754; public const int NaturalExterio = 99916754;
public const int NaturalBeast = 33198837; public const int NaturalBeast = 33198837;
public const int SwordsmanLV7 = 37267041; public const int SwordsmanLV7 = 37267041;
public const int RoyalDecreel = 51452091; public const int RoyalDecreel = 51452091;
public const int HarpieFeatherDuster = 18144506; public const int HarpieFeatherDuster = 18144506;
public const int PotOfDesires = 35261759; public const int PotOfDesires = 35261759;
public const int PotofExtravagance = 49238328; public const int PotofExtravagance = 49238328;
public const int Scapegoat = 73915051; public const int Scapegoat = 73915051;
public const int MacroCosmos = 30241314; public const int MacroCosmos = 30241314;
public const int Crackdown = 36975314; public const int Crackdown = 36975314;
public const int ImperialOrder = 61740673; public const int ImperialOrder = 61740673;
public const int SolemnWarning = 84749824; public const int SolemnWarning = 84749824;
public const int SolemStrike = 40605147; public const int SolemStrike = 40605147;
public const int SolemnJudgment = 41420027; public const int SolemnJudgment = 41420027;
public const int SkillDrain = 82732705; public const int SkillDrain = 82732705;
public const int Mistake = 59305593; public const int Mistake = 59305593;
public const int BorreloadDragon = 31833038; public const int BorreloadDragon = 31833038;
public const int BirrelswordDragon = 85289965; public const int BirrelswordDragon = 85289965;
public const int KnightmareGryphon = 65330383; public const int KnightmareGryphon = 65330383;
public const int KnightmareUnicorn = 38342335; public const int KnightmareUnicorn = 38342335;
public const int KnightmarePhoenix = 2857636; public const int KnightmarePhoenix = 2857636;
public const int KnightmareCerberus = 75452921; public const int KnightmareCerberus = 75452921;
public const int LinkSpider = 98978921; public const int LinkSpider = 98978921;
public const int Linkuriboh = 41999284; public const int Linkuriboh = 41999284;
public const int GagagaCowboy = 12014404; public const int GagagaCowboy = 12014404;
public const int AussaP = 97661969; public const int AussaP = 97661969;
public const int EriaP = 73309655; public const int EriaP = 73309655;
public const int WynnP = 30674956; public const int WynnP = 30674956;
public const int HiitaP = 48815792; public const int HiitaP = 48815792;
public const int LynaP = 9839945; public const int LynaP = 9839945;
// side
// side public const int Raigeki = 12580477;
public const int Raigeki = 12580477; public const int lightningStorm = 14532163;
public const int lightningStorm = 14532163; public const int CosmicCyclone = 8267140;
public const int CosmicCyclone = 8267140; public const int CalledByTheGrave = 24224830;
public const int CalledByTheGrave = 24224830; public const int CrossoutDesignator = 65681983;
public const int CrossoutDesignator = 65681983; public const int InfiniteImpermanence = 10045474;
public const int InfiniteImpermanence = 10045474; }
}
public FamiliarPossessedExecutor(GameAI ai, Duel duel)
public FamiliarPossessedExecutor(GameAI ai, Duel duel) : base(ai, duel)
: base(ai, duel) {
{ // do first
// do first AddExecutor(ExecutorType.Activate, CardId.PotofExtravagance, PotofExtravaganceActivate);
AddExecutor(ExecutorType.Activate, CardId.PotofExtravagance, PotofExtravaganceActivate); // burn if enemy's LP is below 800
// burn if enemy's LP is below 800 AddExecutor(ExecutorType.SpSummon, CardId.GagagaCowboy, GagagaCowboySummon);
AddExecutor(ExecutorType.SpSummon, CardId.GagagaCowboy, GagagaCowboySummon); AddExecutor(ExecutorType.Activate, CardId.GagagaCowboy);
AddExecutor(ExecutorType.Activate, CardId.GagagaCowboy); //Sticker
//Sticker AddExecutor(ExecutorType.Activate, CardId.MacroCosmos, MacroCosmoseff);
AddExecutor(ExecutorType.Activate, CardId.MacroCosmos, MacroCosmoseff); //counter
//counter AddExecutor(ExecutorType.Activate, CardId.CalledByTheGrave, DefaultCalledByTheGrave);
AddExecutor(ExecutorType.Activate, CardId.CalledByTheGrave, DefaultCalledByTheGrave); // AddExecutor(ExecutorType.Activate, CardId.CrossoutDesignator, DefaultCalledByTheGrave);
// AddExecutor(ExecutorType.Activate, CardId.CrossoutDesignator, DefaultCalledByTheGrave); AddExecutor(ExecutorType.Activate, CardId.InfiniteImpermanence, DefaultInfiniteImpermanence);
AddExecutor(ExecutorType.Activate, CardId.InfiniteImpermanence, DefaultInfiniteImpermanence); AddExecutor(ExecutorType.Activate, CardId.AshBlossomAndJoyousSpring, DefaultAshBlossomAndJoyousSpring);
AddExecutor(ExecutorType.Activate, CardId.AshBlossomAndJoyousSpring, DefaultAshBlossomAndJoyousSpring); AddExecutor(ExecutorType.Activate, CardId.MaxxC, DefaultMaxxC);
AddExecutor(ExecutorType.Activate, CardId.MaxxC, DefaultMaxxC); AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning); AddExecutor(ExecutorType.Activate, CardId.SolemStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, CardId.SolemStrike, DefaultSolemnStrike); AddExecutor(ExecutorType.Activate, CardId.ImperialOrder, ImperialOrderfirst);
AddExecutor(ExecutorType.Activate, CardId.ImperialOrder, ImperialOrderfirst); AddExecutor(ExecutorType.Activate, CardId.ImperialOrder, ImperialOrdereff);
AddExecutor(ExecutorType.Activate, CardId.ImperialOrder, ImperialOrdereff); AddExecutor(ExecutorType.Activate, CardId.SolemnJudgment, DefaultSolemnJudgment);
AddExecutor(ExecutorType.Activate, CardId.SolemnJudgment, DefaultSolemnJudgment); AddExecutor(ExecutorType.Activate, CardId.SkillDrain, SkillDrainEffect);
AddExecutor(ExecutorType.Activate, CardId.SkillDrain, SkillDrainEffect); AddExecutor(ExecutorType.Activate, CardId.Mistake, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.Mistake, DefaultUniqueTrap); AddExecutor(ExecutorType.Activate, CardId.Awakening);
AddExecutor(ExecutorType.Activate, CardId.Awakening); AddExecutor(ExecutorType.Activate, CardId.Unpossessed, UnpossessedEffect);
AddExecutor(ExecutorType.Activate, CardId.Unpossessed, UnpossessedEffect); //first do
//first do AddExecutor(ExecutorType.Activate, CardId.lightningStorm, DefaultLightingStorm);
AddExecutor(ExecutorType.Activate, CardId.lightningStorm, DefaultLightingStorm); AddExecutor(ExecutorType.Activate, CardId.HarpieFeatherDuster, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, CardId.HarpieFeatherDuster, DefaultHarpiesFeatherDusterFirst); AddExecutor(ExecutorType.Activate, CardId.CosmicCyclone, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.CosmicCyclone, DefaultMysticalSpaceTyphoon); AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki); AddExecutor(ExecutorType.Activate, CardId.PotOfDesires, PotOfDesireseff);
//sp
AddExecutor(ExecutorType.Activate, CardId.PotOfDesires, PotOfDesireseff); AddExecutor(ExecutorType.Activate, CardId.Linkuriboh, Linkuriboheff);
//sp AddExecutor(ExecutorType.SpSummon, CardId.Linkuriboh, Linkuribohsp);
AddExecutor(ExecutorType.Activate, CardId.Linkuriboh, Linkuriboheff); AddExecutor(ExecutorType.SpSummon, CardId.KnightmareCerberus, Knightmaresp);
AddExecutor(ExecutorType.SpSummon, CardId.Linkuriboh, Linkuribohsp); AddExecutor(ExecutorType.SpSummon, CardId.KnightmarePhoenix, Knightmaresp);
AddExecutor(ExecutorType.SpSummon, CardId.KnightmareCerberus, Knightmaresp); AddExecutor(ExecutorType.SpSummon, CardId.AussaP, AussaPsp);
AddExecutor(ExecutorType.SpSummon, CardId.KnightmarePhoenix, Knightmaresp); AddExecutor(ExecutorType.Activate, CardId.AussaP, AussaPeff);
AddExecutor(ExecutorType.SpSummon, CardId.AussaP, AussaPsp); AddExecutor(ExecutorType.SpSummon, CardId.EriaP, EriaPsp);
AddExecutor(ExecutorType.Activate, CardId.AussaP, AussaPeff); AddExecutor(ExecutorType.Activate, CardId.EriaP, EriaPeff);
AddExecutor(ExecutorType.SpSummon, CardId.EriaP, EriaPsp); AddExecutor(ExecutorType.SpSummon, CardId.WynnP, WynnPsp);
AddExecutor(ExecutorType.Activate, CardId.EriaP, EriaPeff); AddExecutor(ExecutorType.Activate, CardId.WynnP, WynnPeff);
AddExecutor(ExecutorType.SpSummon, CardId.WynnP, WynnPsp); AddExecutor(ExecutorType.SpSummon, CardId.HiitaP, HiitaPsp);
AddExecutor(ExecutorType.Activate, CardId.WynnP, WynnPeff); AddExecutor(ExecutorType.Activate, CardId.HiitaP, HiitaPeff);
AddExecutor(ExecutorType.SpSummon, CardId.HiitaP, HiitaPsp); AddExecutor(ExecutorType.SpSummon, CardId.LynaP, LynaPsp);
AddExecutor(ExecutorType.Activate, CardId.HiitaP, HiitaPeff); AddExecutor(ExecutorType.Activate, CardId.LynaP, LynaPeff);
AddExecutor(ExecutorType.SpSummon, CardId.LynaP, LynaPsp);
AddExecutor(ExecutorType.Activate, CardId.LynaP, LynaPeff); AddExecutor(ExecutorType.SpSummon, CardId.Linkuriboh, Linkuribohsp);
AddExecutor(ExecutorType.SpSummon, CardId.LinkSpider);
AddExecutor(ExecutorType.SpSummon, CardId.Linkuriboh, Linkuribohsp); AddExecutor(ExecutorType.SpSummon, CardId.BorreloadDragon, BorreloadDragonsp);
AddExecutor(ExecutorType.SpSummon, CardId.LinkSpider); AddExecutor(ExecutorType.Activate, CardId.BorreloadDragon, BorreloadDragoneff);
AddExecutor(ExecutorType.SpSummon, CardId.BorreloadDragon, BorreloadDragonsp); AddExecutor(ExecutorType.SpSummon, CardId.BirrelswordDragon, BirrelswordDragonsp);
AddExecutor(ExecutorType.Activate, CardId.BorreloadDragon, BorreloadDragoneff); AddExecutor(ExecutorType.Activate, CardId.BirrelswordDragon, BirrelswordDragoneff);
AddExecutor(ExecutorType.SpSummon, CardId.BirrelswordDragon, BirrelswordDragonsp); // normal summon
AddExecutor(ExecutorType.Activate, CardId.BirrelswordDragon, BirrelswordDragoneff); AddExecutor(ExecutorType.Summon, CardId.InspectBoarder, InspectBoardersummon);
// normal summon AddExecutor(ExecutorType.Summon, CardId.GrenMajuDaEizo, GrenMajuDaEizosummon);
AddExecutor(ExecutorType.Summon, CardId.InspectBoarder, InspectBoardersummon); AddExecutor(ExecutorType.SpSummon, CardId.BorreloadDragon, BorreloadDragonspsecond);
AddExecutor(ExecutorType.Summon, CardId.GrenMajuDaEizo, GrenMajuDaEizosummon);
AddExecutor(ExecutorType.SpSummon, CardId.BorreloadDragon, BorreloadDragonspsecond); AddExecutor(ExecutorType.Summon, CardId.Aussa, FamiliarPossessedsummon);
AddExecutor(ExecutorType.Summon, CardId.Eria, FamiliarPossessedsummon);
AddExecutor(ExecutorType.Summon, CardId.Aussa, FamiliarPossessedsummon); AddExecutor(ExecutorType.Summon, CardId.Wynn, FamiliarPossessedsummon);
AddExecutor(ExecutorType.Summon, CardId.Eria, FamiliarPossessedsummon); AddExecutor(ExecutorType.Summon, CardId.Hiita, FamiliarPossessedsummon);
AddExecutor(ExecutorType.Summon, CardId.Wynn, FamiliarPossessedsummon); AddExecutor(ExecutorType.Summon, CardId.Lyna, FamiliarPossessedsummon);
AddExecutor(ExecutorType.Summon, CardId.Hiita, FamiliarPossessedsummon);
AddExecutor(ExecutorType.Summon, CardId.Lyna, FamiliarPossessedsummon); AddExecutor(ExecutorType.Activate, CardId.MetalSnake, MetalSnakesp);
AddExecutor(ExecutorType.Activate, CardId.MetalSnake, MetalSnakeeff);
AddExecutor(ExecutorType.Activate, CardId.MetalSnake, MetalSnakesp); //spell
AddExecutor(ExecutorType.Activate, CardId.MetalSnake, MetalSnakeeff); AddExecutor(ExecutorType.Activate, CardId.Crackdown, Crackdowneff);
//spell AddExecutor(ExecutorType.Activate, CardId.Scapegoat, DefaultScapegoat);
AddExecutor(ExecutorType.Activate, CardId.Crackdown, Crackdowneff); AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.Activate, CardId.Scapegoat, DefaultScapegoat); //set
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos); AddExecutor(ExecutorType.SpellSet, SpellSet);
//set }
AddExecutor(ExecutorType.SpellSet, SpellSet);
} public void SelectSTPlace(ClientCard card = null, bool avoid_Impermanence = false, List<int> avoid_list = null)
{
public void SelectSTPlace(ClientCard card = null, bool avoid_Impermanence = false, List<int> avoid_list = null) List<int> list = new List<int> { 0, 1, 2, 3, 4 };
{ int n = list.Count;
List<int> list = new List<int> { 0, 1, 2, 3, 4 }; while (n-- > 1)
int n = list.Count; {
while (n-- > 1) int index = Program.Rand.Next(n + 1);
{ int temp = list[index];
int index = Program.Rand.Next(n + 1); list[index] = list[n];
int temp = list[index]; list[n] = temp;
list[index] = list[n]; }
list[n] = temp; foreach (int seq in list)
} {
foreach (int seq in list) int zone = (int)System.Math.Pow(2, seq);
{ if (Bot.SpellZone[seq] == null)
int zone = (int)System.Math.Pow(2, seq); {
if (Bot.SpellZone[seq] == null) if (card != null && card.Location == CardLocation.Hand && avoid_Impermanence) continue;
{ if (avoid_list != null && avoid_list.Contains(seq)) continue;
if (card != null && card.Location == CardLocation.Hand && avoid_Impermanence) continue; AI.SelectPlace(zone);
if (avoid_list != null && avoid_list.Contains(seq)) continue; return;
AI.SelectPlace(zone); };
return; }
}; AI.SelectPlace(0);
} }
AI.SelectPlace(0);
} public bool SpellNegatable(bool isCounter = false, ClientCard target = null)
{
public bool SpellNegatable(bool isCounter = false, ClientCard target = null) // target default set
{ if (target == null) target = Card;
// target default set // won't negate if not on field
if (target == null) target = Card; if (target.Location != CardLocation.SpellZone && target.Location != CardLocation.Hand) return false;
// won't negate if not on field
if (target.Location != CardLocation.SpellZone && target.Location != CardLocation.Hand) return false; // negate judge
if (Enemy.HasInMonstersZone(CardId.NaturalExterio, true) && !isCounter) return true;
// negate judge if (target.IsSpell())
if (Enemy.HasInMonstersZone(CardId.NaturalExterio, true) && !isCounter) return true; {
if (target.IsSpell()) if (Enemy.HasInMonstersZone(CardId.NaturalBeast, true)) return true;
{ if (Enemy.HasInSpellZone(CardId.ImperialOrder, true) || Bot.HasInSpellZone(CardId.ImperialOrder, true)) return true;
if (Enemy.HasInMonstersZone(CardId.NaturalBeast, true)) return true; if (Enemy.HasInMonstersZone(CardId.SwordsmanLV7, true) || Bot.HasInMonstersZone(CardId.SwordsmanLV7, true)) return true;
if (Enemy.HasInSpellZone(CardId.ImperialOrder, true) || Bot.HasInSpellZone(CardId.ImperialOrder, true)) return true; }
if (Enemy.HasInMonstersZone(CardId.SwordsmanLV7, true) || Bot.HasInMonstersZone(CardId.SwordsmanLV7, true)) return true; if (target.IsTrap())
} {
if (target.IsTrap()) if (Enemy.HasInSpellZone(CardId.RoyalDecreel, true) || Bot.HasInSpellZone(CardId.RoyalDecreel, true)) return true;
{ }
if (Enemy.HasInSpellZone(CardId.RoyalDecreel, true) || Bot.HasInSpellZone(CardId.RoyalDecreel, true)) return true; // how to get here?
} return false;
// how to get here? }
return false;
} private bool MacroCosmoseff()
{
private bool MacroCosmoseff()
{ return (Duel.LastChainPlayer == 1 || Duel.LastSummonPlayer == 1 || Duel.Player == 0) && UniqueFaceupSpell();
}
return (Duel.LastChainPlayer == 1 || Duel.LastSummonPlayer == 1 || Duel.Player == 0) && UniqueFaceupSpell();
} private bool ImperialOrderfirst()
{
private bool ImperialOrderfirst() if (Util.GetLastChainCard() != null && Util.GetLastChainCard().IsCode(CardId.PotOfDesires))
{ return false;
if (Util.GetLastChainCard() != null && Util.GetLastChainCard().IsCode(CardId.PotOfDesires)) return DefaultOnBecomeTarget() && Util.GetLastChainCard().HasType(CardType.Spell);
return false; }
return DefaultOnBecomeTarget() && Util.GetLastChainCard().HasType(CardType.Spell);
} private bool ImperialOrdereff()
{
private bool ImperialOrdereff() if (Util.GetLastChainCard() != null && Util.GetLastChainCard().IsCode(CardId.PotOfDesires))
{ return false;
if (Util.GetLastChainCard() != null && Util.GetLastChainCard().IsCode(CardId.PotOfDesires)) if (Duel.LastChainPlayer == 1)
return false; {
if (Duel.LastChainPlayer == 1) foreach (ClientCard check in Enemy.GetSpells())
{ {
foreach (ClientCard check in Enemy.GetSpells()) if (Util.GetLastChainCard() == check)
{ return true;
if (Util.GetLastChainCard() == check) }
return true; }
} return false;
} }
return false;
} private bool PotOfDesireseff()
{
private bool PotOfDesireseff() return Bot.Deck.Count > 14 && !DefaultSpellWillBeNegated();
{ }
return Bot.Deck.Count > 14 && !DefaultSpellWillBeNegated();
} // activate of PotofExtravagance
public bool PotofExtravaganceActivate()
// activate of PotofExtravagance {
public bool PotofExtravaganceActivate() // won't activate if it'll be negate
{ if (SpellNegatable()) return false;
// won't activate if it'll be negate SelectSTPlace(Card, true);
if (SpellNegatable()) return false; AI.SelectOption(1);
SelectSTPlace(Card, true); return true;
AI.SelectOption(1); }
return true;
} private bool Crackdowneff()
{
private bool Crackdowneff() if (Util.GetOneEnemyBetterThanMyBest(true, true) != null && Bot.UnderAttack)
{ AI.SelectCard(Util.GetOneEnemyBetterThanMyBest(true, true));
if (Util.GetOneEnemyBetterThanMyBest(true, true) != null && Bot.UnderAttack) return Util.GetOneEnemyBetterThanMyBest(true, true) != null && Bot.UnderAttack;
AI.SelectCard(Util.GetOneEnemyBetterThanMyBest(true, true)); }
return Util.GetOneEnemyBetterThanMyBest(true, true) != null && Bot.UnderAttack;
} private bool SkillDrainEffect()
{
private bool SkillDrainEffect() return (Bot.LifePoints > 1000) && DefaultUniqueTrap();
{ }
return (Bot.LifePoints > 1000) && DefaultUniqueTrap();
} private bool UnpossessedEffect()
{
private bool UnpossessedEffect() AI.SelectCard(new List<int>() {
{ CardId.Lyna,
AI.SelectCard(new List<int>() { CardId.Hiita,
CardId.Lyna, CardId.Wynn,
CardId.Hiita, CardId.Eria,
CardId.Wynn, CardId.Aussa
CardId.Eria, });
CardId.Aussa return true;
}); }
return true;
} private bool InspectBoardersummon()
{
private bool InspectBoardersummon() if (Bot.MonsterZone[0] == null)
{ AI.SelectPlace(Zones.z0);
if (Bot.MonsterZone[0] == null) else
AI.SelectPlace(Zones.z0); AI.SelectPlace(Zones.z4);
else return true;
AI.SelectPlace(Zones.z4); }
return true;
} private bool GrenMajuDaEizosummon()
{
private bool GrenMajuDaEizosummon() if (Duel.Turn == 1) return false;
{ if (Bot.HasInSpellZone(CardId.SkillDrain) || Enemy.HasInSpellZone(CardId.SkillDrain)) return false;
if (Duel.Turn == 1) return false; if (Bot.MonsterZone[0] == null)
if (Bot.HasInSpellZone(CardId.SkillDrain) || Enemy.HasInSpellZone(CardId.SkillDrain)) return false; AI.SelectPlace(Zones.z0);
if (Bot.MonsterZone[0] == null) else
AI.SelectPlace(Zones.z0); AI.SelectPlace(Zones.z4);
else return Bot.Banished.Count >= 6;
AI.SelectPlace(Zones.z4); }
return Bot.Banished.Count >= 6;
} private bool FamiliarPossessedsummon()
{
private bool FamiliarPossessedsummon() if (Bot.MonsterZone[0] == null)
{ AI.SelectPlace(Zones.z0);
if (Bot.MonsterZone[0] == null) else
AI.SelectPlace(Zones.z0); AI.SelectPlace(Zones.z4);
else return true;
AI.SelectPlace(Zones.z4); }
return true;
} private bool BorreloadDragonsp()
{
private bool BorreloadDragonsp() if (!(Bot.HasInMonstersZone(new[] { CardId.KnightmareCerberus, CardId.KnightmarePhoenix, CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP }))) return false;
{ IList<ClientCard> material_list = new List<ClientCard>();
if (!(Bot.HasInMonstersZone(new[] { CardId.KnightmareCerberus, CardId.KnightmarePhoenix, CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP }))) return false; foreach (ClientCard monster in Bot.GetMonsters())
IList<ClientCard> material_list = new List<ClientCard>(); {
foreach (ClientCard monster in Bot.GetMonsters()) if (monster.IsCode(CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP, CardId.KnightmareCerberus, CardId.KnightmarePhoenix, CardId.LinkSpider, CardId.Linkuriboh))
{ material_list.Add(monster);
if (monster.IsCode(CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP, CardId.KnightmareCerberus, CardId.KnightmarePhoenix, CardId.LinkSpider, CardId.Linkuriboh)) if (material_list.Count == 3) break;
material_list.Add(monster); }
if (material_list.Count == 3) break; if (material_list.Count >= 3)
} {
if (material_list.Count >= 3) AI.SelectMaterials(material_list);
{ return true;
AI.SelectMaterials(material_list); }
return true; return false;
} }
return false; private bool BorreloadDragonspsecond()
} {
private bool BorreloadDragonspsecond() if (!(Bot.HasInMonstersZone(new[] { CardId.KnightmareCerberus, CardId.KnightmarePhoenix, CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP }))) return false;
{ IList<ClientCard> material_list = new List<ClientCard>();
if (!(Bot.HasInMonstersZone(new[] { CardId.KnightmareCerberus, CardId.KnightmarePhoenix, CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP }))) return false; foreach (ClientCard monster in Bot.GetMonsters())
IList<ClientCard> material_list = new List<ClientCard>(); {
foreach (ClientCard monster in Bot.GetMonsters()) if (monster.IsCode(CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP, CardId.KnightmareCerberus, CardId.KnightmarePhoenix, CardId.LinkSpider, CardId.Linkuriboh))
{ material_list.Add(monster);
if (monster.IsCode(CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP, CardId.KnightmareCerberus, CardId.KnightmarePhoenix, CardId.LinkSpider, CardId.Linkuriboh)) if (material_list.Count == 3) break;
material_list.Add(monster); }
if (material_list.Count == 3) break; if (material_list.Count >= 3)
} {
if (material_list.Count >= 3) AI.SelectMaterials(material_list);
{ return true;
AI.SelectMaterials(material_list); }
return true; return false;
} }
return false; public bool BorreloadDragoneff()
} {
public bool BorreloadDragoneff() if (ActivateDescription == -1 && (Duel.Phase == DuelPhase.BattleStart || Duel.Phase == DuelPhase.End))
{ {
if (ActivateDescription == -1 && (Duel.Phase == DuelPhase.BattleStart || Duel.Phase == DuelPhase.End)) ClientCard enemy_monster = Enemy.BattlingMonster;
{ if (enemy_monster != null && enemy_monster.HasPosition(CardPosition.Attack))
ClientCard enemy_monster = Enemy.BattlingMonster; {
if (enemy_monster != null && enemy_monster.HasPosition(CardPosition.Attack)) return (Card.Attack - enemy_monster.Attack < Enemy.LifePoints);
{ }
return (Card.Attack - enemy_monster.Attack < Enemy.LifePoints); return true;
} };
return true; ClientCard BestEnemy = Util.GetBestEnemyMonster(true);
}; ClientCard WorstBot = Bot.GetMonsters().GetLowestAttackMonster();
ClientCard BestEnemy = Util.GetBestEnemyMonster(true); if (BestEnemy == null || BestEnemy.HasPosition(CardPosition.FaceDown)) return false;
ClientCard WorstBot = Bot.GetMonsters().GetLowestAttackMonster(); if (WorstBot == null || WorstBot.HasPosition(CardPosition.FaceDown)) return false;
if (BestEnemy == null || BestEnemy.HasPosition(CardPosition.FaceDown)) return false; if (BestEnemy.Attack >= WorstBot.RealPower)
if (WorstBot == null || WorstBot.HasPosition(CardPosition.FaceDown)) return false; {
if (BestEnemy.Attack >= WorstBot.RealPower) AI.SelectCard(BestEnemy);
{ return true;
AI.SelectCard(BestEnemy); }
return true; return false;
} }
return false;
} private bool BirrelswordDragonsp()
{
private bool BirrelswordDragonsp() IList<ClientCard> material_list = new List<ClientCard>();
{ foreach (ClientCard m in Bot.GetMonsters())
IList<ClientCard> material_list = new List<ClientCard>(); {
foreach (ClientCard m in Bot.GetMonsters()) if (m.IsCode(CardId.KnightmareCerberus, CardId.KnightmarePhoenix, CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP))
{ {
if (m.IsCode(CardId.KnightmareCerberus, CardId.KnightmarePhoenix, CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP)) material_list.Add(m);
{ break;
material_list.Add(m); }
break; }
} foreach (ClientCard m in Bot.GetMonsters())
} {
foreach (ClientCard m in Bot.GetMonsters()) if (m.IsCode(CardId.Linkuriboh) || m.Level == 1)
{ {
if (m.IsCode(CardId.Linkuriboh) || m.Level == 1) material_list.Add(m);
{ if (material_list.Count == 3)
material_list.Add(m); break;
if (material_list.Count == 3) }
break; }
} if (material_list.Count == 3)
} {
if (material_list.Count == 3) AI.SelectMaterials(material_list);
{ return true;
AI.SelectMaterials(material_list); }
return true; return false;
} }
return false;
} private bool BirrelswordDragoneff()
{
private bool BirrelswordDragoneff() if (ActivateDescription == Util.GetStringId(CardId.BirrelswordDragon, 0))
{ {
if (ActivateDescription == Util.GetStringId(CardId.BirrelswordDragon, 0)) if (Util.IsChainTarget(Card) && Util.GetBestEnemyMonster(true, true) != null)
{ {
if (Util.IsChainTarget(Card) && Util.GetBestEnemyMonster(true, true) != null) AI.SelectCard(Util.GetBestEnemyMonster(true, true));
{ return true;
AI.SelectCard(Util.GetBestEnemyMonster(true, true)); }
return true; if (Duel.Player == 1 && Bot.BattlingMonster == Card)
} {
if (Duel.Player == 1 && Bot.BattlingMonster == Card) AI.SelectCard(Enemy.BattlingMonster);
{ return true;
AI.SelectCard(Enemy.BattlingMonster); }
return true; if (Duel.Player == 1 && Bot.BattlingMonster != null &&
} (Enemy.BattlingMonster.Attack - Bot.BattlingMonster.Attack) >= Bot.LifePoints)
if (Duel.Player == 1 && Bot.BattlingMonster != null && {
(Enemy.BattlingMonster.Attack - Bot.BattlingMonster.Attack) >= Bot.LifePoints) AI.SelectCard(Enemy.BattlingMonster);
{ return true;
AI.SelectCard(Enemy.BattlingMonster); }
return true; if (Duel.Player == 0 && Duel.Phase == DuelPhase.BattleStart)
} {
if (Duel.Player == 0 && Duel.Phase == DuelPhase.BattleStart) foreach (ClientCard check in Enemy.GetMonsters())
{ {
foreach (ClientCard check in Enemy.GetMonsters()) if (check.IsAttack())
{ {
if (check.IsAttack()) AI.SelectCard(check);
{ return true;
AI.SelectCard(check); }
return true; }
} }
} return false;
} }
return false; return true;
} }
return true;
} private bool MetalSnakesp()
{
private bool MetalSnakesp() if (ActivateDescription == Util.GetStringId(CardId.MetalSnake, 0) && !Bot.HasInMonstersZone(CardId.MetalSnake))
{ {
if (ActivateDescription == Util.GetStringId(CardId.MetalSnake, 0) && !Bot.HasInMonstersZone(CardId.MetalSnake)) if (Duel.Player == 1 && Duel.Phase >= DuelPhase.BattleStart)
{ return Bot.Deck.Count >= 12;
if (Duel.Player == 1 && Duel.Phase >= DuelPhase.BattleStart) if (Duel.Player == 0 && Duel.Phase >= DuelPhase.Main1)
return Bot.Deck.Count >= 12; return Bot.Deck.Count >= 12;
if (Duel.Player == 0 && Duel.Phase >= DuelPhase.Main1) }
return Bot.Deck.Count >= 12; return false;
} }
return false;
} private bool MetalSnakeeff()
{
private bool MetalSnakeeff() ClientCard target = Util.GetOneEnemyBetterThanMyBest(true, true);
{ if (ActivateDescription == Util.GetStringId(CardId.MetalSnake, 1) && target != null)
ClientCard target = Util.GetOneEnemyBetterThanMyBest(true, true); {
if (ActivateDescription == Util.GetStringId(CardId.MetalSnake, 1) && target != null) AI.SelectCard(new[]
{ {
AI.SelectCard(new[] CardId.LynaP,
{ CardId.HiitaP,
CardId.LynaP, CardId.WynnP,
CardId.HiitaP, CardId.EriaP,
CardId.WynnP, CardId.KnightmareGryphon
CardId.EriaP, });
CardId.KnightmareGryphon AI.SelectNextCard(target);
}); return true;
AI.SelectNextCard(target); }
return true; return false;
}
return false; }
} private bool AussaPsp()
{
private bool AussaPsp() IList<ClientCard> material_list = new List<ClientCard>();
{ foreach (ClientCard monster in Bot.GetMonsters())
IList<ClientCard> material_list = new List<ClientCard>(); {
foreach (ClientCard monster in Bot.GetMonsters()) if (monster.HasAttribute(CardAttribute.Earth) && !monster.IsCode(CardId.KnightmareCerberus, CardId.InspectBoarder, CardId.GrenMajuDaEizo, CardId.KnightmarePhoenix, CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP, CardId.KnightmareUnicorn, CardId.KnightmareGryphon, CardId.BorreloadDragon, CardId.BirrelswordDragon))
{ material_list.Add(monster);
if (monster.HasAttribute(CardAttribute.Earth) && !monster.IsCode(CardId.KnightmareCerberus, CardId.InspectBoarder, CardId.GrenMajuDaEizo, CardId.KnightmarePhoenix, CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP, CardId.KnightmareUnicorn, CardId.KnightmareGryphon, CardId.BorreloadDragon, CardId.BirrelswordDragon)) if (material_list.Count == 2) break;
material_list.Add(monster); }
if (material_list.Count == 2) break; if (material_list.Count < 2) return false;
} if (Bot.HasInMonstersZone(CardId.AussaP)) return false;
if (material_list.Count < 2) return false; AI.SelectMaterials(material_list);
if (Bot.HasInMonstersZone(CardId.AussaP)) return false; if (Bot.MonsterZone[0] == null && Bot.MonsterZone[2] == null && Bot.MonsterZone[5] == null)
AI.SelectMaterials(material_list); AI.SelectPlace(Zones.z5);
if (Bot.MonsterZone[0] == null && Bot.MonsterZone[2] == null && Bot.MonsterZone[5] == null) else
AI.SelectPlace(Zones.z5); AI.SelectPlace(Zones.z6);
else return true;
AI.SelectPlace(Zones.z6); }
return true;
} private bool AussaPeff()
{
private bool AussaPeff() AI.SelectCard(CardId.MaxxC, CardId.Aussa);
{ return true;
AI.SelectCard(CardId.MaxxC, CardId.Aussa); }
return true;
} private bool EriaPsp()
{
private bool EriaPsp() IList<ClientCard> material_list = new List<ClientCard>();
{ foreach (ClientCard monster in Bot.GetMonsters())
IList<ClientCard> material_list = new List<ClientCard>(); {
foreach (ClientCard monster in Bot.GetMonsters()) if (monster.HasAttribute(CardAttribute.Water) && !monster.IsCode(CardId.KnightmareCerberus, CardId.InspectBoarder, CardId.GrenMajuDaEizo, CardId.KnightmarePhoenix, CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP, CardId.KnightmareUnicorn, CardId.KnightmareGryphon, CardId.BorreloadDragon, CardId.BirrelswordDragon))
{ material_list.Add(monster);
if (monster.HasAttribute(CardAttribute.Water) && !monster.IsCode(CardId.KnightmareCerberus, CardId.InspectBoarder, CardId.GrenMajuDaEizo, CardId.KnightmarePhoenix, CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP, CardId.KnightmareUnicorn, CardId.KnightmareGryphon, CardId.BorreloadDragon, CardId.BirrelswordDragon)) if (material_list.Count == 2) break;
material_list.Add(monster); }
if (material_list.Count == 2) break; if (material_list.Count < 2) return false;
} if (Bot.HasInMonstersZone(CardId.EriaP)) return false;
if (material_list.Count < 2) return false; AI.SelectMaterials(material_list);
if (Bot.HasInMonstersZone(CardId.EriaP)) return false; if (Bot.MonsterZone[0] == null && Bot.MonsterZone[2] == null && Bot.MonsterZone[5] == null)
AI.SelectMaterials(material_list); AI.SelectPlace(Zones.z5);
if (Bot.MonsterZone[0] == null && Bot.MonsterZone[2] == null && Bot.MonsterZone[5] == null) else
AI.SelectPlace(Zones.z5); AI.SelectPlace(Zones.z6);
else return true;
AI.SelectPlace(Zones.z6); }
return true;
} private bool EriaPeff()
{
private bool EriaPeff() AI.SelectCard(CardId.Eria);
{ return true;
AI.SelectCard(CardId.Eria); }
return true;
} private bool WynnPsp()
{
private bool WynnPsp() IList<ClientCard> material_list = new List<ClientCard>();
{ foreach (ClientCard monster in Bot.GetMonsters())
IList<ClientCard> material_list = new List<ClientCard>(); {
foreach (ClientCard monster in Bot.GetMonsters()) if (monster.HasAttribute(CardAttribute.Wind) && !monster.IsCode(CardId.KnightmareCerberus, CardId.InspectBoarder, CardId.GrenMajuDaEizo, CardId.KnightmarePhoenix, CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP, CardId.KnightmareUnicorn, CardId.KnightmareGryphon, CardId.BorreloadDragon, CardId.BirrelswordDragon))
{ material_list.Add(monster);
if (monster.HasAttribute(CardAttribute.Wind) && !monster.IsCode(CardId.KnightmareCerberus, CardId.InspectBoarder, CardId.GrenMajuDaEizo, CardId.KnightmarePhoenix, CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP, CardId.KnightmareUnicorn, CardId.KnightmareGryphon, CardId.BorreloadDragon, CardId.BirrelswordDragon)) if (material_list.Count == 2) break;
material_list.Add(monster); }
if (material_list.Count == 2) break; if (material_list.Count < 2) return false;
} if (Bot.HasInMonstersZone(CardId.WynnP)) return false;
if (material_list.Count < 2) return false; AI.SelectMaterials(material_list);
if (Bot.HasInMonstersZone(CardId.WynnP)) return false; if (Bot.MonsterZone[0] == null && Bot.MonsterZone[2] == null && Bot.MonsterZone[5] == null)
AI.SelectMaterials(material_list); AI.SelectPlace(Zones.z5);
if (Bot.MonsterZone[0] == null && Bot.MonsterZone[2] == null && Bot.MonsterZone[5] == null) else
AI.SelectPlace(Zones.z5); AI.SelectPlace(Zones.z6);
else return true;
AI.SelectPlace(Zones.z6); }
return true;
} private bool WynnPeff()
{
private bool WynnPeff() AI.SelectCard(CardId.Wynn);
{ return true;
AI.SelectCard(CardId.Wynn); }
return true;
} private bool HiitaPsp()
{
private bool HiitaPsp() IList<ClientCard> material_list = new List<ClientCard>();
{ foreach (ClientCard monster in Bot.GetMonsters())
IList<ClientCard> material_list = new List<ClientCard>(); {
foreach (ClientCard monster in Bot.GetMonsters()) if (monster.HasAttribute(CardAttribute.Fire) && !monster.IsCode(CardId.KnightmareCerberus, CardId.InspectBoarder, CardId.GrenMajuDaEizo, CardId.KnightmarePhoenix, CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP, CardId.KnightmareUnicorn, CardId.KnightmareGryphon, CardId.BorreloadDragon, CardId.BirrelswordDragon))
{ material_list.Add(monster);
if (monster.HasAttribute(CardAttribute.Fire) && !monster.IsCode(CardId.KnightmareCerberus, CardId.InspectBoarder, CardId.GrenMajuDaEizo, CardId.KnightmarePhoenix, CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP, CardId.KnightmareUnicorn, CardId.KnightmareGryphon, CardId.BorreloadDragon, CardId.BirrelswordDragon)) if (material_list.Count == 2) break;
material_list.Add(monster); }
if (material_list.Count == 2) break; if (material_list.Count < 2) return false;
} if (Bot.HasInMonstersZone(CardId.HiitaP)) return false;
if (material_list.Count < 2) return false; AI.SelectMaterials(material_list);
if (Bot.HasInMonstersZone(CardId.HiitaP)) return false; if (Bot.MonsterZone[0] == null && Bot.MonsterZone[2] == null && Bot.MonsterZone[5] == null)
AI.SelectMaterials(material_list); AI.SelectPlace(Zones.z5);
if (Bot.MonsterZone[0] == null && Bot.MonsterZone[2] == null && Bot.MonsterZone[5] == null) else
AI.SelectPlace(Zones.z5); AI.SelectPlace(Zones.z6);
else return true;
AI.SelectPlace(Zones.z6); }
return true;
} private bool HiitaPeff()
{
private bool HiitaPeff() AI.SelectCard(CardId.Hiita);
{ return true;
AI.SelectCard(CardId.Hiita); }
return true;
} private bool LynaPsp()
{
private bool LynaPsp() IList<ClientCard> material_list = new List<ClientCard>();
{ foreach (ClientCard monster in Bot.GetMonsters())
IList<ClientCard> material_list = new List<ClientCard>(); {
foreach (ClientCard monster in Bot.GetMonsters()) if (monster.HasAttribute(CardAttribute.Light) && !monster.IsCode(CardId.KnightmareCerberus, CardId.InspectBoarder, CardId.GrenMajuDaEizo, CardId.KnightmarePhoenix, CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP, CardId.KnightmareUnicorn, CardId.KnightmareGryphon, CardId.BorreloadDragon, CardId.BirrelswordDragon))
{ material_list.Add(monster);
if (monster.HasAttribute(CardAttribute.Light) && !monster.IsCode(CardId.KnightmareCerberus, CardId.InspectBoarder, CardId.GrenMajuDaEizo, CardId.KnightmarePhoenix, CardId.LynaP, CardId.HiitaP, CardId.WynnP, CardId.EriaP, CardId.AussaP, CardId.KnightmareUnicorn, CardId.KnightmareGryphon, CardId.BorreloadDragon, CardId.BirrelswordDragon)) if (material_list.Count == 2) break;
material_list.Add(monster); }
if (material_list.Count == 2) break; if (material_list.Count < 2) return false;
} if (Bot.HasInMonstersZone(CardId.LynaP)) return false;
if (material_list.Count < 2) return false; AI.SelectMaterials(material_list);
if (Bot.HasInMonstersZone(CardId.LynaP)) return false; if (Bot.MonsterZone[0] == null && Bot.MonsterZone[2] == null && Bot.MonsterZone[5] == null)
AI.SelectMaterials(material_list); AI.SelectPlace(Zones.z5);
if (Bot.MonsterZone[0] == null && Bot.MonsterZone[2] == null && Bot.MonsterZone[5] == null) else
AI.SelectPlace(Zones.z5); AI.SelectPlace(Zones.z6);
else return true;
AI.SelectPlace(Zones.z6); }
return true;
} private bool LynaPeff()
{
private bool LynaPeff() AI.SelectCard(CardId.Lyna);
{ return true;
AI.SelectCard(CardId.Lyna); }
return true;
} private bool Linkuribohsp()
{
private bool Linkuribohsp()
{ foreach (ClientCard c in Bot.GetMonsters())
{
foreach (ClientCard c in Bot.GetMonsters()) if (c.Level == 1)
{ {
if (c.Level == 1) AI.SelectMaterials(c);
{ return true;
AI.SelectMaterials(c); }
return true; }
} return false;
} }
return false;
} private bool Knightmaresp()
{
private bool Knightmaresp() int[] firstMats = new[] {
{ CardId.KnightmareCerberus,
int[] firstMats = new[] { CardId.KnightmarePhoenix
CardId.KnightmareCerberus, };
CardId.KnightmarePhoenix if (Bot.MonsterZone.GetMatchingCardsCount(card => card.IsCode(firstMats)) >= 1) return false;
}; foreach (ClientCard c in Bot.GetMonsters())
if (Bot.MonsterZone.GetMatchingCardsCount(card => card.IsCode(firstMats)) >= 1) return false; {
foreach (ClientCard c in Bot.GetMonsters()) if (c.Level == 1)
{ {
if (c.Level == 1) AI.SelectMaterials(c);
{ return true;
AI.SelectMaterials(c); }
return true; }
} return false;
} }
return false; private bool Linkuriboheff()
} {
private bool Linkuriboheff() if (Duel.LastChainPlayer == 0 && Util.GetLastChainCard().IsCode(CardId.Linkuriboh)) return false;
{ return true;
if (Duel.LastChainPlayer == 0 && Util.GetLastChainCard().IsCode(CardId.Linkuriboh)) return false; }
return true;
} private bool GagagaCowboySummon()
{
private bool GagagaCowboySummon() if (Enemy.LifePoints <= 800 || (Bot.GetMonsterCount() >= 4 && Enemy.LifePoints <= 1600))
{ {
if (Enemy.LifePoints <= 800 || (Bot.GetMonsterCount() >= 4 && Enemy.LifePoints <= 1600)) AI.SelectPosition(CardPosition.FaceUpDefence);
{ return true;
AI.SelectPosition(CardPosition.FaceUpDefence); }
return true; return false;
} }
return false; private bool SpellSet()
} {
private bool SpellSet() if (Card.IsCode(CardId.MacroCosmos) && Bot.HasInSpellZone(CardId.MacroCosmos)) return false;
{ if (Card.IsCode(CardId.Unpossessed) && Bot.HasInSpellZone(CardId.Unpossessed)) return false;
if (Card.IsCode(CardId.MacroCosmos) && Bot.HasInSpellZone(CardId.MacroCosmos)) return false; if (Card.IsCode(CardId.Crackdown) && Bot.HasInSpellZone(CardId.Crackdown)) return false;
if (Card.IsCode(CardId.Unpossessed) && Bot.HasInSpellZone(CardId.Unpossessed)) return false; if (Card.IsCode(CardId.SkillDrain) && Bot.HasInSpellZone(CardId.SkillDrain)) return false;
if (Card.IsCode(CardId.Crackdown) && Bot.HasInSpellZone(CardId.Crackdown)) return false; if (Card.IsCode(CardId.Mistake) && Bot.HasInSpellZone(CardId.Mistake)) return false;
if (Card.IsCode(CardId.SkillDrain) && Bot.HasInSpellZone(CardId.SkillDrain)) return false; if (Card.IsCode(CardId.Scapegoat))
if (Card.IsCode(CardId.Mistake) && Bot.HasInSpellZone(CardId.Mistake)) return false; return true;
if (Card.IsCode(CardId.Scapegoat)) if (Card.HasType(CardType.Trap))
return true; return Bot.GetSpellCountWithoutField() < 4;
if (Card.HasType(CardType.Trap)) return false;
return Bot.GetSpellCountWithoutField() < 4; }
return false; public override ClientCard OnSelectAttacker(IList<ClientCard> attackers, IList<ClientCard> defenders)
} {
public override ClientCard OnSelectAttacker(IList<ClientCard> attackers, IList<ClientCard> defenders) for (int i = 0; i < attackers.Count; ++i)
{ {
for (int i = 0; i < attackers.Count; ++i) ClientCard attacker = attackers[i];
{ if (attacker.IsCode(CardId.BirrelswordDragon, CardId.BorreloadDragon)) return attacker;
ClientCard attacker = attackers[i]; }
if (attacker.IsCode(CardId.BirrelswordDragon, CardId.BorreloadDragon)) return attacker; return null;
} }
return null; public override bool OnSelectHand()
} {
public override bool OnSelectHand() return true;
{ }
return true; }
} }
}
}
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic; using System.Collections.Generic;
using WindBot; using WindBot;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
[Deck("LightswornShaddoldinosour", "AI_LightswornShaddoldinosour")] [Deck("LightswornShaddoldinosour", "AI_LightswornShaddoldinosour")]
public class LightswornShaddoldinosour : DefaultExecutor public class LightswornShaddoldinosour : DefaultExecutor
{ {
public class CardId public class CardId
{ {
//monster //monster
public const int UltimateConductorTytanno = 18940556; public const int UltimateConductorTytanno = 18940556;
public const int DogorantheMadFlameKaiju = 93332803; public const int DogorantheMadFlameKaiju = 93332803;
public const int GamecieltheSeaTurtleKaiju = 55063751; public const int GamecieltheSeaTurtleKaiju = 55063751;
public const int RadiantheMultidimensionalKaiju = 28674152; public const int RadiantheMultidimensionalKaiju = 28674152;
public const int OvertexCoatls = 41782653; public const int OvertexCoatls = 41782653;
public const int ShaddollBeast = 3717252; public const int ShaddollBeast = 3717252;
public const int GiantRex = 80280944; public const int GiantRex = 80280944;
public const int ShaddollDragon = 77723643; public const int ShaddollDragon = 77723643;
public const int FairyTailSnow = 55623480; public const int FairyTailSnow = 55623480;
public const int KeeperOfDragonicMagic = 48048590; public const int KeeperOfDragonicMagic = 48048590;
public const int ShaddollSquamata = 30328508; public const int ShaddollSquamata = 30328508;
public const int SouleatingOviraptor = 44335251; public const int SouleatingOviraptor = 44335251;
public const int Raiden = 77558536; public const int Raiden = 77558536;
public const int Lumina = 95503687; public const int Lumina = 95503687;
public const int ShaddollHedgehog = 4939890; public const int ShaddollHedgehog = 4939890;
public const int AshBlossom = 14558127; public const int AshBlossom = 14558127;
public const int GhostOgre = 59438930; public const int GhostOgre = 59438930;
public const int ShaddollFalco = 37445295; public const int ShaddollFalco = 37445295;
public const int MaxxC = 23434538; public const int MaxxC = 23434538;
public const int PlaguespreaderZombie = 33420078; public const int PlaguespreaderZombie = 33420078;
public const int GlowUpBulb = 67441435; public const int GlowUpBulb = 67441435;
//spell //spell
public const int AllureofDarkness = 1475311; public const int AllureofDarkness = 1475311;
public const int ThatGrassLooksgreener = 11110587; public const int ThatGrassLooksgreener = 11110587;
public const int HarpiesFeatherDuster = 18144506; public const int HarpiesFeatherDuster = 18144506;
public const int DoubleEvolutionPill = 38179121; public const int DoubleEvolutionPill = 38179121;
public const int ShaddollFusion = 44394295; public const int ShaddollFusion = 44394295;
public const int PotOfAvarice = 67169062; public const int PotOfAvarice = 67169062;
public const int FoolishBurial = 81439173; public const int FoolishBurial = 81439173;
public const int MonsterReborn = 83764718; public const int MonsterReborn = 83764718;
public const int ChargeOfTheLightBrigade = 94886282; public const int ChargeOfTheLightBrigade = 94886282;
public const int InterruptedKaijuSlumber = 99330325; public const int InterruptedKaijuSlumber = 99330325;
//public const int ElShaddollFusion = 6417578; //public const int ElShaddollFusion = 6417578;
//trap //trap
public const int infiniteTransience = 10045474; public const int infiniteTransience = 10045474;
public const int LostWind = 74003290; public const int LostWind = 74003290;
public const int SinisterShadowGames = 77505534; public const int SinisterShadowGames = 77505534;
public const int ShaddollCore = 4904633; public const int ShaddollCore = 4904633;
//extra //extra
public const int ElShaddollShekhinaga = 74822425; public const int ElShaddollShekhinaga = 74822425;
public const int ElShaddollConstruct = 20366274; public const int ElShaddollConstruct = 20366274;
public const int ElShaddollGrysra = 48424886; public const int ElShaddollGrysra = 48424886;
public const int ElShaddollWinda = 94977269; public const int ElShaddollWinda = 94977269;
public const int CrystalWingSynchroDragon = 50954680; public const int CrystalWingSynchroDragon = 50954680;
public const int ScarlightRedDragon = 80666118; public const int ScarlightRedDragon = 80666118;
public const int Michael = 4779823; public const int Michael = 4779823;
public const int BlackRoseMoonlightDragon = 33698022; public const int BlackRoseMoonlightDragon = 33698022;
public const int RedWyvern = 76547525; public const int RedWyvern = 76547525;
public const int CoralDragon = 42566602; public const int CoralDragon = 42566602;
public const int TG_WonderMagician = 98558751; public const int TG_WonderMagician = 98558751;
public const int MinervaTheExalte = 30100551; public const int MinervaTheExalte = 30100551;
public const int Sdulldeat = 74997493; public const int Sdulldeat = 74997493;
public const int CrystronNeedlefiber = 50588353; public const int CrystronNeedlefiber = 50588353;
} }
public LightswornShaddoldinosour(GameAI ai, Duel duel) public LightswornShaddoldinosour(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
//counter //counter
AddExecutor(ExecutorType.Activate, CardId.GhostOgre, Hand_act_eff); AddExecutor(ExecutorType.Activate, CardId.GhostOgre, Hand_act_eff);
AddExecutor(ExecutorType.Activate, CardId.AshBlossom, Hand_act_eff); AddExecutor(ExecutorType.Activate, CardId.AshBlossom, Hand_act_eff);
AddExecutor(ExecutorType.Activate, CardId.MaxxC,MaxxC); AddExecutor(ExecutorType.Activate, CardId.MaxxC,MaxxC);
//first do //first do
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst); AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, CardId.infiniteTransience, DefaultBreakthroughSkill); AddExecutor(ExecutorType.Activate, CardId.infiniteTransience, DefaultBreakthroughSkill);
AddExecutor(ExecutorType.Activate, CardId.ThatGrassLooksgreener); AddExecutor(ExecutorType.Activate, CardId.ThatGrassLooksgreener);
AddExecutor(ExecutorType.Summon, CardId.SouleatingOviraptor); AddExecutor(ExecutorType.Summon, CardId.SouleatingOviraptor);
AddExecutor(ExecutorType.Activate, CardId.SouleatingOviraptor, SouleatingOviraptoreff); AddExecutor(ExecutorType.Activate, CardId.SouleatingOviraptor, SouleatingOviraptoreff);
AddExecutor(ExecutorType.Activate, CardId.AllureofDarkness, DefaultAllureofDarkness); AddExecutor(ExecutorType.Activate, CardId.AllureofDarkness, DefaultAllureofDarkness);
AddExecutor(ExecutorType.Activate, CardId.PotOfAvarice, PotofAvariceeff); AddExecutor(ExecutorType.Activate, CardId.PotOfAvarice, PotofAvariceeff);
AddExecutor(ExecutorType.Activate, CardId.ChargeOfTheLightBrigade, ChargeOfTheLightBrigadeEffect); AddExecutor(ExecutorType.Activate, CardId.ChargeOfTheLightBrigade, ChargeOfTheLightBrigadeEffect);
AddExecutor(ExecutorType.Activate, CardId.FoolishBurial, FoolishBurialEffect); AddExecutor(ExecutorType.Activate, CardId.FoolishBurial, FoolishBurialEffect);
AddExecutor(ExecutorType.Activate, CardId.InterruptedKaijuSlumber, InterruptedKaijuSlumbereff); AddExecutor(ExecutorType.Activate, CardId.InterruptedKaijuSlumber, InterruptedKaijuSlumbereff);
AddExecutor(ExecutorType.Activate, CardId.ShaddollFusion, ShaddollFusioneff); AddExecutor(ExecutorType.Activate, CardId.ShaddollFusion, ShaddollFusioneff);
//Normal Summon //Normal Summon
AddExecutor(ExecutorType.Summon, CardId.Raiden); AddExecutor(ExecutorType.Summon, CardId.Raiden);
AddExecutor(ExecutorType.Activate, CardId.Raiden); AddExecutor(ExecutorType.Activate, CardId.Raiden);
AddExecutor(ExecutorType.Summon , CardId.KeeperOfDragonicMagic); AddExecutor(ExecutorType.Summon , CardId.KeeperOfDragonicMagic);
AddExecutor(ExecutorType.Activate, CardId.KeeperOfDragonicMagic, KeeperOfDragonicMagiceff); AddExecutor(ExecutorType.Activate, CardId.KeeperOfDragonicMagic, KeeperOfDragonicMagiceff);
AddExecutor(ExecutorType.MonsterSet, CardId.ShaddollSquamata); AddExecutor(ExecutorType.MonsterSet, CardId.ShaddollSquamata);
AddExecutor(ExecutorType.MonsterSet, CardId.GlowUpBulb); AddExecutor(ExecutorType.MonsterSet, CardId.GlowUpBulb);
AddExecutor(ExecutorType.Summon, CardId.Lumina, Luminasummon); AddExecutor(ExecutorType.Summon, CardId.Lumina, Luminasummon);
AddExecutor(ExecutorType.MonsterSet, CardId.ShaddollHedgehog); AddExecutor(ExecutorType.MonsterSet, CardId.ShaddollHedgehog);
AddExecutor(ExecutorType.MonsterSet, CardId.ShaddollDragon); AddExecutor(ExecutorType.MonsterSet, CardId.ShaddollDragon);
AddExecutor(ExecutorType.Summon, CardId.FairyTailSnow,FairyTailSnowsummon); AddExecutor(ExecutorType.Summon, CardId.FairyTailSnow,FairyTailSnowsummon);
AddExecutor(ExecutorType.Activate, CardId.FairyTailSnow, FairyTailSnoweff); AddExecutor(ExecutorType.Activate, CardId.FairyTailSnow, FairyTailSnoweff);
AddExecutor(ExecutorType.Activate, CardId.Lumina, Luminaeff); AddExecutor(ExecutorType.Activate, CardId.Lumina, Luminaeff);
//activate //activate
AddExecutor(ExecutorType.Activate, CardId.GlowUpBulb, GlowUpBulbeff); AddExecutor(ExecutorType.Activate, CardId.GlowUpBulb, GlowUpBulbeff);
AddExecutor(ExecutorType.Activate, CardId.TG_WonderMagician, TG_WonderMagicianeff); AddExecutor(ExecutorType.Activate, CardId.TG_WonderMagician, TG_WonderMagicianeff);
AddExecutor(ExecutorType.Activate, CardId.CoralDragon, CoralDragoneff); AddExecutor(ExecutorType.Activate, CardId.CoralDragon, CoralDragoneff);
AddExecutor(ExecutorType.Activate, CardId.RedWyvern, RedWyverneff); AddExecutor(ExecutorType.Activate, CardId.RedWyvern, RedWyverneff);
AddExecutor(ExecutorType.Activate, CardId.CrystalWingSynchroDragon, CrystalWingSynchroDragoneff); AddExecutor(ExecutorType.Activate, CardId.CrystalWingSynchroDragon, CrystalWingSynchroDragoneff);
AddExecutor(ExecutorType.Activate, CardId.BlackRoseMoonlightDragon, BlackRoseMoonlightDragoneff); AddExecutor(ExecutorType.Activate, CardId.BlackRoseMoonlightDragon, BlackRoseMoonlightDragoneff);
AddExecutor(ExecutorType.Activate, CardId.Sdulldeat, Sdulldeateff); AddExecutor(ExecutorType.Activate, CardId.Sdulldeat, Sdulldeateff);
AddExecutor(ExecutorType.Activate, CardId.Michael, Michaeleff); AddExecutor(ExecutorType.Activate, CardId.Michael, Michaeleff);
AddExecutor(ExecutorType.Activate, CardId.ScarlightRedDragon, ScarlightRedDragoneff); AddExecutor(ExecutorType.Activate, CardId.ScarlightRedDragon, ScarlightRedDragoneff);
//Sp Summon //Sp Summon
AddExecutor(ExecutorType.Activate, CardId.CrystronNeedlefiber, CrystronNeedlefibereff); AddExecutor(ExecutorType.Activate, CardId.CrystronNeedlefiber, CrystronNeedlefibereff);
AddExecutor(ExecutorType.SpSummon, CardId.UltimateConductorTytanno, UltimateConductorTytannosp); AddExecutor(ExecutorType.SpSummon, CardId.UltimateConductorTytanno, UltimateConductorTytannosp);
AddExecutor(ExecutorType.Activate, CardId.UltimateConductorTytanno, UltimateConductorTytannoeff); AddExecutor(ExecutorType.Activate, CardId.UltimateConductorTytanno, UltimateConductorTytannoeff);
AddExecutor(ExecutorType.Activate, CardId.DoubleEvolutionPill, DoubleEvolutionPilleff); AddExecutor(ExecutorType.Activate, CardId.DoubleEvolutionPill, DoubleEvolutionPilleff);
//extra //extra
AddExecutor(ExecutorType.SpSummon, CardId.CrystalWingSynchroDragon); AddExecutor(ExecutorType.SpSummon, CardId.CrystalWingSynchroDragon);
AddExecutor(ExecutorType.Activate, CardId.CrystalWingSynchroDragon, CrystalWingSynchroDragoneff); AddExecutor(ExecutorType.Activate, CardId.CrystalWingSynchroDragon, CrystalWingSynchroDragoneff);
AddExecutor(ExecutorType.SpSummon, CardId.ScarlightRedDragon, ScarlightRedDragonsp); AddExecutor(ExecutorType.SpSummon, CardId.ScarlightRedDragon, ScarlightRedDragonsp);
AddExecutor(ExecutorType.Activate, CardId.ScarlightRedDragon, ScarlightRedDragoneff); AddExecutor(ExecutorType.Activate, CardId.ScarlightRedDragon, ScarlightRedDragoneff);
AddExecutor(ExecutorType.SpSummon, CardId.Michael, Michaelsp); AddExecutor(ExecutorType.SpSummon, CardId.Michael, Michaelsp);
AddExecutor(ExecutorType.Activate, CardId.Michael, Michaeleff); AddExecutor(ExecutorType.Activate, CardId.Michael, Michaeleff);
AddExecutor(ExecutorType.SpSummon, CardId.RedWyvern, RedWyvernsp); AddExecutor(ExecutorType.SpSummon, CardId.RedWyvern, RedWyvernsp);
AddExecutor(ExecutorType.Activate, CardId.RedWyvern, RedWyverneff); AddExecutor(ExecutorType.Activate, CardId.RedWyvern, RedWyverneff);
AddExecutor(ExecutorType.SpSummon, CardId.MinervaTheExalte); AddExecutor(ExecutorType.SpSummon, CardId.MinervaTheExalte);
AddExecutor(ExecutorType.Activate, CardId.MinervaTheExalte, MinervaTheExaltedEffect); AddExecutor(ExecutorType.Activate, CardId.MinervaTheExalte, MinervaTheExaltedEffect);
AddExecutor(ExecutorType.SpSummon, CardId.CrystronNeedlefiber, CrystronNeedlefibersp); AddExecutor(ExecutorType.SpSummon, CardId.CrystronNeedlefiber, CrystronNeedlefibersp);
//Kaiju //Kaiju
AddExecutor(ExecutorType.SpSummon, CardId.GamecieltheSeaTurtleKaiju, GamecieltheSeaTurtleKaijusp); AddExecutor(ExecutorType.SpSummon, CardId.GamecieltheSeaTurtleKaiju, GamecieltheSeaTurtleKaijusp);
AddExecutor(ExecutorType.SpSummon, CardId.RadiantheMultidimensionalKaiju, RadiantheMultidimensionalKaijusp); AddExecutor(ExecutorType.SpSummon, CardId.RadiantheMultidimensionalKaiju, RadiantheMultidimensionalKaijusp);
AddExecutor(ExecutorType.SpSummon, CardId.DogorantheMadFlameKaiju, DogorantheMadFlameKaijusp); AddExecutor(ExecutorType.SpSummon, CardId.DogorantheMadFlameKaiju, DogorantheMadFlameKaijusp);
//Reborn //Reborn
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, Reborneff); AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, Reborneff);
//activate chain //activate chain
AddExecutor(ExecutorType.Activate, CardId.OvertexCoatls, OvertexCoatlseff); AddExecutor(ExecutorType.Activate, CardId.OvertexCoatls, OvertexCoatlseff);
AddExecutor(ExecutorType.Activate, CardId.ShaddollCore, ShaddollCoreeff); AddExecutor(ExecutorType.Activate, CardId.ShaddollCore, ShaddollCoreeff);
AddExecutor(ExecutorType.Activate, CardId.ShaddollBeast, ShaddollBeasteff); AddExecutor(ExecutorType.Activate, CardId.ShaddollBeast, ShaddollBeasteff);
AddExecutor(ExecutorType.Activate, CardId.ShaddollFalco, ShaddollFalcoeff); AddExecutor(ExecutorType.Activate, CardId.ShaddollFalco, ShaddollFalcoeff);
AddExecutor(ExecutorType.Activate, CardId.ShaddollDragon, ShaddollDragoneff); AddExecutor(ExecutorType.Activate, CardId.ShaddollDragon, ShaddollDragoneff);
AddExecutor(ExecutorType.Activate, CardId.ShaddollHedgehog, ShaddollHedgehogeff); AddExecutor(ExecutorType.Activate, CardId.ShaddollHedgehog, ShaddollHedgehogeff);
AddExecutor(ExecutorType.Activate, CardId.ShaddollSquamata, ShaddollSquamataeff); AddExecutor(ExecutorType.Activate, CardId.ShaddollSquamata, ShaddollSquamataeff);
AddExecutor(ExecutorType.Activate, CardId.GiantRex); AddExecutor(ExecutorType.Activate, CardId.GiantRex);
AddExecutor(ExecutorType.Activate, CardId.ElShaddollConstruct, ElShaddollConstructeff); AddExecutor(ExecutorType.Activate, CardId.ElShaddollConstruct, ElShaddollConstructeff);
AddExecutor(ExecutorType.Activate, CardId.ElShaddollGrysra, ElShaddollGrysraeff); AddExecutor(ExecutorType.Activate, CardId.ElShaddollGrysra, ElShaddollGrysraeff);
AddExecutor(ExecutorType.Activate, CardId.ElShaddollShekhinaga, ElShaddollShekhinagaeff); AddExecutor(ExecutorType.Activate, CardId.ElShaddollShekhinaga, ElShaddollShekhinagaeff);
AddExecutor(ExecutorType.Activate, CardId.ElShaddollWinda); AddExecutor(ExecutorType.Activate, CardId.ElShaddollWinda);
//spellset //spellset
AddExecutor(ExecutorType.SpellSet, CardId.ThatGrassLooksgreener, SpellSetZone); AddExecutor(ExecutorType.SpellSet, CardId.ThatGrassLooksgreener, SpellSetZone);
AddExecutor(ExecutorType.SpellSet, SpellSetZone); AddExecutor(ExecutorType.SpellSet, SpellSetZone);
//trapset //trapset
AddExecutor(ExecutorType.SpellSet, CardId.LostWind); AddExecutor(ExecutorType.SpellSet, CardId.LostWind);
AddExecutor(ExecutorType.SpellSet, CardId.SinisterShadowGames); AddExecutor(ExecutorType.SpellSet, CardId.SinisterShadowGames);
AddExecutor(ExecutorType.SpellSet, CardId.ShaddollCore); AddExecutor(ExecutorType.SpellSet, CardId.ShaddollCore);
AddExecutor(ExecutorType.SpellSet, CardId.infiniteTransience, SetIsFieldEmpty); AddExecutor(ExecutorType.SpellSet, CardId.infiniteTransience, SetIsFieldEmpty);
//trap activate //trap activate
AddExecutor(ExecutorType.Activate, CardId.LostWind, LostWindeff); AddExecutor(ExecutorType.Activate, CardId.LostWind, LostWindeff);
AddExecutor(ExecutorType.Activate, CardId.SinisterShadowGames, SinisterShadowGameseff); AddExecutor(ExecutorType.Activate, CardId.SinisterShadowGames, SinisterShadowGameseff);
AddExecutor(ExecutorType.Repos, MonsterRepos); AddExecutor(ExecutorType.Repos, MonsterRepos);
} }
public int[] all_List() public int[] all_List()
{ {
return new[] return new[]
{ {
CardId.UltimateConductorTytanno, CardId.UltimateConductorTytanno,
CardId.DogorantheMadFlameKaiju, CardId.DogorantheMadFlameKaiju,
CardId.GamecieltheSeaTurtleKaiju, CardId.GamecieltheSeaTurtleKaiju,
CardId.RadiantheMultidimensionalKaiju, CardId.RadiantheMultidimensionalKaiju,
CardId.OvertexCoatls, CardId.OvertexCoatls,
CardId.ShaddollBeast, CardId.ShaddollBeast,
CardId.GiantRex, CardId.GiantRex,
CardId.ShaddollDragon, CardId.ShaddollDragon,
CardId.FairyTailSnow, CardId.FairyTailSnow,
CardId.KeeperOfDragonicMagic, CardId.KeeperOfDragonicMagic,
CardId.ShaddollSquamata, CardId.ShaddollSquamata,
CardId.SouleatingOviraptor, CardId.SouleatingOviraptor,
CardId.Raiden, CardId.Raiden,
CardId.Lumina, CardId.Lumina,
CardId.ShaddollHedgehog, CardId.ShaddollHedgehog,
CardId.AshBlossom, CardId.AshBlossom,
CardId.GhostOgre, CardId.GhostOgre,
CardId.ShaddollFalco, CardId.ShaddollFalco,
CardId.MaxxC, CardId.MaxxC,
CardId.PlaguespreaderZombie, CardId.PlaguespreaderZombie,
CardId.GlowUpBulb, CardId.GlowUpBulb,
CardId.AllureofDarkness, CardId.AllureofDarkness,
CardId.ThatGrassLooksgreener, CardId.ThatGrassLooksgreener,
CardId.HarpiesFeatherDuster, CardId.HarpiesFeatherDuster,
CardId.DoubleEvolutionPill, CardId.DoubleEvolutionPill,
CardId.ShaddollFusion, CardId.ShaddollFusion,
CardId.PotOfAvarice, CardId.PotOfAvarice,
CardId.FoolishBurial, CardId.FoolishBurial,
CardId.MonsterReborn, CardId.MonsterReborn,
CardId.ChargeOfTheLightBrigade, CardId.ChargeOfTheLightBrigade,
CardId.InterruptedKaijuSlumber, CardId.InterruptedKaijuSlumber,
//CardId.ElShaddollFusion, //CardId.ElShaddollFusion,
CardId.infiniteTransience, CardId.infiniteTransience,
CardId.LostWind, CardId.LostWind,
CardId.SinisterShadowGames, CardId.SinisterShadowGames,
CardId.ShaddollCore, CardId.ShaddollCore,
}; };
} }
public int[] Useless_List() public int[] Useless_List()
{ {
return new[] return new[]
{ {
CardId.GlowUpBulb, CardId.GlowUpBulb,
CardId.PlaguespreaderZombie, CardId.PlaguespreaderZombie,
CardId.ChargeOfTheLightBrigade, CardId.ChargeOfTheLightBrigade,
CardId.ThatGrassLooksgreener, CardId.ThatGrassLooksgreener,
CardId.HarpiesFeatherDuster, CardId.HarpiesFeatherDuster,
CardId.FairyTailSnow, CardId.FairyTailSnow,
CardId.GiantRex, CardId.GiantRex,
CardId.Lumina, CardId.Lumina,
CardId.OvertexCoatls, CardId.OvertexCoatls,
CardId.InterruptedKaijuSlumber, CardId.InterruptedKaijuSlumber,
CardId.FoolishBurial, CardId.FoolishBurial,
}; };
} }
int Ultimate_ss = 0; int Ultimate_ss = 0;
int Enemy_atk = 0; int Enemy_atk = 0;
bool Pillused = false; bool Pillused = false;
bool CrystronNeedlefibereff_used = false; bool CrystronNeedlefibereff_used = false;
bool OvertexCoatlseff_used = false; bool OvertexCoatlseff_used = false;
bool ShaddollBeast_used = false; bool ShaddollBeast_used = false;
bool ShaddollFalco_used = false; bool ShaddollFalco_used = false;
bool ShaddollSquamata_used = false; bool ShaddollSquamata_used = false;
bool ShaddollDragon_used = false; bool ShaddollDragon_used = false;
bool ShaddollHedgehog_used = false; bool ShaddollHedgehog_used = false;
public int GetTotalATK(IList<ClientCard> list) public int GetTotalATK(IList<ClientCard> list)
{ {
int atk = 0; int atk = 0;
foreach (ClientCard c in list) foreach (ClientCard c in list)
{ {
if (c == null) continue; if (c == null) continue;
atk += c.Attack; atk += c.Attack;
} }
return atk; return atk;
} }
public override void OnNewPhase() public override void OnNewPhase()
{ {
Enemy_atk = 0; Enemy_atk = 0;
IList<ClientCard> list = new List<ClientCard>(); IList<ClientCard> list = new List<ClientCard>();
foreach (ClientCard monster in Enemy.GetMonsters()) foreach (ClientCard monster in Enemy.GetMonsters())
{ {
if(monster.IsAttack()) if(monster.IsAttack())
list.Add(monster); list.Add(monster);
} }
//if (GetTotalATK(list) / 2 >= Bot.LifePoints) return false; //if (GetTotalATK(list) / 2 >= Bot.LifePoints) return false;
Enemy_atk = GetTotalATK(list); Enemy_atk = GetTotalATK(list);
//SLogger.DebugWriteLine("++++++++++++++++++" + Enemy_atk + "++++++++++++"); //SLogger.DebugWriteLine("++++++++++++++++++" + Enemy_atk + "++++++++++++");
} }
public override void OnNewTurn() public override void OnNewTurn()
{ {
Pillused = false; Pillused = false;
OvertexCoatlseff_used = false; OvertexCoatlseff_used = false;
CrystronNeedlefibereff_used = false; CrystronNeedlefibereff_used = false;
ShaddollBeast_used = false; ShaddollBeast_used = false;
ShaddollFalco_used = false; ShaddollFalco_used = false;
ShaddollSquamata_used = false; ShaddollSquamata_used = false;
ShaddollDragon_used = false; ShaddollDragon_used = false;
ShaddollHedgehog_used = false; ShaddollHedgehog_used = false;
} }
private bool Luminasummon() private bool Luminasummon()
{ {
if (Bot.Deck.Count >= 20) return true; if (Bot.Deck.Count >= 20) return true;
IList<ClientCard> extra = Bot.GetMonstersInExtraZone(); IList<ClientCard> extra = Bot.GetMonstersInExtraZone();
if (extra != null) if (extra != null)
foreach (ClientCard monster in extra) foreach (ClientCard monster in extra)
if (!monster.HasType(CardType.Link)) if (!monster.HasType(CardType.Link))
return false; return false;
if (Bot.LifePoints <= 3000) return true; if (Bot.LifePoints <= 3000) return true;
if (Bot.HasInGraveyard(CardId.Raiden)) return true; if (Bot.HasInGraveyard(CardId.Raiden)) return true;
return false; return false;
} }
private bool Luminaeff() private bool Luminaeff()
{ {
if (Bot.HasInGraveyard(CardId.Raiden)) if (Bot.HasInGraveyard(CardId.Raiden))
{ {
AI.SelectCard(Useless_List()); AI.SelectCard(Useless_List());
AI.SelectNextCard(CardId.Raiden); AI.SelectNextCard(CardId.Raiden);
return true; return true;
} }
return false; return false;
} }
private bool UltimateConductorTytannoeff() private bool UltimateConductorTytannoeff()
{ {
IList<int> targets = new[] { IList<int> targets = new[] {
CardId.OvertexCoatls, CardId.OvertexCoatls,
CardId.ShaddollBeast, CardId.ShaddollBeast,
CardId.ShaddollSquamata, CardId.ShaddollSquamata,
CardId.ShaddollHedgehog, CardId.ShaddollHedgehog,
CardId.ShaddollDragon, CardId.ShaddollDragon,
CardId.ShaddollFalco, CardId.ShaddollFalco,
CardId.GlowUpBulb, CardId.GlowUpBulb,
CardId.PlaguespreaderZombie, CardId.PlaguespreaderZombie,
CardId.FairyTailSnow, CardId.FairyTailSnow,
CardId.KeeperOfDragonicMagic, CardId.KeeperOfDragonicMagic,
CardId.DogorantheMadFlameKaiju, CardId.DogorantheMadFlameKaiju,
CardId.GamecieltheSeaTurtleKaiju, CardId.GamecieltheSeaTurtleKaiju,
CardId.RadiantheMultidimensionalKaiju, CardId.RadiantheMultidimensionalKaiju,
CardId.GiantRex, CardId.GiantRex,
CardId.ShaddollCore, CardId.ShaddollCore,
CardId.SouleatingOviraptor, CardId.SouleatingOviraptor,
CardId.Raiden, CardId.Raiden,
CardId.Lumina, CardId.Lumina,
CardId.AshBlossom, CardId.AshBlossom,
CardId.GhostOgre, CardId.GhostOgre,
CardId.MaxxC, CardId.MaxxC,
}; };
if (Duel.Phase == DuelPhase.Main1) if (Duel.Phase == DuelPhase.Main1)
{ {
if(Duel.Player==0) if(Duel.Player==0)
{ {
int count = 0; int count = 0;
IList<ClientCard> check = Enemy.GetMonsters(); IList<ClientCard> check = Enemy.GetMonsters();
foreach (ClientCard monster in check) foreach (ClientCard monster in check)
if (monster.Attack > 2500 || monster == Enemy.MonsterZone.GetDangerousMonster()) if (monster.Attack > 2500 || monster == Enemy.MonsterZone.GetDangerousMonster())
count++; count++;
if(count==0)return false; if(count==0)return false;
} }
if (!Bot.HasInHand(targets)) if (!Bot.HasInHand(targets))
{ {
if(!Bot.HasInMonstersZone(targets)) if(!Bot.HasInMonstersZone(targets))
return false; return false;
} }
AI.SelectCard(targets); AI.SelectCard(targets);
return true; return true;
} }
if (Duel.Phase == DuelPhase.BattleStart) if (Duel.Phase == DuelPhase.BattleStart)
{ {
AI.SelectYesNo(true); AI.SelectYesNo(true);
return true; return true;
} }
return false; return false;
} }
private bool GamecieltheSeaTurtleKaijusp() private bool GamecieltheSeaTurtleKaijusp()
{ {
if (!Bot.HasInMonstersZone(CardId.UltimateConductorTytanno)) if (!Bot.HasInMonstersZone(CardId.UltimateConductorTytanno))
return DefaultKaijuSpsummon(); return DefaultKaijuSpsummon();
return false; return false;
} }
private bool RadiantheMultidimensionalKaijusp() private bool RadiantheMultidimensionalKaijusp()
{ {
if (Enemy.HasInMonstersZone(CardId.GamecieltheSeaTurtleKaiju)) return true; if (Enemy.HasInMonstersZone(CardId.GamecieltheSeaTurtleKaiju)) return true;
if (Bot.HasInHand(CardId.DogorantheMadFlameKaiju) && !Bot.HasInMonstersZone(CardId.UltimateConductorTytanno)) return DefaultKaijuSpsummon(); if (Bot.HasInHand(CardId.DogorantheMadFlameKaiju) && !Bot.HasInMonstersZone(CardId.UltimateConductorTytanno)) return DefaultKaijuSpsummon();
return false; return false;
} }
private bool DogorantheMadFlameKaijusp() private bool DogorantheMadFlameKaijusp()
{ {
if (Enemy.HasInMonstersZone(CardId.GamecieltheSeaTurtleKaiju)) return true; if (Enemy.HasInMonstersZone(CardId.GamecieltheSeaTurtleKaiju)) return true;
if (Enemy.HasInMonstersZone(CardId.RadiantheMultidimensionalKaiju)) return true; if (Enemy.HasInMonstersZone(CardId.RadiantheMultidimensionalKaiju)) return true;
return false; return false;
} }
private bool InterruptedKaijuSlumbereff() private bool InterruptedKaijuSlumbereff()
{ {
if (Enemy.GetMonsterCount() - Bot.GetMonsterCount() >= 2 ) if (Enemy.GetMonsterCount() - Bot.GetMonsterCount() >= 2 )
return DefaultInterruptedKaijuSlumber(); return DefaultInterruptedKaijuSlumber();
return false; return false;
} }
private bool UltimateConductorTytannosp() private bool UltimateConductorTytannosp()
{ {
Pillused = true; Pillused = true;
foreach (ClientCard card in Bot.GetMonsters()) foreach (ClientCard card in Bot.GetMonsters())
{ {
if (card.IsCode(CardId.UltimateConductorTytanno) && card.IsFaceup()) if (card.IsCode(CardId.UltimateConductorTytanno) && card.IsFaceup())
return false; return false;
} }
Ultimate_ss++; Ultimate_ss++;
return true; return true;
} }
private bool KeeperOfDragonicMagiceff() private bool KeeperOfDragonicMagiceff()
{ {
if (ActivateDescription == -1) if (ActivateDescription == -1)
{ {
AI.SelectCard(Useless_List()); AI.SelectCard(Useless_List());
return true; return true;
} }
return true; return true;
} }
private bool MonsterRepos() private bool MonsterRepos()
{ {
if (Card.IsCode(CardId.UltimateConductorTytanno) && Card.IsFacedown()) return true; if (Card.IsCode(CardId.UltimateConductorTytanno) && Card.IsFacedown()) return true;
if (Card.IsCode(CardId.ElShaddollConstruct) && Card.IsFacedown()) return true; if (Card.IsCode(CardId.ElShaddollConstruct) && Card.IsFacedown()) return true;
if (Card.IsCode(CardId.ElShaddollConstruct) && Card.IsAttack()) return false; if (Card.IsCode(CardId.ElShaddollConstruct) && Card.IsAttack()) return false;
if (Card.IsCode(CardId.GlowUpBulb) && Card.IsDefense()) return false; if (Card.IsCode(CardId.GlowUpBulb) && Card.IsDefense()) return false;
if (Card.IsCode(CardId.ShaddollDragon) && Card.IsFacedown() && Enemy.GetMonsterCount() >= 0) return true; if (Card.IsCode(CardId.ShaddollDragon) && Card.IsFacedown() && Enemy.GetMonsterCount() >= 0) return true;
if (Card.IsCode(CardId.ShaddollSquamata) && Card.IsFacedown() && Enemy.GetMonsterCount() >= 0) return true; if (Card.IsCode(CardId.ShaddollSquamata) && Card.IsFacedown() && Enemy.GetMonsterCount() >= 0) return true;
return base.DefaultMonsterRepos(); return base.DefaultMonsterRepos();
} }
private bool OvertexCoatlseff() private bool OvertexCoatlseff()
{ {
if (Card.Location == CardLocation.MonsterZone) return false; if (Card.Location == CardLocation.MonsterZone) return false;
OvertexCoatlseff_used = true; OvertexCoatlseff_used = true;
return true; return true;
} }
private bool DoubleEvolutionPilleff() private bool DoubleEvolutionPilleff()
{ {
foreach (ClientCard card in Bot.GetMonsters()) foreach (ClientCard card in Bot.GetMonsters())
{ {
if (card.IsCode(CardId.UltimateConductorTytanno) && card.IsFaceup()) if (card.IsCode(CardId.UltimateConductorTytanno) && card.IsFaceup())
return false; return false;
} }
if (Pillused == true) return false; if (Pillused == true) return false;
Pillused = true; Pillused = true;
IList<int> targets = new[] { IList<int> targets = new[] {
CardId.GiantRex, CardId.GiantRex,
CardId.DogorantheMadFlameKaiju, CardId.DogorantheMadFlameKaiju,
CardId.GamecieltheSeaTurtleKaiju, CardId.GamecieltheSeaTurtleKaiju,
CardId.RadiantheMultidimensionalKaiju, CardId.RadiantheMultidimensionalKaiju,
CardId.OvertexCoatls, CardId.OvertexCoatls,
CardId.SouleatingOviraptor, CardId.SouleatingOviraptor,
CardId.UltimateConductorTytanno, CardId.UltimateConductorTytanno,
}; };
if (Bot.HasInGraveyard(targets)) if (Bot.HasInGraveyard(targets))
{ {
AI.SelectCard(CardId.GiantRex, CardId.DogorantheMadFlameKaiju, CardId.OvertexCoatls, CardId.GamecieltheSeaTurtleKaiju, CardId.RadiantheMultidimensionalKaiju, CardId.SouleatingOviraptor, CardId.UltimateConductorTytanno); AI.SelectCard(CardId.GiantRex, CardId.DogorantheMadFlameKaiju, CardId.OvertexCoatls, CardId.GamecieltheSeaTurtleKaiju, CardId.RadiantheMultidimensionalKaiju, CardId.SouleatingOviraptor, CardId.UltimateConductorTytanno);
} }
else else
{ {
AI.SelectCard(CardId.GiantRex, CardId.DogorantheMadFlameKaiju, CardId.GamecieltheSeaTurtleKaiju, CardId.RadiantheMultidimensionalKaiju, CardId.OvertexCoatls, CardId.SouleatingOviraptor, CardId.UltimateConductorTytanno); AI.SelectCard(CardId.GiantRex, CardId.DogorantheMadFlameKaiju, CardId.GamecieltheSeaTurtleKaiju, CardId.RadiantheMultidimensionalKaiju, CardId.OvertexCoatls, CardId.SouleatingOviraptor, CardId.UltimateConductorTytanno);
} }
IList<int> targets2 = new[] { IList<int> targets2 = new[] {
CardId.GiantRex, CardId.GiantRex,
CardId.DogorantheMadFlameKaiju, CardId.DogorantheMadFlameKaiju,
CardId.GamecieltheSeaTurtleKaiju, CardId.GamecieltheSeaTurtleKaiju,
CardId.RadiantheMultidimensionalKaiju, CardId.RadiantheMultidimensionalKaiju,
CardId.OvertexCoatls, CardId.OvertexCoatls,
CardId.SouleatingOviraptor, CardId.SouleatingOviraptor,
CardId.UltimateConductorTytanno, CardId.UltimateConductorTytanno,
}; };
if (Bot.HasInGraveyard(targets)) if (Bot.HasInGraveyard(targets))
{ {
AI.SelectNextCard(CardId.ShaddollBeast, CardId.ShaddollDragon, CardId.KeeperOfDragonicMagic, CardId.ShaddollSquamata, CardId.SouleatingOviraptor, CardId.Raiden, CardId.Lumina, CardId.ShaddollHedgehog, CardId.AshBlossom, CardId.GhostOgre, CardId.ShaddollFalco, CardId.MaxxC, CardId.PlaguespreaderZombie, CardId.GlowUpBulb, CardId.FairyTailSnow); AI.SelectNextCard(CardId.ShaddollBeast, CardId.ShaddollDragon, CardId.KeeperOfDragonicMagic, CardId.ShaddollSquamata, CardId.SouleatingOviraptor, CardId.Raiden, CardId.Lumina, CardId.ShaddollHedgehog, CardId.AshBlossom, CardId.GhostOgre, CardId.ShaddollFalco, CardId.MaxxC, CardId.PlaguespreaderZombie, CardId.GlowUpBulb, CardId.FairyTailSnow);
} }
else else
AI.SelectNextCard(CardId.ShaddollBeast, CardId.ShaddollDragon, CardId.KeeperOfDragonicMagic, CardId.ShaddollSquamata, CardId.SouleatingOviraptor, CardId.Raiden, CardId.Lumina, CardId.ShaddollHedgehog, CardId.AshBlossom, CardId.GhostOgre, CardId.ShaddollFalco, CardId.MaxxC, CardId.PlaguespreaderZombie, CardId.GlowUpBulb, CardId.FairyTailSnow); AI.SelectNextCard(CardId.ShaddollBeast, CardId.ShaddollDragon, CardId.KeeperOfDragonicMagic, CardId.ShaddollSquamata, CardId.SouleatingOviraptor, CardId.Raiden, CardId.Lumina, CardId.ShaddollHedgehog, CardId.AshBlossom, CardId.GhostOgre, CardId.ShaddollFalco, CardId.MaxxC, CardId.PlaguespreaderZombie, CardId.GlowUpBulb, CardId.FairyTailSnow);
AI.SelectThirdCard(new[] { AI.SelectThirdCard(new[] {
CardId.UltimateConductorTytanno, CardId.UltimateConductorTytanno,
}); });
return Enemy.GetMonsterCount() >= 1; return Enemy.GetMonsterCount() >= 1;
} }
private bool FairyTailSnowsummon() private bool FairyTailSnowsummon()
{ {
ClientCard target = Util.GetBestEnemyMonster(true, true); ClientCard target = Util.GetBestEnemyMonster(true, true);
if(target != null) if(target != null)
{ {
return true; return true;
} }
return false; return false;
} }
private bool FairyTailSnoweff() private bool FairyTailSnoweff()
{ {
if (Card.Location == CardLocation.MonsterZone) if (Card.Location == CardLocation.MonsterZone)
{ {
AI.SelectCard(Util.GetBestEnemyMonster(true, true)); AI.SelectCard(Util.GetBestEnemyMonster(true, true));
return true; return true;
} }
else else
{ {
int spell_count = 0; int spell_count = 0;
IList<ClientCard> grave = Bot.Graveyard; IList<ClientCard> grave = Bot.Graveyard;
IList<ClientCard> all = new List<ClientCard>(); IList<ClientCard> all = new List<ClientCard>();
foreach (ClientCard check in grave) foreach (ClientCard check in grave)
{ {
if (check.IsCode(CardId.GiantRex)) if (check.IsCode(CardId.GiantRex))
{ {
all.Add(check); all.Add(check);
} }
} }
foreach (ClientCard check in grave) foreach (ClientCard check in grave)
{ {
if(check.HasType(CardType.Spell)||check.HasType(CardType.Trap)) if(check.HasType(CardType.Spell)||check.HasType(CardType.Trap))
{ {
spell_count++; spell_count++;
all.Add(check); all.Add(check);
} }
} }
foreach (ClientCard check in grave) foreach (ClientCard check in grave)
{ {
if (check.HasType(CardType.Monster)) if (check.HasType(CardType.Monster))
{ {
all.Add(check); all.Add(check);
} }
} }
if (Util.ChainContainsCard(CardId.FairyTailSnow)) return false; if (Util.ChainContainsCard(CardId.FairyTailSnow)) return false;
if ( Duel.Player == 1 && Duel.Phase == DuelPhase.BattleStart && Bot.BattlingMonster == null && Enemy_atk >=Bot.LifePoints || if ( Duel.Player == 1 && Duel.Phase == DuelPhase.BattleStart && Bot.BattlingMonster == null && Enemy_atk >=Bot.LifePoints ||
Duel.Player == 0 && Duel.Phase==DuelPhase.BattleStart && Enemy.BattlingMonster == null && Enemy.LifePoints<=1850 Duel.Player == 0 && Duel.Phase==DuelPhase.BattleStart && Enemy.BattlingMonster == null && Enemy.LifePoints<=1850
) )
{ {
AI.SelectCard(all); AI.SelectCard(all);
AI.SelectNextCard(Util.GetBestEnemyMonster()); AI.SelectNextCard(Util.GetBestEnemyMonster());
return true; return true;
} }
} }
return false; return false;
} }
private bool SouleatingOviraptoreff() private bool SouleatingOviraptoreff()
{ {
if (!OvertexCoatlseff_used && Bot.GetRemainingCount(CardId.OvertexCoatls, 3) > 0) if (!OvertexCoatlseff_used && Bot.GetRemainingCount(CardId.OvertexCoatls, 3) > 0)
{ {
AI.SelectCard(CardId.OvertexCoatls); AI.SelectCard(CardId.OvertexCoatls);
AI.SelectOption(0); AI.SelectOption(0);
} }
else else
{ {
AI.SelectCard(CardId.UltimateConductorTytanno); AI.SelectCard(CardId.UltimateConductorTytanno);
AI.SelectOption(1); AI.SelectOption(1);
} }
return true; return true;
} }
private bool GlowUpBulbeff() private bool GlowUpBulbeff()
{ {
IList<ClientCard> check = Bot.GetMonstersInExtraZone(); IList<ClientCard> check = Bot.GetMonstersInExtraZone();
foreach (ClientCard monster in check) foreach (ClientCard monster in check)
if (monster.HasType(CardType.Fusion)) return false; if (monster.HasType(CardType.Fusion)) return false;
if (Bot.HasInMonstersZone(CardId.Lumina) || if (Bot.HasInMonstersZone(CardId.Lumina) ||
Bot.HasInMonstersZone(CardId.FairyTailSnow) || Bot.HasInMonstersZone(CardId.FairyTailSnow) ||
Bot.HasInMonstersZone(CardId.KeeperOfDragonicMagic) || Bot.HasInMonstersZone(CardId.KeeperOfDragonicMagic) ||
Bot.HasInMonstersZone(CardId.SouleatingOviraptor) || Bot.HasInMonstersZone(CardId.SouleatingOviraptor) ||
Bot.HasInMonstersZone(CardId.GiantRex) || Bot.HasInMonstersZone(CardId.GiantRex) ||
Bot.HasInMonstersZone(CardId.Raiden) Bot.HasInMonstersZone(CardId.Raiden)
) )
{ {
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
return true; return true;
} }
return false; return false;
} }
private bool TG_WonderMagicianeff() private bool TG_WonderMagicianeff()
{ {
return true; return true;
} }
private bool AllureofDarkness() private bool AllureofDarkness()
{ {
IList<ClientCard> materials = Bot.Hand; IList<ClientCard> materials = Bot.Hand;
// IList<ClientCard> check = new List<ClientCard>(); // IList<ClientCard> check = new List<ClientCard>();
ClientCard mat = null; ClientCard mat = null;
foreach (ClientCard card in materials) foreach (ClientCard card in materials)
{ {
if (card.HasAttribute(CardAttribute.Dark)) if (card.HasAttribute(CardAttribute.Dark))
{ {
mat = card; mat = card;
break; break;
} }
} }
if (mat != null) if (mat != null)
{ {
return true; return true;
} }
return false; return false;
} }
private bool Reborneff() private bool Reborneff()
{ {
if(Bot.HasInGraveyard(CardId.UltimateConductorTytanno)&&Ultimate_ss>0) if(Bot.HasInGraveyard(CardId.UltimateConductorTytanno)&&Ultimate_ss>0)
{ {
AI.SelectCard(CardId.UltimateConductorTytanno); AI.SelectCard(CardId.UltimateConductorTytanno);
return true; return true;
} }
if (!Util.IsOneEnemyBetter(true)) return false; if (!Util.IsOneEnemyBetter(true)) return false;
IList<int> targets = new[] { IList<int> targets = new[] {
CardId.ElShaddollConstruct, CardId.ElShaddollConstruct,
CardId.DogorantheMadFlameKaiju, CardId.DogorantheMadFlameKaiju,
CardId.GamecieltheSeaTurtleKaiju, CardId.GamecieltheSeaTurtleKaiju,
CardId.SouleatingOviraptor, CardId.SouleatingOviraptor,
}; };
if (!Bot.HasInGraveyard(targets)) if (!Bot.HasInGraveyard(targets))
{ {
return false; return false;
} }
AI.SelectCard(targets); AI.SelectCard(targets);
return true; return true;
} }
private bool PotofAvariceeff() private bool PotofAvariceeff()
{ {
return true; return true;
} }
private bool MaxxC() private bool MaxxC()
{ {
return Duel.Player == 1; return Duel.Player == 1;
} }
private bool SetIsFieldEmpty() private bool SetIsFieldEmpty()
{ {
return !Bot.IsFieldEmpty(); return !Bot.IsFieldEmpty();
} }
private bool SpellSetZone() private bool SpellSetZone()
{ {
return (Bot.GetHandCount()>6 && Duel.Phase==DuelPhase.Main2); return (Bot.GetHandCount()>6 && Duel.Phase==DuelPhase.Main2);
} }
private bool ChargeOfTheLightBrigadeEffect() private bool ChargeOfTheLightBrigadeEffect()
{ {
if (Bot.HasInGraveyard(CardId.Raiden) || Bot.HasInHand(CardId.Raiden)) if (Bot.HasInGraveyard(CardId.Raiden) || Bot.HasInHand(CardId.Raiden))
AI.SelectCard(CardId.Lumina); AI.SelectCard(CardId.Lumina);
else else
AI.SelectCard(CardId.Raiden); AI.SelectCard(CardId.Raiden);
return true; return true;
} }
// all Shaddoll // all Shaddoll
private bool SinisterShadowGameseff() private bool SinisterShadowGameseff()
{ {
if (Bot.HasInGraveyard(CardId.ShaddollFusion)) if (Bot.HasInGraveyard(CardId.ShaddollFusion))
AI.SelectCard(CardId.ShaddollCore); AI.SelectCard(CardId.ShaddollCore);
else else
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.ShaddollBeast, CardId.ShaddollBeast,
}); });
return true; return true;
} }
private bool ShaddollCoreeff() private bool ShaddollCoreeff()
{ {
if (Card.Location == CardLocation.SpellZone) if (Card.Location == CardLocation.SpellZone)
{ {
if (Duel.Player == 1 && Bot.BattlingMonster == null && Duel.Phase==DuelPhase.BattleStart|| DefaultOnBecomeTarget()) if (Duel.Player == 1 && Bot.BattlingMonster == null && Duel.Phase==DuelPhase.BattleStart|| DefaultOnBecomeTarget())
{ {
Logger.DebugWriteLine("+++++++++++ShaddollCoreeffdododoo++++++++++"); Logger.DebugWriteLine("+++++++++++ShaddollCoreeffdododoo++++++++++");
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
return true; return true;
} }
return false; return false;
} }
return true; return true;
} }
private bool ShaddollFusioneff() private bool ShaddollFusioneff()
{ {
List<ClientCard> extra_zone_check = Bot.GetMonstersInExtraZone(); List<ClientCard> extra_zone_check = Bot.GetMonstersInExtraZone();
foreach (ClientCard extra_monster in extra_zone_check) foreach (ClientCard extra_monster in extra_zone_check)
if (extra_monster.HasType(CardType.Xyz) || extra_monster.HasType(CardType.Fusion) || extra_monster.HasType(CardType.Synchro)) return false; if (extra_monster.HasType(CardType.Xyz) || extra_monster.HasType(CardType.Fusion) || extra_monster.HasType(CardType.Synchro)) return false;
bool deck_check = false; bool deck_check = false;
List<ClientCard> monsters = Enemy.GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.HasType(CardType.Synchro) || monster.HasType(CardType.Fusion) || monster.HasType(CardType.Xyz) || monster.HasType(CardType.Link)) if (monster.HasType(CardType.Synchro) || monster.HasType(CardType.Fusion) || monster.HasType(CardType.Xyz) || monster.HasType(CardType.Link))
deck_check = true; deck_check = true;
} }
if (deck_check) if (deck_check)
{ {
AI.SelectCard( AI.SelectCard(
CardId.ElShaddollConstruct, CardId.ElShaddollConstruct,
CardId.ElShaddollShekhinaga, CardId.ElShaddollShekhinaga,
CardId.ElShaddollGrysra, CardId.ElShaddollGrysra,
CardId.ElShaddollWinda CardId.ElShaddollWinda
); );
AI.SelectNextCard( AI.SelectNextCard(
CardId.ShaddollSquamata, CardId.ShaddollSquamata,
CardId.ShaddollBeast, CardId.ShaddollBeast,
CardId.ShaddollHedgehog, CardId.ShaddollHedgehog,
CardId.ShaddollDragon, CardId.ShaddollDragon,
CardId.ShaddollFalco, CardId.ShaddollFalco,
CardId.FairyTailSnow CardId.FairyTailSnow
); );
AI.SelectPosition(CardPosition.FaceUpAttack); AI.SelectPosition(CardPosition.FaceUpAttack);
return true; return true;
} }
if (Enemy.GetMonsterCount() == 0) if (Enemy.GetMonsterCount() == 0)
{ {
int dark_count = 0; int dark_count = 0;
IList<ClientCard> m0 = Bot.Hand; IList<ClientCard> m0 = Bot.Hand;
IList<ClientCard> m1 = Bot.MonsterZone; IList<ClientCard> m1 = Bot.MonsterZone;
IList<ClientCard> all = new List<ClientCard>(); IList<ClientCard> all = new List<ClientCard>();
foreach (ClientCard monster in m0) foreach (ClientCard monster in m0)
{ {
if (dark_count == 2) break; if (dark_count == 2) break;
if (monster.HasAttribute(CardAttribute.Dark)) if (monster.HasAttribute(CardAttribute.Dark))
{ {
dark_count++; dark_count++;
all.Add(monster); all.Add(monster);
} }
} }
foreach (ClientCard monster in m1) foreach (ClientCard monster in m1)
{ {
if (dark_count == 2) break; if (dark_count == 2) break;
if (monster != null) if (monster != null)
{ {
if (monster.HasAttribute(CardAttribute.Dark)) if (monster.HasAttribute(CardAttribute.Dark))
{ {
dark_count++; dark_count++;
all.Add(monster); all.Add(monster);
} }
} }
} }
if (dark_count == 2) if (dark_count == 2)
{ {
AI.SelectCard(CardId.ElShaddollWinda); AI.SelectCard(CardId.ElShaddollWinda);
AI.SelectMaterials(all); AI.SelectMaterials(all);
AI.SelectPosition(CardPosition.FaceUpAttack); AI.SelectPosition(CardPosition.FaceUpAttack);
return true; return true;
} }
} }
if (!Util.IsOneEnemyBetter()) return false; if (!Util.IsOneEnemyBetter()) return false;
foreach (ClientCard monster in Bot.Hand) foreach (ClientCard monster in Bot.Hand)
{ {
if (monster.HasAttribute(CardAttribute.Light)) if (monster.HasAttribute(CardAttribute.Light))
{ {
AI.SelectCard(CardId.ElShaddollConstruct); AI.SelectCard(CardId.ElShaddollConstruct);
AI.SelectPosition(CardPosition.FaceUpAttack); AI.SelectPosition(CardPosition.FaceUpAttack);
return true; return true;
} }
} }
List<ClientCard> material_1 = Bot.GetMonsters(); List<ClientCard> material_1 = Bot.GetMonsters();
foreach (ClientCard monster in material_1) foreach (ClientCard monster in material_1)
{ {
if (monster == null) break; if (monster == null) break;
if (monster.HasAttribute(CardAttribute.Light)) if (monster.HasAttribute(CardAttribute.Light))
{ {
AI.SelectCard(CardId.ElShaddollConstruct); AI.SelectCard(CardId.ElShaddollConstruct);
AI.SelectPosition(CardPosition.FaceUpAttack); AI.SelectPosition(CardPosition.FaceUpAttack);
return true; return true;
} }
} }
return false; return false;
} }
private bool ElShaddollShekhinagaeff() private bool ElShaddollShekhinagaeff()
{ {
if (Card.Location != CardLocation.MonsterZone) if (Card.Location != CardLocation.MonsterZone)
return true; return true;
else else
{ {
if (DefaultBreakthroughSkill()) if (DefaultBreakthroughSkill())
{ {
AI.SelectCard( AI.SelectCard(
CardId.ShaddollBeast, CardId.ShaddollBeast,
CardId.ShaddollSquamata, CardId.ShaddollSquamata,
CardId.ShaddollHedgehog, CardId.ShaddollHedgehog,
CardId.ShaddollDragon, CardId.ShaddollDragon,
CardId.ShaddollFalco CardId.ShaddollFalco
); );
} }
else else
return false; return false;
} }
return true; return true;
} }
private bool ElShaddollGrysraeff() private bool ElShaddollGrysraeff()
{ {
if (Card.Location != CardLocation.MonsterZone) if (Card.Location != CardLocation.MonsterZone)
return true; return true;
return true; return true;
} }
private bool ElShaddollConstructeff() private bool ElShaddollConstructeff()
{ {
if (!ShaddollBeast_used) if (!ShaddollBeast_used)
AI.SelectCard(CardId.ShaddollBeast); AI.SelectCard(CardId.ShaddollBeast);
else else
AI.SelectCard(CardId.ShaddollFalco); AI.SelectCard(CardId.ShaddollFalco);
return true; return true;
} }
private bool ShaddollSquamataeff() private bool ShaddollSquamataeff()
{ {
ShaddollSquamata_used = true; ShaddollSquamata_used = true;
if (Card.Location != CardLocation.MonsterZone) if (Card.Location != CardLocation.MonsterZone)
{ {
if(Util.ChainContainsCard(CardId.ElShaddollConstruct)) if(Util.ChainContainsCard(CardId.ElShaddollConstruct))
{ {
if (!Bot.HasInHand(CardId.ShaddollFusion) && Bot.HasInGraveyard(CardId.ShaddollFusion)) if (!Bot.HasInHand(CardId.ShaddollFusion) && Bot.HasInGraveyard(CardId.ShaddollFusion))
AI.SelectNextCard(CardId.ShaddollCore); AI.SelectNextCard(CardId.ShaddollCore);
if (!ShaddollBeast_used) AI.SelectNextCard(CardId.ShaddollBeast); if (!ShaddollBeast_used) AI.SelectNextCard(CardId.ShaddollBeast);
else if (!ShaddollFalco_used) AI.SelectNextCard(CardId.ShaddollFalco); else if (!ShaddollFalco_used) AI.SelectNextCard(CardId.ShaddollFalco);
else if(!ShaddollHedgehog_used) AI.SelectNextCard(CardId.ShaddollHedgehog); else if(!ShaddollHedgehog_used) AI.SelectNextCard(CardId.ShaddollHedgehog);
} }
else else
{ {
if (!Bot.HasInHand(CardId.ShaddollFusion) && Bot.HasInGraveyard(CardId.ShaddollFusion)) if (!Bot.HasInHand(CardId.ShaddollFusion) && Bot.HasInGraveyard(CardId.ShaddollFusion))
AI.SelectCard(CardId.ShaddollCore); AI.SelectCard(CardId.ShaddollCore);
if (!ShaddollBeast_used) AI.SelectCard(CardId.ShaddollBeast); if (!ShaddollBeast_used) AI.SelectCard(CardId.ShaddollBeast);
else if (!ShaddollFalco_used) AI.SelectCard(CardId.ShaddollFalco); else if (!ShaddollFalco_used) AI.SelectCard(CardId.ShaddollFalco);
else if (!ShaddollHedgehog_used) AI.SelectCard(CardId.ShaddollHedgehog); else if (!ShaddollHedgehog_used) AI.SelectCard(CardId.ShaddollHedgehog);
} }
} }
else else
{ {
if (Enemy.GetMonsterCount() == 0) return false; if (Enemy.GetMonsterCount() == 0) return false;
ClientCard target = Util.GetBestEnemyMonster(); ClientCard target = Util.GetBestEnemyMonster();
AI.SelectCard(target); AI.SelectCard(target);
} }
return true; return true;
} }
private bool ShaddollBeasteff() private bool ShaddollBeasteff()
{ {
ShaddollBeast_used = true; ShaddollBeast_used = true;
return true; return true;
} }
private bool ShaddollFalcoeff() private bool ShaddollFalcoeff()
{ {
ShaddollFalco_used = true; ShaddollFalco_used = true;
if (Card.Location != CardLocation.MonsterZone) if (Card.Location != CardLocation.MonsterZone)
return true; return true;
else else
{ {
AI.SelectCard( AI.SelectCard(
CardId.ElShaddollConstruct, CardId.ElShaddollConstruct,
CardId.ElShaddollShekhinaga, CardId.ElShaddollShekhinaga,
CardId.ElShaddollGrysra, CardId.ElShaddollGrysra,
CardId.ElShaddollWinda, CardId.ElShaddollWinda,
CardId.ShaddollSquamata CardId.ShaddollSquamata
); );
} }
return true; return true;
} }
private bool ShaddollHedgehogeff() private bool ShaddollHedgehogeff()
{ {
ShaddollHedgehog_used = true; ShaddollHedgehog_used = true;
if (Card.Location != CardLocation.MonsterZone) if (Card.Location != CardLocation.MonsterZone)
{ {
if (Util.ChainContainsCard(CardId.ElShaddollConstruct)) if (Util.ChainContainsCard(CardId.ElShaddollConstruct))
{ {
AI.SelectNextCard( AI.SelectNextCard(
CardId.ShaddollFalco, CardId.ShaddollFalco,
CardId.ShaddollSquamata, CardId.ShaddollSquamata,
CardId.ShaddollDragon CardId.ShaddollDragon
); );
} }
else else
{ {
AI.SelectCard( AI.SelectCard(
CardId.ShaddollSquamata, CardId.ShaddollSquamata,
CardId.ShaddollDragon CardId.ShaddollDragon
); );
} }
} }
else else
{ {
AI.SelectCard( AI.SelectCard(
CardId.ShaddollFusion, CardId.ShaddollFusion,
CardId.SinisterShadowGames CardId.SinisterShadowGames
); );
} }
return true; return true;
} }
private bool ShaddollDragoneff() private bool ShaddollDragoneff()
{ {
ShaddollDragon_used = true; ShaddollDragon_used = true;
if (Card.Location == CardLocation.MonsterZone) if (Card.Location == CardLocation.MonsterZone)
{ {
ClientCard target = Util.GetBestEnemyCard(); ClientCard target = Util.GetBestEnemyCard();
AI.SelectCard(target); AI.SelectCard(target);
return true; return true;
} }
else else
{ {
if (Enemy.GetSpellCount() == 0) return false; if (Enemy.GetSpellCount() == 0) return false;
ClientCard target = Util.GetBestEnemySpell(); ClientCard target = Util.GetBestEnemySpell();
AI.SelectCard(target); AI.SelectCard(target);
return true; return true;
} }
} }
private bool LostWindeff() private bool LostWindeff()
{ {
if (Card.Location == CardLocation.Grave) if (Card.Location == CardLocation.Grave)
return true; return true;
List<ClientCard> check = Enemy.GetMonsters(); List<ClientCard> check = Enemy.GetMonsters();
foreach (ClientCard m in check) foreach (ClientCard m in check)
{ {
if (m.Attack>=2000) return DefaultBreakthroughSkill(); if (m.Attack>=2000) return DefaultBreakthroughSkill();
} }
return false; return false;
} }
private bool FoolishBurialEffect() private bool FoolishBurialEffect()
{ {
if (Bot.GetRemainingCount(CardId.DoubleEvolutionPill, 3) > 0) if (Bot.GetRemainingCount(CardId.DoubleEvolutionPill, 3) > 0)
{ {
if (!OvertexCoatlseff_used) if (!OvertexCoatlseff_used)
{ {
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.OvertexCoatls, CardId.OvertexCoatls,
}); });
return true; return true;
} }
return false; return false;
} }
else else
{ {
AI.SelectCard(CardId.ShaddollSquamata, CardId.FairyTailSnow); AI.SelectCard(CardId.ShaddollSquamata, CardId.FairyTailSnow);
} }
return true; return true;
} }
public bool Hand_act_eff() public bool Hand_act_eff()
{ {
//if (Card.IsCode(CardId.Urara) && Bot.HasInHand(CardId.LockBird) && Bot.HasInSpellZone(CardId.Re)) return false; //if (Card.IsCode(CardId.Urara) && Bot.HasInHand(CardId.LockBird) && Bot.HasInSpellZone(CardId.Re)) return false;
if (Card.IsCode(CardId.GhostOgre) && Card.Location == CardLocation.Hand && Bot.HasInMonstersZone(CardId.GhostOgre)) return false; if (Card.IsCode(CardId.GhostOgre) && Card.Location == CardLocation.Hand && Bot.HasInMonstersZone(CardId.GhostOgre)) return false;
return (Duel.LastChainPlayer == 1); return (Duel.LastChainPlayer == 1);
} }
//other extra //other extra
private bool Michaelsp() private bool Michaelsp()
{ {
IList<int> targets = new[] { IList<int> targets = new[] {
CardId.Raiden, CardId.Raiden,
CardId.Lumina CardId.Lumina
}; };
if (!Bot.HasInMonstersZone(targets)) if (!Bot.HasInMonstersZone(targets))
return false; return false;
AI.SelectCard(targets); AI.SelectCard(targets);
return true; return true;
} }
private bool Michaeleff() private bool Michaeleff()
{ {
if (Card.Location == CardLocation.Grave) if (Card.Location == CardLocation.Grave)
return true; return true;
if (Bot.LifePoints <= 1000) return false; if (Bot.LifePoints <= 1000) return false;
ClientCard select = Util.GetBestEnemyCard(); ClientCard select = Util.GetBestEnemyCard();
if (select == null) return false; if (select == null) return false;
if(select!=null) if(select!=null)
{ {
AI.SelectCard(select); AI.SelectCard(select);
return true; return true;
} }
return false; return false;
} }
private bool MinervaTheExaltedEffect() private bool MinervaTheExaltedEffect()
{ {
if (Card.Location == CardLocation.MonsterZone) if (Card.Location == CardLocation.MonsterZone)
{ {
if (Bot.Deck.Count <= 10) return false; if (Bot.Deck.Count <= 10) return false;
return true; return true;
} }
else else
{ {
IList<ClientCard> targets = new List<ClientCard>(); IList<ClientCard> targets = new List<ClientCard>();
ClientCard target1 = Util.GetBestEnemyMonster(); ClientCard target1 = Util.GetBestEnemyMonster();
if (target1 != null) if (target1 != null)
targets.Add(target1); targets.Add(target1);
ClientCard target2 = Util.GetBestEnemySpell(); ClientCard target2 = Util.GetBestEnemySpell();
if (target2 != null) if (target2 != null)
targets.Add(target2); targets.Add(target2);
foreach (ClientCard target in Enemy.GetMonsters()) foreach (ClientCard target in Enemy.GetMonsters())
{ {
if (targets.Count >= 3) if (targets.Count >= 3)
break; break;
if (!targets.Contains(target)) if (!targets.Contains(target))
targets.Add(target); targets.Add(target);
} }
foreach (ClientCard target in Enemy.GetSpells()) foreach (ClientCard target in Enemy.GetSpells())
{ {
if (targets.Count >= 3) if (targets.Count >= 3)
break; break;
if (!targets.Contains(target)) if (!targets.Contains(target))
targets.Add(target); targets.Add(target);
} }
if (targets.Count == 0) if (targets.Count == 0)
return false; return false;
AI.SelectCard(0); AI.SelectCard(0);
AI.SelectNextCard(targets); AI.SelectNextCard(targets);
return true; return true;
} }
} }
public bool CrystronNeedlefibersp() public bool CrystronNeedlefibersp()
{ {
if (Bot.HasInMonstersZone(CardId.ElShaddollConstruct) || if (Bot.HasInMonstersZone(CardId.ElShaddollConstruct) ||
Bot.HasInMonstersZone(CardId.ElShaddollGrysra) || Bot.HasInMonstersZone(CardId.ElShaddollGrysra) ||
Bot.HasInMonstersZone(CardId.ElShaddollShekhinaga) || Bot.HasInMonstersZone(CardId.ElShaddollShekhinaga) ||
Bot.HasInMonstersZone(CardId.ElShaddollWinda)) Bot.HasInMonstersZone(CardId.ElShaddollWinda))
return false; return false;
if (CrystronNeedlefibereff_used) return false; if (CrystronNeedlefibereff_used) return false;
if (Bot.HasInMonstersZone(CardId.CrystronNeedlefiber)) return false; if (Bot.HasInMonstersZone(CardId.CrystronNeedlefiber)) return false;
IList<int> check = new[] IList<int> check = new[]
{ {
CardId.GlowUpBulb, CardId.GlowUpBulb,
CardId.FairyTailSnow, CardId.FairyTailSnow,
CardId.KeeperOfDragonicMagic, CardId.KeeperOfDragonicMagic,
CardId.SouleatingOviraptor, CardId.SouleatingOviraptor,
CardId.GiantRex, CardId.GiantRex,
CardId.Lumina, CardId.Lumina,
CardId.Raiden, CardId.Raiden,
}; };
int count=0; int count=0;
foreach (ClientCard monster in Bot.GetMonsters()) foreach (ClientCard monster in Bot.GetMonsters())
if (monster.IsCode(CardId.GlowUpBulb, CardId.FairyTailSnow, CardId.KeeperOfDragonicMagic, if (monster.IsCode(CardId.GlowUpBulb, CardId.FairyTailSnow, CardId.KeeperOfDragonicMagic,
CardId.SouleatingOviraptor, CardId.GiantRex, CardId.Lumina, CardId.Raiden)) CardId.SouleatingOviraptor, CardId.GiantRex, CardId.Lumina, CardId.Raiden))
count++; count++;
if (!Bot.HasInMonstersZone(CardId.GlowUpBulb) || count<2) if (!Bot.HasInMonstersZone(CardId.GlowUpBulb) || count<2)
return false; return false;
AI.SelectCard(check); AI.SelectCard(check);
AI.SelectNextCard(check); AI.SelectNextCard(check);
return true; return true;
} }
public bool CrystronNeedlefibereff() public bool CrystronNeedlefibereff()
{ {
bool DarkHole = false; bool DarkHole = false;
foreach (ClientCard card in Enemy.GetSpells()) foreach (ClientCard card in Enemy.GetSpells())
{ {
if (card.IsCode(53129443) && card.IsFaceup()) if (card.IsCode(53129443) && card.IsFaceup())
{ {
DarkHole = true; DarkHole = true;
} }
} }
if (Duel.Player == 0) if (Duel.Player == 0)
{ {
CrystronNeedlefibereff_used = true; CrystronNeedlefibereff_used = true;
AI.SelectCard( AI.SelectCard(
CardId.GhostOgre, CardId.GhostOgre,
CardId.GlowUpBulb, CardId.GlowUpBulb,
CardId.PlaguespreaderZombie, CardId.PlaguespreaderZombie,
CardId.ShaddollFalco CardId.ShaddollFalco
); );
return true; return true;
} }
else if (DarkHole || Util.IsChainTarget(Card) || Util.GetProblematicEnemySpell() != null) else if (DarkHole || Util.IsChainTarget(Card) || Util.GetProblematicEnemySpell() != null)
{ {
AI.SelectCard(CardId.TG_WonderMagician); AI.SelectCard(CardId.TG_WonderMagician);
return true; return true;
} }
else if (Duel.Player == 1 && Duel.Phase == DuelPhase.BattleStart && Util.IsOneEnemyBetterThanValue(1500, true)) else if (Duel.Player == 1 && Duel.Phase == DuelPhase.BattleStart && Util.IsOneEnemyBetterThanValue(1500, true))
{ {
AI.SelectCard(CardId.TG_WonderMagician); AI.SelectCard(CardId.TG_WonderMagician);
if (Util.IsOneEnemyBetterThanValue(1900, true)) if (Util.IsOneEnemyBetterThanValue(1900, true))
{ {
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
} }
else else
{ {
AI.SelectPosition(CardPosition.FaceUpAttack); AI.SelectPosition(CardPosition.FaceUpAttack);
} }
return true; return true;
} }
return false; return false;
} }
private bool ScarlightRedDragonsp() private bool ScarlightRedDragonsp()
{ {
return false; return false;
} }
private bool ScarlightRedDragoneff() private bool ScarlightRedDragoneff()
{ {
IList<ClientCard> targets = new List<ClientCard>(); IList<ClientCard> targets = new List<ClientCard>();
ClientCard target1 = Util.GetBestEnemyMonster(); ClientCard target1 = Util.GetBestEnemyMonster();
if (target1 != null) if (target1 != null)
{ {
targets.Add(target1); targets.Add(target1);
AI.SelectCard(targets); AI.SelectCard(targets);
return true; return true;
} }
return false; return false;
} }
private bool CrystalWingSynchroDragoneff() private bool CrystalWingSynchroDragoneff()
{ {
return Duel.LastChainPlayer != 0; return Duel.LastChainPlayer != 0;
} }
private bool Sdulldeateff() private bool Sdulldeateff()
{ {
/* if (snake_four_s) /* if (snake_four_s)
{ {
snake_four_s = false; snake_four_s = false;
AI.SelectCard(Useless_List()); AI.SelectCard(Useless_List());
return true; return true;
} }
//if (ActivateDescription == Util.GetStringId(CardId.snake, 2)) return true; //if (ActivateDescription == Util.GetStringId(CardId.snake, 2)) return true;
if (ActivateDescription == Util.GetStringId(CardId.snake, 1)) if (ActivateDescription == Util.GetStringId(CardId.snake, 1))
{ {
foreach (ClientCard hand in Bot.Hand) foreach (ClientCard hand in Bot.Hand)
{ {
if (hand.IsCode(CardId.Red, CardId.Pink)) if (hand.IsCode(CardId.Red, CardId.Pink))
{ {
AI.SelectCard(hand); AI.SelectCard(hand);
return true; return true;
} }
if (hand.IsCode(CardId.Urara, CardId.Ghost)) if (hand.IsCode(CardId.Urara, CardId.Ghost))
{ {
if (Tuner_ss()) if (Tuner_ss())
{ {
AI.SelectCard(hand); AI.SelectCard(hand);
return true; return true;
} }
} }
} }
}*/ }*/
return false; return false;
} }
private bool BlackRoseMoonlightDragoneff() private bool BlackRoseMoonlightDragoneff()
{ {
IList<ClientCard> targets = new List<ClientCard>(); IList<ClientCard> targets = new List<ClientCard>();
ClientCard target1 = Util.GetBestEnemyMonster(); ClientCard target1 = Util.GetBestEnemyMonster();
if (target1 != null) if (target1 != null)
{ {
targets.Add(target1); targets.Add(target1);
AI.SelectCard(targets); AI.SelectCard(targets);
return true; return true;
} }
return false; return false;
} }
private bool RedWyvernsp() private bool RedWyvernsp()
{ {
return false; return false;
} }
private bool RedWyverneff() private bool RedWyverneff()
{ {
IList<ClientCard> check = Enemy.GetMonsters(); IList<ClientCard> check = Enemy.GetMonsters();
ClientCard best = null; ClientCard best = null;
foreach (ClientCard monster in check) foreach (ClientCard monster in check)
{ {
if (monster.Attack >= 2400) best = monster; if (monster.Attack >= 2400) best = monster;
} }
if (best != null) if (best != null)
{ {
AI.SelectCard(best); AI.SelectCard(best);
return true; return true;
} }
return false; return false;
} }
private bool CoralDragoneff() private bool CoralDragoneff()
{ {
if (Card.Location != CardLocation.MonsterZone) if (Card.Location != CardLocation.MonsterZone)
return true; return true;
IList<ClientCard> targets = new List<ClientCard>(); IList<ClientCard> targets = new List<ClientCard>();
ClientCard target1 = Util.GetBestEnemyMonster(); ClientCard target1 = Util.GetBestEnemyMonster();
if (target1 != null) if (target1 != null)
targets.Add(target1); targets.Add(target1);
ClientCard target2 = Util.GetBestEnemySpell(); ClientCard target2 = Util.GetBestEnemySpell();
if (target2 != null) if (target2 != null)
targets.Add(target2); targets.Add(target2);
else if (Util.IsChainTarget(Card) || Util.GetProblematicEnemySpell() != null) else if (Util.IsChainTarget(Card) || Util.GetProblematicEnemySpell() != null)
{ {
AI.SelectCard(targets); AI.SelectCard(targets);
return true; return true;
} }
else if (Duel.Player == 1 && Duel.Phase == DuelPhase.BattleStart && Util.IsOneEnemyBetterThanValue(2400, true)) else if (Duel.Player == 1 && Duel.Phase == DuelPhase.BattleStart && Util.IsOneEnemyBetterThanValue(2400, true))
{ {
AI.SelectCard(targets); AI.SelectCard(targets);
return true; return true;
} }
return false; return false;
} }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{ {
if (!defender.IsMonsterHasPreventActivationEffectInBattle()) if (!defender.IsMonsterHasPreventActivationEffectInBattle())
{ {
if (attacker.IsCode(CardId.ElShaddollConstruct) && !attacker.IsDisabled()) // TODO: && defender.IsSpecialSummoned if (attacker.IsCode(CardId.ElShaddollConstruct) && !attacker.IsDisabled()) // TODO: && defender.IsSpecialSummoned
attacker.RealPower = 9999; attacker.RealPower = 9999;
if (attacker.IsCode(CardId.UltimateConductorTytanno) && !attacker.IsDisabled() && defender.IsDefense()) if (attacker.IsCode(CardId.UltimateConductorTytanno) && !attacker.IsDisabled() && defender.IsDefense())
attacker.RealPower = 9999; attacker.RealPower = 9999;
} }
return base.OnPreBattleBetween(attacker, defender); return base.OnPreBattleBetween(attacker, defender);
} }
public override bool OnSelectHand() public override bool OnSelectHand()
{ {
return true; return true;
} }
/* /*
private bool GoblindberghSummon() private bool GoblindberghSummon()
{ {
foreach (ClientCard card in Bot.Hand.GetMonsters()) foreach (ClientCard card in Bot.Hand.GetMonsters())
{ {
if (!card.Equals(Card) && card.Level == 4) if (!card.Equals(Card) && card.Level == 4)
return true; return true;
} }
return false; return false;
}*/ }*/
} }
} }
\ No newline at end of file
using YGOSharp.OCGWrapper; using YGOSharp.OCGWrapper;
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic; using System.Collections.Generic;
using WindBot; using WindBot;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
using System.Linq; using System.Linq;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
[Deck("TimeThief", "AI_Timethief")] [Deck("TimeThief", "AI_Timethief")]
public class TimeThiefExecutor : DefaultExecutor public class TimeThiefExecutor : DefaultExecutor
{ {
public class Monsters public class Monsters
{ {
//monsters //monsters
public const int TimeThiefWinder = 56308388; public const int TimeThiefWinder = 56308388;
public const int TimeThiefBezelShip = 82496079; public const int TimeThiefBezelShip = 82496079;
public const int TimeThiefCronocorder = 74578720; public const int TimeThiefCronocorder = 74578720;
public const int TimeThiefRegulator = 19891131; public const int TimeThiefRegulator = 19891131;
public const int PhotonTrasher = 65367484; public const int PhotonTrasher = 65367484;
public const int PerformTrickClown = 67696066; public const int PerformTrickClown = 67696066;
public const int ThunderKingRaiOh = 71564252; public const int ThunderKingRaiOh = 71564252;
public const int MaxxC = 23434538; public const int MaxxC = 23434538;
public const int AshBlossomAndJoyousSpring = 14558127; public const int AshBlossomAndJoyousSpring = 14558127;
} }
public class CardId public class CardId
{ {
public const int ImperialOrder = 61740673; public const int ImperialOrder = 61740673;
public const int NaturalExterio = 99916754; public const int NaturalExterio = 99916754;
public const int NaturalBeast = 33198837; public const int NaturalBeast = 33198837;
public const int SwordsmanLV7 = 37267041; public const int SwordsmanLV7 = 37267041;
public const int RoyalDecreel = 51452091; public const int RoyalDecreel = 51452091;
} }
public class Spells public class Spells
{ {
// spells // spells
public const int Raigeki = 12580477; public const int Raigeki = 12580477;
public const int FoolishBurial = 81439173; public const int FoolishBurial = 81439173;
public const int TimeThiefStartup = 10877309; public const int TimeThiefStartup = 10877309;
public const int TimeThiefHack = 81670445; public const int TimeThiefHack = 81670445;
public const int HarpieFeatherDuster = 18144506; public const int HarpieFeatherDuster = 18144506;
public const int PotOfDesires = 35261759; public const int PotOfDesires = 35261759;
public const int PotofExtravagance = 49238328; public const int PotofExtravagance = 49238328;
} }
public class Traps public class Traps
{ {
//traps //traps
public const int SolemnWarning = 84749824; public const int SolemnWarning = 84749824;
public const int SolemStrike = 40605147; public const int SolemStrike = 40605147;
public const int SolemnJudgment = 41420027; public const int SolemnJudgment = 41420027;
public const int TimeThiefRetrograte = 76587747; public const int TimeThiefRetrograte = 76587747;
public const int PhantomKnightsShade = 98827725; public const int PhantomKnightsShade = 98827725;
public const int TimeThiefFlyBack = 18678554; public const int TimeThiefFlyBack = 18678554;
public const int Crackdown = 36975314; public const int Crackdown = 36975314;
} }
public class XYZs public class XYZs
{ {
//xyz //xyz
public const int TimeThiefRedoer = 55285840; public const int TimeThiefRedoer = 55285840;
public const int TimeThiefPerpetua = 59208943; public const int TimeThiefPerpetua = 59208943;
public const int CrazyBox = 42421606; public const int CrazyBox = 42421606;
public const int GagagaCowboy = 12014404; public const int GagagaCowboy = 12014404;
public const int Number39Utopia = 84013237; public const int Number39Utopia = 84013237;
public const int NumberS39UtopiatheLightning = 56832966; public const int NumberS39UtopiatheLightning = 56832966;
public const int NumberS39UtopiaOne = 86532744; public const int NumberS39UtopiaOne = 86532744;
public const int DarkRebellionXyzDragon = 16195942; public const int DarkRebellionXyzDragon = 16195942;
public const int EvilswarmExcitonKnight = 46772449; public const int EvilswarmExcitonKnight = 46772449;
} }
public TimeThiefExecutor(GameAI ai, Duel duel) public TimeThiefExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
// executors // executors
//Spell activate //Spell activate
AddExecutor(ExecutorType.Activate, Spells.Raigeki, DefaultDarkHole); AddExecutor(ExecutorType.Activate, Spells.Raigeki, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, Spells.FoolishBurial, FoolishBurialTarget); AddExecutor(ExecutorType.Activate, Spells.FoolishBurial, FoolishBurialTarget);
AddExecutor(ExecutorType.Activate, Spells.TimeThiefStartup, TimeThiefStartupEffect); AddExecutor(ExecutorType.Activate, Spells.TimeThiefStartup, TimeThiefStartupEffect);
AddExecutor(ExecutorType.Activate, Spells.TimeThiefHack); AddExecutor(ExecutorType.Activate, Spells.TimeThiefHack);
AddExecutor(ExecutorType.Activate, Spells.PotofExtravagance, PotofExtravaganceActivate); AddExecutor(ExecutorType.Activate, Spells.PotofExtravagance, PotofExtravaganceActivate);
AddExecutor(ExecutorType.Activate, Spells.HarpieFeatherDuster, DefaultHarpiesFeatherDusterFirst); AddExecutor(ExecutorType.Activate, Spells.HarpieFeatherDuster, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, Spells.PotOfDesires, PotOfDesireseff); AddExecutor(ExecutorType.Activate, Spells.PotOfDesires, PotOfDesireseff);
// trap executors set // trap executors set
AddExecutor(ExecutorType.SpellSet, Traps.PhantomKnightsShade); AddExecutor(ExecutorType.SpellSet, Traps.PhantomKnightsShade);
AddExecutor(ExecutorType.SpellSet, Traps.TimeThiefRetrograte); AddExecutor(ExecutorType.SpellSet, Traps.TimeThiefRetrograte);
AddExecutor(ExecutorType.SpellSet, Traps.TimeThiefFlyBack); AddExecutor(ExecutorType.SpellSet, Traps.TimeThiefFlyBack);
AddExecutor(ExecutorType.SpellSet, Traps.SolemnWarning); AddExecutor(ExecutorType.SpellSet, Traps.SolemnWarning);
AddExecutor(ExecutorType.SpellSet, Traps.SolemStrike); AddExecutor(ExecutorType.SpellSet, Traps.SolemStrike);
AddExecutor(ExecutorType.SpellSet, Traps.SolemnJudgment); AddExecutor(ExecutorType.SpellSet, Traps.SolemnJudgment);
AddExecutor(ExecutorType.SpellSet, Traps.Crackdown); AddExecutor(ExecutorType.SpellSet, Traps.Crackdown);
//normal summons //normal summons
AddExecutor(ExecutorType.Summon, Monsters.TimeThiefRegulator); AddExecutor(ExecutorType.Summon, Monsters.TimeThiefRegulator);
AddExecutor(ExecutorType.SpSummon, Monsters.PhotonTrasher, SummonToDef); AddExecutor(ExecutorType.SpSummon, Monsters.PhotonTrasher, SummonToDef);
AddExecutor(ExecutorType.Summon, Monsters.TimeThiefWinder); AddExecutor(ExecutorType.Summon, Monsters.TimeThiefWinder);
AddExecutor(ExecutorType.Summon, Monsters.TimeThiefBezelShip); AddExecutor(ExecutorType.Summon, Monsters.TimeThiefBezelShip);
AddExecutor(ExecutorType.Summon, Monsters.PerformTrickClown); AddExecutor(ExecutorType.Summon, Monsters.PerformTrickClown);
AddExecutor(ExecutorType.Summon, Monsters.TimeThiefCronocorder); AddExecutor(ExecutorType.Summon, Monsters.TimeThiefCronocorder);
AddExecutor(ExecutorType.Summon, Monsters.ThunderKingRaiOh, ThunderKingRaiOhsummon); AddExecutor(ExecutorType.Summon, Monsters.ThunderKingRaiOh, ThunderKingRaiOhsummon);
//xyz summons //xyz summons
AddExecutor(ExecutorType.SpSummon, XYZs.TimeThiefRedoer); AddExecutor(ExecutorType.SpSummon, XYZs.TimeThiefRedoer);
AddExecutor(ExecutorType.SpSummon, XYZs.TimeThiefPerpetua); AddExecutor(ExecutorType.SpSummon, XYZs.TimeThiefPerpetua);
AddExecutor(ExecutorType.SpSummon, XYZs.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightSummon); AddExecutor(ExecutorType.SpSummon, XYZs.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightSummon);
AddExecutor(ExecutorType.SpSummon, XYZs.GagagaCowboy, GagagaCowboySummon); AddExecutor(ExecutorType.SpSummon, XYZs.GagagaCowboy, GagagaCowboySummon);
AddExecutor(ExecutorType.SpSummon, XYZs.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon); AddExecutor(ExecutorType.SpSummon, XYZs.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon);
AddExecutor(ExecutorType.SpSummon, XYZs.NumberS39UtopiaOne); AddExecutor(ExecutorType.SpSummon, XYZs.NumberS39UtopiaOne);
AddExecutor(ExecutorType.SpSummon, XYZs.NumberS39UtopiatheLightning); AddExecutor(ExecutorType.SpSummon, XYZs.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.SpSummon, XYZs.DarkRebellionXyzDragon, DarkRebellionXyzDragonSummon); AddExecutor(ExecutorType.SpSummon, XYZs.DarkRebellionXyzDragon, DarkRebellionXyzDragonSummon);
//activate trap //activate trap
AddExecutor(ExecutorType.Activate, Traps.PhantomKnightsShade); AddExecutor(ExecutorType.Activate, Traps.PhantomKnightsShade);
AddExecutor(ExecutorType.Activate, Traps.TimeThiefRetrograte, RetrograteEffect); AddExecutor(ExecutorType.Activate, Traps.TimeThiefRetrograte, RetrograteEffect);
AddExecutor(ExecutorType.Activate, Traps.TimeThiefFlyBack); AddExecutor(ExecutorType.Activate, Traps.TimeThiefFlyBack);
AddExecutor(ExecutorType.Activate, Traps.SolemnWarning, DefaultSolemnWarning); AddExecutor(ExecutorType.Activate, Traps.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, Traps.SolemStrike, DefaultSolemnStrike); AddExecutor(ExecutorType.Activate, Traps.SolemStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, Traps.SolemnJudgment, DefaultSolemnJudgment); AddExecutor(ExecutorType.Activate, Traps.SolemnJudgment, DefaultSolemnJudgment);
AddExecutor(ExecutorType.Activate, Traps.Crackdown, Crackdowneff); AddExecutor(ExecutorType.Activate, Traps.Crackdown, Crackdowneff);
//xyz effects //xyz effects
AddExecutor(ExecutorType.Activate, XYZs.TimeThiefRedoer, RedoerEffect); AddExecutor(ExecutorType.Activate, XYZs.TimeThiefRedoer, RedoerEffect);
AddExecutor(ExecutorType.Activate, XYZs.TimeThiefPerpetua, PerpertuaEffect); AddExecutor(ExecutorType.Activate, XYZs.TimeThiefPerpetua, PerpertuaEffect);
AddExecutor(ExecutorType.Activate, XYZs.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightEffect); AddExecutor(ExecutorType.Activate, XYZs.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightEffect);
AddExecutor(ExecutorType.Activate, XYZs.GagagaCowboy); AddExecutor(ExecutorType.Activate, XYZs.GagagaCowboy);
AddExecutor(ExecutorType.Activate, XYZs.NumberS39UtopiatheLightning, DefaultNumberS39UtopiaTheLightningEffect); AddExecutor(ExecutorType.Activate, XYZs.NumberS39UtopiatheLightning, DefaultNumberS39UtopiaTheLightningEffect);
AddExecutor(ExecutorType.Activate, XYZs.DarkRebellionXyzDragon, DarkRebellionXyzDragonEffect); AddExecutor(ExecutorType.Activate, XYZs.DarkRebellionXyzDragon, DarkRebellionXyzDragonEffect);
//monster effects //monster effects
AddExecutor(ExecutorType.Activate, Monsters.TimeThiefRegulator, RegulatorEffect); AddExecutor(ExecutorType.Activate, Monsters.TimeThiefRegulator, RegulatorEffect);
AddExecutor(ExecutorType.Activate, Monsters.TimeThiefWinder); AddExecutor(ExecutorType.Activate, Monsters.TimeThiefWinder);
AddExecutor(ExecutorType.Activate, Monsters.TimeThiefCronocorder); AddExecutor(ExecutorType.Activate, Monsters.TimeThiefCronocorder);
AddExecutor(ExecutorType.Activate, Monsters.PerformTrickClown, TrickClownEffect); AddExecutor(ExecutorType.Activate, Monsters.PerformTrickClown, TrickClownEffect);
AddExecutor(ExecutorType.Activate, Monsters.TimeThiefBezelShip); AddExecutor(ExecutorType.Activate, Monsters.TimeThiefBezelShip);
AddExecutor(ExecutorType.Activate, Monsters.ThunderKingRaiOh, ThunderKingRaiOheff); AddExecutor(ExecutorType.Activate, Monsters.ThunderKingRaiOh, ThunderKingRaiOheff);
AddExecutor(ExecutorType.Activate, Monsters.AshBlossomAndJoyousSpring, DefaultAshBlossomAndJoyousSpring); AddExecutor(ExecutorType.Activate, Monsters.AshBlossomAndJoyousSpring, DefaultAshBlossomAndJoyousSpring);
AddExecutor(ExecutorType.Activate, Monsters.MaxxC, DefaultMaxxC); AddExecutor(ExecutorType.Activate, Monsters.MaxxC, DefaultMaxxC);
}
public void SelectSTPlace(ClientCard card = null, bool avoid_Impermanence = false, List<int> avoid_list = null)
{
List<int> list = new List<int> { 0, 1, 2, 3, 4 };
int n = list.Count;
while (n-- > 1)
{
int index = Program.Rand.Next(n + 1);
int temp = list[index];
list[index] = list[n];
list[n] = temp;
}
foreach (int seq in list)
{
int zone = (int)System.Math.Pow(2, seq);
if (Bot.SpellZone[seq] == null)
{
if (card != null && card.Location == CardLocation.Hand && avoid_Impermanence) continue;
if (avoid_list != null && avoid_list.Contains(seq)) continue;
AI.SelectPlace(zone);
return;
};
}
AI.SelectPlace(0);
}
public bool SpellNegatable(bool isCounter = false, ClientCard target = null)
{
// target default set
if (target == null) target = Card;
// won't negate if not on field
if (target.Location != CardLocation.SpellZone && target.Location != CardLocation.Hand) return false;
// negate judge
if (Enemy.HasInMonstersZone(CardId.NaturalExterio, true) && !isCounter) return true;
if (target.IsSpell())
{
if (Enemy.HasInMonstersZone(CardId.NaturalBeast, true)) return true;
if (Enemy.HasInSpellZone(CardId.ImperialOrder, true) || Bot.HasInSpellZone(CardId.ImperialOrder, true)) return true;
if (Enemy.HasInMonstersZone(CardId.SwordsmanLV7, true) || Bot.HasInMonstersZone(CardId.SwordsmanLV7, true)) return true;
}
if (target.IsTrap())
{
if (Enemy.HasInSpellZone(CardId.RoyalDecreel, true) || Bot.HasInSpellZone(CardId.RoyalDecreel, true)) return true;
}
// how to get here?
return false;
}
private bool SummonToDef()
{
AI.SelectPosition(CardPosition.Defence);
return true;
}
private bool RegulatorEffect()
{
if (Card.Location == CardLocation.MonsterZone)
{
AI.SelectCard(Monsters.TimeThiefCronocorder);
AI.SelectCard(Monsters.TimeThiefWinder);
return true;
}
if (Card.Location == CardLocation.Grave)
{
return true;
}
return false;
} }
public void SelectSTPlace(ClientCard card = null, bool avoid_Impermanence = false, List<int> avoid_list = null) private bool PerpertuaEffect()
{ {
List<int> list = new List<int> { 0, 1, 2, 3, 4 }; if (Bot.HasInGraveyard(XYZs.TimeThiefRedoer))
int n = list.Count; {
while (n-- > 1) AI.SelectCard(XYZs.TimeThiefRedoer);
{ return true;
int index = Program.Rand.Next(n + 1); }
int temp = list[index];
list[index] = list[n]; if (Bot.HasInMonstersZone(XYZs.TimeThiefRedoer))
list[n] = temp; {
} AI.SelectCard(Monsters.TimeThiefBezelShip);
foreach (int seq in list) AI.SelectNextCard(XYZs.TimeThiefRedoer);
{ return true;
int zone = (int)System.Math.Pow(2, seq); }
if (Bot.SpellZone[seq] == null)
{ return false;
if (card != null && card.Location == CardLocation.Hand && avoid_Impermanence) continue;
if (avoid_list != null && avoid_list.Contains(seq)) continue;
AI.SelectPlace(zone);
return;
};
}
AI.SelectPlace(0);
} }
public bool SpellNegatable(bool isCounter = false, ClientCard target = null) private int _totalAttack;
{ private int _totalBotAttack;
// target default set private bool RedoerEffect()
if (target == null) target = Card; {
// won't negate if not on field
if (target.Location != CardLocation.SpellZone && target.Location != CardLocation.Hand) return false; List<ClientCard> enemy = Enemy.GetMonstersInMainZone();
List<int> units = Card.Overlays;
// negate judge if (Duel.Phase == DuelPhase.Standby && (AI.Executor.Util.GetStringId(XYZs.TimeThiefRedoer, 0) ==
if (Enemy.HasInMonstersZone(CardId.NaturalExterio, true) && !isCounter) return true; ActivateDescription))
if (target.IsSpell())
{
if (Enemy.HasInMonstersZone(CardId.NaturalBeast, true)) return true;
if (Enemy.HasInSpellZone(CardId.ImperialOrder, true) || Bot.HasInSpellZone(CardId.ImperialOrder, true)) return true;
if (Enemy.HasInMonstersZone(CardId.SwordsmanLV7, true) || Bot.HasInMonstersZone(CardId.SwordsmanLV7, true)) return true;
}
if (target.IsTrap())
{
if (Enemy.HasInSpellZone(CardId.RoyalDecreel, true) || Bot.HasInSpellZone(CardId.RoyalDecreel, true)) return true;
}
// how to get here?
return false;
}
private bool SummonToDef()
{
AI.SelectPosition(CardPosition.Defence);
return true;
}
private bool RegulatorEffect()
{
if (Card.Location == CardLocation.MonsterZone)
{
AI.SelectCard(Monsters.TimeThiefCronocorder);
AI.SelectCard(Monsters.TimeThiefWinder);
return true;
}
if (Card.Location == CardLocation.Grave)
{
return true;
}
return false;
}
private bool PerpertuaEffect()
{
if (Bot.HasInGraveyard(XYZs.TimeThiefRedoer))
{
AI.SelectCard(XYZs.TimeThiefRedoer);
return true;
}
if (Bot.HasInMonstersZone(XYZs.TimeThiefRedoer))
{
AI.SelectCard(Monsters.TimeThiefBezelShip);
AI.SelectNextCard(XYZs.TimeThiefRedoer);
return true;
}
return false;
}
private int _totalAttack;
private int _totalBotAttack;
private bool RedoerEffect()
{
List<ClientCard> enemy = Enemy.GetMonstersInMainZone();
List<int> units = Card.Overlays;
if (Duel.Phase == DuelPhase.Standby && (AI.Executor.Util.GetStringId(XYZs.TimeThiefRedoer, 0) ==
ActivateDescription))
{ {
return true; return true;
} }
try try
{ {
for (int i = 0; i < enemy.Count; i++) for (int i = 0; i < enemy.Count; i++)
{ {
_totalAttack += enemy[i].Attack; _totalAttack += enemy[i].Attack;
} }
foreach (var t in Bot.GetMonsters()) foreach (var t in Bot.GetMonsters())
{ {
_totalBotAttack += t.Attack; _totalBotAttack += t.Attack;
} }
if (_totalAttack > Bot.LifePoints + _totalBotAttack) if (_totalAttack > Bot.LifePoints + _totalBotAttack)
{ {
return false; return false;
} }
foreach (var t in enemy) foreach (var t in enemy)
{ {
if (t.Attack < 2400 || !t.IsAttack()) continue; if (t.Attack < 2400 || !t.IsAttack()) continue;
try try
{ {
AI.SelectCard(t.Id); AI.SelectCard(t.Id);
AI.SelectCard(t.Id); AI.SelectCard(t.Id);
} }
catch { } catch { }
return true; return true;
} }
} }
catch { } catch { }
if (Bot.UnderAttack) if (Bot.UnderAttack)
{ {
//AI.SelectCard(Util.GetBestEnemyMonster()); //AI.SelectCard(Util.GetBestEnemyMonster());
return true; return true;
} }
return false; return false;
} }
private bool RetrograteEffect() private bool RetrograteEffect()
{ {
if (Card.Owner == 1) if (Card.Owner == 1)
{ {
return true; return true;
} }
return false; return false;
} }
private bool TimeThiefStartupEffect() private bool TimeThiefStartupEffect()
{ {
if (Card.Location == CardLocation.Hand) if (Card.Location == CardLocation.Hand)
{ {
if (Bot.HasInHand(Monsters.TimeThiefRegulator) && !(Bot.GetMonsterCount() > 0)) if (Bot.HasInHand(Monsters.TimeThiefRegulator) && !(Bot.GetMonsterCount() > 0))
{ {
AI.SelectCard(Monsters.TimeThiefRegulator); AI.SelectCard(Monsters.TimeThiefRegulator);
return true; return true;
} }
if (Bot.HasInHand(Monsters.TimeThiefWinder) && Bot.GetMonsterCount() > 1) if (Bot.HasInHand(Monsters.TimeThiefWinder) && Bot.GetMonsterCount() > 1)
{ {
AI.SelectCard(Monsters.TimeThiefWinder); AI.SelectCard(Monsters.TimeThiefWinder);
return true; return true;
} }
return true; return true;
} }
if (Card.Location == CardLocation.Grave) if (Card.Location == CardLocation.Grave)
{ {
AI.SelectCard(Monsters.TimeThiefCronocorder); AI.SelectCard(Monsters.TimeThiefCronocorder);
AI.SelectCard(Spells.TimeThiefHack); AI.SelectCard(Spells.TimeThiefHack);
AI.SelectCard(Traps.TimeThiefFlyBack); AI.SelectCard(Traps.TimeThiefFlyBack);
return true; return true;
} }
return false; return false;
} }
private bool FoolishBurialTarget() private bool FoolishBurialTarget()
{ {
AI.SelectCard(Monsters.PerformTrickClown); AI.SelectCard(Monsters.PerformTrickClown);
return true; return true;
}
private bool TrickClownEffect()
{
if (Bot.LifePoints <= 1000)
{
return false;
}
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool GagagaCowboySummon()
{
if (Enemy.LifePoints <= 800 || (Bot.GetMonsterCount() >= 4 && Enemy.LifePoints <= 1600))
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
return false;
} }
private bool TrickClownEffect() private bool DarkRebellionXyzDragonSummon()
{ {
if (Bot.LifePoints <= 1000) int selfBestAttack = Util.GetBestAttack(Bot);
{ int oppoBestAttack = Util.GetBestAttack(Enemy);
return false; return selfBestAttack <= oppoBestAttack;
}
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
} }
private bool GagagaCowboySummon()
{ private bool DarkRebellionXyzDragonEffect()
if (Enemy.LifePoints <= 800 || (Bot.GetMonsterCount() >= 4 && Enemy.LifePoints <= 1600)) {
{ int oppoBestAttack = Util.GetBestAttack(Enemy);
AI.SelectPosition(CardPosition.FaceUpDefence); ClientCard target = Util.GetOneEnemyBetterThanValue(oppoBestAttack, true);
return true; if (target != null)
} {
return false; AI.SelectCard(0);
} AI.SelectNextCard(target);
}
private bool DarkRebellionXyzDragonSummon()
{
int selfBestAttack = Util.GetBestAttack(Bot);
int oppoBestAttack = Util.GetBestAttack(Enemy);
return selfBestAttack <= oppoBestAttack;
}
private bool DarkRebellionXyzDragonEffect()
{
int oppoBestAttack = Util.GetBestAttack(Enemy);
ClientCard target = Util.GetOneEnemyBetterThanValue(oppoBestAttack, true);
if (target != null)
{
AI.SelectCard(0);
AI.SelectNextCard(target);
}
return true; return true;
} }
private bool ThunderKingRaiOhsummon() private bool ThunderKingRaiOhsummon()
{ {
if (Bot.MonsterZone[0] == null) if (Bot.MonsterZone[0] == null)
AI.SelectPlace(Zones.z0); AI.SelectPlace(Zones.z0);
else else
AI.SelectPlace(Zones.z4); AI.SelectPlace(Zones.z4);
return true; return true;
} }
private bool ThunderKingRaiOheff() private bool ThunderKingRaiOheff()
{ {
if (Duel.SummoningCards.Count > 0) if (Duel.SummoningCards.Count > 0)
{ {
foreach (ClientCard m in Duel.SummoningCards) foreach (ClientCard m in Duel.SummoningCards)
{ {
if (m.Attack >= 1900) if (m.Attack >= 1900)
return true; return true;
} }
} }
return false; return false;
}
private bool Crackdowneff()
{
if (Util.GetOneEnemyBetterThanMyBest(true, true) != null && Bot.UnderAttack)
AI.SelectCard(Util.GetOneEnemyBetterThanMyBest(true, true));
return Util.GetOneEnemyBetterThanMyBest(true, true) != null && Bot.UnderAttack;
} }
private bool Crackdowneff() private bool PotOfDesireseff()
{ {
if (Util.GetOneEnemyBetterThanMyBest(true, true) != null && Bot.UnderAttack) return Bot.Deck.Count > 14 && !DefaultSpellWillBeNegated();
AI.SelectCard(Util.GetOneEnemyBetterThanMyBest(true, true));
return Util.GetOneEnemyBetterThanMyBest(true, true) != null && Bot.UnderAttack;
} }
private bool PotOfDesireseff()
// activate of PotofExtravagance
public bool PotofExtravaganceActivate()
{ {
return Bot.Deck.Count > 14 && !DefaultSpellWillBeNegated(); // won't activate if it'll be negate
} if (SpellNegatable()) return false;
SelectSTPlace(Card, true);
// activate of PotofExtravagance AI.SelectOption(1);
public bool PotofExtravaganceActivate() return true;
{ }
// won't activate if it'll be negate
if (SpellNegatable()) return false;
SelectSTPlace(Card, true); }
AI.SelectOption(1);
return true; }
}
}
}
...@@ -59,7 +59,7 @@ namespace WindBot.Game.AI ...@@ -59,7 +59,7 @@ namespace WindBot.Game.AI
_game = game; _game = game;
DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(DialogsData)); DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(DialogsData));
string dialogfilename = game.Dialog; string dialogfilename = game.Dialog;
using (FileStream fs = File.OpenRead("Dialogs/" + dialogfilename + ".json")) using (FileStream fs = Program.ReadFile("Dialogs", dialogfilename, "json"))
{ {
DialogsData data = (DialogsData)serializer.ReadObject(fs); DialogsData data = (DialogsData)serializer.ReadObject(fs);
_welcome = data.welcome; _welcome = data.welcome;
......
...@@ -43,7 +43,7 @@ namespace WindBot.Game ...@@ -43,7 +43,7 @@ namespace WindBot.Game
StreamReader reader = null; StreamReader reader = null;
try try
{ {
reader = new StreamReader(new FileStream("Decks/" + name + ".ydk", FileMode.Open, FileAccess.Read)); reader = new StreamReader(Program.ReadFile("Decks", name, "ydk"));
Deck deck = new Deck(); Deck deck = new Deck();
bool side = false; bool side = false;
......
...@@ -201,5 +201,22 @@ namespace WindBot ...@@ -201,5 +201,22 @@ namespace WindBot
} }
#endif #endif
} }
public static FileStream ReadFile(string directory, string filename, string extension)
{
string tryfilename = filename + "." + extension;
string fullpath = Path.Combine(directory, tryfilename);
if (!File.Exists(fullpath))
fullpath = filename;
if (!File.Exists(fullpath))
fullpath = Path.Combine("../", filename);
if (!File.Exists(fullpath))
fullpath = Path.Combine("../deck/", filename);
if (!File.Exists(fullpath))
fullpath = Path.Combine("../", tryfilename);
if (!File.Exists(fullpath))
fullpath = Path.Combine("../deck/", tryfilename);
return new FileStream(fullpath, FileMode.Open, FileAccess.Read);
}
} }
} }
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