Commit b115f4a5 authored by Sun's avatar Sun Committed by mercury233

Added time thief and Mathmech deck (#122)

Co-authored-by: mercury233's avatarmercury233 <me@mercury233.me>
parent 2468bed3
#created by ...
#main
8567955
8567955
8567955
89743495
89743495
27182739
27182739
27182739
53577438
53577438
53577438
16360142
16360142
16360142
80965043
80965043
80965043
52354896
52354896
12580477
14025912
14532163
14532163
35261759
35261759
35261759
57160136
57160136
57160136
70368879
70368879
70368879
81439173
93104632
93104632
8267140
41410651
36361633
36361633
36361633
#extra
42632209
42632209
42632209
15248594
15248594
15248594
61399402
61399402
61399402
85692042
85692042
85692042
88021907
88021907
88021907
!side
#created by ...
#main
65367484
65367484
65367484
56308388
56308388
56308388
67696066
82496097
82496097
82496097
74578720
74578720
74578720
19891131
19891131
19891131
70368879
70368879
70368879
81439173
10877309
10877309
10877309
81670445
81670445
81670445
18678554
18678554
18678554
26708437
26708437
26708437
57319935
57319935
98827725
98827725
98827725
76587747
76587747
76587747
#extra
56832966
56832966
56832966
86532744
86532744
86532744
84013237
84013237
84013237
55285840
55285840
55285840
59208943
59208943
59208943
!side
using System;
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using System.Diagnostics;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
using System.Linq;
namespace WindBot.Game.AI.Decks
{
[Deck("MathMech", "AI_Mathmech")]
public class MathmechExecutor : DefaultExecutor
{
public class CardID
{
public const int MathmechNebla = 53577438;
public const int MathmechSigma = 27182739;
public const int MathmechDivision = 89743495;
public const int MathmechAddition = 80965043;
public const int MathmechSubtra = 16360142;
public const int Mathmechdouble = 52354896;
public const int MathmechFinalSigma = 42632209;
public const int Mathmechalem = 85692042;
public const int MathmechMagma = 15248594;
public const int BalancerLord = 08567955;
public const int LightDragon = 61399402;
// spells
public const int upstartGoblin = 70368879;
public const int raigeki = 12580477;
public const int cynetmining = 57160136;
public const int PotOfDesires= 35261759;
public const int lightningStorm = 14532163;
public const int cosmicCyclone = 08267140;
public const int foolishBurial = 81439173;
public const int OneTimePasscode = 93104632;
public const int mathmechEquation = 14025912;
//traps
public const int threanteningRoar = 36361633;
//tokens
public const int securitytoken = 93104633;
}
public MathmechExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, CardID.raigeki ,when_raigeki);
AddExecutor(ExecutorType.Activate, CardID.upstartGoblin);
AddExecutor(ExecutorType.Activate, CardID.OneTimePasscode);
AddExecutor(ExecutorType.SpellSet, CardID.threanteningRoar);
AddExecutor(ExecutorType.Activate,CardID.cosmicCyclone , when_cosmic);
AddExecutor(ExecutorType.Activate,CardID.lightningStorm ,lightstorm_target);
AddExecutor(ExecutorType.Activate,CardID.foolishBurial,foolish_burial_target);
AddExecutor(ExecutorType.Activate,CardID.mathmechEquation,mathmech_equation_target);
AddExecutor(ExecutorType.Activate,CardID.PotOfDesires);
AddExecutor(ExecutorType.Summon, CardID.MathmechNebla);
AddExecutor(ExecutorType.Summon,CardID.BalancerLord );
AddExecutor(ExecutorType.Summon, CardID.Mathmechdouble);
AddExecutor(ExecutorType.Summon, CardID.MathmechSubtra);
AddExecutor(ExecutorType.Summon, CardID.MathmechAddition);
AddExecutor(ExecutorType.Summon, CardID.MathmechDivision);
AddExecutor(ExecutorType.Summon, CardID.MathmechDivision);
AddExecutor(ExecutorType.Activate, CardID.MathmechSigma);
AddExecutor(ExecutorType.Activate,CardID.threanteningRoar);
//xyz summons
AddExecutor(ExecutorType.SpSummon, CardID.Mathmechalem, when_Mathmechalem);
//xyz effects
AddExecutor(ExecutorType.Activate, CardID.Mathmechalem, mathchalenEffect);
//Synchro
AddExecutor(ExecutorType.SpSummon, CardID.MathmechFinalSigma , FinalSigmaSummon);
AddExecutor(ExecutorType.Activate, CardID.Mathmechdouble, doubleEffect);
//normal effects
AddExecutor(ExecutorType.Activate, CardID.MathmechNebla, NeblaEffect);
AddExecutor(ExecutorType.Activate,CardID.MathmechDivision , divisionEffect);
AddExecutor(ExecutorType.Activate,CardID.BalancerLord , active_balancer);
AddExecutor(ExecutorType.Activate, CardID.MathmechSubtra , whom_subtra);
AddExecutor(ExecutorType.Activate, CardID.MathmechAddition , whom_addition);
//spell effects
AddExecutor(ExecutorType.Activate, CardID.cynetmining , how_to_cynet_mine);
AddExecutor(ExecutorType.SpSummon, CardID.MathmechMagma, MagmaSummon);
AddExecutor(ExecutorType.Activate,CardID.MathmechFinalSigma);
AddExecutor(ExecutorType.Activate,CardID.MathmechMagma);
//function
}
public override bool OnSelectHand()
{
return false;
}
private bool when_cosmic()
{
if (Enemy.GetSpellCount() > 1)
{
AI.SelectCard(Util.GetBestEnemySpell());
return true;
}
else
{
return false;
}
}
private bool divisionEffect()
{
if (Enemy.GetMonsterCount() > 0)
{
AI.SelectCard(Util.GetBestEnemyMonster(canBeTarget:true,onlyFaceup:true));
return true;
}
else
{
return false;
}
}
private bool when_raigeki()
{
if (Enemy.GetMonsterCount() > 3)
{
return true;
}
else
{
return false;
}
}
private bool whom_addition()
{
AI.SelectCard(Util.GetBestBotMonster(onlyATK:true));
return true;
}
private bool whom_subtra()
{
try
{
AI.SelectCard(Util.GetBestEnemyMonster(onlyFaceup: true, canBeTarget: true));
return true;
}
catch (Exception e)
{
return true;
}
}
private bool active_balancer()
{
if (Bot.HasInHand(CardID.MathmechNebla))
{
AI.SelectCard(CardID.MathmechNebla);
return true;
}
else
{
return true;
}
}
private bool lightstorm_target()
{
if ((Enemy.MonsterZone.ToList().Count > Enemy.SpellZone.ToList().Count ) && Enemy.MonsterZone.ToList().Count>3)
{
AI.SelectPlace(Zones.MonsterZones);
return true;
}
else
{
AI.SelectPlace(Zones.SpellZones);
return true;
}
}
private bool mathmech_equation_target()
{
if (Bot.HasInGraveyard(CardID.MathmechNebla))
{
AI.SelectCard(CardID.MathmechNebla);
return true;
}
else
{
AI.SelectCard((Util.GetBestBotMonster(onlyATK: true)));
return true;
}
}
private bool foolish_burial_target()
{
AI.SelectCard(CardID.MathmechNebla);
return true;
}
private bool how_to_cynet_mine()
{
AI.SelectCard(Util.GetWorstBotMonster());
if (!Bot.HasInHandOrInMonstersZoneOrInGraveyard(CardID.MathmechSigma))
{
AI.SelectNextCard(CardID.MathmechSigma);
return true;
}
return true;
}
private bool when_Mathmechalem()
{
if (Bot.HasInMonstersZone(CardID.MathmechNebla)){
return false;
}
else if(Bot.HasInMonstersZone(CardID.MathmechSigma) && Bot.HasInMonstersZone(CardID.Mathmechdouble))
{
return false;
}
else if (Bot.HasInMonstersZone(CardID.Mathmechalem))
{
return false;
}
else
{
return true;
}
}
private bool FinalSigmaSummon()
{
if (Duel.Turn < 1)
{
return false;
}
if ((Bot.HasInMonstersZone(CardID.Mathmechdouble) && (( Bot.HasInMonstersZone(CardID.MathmechSigma)) || Bot.HasInMonstersZone(CardID.MathmechNebla))))
{
AI.SelectPosition(CardPosition.Attack);
try { AI.SelectPlace(Zones.ExtraMonsterZones); }
catch { }
return true;
}
else
{
return true;
}
}
private bool NeblaEffect()
{
bool a = Bot.HasInMonstersZone(CardID.MathmechSubtra) || Bot.HasInMonstersZone(CardID.securitytoken) || Bot.HasInMonstersZone(CardID.MathmechSigma) || Bot.HasInMonstersZone(CardID.MathmechAddition) || Bot.HasInMonstersZone(CardID.Mathmechalem) || Bot.HasInMonstersZone(CardID.MathmechDivision);
if (a)
{
List<int> cards = new List<int>();
cards.Add(CardID.MathmechSigma);
cards.Add(CardID.MathmechSubtra);
cards.Add(CardID.MathmechAddition);
cards.Add(item:CardID.MathmechDivision);
cards.Add(item:CardID.Mathmechalem);
cards.Add(CardID.securitytoken);
int u = 0;
List<ClientCard> monsters = Bot.GetMonstersInMainZone();
for (int i = 0; i < monsters.Count; i++)
{
if (cards.Contains(monsters[i].Id))
{
u = monsters[i].Id;
break;
}
else
{
u = CardID.securitytoken;
}
}
AI.SelectCard(CardID.securitytoken);
AI.SelectNextCard(CardID.Mathmechdouble);
return true;
}
if (Card.Location == CardLocation.Grave)
{
return true;
}
else
{
return false;
}
}
private bool doubleEffect()
{
if (Bot.HasInMonstersZone(CardID.MathmechNebla) || Bot.HasInMonstersZone(CardID.MathmechSigma))
{
return true;
};
if (Card.Location == CardLocation.Grave )
{
return true;
}
else
{
return false;
}
}
private bool mathchalenEffect()
{
if (Duel.Turn < 1)
{
return false;
}
if ( (Bot.HasInHandOrInGraveyard(CardID.MathmechNebla) && !Bot.HasInMonstersZone(CardID.MathmechNebla)) && (Card.Location == CardLocation.FieldZone && Card.HasXyzMaterial(0)) )
{
AI.SelectCard(CardID.Mathmechalem);
AI.SelectNextCard(CardID.MathmechNebla);
return true;
}
if (Bot.HasInHandOrInGraveyard(CardID.Mathmechdouble) &&
(Bot.HasInMonstersZone(CardID.MathmechNebla) || Bot.HasInMonstersZone(CardID.MathmechSigma)) &&
Card.Location == CardLocation.FieldZone && Card.HasXyzMaterial(0))
{
AI.SelectCard(CardID.Mathmechalem);
AI.SelectNextCard(CardID.Mathmechdouble);
return true;
}
if (!Bot.HasInHandOrInGraveyard(CardID.MathmechNebla) && Card.HasXyzMaterial(2))
{
AI.SelectCard(CardID.MathmechNebla);
AI.SelectThirdCard(CardID.MathmechNebla);
return true;
}
if (!Bot.HasInHandOrInGraveyard(CardID.MathmechSigma) && Card.HasXyzMaterial(2))
{
AI.SelectCard(CardID.MathmechSigma);
AI.SelectThirdCard(CardID.MathmechSigma);
return true;
}
else
{
return false;
};
}
private bool MagmaSummon()
{
if (Bot.HasInMonstersZone(CardID.MathmechNebla))
{
return false;
}
if (Bot.HasInMonstersZone(CardID.MathmechSigma) && Bot.HasInMonstersZone(CardID.Mathmechdouble))
{
return false;
}
else
{
return true;
}
}
}
}
\ No newline at end of file
using System;
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using System.Diagnostics;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
using System.Linq;
using System.Reflection;
namespace WindBot.Game.AI.Decks
{
[Deck("TimeThief", "AI_Timethief")]
public class TimeThiefExecutor : DefaultExecutor
{
public class Monsters
{
//monsters
public const int TimeThiefWinder = 56308388;
public const int TimeThiefBezelShip = 82496079;
public const int TimeThiefCronocorder = 74578720;
public const int TimeThiefRegulator = 19891131;
public const int PhotonTrasher = 65367484;
public const int PerformTrickClown = 67696066;
}
public class Spells
{
// spells
public const int UpstartGoblin = 70368879;
public const int Raigeki = 12580477;
public const int FoolishBurial = 81439173;
public const int TimeThiefStartup = 10877309;
public const int TimeThiefHack = 81670445;
}
public class Traps
{
//traps
public const int XyzReborn = 26708437;
public const int XyzExtreme = 57319935;
public const int TimeThiefRetrograte = 76587747;
public const int PhantomKnightsShade = 98827725;
public const int TimeThiefFlyBack = 18678554;
}
public class XYZs
{
//xyz
public const int TimeThiefRedoer = 55285840;
public const int TimeThiefPerpetua = 59208943;
public const int CrazyBox = 42421606;
}
public TimeThiefExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
// executors
//Spell activate
AddExecutor(ExecutorType.Activate,Spells.UpstartGoblin);
AddExecutor(ExecutorType.Activate,Spells.FoolishBurial,FoolishBurialTarget);
AddExecutor(ExecutorType.Activate,Spells.TimeThiefStartup,TimeThiefStartupEffect);
AddExecutor(ExecutorType.Activate,Spells.TimeThiefHack);
// trap executors set
AddExecutor(ExecutorType.SpellSet,Traps.XyzExtreme);
AddExecutor(ExecutorType.SpellSet,Traps.XyzReborn);
AddExecutor(ExecutorType.SpellSet,Traps.PhantomKnightsShade);
AddExecutor(ExecutorType.SpellSet,Traps.TimeThiefRetrograte);
AddExecutor(ExecutorType.SpellSet,Traps.TimeThiefFlyBack);
//special summons
AddExecutor(ExecutorType.SpSummon,Monsters.PhotonTrasher ,SummonToDef);
AddExecutor(ExecutorType.SpSummon,Monsters.TimeThiefRegulator, SummonToDef);
AddExecutor(ExecutorType.SpSummon,Monsters.TimeThiefWinder, SummonToDef);
AddExecutor(ExecutorType.SpSummon,Monsters.PerformTrickClown, SummonToDef);
AddExecutor(ExecutorType.SpSummon,Monsters.TimeThiefCronocorder, SummonToDef);
AddExecutor(ExecutorType.SpSummon,Monsters.TimeThiefBezelShip, SummonToDef);
//normal summons
AddExecutor(ExecutorType.Summon,Monsters.TimeThiefRegulator );
AddExecutor(ExecutorType.Summon,Monsters.TimeThiefWinder );
AddExecutor(ExecutorType.Summon,Monsters.TimeThiefBezelShip );
AddExecutor(ExecutorType.Summon,Monsters.PerformTrickClown );
AddExecutor(ExecutorType.Summon,Monsters.TimeThiefCronocorder );
//xyz summons
AddExecutor(ExecutorType.SpSummon,XYZs.TimeThiefRedoer);
AddExecutor(ExecutorType.SpSummon,XYZs.TimeThiefPerpetua);
// activate trap
AddExecutor(ExecutorType.Activate,Traps.PhantomKnightsShade);
AddExecutor(ExecutorType.Activate,Traps.XyzExtreme , XyzExtremeEffect);
AddExecutor(ExecutorType.Activate,Traps.XyzReborn , XyzRebornEffect);
AddExecutor(ExecutorType.Activate,Traps.TimeThiefRetrograte , RetrograteEffect);
AddExecutor(ExecutorType.Activate,Traps.TimeThiefFlyBack );
//xyz effects
AddExecutor(ExecutorType.Activate,XYZs.TimeThiefRedoer,RedoerEffect);
AddExecutor(ExecutorType.Activate,XYZs.TimeThiefPerpetua , PerpertuaEffect);
//monster effects
AddExecutor(ExecutorType.Activate,Monsters.TimeThiefRegulator , RegulatorEffect);
AddExecutor(ExecutorType.Activate,Monsters.TimeThiefWinder);
AddExecutor(ExecutorType.Activate,Monsters.PhotonTrasher);
AddExecutor(ExecutorType.Activate,Monsters.TimeThiefCronocorder);
AddExecutor(ExecutorType.Activate,Monsters.PerformTrickClown);
AddExecutor(ExecutorType.Activate,Monsters.TimeThiefBezelShip);
}
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;
}
try
{
if (Bot.HasInSpellZone(Traps.XyzReborn))
{
return false;
}
if (Bot.HasInSpellZone(Traps.XyzExtreme))
{
return false;
}
for (int i = 0; i < enemy.Count; i++)
{
_totalAttack += enemy[i].Attack;
}
foreach (var t in Bot.GetMonsters())
{
_totalBotAttack += t.Attack;
}
if (_totalAttack > Bot.LifePoints + _totalBotAttack)
{
return false;
}
foreach (var t in enemy)
{
if (t.Attack < 2400 || !t.IsAttack()) continue;
try
{
AI.SelectCard(t.Id);
AI.SelectCard(t.Id);
}
catch{}
return true;
}
}
catch{}
if (Bot.UnderAttack)
{
//AI.SelectCard(Util.GetBestEnemyMonster());
return true;
}
return false;
}
private bool RetrograteEffect()
{
if (Card.Owner== 1)
{
return true;
}
return false;
}
private bool XyzRebornEffect()
{
if (Bot.HasInGraveyard(XYZs.TimeThiefRedoer))
{
AI.SelectCard(XYZs.TimeThiefRedoer);
return true;
}
return true;
}
//function
private bool XyzExtremeEffect()
{
AI.SelectCard(XYZs.CrazyBox);
return true;
}
private bool TimeThiefStartupEffect()
{
if (Card.Location == CardLocation.Hand)
{
if (Bot.HasInHand(Monsters.TimeThiefRegulator) && !(Bot.GetMonsterCount() > 0))
{
AI.SelectCard(Monsters.TimeThiefRegulator);
return true;
}
if(Bot.HasInHand(Monsters.TimeThiefWinder) && Bot.GetMonsterCount()>1)
{
AI.SelectCard(Monsters.TimeThiefWinder);
return true;
}
return true;
}
if (Card.Location == CardLocation.Grave)
{
AI.SelectCard(Monsters.TimeThiefCronocorder);
AI.SelectCard(Spells.TimeThiefHack);
AI.SelectCard(Traps.TimeThiefFlyBack);
return true;
}
return false;
}
private bool FoolishBurialTarget()
{
AI.SelectCard(Monsters.PerformTrickClown);
return true;
}
}
}
......@@ -68,6 +68,7 @@
<Compile Include="Game\AI\DecksManager.cs" />
<Compile Include="Game\AI\Decks\AltergeistExecutor.cs" />
<Compile Include="Game\AI\Decks\BlackwingExecutor.cs" />
<Compile Include="Game\AI\Decks\MathMechExecutor.cs" />
<Compile Include="Game\AI\Decks\PureWindsExecutor.cs" />
<Compile Include="Game\AI\Decks\DragunExecutor.cs" />
<Compile Include="Game\AI\Decks\Level8Executor.cs" />
......@@ -78,6 +79,7 @@
<Compile Include="Game\AI\Decks\SkyStrikerExecutor.cs" />
<Compile Include="Game\AI\Decks\MokeyMokeyKingExecutor.cs" />
<Compile Include="Game\AI\Decks\MokeyMokeyExecutor.cs" />
<Compile Include="Game\AI\Decks\TimeThiefExecutor.cs" />
<Compile Include="Game\AI\Decks\ToadallyAwesomeExecutor.cs" />
<Compile Include="Game\AI\Decks\NekrozExecutor.cs" />
<Compile Include="Game\AI\Decks\GravekeeperExecutor.cs" />
......
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