Commit fa96dfae authored by nanahira's avatar nanahira

mg

parents 3b92c1dd 42a2cc6b
#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
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
#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
#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
#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
#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
#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
#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
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
#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
#created by ...
#main
77558536
18144506
57774843
57774843
57774843
58996430
58996430
58996430
59019082
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
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
77558536
18144506
57774843
57774843
57774843
58996430
58996430
58996430
59019082
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
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
18940556
18940556
18940556
93332803
93332803
55063751
28674152
41782653
41782653
41782653
3717252
3717252
80280944
48048590
77723643
55623480
30328508
30328508
44335251
77558536
77558536
77558536
95503687
95503687
4939890
4939890
14558127
14558127
59438930
37445295
37445295
23434538
23434538
33420078
67441435
1475311
1475311
1475311
11110587
11110587
11110587
18144506
38179121
38179121
38179121
44394295
44394295
44394295
67169062
81439173
83764718
94886282
94886282
99330325
10045474
10045474
74003290
77505534
4904633
#extra
74822425
20366274
48424886
94977269
50954680
80666118
4779823
33698022
76547525
42566602
98558751
30100551
74997493
50588353
50588353
!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
#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
#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
#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
#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
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
......@@ -2,7 +2,6 @@
#main
98169343
98169343
9929398
61283655
61283655
61283655
......@@ -11,20 +10,21 @@
35199656
14558127
14558127
14558127
59438930
59438930
98700941
23434538
23434538
23434538
67441435
94145021
63845230
63845230
63845230
18144506
35261759
35261759
53129443
53129443
53129443
73628505
73915051
73915051
......@@ -42,18 +42,18 @@
84749824
#extra
41999284
3987233
41999284
3987233
2857636
50588353
98558751
74997493
2857636
38342335
99111753
86221741
31833038
3987233
99111753
38342335
50588353
41999284
9753964
41999284
34408491
!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
#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
{
"welcome": [
"真難得有人發現這個。",
"真沒想到你能跟我對戰呢!決鬥者。不過也就到此為止了,接下來由我V.F.D(非常友善的決鬥者)來做你的對手。"
],
"deckerror": [
"阿,可能BA又把CBD修壞導致{0}消失了。"
],
"duelstart": [
"這只是AI,打贏不要太高興阿。",
"十分致謝233服讓我們有遊戲可以玩,別忘記去拜訪他們。",
"反主流學院請洽NOVA。",
"Wryyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy."
],
"newturn": [
"到我的回合了,抽牌!",
"我的回合,抽牌!",
"我抽了一張卡。"
],
"endturn": [
"回合结束。",
"我的回合结束了。",
"這樣算是成功的展開嗎......",
"輪到你了。你的下一句是......我要發動灰流麗對吧!"
],
"directattack": [
"{0},直接攻擊!",
"{0},直接攻擊對手!",
"{0},没有防守的地方,攻擊!",
"{0},攻擊對手的生命值!",
"{0},直接攻擊對手的生命值!",
"{0},通過直接攻擊打倒對手!",
"{0},使用直接攻擊打倒對手!",
"{0},直接攻擊釋放你的力量吧!",
"我的{0}將會粉碎你的生命值!",
"向對手展示你的力量吧,{0}!",
"你已經無法阻止我了。{0},攻擊!"
],
"attack": [
"{0},攻擊這體{1}!",
"{0},消滅這體{1}!",
"{0},打倒{1}!",
"{0},衝向那體{1}!",
"{0},把你的力量释放到{1}上吧!"
],
"ondirectattack": [
"可惡......",
"不過是{0}而已!",
"果然我還是太弱了......"
],
"facedownmonstername": "怪獸",
"activate": [
"我發動{0}。",
"我使用{0}的效果。",
"我使用{0}的力量。"
],
"summon": [
"真是HIGH的最高點!出來吧{0}。",
"出來吧,{0}!",
"出現吧,{0}!",
"我召喚了強大的{0}!",
"我呼喚{0}參加戰鬥!",
"我呼喚出{0}。",
"我召喚{0}。"
],
"setmonster": [
"我放置了一體怪獸。",
"我裡側表示放置了一體怪獸。"
],
"chaining": [
"看這裡!發動{0}!",
"我使用{0}的力量。",
"很不錯的戰術...但是我拒絕!{0}!",
"真不愧是納粹,竟然能識破我的蓋牌......你說你只是單純的決鬥者?{0},發動!",
"看樣子你忘了我的{0}!",
"你考慮過我有{0}嗎?"
]
}
{
"welcome": [
"你找到我了!!!",
"來決鬥吧"
],
"deckerror": [
"阿,可能BA又把CBD修壞導致{0}消失了。"
],
"duelstart": [
"這只是AI,打贏不要太高興阿。",
"十分致謝233服讓我們有遊戲可以玩,別忘記去拜訪他們。",
"反主流學院請洽NOVA。"
],
"newturn": [
"到我的回合了,抽牌!",
"我的回合,抽牌!",
"我抽了一張卡。"
],
"endturn": [
"回合结束。",
"我的回合结束了。",
"這樣算是成功的展開嗎......",
"輪到你了。你的下一句是......我要發動灰流麗對吧!"
],
"directattack": [
"{0},直接攻擊!",
"{0},直接攻擊對手!",
"{0},没有防守的地方,攻擊!",
"{0},攻擊對手的生命值!",
"{0},直接攻擊對手的生命值!",
"{0},通過直接攻擊打倒對手!",
"{0},使用直接攻擊打倒對手!",
"{0},直接攻擊釋放你的力量吧!",
"我的{0}將會粉碎你的生命值!",
"向對手展示你的力量吧,{0}!",
"你已經無法阻止我了。{0},攻擊!"
],
"attack": [
"{0},攻擊這體{1}!",
"{0},消滅這體{1}!",
"{0},打倒{1}!",
"{0},衝向那體{1}!",
"{0},把你的力量释放到{1}上吧!"
],
"ondirectattack": [
"可惡......",
"不過是{0}而已!",
"果然我還是太弱了......"
],
"facedownmonstername": "怪獸",
"activate": [
"我發動{0}。",
"我使用{0}的效果。",
"我使用{0}的力量。"
],
"summon": [
"真是HIGH的最高點!出來吧{0}。",
"出來吧,{0}!",
"出現吧,{0}!",
"我召喚了強大的{0}!",
"我呼喚{0}參加戰鬥!",
"我呼喚出{0}。",
"我召喚{0}。"
],
"setmonster": [
"我放置了一體怪獸。",
"我裡側表示放置了一體怪獸。"
],
"chaining": [
"看這裡!發動{0}!",
"我使用{0}的力量。",
"很不錯的戰術...但是我拒絕!{0}!",
"看樣子你忘了我的{0}!",
"你考慮過我有{0}嗎?"
]
}
......@@ -296,6 +296,44 @@ namespace WindBot.Game.AI
return Duel.ChainTargets.Count == 1 && card.Equals(Duel.ChainTargets[0]);
}
public bool ChainContainsCard(int id)
{
foreach (ClientCard card in Duel.CurrentChain)
{
if (card.Id == id)
return true;
}
return false;
}
public int ChainCountPlayer(int player)
{
int count = 0;
foreach (ClientCard card in Duel.CurrentChain)
{
if (card.Controller == player)
count++;
}
return count;
}
public bool HasChainedTrap(int player)
{
foreach (ClientCard card in Duel.CurrentChain)
{
if (card.Controller == player && card.HasType(CardType.Trap))
return true;
}
return false;
}
public ClientCard GetLastChainCard()
{
if (Duel.CurrentChain.Count > 0)
return Duel.CurrentChain[Duel.CurrentChain.Count - 1];
return null;
}
/// <summary>
/// Select cards listed in preferred.
/// </summary>
......
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;
}
}
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, int hint, 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);
}
}
AI.Utils.CheckSelectCount(result, cards, min, max);
return result;
}
Logger.DebugWriteLine("Use default.");
return null;
}
public override IList<ClientCard> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max)
{
Logger.DebugWriteLine("OnSelectXyzMaterial " + cards.Count + " " + min + " " + max);
IList<ClientCard> result = new List<ClientCard>();
AI.Utils.SelectPreferredCards(result, UsedAlternativeWhiteDragon, cards, min, max);
AI.Utils.CheckSelectCount(result, cards, min, max);
return result;
}
public override IList<ClientCard> OnSelectSynchroMaterial(IList<ClientCard> cards, int sum, int min, int max)
{
Logger.DebugWriteLine("OnSelectSynchroMaterial " + cards.Count + " " + sum + " " + min + " " + max);
if (sum != 8)
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 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, int hint, 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);
}
}
AI.Utils.CheckSelectCount(result, cards, min, max);
return result;
}
Logger.DebugWriteLine("Use default.");
return null;
}
public override IList<ClientCard> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max)
{
Logger.DebugWriteLine("OnSelectXyzMaterial " + cards.Count + " " + min + " " + max);
IList<ClientCard> result = new List<ClientCard>();
AI.Utils.SelectPreferredCards(result, UsedAlternativeWhiteDragon, cards, min, max);
AI.Utils.CheckSelectCount(result, cards, min, max);
return result;
}
public override IList<ClientCard> OnSelectSynchroMaterial(IList<ClientCard> cards, int sum, int min, int max)
{
Logger.DebugWriteLine("OnSelectSynchroMaterial " + cards.Count + " " + sum + " " + min + " " + max);
if (sum != 8)
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 && Duel.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 Duel.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 Duel.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 || Bot.LifePoints < 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 > Enemy.LifePoints)
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)
);
}
}
}
......@@ -90,7 +90,7 @@ namespace WindBot.Game.AI.Decks
private bool SupremacyBerry()
{
return Duel.LifePoints[0] < Duel.LifePoints[1];
return Bot.LifePoints < Enemy.LifePoints;
}
private bool PoisonOfTheOldMan()
......
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;
}
}
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
......@@ -399,7 +399,7 @@ namespace WindBot.Game.AI.Decks
private bool CrystalWingSynchroDragonEffect()
{
return LastChainPlayer != 0;
return Duel.LastChainPlayer != 0;
}
private bool DragunityPhalanxSummon()
......
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...?
}
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 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;
}
}
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...?
}
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
......@@ -162,7 +162,7 @@ namespace WindBot.Game.AI.Decks
private bool HorusTheBlackFlameDragonLv8()
{
return LastChainPlayer == 1;
return Duel.LastChainPlayer == 1;
}
private bool DragonsRebirth()
......
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> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max)
{
Logger.DebugWriteLine("OnSelectXyzMaterial " + cards.Count + " " + min + " " + max);
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 >= max)
break;
}
AI.Utils.CheckSelectCount(result, cards, min, max);
return result;
}
private bool ReinforcementOfTheArmyEffect()
{
if (!Bot.HasInHand(CardId.Raiden))
{
AI.SelectCard(CardId.Raiden);
return true;
}
else if (!Bot.HasInHand(CardId.Goblindbergh))
{
AI.SelectCard(CardId.Goblindbergh);
return true;
}
return false;
}
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.GetMonsters())
{
if (!card.Equals(Card) && 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 LuminaEffect()
{
if (!Bot.HasInGraveyard(CardId.Raiden) && Bot.HasInHand(CardId.Raiden))
{
AI.SelectCard(CardId.Raiden);
}
else if (!ClownUsed && Bot.HasInHand(CardId.PerformageTrickClown))
{
AI.SelectCard(CardId.PerformageTrickClown);
}
else
{
AI.SelectCard(new[] {
CardId.Wulf,
CardId.Felis,
CardId.Minerva,
CardId.ThousandBlades
});
}
AI.SelectNextCard(new[] {
CardId.Raiden,
CardId.Felis
});
return true;
}
private bool PerformageTrickClownEffect()
{
ClownUsed = true;
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool MinervaTheExaltedEffect()
{
if (Card.Location == CardLocation.MonsterZone)
{
return true;
}
else
{
IList<ClientCard> targets = new List<ClientCard>();
ClientCard target1 = AI.Utils.GetBestEnemyMonster();
if (target1 != null)
targets.Add(target1);
ClientCard target2 = AI.Utils.GetBestEnemySpell();
if (target2 != null)
targets.Add(target2);
foreach (ClientCard target in Enemy.GetMonsters())
{
if (targets.Count >= 3)
break;
if (!targets.Contains(target))
targets.Add(target);
}
foreach (ClientCard target in Enemy.GetSpells())
{
if (targets.Count >= 3)
break;
if (!targets.Contains(target))
targets.Add(target);
}
if (targets.Count == 0)
return false;
AI.SelectNextCard(targets);
return true;
}
}
private bool HonestEffect()
{
return Duel.Phase != DuelPhase.Main1;
}
}
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, DefaultNumberS39UtopiaTheLightningEffect);
AddExecutor(ExecutorType.Activate, CardId.PerformageTrickClown, PerformageTrickClownEffect);
AddExecutor(ExecutorType.Activate, CardId.ThousandBlades);
AddExecutor(ExecutorType.Activate, CardId.Honest, DefaultHonestEffect);
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> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max)
{
Logger.DebugWriteLine("OnSelectXyzMaterial " + cards.Count + " " + min + " " + max);
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 >= max)
break;
}
AI.Utils.CheckSelectCount(result, cards, min, max);
return result;
}
private bool ReinforcementOfTheArmyEffect()
{
if (!Bot.HasInHand(CardId.Raiden))
{
AI.SelectCard(CardId.Raiden);
return true;
}
else if (!Bot.HasInHand(CardId.Goblindbergh))
{
AI.SelectCard(CardId.Goblindbergh);
return true;
}
return false;
}
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.GetMonsters())
{
if (!card.Equals(Card) && 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 LuminaEffect()
{
if (!Bot.HasInGraveyard(CardId.Raiden) && Bot.HasInHand(CardId.Raiden))
{
AI.SelectCard(CardId.Raiden);
}
else if (!ClownUsed && Bot.HasInHand(CardId.PerformageTrickClown))
{
AI.SelectCard(CardId.PerformageTrickClown);
}
else
{
AI.SelectCard(new[] {
CardId.Wulf,
CardId.Felis,
CardId.Minerva,
CardId.ThousandBlades
});
}
AI.SelectNextCard(new[] {
CardId.Raiden,
CardId.Felis
});
return true;
}
private bool PerformageTrickClownEffect()
{
ClownUsed = true;
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool MinervaTheExaltedEffect()
{
if (Card.Location == CardLocation.MonsterZone)
{
return true;
}
else
{
IList<ClientCard> targets = new List<ClientCard>();
ClientCard target1 = AI.Utils.GetBestEnemyMonster();
if (target1 != null)
targets.Add(target1);
ClientCard target2 = AI.Utils.GetBestEnemySpell();
if (target2 != null)
targets.Add(target2);
foreach (ClientCard target in Enemy.GetMonsters())
{
if (targets.Count >= 3)
break;
if (!targets.Contains(target))
targets.Add(target);
}
foreach (ClientCard target in Enemy.GetSpells())
{
if (targets.Count >= 3)
break;
if (!targets.Contains(target))
targets.Add(target);
}
if (targets.Count == 0)
return false;
AI.SelectNextCard(targets);
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("LightswornShaddoldinosour", "AI_LightswornShaddoldinosour", "ver0.1")]
public class LightswornShaddoldinosour : DefaultExecutor
{
public class CardId
{
//monster
public const int UltimateConductorTytanno = 18940556;
public const int DogorantheMadFlameKaiju = 93332803;
public const int GamecieltheSeaTurtleKaiju = 55063751;
public const int RadiantheMultidimensionalKaiju = 28674152;
public const int OvertexCoatls = 41782653;
public const int ShaddollBeast = 3717252;
public const int GiantRex = 80280944;
public const int ShaddollDragon = 77723643;
public const int FairyTailSnow = 55623480;
public const int KeeperOfDragonicMagic = 48048590;
public const int ShaddollSquamata = 30328508;
public const int SouleatingOviraptor = 44335251;
public const int Raiden = 77558536;
public const int Lumina = 95503687;
public const int ShaddollHedgehog = 4939890;
public const int AshBlossom = 14558127;
public const int GhostOgre = 59438930;
public const int ShaddollFalco = 37445295;
public const int MaxxC = 23434538;
public const int PlaguespreaderZombie = 33420078;
public const int GlowUpBulb = 67441435;
//spell
public const int AllureofDarkness = 1475311;
public const int ThatGrassLooksgreener = 11110587;
public const int HarpiesFeatherDuster = 18144506;
public const int DoubleEvolutionPill = 38179121;
public const int ShaddollFusion = 44394295;
public const int PotOfAvarice = 67169026;
public const int FoolishBurial = 81439173;
public const int MonsterReborn = 83764718;
public const int ChargeOfTheLightBrigade = 94886282;
public const int InterruptedKaijuSlumber = 99330325;
public const int ElShaddollFusion = 6417578;
//trap
public const int infiniteTransience = 10045474;
public const int LostWind = 74003290;
public const int SinisterShadowGames = 77505534;
public const int ShaddollCore = 4904633;
//extra
public const int ElShaddollShekhinaga = 74822425;
public const int ElShaddollConstruct = 20366274;
public const int ElShaddollGrysra = 48424886;
public const int ElShaddollWinda = 94977269;
public const int CrystalWingSynchroDragon = 50954680;
public const int ScarlightRedDragon = 80666118;
public const int Michael = 4779823;
public const int BlackRoseMoonlightDragon = 33698022;
public const int RedWyvern = 76547525;
public const int CoralDragon = 42566602;
public const int TG_WonderMagician = 98558751;
public const int MinervaTheExalte = 30100551;
public const int Sdulldeat = 74997493;
public const int CrystronNeedlefiber = 50588353;
}
bool Pillused = false;
bool CrystalWingSynchroDragoneff_used = false;
bool OvertexCoatlseff_used = false;
public LightswornShaddoldinosour(GameAI ai, Duel duel)
: base(ai, duel)
{
//counter
AddExecutor(ExecutorType.SpSummon, CardId.CrystalWingSynchroDragon, CrystalWingSynchroDragonesp);
AddExecutor(ExecutorType.Activate, CardId.GhostOgre, Hand_act_eff);
AddExecutor(ExecutorType.Activate, CardId.AshBlossom, Hand_act_eff);
AddExecutor(ExecutorType.Activate, CardId.MaxxC,MaxxC);
//first do
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, CardId.infiniteTransience, DefaultBreakthroughSkill);
AddExecutor(ExecutorType.Activate, CardId.ThatGrassLooksgreener);
AddExecutor(ExecutorType.Summon, CardId.SouleatingOviraptor);
AddExecutor(ExecutorType.Activate, CardId.SouleatingOviraptor, SouleatingOviraptoreff);
AddExecutor(ExecutorType.Activate, CardId.AllureofDarkness, DefaultAllureofDarkness);
AddExecutor(ExecutorType.Activate, CardId.PotOfAvarice, PotofAvarice);
// AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, CardId.ChargeOfTheLightBrigade, ChargeOfTheLightBrigadeEffect);
AddExecutor(ExecutorType.Activate, CardId.FoolishBurial, FoolishBurialEffect);
AddExecutor(ExecutorType.Activate, CardId.InterruptedKaijuSlumber, DefaultInterruptedKaijuSlumber);
AddExecutor(ExecutorType.Activate, CardId.ShaddollFusion, ShaddollFusioneff);
//Reborn
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, RebornEffect);
//Normal Summon
AddExecutor(ExecutorType.Summon, CardId.Raiden);
AddExecutor(ExecutorType.Activate, CardId.Raiden);
AddExecutor(ExecutorType.Summon , CardId.KeeperOfDragonicMagic);
AddExecutor(ExecutorType.Activate, CardId.KeeperOfDragonicMagic, KeeperOfDragonicMagic);
AddExecutor(ExecutorType.MonsterSet, CardId.ShaddollSquamata);
AddExecutor(ExecutorType.MonsterSet, CardId.GlowUpBulb);
AddExecutor(ExecutorType.MonsterSet, CardId.ShaddollHedgehog);
AddExecutor(ExecutorType.MonsterSet, CardId.ShaddollDragon);
AddExecutor(ExecutorType.Summon, CardId.FairyTailSnow,FairyTailSnow);
AddExecutor(ExecutorType.Activate, CardId.FairyTailSnow, FairyTailSnow);
AddExecutor(ExecutorType.Summon, CardId.Lumina);
AddExecutor(ExecutorType.Activate, CardId.Lumina);
//Sp Summon
AddExecutor(ExecutorType.SpSummon, CardId.UltimateConductorTytanno, UltimateConductorTytannosp);
AddExecutor(ExecutorType.Activate, CardId.UltimateConductorTytanno, UltimateConductorTytannoeff);
AddExecutor(ExecutorType.Activate, CardId.DoubleEvolutionPill, DoubleEvolutionPilleff);
AddExecutor(ExecutorType.SpSummon, CardId.MinervaTheExalte);
AddExecutor(ExecutorType.Activate, CardId.MinervaTheExalte, MinervaTheExaltedEffect);
AddExecutor(ExecutorType.SpSummon, CardId.GamecieltheSeaTurtleKaiju, DefaultKaijuSpsummon);
//activate
AddExecutor(ExecutorType.SpSummon , CardId.GlowUpBulb,GlowUpBulbeff);
//activate chain
AddExecutor(ExecutorType.Activate, CardId.OvertexCoatls, OvertexCoatlseff);
AddExecutor(ExecutorType.Activate, CardId.ShaddollBeast);
AddExecutor(ExecutorType.Activate, CardId.ShaddollFalco, ShaddollFalcoeff);
AddExecutor(ExecutorType.Activate, CardId.ShaddollSquamata, ShaddollSquamataeff);
AddExecutor(ExecutorType.Activate, CardId.ShaddollDragon, ShaddollDragoneff);
AddExecutor(ExecutorType.Activate, CardId.ShaddollHedgehog, ShaddollHedgehogeff);
AddExecutor(ExecutorType.Activate, CardId.GiantRex);
AddExecutor(ExecutorType.Activate, CardId.ElShaddollConstruct);
AddExecutor(ExecutorType.Activate, CardId.ElShaddollGrysra);
AddExecutor(ExecutorType.Activate, CardId.ElShaddollShekhinaga, ElShaddollShekhinagaeff);
AddExecutor(ExecutorType.Activate, CardId.ElShaddollWinda);
AddExecutor(ExecutorType.Activate, CardId.CrystalWingSynchroDragon, CrystalWingSynchroDragoneff);
AddExecutor(ExecutorType.Activate, CardId.TG_WonderMagician);
//spellset
AddExecutor(ExecutorType.SpellSet, CardId.MonsterReborn, spellset);
AddExecutor(ExecutorType.SpellSet, CardId.PotOfAvarice, spellset);
AddExecutor(ExecutorType.SpellSet, CardId.ThatGrassLooksgreener, spellset);
//trap
AddExecutor(ExecutorType.SpellSet, CardId.LostWind, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.SinisterShadowGames, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.ShaddollCore);
AddExecutor(ExecutorType.SpellSet, CardId.infiniteTransience, SetIsFieldEmpty);
//trap activate
AddExecutor(ExecutorType.Activate, CardId.LostWind, DefaultBreakthroughSkill);
AddExecutor(ExecutorType.Activate, CardId.SinisterShadowGames, SinisterShadowGames);
AddExecutor(ExecutorType.Activate, CardId.ShaddollCore, ShaddollCoreeff);
AddExecutor(ExecutorType.Repos, MonsterRepos);
}
public int[] all_List()
{
return new[]
{
CardId.UltimateConductorTytanno,
CardId.DogorantheMadFlameKaiju,
CardId.GamecieltheSeaTurtleKaiju,
CardId.RadiantheMultidimensionalKaiju,
CardId.OvertexCoatls,
CardId.ShaddollBeast,
CardId.GiantRex,
CardId.ShaddollDragon,
CardId.FairyTailSnow,
CardId.KeeperOfDragonicMagic,
CardId.ShaddollSquamata,
CardId.SouleatingOviraptor,
CardId.Raiden,
CardId.Lumina,
CardId.ShaddollHedgehog,
CardId.AshBlossom,
CardId.GhostOgre,
CardId.ShaddollFalco,
CardId.MaxxC,
CardId.PlaguespreaderZombie,
CardId.GlowUpBulb,
CardId.AllureofDarkness,
CardId.ThatGrassLooksgreener,
CardId.HarpiesFeatherDuster,
CardId.DoubleEvolutionPill,
CardId.ShaddollFusion,
CardId.PotOfAvarice,
CardId.FoolishBurial,
CardId.MonsterReborn,
CardId.ChargeOfTheLightBrigade,
CardId.InterruptedKaijuSlumber,
CardId.ElShaddollFusion,
CardId.infiniteTransience,
CardId.LostWind,
CardId.SinisterShadowGames,
CardId.ShaddollCore,
};
}
public int[] Useless_List()
{
return new[]
{
CardId.GlowUpBulb,
CardId.PlaguespreaderZombie,
CardId.InterruptedKaijuSlumber,
CardId.ChargeOfTheLightBrigade,
CardId.FoolishBurial,
CardId.HarpiesFeatherDuster,
CardId.ThatGrassLooksgreener,
CardId.FairyTailSnow,
CardId.GiantRex,
CardId.Lumina,
CardId.OvertexCoatls,
};
}
public override void OnNewTurn()
{
Pillused = false;
OvertexCoatlseff_used = false;
CrystalWingSynchroDragoneff_used = false;
}
public bool CrystalWingSynchroDragonesp()
{
if (CrystalWingSynchroDragoneff_used) return false;
if (Bot.HasInMonstersZone(CardId.FairyTailSnow) ||
Bot.HasInMonstersZone(CardId.Lumina) ||
Bot.HasInMonstersZone(CardId.KeeperOfDragonicMagic)||
Bot.HasInMonstersZone(CardId.SouleatingOviraptor)
)
{
AI.SelectCard(new[]
{
CardId.KeeperOfDragonicMagic,
CardId.Lumina,
CardId.FairyTailSnow,
CardId.SouleatingOviraptor,
});
return true;
}
return false;
}
public bool CrystalWingSynchroDragoneff()
{
if (Duel.Player == 0)
{
CrystalWingSynchroDragoneff_used = true;
AI.SelectCard(new[] { CardId.GhostOgre, CardId.GlowUpBulb, CardId.PlaguespreaderZombie, CardId.ShaddollFalco });
return true;
}
else if (AI.Utils.IsChainTarget(Card) || AI.Utils.GetProblematicEnemySpell() != null) return true;
else if (Duel.Player == 1 && Duel.Phase == DuelPhase.BattleStart && AI.Utils.IsOneEnemyBetterThanValue(1500, true))
{
if (AI.Utils.IsOneEnemyBetterThanValue(1900, true))
{
AI.SelectPosition(CardPosition.FaceUpDefence);
}
else
{
AI.SelectPosition(CardPosition.FaceUpAttack);
}
return true;
}
return false;
}
private bool UltimateConductorTytannoeff()
{
if (Duel.Phase == DuelPhase.Main1 || Duel.Phase == DuelPhase.Main2)
{
IList<int> targets = new[] {
CardId.OvertexCoatls,
CardId.ShaddollBeast,
CardId.ShaddollSquamata,
CardId.ShaddollHedgehog,
CardId.ShaddollDragon,
CardId.GlowUpBulb,
CardId.PlaguespreaderZombie,
CardId.FairyTailSnow,
CardId.KeeperOfDragonicMagic,
CardId.Raiden,
CardId.Lumina,
CardId.DogorantheMadFlameKaiju,
CardId.GamecieltheSeaTurtleKaiju,
CardId.RadiantheMultidimensionalKaiju,
CardId.GiantRex,
CardId.ShaddollSquamata,
CardId.SouleatingOviraptor,
CardId.Raiden,
CardId.Lumina,
CardId.AshBlossom,
CardId.GhostOgre,
CardId.MaxxC,
};
if (!Bot.HasInHand(targets))
{
if (!Bot.HasInMonstersZone(targets))
{
return false;
}
}
AI.SelectCard(targets);
}
if (Duel.Phase == DuelPhase.Damage)
AI.SelectYesNo(true);
return true;
}
private bool UltimateConductorTytannosp()
{
Pillused = true;
foreach (ClientCard card in Bot.GetMonsters())
{
if (card.Id == Card.Id && card.IsFaceup())
return false;
}
return true;
}
private bool KeeperOfDragonicMagic()
{
if (ActivateDescription == -1)
{
AI.SelectCard(Useless_List());
return true;
}
return true;
}
private bool MonsterRepos()
{
if (Card.Id == CardId.ElShaddollConstruct && Card.IsAttack())
return false;
return base.DefaultMonsterRepos();
}
private bool OvertexCoatlseff()
{
if (OvertexCoatlseff_used == true)
return false;
return true;
}
private bool DoubleEvolutionPilleff()
{
if (Pillused == true) return false;
Pillused = true;
IList<int> targets = new[] {
CardId.GiantRex,
CardId.DogorantheMadFlameKaiju,
CardId.GamecieltheSeaTurtleKaiju,
CardId.RadiantheMultidimensionalKaiju,
CardId.OvertexCoatls,
CardId.SouleatingOviraptor,
CardId.UltimateConductorTytanno,
};
if (Bot.HasInGraveyard(targets))
{
AI.SelectCard(new[] {
CardId.GiantRex,
CardId.DogorantheMadFlameKaiju,
CardId.OvertexCoatls,
CardId.GamecieltheSeaTurtleKaiju,
CardId.RadiantheMultidimensionalKaiju,
CardId.SouleatingOviraptor,
CardId.UltimateConductorTytanno,
});
}
else
{
AI.SelectCard(new[] {
CardId.GiantRex,
CardId.DogorantheMadFlameKaiju,
CardId.GamecieltheSeaTurtleKaiju,
CardId.RadiantheMultidimensionalKaiju,
CardId.OvertexCoatls,
CardId.SouleatingOviraptor,
CardId.UltimateConductorTytanno,
});
}
IList<int> targets2 = new[] {
CardId.GiantRex,
CardId.DogorantheMadFlameKaiju,
CardId.GamecieltheSeaTurtleKaiju,
CardId.RadiantheMultidimensionalKaiju,
CardId.OvertexCoatls,
CardId.SouleatingOviraptor,
CardId.UltimateConductorTytanno,
};
if (Bot.HasInGraveyard(targets))
{
AI.SelectNextCard(new[] {
CardId.ShaddollBeast,
CardId.ShaddollDragon,
CardId.KeeperOfDragonicMagic,
CardId.ShaddollSquamata,
CardId.SouleatingOviraptor,
CardId.Raiden,
CardId.Lumina,
CardId.ShaddollHedgehog,
CardId.AshBlossom,
CardId.GhostOgre,
CardId.ShaddollFalco,
CardId.MaxxC,
CardId.PlaguespreaderZombie,
CardId.GlowUpBulb,
CardId.FairyTailSnow,
});
}
else
AI.SelectNextCard(new[] {
CardId.ShaddollBeast,
CardId.ShaddollDragon,
CardId.KeeperOfDragonicMagic,
CardId.ShaddollSquamata,
CardId.SouleatingOviraptor,
CardId.Raiden,
CardId.Lumina,
CardId.ShaddollHedgehog,
CardId.AshBlossom,
CardId.GhostOgre,
CardId.ShaddollFalco,
CardId.MaxxC,
CardId.PlaguespreaderZombie,
CardId.GlowUpBulb,
CardId.FairyTailSnow,
});
AI.SelectThirdCard(new[] {
CardId.UltimateConductorTytanno,
});
return Enemy.GetMonsterCount() >= 1;
}
private bool ShaddollCoreeff()
{
if (Card.Location == CardLocation.SpellZone)
{
if(Enemy.HasAttackingMonster())
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
return false;
}
return true;
}
private bool FairyTailSnow()
{
if (Card.Location == CardLocation.MonsterZone)
{
return true;
}
return false;
}
private bool SouleatingOviraptoreff()
{
if (!OvertexCoatlseff_used)
{
AI.SelectCard(CardId.OvertexCoatls);
AI.SelectYesNo(false);
}
else
{
AI.SelectCard(CardId.UltimateConductorTytanno);
AI.SelectYesNo(true);
}
return true;
}
private bool GlowUpBulbeff()
{
if(Bot.HasInMonstersZone(CardId.Lumina)||
Bot.HasInMonstersZone(CardId.FairyTailSnow)||
Bot.HasInMonstersZone(CardId.KeeperOfDragonicMagic)||
Bot.HasInMonstersZone(CardId.SouleatingOviraptor)
)
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool ShaddollFusioneff()
{
if (Enemy.GetMonstersExtraZoneCount() != 0)
{
AI.SelectCard(new[]
{
CardId.ElShaddollConstruct,
CardId.ElShaddollShekhinaga,
CardId.ElShaddollGrysra,
CardId.ElShaddollWinda
});
AI.SelectNextCard(new[]
{
CardId.ShaddollBeast,
CardId.ShaddollSquamata,
CardId.ShaddollHedgehog,
CardId.ShaddollDragon,
CardId.ShaddollFalco,
});
AI.SelectPosition(CardPosition.FaceUpAttack);
return true;
}
else
{
if (!Bot.IsFieldEmpty())
return false;
AI.SelectCard(CardId.ElShaddollConstruct);
AI.SelectPosition(CardPosition.FaceUpAttack);
}
return true;
}
private bool ShaddollCore()
{
return Bot.HasInGraveyard(CardId.ShaddollFusion);
}
private bool AllureofDarkness()
{
IList<ClientCard> materials = Bot.Hand;
IList<ClientCard> check = new List<ClientCard>();
ClientCard mat = null;
foreach (ClientCard card in materials)
{
if (card.HasAttribute(CardAttribute.Dark))
{
mat = card;
break;
}
}
if (mat != null)
{
return true;
}
return false;
}
private bool spellset()
{
return Bot.Hand.Count > 6;
}
private bool RebornEffect()
{
IList<int> targets = new[] {
CardId.UltimateConductorTytanno,
CardId.ElShaddollConstruct,
CardId.DogorantheMadFlameKaiju,
CardId.GamecieltheSeaTurtleKaiju,
CardId.SouleatingOviraptor,
};
if (!Bot.HasInGraveyard(targets))
{
return false;
}
AI.SelectCard(targets);
return true;
}
private bool PotofAvarice()
{
return true;
}
private bool MaxxC()
{
return Duel.Player == 1;
}
private bool SetIsFieldEmpty()
{
return !Bot.IsFieldEmpty();
}
private bool TrapSetWhenZoneFree()
{
return Bot.GetSpellCountWithoutField() < 4;
}
private bool ChargeOfTheLightBrigadeEffect()
{
if (!Bot.HasInHand(CardId.Raiden))
AI.SelectCard(CardId.Raiden);
else
AI.SelectCard(new[]
{
CardId.Lumina,
});
return true;
}
private bool SinisterShadowGames()
{
AI.SelectCard(new[]
{
CardId.ShaddollBeast,
});
return true;
}
private bool ElShaddollShekhinagaeff()
{
if (Card.Location != CardLocation.MonsterZone)
return true;
else
{
if(Duel.LastChainPlayer==1)
{
AI.SelectCard(new[]
{
CardId.ElShaddollConstruct,
CardId.ElShaddollShekhinaga,
CardId.ElShaddollGrysra,
CardId.ElShaddollWinda,
CardId.ShaddollSquamata,
}
);
}
}
return true;
}
private bool ShaddollFalcoeff()
{
if (Card.Location != CardLocation.MonsterZone)
return true;
else
{
AI.SelectCard(new[]
{
CardId.ElShaddollConstruct,
CardId.ElShaddollShekhinaga,
CardId.ElShaddollGrysra,
CardId.ElShaddollWinda,
CardId.ShaddollSquamata,
}
);
}
return true;
}
private bool ShaddollHedgehogeff()
{
if (Card.Location != CardLocation.MonsterZone)
{
AI.SelectCard(new[]
{
CardId.ShaddollSquamata,
});
}
else
{
AI.SelectCard(new[] { CardId.ShaddollFusion, CardId.SinisterShadowGames });
}
return true;
}
private bool ShaddollDragoneff()
{
if (Card.Location == CardLocation.MonsterZone)
{
ClientCard target = AI.Utils.GetBestEnemyCard();
AI.SelectCard(target);
return true;
}
else
{
ClientCard target = AI.Utils.GetBestEnemySpell();
AI.SelectCard(target);
return true;
}
}
private bool ShaddollSquamataeff()
{
if (Card.Location != CardLocation.MonsterZone)
{
AI.SelectCard(new[]
{
CardId.ShaddollBeast,
});
}
else
{
ClientCard target = AI.Utils.GetBestEnemyMonster();
AI.SelectCard(target);
}
return true;
}
private bool FoolishBurialEffect()
{
if (Bot.GetRemainingCount(CardId.DoubleEvolutionPill, 3) > 0)
{
if (!OvertexCoatlseff_used)
{
AI.SelectCard(new[]
{
CardId.OvertexCoatls,
});
}
else return false;
}
else
{
AI.SelectCard(new[]
{
CardId.OvertexCoatls,
CardId.ShaddollSquamata,
CardId.FairyTailSnow,
});
}
return true;
}
private bool GoblindberghSummon()
{
foreach (ClientCard card in Bot.Hand.GetMonsters())
{
if (!card.Equals(Card) && card.Level == 4)
return true;
}
return false;
}
private bool PerformageTrickClownEffect()
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
public bool Hand_act_eff()
{
//if (Card.Id == CardId.Urara && Bot.HasInHand(CardId.LockBird) && Bot.HasInSpellZone(CardId.Re)) return false;
if (Card.Id == CardId.GhostOgre && Card.Location == CardLocation.Hand && Bot.HasInMonstersZone(CardId.GhostOgre)) return false;
return (Duel.LastChainPlayer == 1);
}
private bool MinervaTheExaltedEffect()
{
if (Card.Location == CardLocation.MonsterZone)
{
return true;
}
else
{
IList<ClientCard> targets = new List<ClientCard>();
ClientCard target1 = AI.Utils.GetBestEnemyMonster();
if (target1 != null)
targets.Add(target1);
ClientCard target2 = AI.Utils.GetBestEnemySpell();
if (target2 != null)
targets.Add(target2);
foreach (ClientCard target in Enemy.GetMonsters())
{
if (targets.Count >= 3)
break;
if (!targets.Contains(target))
targets.Add(target);
}
foreach (ClientCard target in Enemy.GetSpells())
{
if (targets.Count >= 3)
break;
if (!targets.Contains(target))
targets.Add(target);
}
if (targets.Count == 0)
return false;
AI.SelectNextCard(targets);
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
{
// 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; }
}
}
}
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; }
}
}
}
......@@ -161,7 +161,7 @@ namespace WindBot.Game.AI.Decks
private bool SkillDrainEffect()
{
return (Duel.LifePoints[0] > 1000) && DefaultUniqueTrap();
return (Bot.LifePoints > 1000) && DefaultUniqueTrap();
}
private bool PotOfDualityEffect()
......@@ -191,7 +191,7 @@ namespace WindBot.Game.AI.Decks
}
return false;
}
private bool TrapSetUnique()
{
foreach (ClientCard card in Bot.GetSpells())
......@@ -315,7 +315,7 @@ namespace WindBot.Game.AI.Decks
{
AI.SelectCard(HighScaleCards);
}
return Duel.LifePoints[0] > 800;
return Bot.LifePoints > 800;
}
private bool StealthEffect()
......
......@@ -107,7 +107,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning, DefaultNumberS39UtopiaTheLightningEffect);
AddExecutor(ExecutorType.SpSummon, CardId.StardustDragon, DefaultStardustDragonSummon);
AddExecutor(ExecutorType.Activate, CardId.StardustDragon, DefaultStardustDragonEffect);
......@@ -267,7 +267,7 @@ namespace WindBot.Game.AI.Decks
private bool GagagaCowboySummon()
{
if (Duel.LifePoints[1] <= 800)
if (Enemy.LifePoints <= 800)
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
......
......@@ -262,9 +262,9 @@ namespace WindBot.Game.AI.Decks
private bool CyberDragonInfinityEffect()
{
if (CurrentChain.Count > 0)
if (Duel.CurrentChain.Count > 0)
{
return LastChainPlayer == 1;
return Duel.LastChainPlayer == 1;
}
else
{
......
......@@ -117,7 +117,7 @@ namespace WindBot.Game.AI.Decks
if (!defender.IsMonsterHasPreventActivationEffectInBattle())
{
if (attacker.Id == CardId.SkyCavalryCentaurea && !attacker.IsDisabled() && attacker.HasXyzMaterial())
attacker.RealPower = Duel.LifePoints[0] + attacker.Attack;
attacker.RealPower = Bot.LifePoints + attacker.Attack;
}
return base.OnPreBattleBetween(attacker, defender);
}
......@@ -302,7 +302,7 @@ namespace WindBot.Game.AI.Decks
private bool ToadallyAwesomeEffect()
{
if (CurrentChain.Count > 0)
if (Duel.CurrentChain.Count > 0)
{
// negate effect, select a cost for it
List<ClientCard> monsters = Bot.GetMonsters();
......@@ -506,7 +506,7 @@ namespace WindBot.Game.AI.Decks
{
defence += monster.GetDefensePower();
}
if (attack - 2000 - defence > Duel.LifePoints[1] && !AI.Utils.IsOneEnemyBetter(true))
if (attack - 2000 - defence > Enemy.LifePoints && !AI.Utils.IsOneEnemyBetter(true))
return true;
}
return false;
......
......@@ -249,9 +249,9 @@ namespace WindBot.Game.AI.Decks
ClientCard tosolve = AI.Utils.GetProblematicEnemyCard();
if (tosolve == null)
{
if (LastChainPlayer == 1 && GetLastChainCard() != null)
if (Duel.LastChainPlayer == 1 && AI.Utils.GetLastChainCard() != null)
{
ClientCard target = GetLastChainCard();
ClientCard target = AI.Utils.GetLastChainCard();
if (target.HasPosition(CardPosition.FaceUp) && (target.Location == CardLocation.MonsterZone || target.Location == CardLocation.SpellZone)) tosolve = target;
}
}
......@@ -337,7 +337,7 @@ namespace WindBot.Game.AI.Decks
{
if (Duel.Player == 0) return false;
if (Duel.Phase == DuelPhase.End) return true;
if (LastChainPlayer == 1 && (AI.Utils.IsChainTarget(Card) || (GetLastChainCard().Id == CardId.Feather && !Bot.HasInSpellZone(CardId.Grass)))) return true;
if (Duel.LastChainPlayer == 1 && (AI.Utils.IsChainTarget(Card) || (AI.Utils.GetLastChainCard().Id == CardId.Feather && !Bot.HasInSpellZone(CardId.Grass)))) return true;
if (Duel.Phase == DuelPhase.BattleStart)
{
int total_atk = 0;
......@@ -346,7 +346,7 @@ namespace WindBot.Game.AI.Decks
{
if (m.IsAttack() && !m.Attacked) total_atk += m.Attack;
}
if (total_atk >= Duel.LifePoints[0]) return true;
if (total_atk >= Bot.LifePoints) return true;
}
return false;
}
......@@ -369,7 +369,7 @@ namespace WindBot.Game.AI.Decks
stage_locked = null;
return true;
}
else if (Duel.LifePoints[1] <= 1000 && Bot.GetRemainingCount(CardId.Pink,1) > 0)
else if (Enemy.LifePoints <= 1000 && Bot.GetRemainingCount(CardId.Pink,1) > 0)
{
AI.SelectCard(new[]
{
......@@ -423,7 +423,7 @@ namespace WindBot.Game.AI.Decks
if (NormalSummoned)
{
if (Duel.LifePoints[1] <= 1000 && !pink_ss && Bot.GetRemainingCount(CardId.Pink,1) > 0)
if (Enemy.LifePoints <= 1000 && !pink_ss && Bot.GetRemainingCount(CardId.Pink,1) > 0)
{
AI.SelectCard(new[]
{
......@@ -483,12 +483,12 @@ namespace WindBot.Game.AI.Decks
if (GraveCall_count > 0 && GraveCall_id == Card.Id) return false;
if (Card.Id == CardId.Urara && Bot.HasInHand(CardId.LockBird) && Bot.HasInSpellZone(CardId.Re)) return false;
if (Card.Id == CardId.Ghost && Card.Location == CardLocation.Hand && Bot.HasInMonstersZone(CardId.Ghost)) return false;
return (LastChainPlayer == 1);
return (Duel.LastChainPlayer == 1);
}
public bool Exterio_counter()
{
if (LastChainPlayer == 1)
if (Duel.LastChainPlayer == 1)
{
AI.SelectCard(Useless_List());
return true;
......@@ -505,15 +505,15 @@ namespace WindBot.Game.AI.Decks
{
if (Card.Location == CardLocation.Hand)
{
if ((Duel.LifePoints[1] <= 1000 && Bot.HasInSpellZone(CardId.Stage))
|| Duel.LifePoints[1] <= 800
if ((Enemy.LifePoints <= 1000 && Bot.HasInSpellZone(CardId.Stage))
|| Enemy.LifePoints <= 800
|| (!NormalSummoned && Bot.HasInGraveyard(CardId.Red))
)
{
pink_ss = true;
return true;
}
else if (Enemy.GetMonsterCount() > 0 && (AI.Utils.GetBestEnemyMonster().Attack - 800 >= Duel.LifePoints[0])) return false;
else if (Enemy.GetMonsterCount() > 0 && (AI.Utils.GetBestEnemyMonster().Attack - 800 >= Bot.LifePoints)) return false;
pink_ss = true;
return true;
}
......@@ -580,19 +580,15 @@ namespace WindBot.Game.AI.Decks
public bool Eater_eff()
{
ClientCard self_card = (Duel.Player == 0) ? AI.GetAttacker() : AI.GetDefender();
ClientCard enemy_card = (Duel.Player == 1) ? AI.GetAttacker() : AI.GetDefender();
if (self_card == null || enemy_card == null) return false;
if (enemy_card.HasPosition(CardPosition.FaceDown)) return true;
if (enemy_card.HasPosition(CardPosition.Attack) && (self_card.Attack - enemy_card.GetDefensePower() >= Duel.LifePoints[1])) return true;
return (self_card.Attack <= (enemy_card.GetDefensePower() * 2));
if (Enemy.BattlingMonster.HasPosition(CardPosition.Attack) && (Bot.BattlingMonster.Attack - Enemy.BattlingMonster.GetDefensePower() >= Enemy.LifePoints)) return false;
return true;
}
public bool Red_ss()
{
if (red_ss_count >= 6) return false;
if ((ChainContainsCard(CardId.DarkHole) || ChainContainsCard(99330325) || ChainContainsCard(53582587)) && ChainContainsCard(CardId.Red)) return false;
if (LastChainPlayer == 0 && GetLastChainCard().Id == CardId.Red)
if ((AI.Utils.ChainContainsCard(CardId.DarkHole) || AI.Utils.ChainContainsCard(99330325) || AI.Utils.ChainContainsCard(53582587)) && AI.Utils.ChainContainsCard(CardId.Red)) return false;
if (Duel.LastChainPlayer == 0 && AI.Utils.GetLastChainCard().Id == CardId.Red)
{
foreach (ClientCard m in Bot.GetMonsters())
{
......@@ -604,7 +600,7 @@ namespace WindBot.Game.AI.Decks
}
}
}
if (LastChainPlayer == 1) return true;
if (Duel.LastChainPlayer == 1) return true;
if (Duel.Player == 0)
{
if (AI.Utils.IsTurn1OrMain2()) return false;
......@@ -695,7 +691,7 @@ namespace WindBot.Game.AI.Decks
});
return true;
}
if (Duel.LifePoints[1] <= 1000)
if (Enemy.LifePoints <= 1000)
{
if (Bot.GetRemainingCount(CardId.Pink, 1) > 0 && !pink_ss)
{
......@@ -754,7 +750,7 @@ namespace WindBot.Game.AI.Decks
CardId.Yellow
});
}
else if (Bot.GetRemainingCount(CardId.White, 2) > 0 && Duel.LifePoints[1] <= 4000)
else if (Bot.GetRemainingCount(CardId.White, 2) > 0 && Enemy.LifePoints <= 4000)
{
AI.SelectCard(new[]
{
......@@ -875,10 +871,8 @@ namespace WindBot.Game.AI.Decks
return true;
}
*/
ClientCard self_monster = (Duel.Player == 0) ? AI.GetAttacker() : AI.GetDefender();
ClientCard enemy_monster = (Duel.Player == 1) ? AI.GetAttacker() : AI.GetDefender();
if (self_monster == null || enemy_monster == null || !IsTrickstar(self_monster.Id) || self_monster.HasPosition(CardPosition.Defence)) return false;
if (self_monster.Attack <= enemy_monster.RealPower && self_monster.Attack + self_monster.BaseAttack >= enemy_monster.RealPower)
if (Bot.BattlingMonster == null || Enemy.BattlingMonster == null || !IsTrickstar(Bot.BattlingMonster.Id) || Bot.BattlingMonster.HasPosition(CardPosition.Defence)) return false;
if (Bot.BattlingMonster.Attack <= Enemy.BattlingMonster.RealPower && Bot.BattlingMonster.Attack + Bot.BattlingMonster.BaseAttack >= Enemy.BattlingMonster.RealPower)
{
white_eff_used = true;
return true;
......@@ -934,8 +928,8 @@ namespace WindBot.Game.AI.Decks
lockbird_useful = true;
if (Bot.HasInSpellZone(CardId.Re))
{
if (ChainContainsCard(CardId.Re)) lockbird_used = true;
return ChainContainsCard(CardId.Re);
if (AI.Utils.ChainContainsCard(CardId.Re)) lockbird_used = true;
return AI.Utils.ChainContainsCard(CardId.Re);
}
lockbird_used = true;
return true;
......@@ -946,7 +940,7 @@ namespace WindBot.Game.AI.Decks
if (Card.Location == CardLocation.Grave) return Ts_reborn();
if (Bot.HasInHand(CardId.LockBird))
{
if (lockbird_useful || AI.Utils.IsChainTarget(Card) || (Duel.Player == 1 && ChainContainsCard(CardId.Feather))) {
if (lockbird_useful || AI.Utils.IsChainTarget(Card) || (Duel.Player == 1 && AI.Utils.ChainContainsCard(CardId.Feather))) {
lockbird_useful = false;
return true;
}
......@@ -973,7 +967,7 @@ namespace WindBot.Game.AI.Decks
{
if (hand.IsMonster() && IsTrickstar(hand.Id))
{
if (hand.Attack >= Duel.LifePoints[1]) return true;
if (hand.Attack >= Enemy.LifePoints) return true;
if (hand.Id != CardId.Yellow)
{
if (AI.Utils.GetOneEnemyBetterThanValue(hand.Attack, false) == null) return true;
......@@ -986,7 +980,7 @@ namespace WindBot.Game.AI.Decks
public bool Ts_reborn()
{
if (Duel.Player == 0 && Duel.LifePoints[1] <= 1000)
if (Duel.Player == 0 && Enemy.LifePoints <= 1000)
{
AI.SelectCard(CardId.Pink);
return true;
......@@ -1033,7 +1027,7 @@ namespace WindBot.Game.AI.Decks
public bool Red_sum()
{
if ((Enemy.GetMonsterCount() == 0 && Duel.LifePoints[1] <= 1800) || (Duel.Turn == 1 && Bot.HasInHand(CardId.Re)))
if ((Enemy.GetMonsterCount() == 0 && Enemy.LifePoints <= 1800) || (Duel.Turn == 1 && Bot.HasInHand(CardId.Re)))
{
NormalSummoned = true;
return true;
......@@ -1043,7 +1037,7 @@ namespace WindBot.Game.AI.Decks
public bool Pink_sum()
{
if (Duel.LifePoints[1] <= 1000)
if (Enemy.LifePoints <= 1000)
{
NormalSummoned = true;
return true;
......@@ -1094,7 +1088,7 @@ namespace WindBot.Game.AI.Decks
public bool Ring_act()
{
if (LastChainPlayer == 0 && GetLastChainCard() != null && GetLastChainCard().Id == CardId.Ghost) return false;
if (Duel.LastChainPlayer == 0 && AI.Utils.GetLastChainCard() != null && AI.Utils.GetLastChainCard().Id == CardId.Ghost) return false;
ClientCard target = AI.Utils.GetProblematicEnemyMonster();
if (target == null && AI.Utils.IsChainTarget(Card))
{
......@@ -1102,7 +1096,7 @@ namespace WindBot.Game.AI.Decks
}
if (target != null)
{
if (Duel.LifePoints[0] <= target.Attack) return false;
if (Bot.LifePoints <= target.Attack) return false;
AI.SelectCard(target);
return true;
}
......@@ -1124,7 +1118,7 @@ namespace WindBot.Game.AI.Decks
public bool Linkuri_eff()
{
if (LastChainPlayer == 0 && GetLastChainCard().Id == CardId.Linkuri) return false;
if (Duel.LastChainPlayer == 0 && AI.Utils.GetLastChainCard().Id == CardId.Linkuri) return false;
AI.SelectCard(new[] { CardId.Tuner, CardId.BF + 1 });
return true;
}
......@@ -1216,7 +1210,7 @@ namespace WindBot.Game.AI.Decks
{
if (getLinkMarker(ex_m.Id) >= 4) return false;
}
if ((m == null || m.HasPosition(CardPosition.FaceDown)) && Duel.LifePoints[1] <= 1100)
if ((m == null || m.HasPosition(CardPosition.FaceDown)) && Enemy.LifePoints <= 1100)
{
if (Enemy.GetMonsterCount() == 0 && Duel.Phase < DuelPhase.Battle)
{
......@@ -1261,7 +1255,7 @@ namespace WindBot.Game.AI.Decks
ClientCard m = AI.Utils.GetProblematicEnemySpell();
if (m == null)
{
if (Enemy.GetMonsterCount() == 0 && Duel.LifePoints[1] <= 1900 && Duel.Phase == DuelPhase.Main1)
if (Enemy.GetMonsterCount() == 0 && Enemy.LifePoints <= 1900 && Duel.Phase == DuelPhase.Main1)
{
IList<ClientCard> m_list = new List<ClientCard>();
List<ClientCard> list = new List<ClientCard>(Bot.GetMonsters());
......@@ -1320,7 +1314,7 @@ namespace WindBot.Game.AI.Decks
int link_count = 0;
if (m == null)
{
if (Enemy.GetMonsterCount() == 0 && Duel.LifePoints[1] <= 2200 && Duel.Phase == DuelPhase.Main1)
if (Enemy.GetMonsterCount() == 0 && Enemy.LifePoints <= 2200 && Duel.Phase == DuelPhase.Main1)
{
IList<ClientCard> m_list = new List<ClientCard>();
List<ClientCard> _sort_list = new List<ClientCard>(Bot.GetMonsters());
......@@ -1412,7 +1406,7 @@ namespace WindBot.Game.AI.Decks
}
if (targets.Count >= 4)
{
if (Duel.LifePoints[1] <= GetTotalATK(targets) && Enemy.GetMonsterCount() == 0) return false;
if (Enemy.LifePoints <= GetTotalATK(targets) && Enemy.GetMonsterCount() == 0) return false;
AI.SelectMaterials(targets);
AI.SelectYesNo(true);
snake_four_s = true;
......@@ -1491,7 +1485,7 @@ namespace WindBot.Game.AI.Decks
IList<ClientCard> material_list = new List<ClientCard>();
if (AI.Utils.GetProblematicEnemyMonster(2000) == null) Logger.DebugWriteLine("***borrel:null");
else Logger.DebugWriteLine("***borrel:" + (AI.Utils.GetProblematicEnemyMonster(2000).Name ?? "unknown"));
if (AI.Utils.GetProblematicEnemyMonster(2000) != null || (Enemy.GetMonsterCount() == 0 && Duel.Phase == DuelPhase.Main1 && Duel.LifePoints[1] <= 3000))
if (AI.Utils.GetProblematicEnemyMonster(2000) != null || (Enemy.GetMonsterCount() == 0 && Duel.Phase == DuelPhase.Main1 && Enemy.LifePoints <= 3000))
{
foreach(ClientCard e_m in Bot.GetMonstersInExtraZone())
{
......@@ -1521,7 +1515,7 @@ namespace WindBot.Game.AI.Decks
}
if ((already_link2 && material_list.Count == 3) || (!already_link2 && material_list.Count == 4))
{
if (Enemy.GetMonsterCount() == 0 && Duel.Phase == DuelPhase.Main1 && Duel.LifePoints[1] <= 3000)
if (Enemy.GetMonsterCount() == 0 && Duel.Phase == DuelPhase.Main1 && Enemy.LifePoints <= 3000)
{
if (GetTotalATK(material_list) >= 3000) return false;
}
......@@ -1552,14 +1546,14 @@ namespace WindBot.Game.AI.Decks
public bool GraveCall_eff()
{
if (LastChainPlayer == 1)
if (Duel.LastChainPlayer == 1)
{
Logger.DebugWriteLine(GetLastChainCard().Name.ToString());
Logger.DebugWriteLine(GetLastChainCard().IsMonster().ToString());
Logger.DebugWriteLine(Enemy.HasInGraveyard(GetLastChainCard().Id).ToString());
if (GetLastChainCard().IsMonster() && Enemy.HasInGraveyard(GetLastChainCard().Id))
Logger.DebugWriteLine(AI.Utils.GetLastChainCard().Name.ToString());
Logger.DebugWriteLine(AI.Utils.GetLastChainCard().IsMonster().ToString());
Logger.DebugWriteLine(Enemy.HasInGraveyard(AI.Utils.GetLastChainCard().Id).ToString());
if (AI.Utils.GetLastChainCard().IsMonster() && Enemy.HasInGraveyard(AI.Utils.GetLastChainCard().Id))
{
GraveCall_id = GetLastChainCard().Id;
GraveCall_id = AI.Utils.GetLastChainCard().Id;
GraveCall_count = 2;
AI.SelectCard(GraveCall_id);
return true;
......
......@@ -129,7 +129,7 @@ namespace WindBot.Game.AI.Decks
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.NumberS39UtopiatheLightning, DefaultNumberS39UtopiaTheLightningEffect);
AddExecutor(ExecutorType.Activate, CardId.StardustDragon, DefaultStardustDragonEffect);
......@@ -291,7 +291,7 @@ namespace WindBot.Game.AI.Decks
private bool GagagaCowboySummon()
{
if (Duel.LifePoints[1] <= 800 || (Bot.GetMonsterCount()>=4 && Duel.LifePoints[1] <= 1600))
if (Enemy.LifePoints <= 800 || (Bot.GetMonsterCount()>=4 && Enemy.LifePoints <= 1600))
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
......
......@@ -72,7 +72,7 @@ namespace WindBot.Game.AI.Decks
// XYZ effects
AddExecutor(ExecutorType.Activate, CardId.Number39Utopia, Number39Utopia);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiaOne);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning, NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning, DefaultNumberS39UtopiaTheLightningEffect);
AddExecutor(ExecutorType.Activate, CardId.ZwLionArms, ZwLionArms);
AddExecutor(ExecutorType.Activate, CardId.AdreusKeeperOfArmageddon);
AddExecutor(ExecutorType.Activate, CardId.Number61Volcasaurus);
......@@ -105,7 +105,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.TinGoldfish, GoblindberghEffect);
AddExecutor(ExecutorType.Activate, CardId.Kagetokage);
AddExecutor(ExecutorType.Activate, CardId.SummonerMonk, SummonerMonkEffect);
AddExecutor(ExecutorType.Activate, CardId.Honest, Honest);
AddExecutor(ExecutorType.Activate, CardId.Honest, DefaultHonestEffect);
// Reposition
AddExecutor(ExecutorType.Repos, MonsterRepos);
......@@ -150,7 +150,7 @@ namespace WindBot.Game.AI.Decks
private bool Number39Utopia()
{
if (!HasChainedTrap(0) && Duel.Player == 1 && Duel.Phase == DuelPhase.BattleStart && Card.HasXyzMaterial(2))
if (!AI.Utils.HasChainedTrap(0) && Duel.Player == 1 && Duel.Phase == DuelPhase.BattleStart && Card.HasXyzMaterial(2))
return true;
return false;
}
......@@ -184,7 +184,7 @@ namespace WindBot.Game.AI.Decks
private bool InstantFusion()
{
if (Duel.LifePoints[0] <= 1000)
if (Bot.LifePoints <= 1000)
return false;
int count4 = 0;
int count5 = 0;
......@@ -210,17 +210,7 @@ namespace WindBot.Game.AI.Decks
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;
return Bot.LifePoints > 500;
}
private bool GoblindberghFirst()
......
......@@ -73,7 +73,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning, DefaultNumberS39UtopiaTheLightningEffect);
AddExecutor(ExecutorType.Activate, CardId.InvokedMechaba, DefaultTrap);
......@@ -486,7 +486,7 @@ namespace WindBot.Game.AI.Decks
private bool DridentEffect()
{
if (LastChainPlayer == 0)
if (Duel.LastChainPlayer == 0)
return false;
ClientCard target = AI.Utils.GetBestEnemyCard(true);
if (target == null)
......@@ -571,7 +571,7 @@ namespace WindBot.Game.AI.Decks
private bool ZoodiacComboEffect()
{
if (CurrentChain.Count > 0)
if (Duel.CurrentChain.Count > 0)
return false;
if (Card.Location != CardLocation.Grave)
{
......
using System;
using System;
using System.Collections.Generic;
using YGOSharp.OCGWrapper.Enums;
using WindBot;
......@@ -12,14 +12,15 @@ namespace WindBot.Game.AI
protected 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 ThunderKingtheLightningstrikeKaiju = 48770333;
public const int DogorantheMadFlameKaiju = 93332803;
public const int RadiantheMultidimensionalKaiju = 28674152;
public const int GadarlatheMysteryDustKaiju = 36956512;
public const int KumongoustheStickyStringKaiju = 29726552;
public const int GamecieltheSeaTurtleKaiju = 55063751;
public const int SuperAntiKaijuWarMachineMechaDogoran = 84769941;
public const int DupeFrog = 46239604;
public const int MaraudingCaptain = 2460565;
......@@ -44,13 +45,40 @@ namespace WindBot.Game.AI
AddExecutor(ExecutorType.Activate, _CardId.ChickenGame, DefaultChickenGame);
}
/// <summary>
/// Decide which card should the attacker attack.
/// </summary>
/// <param name="attacker">Card that attack.</param>
/// <param name="defenders">Cards that defend.</param>
/// <returns>BattlePhaseAction including the target, or null (in this situation, GameAI will check the next attacker)</returns>
public override BattlePhaseAction OnSelectAttackTarget(ClientCard attacker, IList<ClientCard> defenders)
{
for (int i = 0; i < defenders.Count; ++i)
{
ClientCard defender = defenders[i];
attacker.RealPower = attacker.Attack;
defender.RealPower = defender.GetDefensePower();
if (!OnPreBattleBetween(attacker, defender))
continue;
if (attacker.RealPower > defender.RealPower || (attacker.RealPower >= defender.RealPower && attacker.IsLastAttacker))
return AI.Attack(attacker, defender);
}
if (attacker.CanDirectAttack)
return AI.Attack(attacker, null);
return null;
}
/// <summary>
/// Decide whether to declare attack between attacker and defender.
/// Can be overrided to update the RealPower of attacker for cards like Honest.
/// </summary>
/// <param name="attacker">Card that attack.</param>
/// <param name="defender">Card that defend.</param>
/// <returns>false if the attack can't be done.</returns>
/// <returns>false if the attack shouldn't be done.</returns>
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (attacker.RealPower <= 0)
......@@ -68,9 +96,9 @@ namespace WindBot.Game.AI
defender.RealPower = 5000;
if (defender.Id == _CardId.VampireFräulein && !defender.IsDisabled())
defender.RealPower += (Duel.LifePoints[defender.Controller] > 3000) ? 3000 : (Duel.LifePoints[defender.Controller] - 100);
defender.RealPower += (Enemy.LifePoints > 3000) ? 3000 : (Enemy.LifePoints - 100);
if (defender.Id == _CardId.InjectionFairyLily && !defender.IsDisabled() && Duel.LifePoints[defender.Controller] > 2000)
if (defender.Id == _CardId.InjectionFairyLily && !defender.IsDisabled() && Enemy.LifePoints > 2000)
defender.RealPower += 3000;
}
......@@ -99,12 +127,27 @@ namespace WindBot.Game.AI
return true;
}
public override bool OnSelectBattleReplay()
{
if (Bot.BattlingMonster == null)
return false;
List<ClientCard> defenders = new List<ClientCard>(Duel.Fields[1].GetMonsters());
defenders.Sort(AIFunctions.CompareDefensePower);
defenders.Reverse();
BattlePhaseAction result = OnSelectAttackTarget(Bot.BattlingMonster, defenders);
if (result != null && result.Action == BattlePhaseAction.BattleAction.Attack)
{
return true;
}
return false;
}
/// <summary>
/// Destroy face-down cards first, in our turn.
/// </summary>
protected bool DefaultMysticalSpaceTyphoon()
{
foreach (ClientCard card in CurrentChain)
foreach (ClientCard card in Duel.CurrentChain)
if (card.Id == _CardId.MysticalSpaceTyphoon)
return false;
......@@ -137,10 +180,10 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultCosmicCyclone()
{
foreach (ClientCard card in CurrentChain)
foreach (ClientCard card in Duel.CurrentChain)
if (card.Id == _CardId.CosmicCyclone)
return false;
return (Duel.LifePoints[0] > 1000) && DefaultMysticalSpaceTyphoon();
return (Bot.LifePoints > 1000) && DefaultMysticalSpaceTyphoon();
}
/// <summary>
......@@ -243,11 +286,12 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultBreakthroughSkill()
{
ClientCard LastChainCard = GetLastChainCard();
ClientCard LastChainCard = AI.Utils.GetLastChainCard();
if (LastChainCard == null)
return false;
AI.SelectCard(LastChainCard);
return LastChainCard.Controller == 1 && LastChainCard.Location == CardLocation.MonsterZone && DefaultUniqueTrap();
}
......@@ -256,7 +300,7 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultSolemnJudgment()
{
return !AI.Utils.IsChainTargetOnly(Card) && !(Duel.Player == 0 && LastChainPlayer == -1) && DefaultTrap();
return !AI.Utils.IsChainTargetOnly(Card) && !(Duel.Player == 0 && Duel.LastChainPlayer == -1) && DefaultTrap();
}
/// <summary>
......@@ -264,7 +308,7 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultSolemnWarning()
{
return (Duel.LifePoints[0] > 2000) && !(Duel.Player == 0 && LastChainPlayer == -1) && DefaultTrap();
return (Bot.LifePoints > 2000) && !(Duel.Player == 0 && Duel.LastChainPlayer == -1) && DefaultTrap();
}
/// <summary>
......@@ -272,7 +316,7 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultSolemnStrike()
{
return (Duel.LifePoints[0] > 1500) && !(Duel.Player == 0 && LastChainPlayer == -1) && DefaultTrap();
return (Bot.LifePoints > 1500) && !(Duel.Player == 0 && Duel.LastChainPlayer == -1) && DefaultTrap();
}
/// <summary>
......@@ -280,7 +324,7 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultTorrentialTribute()
{
return !HasChainedTrap(0) && AI.Utils.IsAllEnemyBetter(true);
return !AI.Utils.HasChainedTrap(0) && AI.Utils.IsAllEnemyBetter(true);
}
/// <summary>
......@@ -395,7 +439,7 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultTrap()
{
return (LastChainPlayer == -1 && Duel.LastSummonPlayer != 0) || LastChainPlayer == 1;
return (Duel.LastChainPlayer == -1 && Duel.LastSummonPlayer != 0) || Duel.LastChainPlayer == 1;
}
/// <summary>
......@@ -403,7 +447,7 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultUniqueTrap()
{
if (HasChainedTrap(0))
if (AI.Utils.HasChainedTrap(0))
return false;
return UniqueFaceupSpell();
......@@ -445,7 +489,7 @@ namespace WindBot.Game.AI
if (exec.Type == Type && exec.CardId == Card.Id)
return false;
}
return LastChainPlayer != 0;
return Duel.LastChainPlayer != 0;
}
/// <summary>
......@@ -459,12 +503,35 @@ namespace WindBot.Game.AI
if (exec.Type == Type && exec.CardId == Card.Id)
count++;
}
if (count > 1 || Duel.LifePoints[0] <= 1000)
if (count > 1 || Bot.LifePoints <= 1000)
return false;
if (Duel.LifePoints[0] <= Duel.LifePoints[1] && ActivateDescription == AI.Utils.GetStringId(_CardId.ChickenGame, 0))
if (Bot.LifePoints <= Enemy.LifePoints && ActivateDescription == AI.Utils.GetStringId(_CardId.ChickenGame, 0))
return true;
if (Bot.LifePoints > Enemy.LifePoints && ActivateDescription == AI.Utils.GetStringId(_CardId.ChickenGame, 1))
return true;
if (Duel.LifePoints[0] > Duel.LifePoints[1] && ActivateDescription == AI.Utils.GetStringId(_CardId.ChickenGame, 1))
return false;
}
/// <summary>
/// Draw when we have Dark monster in hand,and banish random one. Can be overrided.
/// </summary>
protected bool DefaultAllureofDarkness()
{
IList<ClientCard> condition = Bot.Hand;
IList<ClientCard> check = new List<ClientCard>();
ClientCard con = null;
foreach (ClientCard card in condition)
{
if (card.HasAttribute(CardAttribute.Dark))
{
con = card;
break;
}
}
if (con != null)
{
return true;
}
return false;
}
......@@ -518,8 +585,8 @@ namespace WindBot.Game.AI
return true;
}
}
ClientCard lastchaincard = GetLastChainCard();
if (LastChainPlayer == 1 && lastchaincard != null && !lastchaincard.IsDisabled())
ClientCard lastchaincard = AI.Utils.GetLastChainCard();
if (Duel.LastChainPlayer == 1 && lastchaincard != null && !lastchaincard.IsDisabled())
{
if (lastchaincard.HasType(CardType.Ritual))
{
......@@ -556,7 +623,7 @@ namespace WindBot.Game.AI
}
/// <summary>
/// Clever enough.
/// Clever enough
/// </summary>
protected bool DefaultInterruptedKaijuSlumber()
{
......@@ -566,24 +633,34 @@ namespace WindBot.Game.AI
{
_CardId.GamecieltheSeaTurtleKaiju,
_CardId.KumongoustheStickyStringKaiju,
_CardId.GadarlatheMysteryDustKaiju,
_CardId.RadiantheMultidimensionalKaiju,
_CardId.GadarlatheMysteryDustKaiju
_CardId.DogorantheMadFlameKaiju,
_CardId.ThunderKingtheLightningstrikeKaiju,
_CardId.JizukirutheStarDestroyingKaiju,
});
return true;
}
AI.SelectCard(new[]
{
_CardId.JizukirutheStarDestroyingKaiju,
_CardId.ThunderKingtheLightningstrikeKaiju,
_CardId.DogorantheMadFlameKaiju,
_CardId.RadiantheMultidimensionalKaiju,
_CardId.GadarlatheMysteryDustKaiju,
_CardId.KumongoustheStickyStringKaiju
_CardId.KumongoustheStickyStringKaiju,
_CardId.GamecieltheSeaTurtleKaiju,
});
AI.SelectNextCard(new[]
{
_CardId.SuperAntiKaijuWarMachineMechaDogoran,
_CardId.GamecieltheSeaTurtleKaiju,
_CardId.KumongoustheStickyStringKaiju,
_CardId.GadarlatheMysteryDustKaiju,
_CardId.RadiantheMultidimensionalKaiju
_CardId.RadiantheMultidimensionalKaiju,
_CardId.DogorantheMadFlameKaiju,
_CardId.ThunderKingtheLightningstrikeKaiju,
});
return DefaultDarkHole();
}
......@@ -638,6 +715,14 @@ namespace WindBot.Game.AI
return AI.Utils.IsOneEnemyBetterThanValue(bestBotAttack, false);
}
/// <summary>
/// Activate if the card is attack pos, and its attack is below 5000, when the enemy monster is attack pos or not useless faceup defense pos
/// </summary>
protected bool DefaultNumberS39UtopiaTheLightningEffect()
{
return Card.IsAttack() && Card.Attack < 5000 && (Enemy.BattlingMonster.IsAttack() || Enemy.BattlingMonster.IsFacedown() || Enemy.BattlingMonster.GetDefensePower() >= Card.Attack);
}
/// <summary>
/// Summon when it can and should use effect.
/// </summary>
......@@ -691,7 +776,7 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultStardustDragonEffect()
{
return (Card.Location == CardLocation.Grave) || LastChainPlayer == 1;
return (Card.Location == CardLocation.Grave) || Duel.LastChainPlayer == 1;
}
/// <summary>
......@@ -753,5 +838,20 @@ namespace WindBot.Game.AI
return (oppoCount > 0 && selfCount <= oppoCount) || oppoCount >= 3;
}
/// <summary>
/// Clever enough.
/// </summary>
protected bool DefaultHonestEffect()
{
if (Card.Location == CardLocation.Hand)
{
return Bot.BattlingMonster.IsAttack() &&
(((Bot.BattlingMonster.Attack < Enemy.BattlingMonster.Attack) || Bot.BattlingMonster.Attack >= Enemy.LifePoints)
|| ((Bot.BattlingMonster.Attack < Enemy.BattlingMonster.Defense) && (Bot.BattlingMonster.Attack + Enemy.BattlingMonster.Attack > Enemy.BattlingMonster.Defense)));
}
else return AI.Utils.IsTurn1OrMain2();
}
}
}
......@@ -14,6 +14,7 @@
MetaionTheTimelord = 74530899,
KamionTheTimelord = 91712985,
LazionTheTimelord = 92435533,
EaterOfMillions = 63845230
}
EaterOfMillions = 63845230,
ElShaddollConstruct = 20366274,
}
}
namespace WindBot.Game.AI.Enums
{
/// <summary>
/// Cards that restrict player from performing some action. Bot will preferentially destroy them.
/// </summary>
public enum Floodgate
{
BarrierStatueoftheTorrent = 10963799,
BarrierStatueoftheDrought = 19740112,
BarrierStatueoftheHeavens = 46145256,
BarrierStatueoftheInferno = 47961808,
BarrierStatueoftheStormwinds = 73356503,
BarrierStatueoftheAbyss = 84478195,
ThunderKingRaiOh = 71564252,
FossilDynaPachycephalo = 42009836,
VanitysFiend = 47084486,
MajestysFiend = 33746252,
VanitysRuler = 72634965,
KycootheGhostDestroyer = 88240808,
ConsecratedLight = 2980764,
ArchlordKristya = 59509952,
KoakiMeiruDrago = 12435193,
DenkoSekka = 13974207,
ZapMustung = 29951323,
Jinzo = 77585513,
SpellCanceller = 84636823,
LevelLimitAreaB = 3136426,
DimensionalFissure = 81674782,
Necrovalley = 47355498,
SavageColosseum = 32391631,
SecretVillageoftheSpellcasters = 68462976,
SwordsofRevealingLight = 72302403,
MessengerofPeace = 44656491,
KaiserColosseum = 35059553,
DomainoftheTrueMonarchs = 84171830,
ZombieWorld = 4064256,
ImperialOrder = 61740673,
MacroCosmos = 30241314,
MindDrain = 68937720,
SoulDrain = 73599290,
SkillDrain = 82732705,
Eisbahn = 54059040,
GozenMatch = 53334471,
RivalryofWarlords = 90846359,
AntiSpellFragrance = 58921041,
LightImprisoningMirror = 53341729,
ShadowImprisoningMirror = 99735427,
WallofRevealingLight = 17078030,
GravityBind = 85742772,
VanitysEmptiness = 5851097,
Lose1Turn = 24348804,
Reqliate = 20426907,
SummonLimit = 23516703,
AndtheBandPlayedOn = 47594939,
StygianDirge = 81489939,
RoyalDecree = 51452091,
ImperialIronWall = 30459350,
DNASurgery = 74701381,
NaturiaExterio = 99916754,
TheLastWarriorfromAnotherPlanet = 86099788,
ThousandEyesRestrict = 63519819,
ElShaddollWinda = 94977269,
MaskedHERODarkLaw = 58481572,
NaturiaBeast = 33198837,
NaturiaBarkion = 2956282,
EvilswarmOphion = 91279700,
MermailAbyssgaios = 74371660,
AbyssDweller = 21044178,
ZoodiacDrident = 48905153
}
}
namespace WindBot.Game.AI.Enums
{
/// <summary>
/// Cards that restrict player from performing some action. Bot will preferentially destroy them.
/// </summary>
public enum Floodgate
{
BarrierStatueoftheTorrent = 10963799,
BarrierStatueoftheDrought = 19740112,
BarrierStatueoftheHeavens = 46145256,
BarrierStatueoftheInferno = 47961808,
BarrierStatueoftheStormwinds = 73356503,
BarrierStatueoftheAbyss = 84478195,
ThunderKingRaiOh = 71564252,
FossilDynaPachycephalo = 42009836,
VanitysFiend = 47084486,
MajestysFiend = 33746252,
VanitysRuler = 72634965,
KycootheGhostDestroyer = 88240808,
ConsecratedLight = 2980764,
ArchlordKristya = 59509952,
KoakiMeiruDrago = 12435193,
DenkoSekka = 13974207,
ZapMustung = 29951323,
Jinzo = 77585513,
SpellCanceller = 84636823,
LevelLimitAreaB = 3136426,
DimensionalFissure = 81674782,
Necrovalley = 47355498,
SavageColosseum = 32391631,
SecretVillageoftheSpellcasters = 68462976,
SwordsofRevealingLight = 72302403,
MessengerofPeace = 44656491,
KaiserColosseum = 35059553,
DomainoftheTrueMonarchs = 84171830,
ZombieWorld = 4064256,
ImperialOrder = 61740673,
MacroCosmos = 30241314,
MindDrain = 68937720,
SoulDrain = 73599290,
SkillDrain = 82732705,
Eisbahn = 54059040,
GozenMatch = 53334471,
RivalryofWarlords = 90846359,
AntiSpellFragrance = 58921041,
LightImprisoningMirror = 53341729,
ShadowImprisoningMirror = 99735427,
WallofRevealingLight = 17078030,
GravityBind = 85742772,
VanitysEmptiness = 5851097,
Lose1Turn = 24348804,
Reqliate = 20426907,
SummonLimit = 23516703,
AndtheBandPlayedOn = 47594939,
StygianDirge = 81489939,
RoyalDecree = 51452091,
ImperialIronWall = 30459350,
DNASurgery = 74701381,
NaturiaExterio = 99916754,
TheLastWarriorfromAnotherPlanet = 86099788,
ThousandEyesRestrict = 63519819,
ElShaddollWinda = 94977269,
MaskedHERODarkLaw = 58481572,
NaturiaBeast = 33198837,
NaturiaBarkion = 2956282,
EvilswarmOphion = 91279700,
MermailAbyssgaios = 74371660,
AbyssDweller = 21044178,
ZoodiacDrident = 48905153
}
}
......@@ -21,9 +21,6 @@ namespace WindBot.Game.AI
protected ClientCard Card { get; private set; }
protected int ActivateDescription { get; private set; }
protected int LastChainPlayer { get; private set; }
protected IList<ClientCard> CurrentChain { get; private set; }
protected ClientField Bot { get; private set; }
protected ClientField Enemy { get; private set; }
......@@ -33,9 +30,6 @@ namespace WindBot.Game.AI
AI = ai;
Executors = new List<CardExecutor>();
LastChainPlayer = -1;
CurrentChain = new List<ClientCard>();
Bot = Duel.Fields[0];
Enemy = Duel.Fields[1];
}
......@@ -58,47 +52,26 @@ namespace WindBot.Game.AI
/// <returns>A new BattlePhaseAction containing the action to do.</returns>
public virtual BattlePhaseAction OnBattle(IList<ClientCard> attackers, IList<ClientCard> defenders)
{
if (attackers.Count == 0)
return AI.ToMainPhase2();
if (defenders.Count == 0)
{
for (int i = attackers.Count - 1; i >= 0; --i)
{
ClientCard attacker = attackers[i];
if (attacker.Attack > 0)
return AI.Attack(attacker, null);
}
}
else
{
for (int i = defenders.Count - 1; i >= 0; --i)
{
ClientCard defender = defenders[i];
for (int j = 0; j < attackers.Count; ++j)
{
ClientCard attacker = attackers[j];
attacker.RealPower = attacker.Attack;
defender.RealPower = defender.GetDefensePower();
if (!OnPreBattleBetween(attacker, defender))
continue;
if (attacker.RealPower > defender.RealPower || (attacker.RealPower >= defender.RealPower && j == attackers.Count - 1))
return AI.Attack(attacker, defender);
}
}
for (int i = attackers.Count - 1; i >= 0; --i)
{
ClientCard attacker = attackers[i];
if (attacker.CanDirectAttack)
return AI.Attack(attacker, null);
}
}
// For overriding
return null;
}
if (!Battle.CanMainPhaseTwo)
return AI.Attack(attackers[0], (defenders.Count == 0) ? null : defenders[0]);
/// <summary>
/// Called when the AI has to decide which card to attack first
/// </summary>
/// <param name="attackers">List of monsters that can attcack.</param>
/// <param name="defenders">List of monsters of enemy.</param>
/// <returns>The card to attack first.</returns>
public virtual ClientCard OnSelectAttacker(IList<ClientCard> attackers, IList<ClientCard> defenders)
{
// For overriding
return null;
}
return AI.ToMainPhase2();
public virtual BattlePhaseAction OnSelectAttackTarget(ClientCard attacker, IList<ClientCard> defenders)
{
// Overrided in DefalultExecutor
return null;
}
public virtual bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
......@@ -109,14 +82,12 @@ namespace WindBot.Game.AI
public virtual void OnChaining(int player, ClientCard card)
{
CurrentChain.Add(card);
LastChainPlayer = player;
}
public virtual void OnChainEnd()
{
LastChainPlayer = -1;
CurrentChain.Clear();
}
public virtual void OnNewTurn()
......@@ -182,44 +153,12 @@ namespace WindBot.Game.AI
return -1;
}
public bool ChainContainsCard(int id)
{
foreach (ClientCard card in CurrentChain)
{
if (card.Id == id)
return true;
}
return false;
}
public int ChainCountPlayer(int player)
public virtual bool OnSelectBattleReplay()
{
int count = 0;
foreach (ClientCard card in CurrentChain)
{
if (card.Controller == player)
count++;
}
return count;
}
public bool HasChainedTrap(int player)
{
foreach (ClientCard card in CurrentChain)
{
if (card.Controller == player && card.HasType(CardType.Trap))
return true;
}
// Overrided in DefalultExecutor
return false;
}
public ClientCard GetLastChainCard()
{
if (CurrentChain.Count > 0)
return CurrentChain[CurrentChain.Count - 1];
return null;
}
public void SetMain(MainPhase main)
{
Main = main;
......
......@@ -36,6 +36,7 @@ namespace WindBot.Game
public bool CanDirectAttack { get; set; }
public bool ShouldDirectAttack { get; set; }
public bool Attacked { get; set; }
public bool IsLastAttacker { get; set; }
public int[] ActionIndex { get; set; }
public IDictionary<int, int> ActionActivateIndex { get; private set; }
......
......@@ -13,6 +13,9 @@ namespace WindBot.Game
public IList<ClientCard> Deck { get; private set; }
public IList<ClientCard> ExtraDeck { get; private set; }
public int LifePoints;
public ClientCard BattlingMonster;
public ClientField()
{
}
......@@ -33,6 +36,15 @@ namespace WindBot.Game
ExtraDeck.Add(new ClientCard(0, CardLocation.Extra));
}
public int GetMonstersExtraZoneCount()
{
int count = 0;
if (MonsterZone[5] != null)
count++;
if (MonsterZone[6] != null)
count++;
return count;
}
public int GetMonsterCount()
{
return GetCount(MonsterZone);
......@@ -58,6 +70,19 @@ namespace WindBot.Game
}
return count;
}
public int GetFieldCount()
{
return GetSpellCount() + GetMonsterCount();
}
public int GetFieldHandCount()
{
return GetSpellCount() + GetMonsterCount() + GetHandCount();
}
public bool IsFieldEmpty()
{
......@@ -68,6 +93,7 @@ namespace WindBot.Game
{
return GetCards(MonsterZone);
}
public List<ClientCard> GetGraveyardMonsters()
{
......
......@@ -8,7 +8,6 @@ namespace WindBot.Game
public bool IsFirst { get; set; }
public bool IsNewRule { get; set; }
public int[] LifePoints { get; private set; }
public ClientField[] Fields { get; private set; }
public int Turn { get; set; }
......@@ -16,15 +15,19 @@ namespace WindBot.Game
public DuelPhase Phase { get; set; }
public MainPhase MainPhase { get; set; }
public BattlePhase BattlePhase { get; set; }
public int LastChainPlayer { get; set; }
public IList<ClientCard> CurrentChain { get; set; }
public IList<ClientCard> ChainTargets { get; set; }
public int LastSummonPlayer { get; set; }
public Duel()
{
LifePoints = new int[2];
Fields = new ClientField[2];
Fields[0] = new ClientField();
Fields[1] = new ClientField();
LastChainPlayer = -1;
CurrentChain = new List<ClientCard>();
ChainTargets = new List<ClientCard>();
LastSummonPlayer = -1;
}
......
using System.Linq;
using System.Linq;
using System.Collections.Generic;
using WindBot.Game.AI;
using YGOSharp.OCGWrapper.Enums;
......@@ -90,9 +90,6 @@ namespace WindBot.Game
m_option = -1;
m_yesno = -1;
m_position = CardPosition.FaceUpAttack;
m_attacker = null;
m_defender = null;
Duel.LastSummonPlayer = -1;
if (Duel.Player == 0 && Duel.Phase == DuelPhase.Draw)
{
_dialogs.SendNewTurn();
......@@ -114,7 +111,6 @@ namespace WindBot.Game
/// <param name="player">Player who is currently chaining.</param>
public void OnChaining(ClientCard card, int player)
{
Duel.LastSummonPlayer = -1;
Executor.OnChaining(player,card);
}
......@@ -147,13 +143,57 @@ namespace WindBot.Game
}
}
// Sort the attackers and defenders, make monster with higher attack go first.
List<ClientCard> attackers = new List<ClientCard>(battle.AttackableCards);
attackers.Sort(AIFunctions.CompareCardAttack);
attackers.Reverse();
List<ClientCard> defenders = new List<ClientCard>(Duel.Fields[1].GetMonsters());
defenders.Sort(AIFunctions.CompareDefensePower);
defenders.Reverse();
return Executor.OnBattle(attackers, defenders);
// Let executor decide which card should attack first.
ClientCard selected = Executor.OnSelectAttacker(attackers, defenders);
if (selected != null && attackers.Contains(selected))
{
attackers.Remove(selected);
attackers.Insert(0, selected);
}
// Check for the executor.
BattlePhaseAction result = Executor.OnBattle(attackers, defenders);
if (result != null)
return result;
if (attackers.Count == 0)
return ToMainPhase2();
if (defenders.Count == 0)
{
// Attack with the monster with the lowest attack first
for (int i = attackers.Count - 1; i >= 0; --i)
{
ClientCard attacker = attackers[i];
if (attacker.Attack > 0)
return Attack(attacker, null);
}
}
else
{
for (int k = 0; k < attackers.Count; ++k)
{
ClientCard attacker = attackers[k];
attacker.IsLastAttacker = (k == attackers.Count - 1);
result = Executor.OnSelectAttackTarget(attacker, defenders);
if (result != null)
return result;
}
}
if (!battle.CanMainPhaseTwo)
return Attack(attackers[0], (defenders.Count == 0) ? null : defenders[0]);
return ToMainPhase2();
}
/// <summary>
......@@ -607,6 +647,15 @@ namespace WindBot.Game
return Executor.OnSelectYesNo(desc);
}
/// <summary>
/// Called when the AI has to select if to continue attacking when replay.
/// </summary>
/// <returns>True for yes, false for no.</returns>
public bool OnSelectBattleReplay()
{
return Executor.OnSelectBattleReplay();
}
/// <summary>
/// Called when the AI has to declare a card.
/// </summary>
......@@ -630,27 +679,9 @@ namespace WindBot.Game
private int m_number;
private int m_announce;
private int m_yesno;
private ClientCard m_attacker;
private ClientCard m_defender;
private IList<CardAttribute> m_attributes = new List<CardAttribute>();
private IList<CardRace> m_races = new List<CardRace>();
public void SendBattleMsg(ClientCard attackcard, ClientCard defendcard)
{
m_attacker = attackcard;
m_defender = defendcard;
}
public ClientCard GetAttacker()
{
return m_attacker;
}
public ClientCard GetDefender()
{
return m_defender;
}
public void SelectCard(ClientCard card)
{
m_selector = new CardSelector(card);
......@@ -916,4 +947,4 @@ namespace WindBot.Game
return false;
}
}
}
}
\ No newline at end of file
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
......@@ -108,6 +108,7 @@ namespace WindBot.Game
_messages.Add(GameMessage.BecomeTarget, OnBecomeTarget);
_messages.Add(GameMessage.SelectBattleCmd, OnSelectBattleCmd);
_messages.Add(GameMessage.SelectCard, OnSelectCard);
_messages.Add(GameMessage.SelectUnselectCard, OnSelectUnselectCard);
_messages.Add(GameMessage.SelectChain, OnSelectChain);
_messages.Add(GameMessage.SelectCounter, OnSelectCounter);
_messages.Add(GameMessage.SelectDisfield, OnSelectDisfield);
......@@ -327,8 +328,8 @@ namespace WindBot.Game
int type = packet.ReadByte();
_duel.IsFirst = (type & 0xF) == 0;
_duel.Turn = 0;
_duel.LifePoints[GetLocalPlayer(0)] = packet.ReadInt32();
_duel.LifePoints[GetLocalPlayer(1)] = packet.ReadInt32();
_duel.Fields[GetLocalPlayer(0)].LifePoints = packet.ReadInt32();
_duel.Fields[GetLocalPlayer(1)].LifePoints = packet.ReadInt32();
int deck = packet.ReadInt16();
int extra = packet.ReadInt16();
_duel.Fields[GetLocalPlayer(0)].Init(deck, extra);
......@@ -424,27 +425,30 @@ namespace WindBot.Game
private void OnNewPhase(BinaryReader packet)
{
_duel.Phase = (DuelPhase)packet.ReadInt16();
_duel.LastSummonPlayer = -1;
_duel.Fields[0].BattlingMonster = null;
_duel.Fields[1].BattlingMonster = null;
_ai.OnNewPhase();
}
private void OnDamage(BinaryReader packet)
{
int player = GetLocalPlayer(packet.ReadByte());
int final = _duel.LifePoints[player] - packet.ReadInt32();
int final = _duel.Fields[player].LifePoints - packet.ReadInt32();
if (final < 0) final = 0;
_duel.LifePoints[player] = final;
_duel.Fields[player].LifePoints = final;
}
private void OnRecover(BinaryReader packet)
{
int player = GetLocalPlayer(packet.ReadByte());
_duel.LifePoints[player] += packet.ReadInt32();
_duel.Fields[player].LifePoints += packet.ReadInt32();
}
private void OnLpUpdate(BinaryReader packet)
{
int player = GetLocalPlayer(packet.ReadByte());
_duel.LifePoints[player] = packet.ReadInt32();
_duel.Fields[player].LifePoints = packet.ReadInt32();
}
private void OnMove(BinaryReader packet)
......@@ -497,13 +501,16 @@ namespace WindBot.Game
int la = packet.ReadByte();
int sa = packet.ReadByte();
packet.ReadByte(); //
int cd = GetLocalPlayer(packet.ReadByte()); // cd
int cd = GetLocalPlayer(packet.ReadByte());
int ld = packet.ReadByte();
int sd = packet.ReadByte(); // sd
int sd = packet.ReadByte();
packet.ReadByte(); //
ClientCard attackcard = _duel.GetCard(ca, (CardLocation)la, sa);
ClientCard defendcard = _duel.GetCard(cd, (CardLocation)ld, sd);
_ai.SendBattleMsg(attackcard, defendcard);
_duel.Fields[attackcard.Controller].BattlingMonster = attackcard;
_duel.Fields[1 - attackcard.Controller].BattlingMonster = defendcard;
if (ld == 0 && (attackcard != null) && (ca != 0))
{
_ai.OnDirectAttack(attackcard);
......@@ -534,11 +541,17 @@ namespace WindBot.Game
int cc = GetLocalPlayer(packet.ReadByte());
_ai.OnChaining(card, cc);
_duel.ChainTargets.Clear();
_duel.LastSummonPlayer = -1;
_duel.CurrentChain.Add(card);
_duel.LastChainPlayer = cc;
}
private void OnChainEnd(BinaryReader packet)
{
_ai.OnChainEnd();
_duel.LastChainPlayer = -1;
_duel.CurrentChain.Clear();
//_duel.ChainTargets.Clear();
}
......@@ -1170,7 +1183,12 @@ namespace WindBot.Game
private void OnSelectYesNo(BinaryReader packet)
{
packet.ReadByte(); // player
int reply = _ai.OnSelectYesNo(packet.ReadInt32()) ? (1) : (0);
int desc = packet.ReadInt32();
int reply;
if (desc == 30)
reply = _ai.OnSelectBattleReplay() ? 1 : 0;
else
reply = _ai.OnSelectYesNo(desc) ? 1 : 0;
Connection.Send(CtosMessage.Response, reply);
}
......
......@@ -79,6 +79,7 @@
<Compile Include="Game\AI\Decks\EvilswarmExecutor.cs" />
<Compile Include="Game\AI\Decks\GraydleExecutor.cs" />
<Compile Include="Game\AI\Decks\LightswornExecutor.cs" />
<Compile Include="Game\AI\Decks\LightswornShaddoldinosourExecutor.cs" />
<Compile Include="Game\AI\Decks\QliphortExecutor.cs" />
<Compile Include="Game\AI\Decks\ST1732Executor.cs" />
<Compile Include="Game\AI\Decks\TrickstarExecutor.cs" />
......
using System;
using System;
namespace WindBot
{
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment