Commit bfdc2d4c authored by mercury233's avatar mercury233

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

parents 6efcb1b3 b115f4a5
#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
71007216
71007216
71007216
81275020
71175527
71175527
71175527
43722862
43722862
43722862
53932291
53932291
65277087
65277087
65277087
54455435
54455435
54455435
91662792
91662792
91662792
16725505
70117860
70117860
70117860
12580477
27980138
27980138
58577036
83764718
8267140
25789292
67723438
67723438
8608979
8608979
8608979
24590232
40605147
84749824
#extra
27315304
50954680
50954680
50954680
82044279
82044279
14577226
29552709
29552709
64880894
84766279
42110604
70913714
30674956
90512490
!side
19420830
19420830
19420830
94145021
94145021
94145021
25789292
25789292
43711255
43711255
43711255
58921041
58921041
23002292
23002292
#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
This diff is collapsed.
This diff is collapsed.
......@@ -58,8 +58,8 @@ namespace WindBot.Game.AI.Decks
public SkyStrikerExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, CardId.AshBlossom, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.GhostRabbit, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.AshBlossom, DefaultAshBlossomAndJoyousSpring);
AddExecutor(ExecutorType.Activate, CardId.GhostRabbit, DefaultGhostOgreAndSnowRabbit);
AddExecutor(ExecutorType.Activate, CardId.EffectVeiler, DefaultBreakthroughSkill);
AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, CardId.SolemnJudgment, DefaultSolemnJudgment);
......
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;
}
}
}
......@@ -38,12 +38,15 @@ namespace WindBot.Game.AI
public const int CosmicCyclone = 8267140;
public const int ChickenGame = 67616300;
public const int SantaClaws = 46565218;
public const int CastelTheSkyblasterMusketeer = 82633039;
public const int CrystalWingSynchroDragon = 50954680;
public const int NumberS39UtopiaTheLightning = 56832966;
public const int Number39Utopia = 84013237;
public const int UltimayaTzolkin = 1686814;
public const int MekkKnightCrusadiaAstram = 21887175;
public const int HamonLordofStrikingThunder = 32491822;
public const int MoonMirrorShield = 19508728;
public const int PhantomKnightsFogBlade = 25542642;
......@@ -87,6 +90,7 @@ namespace WindBot.Game.AI
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, _CardId.ChickenGame, DefaultChickenGame);
AddExecutor(ExecutorType.Activate, _CardId.SantaClaws);
}
/// <summary>
......@@ -197,6 +201,9 @@ namespace WindBot.Game.AI
if (defender.IsCode(_CardId.UltimayaTzolkin) && !defender.IsDisabled() && Enemy.GetMonsters().Any(monster => !monster.Equals(defender) && monster.HasType(CardType.Synchro)))
return false;
if (Enemy.GetMonsters().Any(monster => !monster.Equals(defender) && monster.IsCode(_CardId.HamonLordofStrikingThunder) && !monster.IsDisabled() && monster.IsDefense()))
return false;
if (defender.OwnTargets.Any(card => card.IsCode(_CardId.PhantomKnightsFogBlade) && !card.IsDisabled()))
return false;
......
......@@ -23,5 +23,6 @@
ElShaddollConstruct = 20366274,
ZushintheSleepingGiant = 67547370,
Heart_eartHDragon = 97403510,
DaigustoSphreeze = 29552709,
}
}
......@@ -82,6 +82,24 @@
InspectorBoarder = 15397015,
Mashoudou = 76375976,
EternalSoul = 48680970,
MarincessBattleOcean = 91027843
MarincessBattleOcean = 91027843,
TopologicZeroboros = 66403530,
GladiatorBeastDomitianus = 33652635,
SerzielWatcheroftheEvilEye = 82466274,
ZerrzielRuleroftheEvilEyed = 17739335,
GorgonEmpressoftheEvilEyed = 29357687,
UnchainedSoulofRage = 67680512,
DracoBerserkeroftheTenyi = 5041348,
NidhoggGeneraiderBossofIce = 49275969,
UtgardaGeneraiderBossofDelusion = 744887,
FrodiGeneraiderBossofSwords = 40998517,
HoarrGeneraiderBossofRumbling = 68199168,
GodPhoenixGearfried = 22091647,
BrotherhoodoftheFireFistEland = 61472381,
PredaplantVerteAnaconda = 70369116,
RedSupernovaDragon = 99585850,
NumberF0UtopicFutureDragon = 26973555,
InvokedAugoeides = 97300502,
DragonmaidStrahl = 24799107
}
}
......@@ -64,6 +64,8 @@
NumberF0UtopicFutureFutureSlash = 43490025,
NumberF0UtopicFuture = 65305468,
GoukiTheGiantOgre = 47946130,
BorrelswordDragon = 85289965
BorrelswordDragon = 85289965,
NumberF0UtopicFutureDragon = 26973555,
BorrelendDragon = 98630720
}
}
......@@ -44,6 +44,12 @@
PaladinofDarkDragon = 71408082,
PaladinofPhotonDragon = 85346853,
TwinPhotonLizard = 29455728,
TimeThiefRegulator = 19891131,
MathmechNabla = 53577438,
NidhoggGeneraiderBossofIce = 49275969,
HoarrGeneraiderBossofRumbling = 68199168,
RedFamiliar = 8372133,
AccesscodeTalker = 86066372,
CosmoBrain = 85679527,
ShiranuiSolitaire = 94801854,
......
......@@ -13,6 +13,7 @@
CXyzSimontheGreatMoralLeader = 41147577,
PaleozoicAnomalocaris = 61307542,
PaleozoicOpabinia = 37649320,
BorreloadDragon = 31833038
BorreloadDragon = 31833038,
BorrelendDragon = 98630720
}
}
......@@ -49,5 +49,6 @@
Blackwing_FullArmoredWing = 54082269,
DragunofRedEyes = 37818794,
RedEyesBDragon = 74677422, // sometimes the name of DragunofRedEyes will be changed to RedEyesBDragon
TheArrivalCyberseIgnister = 11738489
}
}
......@@ -683,12 +683,14 @@ namespace WindBot.Game
private void OnChaining(BinaryReader packet)
{
packet.ReadInt32(); // card id
int cardId = packet.ReadInt32();
int pcc = GetLocalPlayer(packet.ReadByte());
int pcl = packet.ReadByte();
int pcs = packet.ReadSByte();
int subs = packet.ReadSByte();
ClientCard card = _duel.GetCard(pcc, pcl, pcs, subs);
if (card.Id == 0)
card.SetId(cardId);
int cc = GetLocalPlayer(packet.ReadByte());
if (_debug)
if (card != null) Logger.WriteLine("(" + cc.ToString() + " 's " + (card.Name ?? "UnKnowCard") + " activate effect)");
......
......@@ -68,6 +68,8 @@
<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" />
<Compile Include="Game\AI\Decks\SalamangreatExecutor.cs" />
......@@ -77,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