Commit 60974623 authored by mercury233's avatar mercury233

merge mycard deck changes

parent 93ad9043
#created by ...
#main
75498415
75498415
75498415
81105204
81105204
81105204
58820853
58820853
58820853
49003716
49003716
49003716
85215458
85215458
85215458
2009101
2009101
2009101
22835145
22835145
22835145
46710683
46710683
46710683
53129443
5318639
5318639
5318639
91351370
91351370
91351370
44095762
44095762
44095762
59839761
59839761
59839761
70342110
70342110
70342110
#extra
33236860
33236860
33236860
9012916
9012916
9012916
69031175
69031175
69031175
76913983
76913983
76913983
17377751
17377751
17377751
!side
#created by ...
#main
89631139
89631139
89631139
38517737
38517737
38517737
45467446
45467446
71039903
71039903
71039903
79814787
79814787
8240199
8240199
8240199
5133471
5133471
6853254
6853254
6853254
18144506
35261759
35261759
38120068
38120068
38120068
39701395
39701395
39701395
41620959
41620959
48800175
48800175
48800175
54447022
83764718
87025064
87025064
87025064
#extra
63422098
40908371
40908371
40908371
59822133
59822133
59822133
58820923
2530830
39030163
31801517
18963306
63767246
63767246
33909817
!side
......@@ -7,6 +7,7 @@
2851070
97396380
97396380
97396380
26302522
26302522
26302522
......@@ -19,26 +20,25 @@
44789585
44789585
44789585
19523799
19523799
19523799
45311864
45311864
45311864
20264508
20264508
46918794
46918794
46918794
72302403
72302403
72302403
98380593
8842266
79323590
79323590
85562745
85562745
29843091
36468556
62279055
62279055
62279055
1918087
1918087
48276469
98139712
98139712
98139712
#extra
!side
#created by ...
#main
4162088
68774379
70095154
70095154
70095154
59281922
59281922
59281922
3370104
67159705
26439287
26439287
26439287
76986005
23893227
23893227
23893227
3657444
11961740
11961740
24094653
24094653
37630732
37630732
37630732
52875873
52875873
53129443
66607691
95286165
29401950
29401950
44095762
44095762
91989718
92773018
92773018
97077563
97077563
3819470
#extra
1546123
1546123
1546123
74157028
74157028
74157028
10443957
10443957
10443957
58069384
58069384
58069384
!side
......@@ -20,10 +20,9 @@
39701395
39701395
70368879
70368879
71490127
73628505
73628505
73628505
81439173
5318639
5318639
......@@ -32,6 +31,7 @@
60004971
62265044
62265044
62265044
44095762
58120309
58120309
......@@ -42,8 +42,8 @@
80280737
#extra
99267150
99267150
99267150
50954680
50954680
76774528
76774528
76774528
......
#created by ...
#main
77542832
77542832
77542832
40921545
79785958
79785958
79785958
59546797
59546797
72429240
4756629
4756629
4756629
8814959
8814959
8814959
85138716
85138716
85138716
23434538
23434538
911883
1475311
1475311
18144506
32807846
8267140
27541267
27541267
26708437
26708437
5851097
35419032
58921041
58921041
40605147
40605147
40605147
41420027
84749824
#extra
88754763
9272381
56832966
86532744
36757171
93568288
21044178
91279700
46772449
82633039
84013237
76067258
359563
91279700
91279700
!side
8233522
8233522
5318639
8267140
12923641
12923641
12923641
18161786
18161786
11109820
11109820
11109820
94192409
94192409
58921041
......@@ -22,7 +22,7 @@
23408872
12538374
12538374
12580477
53129443
73628505
73628505
98645731
......
#created by ...
#main
25524823
36521459
3825890
62473983
17393207
17393207
17393207
25262697
30213599
30213599
30213599
24317029
24317029
24317029
93023479
93023479
93023479
72405967
72405967
5318639
5318639
5318639
14087893
14087893
70000776
70000776
47355498
47355498
47355498
29401950
29401950
30450531
30450531
53582587
53582587
70342110
70342110
84749824
90434657
90434657
#extra
44508094
!side
#created by ...
#main
20056760
20056760
20056760
29834183
29834183
29834183
93445074
93445074
93445074
66451379
66451379
66451379
23434538
23434538
23434538
97268402
97268402
97268402
18144507
33057951
33057951
33057951
53129443
83764718
98645731
98645731
98645731
2759860
2759860
2759860
58120309
75361204
75361204
49966595
49966595
49966595
82732705
82732705
82732705
41420027
#extra
52687916
80666118
39765958
52145422
52145422
70902743
76774528
44508094
83994433
95040215
98012938
88033975
26593852
98558751
78156759
!side
46565218
46565218
46565218
5318639
5318639
5318639
95561280
95561280
95561280
47475363
47475363
47475363
98643358
98643358
98643358
......@@ -20,7 +20,7 @@
47013502
47013502
9666558
12580477
26412047
26412047
53129443
66788016
......
#created by ...
#main
57774843
57774843
57774843
58996430
58996430
58996430
59019082
77558536
77558536
77558536
22624373
22624373
67696066
67696066
67696066
25259669
25259669
25259669
1833916
1833916
73176465
73176465
37742478
37742478
95503687
95503687
95503687
40164421
21502796
67441435
691925
691925
691925
5133471
18144506
32807846
73594093
94886282
94886282
94886282
#extra
52687916
80666118
74586817
4779823
37192109
56832966
84013237
82633039
30100551
30100551
30100551
46772449
83531441
1861629
3987233
!side
#created by ...
#main
39552864
39552864
39552864
12482652
12482652
12482652
42941100
42941100
42941100
79335209
79335209
79335209
487395
487395
487395
99171160
99171160
99171160
53776525
53776525
53776525
32274490
32274490
32274490
27288416
27288416
27288416
80825553
80825553
80825553
7902349
8124921
44519536
70903634
69380702
69380702
69380702
3557275
3557275
3557275
#extra
!side
#created by ...
#main
5464695
5464695
5464695
39256679
39256679
39256679
11549357
11549357
11549357
99785935
99785935
99785935
91152256
91152256
91152256
76812113
76812113
76812113
85639257
85639257
85639257
74093656
74093656
74093656
68505803
68505803
68505803
27288416
27288416
27288416
19384334
22702055
23424603
35956022
45778932
50913601
56594520
82999629
86318356
87430998
#extra
45815891
45815891
45815891
71594310
71594310
71594310
67598234
67598234
67598234
!side
#created by ...
#main
52738610
52738610
52738610
23401839
23401839
23401839
95492061
95492061
95492061
30312361
90307777
88240999
88240999
52068432
52068432
52068432
74122412
74122412
26674724
89463537
99185129
99185129
99185129
32807846
53129443
96729612
96729612
14735698
14735698
14735698
51124303
51124303
51124303
97211663
5318639
5318639
5318639
51452091
51452091
51452091
#extra
35952884
35952884
41517789
41517789
24696097
24696097
52687916
74586817
37192109
42566602
90953320
79606837
79606837
79606837
46772449
!side
......@@ -23,7 +23,6 @@
83104731
30190809
30190809
12580477
26412047
26412047
26412047
......@@ -38,6 +37,7 @@
72302403
44095762
44095762
44095762
70342110
70342110
#extra
......
#created by ...
#main
65518099
65518099
65518099
13073850
13073850
90885155
37991342
37991342
91907707
91907707
53129443
59750328
59750328
79816536
79816536
79816536
98645731
98645731
17639150
17639150
44095762
44095762
44095762
53582587
53582587
53582587
83326048
83326048
83326048
94192409
94192409
94192409
5851097
82732705
82732705
82732705
40605147
40605147
99188141
99188141
#extra
13331639
13331639
13331639
79229522
79229522
79229522
26268488
26268488
26268488
35952884
35952884
35952884
23187256
23187256
23187256
!side
#created by ...
#main
18108166
18108166
18108166
74852097
74852097
74852097
81823360
81823360
81823360
75195825
75195825
75195825
87979586
87979586
87979586
33256280
33256280
33256280
85138716
85138716
85138716
911883
911883
911883
18144506
35261759
35261759
35261759
97169186
97169186
97169186
5650082
20522190
29401950
29616929
40838625
44095762
47475363
58120309
75249652
#extra
80666118
18239909
44508094
56832966
37279508
84013237
74294676
82697249
82633039
61344030
22653490
46772449
12014404
359563
6511113
!side
......@@ -2,26 +2,27 @@
#main
28601770
28601770
18842395
18842395
18842395
70095155
70095155
70095155
54343893
54343893
54343893
14778250
14778250
28601770
70095154
70095154
70095154
29353756
29353756
33911264
33911264
33911264
20932152
20932152
20932152
12299841
12299841
12299841
24610207
24610207
24610207
26082117
26082117
26082117
88552992
88552992
88552992
1845204
1845204
1845204
......@@ -33,27 +34,26 @@
14087893
13032689
26708437
26708437
44095762
44095762
53582587
56120475
58628539
58628539
96457619
96457619
#extra
45231177
45231177
45231177
29515122
29515122
72959823
72959823
72959823
91949988
91949988
10443957
10443957
10443957
31386180
31386180
94119480
94119480
29669359
29669359
29669359
55067058
55067058
55067058
50449881
58069384
58069384
58069384
!side
#created by ...
#main
32295838
36211150
7445307
70950698
70950698
70950698
35595518
35595518
9190563
9190563
44956694
44956694
44956694
8567955
8567955
8567955
71172240
71172240
45778242
45778242
62706865
62706865
18789533
37520316
53129443
83764718
5318639
8267140
14087893
43839002
43839002
19508728
61583217
29401950
44095762
53582587
70238111
83326048
94192409
40605147
#extra
1861629
1861629
1861629
6622715
6622715
6622715
32617464
32617464
34472920
34472920
79016563
79016563
98978921
98978921
98978921
!side
#created by ...
#main
23950192
23950192
90311614
90311614
90311614
9126351
9126351
9126351
50088247
50088247
50088247
1357146
1357146
1357146
46239604
46239604
46239604
80250319
80250319
80250319
5133471
5133471
5133471
18144506
33057951
33057951
33057951
53129443
72892473
81439173
83764718
84206435
84206435
84206435
96947648
96947648
96947648
29047353
29047353
29047353
#extra
79606837
79606837
79606837
90809975
90809975
90809975
36776089
36776089
36776089
2766877
2766877
2766877
84224627
84224627
84224627
!side
#created by ...
#main
92246806
92246806
92246806
65247798
65247798
65247798
28630501
28630501
28630501
25244515
25244515
18144507
53129443
59750328
59750328
98645731
98645731
98645731
8267140
8267140
8267140
40838625
40838625
47475363
47475363
47475363
58120309
58120309
58120309
5851097
30241314
30241314
30241314
40605147
40605147
41420027
59344077
59344077
59344077
84749824
#extra
44508094
56832966
86532744
16195942
84013237
94380860
96381979
63746411
82633039
95169481
22653490
46772449
21044178
12014404
12014404
!side
......@@ -7,7 +7,6 @@
45082499
33911264
33911264
33911264
65367484
65367484
24610207
......@@ -15,45 +14,60 @@
24610207
30914564
30914564
30914564
25259669
25259669
25259669
37742478
37742478
94656263
94656263
94656263
34143852
34143852
34143852
40941889
18063928
18063928
18063928
423585
423585
1845204
1845204
1845204
12580477
32807846
53129443
5318639
5318639
78474168
78474168
78474168
11705261
11705261
11705261
40605147
84749824
#extra
45231177
45231177
17881964
17881964
91949988
60992364
60992364
94119480
56832966
56832966
56832966
29669359
71594310
86532744
86532744
86532744
84013237
84013237
84013237
!side
33911264
34143852
34143852
34143852
45231177
60992364
94119480
29669359
71594310
25341652
12014404
!side
78474168
78474168
78474168
#created by ...
#main
63941210
36956512
55063751
28674152
29726552
65367484
65367484
65367484
77150143
77150143
77150143
31755044
31755044
31755044
86120751
86120751
86120751
78872731
78872731
78872731
18144506
53129443
73628505
73628505
73628505
74063034
74063034
74063034
83764718
99330325
99330325
99330325
46060017
46060017
46060017
57103969
47679935
47679935
47679935
73881652
#extra
75286621
75286621
48791583
48791583
581014
581014
11510448
11510448
41375811
41375811
48905153
48905153
85115440
85115440
85115440
!side
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
// NOT FINISHED YET
[Deck("Blackwing", "AI_Blackwing", "NotFinished")]
public class BlackwingExecutor : DefaultExecutor
{
public class CardId
{
public const int KrisTheCrackOfDawn = 81105204;
public const int SiroccoTheDawn = 75498415;
public const int ShuraTheBlueFlame = 58820853;
public const int BoraTheSpear = 49003716;
public const int KalutTheMoonShadow = 85215458;
public const int GaleTheWhirlwind = 2009101;
public const int BlizzardTheFarNorth = 22835145;
public const int MistralTheSilverShield = 46710683;
public const int Raigeki = 12580477;
public const int DarkHole = 53129443;
public const int MysticalSpaceTyphoon = 5318639;
public const int BlackWhirlwind = 91351370;
public const int MirrorForce = 44095762;
public const int DeltaCrowAntiReverse = 59839761;
public const int DimensionalPrison = 70342110;
public const int SilverwindTheAscendant = 33236860;
public const int BlackWingedDragon = 9012916;
public const int ArmorMaster = 69031175;
public const int ArmedWing = 76913983;
public const int GramTheShiningStar = 17377751;
}
public BlackwingExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, CardId.BlackWhirlwind, BlackWhirlwindEffect);
AddExecutor(ExecutorType.SpSummon, CardId.KrisTheCrackOfDawn);
AddExecutor(ExecutorType.SummonOrSet, CardId.KrisTheCrackOfDawn);
AddExecutor(ExecutorType.Summon, CardId.SiroccoTheDawn, SiroccoTheDawnSummon);
AddExecutor(ExecutorType.Summon, CardId.ShuraTheBlueFlame, ShuraTheBlueFlameSummon);
AddExecutor(ExecutorType.SummonOrSet, CardId.ShuraTheBlueFlame);
AddExecutor(ExecutorType.SpSummon, CardId.BoraTheSpear);
AddExecutor(ExecutorType.SummonOrSet, CardId.BoraTheSpear);
AddExecutor(ExecutorType.SummonOrSet, CardId.KalutTheMoonShadow, KalutTheMoonShadowSummon);
AddExecutor(ExecutorType.SpSummon, CardId.GaleTheWhirlwind);
AddExecutor(ExecutorType.SummonOrSet, CardId.GaleTheWhirlwind);
AddExecutor(ExecutorType.Summon, CardId.BlizzardTheFarNorth, BlizzardTheFarNorthSummon);
AddExecutor(ExecutorType.MonsterSet, CardId.MistralTheSilverShield);
AddExecutor(ExecutorType.SpSummon, CardId.SilverwindTheAscendant);
AddExecutor(ExecutorType.SpSummon, CardId.ArmorMaster);
AddExecutor(ExecutorType.SpSummon, CardId.GramTheShiningStar);
AddExecutor(ExecutorType.SpSummon, CardId.ArmedWing);
AddExecutor(ExecutorType.SpSummon, CardId.BlackWingedDragon);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.DimensionalPrison, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.DeltaCrowAntiReverse, DeltaCrowAntiReverseEffect);
AddExecutor(ExecutorType.Activate, CardId.BlizzardTheFarNorth);
AddExecutor(ExecutorType.Activate, CardId.ShuraTheBlueFlame);
AddExecutor(ExecutorType.Activate, CardId.BoraTheSpear, BoraTheSpearEffect);
AddExecutor(ExecutorType.Activate, CardId.KalutTheMoonShadow, AttackUpEffect);
AddExecutor(ExecutorType.Activate, CardId.SiroccoTheDawn, AttackUpEffect);
AddExecutor(ExecutorType.Activate, CardId.GaleTheWhirlwind, GaleTheWhirlwindEffect);
AddExecutor(ExecutorType.Activate, CardId.SilverwindTheAscendant);
AddExecutor(ExecutorType.Activate, CardId.BlackWingedDragon);
AddExecutor(ExecutorType.Activate, CardId.ArmorMaster);
AddExecutor(ExecutorType.Activate, CardId.ArmedWing);
AddExecutor(ExecutorType.Activate, CardId.GramTheShiningStar);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
private bool ShuraTheBlueFlameSummon()
{
if (Bot.HasInMonstersZone(CardId.SiroccoTheDawn) && Bot.GetMonsters().GetHighestAttackMonster().Attack < 3800)
return true;
return false;
}
private bool BlackWhirlwindEffect()
{
if (Card.Location == CardLocation.Hand && Bot.HasInSpellZone(Card.Id))
return false;
if (ActivateDescription == AI.Utils.GetStringId((int)Card.Id,0))
AI.SelectCard(CardId.GaleTheWhirlwind);
return true;
}
private bool SiroccoTheDawnSummon()
{
int OpponentMonster = Enemy.GetMonsterCount();
int AIMonster = Bot.GetMonsterCount();
if (OpponentMonster != 0 && AIMonster == 0)
return true;
return false;
}
private bool BoraTheSpearEffect()
{
List<ClientCard> monster = Bot.GetMonsters();
foreach (ClientCard card in monster)
if (card != null && card.Id == CardId.KrisTheCrackOfDawn || card.Id == CardId.KalutTheMoonShadow || card.Id == CardId.GaleTheWhirlwind || card.Id == CardId.BoraTheSpear || card.Id == CardId.SiroccoTheDawn || card.Id == CardId.ShuraTheBlueFlame || card.Id == CardId.BlizzardTheFarNorth)
return true;
return false;
}
private bool KalutTheMoonShadowSummon()
{
foreach (ClientCard card in Bot.Hand)
if (card != null && card.Id == CardId.KrisTheCrackOfDawn || card.Id == CardId.GaleTheWhirlwind || card.Id == CardId.BoraTheSpear || card.Id == CardId.SiroccoTheDawn || card.Id == CardId.ShuraTheBlueFlame || card.Id == CardId.BlizzardTheFarNorth)
return false;
return true;
}
private bool BlizzardTheFarNorthSummon()
{
foreach (ClientCard card in Bot.Graveyard)
if (card != null && card.Id == CardId.KalutTheMoonShadow || card.Id == CardId.BoraTheSpear || card.Id == CardId.ShuraTheBlueFlame || card.Id == CardId.KrisTheCrackOfDawn)
return true;
return false;
}
private bool DeltaCrowAntiReverseEffect()
{
int Count = 0;
List<ClientCard> monster = Bot.GetMonsters();
foreach (ClientCard card in monster)
if (card != null && card.Id == CardId.KrisTheCrackOfDawn || card.Id == CardId.KalutTheMoonShadow || card.Id == CardId.GaleTheWhirlwind || card.Id == CardId.BoraTheSpear || card.Id == CardId.SiroccoTheDawn || card.Id == CardId.ShuraTheBlueFlame || card.Id == CardId.BlizzardTheFarNorth)
Count++;
if (Count == 3)
return true;
return false;
}
private bool GaleTheWhirlwindEffect()
{
if (Card.Position == (int)CardPosition.FaceUp)
{
AI.SelectCard(Enemy.GetMonsters().GetHighestAttackMonster());
return true;
}
return false;
}
private bool AttackUpEffect()
{
ClientCard bestMy = Bot.GetMonsters().GetHighestAttackMonster();
ClientCard bestEnemyATK = Enemy.GetMonsters().GetHighestAttackMonster();
ClientCard bestEnemyDEF = Enemy.GetMonsters().GetHighestDefenseMonster();
if (bestMy == null || (bestEnemyATK == null && bestEnemyDEF == null))
return false;
if (bestEnemyATK != null && bestMy.Attack < bestEnemyATK.Attack)
return true;
if (bestEnemyDEF != null && bestMy.Attack < bestEnemyDEF.Defense)
return true;
return false;
}
}
}
\ No newline at end of file
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Blue-Eyes", "AI_BlueEyes")]
class BlueEyesExecutor : DefaultExecutor
{
public class CardId
{
public const int WhiteDragon = 89631139;
public const int AlternativeWhiteDragon = 38517737;
public const int DragonSpiritOfWhite = 45467446;
public const int WhiteStoneOfAncients = 71039903;
public const int WhiteStoneOfLegend = 79814787;
public const int SageWithEyesOfBlue = 8240199;
public const int EffectVeiler = 97268402;
public const int GalaxyCyclone = 5133471;
public const int HarpiesFeatherDuster = 18144506;
public const int ReturnOfTheDragonLords = 6853254;
public const int PotOfDesires = 35261759;
public const int TradeIn = 38120068;
public const int CardsOfConsonance = 39701395;
public const int DragonShrine = 41620959;
public const int MelodyOfAwakeningDragon = 48800175;
public const int SoulCharge = 54447022;
public const int MonsterReborn = 83764718;
public const int SilversCry = 87025064;
public const int Giganticastle = 63422098;
public const int AzureEyesSilverDragon = 40908371;
public const int BlueEyesSpiritDragon = 59822133;
public const int GalaxyEyesDarkMatterDragon = 58820923;
public const int GalaxyEyesCipherBladeDragon = 2530830;
public const int GalaxyEyesFullArmorPhotonDragon = 39030163;
public const int GalaxyEyesPrimePhotonDragon = 31801517;
public const int GalaxyEyesCipherDragon = 18963306;
public const int HopeHarbingerDragonTitanicGalaxy = 63767246;
public const int SylvanPrincessprite = 33909817;
}
private List<ClientCard> UsedAlternativeWhiteDragon = new List<ClientCard>();
ClientCard UsedGalaxyEyesCipherDragon;
bool AlternativeWhiteDragonSummoned = false;
bool SoulChargeUsed = false;
public BlueEyesExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
// destroy traps
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, CardId.GalaxyCyclone, DefaultGalaxyCyclone);
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, CardId.DragonShrine, DragonShrineEffect);
// Sage search
AddExecutor(ExecutorType.Summon, CardId.SageWithEyesOfBlue, SageWithEyesOfBlueSummon);
// search Alternative White Dragon
AddExecutor(ExecutorType.Activate, CardId.MelodyOfAwakeningDragon, MelodyOfAwakeningDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.CardsOfConsonance, CardsOfConsonanceEffect);
AddExecutor(ExecutorType.Activate, CardId.TradeIn, TradeInEffect);
AddExecutor(ExecutorType.Activate, CardId.PotOfDesires, DefaultPotOfDesires);
// spsummon Alternative White Dragon if possible
AddExecutor(ExecutorType.SpSummon, CardId.AlternativeWhiteDragon, AlternativeWhiteDragonSummon);
// reborn
AddExecutor(ExecutorType.Activate, CardId.ReturnOfTheDragonLords, RebornEffect);
AddExecutor(ExecutorType.Activate, CardId.SilversCry, RebornEffect);
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, RebornEffect);
// monster effects
AddExecutor(ExecutorType.Activate, CardId.AlternativeWhiteDragon, AlternativeWhiteDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.SageWithEyesOfBlue, SageWithEyesOfBlueEffect);
AddExecutor(ExecutorType.Activate, CardId.WhiteStoneOfAncients, WhiteStoneOfAncientsEffect);
AddExecutor(ExecutorType.Activate, CardId.DragonSpiritOfWhite, DragonSpiritOfWhiteEffect);
AddExecutor(ExecutorType.Activate, CardId.BlueEyesSpiritDragon, BlueEyesSpiritDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.HopeHarbingerDragonTitanicGalaxy, HopeHarbingerDragonTitanicGalaxyEffect);
AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesCipherDragon, GalaxyEyesCipherDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesPrimePhotonDragon, GalaxyEyesPrimePhotonDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesFullArmorPhotonDragon, GalaxyEyesFullArmorPhotonDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesCipherBladeDragon, GalaxyEyesCipherBladeDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesDarkMatterDragon, GalaxyEyesDarkMatterDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.AzureEyesSilverDragon, AzureEyesSilverDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.SylvanPrincessprite, SylvanPrincesspriteEffect);
// normal summon
AddExecutor(ExecutorType.Summon, CardId.SageWithEyesOfBlue, WhiteStoneSummon);
AddExecutor(ExecutorType.Summon, CardId.WhiteStoneOfAncients, WhiteStoneSummon);
AddExecutor(ExecutorType.Summon, CardId.WhiteStoneOfLegend, WhiteStoneSummon);
// special summon from extra
AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesCipherDragon, GalaxyEyesCipherDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesPrimePhotonDragon, GalaxyEyesPrimePhotonDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesFullArmorPhotonDragon, GalaxyEyesFullArmorPhotonDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesCipherBladeDragon, GalaxyEyesCipherBladeDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesDarkMatterDragon, GalaxyEyesDarkMatterDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.Giganticastle, GiganticastleSummon);
AddExecutor(ExecutorType.SpSummon, CardId.BlueEyesSpiritDragon, BlueEyesSpiritDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.HopeHarbingerDragonTitanicGalaxy, HopeHarbingerDragonTitanicGalaxySummon);
AddExecutor(ExecutorType.SpSummon, CardId.SylvanPrincessprite, SylvanPrincesspriteSummon);
// if we don't have other things to do...
AddExecutor(ExecutorType.Activate, CardId.SoulCharge, SoulChargeEffect);
AddExecutor(ExecutorType.Repos, Repos);
// summon White Stone to use the hand effect of Sage
AddExecutor(ExecutorType.Summon, CardId.WhiteStoneOfLegend, WhiteStoneSummonForSage);
AddExecutor(ExecutorType.Summon, CardId.WhiteStoneOfAncients, WhiteStoneSummonForSage);
AddExecutor(ExecutorType.Summon, CardId.SageWithEyesOfBlue, WhiteStoneSummonForSage);
AddExecutor(ExecutorType.Activate, CardId.SageWithEyesOfBlue, SageWithEyesOfBlueEffectInHand);
// set White Stone of Legend frist
AddExecutor(ExecutorType.MonsterSet, CardId.WhiteStoneOfLegend);
AddExecutor(ExecutorType.MonsterSet, CardId.WhiteStoneOfAncients);
AddExecutor(ExecutorType.SpellSet, SpellSet);
}
public override void OnNewTurn()
{
// reset
UsedAlternativeWhiteDragon.Clear();
UsedGalaxyEyesCipherDragon = null;
AlternativeWhiteDragonSummoned = false;
SoulChargeUsed = false;
}
public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, bool cancelable)
{
Logger.DebugWriteLine("OnSelectCard " + cards.Count + " " + min + " " + max);
if (max == 2 && cards[0].Location == CardLocation.Deck)
{
Logger.DebugWriteLine("OnSelectCard MelodyOfAwakeningDragon");
IList<ClientCard> result = new List<ClientCard>();
if (!Bot.HasInHand(CardId.WhiteDragon))
{
foreach (ClientCard card in cards)
{
if (card.Id == CardId.WhiteDragon)
{
result.Add(card);
break;
}
}
}
foreach (ClientCard card in cards)
{
if (card.Id == CardId.AlternativeWhiteDragon && result.Count < max)
{
result.Add(card);
}
}
if (result.Count < min)
{
foreach (ClientCard card in cards)
{
if (!result.Contains(card))
result.Add(card);
if (result.Count >= min)
break;
}
}
while (result.Count > max)
{
result.RemoveAt(result.Count - 1);
}
return result;
}
if (max == 2 && min == 2 && cards[0].Location == CardLocation.MonsterZone)
{
Logger.DebugWriteLine("OnSelectCard XYZ");
IList<ClientCard> avail = new List<ClientCard>();
foreach (ClientCard card in cards)
{
// clone
avail.Add(card);
}
IList<ClientCard> result = new List<ClientCard>();
while (UsedAlternativeWhiteDragon.Count > 0 && avail.IndexOf(UsedAlternativeWhiteDragon[0]) > 0)
{
Logger.DebugWriteLine("select UsedAlternativeWhiteDragon");
ClientCard card = UsedAlternativeWhiteDragon[0];
UsedAlternativeWhiteDragon.Remove(card);
avail.Remove(card);
result.Add(card);
}
if (result.Count < 2)
{
foreach (ClientCard card in cards)
{
if (!result.Contains(card))
result.Add(card);
if (result.Count >= 2)
break;
}
}
return result;
}
Logger.DebugWriteLine("Use default.");
return null;
}
public override IList<ClientCard> OnSelectSum(IList<ClientCard> cards, int sum, int min, int max, bool mode)
{
Logger.DebugWriteLine("OnSelectSum " + cards.Count + " " + sum + " " + min + " " + max);
if (sum != 8 || !mode)
return null;
foreach (ClientCard AlternativeWhiteDragon in UsedAlternativeWhiteDragon)
{
if (cards.IndexOf(AlternativeWhiteDragon) > 0)
{
UsedAlternativeWhiteDragon.Remove(AlternativeWhiteDragon);
Logger.DebugWriteLine("select UsedAlternativeWhiteDragon");
return new[] { AlternativeWhiteDragon };
}
}
return null;
}
private bool DragonShrineEffect()
{
AI.SelectCard(new[]
{
CardId.DragonSpiritOfWhite,
CardId.WhiteDragon,
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend
});
if (!Bot.HasInHand(CardId.WhiteDragon))
{
AI.SelectNextCard(CardId.WhiteStoneOfLegend);
}
else
{
AI.SelectNextCard(new[]
{
CardId.WhiteStoneOfAncients,
CardId.DragonSpiritOfWhite,
CardId.WhiteStoneOfLegend
});
}
return true;
}
private bool MelodyOfAwakeningDragonEffect()
{
AI.SelectCard(new[]
{
CardId.WhiteStoneOfAncients,
CardId.DragonSpiritOfWhite,
CardId.WhiteStoneOfLegend,
CardId.GalaxyCyclone,
CardId.EffectVeiler,
CardId.TradeIn,
CardId.SageWithEyesOfBlue
});
return true;
}
private bool CardsOfConsonanceEffect()
{
if (!Bot.HasInHand(CardId.WhiteDragon))
{
AI.SelectCard(CardId.WhiteStoneOfLegend);
}
else if (Bot.HasInHand(CardId.TradeIn))
{
AI.SelectCard(CardId.WhiteStoneOfLegend);
}
else
{
AI.SelectCard(CardId.WhiteStoneOfAncients);
}
return true;
}
private bool TradeInEffect()
{
if (Bot.HasInHand(CardId.DragonSpiritOfWhite))
{
AI.SelectCard(CardId.DragonSpiritOfWhite);
return true;
}
else if (HasTwoInHand(CardId.WhiteDragon))
{
AI.SelectCard(CardId.WhiteDragon);
return true;
}
else if (HasTwoInHand(CardId.AlternativeWhiteDragon))
{
AI.SelectCard(CardId.AlternativeWhiteDragon);
return true;
}
else if (!Bot.HasInHand(CardId.WhiteDragon) || !Bot.HasInHand(CardId.AlternativeWhiteDragon))
{
AI.SelectCard(new[]
{
CardId.WhiteDragon,
CardId.AlternativeWhiteDragon
});
return true;
}
else
{
return false;
}
}
private bool AlternativeWhiteDragonEffect()
{
ClientCard target = AI.Utils.GetProblematicEnemyMonster(Card.GetDefensePower());
if (target != null)
{
AI.SelectCard(target);
UsedAlternativeWhiteDragon.Add(Card);
return true;
}
if (CanDealWithUsedAlternativeWhiteDragon())
{
target = AI.Utils.GetBestEnemyMonster();
AI.SelectCard(target);
UsedAlternativeWhiteDragon.Add(Card);
return true;
}
return false;
}
private bool RebornEffect()
{
if (Duel.Player == 0 && CurrentChain.Count > 0)
{
// Silver's Cry spsummon Dragon Spirit at chain 2 will miss the timing
return false;
}
if (Duel.Player == 0 && (Duel.Phase == DuelPhase.Draw || Duel.Phase == DuelPhase.Standby))
{
// Let Azure-Eyes spsummon first
return false;
}
IList<int> targets = new[] {
CardId.HopeHarbingerDragonTitanicGalaxy,
CardId.GalaxyEyesDarkMatterDragon,
CardId.AlternativeWhiteDragon,
CardId.AzureEyesSilverDragon,
CardId.BlueEyesSpiritDragon,
CardId.WhiteDragon,
CardId.DragonSpiritOfWhite
};
if (!Bot.HasInGraveyard(targets))
{
return false;
}
ClientCard floodgate = Enemy.SpellZone.GetFloodgate();
if (floodgate != null && Bot.HasInGraveyard(CardId.DragonSpiritOfWhite))
{
AI.SelectCard(CardId.DragonSpiritOfWhite);
}
else
{
AI.SelectCard(targets);
}
return true;
}
private bool AzureEyesSilverDragonEffect()
{
if (Enemy.GetSpellCount() > 0)
{
AI.SelectCard(CardId.DragonSpiritOfWhite);
}
else
{
AI.SelectCard(CardId.WhiteDragon);
}
return true;
}
private bool SageWithEyesOfBlueSummon()
{
return !Bot.HasInHand(new[]
{
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend
});
}
private bool SageWithEyesOfBlueEffect()
{
if (Card.Location == CardLocation.Hand)
{
return false;
}
AI.SelectCard(new[]
{
CardId.WhiteStoneOfAncients,
CardId.EffectVeiler,
CardId.WhiteStoneOfLegend
});
return true;
}
private bool WhiteStoneSummonForSage()
{
return Bot.HasInHand(CardId.SageWithEyesOfBlue);
}
private bool SageWithEyesOfBlueEffectInHand()
{
if (Card.Location != CardLocation.Hand)
{
return false;
}
if (!Bot.HasInMonstersZone(new[]
{
CardId.WhiteStoneOfLegend,
CardId.WhiteStoneOfAncients
}) || Bot.HasInMonstersZone(new[]
{
CardId.AlternativeWhiteDragon,
CardId.WhiteDragon,
CardId.DragonSpiritOfWhite
}))
{
return false;
}
AI.SelectCard(new[]
{
CardId.WhiteStoneOfLegend,
CardId.WhiteStoneOfAncients
});
if (Enemy.GetSpellCount() > 0)
{
AI.SelectNextCard(CardId.DragonSpiritOfWhite);
}
else
{
AI.SelectNextCard(CardId.WhiteDragon);
}
return true;
}
private bool DragonSpiritOfWhiteEffect()
{
if (ActivateDescription == -1)
{
ClientCard target = AI.Utils.GetBestEnemySpell();
AI.SelectCard(target);
return true;
}
else if (HaveEnoughWhiteDragonInHand())
{
if (Duel.Player == 0 && Duel.Phase == DuelPhase.BattleStart)
{
return Card.Attacked;
}
if (Duel.Player == 1 && Duel.Phase == DuelPhase.End)
{
return Bot.HasInMonstersZone(CardId.AzureEyesSilverDragon, true)
&& !Bot.HasInGraveyard(CardId.DragonSpiritOfWhite)
&& !Bot.HasInGraveyard(CardId.WhiteDragon);
}
if (AI.Utils.IsChainTarget(Card))
{
return true;
}
}
return false;
}
private bool BlueEyesSpiritDragonEffect()
{
if (ActivateDescription == -1 || ActivateDescription == AI.Utils.GetStringId(CardId.BlueEyesSpiritDragon, 0))
{
return LastChainPlayer == 1;
}
else if (Duel.Player == 1 && (Duel.Phase == DuelPhase.BattleStart || Duel.Phase == DuelPhase.End))
{
AI.SelectCard(CardId.AzureEyesSilverDragon);
return true;
}
else
{
if (AI.Utils.IsChainTarget(Card))
{
AI.SelectCard(CardId.AzureEyesSilverDragon);
return true;
}
return false;
}
}
private bool HopeHarbingerDragonTitanicGalaxyEffect()
{
if (ActivateDescription == -1 || ActivateDescription == AI.Utils.GetStringId(CardId.HopeHarbingerDragonTitanicGalaxy, 0))
{
return LastChainPlayer == 1;
}
return true;
}
private bool WhiteStoneOfAncientsEffect()
{
if (ActivateDescription == AI.Utils.GetStringId(CardId.WhiteStoneOfAncients, 0))
{
if (Bot.HasInHand(CardId.TradeIn)
&& !Bot.HasInHand(CardId.WhiteDragon)
&& !Bot.HasInHand(CardId.AlternativeWhiteDragon))
{
AI.SelectCard(CardId.WhiteDragon);
return true;
}
if (AlternativeWhiteDragonSummoned)
{
return false;
}
if (Bot.HasInHand(CardId.WhiteDragon)
&& !Bot.HasInHand(CardId.AlternativeWhiteDragon)
&& Bot.HasInGraveyard(CardId.AlternativeWhiteDragon))
{
AI.SelectCard(CardId.AlternativeWhiteDragon);
return true;
}
if (Bot.HasInHand(CardId.AlternativeWhiteDragon)
&& !Bot.HasInHand(CardId.WhiteDragon)
&& Bot.HasInGraveyard(CardId.WhiteDragon))
{
AI.SelectCard(CardId.WhiteDragon);
return true;
}
return false;
}
else
{
if (Enemy.GetSpellCount() > 0)
{
AI.SelectCard(CardId.DragonSpiritOfWhite);
}
else
{
AI.SelectCard(CardId.WhiteDragon);
}
return true;
}
}
private bool AlternativeWhiteDragonSummon()
{
AlternativeWhiteDragonSummoned = true;
return true;
}
private bool WhiteStoneSummon()
{
return Bot.HasInMonstersZone(new[]
{
CardId.SageWithEyesOfBlue,
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend,
CardId.AlternativeWhiteDragon,
CardId.WhiteDragon,
CardId.DragonSpiritOfWhite
});
}
private bool GalaxyEyesCipherDragonSummon()
{
if (Duel.Turn == 1 || SoulChargeUsed)
{
return false;
}
List<ClientCard> monsters = Enemy.GetMonsters();
if (monsters.Count == 1 && !monsters[0].IsFacedown() && ((monsters[0].IsDefense() && monsters[0].GetDefensePower() >= 3000) && monsters[0].HasType(CardType.Xyz)))
{
return true;
}
if (monsters.Count >= 3)
{
foreach (ClientCard monster in monsters)
{
if (!monster.IsFacedown() && ((monster.IsDefense() && monster.GetDefensePower() >= 3000) || monster.HasType(CardType.Xyz)))
{
return true;
}
}
}
return false;
}
private bool GalaxyEyesPrimePhotonDragonSummon()
{
if (Duel.Turn == 1)
{
return false;
}
if (AI.Utils.IsOneEnemyBetterThanValue(2999, false))
{
return true;
}
return false;
}
private bool GalaxyEyesFullArmorPhotonDragonSummon()
{
if (Bot.HasInMonstersZone(CardId.GalaxyEyesCipherDragon))
{
foreach (ClientCard monster in Bot.GetMonsters())
{
if ((monster.IsDisabled() && monster.HasType(CardType.Xyz) && !monster.Equals(UsedGalaxyEyesCipherDragon))
|| (Duel.Phase == DuelPhase.Main2 && monster.Equals(UsedGalaxyEyesCipherDragon)))
{
AI.SelectCard(monster);
return true;
}
}
}
if (Bot.HasInMonstersZone(CardId.GalaxyEyesPrimePhotonDragon))
{
if (!AI.Utils.IsOneEnemyBetterThanValue(4000, false))
{
AI.SelectCard(CardId.GalaxyEyesPrimePhotonDragon);
return true;
}
}
return false;
}
private bool GalaxyEyesCipherBladeDragonSummon()
{
if (Bot.HasInMonstersZone(CardId.GalaxyEyesFullArmorPhotonDragon) && AI.Utils.GetProblematicEnemyCard() != null)
{
AI.SelectCard(CardId.GalaxyEyesFullArmorPhotonDragon);
return true;
}
return false;
}
private bool GalaxyEyesDarkMatterDragonSummon()
{
if (Bot.HasInMonstersZone(CardId.GalaxyEyesFullArmorPhotonDragon))
{
AI.SelectCard(CardId.GalaxyEyesFullArmorPhotonDragon);
return true;
}
return false;
}
private bool GalaxyEyesPrimePhotonDragonEffect()
{
return true;
}
private bool GalaxyEyesCipherDragonEffect()
{
List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (monster.HasType(CardType.Xyz))
{
AI.SelectCard(monster);
UsedGalaxyEyesCipherDragon = Card;
return true;
}
}
foreach (ClientCard monster in monsters)
{
if (monster.IsDefense())
{
AI.SelectCard(monster);
UsedGalaxyEyesCipherDragon = Card;
return true;
}
}
UsedGalaxyEyesCipherDragon = Card;
return true;
}
private bool GalaxyEyesFullArmorPhotonDragonEffect()
{
ClientCard target = AI.Utils.GetProblematicEnemySpell();
if (target != null)
{
AI.SelectCard(target);
return true;
}
target = AI.Utils.GetProblematicEnemyMonster();
if (target != null)
{
AI.SelectCard(target);
return true;
}
foreach (ClientCard spell in Enemy.GetSpells())
{
if (spell.IsFaceup())
{
AI.SelectCard(spell);
return true;
}
}
List<ClientCard> monsters = Enemy.GetMonsters();
if (monsters.Count >= 2)
{
foreach (ClientCard monster in monsters)
{
if (monster.IsDefense())
{
AI.SelectCard(monster);
return true;
}
}
return true;
}
if (monsters.Count == 2)
{
foreach (ClientCard monster in monsters)
{
if (monster.IsMonsterInvincible() || monster.IsMonsterDangerous() || monster.GetDefensePower() > 4000)
{
AI.SelectCard(monster);
return true;
}
}
}
if (monsters.Count == 1)
{
return true;
}
return false;
}
private bool GalaxyEyesCipherBladeDragonEffect()
{
if (Card.Location == CardLocation.Grave)
{
return true;
}
ClientCard target = AI.Utils.GetProblematicEnemyCard();
if (target != null)
{
AI.SelectCard(target);
return true;
}
List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (monster.IsDefense())
{
AI.SelectCard(monster);
return true;
}
}
foreach (ClientCard monster in monsters)
{
AI.SelectCard(monster);
return true;
}
List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells)
{
if (spell.IsFacedown())
{
AI.SelectCard(spell);
return true;
}
}
foreach (ClientCard spell in spells)
{
AI.SelectCard(spell);
return true;
}
return false;
}
private bool GalaxyEyesDarkMatterDragonEffect()
{
AI.SelectCard(new[]
{
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend,
CardId.DragonSpiritOfWhite,
CardId.WhiteDragon
});
AI.SelectNextCard(new[]
{
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend,
CardId.DragonSpiritOfWhite,
CardId.WhiteDragon
});
return true;
}
private bool GiganticastleSummon()
{
if (Duel.Phase != DuelPhase.Main1 || Duel.Turn == 1 || SoulChargeUsed)
return false;
int bestSelfAttack = AI.Utils.GetBestAttack(Bot);
int bestEnemyAttack = AI.Utils.GetBestPower(Enemy);
return bestSelfAttack <= bestEnemyAttack && bestEnemyAttack > 2500 && bestEnemyAttack <= 3100;
}
private bool BlueEyesSpiritDragonSummon()
{
if (Duel.Phase == DuelPhase.Main1)
{
if (UsedAlternativeWhiteDragon.Count > 0)
{
return true;
}
if (Duel.Turn == 1 || SoulChargeUsed)
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
}
if (Duel.Phase == DuelPhase.Main2)
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
return false;
}
private bool HopeHarbingerDragonTitanicGalaxySummon()
{
if (Duel.Phase == DuelPhase.Main1)
{
if (UsedAlternativeWhiteDragon.Count > 0)
{
return true;
}
if (Duel.Turn == 1 || SoulChargeUsed)
{
return true;
}
}
if (Duel.Phase == DuelPhase.Main2)
{
return true;
}
return false;
}
private bool SylvanPrincesspriteSummon()
{
if (Duel.Turn == 1)
{
return true;
}
if (Duel.Phase == DuelPhase.Main1 && !Bot.HasInMonstersZone(new[]
{
CardId.AlternativeWhiteDragon,
CardId.WhiteDragon,
CardId.DragonSpiritOfWhite
}))
{
return true;
}
if (Duel.Phase == DuelPhase.Main2 || SoulChargeUsed)
{
return true;
}
return false;
}
private bool SylvanPrincesspriteEffect()
{
AI.SelectCard(new[]
{
CardId.WhiteStoneOfLegend,
CardId.WhiteStoneOfAncients
});
return true;
}
private bool SoulChargeEffect()
{
if (Bot.HasInMonstersZone(CardId.BlueEyesSpiritDragon, true))
return false;
int count = Bot.GetGraveyardMonsters().Count;
int space = 5 - Bot.GetMonstersInMainZone().Count;
if (count < space)
count = space;
if (count < 2 || Duel.LifePoints[0] < count*1000)
return false;
if (Duel.Turn != 1)
{
int attack = 0;
int defence = 0;
foreach (ClientCard monster in Bot.GetMonsters())
{
if (!monster.IsDefense())
{
attack += monster.Attack;
}
}
foreach (ClientCard monster in Enemy.GetMonsters())
{
defence += monster.GetDefensePower();
}
if (attack - defence > Duel.LifePoints[1])
return false;
}
AI.SelectCard(new[]
{
CardId.BlueEyesSpiritDragon,
CardId.HopeHarbingerDragonTitanicGalaxy,
CardId.AlternativeWhiteDragon,
CardId.WhiteDragon,
CardId.DragonSpiritOfWhite,
CardId.AzureEyesSilverDragon,
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend
});
SoulChargeUsed = true;
return true;
}
private bool Repos()
{
bool enemyBetter = AI.Utils.IsAllEnemyBetter(true);
if (Card.IsAttack() && enemyBetter)
return true;
if (Card.IsFacedown())
return true;
if (Card.IsDefense() && !enemyBetter && Card.Attack >= Card.Defense)
return true;
if (Card.IsDefense() && (
Card.Id == CardId.BlueEyesSpiritDragon
|| Card.Id == CardId.AzureEyesSilverDragon
))
return true;
if (Card.IsAttack() && (
Card.Id == CardId.SageWithEyesOfBlue
|| Card.Id == CardId.WhiteStoneOfAncients
|| Card.Id == CardId.WhiteStoneOfLegend
))
return true;
return false;
}
private bool SpellSet()
{
return (Card.IsTrap() || (Card.Id==CardId.SilversCry)) && Bot.GetSpellCountWithoutField() < 4;
}
private bool HasTwoInHand(int id)
{
int num = 0;
foreach (ClientCard card in Bot.Hand)
{
if (card != null && card.Id == id)
num++;
}
return num >= 2;
}
private bool CanDealWithUsedAlternativeWhiteDragon()
{
return Bot.HasInMonstersZone(new[]
{
CardId.SageWithEyesOfBlue,
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend,
CardId.WhiteDragon,
CardId.DragonSpiritOfWhite
}) || Bot.GetCountCardInZone(Bot.MonsterZone, CardId.AlternativeWhiteDragon)>=2 ;
}
private bool HaveEnoughWhiteDragonInHand()
{
return HasTwoInHand(CardId.WhiteDragon) || (
Bot.HasInGraveyard(CardId.WhiteDragon)
&& Bot.HasInGraveyard(CardId.WhiteStoneOfAncients)
);
}
}
}
using WindBot.Game;
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace DevBot.Game.AI.Decks
namespace WindBot.Game.AI.Decks
{
[Deck("Burn", "AI_Burn")]
[Deck("Burn", "AI_Burn", "Easy")]
public class BurnExecutor : DefaultExecutor
{
public enum CardId
public class CardId
{
LavaGolem = 102380,
ReflectBounder = 2851070,
FencingFireFerret = 97396380,
BlastSphere = 26302522,
Marshmallon = 31305911,
SpiritReaper = 23205979,
NaturiaBeans = 44789585,
Ookazi = 19523799,
GoblinThief = 45311864,
TremendousFire = 46918794,
SwordsOfRevealingLight = 72302403,
SupremacyBerry = 98380593,
PoisonOfTheOldMan = 8842266,
MagicCylinder = 62279055,
MinorGoblinOfficial = 1918087,
ChainBurst = 48276469,
SkullInvitation = 98139712
public const int LavaGolem = 102380;
public const int ReflectBounder = 2851070;
public const int FencingFireFerret = 97396380;
public const int BlastSphere = 26302522;
public const int Marshmallon = 31305911;
public const int SpiritReaper = 23205979;
public const int NaturiaBeans = 44789585;
public const int ThunderShort = 20264508;
public const int Ookazi = 19523799;
public const int GoblinThief = 45311864;
public const int TremendousFire = 46918794;
public const int SwordsOfRevealingLight = 72302403;
public const int SupremacyBerry = 98380593;
public const int ChainEnergy = 79323590;
public const int DarkRoomofNightmare = 85562745;
public const int PoisonOfTheOldMan = 8842266;
public const int OjamaTrio = 29843091;
public const int Ceasefire = 36468556;
public const int MagicCylinder = 62279055;
public const int MinorGoblinOfficial = 1918087;
public const int ChainBurst = 48276469;
public const int SkullInvitation = 98139712;
}
public BurnExecutor(GameAI ai, Duel duel)
......@@ -34,40 +42,49 @@ namespace DevBot.Game.AI.Decks
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
// Activate Spells
AddExecutor(ExecutorType.Activate, (int)CardId.Ookazi);
AddExecutor(ExecutorType.Activate, (int)CardId.GoblinThief);
AddExecutor(ExecutorType.Activate, (int)CardId.TremendousFire);
AddExecutor(ExecutorType.Activate, (int)CardId.SwordsOfRevealingLight, SwordsOfRevealingLight);
AddExecutor(ExecutorType.Activate, (int)CardId.SupremacyBerry, SupremacyBerry);
AddExecutor(ExecutorType.Activate, (int)CardId.PoisonOfTheOldMan, PoisonOfTheOldMan);
// Set an invincible monster
AddExecutor(ExecutorType.MonsterSet, (int)CardId.Marshmallon, SetInvincibleMonster);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.SpiritReaper, SetInvincibleMonster);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.NaturiaBeans, SetInvincibleMonster);
AddExecutor(ExecutorType.Activate, CardId.DarkRoomofNightmare);
AddExecutor(ExecutorType.Activate, CardId.Ookazi);
AddExecutor(ExecutorType.Activate, CardId.GoblinThief);
AddExecutor(ExecutorType.Activate, CardId.TremendousFire);
AddExecutor(ExecutorType.Activate, CardId.SwordsOfRevealingLight, SwordsOfRevealingLight);
AddExecutor(ExecutorType.Activate, CardId.SupremacyBerry, SupremacyBerry);
AddExecutor(ExecutorType.Activate, CardId.PoisonOfTheOldMan, PoisonOfTheOldMan);
AddExecutor(ExecutorType.Activate, CardId.ThunderShort, ThunderShort);
// Hello, my name is Lava Golem
AddExecutor(ExecutorType.SpSummon, (int)CardId.LavaGolem, LavaGolem);
AddExecutor(ExecutorType.SpSummon, CardId.LavaGolem, LavaGolem);
// Set an invincible monster
AddExecutor(ExecutorType.MonsterSet, CardId.Marshmallon, SetInvincibleMonster);
AddExecutor(ExecutorType.MonsterSet, CardId.SpiritReaper, SetInvincibleMonster);
AddExecutor(ExecutorType.MonsterSet, CardId.BlastSphere);
// Set other monsters
AddExecutor(ExecutorType.Summon, (int)CardId.ReflectBounder);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.FencingFireFerret);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.BlastSphere);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.NaturiaBeans);
AddExecutor(ExecutorType.SummonOrSet, CardId.FencingFireFerret);
AddExecutor(ExecutorType.Summon, CardId.ReflectBounder);
AddExecutor(ExecutorType.MonsterSet, CardId.NaturiaBeans);
// We're a coward
AddExecutor(ExecutorType.Repos, ReposEverything);
// Chain traps
AddExecutor(ExecutorType.Activate, (int)CardId.MagicCylinder, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.MinorGoblinOfficial);
AddExecutor(ExecutorType.Activate, (int)CardId.ChainBurst);
AddExecutor(ExecutorType.Activate, (int)CardId.SkullInvitation);
AddExecutor(ExecutorType.Activate, CardId.MagicCylinder, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.Ceasefire, Ceasefire);
AddExecutor(ExecutorType.Activate, CardId.OjamaTrio);
AddExecutor(ExecutorType.Activate, CardId.MinorGoblinOfficial);
AddExecutor(ExecutorType.Activate, CardId.ChainBurst);
AddExecutor(ExecutorType.Activate, CardId.SkullInvitation);
AddExecutor(ExecutorType.Activate, CardId.ChainEnergy);
}
public override bool OnSelectHand()
{
return true;
}
private bool SwordsOfRevealingLight()
{
int count = Duel.Fields[0].SpellZone.GetCardCount((int)CardId.SwordsOfRevealingLight);
int count = Bot.SpellZone.GetCardCount(CardId.SwordsOfRevealingLight);
return count == 0;
}
......@@ -82,13 +99,16 @@ namespace DevBot.Game.AI.Decks
return true;
}
private bool ThunderShort()
{
return Enemy.GetMonsterCount() >= 3;
}
private bool SetInvincibleMonster()
{
foreach (ClientCard card in Duel.Fields[0].GetMonsters())
foreach (ClientCard card in Bot.GetMonsters())
{
if (card.Id == (int)CardId.Marshmallon ||
card.Id == (int)CardId.SpiritReaper ||
(card.Id == (int)CardId.NaturiaBeans && Card.Id == (int)CardId.NaturiaBeans))
if (card.Id == CardId.Marshmallon || card.Id == CardId.SpiritReaper)
{
return false;
}
......@@ -99,22 +119,24 @@ namespace DevBot.Game.AI.Decks
private bool LavaGolem()
{
bool found = false;
foreach (ClientCard card in Duel.Fields[0].GetMonsters())
foreach (ClientCard card in Enemy.GetMonsters())
{
if (card.Id == (int)CardId.Marshmallon ||
card.Id == (int)CardId.SpiritReaper)
if (card.Attack > 2000)
found = true;
}
if (!found && Duel.LifePoints[1] > 1000)
return false;
return true;
return found;
}
private bool Ceasefire()
{
return Bot.GetMonsterCount() + Enemy.GetMonsterCount() >= 3;
}
private bool ReposEverything()
{
if (Card.Id == (int)CardId.ReflectBounder)
if (Card.Id == CardId.ReflectBounder)
return Card.IsDefense();
if (Card.Id == (int)CardId.FencingFireFerret)
if (Card.Id == CardId.FencingFireFerret)
return DefaultMonsterRepos();
if (Card.IsAttack())
return true;
......
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
// NOT FINISHED YET
[Deck("CyberDragon", "AI_CyberDragon", "NotFinished")]
public class CyberDragonExecutor : DefaultExecutor
{
bool PowerBondUsed = false;
public class CardId
{
public const int CyberLaserDragon = 4162088;
public const int CyberBarrierDragon = 68774379;
public const int CyberDragon = 70095154;
public const int CyberDragonDrei = 59281922;
public const int CyberPhoenix = 3370104;
public const int ArmoredCybern = 67159705;
public const int ProtoCyberDragon = 26439287;
public const int CyberKirin = 76986005;
public const int CyberDragonCore = 23893227;
public const int CyberValley = 3657444;
public const int Raigeki = 12580477;
public const int DarkHole = 53129443;
public const int DifferentDimensionCapsule = 11961740;
public const int Polymerization = 24094653;
public const int PowerBond = 37630732;
public const int EvolutionBurst = 52875873;
public const int PhotonGeneratorUnit = 66607691;
public const int DeFusion = 95286165;
public const int BottomlessTrapHole = 29401950;
public const int MirrorForce = 44095762;
public const int AttackReflectorUnit = 91989718;
public const int CyberneticHiddenTechnology = 92773018;
public const int CallOfTheHaunted = 97077563;
public const int SevenToolsOfTheBandit = 3819470;
public const int CyberTwinDragon = 74157028;
public const int CyberEndDragon = 1546123;
public const int CyberDragonNova = 58069384;
}
public CyberDragonExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.SpellSet, CardId.DeFusion);
AddExecutor(ExecutorType.Activate, CardId.DifferentDimensionCapsule, Capsule);
AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, CardId.Polymerization, PolymerizationEffect);
AddExecutor(ExecutorType.Activate, CardId.PowerBond, PowerBondEffect);
AddExecutor(ExecutorType.Activate, CardId.EvolutionBurst, EvolutionBurstEffect);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.PhotonGeneratorUnit);
AddExecutor(ExecutorType.Activate, CardId.DeFusion, DeFusionEffect);
AddExecutor(ExecutorType.Activate, CardId.BottomlessTrapHole, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.AttackReflectorUnit);
AddExecutor(ExecutorType.Activate, CardId.SevenToolsOfTheBandit, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.CallOfTheHaunted, DefaultCallOfTheHaunted);
AddExecutor(ExecutorType.SummonOrSet, CardId.CyberDragonDrei, NoCyberDragonSpsummon);
AddExecutor(ExecutorType.SummonOrSet, CardId.CyberPhoenix, NoCyberDragonSpsummon);
AddExecutor(ExecutorType.Summon, CardId.CyberValley, NoCyberDragonSpsummon);
AddExecutor(ExecutorType.MonsterSet, CardId.CyberDragonCore, NoCyberDragonSpsummon);
AddExecutor(ExecutorType.MonsterSet, CardId.ArmoredCybern, ArmoredCybernSet);
AddExecutor(ExecutorType.SummonOrSet, CardId.ProtoCyberDragon, ProtoCyberDragonSummon);
AddExecutor(ExecutorType.Summon, CardId.CyberKirin, CyberKirinSummon);
AddExecutor(ExecutorType.SpSummon, CardId.CyberDragon);
AddExecutor(ExecutorType.SpSummon, CardId.CyberEndDragon);
AddExecutor(ExecutorType.SpSummon, CardId.CyberTwinDragon);
AddExecutor(ExecutorType.SpSummon, CardId.CyberBarrierDragon);
AddExecutor(ExecutorType.SpSummon, CardId.CyberLaserDragon);
AddExecutor(ExecutorType.Activate, CardId.CyberBarrierDragon);
AddExecutor(ExecutorType.Activate, CardId.CyberLaserDragon);
AddExecutor(ExecutorType.Activate, CardId.CyberDragonDrei);
AddExecutor(ExecutorType.Activate, CardId.CyberPhoenix);
AddExecutor(ExecutorType.Activate, CardId.CyberKirin);
AddExecutor(ExecutorType.Activate, CardId.ArmoredCybern, ArmoredCybernEffect);
AddExecutor(ExecutorType.Activate, CardId.CyberValley);
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
private bool CyberDragonInHand() { return Bot.HasInHand(CardId.CyberDragon); }
private bool CyberDragonInGraveyard() { return Bot.HasInGraveyard(CardId.CyberDragon); }
private bool CyberDragonInMonsterZone() { return Bot.HasInMonstersZone(CardId.CyberDragon); }
private bool CyberDragonIsBanished() { return Bot.HasInBanished(CardId.CyberDragon); }
private bool Capsule()
{
IList<int> SelectedCard = new List<int>();
SelectedCard.Add(CardId.PowerBond);
SelectedCard.Add(CardId.DarkHole);
SelectedCard.Add(CardId.Raigeki);
AI.SelectCard(SelectedCard);
return true;
}
private bool PolymerizationEffect()
{
if (Bot.GetCountCardInZone(Bot.MonsterZone, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, CardId.ProtoCyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, CardId.CyberDragonDrei) + Bot.GetCountCardInZone(Bot.MonsterZone, CardId.CyberDragonDrei) + Bot.GetCountCardInZone(Bot.Hand, CardId.CyberDragon) >= 3)
AI.SelectCard(CardId.CyberEndDragon);
else
AI.SelectCard(CardId.CyberTwinDragon);
return true;
}
private bool PowerBondEffect()
{
PowerBondUsed = true;
if (Bot.GetCountCardInZone(Bot.MonsterZone, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, CardId.ProtoCyberDragon) + Bot.GetCountCardInZone(Bot.Hand, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.Graveyard, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.Hand, CardId.CyberDragonCore) + Bot.GetCountCardInZone(Bot.Graveyard, CardId.CyberDragonCore) + Bot.GetCountCardInZone(Bot.Graveyard, CardId.CyberDragonDrei) + Bot.GetCountCardInZone(Bot.MonsterZone, CardId.CyberDragonDrei) >= 3)
AI.SelectCard(CardId.CyberEndDragon);
else
AI.SelectCard(CardId.CyberTwinDragon);
return true;
}
private bool EvolutionBurstEffect()
{
ClientCard bestMy = Bot.GetMonsters().GetHighestAttackMonster();
if (bestMy == null || !AI.Utils.IsOneEnemyBetterThanValue(bestMy.Attack, false))
return false;
else
AI.SelectCard(Enemy.MonsterZone.GetHighestAttackMonster());
return true;
}
private bool NoCyberDragonSpsummon()
{
if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Enemy.GetMonsterCount() != 0))
return false;
return true;
}
private bool ArmoredCybernSet()
{
if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Enemy.GetMonsterCount() != 0) || (Bot.HasInHand(CardId.CyberDragonDrei) || Bot.HasInHand(CardId.CyberPhoenix)) && !AI.Utils.IsOneEnemyBetterThanValue(1800,true))
return false;
return true;
}
private bool ProtoCyberDragonSummon()
{
if (Bot.GetCountCardInZone(Bot.Hand, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, CardId.CyberDragonCore) >= 1 && Bot.HasInHand(CardId.Polymerization) || Bot.GetCountCardInZone(Bot.Hand, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.MonsterZone, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.Graveyard, CardId.CyberDragon) + Bot.GetCountCardInZone(Bot.Graveyard, CardId.CyberDragonCore) >= 1 && Bot.HasInHand(CardId.PowerBond))
return true;
if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Enemy.GetMonsterCount() != 0) || (Bot.HasInHand(CardId.CyberDragonDrei) || Bot.HasInHand(CardId.CyberPhoenix)) && !AI.Utils.IsOneEnemyBetterThanValue(1800, true))
return false;
return true;
}
private bool CyberKirinSummon()
{
return PowerBondUsed;
}
private bool ArmoredCybernEffect()
{
if (Card.Location == CardLocation.Hand)
return true;
else if (Card.Location == CardLocation.SpellZone)
{
if (AI.Utils.IsOneEnemyBetterThanValue(Bot.GetMonsters().GetHighestAttackMonster().Attack, true))
if (ActivateDescription == AI.Utils.GetStringId(CardId.ArmoredCybern, 2))
return true;
return false;
}
return false;
}
private bool DeFusionEffect()
{
if (Duel.Phase == DuelPhase.Battle)
{
if (!Bot.HasAttackingMonster())
return true;
}
return false;
}
}
}
\ No newline at end of file
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Test", "AI_Test", "Test")]
public class DoEverythingExecutor : DefaultExecutor
{
public class CardId
{
public const int LeoWizard = 4392470;
public const int Bunilla = 69380702;
}
public DoEverythingExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.SpSummon);
AddExecutor(ExecutorType.Activate, DefaultDontChainMyself);
AddExecutor(ExecutorType.SummonOrSet);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.SpellSet);
}
public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, bool cancelable)
{
if (Duel.Phase == DuelPhase.BattleStart)
return null;
IList<ClientCard> selected = new List<ClientCard>();
// select the last cards
for (int i = 1; i <= max; ++i)
selected.Add(cards[cards.Count-i]);
return selected;
}
public override int OnSelectOption(IList<int> options)
{
return Program.Rand.Next(options.Count);
}
}
}
\ No newline at end of file
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
using YGOSharp.OCGWrapper.Enums;
namespace DevBot.Game.AI.Decks
namespace WindBot.Game.AI.Decks
{
[Deck("Dragunity", "AI_Dragunity")]
public class DragunityExecutor : DefaultExecutor
{
public enum CardId
public class CardId
{
StardustDragonAssaultMode = 61257789,
DragunityArmaMysletainn = 876330,
AssaultBeast = 3431737,
DragunityDux = 28183605,
DragunityPhalanx = 59755122,
AssaultTeleport = 29863101,
CardsOfConsonance = 39701395,
UpstartGoblin = 70368879,
DragonsMirror = 71490127,
Terraforming = 73628505,
FoolishBurial = 81439173,
MonsterReborn = 83764718,
MysticalSpaceTyphoon = 5318639,
FireFormationTenki = 57103969,
DragunitySpearOfDestiny = 60004971,
DragonRavine = 62265044,
MirrorForce = 44095762,
StarlightRoad = 58120309,
DimensionalPrison = 70342110,
AssaultModeActivate = 80280737,
FiveHeadedDragon = 99267150,
ScrapDragon = 76774528,
StardustDragon = 44508094,
DragunityKnightGaeDearg = 34116027,
DragunityKnightVajrayana = 21249921
public const int StardustDragonAssaultMode = 61257789;
public const int DragunityArmaMysletainn = 876330;
public const int AssaultBeast = 3431737;
public const int DragunityDux = 28183605;
public const int DragunityPhalanx = 59755122;
public const int AssaultTeleport = 29863101;
public const int CardsOfConsonance = 39701395;
public const int UpstartGoblin = 70368879;
public const int DragonsMirror = 71490127;
public const int Terraforming = 73628505;
public const int FoolishBurial = 81439173;
public const int MonsterReborn = 83764718;
public const int MysticalSpaceTyphoon = 5318639;
public const int FireFormationTenki = 57103969;
public const int DragunitySpearOfDestiny = 60004971;
public const int DragonRavine = 62265044;
public const int MirrorForce = 44095762;
public const int StarlightRoad = 58120309;
public const int DimensionalPrison = 70342110;
public const int AssaultModeActivate = 80280737;
public const int FiveHeadedDragon = 99267150;
public const int CrystalWingSynchroDragon = 50954680;
public const int ScrapDragon = 76774528;
public const int StardustDragon = 44508094;
public const int DragunityKnightGaeDearg = 34116027;
public const int DragunityKnightVajrayana = 21249921;
}
public DragunityExecutor(GameAI ai, Duel duel)
......@@ -44,58 +46,62 @@ namespace DevBot.Game.AI.Decks
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
// Execute spells
AddExecutor(ExecutorType.Activate, (int)CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, (int)CardId.AssaultTeleport);
AddExecutor(ExecutorType.Activate, (int)CardId.UpstartGoblin);
AddExecutor(ExecutorType.Activate, (int)CardId.DragonRavine, DragonRavineField);
AddExecutor(ExecutorType.Activate, (int)CardId.Terraforming, Terraforming);
AddExecutor(ExecutorType.Activate, (int)CardId.FoolishBurial, FoolishBurial);
AddExecutor(ExecutorType.Activate, (int)CardId.MonsterReborn, MonsterReborn);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.AssaultTeleport);
AddExecutor(ExecutorType.Activate, CardId.UpstartGoblin);
AddExecutor(ExecutorType.Activate, CardId.DragonRavine, DragonRavineField);
AddExecutor(ExecutorType.Activate, CardId.Terraforming, Terraforming);
AddExecutor(ExecutorType.Activate, CardId.FoolishBurial, FoolishBurial);
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, MonsterReborn);
// Execute monsters
AddExecutor(ExecutorType.Activate, (int)CardId.ScrapDragon, ScrapDragonEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.DragunityPhalanx);
AddExecutor(ExecutorType.Activate, (int)CardId.DragunityKnightVajrayana);
AddExecutor(ExecutorType.Activate, (int)CardId.DragunityArmaMysletainn);
AddExecutor(ExecutorType.Activate, (int)CardId.DragunityDux);
AddExecutor(ExecutorType.Activate, CardId.ScrapDragon, ScrapDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.CrystalWingSynchroDragon, CrystalWingSynchroDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.DragunityPhalanx);
AddExecutor(ExecutorType.Activate, CardId.DragunityKnightVajrayana);
AddExecutor(ExecutorType.Activate, CardId.DragunityArmaMysletainn, DragunityArmaMysletainnEffect);
AddExecutor(ExecutorType.Activate, CardId.DragunityDux);
// Summon
AddExecutor(ExecutorType.Activate, (int)CardId.DragonsMirror, DragonsMirror);
AddExecutor(ExecutorType.SpSummon, (int)CardId.ScrapDragon, ScrapDragonSummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.StardustDragon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.DragunityKnightVajrayana);
AddExecutor(ExecutorType.SpSummon, (int)CardId.DragunityKnightGaeDearg);
AddExecutor(ExecutorType.Summon, (int)CardId.DragunityPhalanx, DragunityPhalanxSummon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.DragunityArmaMysletainn, DragunityArmaMysletainn);
AddExecutor(ExecutorType.Summon, (int)CardId.DragunityArmaMysletainn, DragunityArmaMysletainnTribute);
AddExecutor(ExecutorType.Activate, CardId.DragonsMirror, DragonsMirror);
AddExecutor(ExecutorType.SpSummon, CardId.ScrapDragon, ScrapDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.CrystalWingSynchroDragon, CrystalWingSynchroDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.StardustDragon);
AddExecutor(ExecutorType.SpSummon, CardId.DragunityKnightVajrayana);
AddExecutor(ExecutorType.SpSummon, CardId.DragunityKnightGaeDearg);
AddExecutor(ExecutorType.Summon, CardId.DragunityPhalanx, DragunityPhalanxSummon);
AddExecutor(ExecutorType.SpSummon, CardId.DragunityArmaMysletainn, DragunityArmaMysletainn);
AddExecutor(ExecutorType.Summon, CardId.DragunityArmaMysletainn, DragunityArmaMysletainnTribute);
// Use draw effects if we can't do anything else
AddExecutor(ExecutorType.Activate, (int)CardId.CardsOfConsonance);
AddExecutor(ExecutorType.Activate, (int)CardId.DragonRavine, DragonRavineEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.FireFormationTenki, FireFormationTenki);
AddExecutor(ExecutorType.Activate, (int)CardId.DragunitySpearOfDestiny);
AddExecutor(ExecutorType.Activate, CardId.CardsOfConsonance);
AddExecutor(ExecutorType.Activate, CardId.DragonRavine, DragonRavineEffect);
AddExecutor(ExecutorType.Activate, CardId.FireFormationTenki, FireFormationTenki);
AddExecutor(ExecutorType.Activate, CardId.DragunitySpearOfDestiny);
// Summon
AddExecutor(ExecutorType.Summon, (int)CardId.DragunityDux, DragunityDux);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.DragunityPhalanx, DragunityPhalanxSet);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.AssaultBeast);
AddExecutor(ExecutorType.Summon, CardId.DragunityDux, DragunityDux);
AddExecutor(ExecutorType.MonsterSet, CardId.DragunityPhalanx, DragunityPhalanxSet);
AddExecutor(ExecutorType.SummonOrSet, CardId.AssaultBeast);
// Draw assault mode if we don't have one
AddExecutor(ExecutorType.Activate, (int)CardId.AssaultBeast, AssaultBeast);
AddExecutor(ExecutorType.Activate, CardId.AssaultBeast, AssaultBeast);
// Set useless cards
AddExecutor(ExecutorType.SpellSet, (int)CardId.DragonsMirror, SetUselessCards);
AddExecutor(ExecutorType.SpellSet, (int)CardId.Terraforming, SetUselessCards);
AddExecutor(ExecutorType.SpellSet, (int)CardId.AssaultTeleport, SetUselessCards);
AddExecutor(ExecutorType.SpellSet, (int)CardId.CardsOfConsonance, SetUselessCards);
AddExecutor(ExecutorType.SpellSet, CardId.DragonsMirror, SetUselessCards);
AddExecutor(ExecutorType.SpellSet, CardId.Terraforming, SetUselessCards);
AddExecutor(ExecutorType.SpellSet, CardId.AssaultTeleport, SetUselessCards);
AddExecutor(ExecutorType.SpellSet, CardId.CardsOfConsonance, SetUselessCards);
// Chain traps and monsters
AddExecutor(ExecutorType.Activate, (int)CardId.StardustDragonAssaultMode, StardustDragon);
AddExecutor(ExecutorType.Activate, (int)CardId.StardustDragon, StardustDragon);
AddExecutor(ExecutorType.Activate, (int)CardId.StarlightRoad, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.MirrorForce, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.DimensionalPrison, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.AssaultModeActivate);
AddExecutor(ExecutorType.Activate, CardId.StardustDragonAssaultMode, DefaultStardustDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.StardustDragon, DefaultStardustDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.StarlightRoad, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.DimensionalPrison, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.AssaultModeActivate, AssaultModeActivate);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
private bool DragonRavineField()
......@@ -110,64 +116,62 @@ namespace DevBot.Game.AI.Decks
if (Card.Location != CardLocation.SpellZone)
return false;
ClientField field = Duel.Fields[0];
int tributeId = -1;
if (field.HasInHand((int)CardId.DragunityPhalanx))
tributeId = (int)CardId.DragunityPhalanx;
else if (field.HasInHand((int)CardId.FireFormationTenki))
tributeId = (int)CardId.FireFormationTenki;
else if (field.HasInHand((int)CardId.Terraforming))
tributeId = (int)CardId.Terraforming;
else if (field.HasInHand((int)CardId.DragonRavine))
tributeId = (int)CardId.DragonRavine;
else if (field.HasInHand((int)CardId.AssaultTeleport))
tributeId = (int)CardId.AssaultTeleport;
else if (field.HasInHand((int)CardId.AssaultBeast))
tributeId = (int)CardId.AssaultBeast;
else if (field.HasInHand((int) CardId.DragunityArmaMysletainn))
tributeId = (int)CardId.DragunityArmaMysletainn;
if (Bot.HasInHand(CardId.DragunityPhalanx))
tributeId = CardId.DragunityPhalanx;
else if (Bot.HasInHand(CardId.FireFormationTenki))
tributeId = CardId.FireFormationTenki;
else if (Bot.HasInHand(CardId.Terraforming))
tributeId = CardId.Terraforming;
else if (Bot.HasInHand(CardId.DragonRavine))
tributeId = CardId.DragonRavine;
else if (Bot.HasInHand(CardId.AssaultTeleport))
tributeId = CardId.AssaultTeleport;
else if (Bot.HasInHand(CardId.AssaultBeast))
tributeId = CardId.AssaultBeast;
else if (Bot.HasInHand((int) CardId.DragunityArmaMysletainn))
tributeId = CardId.DragunityArmaMysletainn;
else
{
int count = 0;
foreach (ClientCard card in Duel.Fields[0].Hand)
foreach (ClientCard card in Bot.Hand)
{
if (card.Id == (int)CardId.DragunityDux)
if (card.Id == CardId.DragunityDux)
++count;
}
if (count >= 2)
tributeId = (int)CardId.DragunityDux;
tributeId = CardId.DragunityDux;
}
if (tributeId == -1 && field.HasInHand((int)CardId.StardustDragonAssaultMode))
tributeId = (int)CardId.StardustDragonAssaultMode;
if (tributeId == -1 && field.HasInHand((int)CardId.DragunitySpearOfDestiny))
tributeId = (int)CardId.StardustDragonAssaultMode;
if (tributeId == -1 && field.HasInHand((int)CardId.DragonsMirror)
&& Duel.Fields[0].GetMonsterCount() == 0)
tributeId = (int)CardId.StardustDragonAssaultMode;
if (tributeId == -1 && Bot.HasInHand(CardId.StardustDragonAssaultMode))
tributeId = CardId.StardustDragonAssaultMode;
if (tributeId == -1 && Bot.HasInHand(CardId.DragunitySpearOfDestiny))
tributeId = CardId.StardustDragonAssaultMode;
if (tributeId == -1 && Bot.HasInHand(CardId.DragonsMirror)
&& Bot.GetMonsterCount() == 0)
tributeId = CardId.StardustDragonAssaultMode;
if (tributeId == -1)
return false;
int needId = -1;
if (!field.HasInMonstersZone((int)CardId.DragunityPhalanx) &&
!field.HasInGraveyard((int)CardId.DragunityPhalanx))
needId = (int)CardId.DragunityPhalanx;
else if (field.GetMonsterCount() == 0)
needId = (int)CardId.DragunityDux;
if (!Bot.HasInMonstersZone(CardId.DragunityPhalanx) &&
!Bot.HasInGraveyard(CardId.DragunityPhalanx))
needId = CardId.DragunityPhalanx;
else if (Bot.GetMonsterCount() == 0)
needId = CardId.DragunityDux;
else
{
bool hasRealMonster = false;
foreach (ClientCard card in field.GetMonsters())
/*bool hasRealMonster = false;
foreach (ClientCard card in Bot.GetMonsters())
{
if (card.Id != (int)CardId.AssaultBeast)
if (card.Id != CardId.AssaultBeast)
{
hasRealMonster = true;
break;
}
}
if (!hasRealMonster || GetProblematicCard() != null)
needId = (int)CardId.DragunityDux;
if (!hasRealMonster || AI.Utils.GetProblematicCard() != null)*/
needId = CardId.DragunityDux;
}
if (needId == -1)
......@@ -175,28 +179,28 @@ namespace DevBot.Game.AI.Decks
int option;
if (tributeId == (int)CardId.DragunityPhalanx)
needId = (int)CardId.DragunityDux;
if (tributeId == CardId.DragunityPhalanx)
needId = CardId.DragunityDux;
int remaining = 3;
foreach (ClientCard card in Duel.Fields[0].Hand)
foreach (ClientCard card in Bot.Hand)
if (card.Id == needId)
remaining--;
foreach (ClientCard card in Duel.Fields[0].Graveyard)
foreach (ClientCard card in Bot.Graveyard)
if (card.Id == needId)
remaining--;
foreach (ClientCard card in Duel.Fields[0].Banished)
foreach (ClientCard card in Bot.Banished)
if (card.Id == needId)
remaining--;
if (remaining <= 0)
return false;
if (needId == (int)CardId.DragunityPhalanx)
if (needId == CardId.DragunityPhalanx)
option = 2;
else
option = 1;
if (ActivateDescription != (int)CardId.DragonRavine*16 + option)
if (ActivateDescription != AI.Utils.GetStringId(CardId.DragonRavine, option))
return false;
AI.SelectCard(tributeId);
......@@ -207,57 +211,50 @@ namespace DevBot.Game.AI.Decks
private bool Terraforming()
{
if (Duel.Fields[0].HasInHand((int)CardId.DragonRavine))
if (Bot.HasInHand(CardId.DragonRavine))
return false;
if (Duel.Fields[0].SpellZone[5] != null)
if (Bot.SpellZone[5] != null)
return false;
return true;
}
private bool SetUselessCards()
{
ClientField field = Duel.Fields[0];
ClientField field = Bot;
if (field.HasInSpellZone((int)CardId.FireFormationTenki))
if (field.HasInSpellZone(CardId.FireFormationTenki))
return false;
if (field.HasInSpellZone((int)CardId.AssaultTeleport))
if (field.HasInSpellZone(CardId.AssaultTeleport))
return false;
if (field.HasInSpellZone((int)CardId.CardsOfConsonance))
if (field.HasInSpellZone(CardId.CardsOfConsonance))
return false;
if (field.HasInSpellZone((int)CardId.DragonsMirror))
if (field.HasInSpellZone(CardId.DragonsMirror))
return false;
return Duel.Fields[0].GetSpellCountWithoutField() < 4;
return Bot.GetSpellCountWithoutField() < 4;
}
private bool FireFormationTenki()
{
if (Card.Location == CardLocation.Hand)
return Duel.Fields[0].GetSpellCountWithoutField() < 4;
return Bot.GetSpellCountWithoutField() < 4;
return true;
}
private bool FoolishBurial()
{
if (Duel.Fields[0].HasInGraveyard((int)CardId.DragunityPhalanx))
return false;
if (Duel.Fields[0].HasInHand((int)CardId.DragunityPhalanx))
return false;
int remaining = 3;
foreach (ClientCard card in Duel.Fields[0].Banished)
if (card.Id == (int)CardId.DragunityPhalanx)
remaining--;
if (remaining > 0)
AI.SelectCard(new[]
{
AI.SelectCard((int)CardId.DragunityPhalanx);
return true;
}
return false;
CardId.DragunityPhalanx,
CardId.AssaultBeast,
CardId.StardustDragonAssaultMode
});
return true;
}
private bool MonsterReborn()
{
List<ClientCard> cards = new List<ClientCard>(Duel.Fields[0].Graveyard);
List<ClientCard> cards = new List<ClientCard>(Bot.Graveyard);
cards.Sort(AIFunctions.CompareCardAttack);
ClientCard selectedCard = null;
for (int i = cards.Count - 1; i >= 0; --i)
......@@ -274,7 +271,7 @@ namespace DevBot.Game.AI.Decks
break;
}
}
cards = new List<ClientCard>(Duel.Fields[1].Graveyard);
cards = new List<ClientCard>(Enemy.Graveyard);
cards.Sort(AIFunctions.CompareCardAttack);
for (int i = cards.Count - 1; i >= 0; --i)
{
......@@ -299,7 +296,7 @@ namespace DevBot.Game.AI.Decks
{
IList<ClientCard> tributes = new List<ClientCard>();
int phalanxCount = 0;
foreach (ClientCard card in Duel.Fields[0].Graveyard)
foreach (ClientCard card in Bot.Graveyard)
{
if (card.Id == (int) CardId.DragunityPhalanx)
{
......@@ -316,7 +313,7 @@ namespace DevBot.Game.AI.Decks
// if we have more than one in the graveyard.
if (tributes.Count < 5 && phalanxCount > 1)
{
foreach (ClientCard card in Duel.Fields[0].Graveyard)
foreach (ClientCard card in Bot.Graveyard)
{
if (card.Id == (int) CardId.DragunityPhalanx)
{
......@@ -331,44 +328,42 @@ namespace DevBot.Game.AI.Decks
if (tributes.Count < 5)
return false;
AI.SelectCard((int)CardId.FiveHeadedDragon);
AI.SelectCard(CardId.FiveHeadedDragon);
AI.SelectNextCard(tributes);
return true;
}
private bool ScrapDragonSummon()
{
if (AI.Utils.IsOneEnnemyBetterThanValue(2500, true))
return true;
ClientCard invincible = GetProblematicCard();
//if (AI.Utils.IsOneEnemyBetterThanValue(2500, true))
// return true;
ClientCard invincible = AI.Utils.GetProblematicEnemyCard(3000);
return invincible != null;
}
private bool ScrapDragonEffect()
{
ClientCard invincible = GetProblematicCard();
if (invincible == null && !AI.Utils.IsOneEnnemyBetterThanValue(2800 - 1, false))
ClientCard invincible = AI.Utils.GetProblematicEnemyCard(3000);
if (invincible == null && !AI.Utils.IsOneEnemyBetterThanValue(2800 - 1, false))
return false;
ClientField field = Duel.Fields[0];
int tributeId = -1;
if (field.HasInSpellZone((int)CardId.FireFormationTenki))
tributeId = (int)CardId.FireFormationTenki;
else if (field.HasInSpellZone((int)CardId.Terraforming))
tributeId = (int)CardId.Terraforming;
else if (field.HasInSpellZone((int)CardId.DragonsMirror))
tributeId = (int)CardId.DragonsMirror;
else if (field.HasInSpellZone((int)CardId.CardsOfConsonance))
tributeId = (int)CardId.CardsOfConsonance;
else if (field.HasInSpellZone((int)CardId.AssaultTeleport))
tributeId = (int)CardId.AssaultTeleport;
else if (field.HasInSpellZone((int)CardId.AssaultModeActivate))
tributeId = (int)CardId.AssaultModeActivate;
else if (field.HasInSpellZone((int)CardId.DragonRavine))
tributeId = (int)CardId.DragonRavine;
List<ClientCard> monsters = Duel.Fields[1].GetMonsters();
if (Bot.HasInSpellZone(CardId.FireFormationTenki))
tributeId = CardId.FireFormationTenki;
else if (Bot.HasInSpellZone(CardId.Terraforming))
tributeId = CardId.Terraforming;
else if (Bot.HasInSpellZone(CardId.DragonsMirror))
tributeId = CardId.DragonsMirror;
else if (Bot.HasInSpellZone(CardId.CardsOfConsonance))
tributeId = CardId.CardsOfConsonance;
else if (Bot.HasInSpellZone(CardId.AssaultTeleport))
tributeId = CardId.AssaultTeleport;
else if (Bot.HasInSpellZone(CardId.AssaultModeActivate))
tributeId = CardId.AssaultModeActivate;
else if (Bot.HasInSpellZone(CardId.DragonRavine))
tributeId = CardId.DragonRavine;
List<ClientCard> monsters = Enemy.GetMonsters();
monsters.Sort(AIFunctions.CompareCardAttack);
ClientCard destroyCard = invincible;
......@@ -395,66 +390,88 @@ namespace DevBot.Game.AI.Decks
return true;
}
private bool CrystalWingSynchroDragonSummon()
{
return !Bot.HasInHand(CardId.AssaultModeActivate)
&& !Bot.HasInHand(CardId.AssaultBeast)
&& !Bot.HasInSpellZone(CardId.AssaultModeActivate);
}
private bool CrystalWingSynchroDragonEffect()
{
return LastChainPlayer != 0;
}
private bool DragunityPhalanxSummon()
{
return Duel.Fields[0].HasInHand((int)CardId.DragunityArmaMysletainn);
return Bot.HasInHand(CardId.DragunityArmaMysletainn);
}
private bool DragunityArmaMysletainn()
{
if (Duel.Fields[0].HasInMonstersZone((int)CardId.DragunityPhalanx))
if (Bot.HasInMonstersZone(CardId.DragunityPhalanx))
{
AI.SelectCard((int)CardId.DragunityPhalanx);
AI.SelectCard(CardId.DragunityPhalanx);
return true;
}
if (Duel.Fields[0].HasInMonstersZone((int)CardId.DragunityDux))
if (Bot.HasInMonstersZone(CardId.DragunityDux))
{
AI.SelectCard((int)CardId.DragunityDux);
AI.SelectCard(CardId.DragunityDux);
return true;
}
return false;
}
private bool DragunityArmaMysletainnEffect()
{
AI.SelectCard(CardId.DragunityPhalanx);
return true;
}
private bool DragunityArmaMysletainnTribute()
{
if ((Duel.Fields[0].HasInMonstersZone((int)CardId.AssaultBeast)
&& Duel.Fields[0].HasInGraveyard((int)CardId.DragunityPhalanx))
|| Duel.Fields[0].HasInMonstersZone((int)CardId.DragunityPhalanx)
|| Duel.Fields[0].HasInHand((int)CardId.DragunitySpearOfDestiny))
if ((Bot.HasInMonstersZone(CardId.AssaultBeast)
&& Bot.HasInGraveyard(CardId.DragunityPhalanx))
|| Bot.HasInMonstersZone(CardId.DragunityPhalanx)
|| Bot.HasInHand(CardId.DragunitySpearOfDestiny))
return true;
return false;
}
private bool DragunityDux()
{
return Duel.Fields[0].HasInGraveyard((int)CardId.DragunityPhalanx) ||
(Duel.Fields[0].GetMonsterCount() == 0 && Duel.Fields[0].HasInHand((int)CardId.DragunityArmaMysletainn) ||
Duel.Fields[0].HasInHand((int)CardId.DragunitySpearOfDestiny));
return Bot.HasInGraveyard(CardId.DragunityPhalanx) ||
(Bot.GetMonsterCount() == 0 && Bot.HasInHand(CardId.DragunityArmaMysletainn) ||
Bot.HasInHand(CardId.DragunitySpearOfDestiny));
}
private bool DragunityPhalanxSet()
{
return Duel.Fields[0].GetMonsterCount() == 0 || !Duel.Fields[0].HasInGraveyard((int)CardId.DragunityPhalanx);
return Bot.GetMonsterCount() == 0 || !Bot.HasInGraveyard(CardId.DragunityPhalanx);
}
private bool AssaultBeast()
{
if (!Duel.Fields[0].HasInSpellZone((int)CardId.AssaultModeActivate))
if (!Bot.HasInSpellZone(CardId.AssaultModeActivate))
return true;
return false;
}
private bool StardustDragon()
private bool AssaultModeActivate()
{
if (Card.Location == CardLocation.Grave)
return true;
return LastChainPlayer == 1;
}
private ClientCard GetProblematicCard()
{
ClientCard card = Duel.Fields[1].MonsterZone.GetInvincibleMonster();
return card ?? Duel.Fields[1].SpellZone.GetNegateAttackSpell();
if (Duel.Player == 0 && Duel.Phase == DuelPhase.BattleStart)
{
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (monster.Id == CardId.StardustDragon && monster.Attacked)
{
AI.SelectCard(monster);
return true;
}
}
}
return Duel.Player == 1;
}
}
}
\ No newline at end of file
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
// NOT FINISHED YET
[Deck("Evilswarm", "AI_Evilswarm", "NotFinished")]
public class EvilswarmExecutor : DefaultExecutor
{
public class CardId
{
public const int DarkHole = 53129443;
public const int CosmicCyclone = 8267140;
public const int InfestationPandemic = 27541267;
public const int SolemnJudgment = 41420027;
public const int SolemnWarning = 84749824;
public const int SolemnStrike = 40605147;
}
public EvilswarmExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.CosmicCyclone, DefaultCosmicCyclone);
AddExecutor(ExecutorType.Activate, CardId.SolemnJudgment, DefaultSolemnJudgment);
AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.SpellSet, CardId.InfestationPandemic);
AddExecutor(ExecutorType.Activate, DefaultDontChainMyself);
AddExecutor(ExecutorType.Summon);
AddExecutor(ExecutorType.SpSummon);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.SpellSet);
}
// will be added soon...?
}
}
\ No newline at end of file
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
using YGOSharp.OCGWrapper.Enums;
namespace DevBot.Game.AI.Decks
namespace WindBot.Game.AI.Decks
{
[Deck("Frog", "AI_Frog")]
[Deck("Frog", "AI_Frog", "Easy")]
public class FrogExecutor : DefaultExecutor
{
public enum CardId
{
CryomancerOfTheIceBarrier = 23950192,
DewdarkOfTheIceBarrier = 90311614,
SubmarineFrog = 63948258,
SwapFrog = 9126351,
FlipFlopFrog = 81278754,
Unifrog = 56052205,
Ronintoadin = 1357146,
DupeFrog = 46239604,
Tradetoad = 23408872,
TreebornFrog = 12538374,
DarkHole = 53129443,
Raigeki = 12580477,
Terraforming = 73628505,
PotOfDuality = 98645731,
Solidarity = 86780027,
Wetlands = 2084239,
FroggyForcefield = 34351849,
GravityBind = 85742772,
TheHugeRevolutionIsOver = 99188141
public class CardId
{
public const int CryomancerOfTheIceBarrier = 23950192;
public const int DewdarkOfTheIceBarrier = 90311614;
public const int SubmarineFrog = 63948258;
public const int SwapFrog = 9126351;
public const int FlipFlopFrog = 81278754;
public const int Unifrog = 56052205;
public const int Ronintoadin = 1357146;
public const int DupeFrog = 46239604;
public const int Tradetoad = 23408872;
public const int TreebornFrog = 12538374;
public const int DarkHole = 53129443;
public const int Raigeki = 12580477;
public const int Terraforming = 73628505;
public const int PotOfDuality = 98645731;
public const int Solidarity = 86780027;
public const int Wetlands = 2084239;
public const int FroggyForcefield = 34351849;
public const int GravityBind = 85742772;
public const int TheHugeRevolutionIsOver = 99188141;
}
public FrogExecutor(GameAI ai, Duel duel)
......@@ -36,69 +37,60 @@ namespace DevBot.Game.AI.Decks
{
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, (int)CardId.Solidarity, Solidarity);
AddExecutor(ExecutorType.Activate, (int)CardId.Terraforming, Terraforming);
AddExecutor(ExecutorType.Activate, (int)CardId.Wetlands, DefaultField);
AddExecutor(ExecutorType.Activate, (int)CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, (int)CardId.PotOfDuality, PotOfDuality);
AddExecutor(ExecutorType.SpSummon, (int)CardId.SwapFrog, SwapFrogSummon);
AddExecutor(ExecutorType.Activate, (int)CardId.SwapFrog, SwapFrogActivate);
AddExecutor(ExecutorType.Activate, (int)CardId.DupeFrog, DupeFrog);
AddExecutor(ExecutorType.Activate, (int)CardId.FlipFlopFrog, FlipFlopFrog);
AddExecutor(ExecutorType.Activate, (int)CardId.Ronintoadin, Ronintoadin);
AddExecutor(ExecutorType.Activate, (int)CardId.TreebornFrog);
AddExecutor(ExecutorType.Activate, (int)CardId.Unifrog);
AddExecutor(ExecutorType.Summon, (int)CardId.CryomancerOfTheIceBarrier, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.DewdarkOfTheIceBarrier, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.SubmarineFrog, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.SwapFrog, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.Unifrog, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.Ronintoadin, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.DupeFrog, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.Tradetoad, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.TreebornFrog, SummonFrog);
AddExecutor(ExecutorType.Summon, (int)CardId.FlipFlopFrog, SummonFrog);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.FlipFlopFrog);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.DupeFrog);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.Tradetoad);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.Ronintoadin);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.TreebornFrog);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.Unifrog);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.SwapFrog);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.SubmarineFrog);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.DewdarkOfTheIceBarrier);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.CryomancerOfTheIceBarrier);
AddExecutor(ExecutorType.Activate, CardId.Solidarity, Solidarity);
AddExecutor(ExecutorType.Activate, CardId.Terraforming, Terraforming);
AddExecutor(ExecutorType.Activate, CardId.Wetlands, DefaultField);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, CardId.PotOfDuality, PotOfDuality);
AddExecutor(ExecutorType.SpSummon, CardId.SwapFrog, SwapFrogSummon);
AddExecutor(ExecutorType.Activate, CardId.SwapFrog, SwapFrogActivate);
AddExecutor(ExecutorType.Activate, CardId.DupeFrog, DupeFrog);
AddExecutor(ExecutorType.Activate, CardId.FlipFlopFrog, FlipFlopFrog);
AddExecutor(ExecutorType.Activate, CardId.Ronintoadin, Ronintoadin);
AddExecutor(ExecutorType.Activate, CardId.TreebornFrog);
AddExecutor(ExecutorType.Activate, CardId.Unifrog);
AddExecutor(ExecutorType.Summon, CardId.CryomancerOfTheIceBarrier, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.DewdarkOfTheIceBarrier, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.SubmarineFrog, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.SwapFrog, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.Unifrog, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.Ronintoadin, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.DupeFrog, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.Tradetoad, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.TreebornFrog, SummonFrog);
AddExecutor(ExecutorType.Summon, CardId.FlipFlopFrog, SummonFrog);
AddExecutor(ExecutorType.MonsterSet, CardId.FlipFlopFrog);
AddExecutor(ExecutorType.MonsterSet, CardId.DupeFrog);
AddExecutor(ExecutorType.MonsterSet, CardId.Tradetoad);
AddExecutor(ExecutorType.MonsterSet, CardId.Ronintoadin);
AddExecutor(ExecutorType.MonsterSet, CardId.TreebornFrog);
AddExecutor(ExecutorType.MonsterSet, CardId.Unifrog);
AddExecutor(ExecutorType.MonsterSet, CardId.SwapFrog);
AddExecutor(ExecutorType.MonsterSet, CardId.SubmarineFrog);
AddExecutor(ExecutorType.MonsterSet, CardId.DewdarkOfTheIceBarrier);
AddExecutor(ExecutorType.MonsterSet, CardId.CryomancerOfTheIceBarrier);
AddExecutor(ExecutorType.Repos, FrogMonsterRepos);
AddExecutor(ExecutorType.Activate, (int)CardId.FroggyForcefield, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.TheHugeRevolutionIsOver, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.GravityBind, GravityBind);
AddExecutor(ExecutorType.Activate, CardId.FroggyForcefield, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.TheHugeRevolutionIsOver, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.GravityBind, GravityBind);
}
private int m_swapFrogSummoned;
private int m_flipFlopFrogSummoned;
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (attacker.Id == (int)CardId.Unifrog || attacker.Id == (int)CardId.DewdarkOfTheIceBarrier)
return true;
if (defender.IsMonsterInvincible() && !defender.IsMonsterDangerous() && attacker.Id == (int)CardId.SubmarineFrog)
return true;
return base.OnPreBattleBetween(attacker, defender);
}
private bool SwapFrogSummon()
{
int atk = Card.Attack + GetSpellBonus();
if (AI.Utils.IsAllEnnemyBetterThanValue(atk, true))
if (AI.Utils.IsAllEnemyBetterThanValue(atk, true))
return false;
AI.SelectCard((int)CardId.Ronintoadin);
AI.SelectCard(CardId.Ronintoadin);
m_swapFrogSummoned = Duel.Turn;
return true;
}
......@@ -109,10 +101,10 @@ namespace DevBot.Game.AI.Decks
return false;
m_swapFrogSummoned = -1;
if (Duel.Fields[0].GetRemainingCount((int)CardId.Ronintoadin, 2) == 0)
if (Bot.GetRemainingCount(CardId.Ronintoadin, 2) == 0)
return false;
AI.SelectCard((int)CardId.Ronintoadin);
AI.SelectCard(CardId.Ronintoadin);
return true;
}
......@@ -127,7 +119,7 @@ namespace DevBot.Game.AI.Decks
if (Card.IsDefense() || m_flipFlopFrogSummoned == Duel.Turn || Duel.Phase == DuelPhase.Main2)
{
m_flipFlopFrogSummoned = -1;
List<ClientCard> monsters = Duel.Fields[1].GetMonsters();
List<ClientCard> monsters = Enemy.GetMonsters();
monsters.Sort(AIFunctions.CompareCardAttack);
monsters.Reverse();
AI.SelectCard(monsters);
......@@ -138,7 +130,7 @@ namespace DevBot.Game.AI.Decks
private bool Ronintoadin()
{
List<ClientCard> monsters = Duel.Fields[0].GetGraveyardMonsters();
List<ClientCard> monsters = Bot.GetGraveyardMonsters();
if (monsters.Count > 2)
{
if (GetSpellBonus() == 0)
......@@ -152,10 +144,10 @@ namespace DevBot.Game.AI.Decks
{
int atk = Card.Attack + GetSpellBonus();
if (AI.Utils.IsOneEnnemyBetterThanValue(atk, true))
if (AI.Utils.IsOneEnemyBetterThanValue(atk, true))
return false;
if (Card.Id == (int)CardId.SwapFrog)
if (Card.Id == CardId.SwapFrog)
m_swapFrogSummoned = Duel.Turn;
return true;
}
......@@ -164,20 +156,20 @@ namespace DevBot.Game.AI.Decks
{
List<int> cards = new List<int>();
if (AI.Utils.IsEnnemyBetter(false, false))
if (AI.Utils.IsOneEnemyBetter())
{
cards.Add((int)CardId.FlipFlopFrog);
cards.Add(CardId.FlipFlopFrog);
}
if (Duel.Fields[0].SpellZone[5] == null)
if (Bot.SpellZone[5] == null)
{
cards.Add((int)CardId.Terraforming);
cards.Add((int)CardId.Wetlands);
cards.Add(CardId.Terraforming);
cards.Add(CardId.Wetlands);
}
cards.Add((int)CardId.DarkHole);
cards.Add((int)CardId.SwapFrog);
cards.Add((int)CardId.GravityBind);
cards.Add(CardId.DarkHole);
cards.Add(CardId.SwapFrog);
cards.Add(CardId.GravityBind);
if (cards.Count > 0)
{
......@@ -188,32 +180,27 @@ namespace DevBot.Game.AI.Decks
return false;
}
private bool DarkHole()
{
return AI.Utils.IsEnnemyBetter(false, false);
}
private bool Terraforming()
{
if (Duel.Fields[0].HasInHand((int)CardId.Wetlands))
if (Bot.HasInHand(CardId.Wetlands))
return false;
if (Duel.Fields[0].SpellZone[5] != null)
if (Bot.SpellZone[5] != null)
return false;
return true;
}
private bool Solidarity()
{
List<ClientCard> monsters = Duel.Fields[0].GetGraveyardMonsters();
List<ClientCard> monsters = Bot.GetGraveyardMonsters();
return monsters.Count != 0;
}
private bool GravityBind()
{
List<ClientCard> spells = Duel.Fields[0].GetSpells();
List<ClientCard> spells = Bot.GetSpells();
foreach (ClientCard spell in spells)
{
if (spell.Id == (int)CardId.GravityBind && !spell.IsFacedown())
if (spell.Id == CardId.GravityBind && !spell.IsFacedown())
return false;
}
return true;
......@@ -221,24 +208,24 @@ namespace DevBot.Game.AI.Decks
private bool FrogMonsterRepos()
{
if (Card.Id == (int)CardId.Unifrog)
if (Card.Id == CardId.Unifrog)
return Card.IsDefense();
if (Card.Id == (int)CardId.DewdarkOfTheIceBarrier)
if (Card.Id == CardId.DewdarkOfTheIceBarrier)
return Card.IsDefense();
bool ennemyBetter = AI.Utils.IsOneEnnemyBetterThanValue(Card.Attack + (Card.IsFacedown() ? GetSpellBonus() : 0), true);
bool enemyBetter = AI.Utils.IsOneEnemyBetterThanValue(Card.Attack + (Card.IsFacedown() ? GetSpellBonus() : 0), true);
if (Card.Attack < 800)
ennemyBetter = true;
enemyBetter = true;
bool result = false;
if (Card.IsAttack() && ennemyBetter)
if (Card.IsAttack() && enemyBetter)
result = true;
if (Card.IsDefense() && !ennemyBetter)
if (Card.IsDefense() && !enemyBetter)
result = true;
if (!result && Card.Id == (int)CardId.FlipFlopFrog && Duel.Fields[1].GetMonsterCount() > 0 && Card.IsFacedown())
if (!result && Card.Id == CardId.FlipFlopFrog && Enemy.GetMonsterCount() > 0 && Card.IsFacedown())
result = true;
if (Card.Id == (int)CardId.FlipFlopFrog && Card.IsFacedown() && result)
if (Card.Id == CardId.FlipFlopFrog && Card.IsFacedown() && result)
m_flipFlopFrogSummoned = Duel.Turn;
return result;
......@@ -247,15 +234,15 @@ namespace DevBot.Game.AI.Decks
private int GetSpellBonus()
{
int atk = 0;
if (Duel.Fields[0].SpellZone[5] != null)
if (Bot.SpellZone[5] != null)
atk += 1200;
List<ClientCard> monsters = Duel.Fields[0].GetGraveyardMonsters();
List<ClientCard> monsters = Bot.GetGraveyardMonsters();
if (monsters.Count != 0)
{
foreach (ClientCard card in Duel.Fields[0].GetSpells())
foreach (ClientCard card in Bot.GetSpells())
{
if (card.Id == (int)CardId.Solidarity)
if (card.Id == CardId.Solidarity)
atk += 800;
}
}
......
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
// NOT FINISHED YET
[Deck("Gravekeeper", "AI_Gravekeeper", "NotFinished")]
public class GravekeeperExecutor : DefaultExecutor
{
public class CardId
{
public const int GravekeepersOracle = 25524823;
public const int MaleficStardustDragon = 36521459;
public const int GravekeepersVisionary = 3825890;
public const int GravekeepersChief = 62473983;
public const int ThunderKingRaiOh = 71564252;
public const int GravekeepersCommandant = 17393207;
public const int GravekeepersAssailant = 25262697;
public const int GravekeepersDescendant = 30213599;
public const int GravekeepersSpy = 24317029;
public const int GravekeepersRecruiter = 93023479;
public const int AllureOfDarkness = 1475311;
public const int DarkHole = 53129443;
public const int RoyalTribute = 72405967;
public const int GravekeepersStele = 99523325;
public const int MysticalSpaceTyphoon = 5318639;
public const int BookofMoon = 14087893;
public const int HiddenTemplesOfNecrovalley = 70000776;
public const int Necrovalley = 47355498;
public const int BottomlessTrapHole = 29401950;
public const int RiteOfSpirit = 30450531;
public const int TorrentialTribute = 53582587;
public const int DimensionalPrison = 70342110;
public const int SolemnWarning = 84749824;
public const int ImperialTombsOfNecrovalley = 90434657;
}
public GravekeeperExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, CardId.AllureOfDarkness);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.RoyalTribute);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersStele);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.BookofMoon, DefaultBookOfMoon);
AddExecutor(ExecutorType.Activate, CardId.HiddenTemplesOfNecrovalley, HiddenTemplesOfNecrovalleyEffect);
AddExecutor(ExecutorType.Activate, CardId.Necrovalley, NecrovalleyActivate);
AddExecutor(ExecutorType.Activate, CardId.BottomlessTrapHole, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, CardId.DimensionalPrison, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.RiteOfSpirit, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.ImperialTombsOfNecrovalley, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.TorrentialTribute, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersOracle);
AddExecutor(ExecutorType.SpSummon, CardId.MaleficStardustDragon, MaleficStardustDragonSummon);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersVisionary);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersChief);
AddExecutor(ExecutorType.Summon, CardId.ThunderKingRaiOh);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersCommandant, GravekeepersCommandantSummon);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersAssailant);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersDescendant);
AddExecutor(ExecutorType.MonsterSet, CardId.GravekeepersSpy);
AddExecutor(ExecutorType.MonsterSet, CardId.GravekeepersRecruiter);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersOracle);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersVisionary);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersChief);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersCommandant, GravekeepersCommandantEffect);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersAssailant, GravekeepersAssailantEffect);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersDescendant, GravekeepersDescendantEffect);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersSpy, SearchForDescendant);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersRecruiter, SearchForDescendant);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
private bool HiddenTemplesOfNecrovalleyEffect()
{
if (Card.Location == CardLocation.Hand && Bot.HasInSpellZone((int)Card.Id))
return false;
return true;
}
private bool NecrovalleyActivate()
{
if (Bot.SpellZone[5] != null)
return false;
return true;
}
private bool MaleficStardustDragonSummon()
{
if (Bot.SpellZone[5] != null)
return true;
return false;
}
private bool GravekeepersCommandantEffect()
{
if (!Bot.HasInHand(CardId.Necrovalley) && !Bot.HasInSpellZone(CardId.Necrovalley))
return true;
return false;
}
private bool GravekeepersCommandantSummon()
{
return !GravekeepersCommandantEffect();
}
private bool GravekeepersAssailantEffect()
{
if (!Card.IsAttack())
return false;
foreach (ClientCard card in Enemy.GetMonsters())
{
if (card.IsDefense() && card.Defense > 1500 && card.Attack < 1500 || card.Attack > 1500 && card.Defense < 1500)
return true;
}
return false;
}
private bool GravekeepersDescendantEffect()
{
int bestatk = Bot.GetMonsters().GetHighestAttackMonster().Attack;
if (AI.Utils.IsOneEnemyBetterThanValue(bestatk, true))
{
AI.SelectCard(Enemy.GetMonsters().GetHighestAttackMonster());
return true;
}
return false;
}
private bool SearchForDescendant()
{
AI.SelectCard(CardId.GravekeepersDescendant);
return true;
}
}
}
\ No newline at end of file
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
// NOT FINISHED YET
[Deck("Graydle", "AI_Graydle", "NotFinished")]
public class GraydleExecutor : DefaultExecutor
{
public class CardId
{
public const int DarkHole = 53129443;
public const int CosmicCyclone = 8267140;
public const int SolemnJudgment = 41420027;
public const int SolemnWarning = 84749824;
public const int SolemnStrike = 40605147;
}
public GraydleExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.CosmicCyclone, DefaultCosmicCyclone);
AddExecutor(ExecutorType.Activate, CardId.SolemnJudgment, DefaultSolemnJudgment);
AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, DefaultDontChainMyself);
AddExecutor(ExecutorType.MonsterSet);
AddExecutor(ExecutorType.SpSummon);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.SpellSet);
}
// will be added soon...?
}
}
\ No newline at end of file
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game.AI.Decks
{
[Deck("Horus", "AI_Horus")]
[Deck("Horus", "AI_Horus", "Easy")]
public class HorusExecutor : DefaultExecutor
{
public enum CardId
public class CardId
{
AlexandriteDragon = 43096270,
LusterDragon = 11091375,
WhiteNightDragon = 79473793,
HorusTheBlackFlameDragonLv8 = 48229808,
HorusTheBlackFlameDragonLv6 = 11224103,
CyberDragon = 70095154,
AxeDragonute = 84914462,
DodgerDragon = 47013502,
GolemDragon = 9666558,
Raigeki = 12580477,
HammerShot = 26412047,
DarkHole = 53129443,
Fissure = 66788016,
StampingDestruction = 81385346,
FoolishBurial = 81439173,
MonsterReborn = 83764718,
MysticalSpaceTyphoon = 5318639,
BellowOfTheSilverDragon = 80600103,
Mountain = 50913601,
DragonsRebirth = 20638610,
MirrorForce = 44095762,
DimensionalPrison = 70342110
public const int AlexandriteDragon = 43096270;
public const int LusterDragon = 11091375;
public const int WhiteNightDragon = 79473793;
public const int HorusTheBlackFlameDragonLv8 = 48229808;
public const int HorusTheBlackFlameDragonLv6 = 11224103;
public const int CyberDragon = 70095154;
public const int AxeDragonute = 84914462;
public const int DodgerDragon = 47013502;
public const int GolemDragon = 9666558;
public const int Raigeki = 12580477;
public const int HammerShot = 26412047;
public const int DarkHole = 53129443;
public const int Fissure = 66788016;
public const int StampingDestruction = 81385346;
public const int FoolishBurial = 81439173;
public const int MonsterReborn = 83764718;
public const int MysticalSpaceTyphoon = 5318639;
public const int BellowOfTheSilverDragon = 80600103;
public const int Mountain = 50913601;
public const int DragonsRebirth = 20638610;
public const int MirrorForce = 44095762;
public const int DimensionalPrison = 70342110;
}
public HorusExecutor(GameAI ai, Duel duel) : base(ai, duel)
{
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, (int)CardId.HorusTheBlackFlameDragonLv6);
AddExecutor(ExecutorType.Activate, (int)CardId.StampingDestruction, DefaultStampingDestruction);
AddExecutor(ExecutorType.Activate, (int)CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, (int)CardId.FoolishBurial, FoolishBurial);
AddExecutor(ExecutorType.Activate, (int)CardId.Mountain, DefaultField);
AddExecutor(ExecutorType.Activate, (int)CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, (int)CardId.HammerShot, DefaultHammerShot);
AddExecutor(ExecutorType.Activate, (int)CardId.Fissure);
AddExecutor(ExecutorType.SpSummon, (int)CardId.CyberDragon);
AddExecutor(ExecutorType.Activate, (int)CardId.BellowOfTheSilverDragon, BellowOfTheSilverDragon);
AddExecutor(ExecutorType.Activate, (int)CardId.MonsterReborn, MonsterReborn);
AddExecutor(ExecutorType.Summon, (int)CardId.WhiteNightDragon, WhiteNightDragon);
AddExecutor(ExecutorType.Summon, (int)CardId.HorusTheBlackFlameDragonLv6, DefaultTributeSummon);
AddExecutor(ExecutorType.Summon, (int)CardId.AlexandriteDragon);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.AxeDragonute);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.DodgerDragon);
AddExecutor(ExecutorType.MonsterSet, (int)CardId.GolemDragon);
AddExecutor(ExecutorType.SummonOrSet, (int)CardId.LusterDragon);
AddExecutor(ExecutorType.Activate, CardId.HorusTheBlackFlameDragonLv6);
AddExecutor(ExecutorType.Activate, CardId.StampingDestruction, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.FoolishBurial, FoolishBurial);
AddExecutor(ExecutorType.Activate, CardId.Mountain, DefaultField);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.SpSummon, CardId.CyberDragon);
AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, CardId.HammerShot, DefaultHammerShot);
AddExecutor(ExecutorType.Activate, CardId.Fissure);
AddExecutor(ExecutorType.Activate, CardId.BellowOfTheSilverDragon, BellowOfTheSilverDragon);
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, MonsterReborn);
AddExecutor(ExecutorType.Summon, CardId.WhiteNightDragon, WhiteNightDragon);
AddExecutor(ExecutorType.Summon, CardId.HorusTheBlackFlameDragonLv6, DefaultTributeSummon);
AddExecutor(ExecutorType.Summon, CardId.AlexandriteDragon);
AddExecutor(ExecutorType.SummonOrSet, CardId.AxeDragonute);
AddExecutor(ExecutorType.SummonOrSet, CardId.DodgerDragon);
AddExecutor(ExecutorType.MonsterSet, CardId.GolemDragon);
AddExecutor(ExecutorType.SummonOrSet, CardId.LusterDragon);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.Activate, (int)CardId.HorusTheBlackFlameDragonLv8, HorusTheBlackFlameDragonLv8);
AddExecutor(ExecutorType.Activate, (int)CardId.MirrorForce, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.DimensionalPrison, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.DragonsRebirth, DragonsRebirth);
AddExecutor(ExecutorType.Activate, CardId.HorusTheBlackFlameDragonLv8, HorusTheBlackFlameDragonLv8);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.DimensionalPrison, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.DragonsRebirth, DragonsRebirth);
}
private bool FoolishBurial()
{
if (Duel.Fields[0].HasInGraveyard((int)CardId.WhiteNightDragon))
if (Bot.HasInGraveyard(CardId.WhiteNightDragon))
return false;
if (Duel.Fields[0].HasInHand((int)CardId.WhiteNightDragon))
if (Bot.HasInHand(CardId.WhiteNightDragon))
return false;
int remaining = 2;
foreach (ClientCard card in Duel.Fields[0].Banished)
if (card.Id == (int)CardId.WhiteNightDragon)
foreach (ClientCard card in Bot.Banished)
if (card.Id == CardId.WhiteNightDragon)
remaining--;
if (remaining > 0)
{
AI.SelectCard((int)CardId.WhiteNightDragon);
AI.SelectCard(CardId.WhiteNightDragon);
return true;
}
return false;
......@@ -91,7 +96,7 @@ namespace WindBot.Game.AI.Decks
if (Duel.Player == 1 && Duel.Phase == DuelPhase.End)
return false;
List<ClientCard> cards = new List<ClientCard>(Duel.Fields[0].Graveyard);
List<ClientCard> cards = new List<ClientCard>(Bot.Graveyard);
cards.Sort(AIFunctions.CompareCardAttack);
for (int i = cards.Count - 1; i >= 0; --i)
{
......@@ -109,7 +114,7 @@ namespace WindBot.Game.AI.Decks
private bool MonsterReborn()
{
List<ClientCard> cards = new List<ClientCard>(Duel.Fields[0].Graveyard);
List<ClientCard> cards = new List<ClientCard>(Bot.Graveyard);
cards.Sort(AIFunctions.CompareCardAttack);
ClientCard selectedCard = null;
for (int i = cards.Count - 1; i >= 0; --i)
......@@ -123,7 +128,7 @@ namespace WindBot.Game.AI.Decks
break;
}
}
cards = new List<ClientCard>(Duel.Fields[1].Graveyard);
cards = new List<ClientCard>(Enemy.Graveyard);
cards.Sort(AIFunctions.CompareCardAttack);
for (int i = cards.Count - 1; i >= 0; --i)
{
......@@ -147,7 +152,7 @@ namespace WindBot.Game.AI.Decks
private bool WhiteNightDragon()
{
// We should summon Horus the Black Flame Dragon LV6 if he can lvlup.
if (Duel.Fields[1].GetMonsterCount() != 0 && !AI.Utils.IsAllEnnemyBetterThanValue(2300 - 1, false))
if (Enemy.GetMonsterCount() != 0 && !AI.Utils.IsAllEnemyBetterThanValue(2300 - 1, false))
foreach (ClientCard card in Main.SummonableCards)
if (card.Id == 11224103)
return false;
......@@ -162,7 +167,7 @@ namespace WindBot.Game.AI.Decks
private bool DragonsRebirth()
{
List<ClientCard> cards = new List<ClientCard>(Duel.Fields[0].GetMonsters());
List<ClientCard> cards = new List<ClientCard>(Bot.GetMonsters());
if (cards.Count == 0)
return false;
cards.Sort(AIFunctions.CompareCardAttack);
......@@ -181,8 +186,8 @@ namespace WindBot.Game.AI.Decks
if (tributeCard == null)
return false;
cards = new List<ClientCard>(Duel.Fields[0].Hand);
cards.AddRange(Duel.Fields[0].Graveyard);
cards = new List<ClientCard>(Bot.Hand);
cards.AddRange(Bot.Graveyard);
if (cards.Count == 0)
return false;
cards.Sort(AIFunctions.CompareCardAttack);
......@@ -192,7 +197,7 @@ namespace WindBot.Game.AI.Decks
ClientCard monster = cards[i];
if (monster.Attack < 2300)
return false;
if (monster.Race == (int)CardRace.Dragon && monster.Id != (int)CardId.HorusTheBlackFlameDragonLv8)
if (monster.Race == (int)CardRace.Dragon && monster.Id != CardId.HorusTheBlackFlameDragonLv8)
{
summonCard = monster;
break;
......
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
// NOT FINISHED YET
[Deck("Lightsworn", "AI_Lightsworn", "NotFinished")]
public class LightswornExecutor : DefaultExecutor
{
public class CardId
{
public const int JudgmentDragon = 57774843;
public const int Wulf = 58996430;
public const int Garoth = 59019082;
public const int Raiden = 77558536;
public const int Lyla = 22624373;
public const int Felis = 73176465;
public const int Lumina = 95503687;
public const int Minerva = 40164421;
public const int Ryko = 21502796;
public const int PerformageTrickClown = 67696066;
public const int Goblindbergh = 25259669;
public const int ThousandBlades = 1833916;
public const int Honest = 37742478;
public const int GlowUpBulb = 67441435;
public const int SolarRecharge = 691925;
public const int GalaxyCyclone = 5133471;
public const int HarpiesFeatherDuster = 18144506;
public const int ReinforcementOfTheArmy = 32807846;
public const int MetalfoesFusion = 73594093;
public const int ChargeOfTheLightBrigade = 94886282;
public const int Michael = 4779823;
public const int MinervaTheExalted = 30100551;
public const int TrishulaDragonOfTheIceBarrier = 52687916;
public const int ScarlightRedDragonArchfiend = 80666118;
public const int PSYFramelordOmega = 74586817;
public const int PSYFramelordZeta = 37192109;
public const int NumberS39UtopiatheLightning = 56832966;
public const int Number39Utopia = 84013237;
public const int CastelTheSkyblasterMusketeer = 82633039;
public const int EvilswarmExcitonKnight = 46772449;
public const int DanteTravelerOfTheBurningAbyss = 83531441;
public const int DecodeTalker = 1861629;
public const int MissusRadiant = 3987233;
}
bool ClownUsed = false;
public LightswornExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, CardId.GalaxyCyclone, DefaultGalaxyCyclone);
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, CardId.MetalfoesFusion);
AddExecutor(ExecutorType.Activate, CardId.GlowUpBulb);
AddExecutor(ExecutorType.Activate, CardId.JudgmentDragon, DefaultDarkHole);
AddExecutor(ExecutorType.SpSummon, CardId.JudgmentDragon);
AddExecutor(ExecutorType.Activate, CardId.ReinforcementOfTheArmy, ReinforcementOfTheArmyEffect);
AddExecutor(ExecutorType.Activate, CardId.ChargeOfTheLightBrigade, ChargeOfTheLightBrigadeEffect);
AddExecutor(ExecutorType.Activate, CardId.SolarRecharge, SolarRechargeEffect);
AddExecutor(ExecutorType.Summon, CardId.Goblindbergh, GoblindberghSummon);
AddExecutor(ExecutorType.Activate, CardId.Goblindbergh, GoblindberghEffect);
AddExecutor(ExecutorType.SpSummon, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightSummon);
AddExecutor(ExecutorType.Activate, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightEffect);
AddExecutor(ExecutorType.SpSummon, CardId.CastelTheSkyblasterMusketeer, DefaultCastelTheSkyblasterMusketeerSummon);
AddExecutor(ExecutorType.Activate, CardId.CastelTheSkyblasterMusketeer, DefaultCastelTheSkyblasterMusketeerEffect);
AddExecutor(ExecutorType.SpSummon, CardId.ScarlightRedDragonArchfiend, DefaultScarlightRedDragonArchfiendSummon);
AddExecutor(ExecutorType.Activate, CardId.ScarlightRedDragonArchfiend, DefaultScarlightRedDragonArchfiendEffect);
AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.PerformageTrickClown, PerformageTrickClownEffect);
AddExecutor(ExecutorType.Activate, CardId.ThousandBlades);
AddExecutor(ExecutorType.Activate, CardId.Honest, HonestEffect);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
public override void OnNewTurn()
{
ClownUsed = false;
}
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (!defender.IsMonsterHasPreventActivationEffectInBattle())
{
if (attacker.Attribute == (int)CardAttribute.Light && Bot.HasInHand(CardId.Honest))
attacker.RealPower = attacker.RealPower + defender.Attack;
}
return base.OnPreBattleBetween(attacker, defender);
}
public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, bool cancelable)
{
if (max == 2 && min == 2 && cards[0].Location == CardLocation.MonsterZone)
{
Logger.DebugWriteLine("OnSelectCard XYZ");
IList<ClientCard> avail = new List<ClientCard>();
foreach (ClientCard card in cards)
{
// clone
avail.Add(card);
}
IList<ClientCard> result = new List<ClientCard>();
foreach (ClientCard card in cards)
{
if (!result.Contains(card) && (!ClownUsed || card.Id != CardId.PerformageTrickClown))
result.Add(card);
if (result.Count >= 2)
break;
}
if (result.Count < 2)
{
foreach (ClientCard card in cards)
{
if (!result.Contains(card))
result.Add(card);
if (result.Count >= 2)
break;
}
}
return result;
}
Logger.DebugWriteLine("Use default.");
return null;
}
private bool ReinforcementOfTheArmyEffect()
{
if (!Bot.HasInHand(CardId.Goblindbergh))
AI.SelectCard(CardId.Goblindbergh);
else if (!Bot.HasInHand(CardId.Raiden))
AI.SelectCard(CardId.Raiden);
return true;
}
private bool ChargeOfTheLightBrigadeEffect()
{
if (!Bot.HasInHand(CardId.Lumina))
AI.SelectCard(CardId.Lumina);
else
AI.SelectCard(new[]
{
CardId.Raiden,
CardId.Lumina,
CardId.Minerva,
CardId.Lyla
});
return true;
}
private bool SolarRechargeEffect()
{
AI.SelectCard(new[]
{
CardId.Wulf,
CardId.Felis,
CardId.Minerva,
CardId.Lyla,
CardId.Raiden
});
return true;
}
private bool GoblindberghSummon()
{
foreach (ClientCard card in Bot.Hand)
{
if (card != Card && card.IsMonster() && card.Level == 4)
return true;
}
return false;
}
private bool GoblindberghEffect()
{
AI.SelectCard(new[]
{
CardId.Felis,
CardId.Wulf,
CardId.Raiden,
CardId.PerformageTrickClown,
CardId.ThousandBlades
});
return true;
}
private bool PerformageTrickClownEffect()
{
ClownUsed = true;
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool HonestEffect()
{
return Duel.Phase != DuelPhase.Main1;
}
}
}
\ No newline at end of file
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("MokeyMokey", "AI_MokeyMokey", "Easy")]
public class MokeyMokeyExecutor : DefaultExecutor
{
public class CardId
{
public const int LeoWizard = 4392470;
public const int Bunilla = 69380702;
}
private int RockCount = 0;
public MokeyMokeyExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Summon);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.SpellSet);
}
public override int OnRockPaperScissors()
{
RockCount++;
if (RockCount <= 3)
return 2;
else
return base.OnRockPaperScissors();
}
}
}
\ No newline at end of file
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("MokeyMokeyKing", "AI_MokeyMokeyKing", "Easy")]
public class MokeyMokeyKingExecutor : DefaultExecutor
{
public class CardId
{
public const int LeoWizard = 4392470;
public const int Bunilla = 69380702;
}
private int RockCount = 0;
public MokeyMokeyKingExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.SpSummon);
AddExecutor(ExecutorType.SummonOrSet);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.Activate, DefaultField);
}
public override int OnRockPaperScissors()
{
RockCount++;
if (RockCount <= 3)
return 2;
else
return base.OnRockPaperScissors();
}
}
}
\ No newline at end of file
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
// NOT FINISHED YET
[Deck("Nekroz", "AI_Nekroz", "NotFinished")]
public class NekrozExecutor : DefaultExecutor
{
public class CardId
{
public const int DancePrincess = 52738610;
public const int ThousandHands = 23401839;
public const int TenThousandHands = 95492061;
public const int Shurit = 90307777;
public const int MaxxC = 23434538;
public const int DecisiveArmor = 88240999;
public const int Trishula = 52068432;
public const int Valkyrus = 25857246;
public const int Gungnir = 74122412;
public const int Brionac = 26674724;
public const int Unicore = 89463537;
public const int Clausolas = 99185129;
public const int PhantomOfChaos = 30312361;
public const int DarkHole = 53129443;
public const int ReinforcementOfTheArmy = 32807846;
public const int TradeIn = 38120068;
public const int PreparationOfRites = 96729612;
public const int Mirror = 14735698;
public const int Kaleidoscope = 51124303;
public const int Cycle = 97211663;
public const int MysticalSpaceTyphoon = 5318639;
public const int RoyalDecree = 51452091;
public const int EvilswarmExcitonKnight = 46772449;
public const int HeraldOfTheArcLight = 79606837;
}
List<int> NekrozRituelCard = new List<int>();
List<int> NekrozSpellCard = new List<int>();
public NekrozExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
NekrozRituelCard.Add(CardId.Clausolas);
NekrozRituelCard.Add(CardId.Unicore);
NekrozRituelCard.Add(CardId.DecisiveArmor);
NekrozRituelCard.Add(CardId.Brionac);
NekrozRituelCard.Add(CardId.Trishula);
NekrozRituelCard.Add(CardId.Gungnir);
NekrozRituelCard.Add(CardId.Valkyrus);
NekrozSpellCard.Add(CardId.Mirror);
NekrozSpellCard.Add(CardId.Kaleidoscope);
NekrozSpellCard.Add(CardId.Cycle);
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.ReinforcementOfTheArmy, ReinforcementOfTheArmyEffect);
AddExecutor(ExecutorType.Activate, CardId.TradeIn);
AddExecutor(ExecutorType.Activate, CardId.PreparationOfRites);
AddExecutor(ExecutorType.Activate, CardId.Mirror);
AddExecutor(ExecutorType.Activate, CardId.Kaleidoscope);
AddExecutor(ExecutorType.Activate, CardId.Cycle);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.RoyalDecree);
AddExecutor(ExecutorType.SummonOrSet, CardId.DancePrincess, DancePrincessSummon);
AddExecutor(ExecutorType.MonsterSet, CardId.Shurit, ShuritSet);
AddExecutor(ExecutorType.Summon, CardId.ThousandHands, ThousandHandsSummon);
AddExecutor(ExecutorType.Summon, CardId.TenThousandHands, TenThousandHandsSummon);
AddExecutor(ExecutorType.Summon, CardId.PhantomOfChaos, PhantomOfChaosSummon);
AddExecutor(ExecutorType.Activate, CardId.Unicore, UnicoreEffect);
AddExecutor(ExecutorType.Activate, CardId.DecisiveArmor, DecisiveArmorEffect);
AddExecutor(ExecutorType.Activate, CardId.Valkyrus, ValkyrusEffect);
AddExecutor(ExecutorType.Activate, CardId.Gungnir, GungnirEffect);
AddExecutor(ExecutorType.Activate, CardId.Brionac, BrionacEffect);
AddExecutor(ExecutorType.Activate, CardId.Clausolas, ClausolasEffect);
AddExecutor(ExecutorType.Activate, CardId.Trishula);
AddExecutor(ExecutorType.Activate, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightEffect);
AddExecutor(ExecutorType.Activate, CardId.PhantomOfChaos, PhantomOfChaosEffect);
AddExecutor(ExecutorType.Activate, CardId.MaxxC);
AddExecutor(ExecutorType.Activate, CardId.ThousandHands, ThousandHandsEffect);
AddExecutor(ExecutorType.Activate, CardId.TenThousandHands, BrionacEffect);
AddExecutor(ExecutorType.Activate, CardId.HeraldOfTheArcLight);
AddExecutor(ExecutorType.Activate, CardId.Shurit);
AddExecutor(ExecutorType.SpSummon, CardId.Trishula);
AddExecutor(ExecutorType.SpSummon, CardId.DecisiveArmor);
AddExecutor(ExecutorType.SpSummon, CardId.Valkyrus);
AddExecutor(ExecutorType.SpSummon, CardId.Gungnir);
AddExecutor(ExecutorType.SpSummon, CardId.Brionac);
AddExecutor(ExecutorType.SpSummon, CardId.Unicore);
AddExecutor(ExecutorType.SpSummon, CardId.Clausolas);
AddExecutor(ExecutorType.SpSummon, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightSummon);
}
private bool ThousandHandsSummon()
{
if (!Bot.HasInHand(NekrozRituelCard) || Bot.HasInHand(CardId.Shurit) || !Bot.HasInHand(NekrozSpellCard))
return true;
foreach (ClientCard Card in Bot.Hand)
if (Card != null && Card.Id == CardId.Kaleidoscope && !Bot.HasInHand(CardId.Unicore))
return true;
else if (Card.Id == CardId.Trishula || Card.Id == CardId.DecisiveArmor && !Bot.HasInHand(CardId.Mirror) || !Bot.HasInHand(CardId.Shurit))
return true;
return false;
}
private bool ReinforcementOfTheArmyEffect()
{
if (!Bot.HasInGraveyard(CardId.Shurit) && !Bot.HasInHand(CardId.Shurit))
{
AI.SelectCard(CardId.Shurit);
return true;
}
return false;
}
private bool TenThousandHandsSummon()
{
if (!Bot.HasInHand(CardId.ThousandHands) || !Bot.HasInHand(CardId.Shurit))
return true;
return false;
}
private bool DancePrincessSummon()
{
if (!Bot.HasInHand(CardId.ThousandHands) && !Bot.HasInHand(CardId.TenThousandHands))
return true;
return false;
}
private bool PhantomOfChaosSummon()
{
if (Bot.HasInGraveyard(CardId.Shurit) && Bot.HasInHand(NekrozSpellCard) && Bot.HasInHand(NekrozRituelCard))
return true;
return false;
}
private bool PhantomOfChaosEffect()
{
AI.SelectCard(CardId.Shurit);
return true;
}
private bool ShuritSet()
{
if (!Bot.HasInHand(CardId.ThousandHands) && !Bot.HasInHand(CardId.TenThousandHands) && !Bot.HasInHand(CardId.DancePrincess))
return true;
return false;
}
private bool DecisiveArmorEffect()
{
if (AI.Utils.IsAllEnemyBetterThanValue(3300, true))
{
AI.SelectCard(CardId.DecisiveArmor);
return true;
}
return false;
}
private bool ValkyrusEffect()
{
if (Duel.Phase == DuelPhase.Battle)
return true;
return false;
}
private bool GungnirEffect()
{
if (AI.Utils.IsOneEnemyBetter(true) && Duel.Phase == DuelPhase.Main1)
{
AI.SelectCard(Enemy.GetMonsters().GetHighestAttackMonster());
return true;
}
return false;
}
private bool BrionacEffect()
{
if (!Bot.HasInHand(CardId.Shurit))
{
AI.SelectCard(CardId.Shurit);
return true;
}
else if (!Bot.HasInHand(NekrozSpellCard))
{
AI.SelectCard(CardId.Mirror);
return true;
}
else if (AI.Utils.IsOneEnemyBetterThanValue(3300, true) && !Bot.HasInHand(CardId.Trishula))
{
AI.SelectCard(CardId.Trishula);
return true;
}
else if (AI.Utils.IsAllEnemyBetterThanValue(2700,true) && !Bot.HasInHand(CardId.DecisiveArmor))
{
AI.SelectCard(CardId.DecisiveArmor);
return true;
}
else if (Bot.HasInHand(CardId.Unicore) && !Bot.HasInHand(CardId.Kaleidoscope))
{
AI.SelectCard(CardId.Kaleidoscope);
return true;
}
else if (!Bot.HasInHand(CardId.Unicore) && Bot.HasInHand(CardId.Kaleidoscope))
{
AI.SelectCard(CardId.Unicore);
return true;
}
return true;
}
private bool ThousandHandsEffect()
{
if (AI.Utils.IsOneEnemyBetterThanValue(3300, true) && !Bot.HasInHand(CardId.Trishula))
{
AI.SelectCard(CardId.Trishula);
return true;
}
else if (AI.Utils.IsAllEnemyBetterThanValue(2700, true) && !Bot.HasInHand(CardId.DecisiveArmor))
{
AI.SelectCard(CardId.DecisiveArmor);
return true;
}
else if (!Bot.HasInHand(CardId.Unicore) && Bot.HasInHand(CardId.Kaleidoscope))
{
AI.SelectCard(CardId.Unicore);
return true;
}
return true;
}
private bool UnicoreEffect()
{
if (Bot.HasInGraveyard(CardId.Shurit))
{
AI.SelectCard(CardId.Shurit);
return true;
}
return false;
}
private bool ClausolasEffect()
{
if (!Bot.HasInHand(NekrozSpellCard))
{
AI.SelectCard(CardId.Mirror);
return true;
}
return false;
}
private bool IsTheLastPossibility()
{
if (!Bot.HasInHand(CardId.DecisiveArmor) && !Bot.HasInHand(CardId.Trishula))
return true;
return false;
}
private bool SelectNekrozWhoInvoke()
{
List<int> NekrozCard = new List<int>();
try
{
foreach (ClientCard Card in Bot.Hand)
if (Card != null && NekrozRituelCard.Contains((int)Card.Id))
NekrozCard.Add(Card.Id);
foreach (int Id in NekrozCard)
{
if (Id == CardId.Trishula && AI.Utils.IsAllEnemyBetterThanValue(2700, true) && Bot.HasInHand(CardId.DecisiveArmor))
{
AI.SelectCard(CardId.Trishula);
return true;
}
else if (Id == CardId.DecisiveArmor)
{
AI.SelectCard(CardId.DecisiveArmor);
return true;
}
else if (Id == CardId.Unicore && Bot.HasInHand(CardId.Kaleidoscope) && !Bot.HasInGraveyard(CardId.Shurit))
{
AI.SelectCard(CardId.Unicore);
return true;
}
else if (Id == CardId.Valkyrus)
{
if (IsTheLastPossibility())
{
AI.SelectCard(CardId.Valkyrus);
return true;
}
}
else if (Id == CardId.Gungnir)
{
if (IsTheLastPossibility())
{
AI.SelectCard(CardId.Gungnir);
return true;
}
}
else if (Id == CardId.Clausolas)
{
if (IsTheLastPossibility())
{
AI.SelectCard(CardId.Clausolas);
return true;
}
}
}
return false;
}
catch
{ return false; }
}
}
}
namespace WindBot.Game.AI.Decks
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("OldSchool", "AI_OldSchool")]
[Deck("OldSchool", "AI_OldSchool", "Easy")]
public class OldSchoolExecutor : DefaultExecutor
{
public enum CardId
public class CardId
{
Raigeki = 12580477
public const int AncientGearGolem = 83104731;
public const int Frostosaurus = 6631034;
public const int AlexandriteDragon = 43096270;
public const int GeneWarpedWarwolf = 69247929;
public const int GearGolemTheMovingFortress = 30190809;
public const int EvilswarmHeliotrope = 77542832;
public const int LusterDragon = 11091375;
public const int InsectKnight = 35052053;
public const int ArchfiendSoldier = 49881766;
public const int HeavyStorm = 19613556;
public const int DarkHole = 53129443;
public const int Raigeki = 12580477;
public const int HammerShot = 26412047;
public const int Fissure = 66788016;
public const int SwordsOfRevealingLight = 72302403;
public const int DoubleSummon = 43422537;
public const int MirrorForce = 44095762;
public const int DimensionalPrison = 70342110;
}
public OldSchoolExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, 19613556, DefaultHeavyStorm);
AddExecutor(ExecutorType.Activate, CardId.HeavyStorm, DefaultHeavyStorm);
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, 53129443, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, 26412047, DefaultHammerShot);
AddExecutor(ExecutorType.Activate, 66788016);
AddExecutor(ExecutorType.Activate, 72302403, SwordsOfRevealingLight);
AddExecutor(ExecutorType.Activate, 43422537, DoubleSummon);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, CardId.HammerShot, DefaultHammerShot);
AddExecutor(ExecutorType.Activate, CardId.Fissure);
AddExecutor(ExecutorType.Activate, CardId.SwordsOfRevealingLight, SwordsOfRevealingLight);
AddExecutor(ExecutorType.Activate, CardId.DoubleSummon, DoubleSummon);
AddExecutor(ExecutorType.Summon, 83104731, DefaultTributeSummon);
AddExecutor(ExecutorType.Summon, 6631034, DefaultTributeSummon);
AddExecutor(ExecutorType.SummonOrSet, 43096270);
AddExecutor(ExecutorType.SummonOrSet, 69247929);
AddExecutor(ExecutorType.MonsterSet, 30190809);
AddExecutor(ExecutorType.SummonOrSet, 77542832);
AddExecutor(ExecutorType.SummonOrSet, 11091375);
AddExecutor(ExecutorType.SummonOrSet, 35052053);
AddExecutor(ExecutorType.SummonOrSet, 49881766);
AddExecutor(ExecutorType.Summon, CardId.AncientGearGolem, DefaultTributeSummon);
AddExecutor(ExecutorType.Summon, CardId.Frostosaurus, DefaultTributeSummon);
AddExecutor(ExecutorType.SummonOrSet, CardId.AlexandriteDragon);
AddExecutor(ExecutorType.SummonOrSet, CardId.GeneWarpedWarwolf);
AddExecutor(ExecutorType.MonsterSet, CardId.GearGolemTheMovingFortress);
AddExecutor(ExecutorType.SummonOrSet, CardId.EvilswarmHeliotrope);
AddExecutor(ExecutorType.SummonOrSet, CardId.LusterDragon);
AddExecutor(ExecutorType.SummonOrSet, CardId.InsectKnight);
AddExecutor(ExecutorType.SummonOrSet, CardId.ArchfiendSoldier);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.Activate, 44095762, DefaultTrap);
AddExecutor(ExecutorType.Activate, 70342110, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.DimensionalPrison, DefaultTrap);
}
private int _lastDoubleSummon;
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (defender.IsMonsterInvincible() && !defender.IsMonsterDangerous() && attacker.Id == 83104731)
return true;
return base.OnPreBattleBetween(attacker, defender);
}
private bool DoubleSummon()
{
if (_lastDoubleSummon == Duel.Turn)
......@@ -56,7 +75,7 @@
if (Main.SummonableCards.Count == 1 && Main.SummonableCards[0].Level < 5)
{
bool canTribute = false;
foreach (ClientCard handCard in Duel.Fields[0].Hand)
foreach (ClientCard handCard in Bot.Hand)
{
if (handCard.IsMonster() && handCard.Level > 4 && handCard.Level < 6)
canTribute = true;
......@@ -66,7 +85,7 @@
}
int monsters = 0;
foreach (ClientCard handCard in Duel.Fields[0].Hand)
foreach (ClientCard handCard in Bot.Hand)
{
if (handCard.IsMonster())
monsters++;
......@@ -80,12 +99,12 @@
private bool SwordsOfRevealingLight()
{
foreach (ClientCard handCard in Duel.Fields[1].GetMonsters())
foreach (ClientCard handCard in Enemy.GetMonsters())
{
if (handCard.IsFacedown())
return true;
}
return AI.Utils.IsEnnemyBetter(true, false);
return AI.Utils.IsOneEnemyBetter(true);
}
}
}
\ No newline at end of file
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Qliphort", "AI_Qliphort")]
public class QliphortExecutor : DefaultExecutor
{
public class CardId
{
public const int Scout = 65518099;
public const int Stealth = 13073850;
public const int Shell = 90885155;
public const int Helix = 37991342;
public const int Carrier = 91907707;
public const int DarkHole = 53129443;
public const int CardOfDemise = 59750328;
public const int SummonersArt = 79816536;
public const int PotOfDuality = 98645731;
public const int Saqlifice = 17639150;
public const int MirrorForce = 44095762;
public const int TorrentialTribute = 53582587;
public const int DimensionalBarrier = 83326048;
public const int CompulsoryEvacuationDevice = 94192409;
public const int VanitysEmptiness = 5851097;
public const int SkillDrain = 82732705;
public const int SolemnStrike = 40605147;
public const int TheHugeRevolutionIsOver = 99188141;
}
bool CardOfDemiseUsed = false;
IList<int> LowScaleCards = new[]
{
CardId.Stealth,
CardId.Carrier
};
IList<int> HighScaleCards = new[]
{
CardId.Scout,
CardId.Shell,
CardId.Helix
};
public QliphortExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.SummonersArt);
AddExecutor(ExecutorType.Activate, CardId.Scout, ScoutActivate);
AddExecutor(ExecutorType.Activate, CardId.Scout, ScoutEffect);
AddExecutor(ExecutorType.Activate, CardId.Stealth, ScaleActivate);
AddExecutor(ExecutorType.Activate, CardId.Shell, ScaleActivate);
AddExecutor(ExecutorType.Activate, CardId.Helix, ScaleActivate);
AddExecutor(ExecutorType.Activate, CardId.Carrier, ScaleActivate);
AddExecutor(ExecutorType.Summon, NormalSummon);
AddExecutor(ExecutorType.SpSummon);
AddExecutor(ExecutorType.Activate, CardId.Saqlifice, SaqlificeEffect);
AddExecutor(ExecutorType.Activate, CardId.Stealth, StealthEffect);
AddExecutor(ExecutorType.Activate, CardId.Helix, HelixEffect);
AddExecutor(ExecutorType.Activate, CardId.Carrier, CarrierEffect);
AddExecutor(ExecutorType.SpellSet, CardId.SkillDrain, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.VanitysEmptiness, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.DimensionalBarrier, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.TorrentialTribute, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnStrike, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.MirrorForce, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.CompulsoryEvacuationDevice, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.TheHugeRevolutionIsOver, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.Saqlifice, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.SkillDrain, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.VanitysEmptiness, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.DimensionalBarrier, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.TorrentialTribute, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnStrike, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.MirrorForce, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.CompulsoryEvacuationDevice, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.TheHugeRevolutionIsOver, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.DarkHole, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.SummonersArt, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.PotOfDuality, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.Activate, CardId.PotOfDuality, PotOfDualityEffect);
AddExecutor(ExecutorType.SpellSet, CardId.CardOfDemise);
AddExecutor(ExecutorType.Activate, CardId.CardOfDemise, CardOfDemiseEffect);
AddExecutor(ExecutorType.SpellSet, CardId.Saqlifice, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.SkillDrain, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.VanitysEmptiness, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.DimensionalBarrier, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.TorrentialTribute, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnStrike, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.MirrorForce, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.CompulsoryEvacuationDevice, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.TheHugeRevolutionIsOver, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.DarkHole, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.SummonersArt, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.PotOfDuality, CardOfDemiseAcivated);
AddExecutor(ExecutorType.Activate, CardId.TheHugeRevolutionIsOver, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, CardId.SkillDrain, SkillDrainEffect);
AddExecutor(ExecutorType.Activate, CardId.VanitysEmptiness, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.CompulsoryEvacuationDevice, DefaultCompulsoryEvacuationDevice);
AddExecutor(ExecutorType.Activate, CardId.DimensionalBarrier, DefaultDimensionalBarrier);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.TorrentialTribute, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
public override bool OnSelectHand()
{
return true;
}
public override void OnNewTurn()
{
CardOfDemiseUsed = false;
}
public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, bool cancelable)
{
if (max <= min)
{
return null;
}
// pendulum summon, select the last cards
IList<ClientCard> selected = new List<ClientCard>();
for (int i = 1; i <= max; ++i)
{
ClientCard card = cards[cards.Count - i];
if (card.Id != CardId.Scout || (card.Location == CardLocation.Extra && !Duel.IsNewRule))
selected.Add(card);
}
if (selected.Count == 0)
selected.Add(cards[cards.Count - 1]);
return selected;
}
private bool NormalSummon()
{
if (Card.Id == CardId.Scout)
return false;
if (Card.Level < 8)
AI.SelectOption(1);
return true;
}
private bool SkillDrainEffect()
{
return (Duel.LifePoints[0] > 1000) && DefaultUniqueTrap();
}
private bool PotOfDualityEffect()
{
AI.SelectCard(new[]
{
CardId.Scout,
CardId.SkillDrain,
CardId.VanitysEmptiness,
CardId.DimensionalBarrier,
CardId.Stealth,
CardId.Shell,
CardId.Helix,
CardId.Carrier,
CardId.SolemnStrike,
CardId.CardOfDemise
});
return !ShouldPendulum();
}
private bool CardOfDemiseEffect()
{
if (AI.Utils.IsTurn1OrMain2() && !ShouldPendulum())
{
CardOfDemiseUsed = true;
return true;
}
return false;
}
private bool TrapSetUnique()
{
foreach (ClientCard card in Bot.GetSpells())
{
if (card.Id == Card.Id)
return false;
}
return TrapSetWhenZoneFree();
}
private bool TrapSetWhenZoneFree()
{
return Bot.GetSpellCountWithoutField() < 4;
}
private bool CardOfDemiseAcivated()
{
return CardOfDemiseUsed;
}
private bool SaqlificeEffect()
{
if (Card.Location == CardLocation.Grave)
{
ClientCard l = AI.Utils.GetPZone(0, 0);
ClientCard r = AI.Utils.GetPZone(0, 1);
if (l == null && r == null)
AI.SelectCard(CardId.Scout);
}
return true;
}
private bool ScoutActivate()
{
if (Card.Location != CardLocation.Hand)
return false;
ClientCard l = AI.Utils.GetPZone(0, 0);
ClientCard r = AI.Utils.GetPZone(0, 1);
if (l == null && r == null)
return true;
if (l == null && r.RScale != Card.LScale)
return true;
if (r == null && l.LScale != Card.RScale)
return true;
return false;
}
private bool ScaleActivate()
{
if (!Card.HasType(CardType.Pendulum) || Card.Location != CardLocation.Hand)
return false;
int count = 0;
foreach (ClientCard card in Bot.Hand.GetMonsters())
{
if (!Card.Equals(card))
count++;
}
foreach (ClientCard card in Bot.ExtraDeck.GetFaceupPendulumMonsters())
{
count++;
}
ClientCard l = AI.Utils.GetPZone(0, 0);
ClientCard r = AI.Utils.GetPZone(0, 1);
if (l == null && r == null)
{
if (CardOfDemiseUsed)
return true;
bool pair = false;
foreach (ClientCard card in Bot.Hand.GetMonsters())
{
if (card.RScale != Card.LScale)
{
pair = true;
count--;
break;
}
}
return pair && count>1;
}
if (l == null && r.RScale != Card.LScale)
return count > 1 || CardOfDemiseUsed;
if (r == null && l.LScale != Card.RScale)
return count > 1 || CardOfDemiseUsed;
return false;
}
private bool ScoutEffect()
{
if (Card.Location == CardLocation.Hand)
return false;
int count = 0;
int handcount = 0;
int fieldcount = 0;
foreach (ClientCard card in Bot.Hand.GetMonsters())
{
count++;
handcount++;
}
foreach (ClientCard card in Bot.MonsterZone.GetMonsters())
{
fieldcount++;
}
foreach (ClientCard card in Bot.ExtraDeck.GetFaceupPendulumMonsters())
{
count++;
}
if (count>0 && !Bot.HasInHand(LowScaleCards))
{
AI.SelectCard(LowScaleCards);
}
else if (handcount>0 || fieldcount>0)
{
AI.SelectCard(new[]
{
CardId.Saqlifice,
CardId.Shell,
CardId.Helix
});
}
else
{
AI.SelectCard(HighScaleCards);
}
return Duel.LifePoints[0] > 800;
}
private bool StealthEffect()
{
if (Card.Location == CardLocation.Hand)
return false;
ClientCard target = AI.Utils.GetBestEnemyCard();
if (target != null)
{
AI.SelectCard(target);
return true;
}
return false;
}
private bool CarrierEffect()
{
if (Card.Location == CardLocation.Hand)
return false;
ClientCard target = AI.Utils.GetBestEnemyMonster();
if (target != null)
{
AI.SelectCard(target);
return true;
}
return false;
}
private bool HelixEffect()
{
if (Card.Location == CardLocation.Hand)
return false;
ClientCard target = AI.Utils.GetBestEnemySpell();
if (target != null)
{
AI.SelectCard(target);
return true;
}
return false;
}
private bool ShouldPendulum()
{
ClientCard l = AI.Utils.GetPZone(0, 0);
ClientCard r = AI.Utils.GetPZone(0, 1);
if (l != null && r != null && l.LScale != r.RScale)
{
int count = 0;
foreach (ClientCard card in Bot.Hand.GetMonsters())
{
count++;
}
foreach (ClientCard card in Bot.ExtraDeck.GetFaceupPendulumMonsters())
{
count++;
}
return count > 1;
}
return false;
}
}
}
\ No newline at end of file
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Rainbow", "AI_Rainbow")]
class RainbowExecutor : DefaultExecutor
{
public class CardId
{
public const int MysteryShellDragon = 18108166;
public const int PhantomGryphon = 74852097;
public const int MasterPendulumTheDracoslayer = 75195825;
public const int AngelTrumpeter = 87979586;
public const int MetalfoesGoldriver = 33256280;
public const int MegalosmasherX = 81823360;
public const int RescueRabbit = 85138716;
public const int UnexpectedDai = 911883;
public const int HarpiesFeatherDuster = 18144506;
public const int PotOfDesires = 35261759;
public const int MonsterReborn = 83764718;
public const int SmashingGround = 97169186;
public const int QuakingMirrorForce = 40838625;
public const int DrowningMirrorForce = 47475363;
public const int BlazingMirrorForce = 75249652;
public const int StormingMirrorForce = 5650082;
public const int MirrorForce = 44095762;
public const int DarkMirrorForce = 20522190;
public const int BottomlessTrapHole = 29401950;
public const int TraptrixTrapHoleNightmare = 29616929;
public const int StarlightRoad = 58120309;
public const int ScarlightRedDragonArchfiend = 80666118;
public const int IgnisterProminenceTheBlastingDracoslayer = 18239909;
public const int StardustDragon = 44508094;
public const int NumberS39UtopiatheLightning = 56832966;
public const int Number37HopeWovenDragonSpiderShark = 37279508;
public const int Number39Utopia = 84013237;
public const int EvolzarLaggia = 74294676;
public const int Number59CrookedCook = 82697249;
public const int CastelTheSkyblasterMusketeer = 82633039;
public const int StarliegePaladynamo = 61344030;
public const int LightningChidori = 22653490;
public const int EvilswarmExcitonKnight = 46772449;
public const int GagagaCowboy = 12014404;
public const int EvilswarmNightmare = 359563;
public const int TraptrixRafflesia = 6511113;
}
private bool NormalSummoned = false;
public RainbowExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, CardId.UnexpectedDai, UnexpectedDaiEffect);
AddExecutor(ExecutorType.Summon, CardId.RescueRabbit);
AddExecutor(ExecutorType.Activate, CardId.RescueRabbit, RescueRabbitEffect);
AddExecutor(ExecutorType.Activate, CardId.PotOfDesires, DefaultPotOfDesires);
AddExecutor(ExecutorType.Summon, CardId.AngelTrumpeter, AngelTrumpeterSummon);
AddExecutor(ExecutorType.Summon, CardId.MegalosmasherX, MegalosmasherXSummon);
AddExecutor(ExecutorType.Summon, CardId.MasterPendulumTheDracoslayer, MasterPendulumTheDracoslayerSummon);
AddExecutor(ExecutorType.Summon, CardId.MysteryShellDragon, MysteryShellDragonSummon);
AddExecutor(ExecutorType.Summon, CardId.PhantomGryphon, PhantomGryphonSummon);
AddExecutor(ExecutorType.Summon, CardId.MetalfoesGoldriver, MetalfoesGoldriverSummon);
AddExecutor(ExecutorType.Summon, NormalSummon);
AddExecutor(ExecutorType.SpSummon, CardId.IgnisterProminenceTheBlastingDracoslayer, IgnisterProminenceTheBlastingDracoslayerSummon);
AddExecutor(ExecutorType.Activate, CardId.IgnisterProminenceTheBlastingDracoslayer, IgnisterProminenceTheBlastingDracoslayerEffect);
AddExecutor(ExecutorType.SpSummon, CardId.GagagaCowboy, GagagaCowboySummon);
AddExecutor(ExecutorType.Activate, CardId.GagagaCowboy);
AddExecutor(ExecutorType.SpSummon, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightSummon);
AddExecutor(ExecutorType.Activate, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightEffect);
AddExecutor(ExecutorType.SpSummon, CardId.EvolzarLaggia, EvolzarLaggiaSummon);
AddExecutor(ExecutorType.Activate, CardId.EvolzarLaggia, EvolzarLaggiaEffect);
AddExecutor(ExecutorType.SpSummon, CardId.EvilswarmNightmare, EvilswarmNightmareSummon);
AddExecutor(ExecutorType.Activate, CardId.EvilswarmNightmare);
AddExecutor(ExecutorType.SpSummon, CardId.StarliegePaladynamo, StarliegePaladynamoSummon);
AddExecutor(ExecutorType.Activate, CardId.StarliegePaladynamo, StarliegePaladynamoEffect);
AddExecutor(ExecutorType.SpSummon, CardId.LightningChidori, LightningChidoriSummon);
AddExecutor(ExecutorType.Activate, CardId.LightningChidori, LightningChidoriEffect);
AddExecutor(ExecutorType.SpSummon, CardId.Number37HopeWovenDragonSpiderShark, Number37HopeWovenDragonSpiderSharkSummon);
AddExecutor(ExecutorType.Activate, CardId.Number37HopeWovenDragonSpiderShark);
AddExecutor(ExecutorType.SpSummon, CardId.TraptrixRafflesia, TraptrixRafflesiaSummon);
AddExecutor(ExecutorType.Activate, CardId.TraptrixRafflesia);
AddExecutor(ExecutorType.Activate, CardId.SmashingGround, DefaultSmashingGround);
AddExecutor(ExecutorType.SpSummon, CardId.CastelTheSkyblasterMusketeer, DefaultCastelTheSkyblasterMusketeerSummon);
AddExecutor(ExecutorType.Activate, CardId.CastelTheSkyblasterMusketeer, DefaultCastelTheSkyblasterMusketeerEffect);
AddExecutor(ExecutorType.SpSummon, CardId.IgnisterProminenceTheBlastingDracoslayer, IgnisterProminenceTheBlastingDracoslayerSummon);
AddExecutor(ExecutorType.Activate, CardId.IgnisterProminenceTheBlastingDracoslayer, IgnisterProminenceTheBlastingDracoslayerEffect);
AddExecutor(ExecutorType.SpSummon, CardId.ScarlightRedDragonArchfiend, DefaultScarlightRedDragonArchfiendSummon);
AddExecutor(ExecutorType.Activate, CardId.ScarlightRedDragonArchfiend, DefaultScarlightRedDragonArchfiendEffect);
AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.SpSummon, CardId.StardustDragon, DefaultStardustDragonSummon);
AddExecutor(ExecutorType.Activate, CardId.StardustDragon, DefaultStardustDragonEffect);
AddExecutor(ExecutorType.SpSummon, CardId.Number59CrookedCook, Number59CrookedCookSummon);
AddExecutor(ExecutorType.Activate, CardId.Number59CrookedCook, Number59CrookedCookEffect);
AddExecutor(ExecutorType.SpellSet, CardId.StarlightRoad, TrapSet);
AddExecutor(ExecutorType.SpellSet, CardId.QuakingMirrorForce, TrapSet);
AddExecutor(ExecutorType.SpellSet, CardId.DrowningMirrorForce, TrapSet);
AddExecutor(ExecutorType.SpellSet, CardId.BlazingMirrorForce, TrapSet);
AddExecutor(ExecutorType.SpellSet, CardId.StormingMirrorForce, TrapSet);
AddExecutor(ExecutorType.SpellSet, CardId.MirrorForce, TrapSet);
AddExecutor(ExecutorType.SpellSet, CardId.DarkMirrorForce, TrapSet);
AddExecutor(ExecutorType.SpellSet, CardId.BottomlessTrapHole, TrapSet);
AddExecutor(ExecutorType.SpellSet, CardId.TraptrixTrapHoleNightmare, TrapSet);
AddExecutor(ExecutorType.Activate, CardId.StarlightRoad, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.QuakingMirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.DrowningMirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.BlazingMirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.StormingMirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.DarkMirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.BottomlessTrapHole, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.TraptrixTrapHoleNightmare, DefaultUniqueTrap);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
public override void OnNewTurn()
{
NormalSummoned = false;
}
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (!defender.IsMonsterHasPreventActivationEffectInBattle())
{
if (Bot.HasInMonstersZone(CardId.Number37HopeWovenDragonSpiderShark, true, true))
attacker.RealPower = attacker.RealPower + 1000;
}
return base.OnPreBattleBetween(attacker, defender);
}
private bool UnexpectedDaiEffect()
{
if (Bot.HasInHand(CardId.RescueRabbit) || NormalSummoned)
AI.SelectCard(new[]
{
CardId.MysteryShellDragon,
CardId.PhantomGryphon,
CardId.MegalosmasherX
});
else if (AI.Utils.IsTurn1OrMain2())
{
if (Bot.HasInHand(CardId.MysteryShellDragon))
AI.SelectCard(CardId.MysteryShellDragon);
else if (Bot.HasInHand(CardId.MegalosmasherX))
AI.SelectCard(CardId.MegalosmasherX);
else if (Bot.HasInHand(CardId.AngelTrumpeter))
AI.SelectCard(CardId.AngelTrumpeter);
}
else
{
if (Bot.HasInHand(CardId.MegalosmasherX))
AI.SelectCard(CardId.MegalosmasherX);
else if (Bot.HasInHand(CardId.MasterPendulumTheDracoslayer))
AI.SelectCard(CardId.MasterPendulumTheDracoslayer);
else if (Bot.HasInHand(CardId.PhantomGryphon))
AI.SelectCard(CardId.PhantomGryphon);
else if (Bot.HasInHand(CardId.AngelTrumpeter))
AI.SelectCard(new[]
{
CardId.MetalfoesGoldriver,
CardId.MasterPendulumTheDracoslayer
});
}
return true;
}
private bool RescueRabbitEffect()
{
if (AI.Utils.IsTurn1OrMain2())
{
AI.SelectCard(new[]
{
CardId.MegalosmasherX,
CardId.MysteryShellDragon
});
}
else
{
AI.SelectCard(new[]
{
CardId.MasterPendulumTheDracoslayer,
CardId.PhantomGryphon,
CardId.MegalosmasherX,
CardId.MetalfoesGoldriver,
CardId.AngelTrumpeter
});
}
return true;
}
private bool MysteryShellDragonSummon()
{
return Bot.HasInMonstersZone(CardId.MysteryShellDragon);
}
private bool PhantomGryphonSummon()
{
return Bot.HasInMonstersZone(CardId.PhantomGryphon);
}
private bool MasterPendulumTheDracoslayerSummon()
{
return Bot.HasInMonstersZone(CardId.MasterPendulumTheDracoslayer);
}
private bool AngelTrumpeterSummon()
{
return Bot.HasInMonstersZone(CardId.AngelTrumpeter);
}
private bool MetalfoesGoldriverSummon()
{
return Bot.HasInMonstersZone(CardId.MetalfoesGoldriver);
}
private bool MegalosmasherXSummon()
{
return Bot.HasInMonstersZone(CardId.MegalosmasherX);
}
private bool NormalSummon()
{
return true;
}
private bool GagagaCowboySummon()
{
if (Duel.LifePoints[1] <= 800)
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
return false;
}
private bool IgnisterProminenceTheBlastingDracoslayerSummon()
{
return AI.Utils.GetProblematicEnemyCard() != null;
}
private bool IgnisterProminenceTheBlastingDracoslayerEffect()
{
if (ActivateDescription == AI.Utils.GetStringId(CardId.IgnisterProminenceTheBlastingDracoslayer, 1))
return true;
ClientCard target1 = null;
ClientCard target2 = AI.Utils.GetProblematicEnemyCard();
List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells)
{
if (spell.HasType(CardType.Pendulum) && !spell.Equals(target2))
{
target1 = spell;
break;
}
}
List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (monster.HasType(CardType.Pendulum) && !monster.Equals(target2))
{
target1 = monster;
break;
}
}
if (target2 == null && target1 != null)
{
foreach (ClientCard spell in spells)
{
if (!spell.Equals(target1))
{
target2 = spell;
break;
}
}
foreach (ClientCard monster in monsters)
{
if (!monster.Equals(target1))
{
target2 = monster;
break;
}
}
}
if (target2 == null)
return false;
AI.SelectCard(target1);
AI.SelectNextCard(target2);
return true;
}
private bool Number37HopeWovenDragonSpiderSharkSummon()
{
return AI.Utils.IsAllEnemyBetterThanValue(1700, false) && !AI.Utils.IsOneEnemyBetterThanValue(3600, true);
}
private bool LightningChidoriSummon()
{
foreach (ClientCard monster in Enemy.GetMonsters())
{
if (monster.IsFacedown())
{
return true;
}
}
foreach (ClientCard spell in Enemy.GetSpells())
{
if (spell.IsFacedown())
{
return true;
}
}
return AI.Utils.GetProblematicEnemyCard() != null;
}
private bool LightningChidoriEffect()
{
ClientCard problematicCard = AI.Utils.GetProblematicEnemyCard();
AI.SelectNextCard(problematicCard);
return true;
}
private bool EvolzarLaggiaSummon()
{
return (AI.Utils.IsAllEnemyBetterThanValue(2000, false) && !AI.Utils.IsOneEnemyBetterThanValue(2400, true)) || AI.Utils.IsTurn1OrMain2();
}
private bool EvilswarmNightmareSummon()
{
if (AI.Utils.IsTurn1OrMain2())
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
return false;
}
private bool TraptrixRafflesiaSummon()
{
if (AI.Utils.IsTurn1OrMain2() && (Bot.GetRemainingCount(CardId.BottomlessTrapHole, 1) + Bot.GetRemainingCount(CardId.TraptrixTrapHoleNightmare, 1)) > 0)
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
return false;
}
private bool Number59CrookedCookSummon()
{
return ((Bot.GetMonsterCount() + Bot.GetSpellCount() - 2) <= 1) &&
((AI.Utils.IsOneEnemyBetter() && !AI.Utils.IsOneEnemyBetterThanValue(2300, true)) || AI.Utils.IsTurn1OrMain2());
}
private bool Number59CrookedCookEffect()
{
if (Duel.Player == 0)
{
if (AI.Utils.IsChainTarget(Card))
return true;
}
else
{
if ((Bot.GetMonsterCount() + Bot.GetSpellCount() -1) <= 1)
return true;
}
return false;
}
private bool EvolzarLaggiaEffect()
{
return DefaultTrap();
}
private bool StarliegePaladynamoSummon()
{
return StarliegePaladynamoEffect();
}
private bool StarliegePaladynamoEffect()
{
ClientCard result = AI.Utils.GetOneEnemyBetterThanValue(2000, true);
if (result != null)
{
AI.SelectNextCard(result);
return true;
}
return false;
}
private bool TrapSet()
{
return !Bot.HasInMonstersZone(CardId.Number59CrookedCook, true, true);
}
}
}
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
using YGOSharp.OCGWrapper.Enums;
namespace DevBot.Game.AI.Decks
namespace WindBot.Game.AI.Decks
{
[Deck("Rank V", "AI_Rank5")]
public class Rank5Executor : DefaultExecutor
{
public enum CardId
public class CardId
{
MistArchfiend = 28601770,
PowerInvader = 18842395,
CyberDragon = 70095155,
ViceDragon = 54343893,
TheTricky = 14778250,
WindUpSoldier = 12299841,
StarDrawing = 24610207,
GagagaMagician = 26082117,
InstantFusion = 1845204,
DoubleSummon = 43422537,
MysticalSpaceTyphoon = 5318639,
BookOfMoon = 14087893,
XyzUnit = 13032689,
XyzReborn = 26708437,
MirrorForce = 44095762,
TorrentialTribute = 53582587,
SakuretsuArmor = 56120475,
XyzEffect = 58628539,
XyzVeil = 96457619,
FlameSwordsman = 45231177,
DigvorzhakKingOfHeavyIndustry = 29515122,
TirasKeeperOfGenesis = 31386180,
AdreusKeeperOfArmageddon = 94119480,
Number61Volcasaurus = 29669359,
Number19Freezerdon = 55067058
public const int MistArchfiend = 28601770;
public const int CyberDragon = 70095154;
public const int ZWEagleClaw = 29353756;
public const int SolarWindJammer = 33911264;
public const int QuickdrawSynchron = 20932152;
public const int WindUpSoldier = 12299841;
public const int StarDrawing = 24610207;
public const int ChronomalyGoldenJet = 88552992;
public const int InstantFusion = 1845204;
public const int DoubleSummon = 43422537;
public const int MysticalSpaceTyphoon = 5318639;
public const int BookOfMoon = 14087893;
public const int XyzUnit = 13032689;
public const int XyzReborn = 26708437;
public const int MirrorForce = 44095762;
public const int TorrentialTribute = 53582587;
public const int XyzVeil = 96457619;
public const int PanzerDragon = 72959823;
public const int GaiaDragonTheThunderCharger = 91949988;
public const int CyberDragonInfinity = 10443957;
public const int TirasKeeperOfGenesis = 31386180;
public const int Number61Volcasaurus = 29669359;
public const int SharkFortress = 50449881;
public const int CyberDragonNova = 58069384;
}
private bool NormalSummoned = false;
private bool InstantFusionUsed = false;
private bool DoubleSummonUsed = false;
private bool CyberDragonInfinitySummoned = false;
private bool Number61VolcasaurusUsed = false;
public Rank5Executor(GameAI ai, Duel duel)
: base(ai, duel)
{
// Quick spells
AddExecutor(ExecutorType.Activate, (int)CardId.BookOfMoon, DefaultBookOfMoon);
AddExecutor(ExecutorType.Activate, (int)CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.BookOfMoon, DefaultBookOfMoon);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
// Cyber Dragon Infinity first
AddExecutor(ExecutorType.SpSummon, CardId.CyberDragonNova, CyberDragonNovaSummon);
AddExecutor(ExecutorType.Activate, CardId.CyberDragonNova, CyberDragonNovaEffect);
AddExecutor(ExecutorType.SpSummon, CardId.CyberDragonInfinity, CyberDragonInfinitySummon);
AddExecutor(ExecutorType.Activate, CardId.CyberDragonInfinity, CyberDragonInfinityEffect);
// XYZ Monsters: Effect
AddExecutor(ExecutorType.Activate, (int)CardId.DigvorzhakKingOfHeavyIndustry);
AddExecutor(ExecutorType.Activate, (int)CardId.TirasKeeperOfGenesis);
AddExecutor(ExecutorType.Activate, (int)CardId.AdreusKeeperOfArmageddon);
AddExecutor(ExecutorType.Activate, (int)CardId.Number61Volcasaurus);
AddExecutor(ExecutorType.Activate, (int)CardId.Number19Freezerdon);
// Level 5 monsters without side effects
AddExecutor(ExecutorType.SpSummon, CardId.CyberDragon);
AddExecutor(ExecutorType.SpSummon, CardId.ZWEagleClaw);
AddExecutor(ExecutorType.Summon, CardId.ChronomalyGoldenJet, NormalSummon);
AddExecutor(ExecutorType.Activate, CardId.ChronomalyGoldenJet, ChronomalyGoldenJetEffect);
AddExecutor(ExecutorType.Summon, CardId.StarDrawing, NormalSummon);
AddExecutor(ExecutorType.Summon, CardId.WindUpSoldier, NormalSummon);
AddExecutor(ExecutorType.Activate, CardId.WindUpSoldier, WindUpSoldierEffect);
// Summon LV.5 Monsters
AddExecutor(ExecutorType.SpSummon, (int)CardId.CyberDragon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.ViceDragon);
AddExecutor(ExecutorType.Summon, (int)CardId.PowerInvader, PowerInvader);
AddExecutor(ExecutorType.Summon, (int)CardId.WindUpSoldier);
AddExecutor(ExecutorType.Summon, (int)CardId.StarDrawing);
AddExecutor(ExecutorType.Summon, (int)CardId.GagagaMagician);
// XYZ Monsters: Summon
AddExecutor(ExecutorType.SpSummon, CardId.Number61Volcasaurus, Number61VolcasaurusSummon);
AddExecutor(ExecutorType.Activate, CardId.Number61Volcasaurus, Number61VolcasaurusEffect);
AddExecutor(ExecutorType.SpSummon, CardId.TirasKeeperOfGenesis);
AddExecutor(ExecutorType.Activate, CardId.TirasKeeperOfGenesis, TirasKeeperOfGenesisEffect);
AddExecutor(ExecutorType.SpSummon, CardId.SharkFortress);
AddExecutor(ExecutorType.Activate, CardId.SharkFortress);
AddExecutor(ExecutorType.SpSummon, (int)CardId.TheTricky, TheTricky);
AddExecutor(ExecutorType.SpSummon, CardId.GaiaDragonTheThunderCharger, GaiaDragonTheThunderChargerSummon);
AddExecutor(ExecutorType.Summon, (int)CardId.MistArchfiend, MistArchfiend);
AddExecutor(ExecutorType.Activate, (int)CardId.InstantFusion, IsAnotherRank5Available);
AddExecutor(ExecutorType.Activate, (int)CardId.GagagaMagician, GagagaMagicianEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.WindUpSoldier, WindUpSoldierEffect);
// Level 5 monsters with side effects
AddExecutor(ExecutorType.SpSummon, CardId.SolarWindJammer, SolarWindJammerSummon);
AddExecutor(ExecutorType.SpSummon, CardId.QuickdrawSynchron, QuickdrawSynchronSummon);
AddExecutor(ExecutorType.Summon, CardId.MistArchfiend, MistArchfiendSummon);
AddExecutor(ExecutorType.Activate, CardId.InstantFusion, InstantFusionEffect);
// Useful spells
AddExecutor(ExecutorType.Activate, (int)CardId.DoubleSummon, DoubleSummon);
AddExecutor(ExecutorType.Activate, (int)CardId.XyzUnit, XyzUnit);
AddExecutor(ExecutorType.Activate, CardId.DoubleSummon, DoubleSummonEffect);
AddExecutor(ExecutorType.Activate, CardId.XyzUnit, XyzUnitEffect);
// XYZ Monsters: Summon
AddExecutor(ExecutorType.SpSummon, (int)CardId.DigvorzhakKingOfHeavyIndustry, SummonXYZ);
AddExecutor(ExecutorType.SpSummon, (int)CardId.TirasKeeperOfGenesis, SummonXYZ);
AddExecutor(ExecutorType.SpSummon, (int)CardId.AdreusKeeperOfArmageddon, SummonXYZ);
AddExecutor(ExecutorType.SpSummon, (int)CardId.Number61Volcasaurus, SummonXYZ);
AddExecutor(ExecutorType.SpSummon, (int)CardId.Number19Freezerdon, SummonXYZ);
// Xyz Reborn
AddExecutor(ExecutorType.Activate, (int)CardId.XyzReborn);
AddExecutor(ExecutorType.Activate, CardId.XyzReborn, XyzRebornEffect);
AddExecutor(ExecutorType.Activate, CardId.PanzerDragon, PanzerDragonEffect);
// Reposition
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
......@@ -88,11 +99,9 @@ namespace DevBot.Game.AI.Decks
// Set and activate traps
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, (int)CardId.XyzVeil, XyzVeil);
AddExecutor(ExecutorType.Activate, (int)CardId.XyzEffect, XyzEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.TorrentialTribute, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Activate, (int)CardId.MirrorForce, DefaultTrap);
AddExecutor(ExecutorType.Activate, (int)CardId.SakuretsuArmor, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.XyzVeil, XyzVeilEffect);
AddExecutor(ExecutorType.Activate, CardId.TorrentialTribute, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultTrap);
}
public override bool OnSelectHand()
......@@ -100,146 +109,233 @@ namespace DevBot.Game.AI.Decks
return false;
}
private bool SummonXYZ()
public override void OnNewTurn()
{
List<ClientCard> monsters = Duel.Fields[0].GetMonsters();
foreach (ClientCard monster in monsters)
if (monster.Id == Card.Id)
return false;
NormalSummoned = false;
InstantFusionUsed = false;
DoubleSummonUsed = false;
CyberDragonInfinitySummoned = false;
Number61VolcasaurusUsed = false;
}
private bool NormalSummon()
{
NormalSummoned = true;
return true;
}
private bool PowerInvader()
private bool SolarWindJammerSummon()
{
if (Duel.Fields[1].GetMonsterCount() >= 2)
{
AI.SelectOption(1);
return true;
}
return false;
if (!NeedLV5())
return false;
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool TheTricky()
private bool QuickdrawSynchronSummon()
{
IList<ClientCard> hand = Duel.Fields[0].Hand;
foreach (ClientCard card in hand)
{
if (card.Id == (int)CardId.TheTricky && card != Card)
if (!NeedLV5())
return false;
AI.SelectCard(new[]
{
AI.SelectCard(card);
return true;
}
}
if (Duel.Fields[0].HasInHand((int)CardId.PowerInvader))
{
AI.SelectCard((int)CardId.PowerInvader);
CardId.QuickdrawSynchron,
CardId.ZWEagleClaw,
CardId.SolarWindJammer,
CardId.CyberDragon,
CardId.MistArchfiend,
CardId.WindUpSoldier,
CardId.StarDrawing,
CardId.ChronomalyGoldenJet
});
return true;
}
private bool MistArchfiendSummon()
{
if (!NeedLV5())
return false;
AI.SelectOption(1);
NormalSummoned = true;
return true;
}
private bool InstantFusionEffect()
{
if (!NeedLV5())
return false;
InstantFusionUsed = true;
return true;
}
private bool NeedLV5()
{
if (HaveOtherLV5OnField())
return true;
}
if (Duel.Fields[0].HasInHand((int)CardId.CyberDragon))
int lv5Count = 0;
foreach (ClientCard card in Bot.Hand)
{
AI.SelectCard((int)CardId.CyberDragon);
return true;
if (card.Id == CardId.SolarWindJammer && Bot.GetMonsterCount() == 0)
++lv5Count;
if (card.Id == CardId.InstantFusion && !InstantFusionUsed)
++lv5Count;
if (card.Id == CardId.QuickdrawSynchron && Bot.Hand.ContainsMonsterWithLevel(4))
++lv5Count;
if (card.Id == CardId.MistArchfiend && !NormalSummoned)
++lv5Count;
if (card.Id == CardId.DoubleSummon && DoubleSummonEffect())
++lv5Count;
}
if (Duel.Fields[0].HasInHand((int)CardId.ViceDragon))
if (lv5Count >= 2)
return true;
return false;
}
private bool WindUpSoldierEffect()
{
return HaveOtherLV5OnField();
}
private bool ChronomalyGoldenJetEffect()
{
return Card.Level == 4;
}
private bool DoubleSummonEffect()
{
if (!NormalSummoned || DoubleSummonUsed)
return false;
if (Bot.HasInHand(new[]
{
CardId.MistArchfiend,
CardId.WindUpSoldier,
CardId.StarDrawing,
CardId.ChronomalyGoldenJet
}))
{
AI.SelectCard((int)CardId.ViceDragon);
NormalSummoned = false;
DoubleSummonUsed = true;
return true;
}
if (Duel.Fields[0].HasInHand((int)CardId.XyzVeil))
return false;
}
private bool CyberDragonNovaSummon()
{
return !CyberDragonInfinitySummoned;
}
private bool CyberDragonNovaEffect()
{
if (ActivateDescription == AI.Utils.GetStringId(CardId.CyberDragonNova, 0))
{
AI.SelectCard((int)CardId.XyzVeil);
return true;
}
if (Duel.Fields[0].HasInHand((int)CardId.XyzEffect))
else if (Card.Location == CardLocation.Grave)
{
AI.SelectCard((int)CardId.XyzEffect);
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
if (Duel.Fields[0].HasInHand((int)CardId.MysticalSpaceTyphoon))
else
{
AI.SelectCard((int)CardId.MysticalSpaceTyphoon);
return true;
return false;
}
return false;
}
private bool MistArchfiend()
private bool CyberDragonInfinitySummon()
{
if (!IsAnotherRank5Available())
return false;
AI.SelectOption(1);
CyberDragonInfinitySummoned = true;
return true;
}
private bool IsAnotherRank5Available()
private bool CyberDragonInfinityEffect()
{
List<ClientCard> monsters = Duel.Fields[0].GetMonsters();
foreach (ClientCard monster in monsters)
if (CurrentChain.Count > 0)
{
if (monster.HasType(CardType.Monster) &&
!monster.HasType(CardType.Xyz) &&
(monster.Level == 5 ||
monster.Id == (int)CardId.WindUpSoldier) ||
monster.Id == (int)CardId.StarDrawing ||
monster.Id == (int)CardId.GagagaMagician)
return true;
return LastChainPlayer == 1;
}
int mistCount = 0;
IList<ClientCard> hand = Duel.Fields[0].Hand;
foreach (ClientCard card in hand)
else
{
if (card.Id == (int)CardId.InstantFusion && Card.Id != card.Id)
return true;
if (card.Id == (int)CardId.MistArchfiend && Card.Id != card.Id)
ClientCard bestmonster = null;
foreach (ClientCard monster in Enemy.GetMonsters())
{
if (monster.IsAttack() && (bestmonster == null || monster.Attack >= bestmonster.Attack))
bestmonster = monster;
}
if (bestmonster != null)
{
AI.SelectCard(bestmonster);
return true;
if (card.Id == (int)CardId.MistArchfiend)
++mistCount;
}
}
if (mistCount >= 2)
return true;
return false;
}
private bool WindUpSoldierEffect()
private bool Number61VolcasaurusSummon()
{
List<ClientCard> monsters = Duel.Fields[0].GetMonsters();
foreach (ClientCard monster in monsters)
return AI.Utils.IsOneEnemyBetterThanValue(2000, false);
}
private bool Number61VolcasaurusEffect()
{
ClientCard target = AI.Utils.GetProblematicEnemyMonster(2000);
if (target != null)
{
if (monster.HasType(CardType.Monster) &&
!monster.HasType(CardType.Xyz) &&
(monster.Level == 5 ||
monster.Id == (int)CardId.StarDrawing) ||
monster.Id == (int)CardId.GagagaMagician)
return true;
AI.SelectCard(CardId.CyberDragon);
AI.SelectNextCard(target);
Number61VolcasaurusUsed = true;
return true;
}
return false;
}
private bool GagagaMagicianEffect()
private bool TirasKeeperOfGenesisEffect()
{
AI.SelectNumber(5);
ClientCard target = AI.Utils.GetProblematicEnemyCard();
if (target == null)
target = AI.Utils.GetBestEnemyCard();
if (target != null)
{
AI.SelectCard(target);
}
return true;
}
private bool DoubleSummon()
private bool GaiaDragonTheThunderChargerSummon()
{
IList<ClientCard> hand = Duel.Fields[0].Hand;
foreach (ClientCard card in hand)
if (Number61VolcasaurusUsed && Bot.HasInMonstersZone(CardId.Number61Volcasaurus))
{
if (card.Id == (int)CardId.PowerInvader && Duel.Fields[1].GetMonsterCount() >= 2)
return true;
if (card.Id == (int)CardId.WindUpSoldier ||
card.Id == (int)CardId.StarDrawing ||
card.Id == (int)CardId.GagagaMagician)
AI.SelectCard(CardId.Number61Volcasaurus);
return true;
}
foreach (ClientCard monster in Bot.GetMonsters())
{
if (monster.HasType(CardType.Xyz) && !monster.HasXyzMaterial())
{
AI.SelectCard(monster);
return true;
}
}
return false;
}
private bool XyzUnit()
private bool XyzRebornEffect()
{
if (!UniqueFaceupSpell())
return false;
AI.SelectCard(new[]
{
CardId.CyberDragonInfinity,
CardId.CyberDragonNova,
CardId.TirasKeeperOfGenesis,
CardId.SharkFortress,
CardId.Number61Volcasaurus
});
return true;
}
private bool XyzUnitEffect()
{
List<ClientCard> monsters = Duel.Fields[0].GetMonsters();
foreach (ClientCard monster in monsters)
foreach (ClientCard monster in Bot.GetMonsters())
{
if (monster.HasType(CardType.Xyz))
{
......@@ -250,57 +346,41 @@ namespace DevBot.Game.AI.Decks
return false;
}
private bool XyzVeil()
private bool PanzerDragonEffect()
{
List<ClientCard> spells = Duel.Fields[0].GetSpells();
foreach (ClientCard spell in spells)
ClientCard target = AI.Utils.GetBestEnemyCard();
if (target != null)
{
if (spell.Id == (int)CardId.XyzVeil && spell != Card)
return false;
AI.SelectCard(target);
return true;
}
List<ClientCard> monsters = Duel.Fields[0].GetMonsters();
foreach (ClientCard monster in monsters)
return false;
}
private bool XyzVeilEffect()
{
if (!UniqueFaceupSpell())
return false;
foreach (ClientCard monster in Bot.GetMonsters())
{
if (monster.HasType(CardType.Xyz))
return true;
}
return true;
return false;
}
private bool XyzEffect()
private bool HaveOtherLV5OnField()
{
ClientCard card = GetBestEnnemyCard();
if (card != null)
foreach (ClientCard monster in Bot.GetMonsters())
{
AI.SelectCard(card);
return true;
if (monster.HasType(CardType.Monster) &&
!monster.HasType(CardType.Xyz) &&
(monster.Level == 5
|| monster.Id == CardId.StarDrawing
|| (monster.Id == CardId.WindUpSoldier) && !monster.Equals(Card)))
return true;
}
return false;
}
private ClientCard GetProblematicCard()
{
ClientCard card = Duel.Fields[1].MonsterZone.GetInvincibleMonster();
if (card != null)
return card;
card = Duel.Fields[1].SpellZone.GetNegateAttackSpell();
if (card != null)
return card;
return null;
}
private ClientCard GetBestEnnemyCard()
{
ClientCard card = GetProblematicCard();
if (card != null)
return card;
card = Duel.Fields[1].MonsterZone.GetHighestAttackMonster();
if (card != null)
return card;
List<ClientCard> spells = Duel.Fields[1].GetSpells();
if (spells.Count > 0)
return spells[0];
return null;
}
}
}
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("ST1732", "AI_ST1732", "Normal")]
public class ST1732Executor : DefaultExecutor
{
public class CardId
{
public const int Digitron = 32295838;
public const int Bitron = 36211150;
public const int DualAssembloom = 7445307;
public const int BootStagguard = 70950698;
public const int Linkslayer = 35595518;
public const int RAMClouder = 9190563;
public const int ROMCloudia = 44956694;
public const int BalancerLord = 8567955;
public const int Backlinker = 71172240;
public const int Kleinant = 45778242;
public const int Draconnet = 62706865;
public const int DotScaper = 18789533;
public const int MindControl = 37520316;
public const int DarkHole = 53129443;
public const int MonsterReborn = 83764718;
public const int MysticalSpaceTyphoon = 5318639;
public const int CosmicCyclone = 8267140;
public const int BookOfMoon = 14087893;
public const int CynetBackdoor = 43839002;
public const int MoonMirrorShield = 19508728;
public const int CynetUniverse = 61583217;
public const int BottomlessTrapHole = 29401950;
public const int MirrorForce = 44095762;
public const int TorrentialTribute = 53582587;
public const int RecodedAlive = 70238111;
public const int DimensionalBarrier = 83326048;
public const int CompulsoryEvacuationDevice = 94192409;
public const int SolemnStrike = 40605147;
public const int DecodeTalker = 1861629;
public const int EncodeTalker = 6622715;
public const int TriGateWizard = 32617464;
public const int Honeybot = 34472920;
public const int BinarySorceress = 79016563;
public const int LinkSpider = 98978921;
public const int StagToken = 70950699;
}
bool BalancerLordUsed = false;
public ST1732Executor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, CardId.CosmicCyclone, DefaultCosmicCyclone);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.BookOfMoon, DefaultBookOfMoon);
AddExecutor(ExecutorType.Activate, CardId.CynetUniverse, CynetUniverseEffect);
AddExecutor(ExecutorType.SpSummon, CardId.Linkslayer);
AddExecutor(ExecutorType.Activate, CardId.Linkslayer, LinkslayerEffect);
AddExecutor(ExecutorType.SpSummon, CardId.LinkSpider);
AddExecutor(ExecutorType.Activate, CardId.LinkSpider);
AddExecutor(ExecutorType.Activate, CardId.MindControl, MindControlEffect);
AddExecutor(ExecutorType.SpSummon, CardId.Backlinker);
AddExecutor(ExecutorType.Activate, CardId.Backlinker, BacklinkerEffect);
AddExecutor(ExecutorType.Activate, CardId.BootStagguard, BootStagguardEffect);
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, MonsterRebornEffect);
AddExecutor(ExecutorType.Activate, CardId.MoonMirrorShield, MoonMirrorShieldEffect);
AddExecutor(ExecutorType.Activate, CardId.CynetBackdoor, CynetBackdoorEffect);
AddExecutor(ExecutorType.Activate, CardId.RecodedAlive);
AddExecutor(ExecutorType.Summon, CardId.BalancerLord, BalancerLordSummon);
AddExecutor(ExecutorType.Summon, CardId.ROMCloudia, ROMCloudiaSummon);
AddExecutor(ExecutorType.Activate, CardId.ROMCloudia, ROMCloudiaEffect);
AddExecutor(ExecutorType.Summon, CardId.Draconnet, DraconnetSummon);
AddExecutor(ExecutorType.Activate, CardId.Draconnet, DraconnetEffect);
AddExecutor(ExecutorType.Summon, CardId.Kleinant);
AddExecutor(ExecutorType.Activate, CardId.Kleinant, KleinantEffect);
AddExecutor(ExecutorType.Summon, CardId.RAMClouder);
AddExecutor(ExecutorType.Activate, CardId.RAMClouder, RAMClouderEffect);
AddExecutor(ExecutorType.SummonOrSet, CardId.DotScaper);
AddExecutor(ExecutorType.Activate, CardId.DotScaper, DotScaperEffect);
AddExecutor(ExecutorType.Summon, CardId.BalancerLord);
AddExecutor(ExecutorType.Summon, CardId.ROMCloudia);
AddExecutor(ExecutorType.Summon, CardId.Draconnet);
AddExecutor(ExecutorType.SummonOrSet, CardId.Backlinker);
AddExecutor(ExecutorType.SummonOrSet, CardId.Digitron);
AddExecutor(ExecutorType.SummonOrSet, CardId.Bitron);
AddExecutor(ExecutorType.Activate, CardId.BalancerLord, BalancerLordEffect);
AddExecutor(ExecutorType.SpSummon, CardId.DecodeTalker, LinkSummon);
AddExecutor(ExecutorType.Activate, CardId.DecodeTalker);
AddExecutor(ExecutorType.SpSummon, CardId.TriGateWizard, LinkSummon);
AddExecutor(ExecutorType.Activate, CardId.TriGateWizard);
AddExecutor(ExecutorType.SpSummon, CardId.EncodeTalker, LinkSummon);
AddExecutor(ExecutorType.Activate, CardId.EncodeTalker);
AddExecutor(ExecutorType.SpSummon, CardId.Honeybot, LinkSummon);
AddExecutor(ExecutorType.SpSummon, CardId.BinarySorceress, LinkSummon);
AddExecutor(ExecutorType.Activate, CardId.BinarySorceress);
AddExecutor(ExecutorType.SpellSet, CardId.CynetBackdoor, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.RecodedAlive, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnStrike, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.CompulsoryEvacuationDevice, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.DimensionalBarrier, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.TorrentialTribute, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.MirrorForce, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.BottomlessTrapHole, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.BookOfMoon, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.CosmicCyclone, DefaultSpellSet);
AddExecutor(ExecutorType.SpellSet, CardId.MysticalSpaceTyphoon, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, CardId.CompulsoryEvacuationDevice, DefaultCompulsoryEvacuationDevice);
AddExecutor(ExecutorType.Activate, CardId.DimensionalBarrier, DefaultDimensionalBarrier);
AddExecutor(ExecutorType.Activate, CardId.TorrentialTribute, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.BottomlessTrapHole, DefaultUniqueTrap);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
public override bool OnSelectHand()
{
// go second
return false;
}
public override void OnNewTurn()
{
// reset
BalancerLordUsed = false;
}
public override int OnSelectOption(IList<int> options)
{
// put Moon Mirror Shield to the bottom of deck
return options.Count == 2 ? 1 : 0;
}
public override bool OnSelectYesNo(int desc)
{
if (desc == 210) // Continue selecting? (Link Summoning)
return false;
if (desc == 31) // Direct Attack?
return true;
return base.OnSelectYesNo(desc);
}
private bool LinkslayerEffect()
{
IList<ClientCard> targets = Enemy.GetSpells();
if (targets.Count > 0)
{
AI.SelectCard(new[]{
CardId.DualAssembloom,
CardId.Bitron,
CardId.Digitron,
CardId.RecodedAlive
});
AI.SelectNextCard(targets);
return true;
}
return false;
}
private bool MindControlEffect()
{
ClientCard target = AI.Utils.GetBestEnemyMonster();
if (target != null)
{
AI.SelectCard(target);
return true;
}
return false;
}
private bool BacklinkerEffect()
{
return (Bot.MonsterZone[5] == null) && (Bot.MonsterZone[6] == null);
}
private bool BootStagguardEffect()
{
if (Card.Location != CardLocation.Hand)
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool MonsterRebornEffect()
{
IList<int> targets = new[] {
CardId.DecodeTalker,
CardId.EncodeTalker,
CardId.TriGateWizard,
CardId.BinarySorceress,
CardId.Honeybot,
CardId.DualAssembloom,
CardId.BootStagguard,
CardId.BalancerLord,
CardId.ROMCloudia,
CardId.Linkslayer,
CardId.RAMClouder,
CardId.Backlinker,
CardId.Kleinant
};
if (!Bot.HasInGraveyard(targets))
{
return false;
}
AI.SelectCard(targets);
return true;
}
private bool MoonMirrorShieldEffect()
{
foreach (ClientCard monster in Bot.GetMonsters())
{
AI.SelectCard(monster);
return true;
}
return false;
}
private bool CynetUniverseEffect()
{
if (Card.Location == CardLocation.Hand)
return DefaultField();
foreach (ClientCard card in Enemy.Graveyard)
{
if (card.IsMonster())
{
AI.SelectCard(card);
return true;
}
}
return false;
}
private bool CynetBackdoorEffect()
{
if (!(Duel.Player == 0 && Duel.Phase == DuelPhase.Main2) &&
!(Duel.Player == 1 && (Duel.Phase == DuelPhase.BattleStart || Duel.Phase == DuelPhase.End)))
{
return false;
}
if (!UniqueFaceupSpell())
return false;
bool selected = false;
foreach (ClientCard monster in Bot.GetMonstersInExtraZone())
{
if (monster.Attack > 1000)
{
AI.SelectCard(monster);
selected = true;
break;
}
}
if (!selected)
{
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (monster.Id == CardId.BalancerLord)
{
AI.SelectCard(monster);
selected = true;
break;
}
}
if (!selected)
{
foreach (ClientCard monster in monsters)
{
if (monster.Attack >= 1700)
{
AI.SelectCard(monster);
selected = true;
break;
}
}
}
}
if (selected)
{
AI.SelectNextCard(new[]
{
CardId.ROMCloudia,
CardId.BalancerLord,
CardId.Kleinant,
CardId.Draconnet,
CardId.Backlinker
});
return true;
}
return false;
}
private bool BalancerLordSummon()
{
return !BalancerLordUsed;
}
private bool BalancerLordEffect()
{
if (Card.Location == CardLocation.Removed)
return true;
bool hastarget = Bot.HasInHand(new[] {
CardId.Draconnet,
CardId.Kleinant,
CardId.BalancerLord,
CardId.ROMCloudia,
CardId.RAMClouder,
CardId.DotScaper
});
if (hastarget && !BalancerLordUsed)
{
BalancerLordUsed = true;
return true;
}
return false;
}
private bool ROMCloudiaSummon()
{
return Bot.HasInGraveyard(new[] {
CardId.BootStagguard,
CardId.BalancerLord,
CardId.Kleinant,
CardId.Linkslayer,
CardId.Draconnet,
CardId.RAMClouder
});
}
private bool ROMCloudiaEffect()
{
if (Card.Location == CardLocation.MonsterZone)
{
AI.SelectCard(new[]{
CardId.BootStagguard,
CardId.BalancerLord,
CardId.Kleinant,
CardId.Linkslayer,
CardId.Draconnet,
CardId.RAMClouder
});
return true;
}
else
{
AI.SelectCard(new[]{
CardId.BalancerLord,
CardId.Kleinant,
CardId.RAMClouder,
CardId.DotScaper
});
return true;
}
}
private bool DraconnetSummon()
{
return Bot.GetRemainingCount(CardId.Digitron, 1) > 0
|| Bot.GetRemainingCount(CardId.Bitron, 1) > 0;
}
private bool DraconnetEffect()
{
AI.SelectCard(CardId.Bitron);
return true;
}
private bool KleinantEffect()
{
IList<int> targets = new[] {
CardId.DualAssembloom,
CardId.Bitron,
CardId.Digitron,
CardId.DotScaper
};
foreach (ClientCard monster in Bot.Hand)
{
if (targets.Contains(monster.Id))
{
AI.SelectCard(targets);
return true;
}
}
IList<int> targets2 = new[] {
CardId.StagToken,
CardId.Bitron,
CardId.Digitron,
CardId.DotScaper
};
foreach (ClientCard monster in Bot.GetMonsters())
{
if (targets2.Contains(monster.Id))
{
AI.SelectCard(targets2);
return true;
}
}
return false;
}
private bool RAMClouderEffect()
{
AI.SelectCard(new[]{
CardId.StagToken,
CardId.Bitron,
CardId.Digitron,
CardId.DotScaper,
CardId.Draconnet,
CardId.Backlinker,
CardId.RAMClouder
});
AI.SelectNextCard(new[]{
CardId.DecodeTalker,
CardId.EncodeTalker,
CardId.TriGateWizard,
CardId.BinarySorceress,
CardId.Honeybot,
CardId.DualAssembloom,
CardId.BootStagguard,
CardId.BalancerLord,
CardId.ROMCloudia,
CardId.Linkslayer,
CardId.RAMClouder
});
return true;
}
private bool DotScaperEffect()
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool LinkSummon()
{
return (AI.Utils.IsTurn1OrMain2() || AI.Utils.IsOneEnemyBetter())
&& AI.Utils.GetBestAttack(Bot) < Card.Attack;
}
}
}
\ No newline at end of file
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Toadally Awesome", "AI_ToadallyAwesome", "OutDated")]
public class ToadallyAwesomeExecutor : DefaultExecutor
{
public class CardId
{
public const int CryomancerOfTheIceBarrier = 23950192;
public const int DewdarkOfTheIceBarrier = 90311614;
public const int SwapFrog = 9126351;
public const int PriorOfTheIceBarrier = 50088247;
public const int Ronintoadin = 1357146;
public const int DupeFrog = 46239604;
public const int GraydleSlimeJr = 80250319;
public const int GalaxyCyclone = 5133471;
public const int HarpiesFeatherDuster = 18144506;
public const int Surface = 33057951;
public const int DarkHole = 53129443;
public const int CardDestruction = 72892473;
public const int FoolishBurial = 81439173;
public const int MonsterReborn = 83764718;
public const int MedallionOfTheIceBarrier = 84206435;
public const int Salvage = 96947648;
public const int AquariumStage = 29047353;
public const int HeraldOfTheArcLight = 79606837;
public const int ToadallyAwesome = 90809975;
public const int SkyCavalryCentaurea = 36776089;
public const int DaigustoPhoenix = 2766877;
public const int CatShark = 84224627;
public const int MysticalSpaceTyphoon = 5318639;
public const int BookOfMoon = 14087893;
public const int CallOfTheHaunted = 97077563;
public const int TorrentialTribute = 53582587;
}
public ToadallyAwesomeExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, CardId.GalaxyCyclone, DefaultGalaxyCyclone);
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.AquariumStage, AquariumStageEffect);
AddExecutor(ExecutorType.Activate, CardId.MedallionOfTheIceBarrier, MedallionOfTheIceBarrierEffect);
AddExecutor(ExecutorType.Activate, CardId.FoolishBurial, FoolishBurialEffect);
AddExecutor(ExecutorType.SpSummon, CardId.PriorOfTheIceBarrier);
AddExecutor(ExecutorType.Summon, CardId.GraydleSlimeJr, GraydleSlimeJrSummon);
AddExecutor(ExecutorType.SpSummon, CardId.SwapFrog, SwapFrogSpsummon);
AddExecutor(ExecutorType.Activate, CardId.SwapFrog, SwapFrogEffect);
AddExecutor(ExecutorType.Activate, CardId.GraydleSlimeJr, GraydleSlimeJrEffect);
AddExecutor(ExecutorType.Activate, CardId.Ronintoadin, RonintoadinEffect);
AddExecutor(ExecutorType.Activate, CardId.PriorOfTheIceBarrier);
AddExecutor(ExecutorType.Activate, CardId.DupeFrog);
AddExecutor(ExecutorType.Activate, CardId.Surface, SurfaceEffect);
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, SurfaceEffect);
AddExecutor(ExecutorType.Activate, CardId.Salvage, SalvageEffect);
AddExecutor(ExecutorType.Summon, CardId.SwapFrog);
AddExecutor(ExecutorType.Summon, CardId.DewdarkOfTheIceBarrier, IceBarrierSummon);
AddExecutor(ExecutorType.Summon, CardId.CryomancerOfTheIceBarrier, IceBarrierSummon);
AddExecutor(ExecutorType.Activate, CardId.CardDestruction);
AddExecutor(ExecutorType.Summon, CardId.GraydleSlimeJr, NormalSummon);
AddExecutor(ExecutorType.Summon, CardId.PriorOfTheIceBarrier, NormalSummon);
AddExecutor(ExecutorType.Summon, CardId.Ronintoadin, NormalSummon);
AddExecutor(ExecutorType.Summon, CardId.DupeFrog, NormalSummon);
AddExecutor(ExecutorType.Summon, CardId.PriorOfTheIceBarrier, PriorOfTheIceBarrierSummon);
AddExecutor(ExecutorType.SpSummon, CardId.CatShark, CatSharkSummon);
AddExecutor(ExecutorType.Activate, CardId.CatShark, CatSharkEffect);
AddExecutor(ExecutorType.SpSummon, CardId.SkyCavalryCentaurea, SkyCavalryCentaureaSummon);
AddExecutor(ExecutorType.Activate, CardId.SkyCavalryCentaurea);
AddExecutor(ExecutorType.SpSummon, CardId.DaigustoPhoenix, DaigustoPhoenixSummon);
AddExecutor(ExecutorType.Activate, CardId.DaigustoPhoenix);
AddExecutor(ExecutorType.SpSummon, CardId.ToadallyAwesome);
AddExecutor(ExecutorType.Activate, CardId.ToadallyAwesome, ToadallyAwesomeEffect);
AddExecutor(ExecutorType.SpSummon, CardId.HeraldOfTheArcLight, HeraldOfTheArcLightSummon);
AddExecutor(ExecutorType.Activate, CardId.HeraldOfTheArcLight);
AddExecutor(ExecutorType.MonsterSet, CardId.GraydleSlimeJr);
AddExecutor(ExecutorType.MonsterSet, CardId.DupeFrog);
AddExecutor(ExecutorType.MonsterSet, CardId.Ronintoadin);
AddExecutor(ExecutorType.Repos, Repos);
// cards got by Toadall yAwesome
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.BookOfMoon, DefaultBookOfMoon);
AddExecutor(ExecutorType.Activate, CardId.CallOfTheHaunted, SurfaceEffect);
AddExecutor(ExecutorType.Activate, CardId.TorrentialTribute, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Activate, OtherSpellEffect);
AddExecutor(ExecutorType.Activate, OtherTrapEffect);
AddExecutor(ExecutorType.Activate, OtherMonsterEffect);
}
public override bool OnSelectHand()
{
return true;
}
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (!defender.IsMonsterHasPreventActivationEffectInBattle())
{
if (attacker.Id == CardId.SkyCavalryCentaurea && !attacker.IsDisabled() && attacker.HasXyzMaterial())
attacker.RealPower = Duel.LifePoints[0] + attacker.Attack;
}
return base.OnPreBattleBetween(attacker, defender);
}
private bool MedallionOfTheIceBarrierEffect()
{
if (Bot.HasInHand(new[]
{
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier
}) || Bot.HasInMonstersZone(new[]
{
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier
}))
{
AI.SelectCard(CardId.PriorOfTheIceBarrier);
}
else
{
AI.SelectCard(new[]
{
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier
});
}
return true;
}
private bool SurfaceEffect()
{
AI.SelectCard(new[]
{
CardId.ToadallyAwesome,
CardId.HeraldOfTheArcLight,
CardId.SwapFrog,
CardId.DewdarkOfTheIceBarrier,
CardId.CryomancerOfTheIceBarrier,
CardId.DupeFrog,
CardId.Ronintoadin,
CardId.GraydleSlimeJr
});
return true;
}
private bool AquariumStageEffect()
{
if (Card.Location == CardLocation.Grave)
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return SurfaceEffect();
}
return true;
}
private bool FoolishBurialEffect()
{
if (Bot.HasInHand(CardId.GraydleSlimeJr) && !Bot.HasInGraveyard(CardId.GraydleSlimeJr))
AI.SelectCard(CardId.GraydleSlimeJr);
else if (Bot.HasInGraveyard(CardId.Ronintoadin) && !Bot.HasInGraveyard(CardId.DupeFrog))
AI.SelectCard(CardId.DupeFrog);
else if (Bot.HasInGraveyard(CardId.DupeFrog) && !Bot.HasInGraveyard(CardId.Ronintoadin))
AI.SelectCard(CardId.Ronintoadin);
else
AI.SelectCard(new[]
{
CardId.GraydleSlimeJr,
CardId.Ronintoadin,
CardId.DupeFrog,
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier,
CardId.PriorOfTheIceBarrier,
CardId.SwapFrog
});
return true;
}
private bool SalvageEffect()
{
AI.SelectCard(new[]
{
CardId.SwapFrog,
CardId.PriorOfTheIceBarrier,
CardId.GraydleSlimeJr
});
return true;
}
private bool SwapFrogSpsummon()
{
if (Bot.GetCountCardInZone(Bot.Hand, CardId.GraydleSlimeJr)>=2 && !Bot.HasInGraveyard(CardId.GraydleSlimeJr))
AI.SelectCard(CardId.GraydleSlimeJr);
else if (Bot.HasInGraveyard(CardId.Ronintoadin) && !Bot.HasInGraveyard(CardId.DupeFrog))
AI.SelectCard(CardId.DupeFrog);
else if (Bot.HasInGraveyard(CardId.DupeFrog) && !Bot.HasInGraveyard(CardId.Ronintoadin))
AI.SelectCard(CardId.Ronintoadin);
else
AI.SelectCard(new[]
{
CardId.Ronintoadin,
CardId.DupeFrog,
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier,
CardId.PriorOfTheIceBarrier,
CardId.GraydleSlimeJr,
CardId.SwapFrog
});
return true;
}
private bool SwapFrogEffect()
{
if (ActivateDescription == -1)
{
return FoolishBurialEffect();
}
else
{
if (Bot.HasInHand(CardId.DupeFrog))
{
AI.SelectCard(new[]
{
CardId.PriorOfTheIceBarrier,
CardId.GraydleSlimeJr,
CardId.SwapFrog
});
return true;
}
}
return false;
}
private bool GraydleSlimeJrSummon()
{
return Bot.HasInGraveyard(CardId.GraydleSlimeJr);
}
private bool GraydleSlimeJrEffect()
{
AI.SelectCard(CardId.GraydleSlimeJr);
AI.SelectPosition(CardPosition.FaceUpDefence);
AI.SelectNextCard(new[]
{
CardId.SwapFrog,
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier,
CardId.Ronintoadin,
CardId.DupeFrog,
CardId.PriorOfTheIceBarrier,
CardId.GraydleSlimeJr
});
return true;
}
private bool RonintoadinEffect()
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool NormalSummon()
{
foreach (ClientCard monster in Bot.GetMonsters())
{
if (monster.Level==2)
{
return true;
}
}
return false;
}
private bool IceBarrierSummon()
{
return Bot.GetCountCardInZone(Bot.Hand, CardId.PriorOfTheIceBarrier) > 0;
}
private bool PriorOfTheIceBarrierSummon()
{
return Bot.GetCountCardInZone(Bot.Hand, CardId.PriorOfTheIceBarrier) >= 2;
}
private bool ToadallyAwesomeEffect()
{
if (CurrentChain.Count > 0)
{
// negate effect, select a cost for it
List<ClientCard> monsters = Bot.GetMonsters();
IList<int> suitableCost = new[] {
CardId.SwapFrog,
CardId.Ronintoadin,
CardId.GraydleSlimeJr,
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier
};
foreach (ClientCard monster in monsters)
{
if (suitableCost.Contains(monster.Id))
{
AI.SelectCard(monster);
return true;
}
}
if (!Bot.HasInSpellZone(CardId.AquariumStage, true))
{
foreach (ClientCard monster in monsters)
{
if (monster.Id == CardId.DupeFrog)
{
AI.SelectCard(monster);
return true;
}
}
}
List<ClientCard> hands = Bot.Hand.GetMonsters();
if (Bot.GetCountCardInZone(Bot.Hand, CardId.GraydleSlimeJr) >= 2)
{
foreach (ClientCard monster in hands)
{
if (monster.Id == CardId.GraydleSlimeJr)
{
AI.SelectCard(monster);
return true;
}
}
}
if (Bot.HasInGraveyard(CardId.Ronintoadin) && !Bot.HasInGraveyard(CardId.DupeFrog) && !Bot.HasInGraveyard(CardId.SwapFrog))
{
foreach (ClientCard monster in hands)
{
if (monster.Id == CardId.DupeFrog)
{
AI.SelectCard(monster);
return true;
}
}
}
foreach (ClientCard monster in hands)
{
if (monster.Id == CardId.Ronintoadin || monster.Id == CardId.DupeFrog)
{
AI.SelectCard(monster);
return true;
}
}
foreach (ClientCard monster in hands)
{
AI.SelectCard(monster);
return true;
}
return true;
}
else if (Card.Location == CardLocation.Grave)
{
if (!Bot.HasInExtra(CardId.ToadallyAwesome))
{
AI.SelectCard(CardId.ToadallyAwesome);
}
else
{
AI.SelectCard(new[]
{
CardId.SwapFrog,
CardId.PriorOfTheIceBarrier,
CardId.GraydleSlimeJr
});
}
return true;
}
else if (Duel.Phase == DuelPhase.Standby)
{
SelectXYZDetach(Card.Overlays);
if (Duel.Player == 0)
{
AI.SelectNextCard(new[]
{
CardId.SwapFrog,
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier,
CardId.Ronintoadin,
CardId.DupeFrog,
CardId.GraydleSlimeJr
});
}
else
{
AI.SelectNextCard(new[]
{
CardId.DupeFrog,
CardId.SwapFrog,
CardId.Ronintoadin,
CardId.GraydleSlimeJr,
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier
});
AI.SelectPosition(CardPosition.FaceUpDefence);
}
return true;
}
return true;
}
private bool CatSharkSummon()
{
if (Bot.HasInMonstersZone(CardId.ToadallyAwesome)
&& ((AI.Utils.IsOneEnemyBetter(true)
&& !Bot.HasInMonstersZone(new[]
{
CardId.CatShark,
CardId.SkyCavalryCentaurea
}, true, true))
|| !Bot.HasInExtra(CardId.ToadallyAwesome)))
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
return false;
}
private bool CatSharkEffect()
{
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (monster.Id == CardId.ToadallyAwesome && monster.Attack <= 2200)
{
SelectXYZDetach(Card.Overlays);
AI.SelectNextCard(monster);
return true;
}
}
foreach (ClientCard monster in monsters)
{
if (monster.Id == CardId.SkyCavalryCentaurea && monster.Attack <= 2000)
{
SelectXYZDetach(Card.Overlays);
AI.SelectNextCard(monster);
return true;
}
}
foreach (ClientCard monster in monsters)
{
if (monster.Id == CardId.DaigustoPhoenix && monster.Attack <= 1500)
{
SelectXYZDetach(Card.Overlays);
AI.SelectNextCard(monster);
return true;
}
}
return false;
}
private bool SkyCavalryCentaureaSummon()
{
int num = 0;
foreach (ClientCard monster in Bot.GetMonsters())
{
if (monster.Level ==2)
{
num++;
}
}
return AI.Utils.IsOneEnemyBetter(true)
&& AI.Utils.GetBestAttack(Enemy) > 2200
&& num < 4
&& !Bot.HasInMonstersZone(new[]
{
CardId.SkyCavalryCentaurea
}, true, true);
}
private bool DaigustoPhoenixSummon()
{
if (Duel.Turn != 1)
{
int attack = 0;
int defence = 0;
foreach (ClientCard monster in Bot.GetMonsters())
{
if (!monster.IsDefense())
{
attack += monster.Attack;
}
}
foreach (ClientCard monster in Enemy.GetMonsters())
{
defence += monster.GetDefensePower();
}
if (attack - 2000 - defence > Duel.LifePoints[1] && !AI.Utils.IsOneEnemyBetter(true))
return true;
}
return false;
}
private bool HeraldOfTheArcLightSummon()
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool Repos()
{
if (Card.IsFacedown())
return true;
if (Card.IsDefense() && !AI.Utils.IsAllEnemyBetter(true) && Card.Attack >= Card.Defense)
return true;
return false;
}
private bool OtherSpellEffect()
{
foreach (CardExecutor exec in Executors)
{
if (exec.Type == Type && exec.CardId == Card.Id)
return false;
}
return Card.IsSpell();
}
private bool OtherTrapEffect()
{
foreach (CardExecutor exec in Executors)
{
if (exec.Type == Type && exec.CardId == Card.Id)
return false;
}
return Card.IsTrap() && DefaultTrap();
}
private bool OtherMonsterEffect()
{
foreach (CardExecutor exec in Executors)
{
if (exec.Type == Type && exec.CardId == Card.Id)
return false;
}
return Card.IsMonster();
}
private void SelectXYZDetach(List<int> Overlays)
{
if (Overlays.Contains(CardId.GraydleSlimeJr) && Bot.HasInHand(CardId.GraydleSlimeJr) && !Bot.HasInGraveyard(CardId.GraydleSlimeJr))
AI.SelectCard(CardId.GraydleSlimeJr);
else if (Overlays.Contains(CardId.DupeFrog) && Bot.HasInGraveyard(CardId.Ronintoadin) && !Bot.HasInGraveyard(CardId.DupeFrog))
AI.SelectCard(CardId.DupeFrog);
else if (Overlays.Contains(CardId.Ronintoadin) && Bot.HasInGraveyard(CardId.DupeFrog) && !Bot.HasInGraveyard(CardId.Ronintoadin))
AI.SelectCard(CardId.Ronintoadin);
else
AI.SelectCard(new[]
{
CardId.GraydleSlimeJr,
CardId.Ronintoadin,
CardId.DupeFrog,
CardId.CryomancerOfTheIceBarrier,
CardId.DewdarkOfTheIceBarrier,
CardId.PriorOfTheIceBarrier,
CardId.SwapFrog
});
}
}
}
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Yosenju", "AI_Yosenju")]
public class YosenjuExecutor : DefaultExecutor
{
public class CardId
{
public const int YosenjuKama1 = 65247798;
public const int YosenjuKama2 = 92246806;
public const int YosenjuKama3 = 28630501;
public const int YosenjuTsujik = 25244515;
public const int HarpiesFeatherDuster = 18144507;
public const int DarkHole = 53129443;
public const int CardOfDemise = 59750328;
public const int PotOfDuality = 98645731;
public const int CosmicCyclone = 8267140;
public const int QuakingMirrorForce = 40838625;
public const int DrowningMirrorForce = 47475363;
public const int StarlightRoad = 58120309;
public const int VanitysEmptiness = 5851097;
public const int MacroCosmos = 30241314;
public const int SolemnStrike = 40605147;
public const int SolemnWarning = 84749824;
public const int SolemnJudgment = 41420027;
public const int MagicDrain = 59344077;
public const int StardustDragon = 44508094;
public const int NumberS39UtopiatheLightning = 56832966;
public const int NumberS39UtopiaOne = 86532744;
public const int DarkRebellionXyzDragon = 16195942;
public const int Number39Utopia = 84013237;
public const int Number103Ragnazero = 94380860;
public const int BrotherhoodOfTheFireFistTigerKing = 96381979;
public const int Number106GiantHand = 63746411;
public const int CastelTheSkyblasterMusketeer = 82633039;
public const int DiamondDireWolf = 95169481;
public const int LightningChidori = 22653490;
public const int EvilswarmExcitonKnight = 46772449;
public const int AbyssDweller = 21044178;
public const int GagagaCowboy = 12014404;
}
bool CardOfDemiseUsed = false;
public YosenjuExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
// do the end phase effect of Card Of Demise before Yosenjus return to hand
AddExecutor(ExecutorType.Activate, CardId.CardOfDemise, CardOfDemiseEPEffect);
// burn if enemy's LP is below 800
AddExecutor(ExecutorType.SpSummon, CardId.GagagaCowboy, GagagaCowboySummon);
AddExecutor(ExecutorType.Activate, CardId.GagagaCowboy);
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, CardId.CosmicCyclone, DefaultCosmicCyclone);
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.PotOfDuality, PotOfDualityEffect);
AddExecutor(ExecutorType.Summon, CardId.YosenjuKama1, HaveAnotherYosenjuWithSameNameInHand);
AddExecutor(ExecutorType.Summon, CardId.YosenjuKama2, HaveAnotherYosenjuWithSameNameInHand);
AddExecutor(ExecutorType.Summon, CardId.YosenjuKama3, HaveAnotherYosenjuWithSameNameInHand);
AddExecutor(ExecutorType.Summon, CardId.YosenjuKama1);
AddExecutor(ExecutorType.Summon, CardId.YosenjuKama2);
AddExecutor(ExecutorType.Summon, CardId.YosenjuKama3);
AddExecutor(ExecutorType.Summon, CardId.YosenjuTsujik);
AddExecutor(ExecutorType.Activate, CardId.YosenjuKama1, YosenjuEffect);
AddExecutor(ExecutorType.Activate, CardId.YosenjuKama2, YosenjuEffect);
AddExecutor(ExecutorType.Activate, CardId.YosenjuKama3, YosenjuEffect);
AddExecutor(ExecutorType.Activate, CardId.YosenjuTsujik, YosenjuEffect);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnJudgment, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnStrike, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnWarning, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.MacroCosmos, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.VanitysEmptiness, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.MagicDrain, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.DrowningMirrorForce, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.QuakingMirrorForce, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.StarlightRoad, TrapSetUnique);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnJudgment, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnStrike, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnWarning, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.MacroCosmos, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.VanitysEmptiness, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.MagicDrain, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.DrowningMirrorForce, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.QuakingMirrorForce, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.StarlightRoad, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.HarpiesFeatherDuster, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.DarkHole, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.PotOfDuality, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.CosmicCyclone, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.CardOfDemise);
AddExecutor(ExecutorType.Activate, CardId.CardOfDemise, CardOfDemiseEffect);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnJudgment, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnStrike, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.SolemnWarning, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.MacroCosmos, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.VanitysEmptiness, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.MagicDrain, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.DrowningMirrorForce, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.QuakingMirrorForce, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.StarlightRoad, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.HarpiesFeatherDuster, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.DarkHole, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.PotOfDuality, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpellSet, CardId.CosmicCyclone, CardOfDemiseAcivated);
AddExecutor(ExecutorType.SpSummon, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightSummon);
AddExecutor(ExecutorType.Activate, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightEffect);
AddExecutor(ExecutorType.SpSummon, CardId.DarkRebellionXyzDragon, DarkRebellionXyzDragonSummon);
AddExecutor(ExecutorType.Activate, CardId.DarkRebellionXyzDragon, DarkRebellionXyzDragonEffect);
AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiaOne);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.StardustDragon, DefaultStardustDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.StarlightRoad, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.MagicDrain);
AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, CardId.SolemnJudgment, DefaultSolemnJudgment);
AddExecutor(ExecutorType.Activate, CardId.MacroCosmos, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.VanitysEmptiness, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.DrowningMirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.QuakingMirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
}
public override bool OnSelectHand()
{
// go first
return true;
}
public override void OnNewTurn()
{
CardOfDemiseUsed = false;
}
public override bool OnSelectYesNo(int desc)
{
// Yosenju Kama 2 shouldn't attack directly at most times
if (Card == null)
return true;
// Logger.DebugWriteLine(Card.Name);
if (Card.Id == CardId.YosenjuKama2)
return Card.ShouldDirectAttack;
else
return true;
}
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (!defender.IsMonsterHasPreventActivationEffectInBattle())
{
if (attacker.Attribute == (int)CardAttribute.Wind && Bot.HasInHand(CardId.YosenjuTsujik))
attacker.RealPower = attacker.RealPower + 1000;
}
return base.OnPreBattleBetween(attacker, defender);
}
private bool PotOfDualityEffect()
{
if (CardOfDemiseUsed)
{
AI.SelectCard(new[]
{
CardId.StarlightRoad,
CardId.MagicDrain,
CardId.SolemnJudgment,
CardId.VanitysEmptiness,
CardId.HarpiesFeatherDuster,
CardId.DrowningMirrorForce,
CardId.QuakingMirrorForce,
CardId.SolemnStrike,
CardId.SolemnWarning,
CardId.MacroCosmos,
CardId.CardOfDemise
});
}
else
{
AI.SelectCard(new[]
{
CardId.YosenjuKama3,
CardId.YosenjuKama1,
CardId.YosenjuKama2,
CardId.StarlightRoad,
CardId.MagicDrain,
CardId.VanitysEmptiness,
CardId.HarpiesFeatherDuster,
CardId.DrowningMirrorForce,
CardId.QuakingMirrorForce,
CardId.SolemnStrike,
CardId.SolemnJudgment,
CardId.SolemnWarning,
CardId.MacroCosmos,
CardId.CardOfDemise,
});
}
return true;
}
private bool CardOfDemiseEffect()
{
if (AI.Utils.IsTurn1OrMain2())
{
CardOfDemiseUsed = true;
return true;
}
return false;
}
private bool HaveAnotherYosenjuWithSameNameInHand()
{
foreach (ClientCard card in Bot.Hand.GetMonsters())
{
if (!card.Equals(Card) && card.Id == Card.Id)
return true;
}
return false;
}
private bool TrapSetUnique()
{
foreach (ClientCard card in Bot.GetSpells())
{
if (card.Id == Card.Id)
return false;
}
return TrapSetWhenZoneFree();
}
private bool TrapSetWhenZoneFree()
{
return Bot.GetSpellCountWithoutField() < 4;
}
private bool CardOfDemiseAcivated()
{
return CardOfDemiseUsed;
}
private bool YosenjuEffect()
{
// Don't activate the return to hand effect first
if (Duel.Phase == DuelPhase.End)
return false;
AI.SelectCard(new[]
{
CardId.YosenjuKama1,
CardId.YosenjuKama2,
CardId.YosenjuKama3
});
return true;
}
private bool CardOfDemiseEPEffect()
{
// do the end phase effect of Card Of Demise before Yosenjus return to hand
return Duel.Phase == DuelPhase.End;
}
private bool GagagaCowboySummon()
{
if (Duel.LifePoints[1] <= 800 || (Bot.GetMonsterCount()>=4 && Duel.LifePoints[1] <= 1600))
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
return false;
}
private bool DarkRebellionXyzDragonSummon()
{
int selfBestAttack = AI.Utils.GetBestAttack(Bot);
int oppoBestAttack = AI.Utils.GetBestAttack(Enemy);
return selfBestAttack <= oppoBestAttack;
}
private bool DarkRebellionXyzDragonEffect()
{
int oppoBestAttack = AI.Utils.GetBestAttack(Enemy);
ClientCard target = AI.Utils.GetOneEnemyBetterThanValue(oppoBestAttack, true);
if (target != null)
{
AI.SelectNextCard(target);
}
return true;
}
}
}
\ No newline at end of file
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
using YGOSharp.OCGWrapper.Enums;
namespace DevBot.Game.AI.Decks
namespace WindBot.Game.AI.Decks
{
[Deck("Zexal Weapons", "AI_ZexalWeapons")]
class ZexalWeaponsExecutor : DefaultExecutor
{
public enum CardId
{
CyberDragon = 70095155,
ZwTornadoBringer = 81471108,
ZwLightningBlade = 45082499,
SolarWindJammer = 33911264,
PhotonTrasher = 65367484,
StarDrawing = 24610207,
SacredCrane = 30914564,
Goblindbergh = 25259669,
Honest = 37742478,
Kagetokage = 94656263,
HeroicChallengerExtraSword = 34143852,
TinGoldfish = 18063928,
SummonerMonk = 423585,
InstantFusion = 1845204,
Raigeki = 12580477,
ReinforcementOfTheArmy = 32807846,
DarkHole = 53129443,
MysticalSpaceTyphoon = 5318639,
BreakthroughSkill = 78474168,
SolemnWarning = 84749824,
FlameSwordsman = 45231177,
DarkfireDragon = 17881964,
GaiaDragonTheThunderCharger = 91949988,
ZwLionArms = 60992364,
AdreusKeeperOfArmageddon = 94119480,
Number61Volcasaurus = 29669359,
GemKnightPearl = 71594310,
Number39Utopia = 84013237,
MaestrokeTheSymphonyDjinn = 25341652,
GagagaCowboy = 12014404
public class CardId
{
public const int CyberDragon = 70095155;
public const int ZwTornadoBringer = 81471108;
public const int ZwLightningBlade = 45082499;
public const int ZwAsuraStrike = 40941889;
public const int SolarWindJammer = 33911264;
public const int PhotonTrasher = 65367484;
public const int StarDrawing = 24610207;
public const int SacredCrane = 30914564;
public const int Goblindbergh = 25259669;
public const int Honest = 37742478;
public const int Kagetokage = 94656263;
public const int HeroicChallengerExtraSword = 34143852;
public const int TinGoldfish = 18063928;
public const int SummonerMonk = 423585;
public const int InstantFusion = 1845204;
public const int Raigeki = 12580477;
public const int ReinforcementOfTheArmy = 32807846;
public const int DarkHole = 53129443;
public const int MysticalSpaceTyphoon = 5318639;
public const int BreakthroughSkill = 78474168;
public const int SolemnWarning = 84749824;
public const int SolemnStrike = 40605147;
public const int XyzChangeTactics = 11705261;
public const int FlameSwordsman = 45231177;
public const int DarkfireDragon = 17881964;
public const int GaiaDragonTheThunderCharger = 91949988;
public const int ZwLionArms = 60992364;
public const int AdreusKeeperOfArmageddon = 94119480;
public const int Number61Volcasaurus = 29669359;
public const int GemKnightPearl = 71594310;
public const int Number39Utopia = 84013237;
public const int NumberS39UtopiaOne = 86532744;
public const int NumberS39UtopiatheLightning = 56832966;
public const int MaestrokeTheSymphonyDjinn = 25341652;
public const int GagagaCowboy = 12014404;
}
public ZexalWeaponsExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
// Quick spells
AddExecutor(ExecutorType.Activate, (int)CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
// Spell cards
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, CardId.ReinforcementOfTheArmy, ReinforcementOfTheArmy);
AddExecutor(ExecutorType.Activate, CardId.XyzChangeTactics, XyzChangeTactics);
// XYZ summons
AddExecutor(ExecutorType.SpSummon, (int)CardId.Number39Utopia);
AddExecutor(ExecutorType.SpSummon, (int)CardId.ZwLionArms);
AddExecutor(ExecutorType.SpSummon, (int)CardId.AdreusKeeperOfArmageddon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.Number61Volcasaurus);
AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiaOne);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.SpSummon, CardId.Number61Volcasaurus, Number61Volcasaurus);
AddExecutor(ExecutorType.SpSummon, CardId.ZwLionArms);
AddExecutor(ExecutorType.SpSummon, CardId.AdreusKeeperOfArmageddon);
// XYZ effects
AddExecutor(ExecutorType.Activate, (int)CardId.Number39Utopia, Number39Utopia);
AddExecutor(ExecutorType.Activate, (int)CardId.ZwLionArms, ZwLionArms);
AddExecutor(ExecutorType.Activate, (int)CardId.AdreusKeeperOfArmageddon);
AddExecutor(ExecutorType.Activate, (int)CardId.Number61Volcasaurus);
AddExecutor(ExecutorType.Activate, CardId.Number39Utopia, Number39Utopia);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiaOne);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning, NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.ZwLionArms, ZwLionArms);
AddExecutor(ExecutorType.Activate, CardId.AdreusKeeperOfArmageddon);
AddExecutor(ExecutorType.Activate, CardId.Number61Volcasaurus);
// Weapons
AddExecutor(ExecutorType.Activate, (int)CardId.ZwTornadoBringer);
AddExecutor(ExecutorType.Activate, (int)CardId.ZwLightningBlade);
AddExecutor(ExecutorType.Activate, CardId.ZwTornadoBringer);
AddExecutor(ExecutorType.Activate, CardId.ZwLightningBlade);
AddExecutor(ExecutorType.Activate, CardId.ZwAsuraStrike);
// Spell cards
AddExecutor(ExecutorType.Activate, (int)CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, (int)CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, (int)CardId.ReinforcementOfTheArmy, ReinforcementOfTheArmy);
// Special summons
AddExecutor(ExecutorType.SpSummon, (int)CardId.PhotonTrasher);
AddExecutor(ExecutorType.SpSummon, (int)CardId.CyberDragon);
AddExecutor(ExecutorType.SpSummon, (int)CardId.SolarWindJammer, SolarWindJammer);
AddExecutor(ExecutorType.SpSummon, CardId.PhotonTrasher);
AddExecutor(ExecutorType.SpSummon, CardId.CyberDragon);
AddExecutor(ExecutorType.SpSummon, CardId.SolarWindJammer, SolarWindJammer);
AddExecutor(ExecutorType.Activate, (int)CardId.InstantFusion, InstantFusion);
AddExecutor(ExecutorType.Activate, CardId.InstantFusion, InstantFusion);
// Normal summons
AddExecutor(ExecutorType.Summon, (int)CardId.Goblindbergh, GoblindberghFirst);
AddExecutor(ExecutorType.Summon, (int)CardId.TinGoldfish, GoblindberghFirst);
AddExecutor(ExecutorType.Summon, (int)CardId.StarDrawing);
AddExecutor(ExecutorType.Summon, (int)CardId.SacredCrane);
AddExecutor(ExecutorType.Summon, (int)CardId.HeroicChallengerExtraSword);
AddExecutor(ExecutorType.Summon, (int)CardId.Goblindbergh);
AddExecutor(ExecutorType.Summon, (int)CardId.TinGoldfish);
AddExecutor(ExecutorType.Summon, (int)CardId.SummonerMonk);
AddExecutor(ExecutorType.Summon, CardId.Goblindbergh, GoblindberghFirst);
AddExecutor(ExecutorType.Summon, CardId.TinGoldfish, GoblindberghFirst);
AddExecutor(ExecutorType.Summon, CardId.StarDrawing);
AddExecutor(ExecutorType.Summon, CardId.SacredCrane);
AddExecutor(ExecutorType.Summon, CardId.HeroicChallengerExtraSword);
AddExecutor(ExecutorType.Summon, CardId.Goblindbergh);
AddExecutor(ExecutorType.Summon, CardId.TinGoldfish);
AddExecutor(ExecutorType.Summon, CardId.SummonerMonk);
// Summons: Effects
AddExecutor(ExecutorType.Activate, (int)CardId.Goblindbergh, GoblindberghEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.TinGoldfish, GoblindberghEffect);
AddExecutor(ExecutorType.Activate, (int)CardId.Kagetokage);
AddExecutor(ExecutorType.Activate, (int)CardId.SummonerMonk, SummonerMonkEffect);
AddExecutor(ExecutorType.Activate, CardId.Goblindbergh, GoblindberghEffect);
AddExecutor(ExecutorType.Activate, CardId.TinGoldfish, GoblindberghEffect);
AddExecutor(ExecutorType.Activate, CardId.Kagetokage);
AddExecutor(ExecutorType.Activate, CardId.SummonerMonk, SummonerMonkEffect);
AddExecutor(ExecutorType.Activate, CardId.Honest, Honest);
// Reposition
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.Repos, MonsterRepos);
// Spummon GaiaDragonTheThunderCharger if Volcasaurus or ZwLionArms had been used
AddExecutor(ExecutorType.SpSummon, CardId.GaiaDragonTheThunderCharger);
// Set and activate traps
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, (int)CardId.BreakthroughSkill, BreakthroughSkill);
AddExecutor(ExecutorType.Activate, (int)CardId.SolemnWarning, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.BreakthroughSkill, DefaultBreakthroughSkill);
AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
}
public override bool OnSelectHand()
......@@ -108,18 +126,34 @@ namespace DevBot.Game.AI.Decks
return false;
}
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (!defender.IsMonsterHasPreventActivationEffectInBattle())
{
if (attacker.Attribute == (int)CardAttribute.Light && Bot.HasInHand(CardId.Honest))
attacker.RealPower = attacker.RealPower + defender.Attack;
}
return base.OnPreBattleBetween(attacker, defender);
}
private bool Number39Utopia()
{
if (!HasChainedTrap(0) && Duel.Player == 1 && Duel.Phase == DuelPhase.BattleStart && Card.Overlays.Count > 1)
if (!HasChainedTrap(0) && Duel.Player == 1 && Duel.Phase == DuelPhase.BattleStart && Card.HasXyzMaterial(2))
return true;
return false;
}
private bool Number61Volcasaurus()
{
return AI.Utils.IsOneEnemyBetterThanValue(2000, false);
}
private bool ZwLionArms()
{
if (ActivateDescription == (int)CardId.ZwLionArms * 16 + 0 ||
ActivateDescription == (int)CardId.ZwLionArms * 16 + 1)
if (ActivateDescription == AI.Utils.GetStringId(CardId.ZwLionArms, 0))
return true;
if (ActivateDescription == AI.Utils.GetStringId(CardId.ZwLionArms, 1))
return !Card.IsDisabled();
return false;
}
......@@ -127,37 +161,61 @@ namespace DevBot.Game.AI.Decks
{
AI.SelectCard(new[]
{
(int)CardId.Goblindbergh,
(int)CardId.TinGoldfish,
(int)CardId.StarDrawing,
(int)CardId.Kagetokage,
(int)CardId.SacredCrane
CardId.Goblindbergh,
CardId.TinGoldfish,
CardId.StarDrawing,
CardId.Kagetokage,
CardId.SacredCrane
});
return true;
}
private bool InstantFusion()
{
List<ClientCard> monsters = Duel.Fields[0].GetMonsters();
int count = 0;
foreach (ClientCard card in monsters)
if (Duel.LifePoints[0] <= 1000)
return false;
int count4 = 0;
int count5 = 0;
foreach (ClientCard card in Bot.GetMonsters())
{
if (card.Level == 5)
++count;
++count5;
if (card.Level == 4)
++count4;
}
if (count == 1)
AI.SelectCard((int)CardId.FlameSwordsman);
else
AI.SelectCard((int)CardId.DarkfireDragon);
return true;
if (count5 == 1)
{
AI.SelectCard(CardId.FlameSwordsman);
return true;
}
else if (count4 == 1)
{
AI.SelectCard(CardId.DarkfireDragon);
return true;
}
return false;
}
private bool XyzChangeTactics()
{
return Duel.LifePoints[0] > 500;
}
private bool NumberS39UtopiatheLightning()
{
return Card.Attack < 5000;
}
private bool Honest()
{
return Duel.Phase != DuelPhase.Main1 || Duel.Turn == 1;
}
private bool GoblindberghFirst()
{
IList<ClientCard> hand = Duel.Fields[0].Hand;
foreach (ClientCard card in hand)
foreach (ClientCard card in Bot.Hand.GetMonsters())
{
if (card != Card && card.IsMonster() && card.Level == 4)
if (!card.Equals(Card) && card.Level == 4)
return true;
}
return false;
......@@ -167,46 +225,55 @@ namespace DevBot.Game.AI.Decks
{
AI.SelectCard(new[]
{
(int)CardId.SacredCrane,
(int)CardId.HeroicChallengerExtraSword,
(int)CardId.StarDrawing,
(int)CardId.SummonerMonk
CardId.SacredCrane,
CardId.HeroicChallengerExtraSword,
CardId.StarDrawing,
CardId.SummonerMonk
});
return true;
}
private bool SummonerMonkEffect()
{
if (Duel.Fields[0].HasInHand((int)CardId.InstantFusion) ||
Duel.Fields[0].HasInHand((int)CardId.MysticalSpaceTyphoon))
IList<int> costs = new[]
{
CardId.XyzChangeTactics,
CardId.DarkHole,
CardId.MysticalSpaceTyphoon,
CardId.InstantFusion
};
if (Bot.HasInHand(costs))
{
AI.SelectCard(new[]
AI.SelectCard(costs);
AI.SelectNextCard(new[]
{
(int)CardId.InstantFusion,
(int)CardId.MysticalSpaceTyphoon
CardId.SacredCrane,
CardId.StarDrawing,
CardId.Goblindbergh,
CardId.TinGoldfish
});
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
AI.SelectNextCard(new[]
{
(int)CardId.Goblindbergh,
(int)CardId.TinGoldfish,
(int)CardId.StarDrawing,
(int)CardId.Kagetokage,
(int)CardId.SacredCrane
});
return false;
}
private bool SolarWindJammer()
{
if (!Bot.HasInHand(new[] {
CardId.StarDrawing,
CardId.InstantFusion
}))
return false;
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool BreakthroughSkill()
private bool MonsterRepos()
{
return (CurrentChain.Count > 0 && DefaultTrap());
if (Card.Id == CardId.NumberS39UtopiatheLightning)
return false;
return base.DefaultMonsterRepos();
}
}
}
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("Zoodiac", "AI_Zoodiac", "OutDated")]
class ZoodiacExecutor : DefaultExecutor
{
public class CardId
{
public const int JizukirutheStarDestroyingKaiju = 63941210;
public const int GadarlatheMysteryDustKaiju = 36956512;
public const int GamecieltheSeaTurtleKaiju = 55063751;
public const int RadiantheMultidimensionalKaiju = 28674152;
public const int KumongoustheStickyStringKaiju = 29726552;
public const int PhotonThrasher = 65367484;
public const int Thoroughblade = 77150143;
public const int Whiptail = 31755044;
public const int Ratpier = 78872731;
public const int AleisterTheInvoker = 86120751;
public const int HarpiesFeatherDuster = 18144506;
public const int DarkHole = 53129443;
public const int Terraforming = 73628505;
public const int Invocation = 74063034;
public const int MonsterReborn = 83764718;
public const int InterruptedKaijuSlumber = 99330325;
public const int ZoodiacBarrage = 46060017;
public const int FireFormationTenki = 57103969;
public const int MagicalMeltdown = 47679935;
public const int ZoodiacCombo = 73881652;
public const int InvokedMechaba = 75286621;
public const int InvokedMagellanica = 48791583;
public const int NumberS39UtopiatheLightning = 56832966;
public const int Number39Utopia = 84013237;
public const int DaigustoEmeral = 581014;
public const int Tigermortar = 11510448;
public const int Chakanine = 41375811;
public const int Drident = 48905153;
public const int Broadbull = 85115440;
}
bool TigermortarSpsummoned = false;
bool ChakanineSpsummoned = false;
bool BroadbullSpsummoned = false;
int WhiptailEffectCount = 0;
public ZoodiacExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
// Quick spells
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, CardId.InterruptedKaijuSlumber, DefaultInterruptedKaijuSlumber);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.SpSummon, CardId.GamecieltheSeaTurtleKaiju, DefaultKaijuSpsummon);
AddExecutor(ExecutorType.SpSummon, CardId.KumongoustheStickyStringKaiju, DefaultKaijuSpsummon);
AddExecutor(ExecutorType.SpSummon, CardId.GadarlatheMysteryDustKaiju, DefaultKaijuSpsummon);
AddExecutor(ExecutorType.SpSummon, CardId.RadiantheMultidimensionalKaiju, DefaultKaijuSpsummon);
AddExecutor(ExecutorType.SpSummon, CardId.JizukirutheStarDestroyingKaiju, DefaultKaijuSpsummon);
AddExecutor(ExecutorType.Activate, CardId.Terraforming);
AddExecutor(ExecutorType.Activate, CardId.MagicalMeltdown);
AddExecutor(ExecutorType.Activate, CardId.FireFormationTenki, FireFormationTenkiEffect);
AddExecutor(ExecutorType.Activate, CardId.ZoodiacBarrage, ZoodiacBarrageEffect);
AddExecutor(ExecutorType.Activate, CardId.DaigustoEmeral, DaigustoEmeralEffect);
AddExecutor(ExecutorType.SpSummon, CardId.PhotonThrasher, PhotonThrasherSummon);
AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.InvokedMechaba, DefaultTrap);
AddExecutor(ExecutorType.Activate, RatpierMaterialEffect);
AddExecutor(ExecutorType.Activate, CardId.Drident, DridentEffect);
AddExecutor(ExecutorType.Activate, CardId.Broadbull, BroadbullEffect);
AddExecutor(ExecutorType.Activate, CardId.Tigermortar, TigermortarEffect);
AddExecutor(ExecutorType.Activate, CardId.Chakanine, ChakanineEffect);
AddExecutor(ExecutorType.SpSummon, CardId.Chakanine, ChakanineSummon);
AddExecutor(ExecutorType.SpSummon, CardId.Tigermortar, TigermortarSummon);
AddExecutor(ExecutorType.SpSummon, CardId.Broadbull, BroadbullSummon);
AddExecutor(ExecutorType.SpSummon, CardId.Drident, DridentSummon);
AddExecutor(ExecutorType.Summon, CardId.Ratpier);
AddExecutor(ExecutorType.Activate, CardId.Ratpier, RatpierEffect);
AddExecutor(ExecutorType.Summon, CardId.Thoroughblade);
AddExecutor(ExecutorType.Activate, CardId.Thoroughblade, RatpierEffect);
AddExecutor(ExecutorType.Summon, CardId.AleisterTheInvoker);
AddExecutor(ExecutorType.Activate, CardId.AleisterTheInvoker, AleisterTheInvokerEffect);
AddExecutor(ExecutorType.SpSummon, CardId.DaigustoEmeral, DaigustoEmeralSummon);
AddExecutor(ExecutorType.SpSummon, CardId.Broadbull, BroadbullXYZSummon);
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, MonsterRebornEffect);
AddExecutor(ExecutorType.SpSummon, CardId.PhotonThrasher);
AddExecutor(ExecutorType.Summon, CardId.Whiptail);
AddExecutor(ExecutorType.Activate, CardId.Invocation, InvocationEffect);
AddExecutor(ExecutorType.Activate, CardId.Whiptail, WhiptailEffect);
AddExecutor(ExecutorType.Activate, CardId.ZoodiacCombo, ZoodiacComboEffect);
AddExecutor(ExecutorType.SpellSet, CardId.ZoodiacCombo);
AddExecutor(ExecutorType.Repos, MonsterRepos);
}
public override bool OnSelectHand()
{
// go first
return true;
}
public override void OnNewTurn()
{
// reset
TigermortarSpsummoned = false;
ChakanineSpsummoned = false;
BroadbullSpsummoned = false;
WhiptailEffectCount = 0;
}
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (!defender.IsMonsterHasPreventActivationEffectInBattle())
{
if (attacker.HasType(CardType.Fusion) && Bot.HasInHand(CardId.AleisterTheInvoker))
attacker.RealPower = attacker.RealPower + 1000;
}
return base.OnPreBattleBetween(attacker, defender);
}
private bool PhotonThrasherSummon()
{
return Bot.HasInHand(CardId.AleisterTheInvoker)
&& !Bot.HasInHand(CardId.Ratpier)
&& !Bot.HasInHand(CardId.Thoroughblade);
}
private bool AleisterTheInvokerEffect()
{
if (Card.Location == CardLocation.Hand)
{
if (!(Duel.Phase == DuelPhase.BattleStep
|| Duel.Phase == DuelPhase.BattleStart
|| Duel.Phase == DuelPhase.Damage))
return false;
return Duel.Player==0
|| AI.Utils.IsOneEnemyBetter();
}
return true;
}
private bool InvocationEffect()
{
if (Card.Location == CardLocation.Grave)
return true;
IList<ClientCard> materials0 = Bot.Graveyard;
IList<ClientCard> materials1 = Enemy.Graveyard;
ClientCard mat = null;
foreach (ClientCard card in materials0)
{
if (card.HasAttribute(CardAttribute.Light))
{
mat = card;
break;
}
}
foreach (ClientCard card in materials1)
{
if (card.HasAttribute(CardAttribute.Light))
{
mat = card;
break;
}
}
if (mat != null)
{
AI.SelectCard(CardId.InvokedMechaba);
SelectAleisterInGrave();
AI.SelectThirdCard(mat);
AI.SelectPosition(CardPosition.FaceUpAttack);
return true;
}
foreach (ClientCard card in materials0)
{
if (card.HasAttribute(CardAttribute.Earth))
{
mat = card;
break;
}
}
foreach (ClientCard card in materials1)
{
if (card.HasAttribute(CardAttribute.Earth))
{
mat = card;
break;
}
}
if (mat != null)
{
AI.SelectCard(CardId.InvokedMagellanica);
SelectAleisterInGrave();
AI.SelectThirdCard(mat);
AI.SelectPosition(CardPosition.FaceUpAttack);
return true;
}
return false;
}
private void SelectAleisterInGrave()
{
foreach (ClientCard card in Enemy.Graveyard)
{
if (card.Id == CardId.AleisterTheInvoker)
{
AI.SelectNextCard(card);
return;
}
}
foreach (ClientCard card in Bot.Graveyard)
{
if (card.Id == CardId.AleisterTheInvoker)
{
AI.SelectNextCard(card);
return;
}
}
AI.SelectNextCard(CardId.AleisterTheInvoker);
}
private bool ChakanineSummon()
{
if (Bot.HasInMonstersZone(CardId.Ratpier) && !ChakanineSpsummoned)
{
AI.SelectCard(CardId.Ratpier);
AI.SelectYesNo(true);
AI.SelectPosition(CardPosition.FaceUpDefence);
ChakanineSpsummoned = true;
return true;
}
if (Bot.HasInMonstersZone(CardId.Broadbull) && !ChakanineSpsummoned)
{
AI.SelectCard(CardId.Broadbull);
AI.SelectYesNo(true);
AI.SelectPosition(CardPosition.FaceUpDefence);
ChakanineSpsummoned = true;
return true;
}
return false;
}
private bool ChakanineEffect()
{
if (Bot.HasInGraveyard(CardId.Whiptail) || Bot.HasInGraveyard(CardId.Thoroughblade))
{
AI.SelectCard(new[]
{
CardId.Broadbull,
CardId.Tigermortar,
CardId.Chakanine,
CardId.Thoroughblade,
CardId.Ratpier,
CardId.Whiptail
});
AI.SelectNextCard(new[]
{
CardId.Whiptail,
CardId.Thoroughblade
});
return true;
}
return false;
}
private bool TigermortarSummon()
{
if (Bot.HasInMonstersZone(CardId.Chakanine) && !TigermortarSpsummoned)
{
AI.SelectCard(CardId.Chakanine);
AI.SelectYesNo(true);
AI.SelectPosition(CardPosition.FaceUpDefence);
TigermortarSpsummoned = true;
return true;
}
if (Bot.HasInMonstersZone(CardId.Ratpier) && !TigermortarSpsummoned)
{
AI.SelectCard(CardId.Ratpier);
AI.SelectYesNo(true);
AI.SelectPosition(CardPosition.FaceUpDefence);
TigermortarSpsummoned = true;
return true;
}
if (Bot.HasInMonstersZone(CardId.Thoroughblade) && !TigermortarSpsummoned
&& Bot.HasInGraveyard(new[]
{
CardId.Whiptail,
CardId.Ratpier
}))
{
AI.SelectCard(CardId.Thoroughblade);
AI.SelectYesNo(true);
TigermortarSpsummoned = true;
return true;
}
if (Bot.HasInMonstersZone(CardId.Whiptail) && !TigermortarSpsummoned
&& Bot.HasInGraveyard(CardId.Ratpier))
{
AI.SelectCard(CardId.Whiptail);
AI.SelectYesNo(true);
TigermortarSpsummoned = true;
return true;
}
return false;
}
private bool TigermortarEffect()
{
//if (Card.HasXyzMaterial(CardId.Ratpier) || !Bot.HasInGraveyard(CardId.Ratpier))
// return false;
AI.SelectCard(CardId.Chakanine);
AI.SelectNextCard(CardId.Tigermortar);
AI.SelectThirdCard(new[]
{
CardId.Ratpier,
CardId.Whiptail,
CardId.Thoroughblade
});
return true;
}
private bool BroadbullSummon()
{
if (Bot.HasInMonstersZone(CardId.Tigermortar) && !BroadbullSpsummoned)
{
AI.SelectCard(CardId.Tigermortar);
AI.SelectYesNo(true);
AI.SelectPosition(CardPosition.FaceUpDefence);
BroadbullSpsummoned = true;
return true;
}
if (Bot.HasInMonstersZone(CardId.Chakanine) && !BroadbullSpsummoned)
{
AI.SelectCard(CardId.Chakanine);
AI.SelectYesNo(true);
AI.SelectPosition(CardPosition.FaceUpDefence);
BroadbullSpsummoned = true;
return true;
}
if (Bot.HasInMonstersZone(CardId.Ratpier) && !BroadbullSpsummoned)
{
AI.SelectCard(CardId.Ratpier);
AI.SelectYesNo(true);
AI.SelectPosition(CardPosition.FaceUpDefence);
BroadbullSpsummoned = true;
return true;
}
if (Bot.HasInMonstersZone(CardId.Thoroughblade) && !BroadbullSpsummoned)
{
AI.SelectCard(CardId.Thoroughblade);
AI.SelectYesNo(true);
AI.SelectPosition(CardPosition.FaceUpDefence);
BroadbullSpsummoned = true;
return true;
}
return false;
}
private bool BroadbullEffect()
{
AI.SelectCard(new[]
{
CardId.Tigermortar,
CardId.Chakanine,
CardId.Drident,
CardId.AleisterTheInvoker,
CardId.PhotonThrasher
});
if (Bot.HasInHand(CardId.Whiptail) && !Bot.HasInHand(CardId.Ratpier))
AI.SelectNextCard(CardId.Ratpier);
else
AI.SelectNextCard(CardId.Whiptail);
return true;
}
private bool BroadbullXYZSummon()
{
AI.SelectYesNo(false);
AI.SelectPosition(CardPosition.FaceUpDefence);
AI.SelectCard(new[]
{
CardId.Ratpier,
CardId.PhotonThrasher,
CardId.Whiptail,
CardId.AleisterTheInvoker
});
return true;
}
private bool DridentSummon()
{
AI.SelectCard(new[]
{
CardId.Broadbull,
CardId.Tigermortar,
CardId.Chakanine,
CardId.Thoroughblade
});
return true;
}
private bool RatpierMaterialEffect()
{
if (ActivateDescription == AI.Utils.GetStringId(CardId.Ratpier, 1))
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
return false;
}
private bool WhiptailEffect()
{
if (Duel.Phase == DuelPhase.Main1 || Duel.Phase == DuelPhase.Main2)
return false;
if (Card.IsDisabled() || WhiptailEffectCount >= 3)
return false;
ClientCard target = null;
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (monster.IsFaceup() && monster.Id == CardId.Drident && !monster.HasXyzMaterial())
{
target = monster;
break;
}
}
/*if (target == null)
{
foreach (ClientCard monster in monsters)
{
if (monster.IsFaceup() && monster.Type == (int)CardType.Xyz && monster.Id != CardId.DaigustoEmeral && !monster.HasXyzMaterial())
{
target = monster;
break;
}
}
}*/
if (target == null)
{
AI.SelectCard(new[]
{
CardId.Drident
});
}
WhiptailEffectCount++;
return true;
}
private bool RatpierEffect()
{
AI.SelectCard(new[]
{
CardId.ZoodiacCombo,
CardId.Thoroughblade,
CardId.ZoodiacBarrage
});
return true;
}
private bool DridentEffect()
{
if (LastChainPlayer == 0)
return false;
ClientCard target = AI.Utils.GetBestEnemyCard(true);
if (target == null)
return false;
AI.SelectCard(new[]
{
CardId.Broadbull,
CardId.Tigermortar,
CardId.Chakanine,
CardId.Thoroughblade,
CardId.Ratpier,
CardId.Whiptail
});
AI.SelectNextCard(target);
return true;
}
private bool DaigustoEmeralSummon()
{
return Bot.GetGraveyardMonsters().Count >= 3;
}
private bool DaigustoEmeralEffect()
{
AI.SelectCard(new[]
{
CardId.Ratpier,
CardId.AleisterTheInvoker,
CardId.Whiptail
});
AI.SelectNextCard(new[]
{
CardId.Ratpier,
CardId.DaigustoEmeral
});
return true;
}
private bool FireFormationTenkiEffect()
{
if (Bot.HasInHand(CardId.ZoodiacBarrage)
|| Bot.HasInSpellZone(CardId.ZoodiacBarrage)
|| Bot.HasInHand(CardId.Ratpier))
{
AI.SelectCard(CardId.Whiptail);
}
else
{
AI.SelectCard(CardId.Ratpier);
}
AI.SelectYesNo(true);
return true;
}
private bool ZoodiacBarrageEffect()
{
foreach (ClientCard spell in Bot.GetSpells())
{
if (spell.Id == CardId.ZoodiacBarrage && !Card.Equals(spell))
return false;
}
AI.SelectCard(new[]
{
CardId.FireFormationTenki,
CardId.MagicalMeltdown,
CardId.ZoodiacBarrage
});
AI.SelectNextCard(new[]
{
CardId.Ratpier,
CardId.Whiptail,
CardId.Thoroughblade
});
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool ZoodiacComboEffect()
{
if (CurrentChain.Count > 0)
return false;
if (Card.Location != CardLocation.Grave)
{
AI.SelectCard(CardId.Drident);
AI.SelectNextCard(new[]
{
CardId.Whiptail,
CardId.Ratpier,
CardId.Thoroughblade
});
}
return true;
}
private bool MonsterRebornEffect()
{
AI.SelectCard(new[]
{
CardId.Ratpier,
CardId.Whiptail,
CardId.InvokedMechaba,
CardId.JizukirutheStarDestroyingKaiju,
CardId.InvokedMagellanica,
CardId.Tigermortar,
CardId.Chakanine,
CardId.Broadbull
});
return true;
}
private bool MonsterRepos()
{
if (Card.Id == CardId.NumberS39UtopiatheLightning)
return false;
return base.DefaultMonsterRepos();
}
}
}
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