Commit fa96dfae authored by nanahira's avatar nanahira

mg

parents 3b92c1dd 42a2cc6b
#created by ... #created by ...
#main #main
75498415 75498415
75498415 75498415
75498415 75498415
81105204 81105204
81105204 81105204
81105204 81105204
58820853 58820853
58820853 58820853
58820853 58820853
49003716 49003716
49003716 49003716
49003716 49003716
85215458 85215458
85215458 85215458
85215458 85215458
2009101 2009101
2009101 2009101
2009101 2009101
22835145 22835145
22835145 22835145
22835145 22835145
46710683 46710683
46710683 46710683
46710683 46710683
53129443 53129443
5318639 5318639
5318639 5318639
5318639 5318639
91351370 91351370
91351370 91351370
91351370 91351370
44095762 44095762
44095762 44095762
44095762 44095762
59839761 59839761
59839761 59839761
59839761 59839761
70342110 70342110
70342110 70342110
70342110 70342110
#extra #extra
33236860 33236860
33236860 33236860
33236860 33236860
9012916 9012916
9012916 9012916
9012916 9012916
69031175 69031175
69031175 69031175
69031175 69031175
76913983 76913983
76913983 76913983
76913983 76913983
17377751 17377751
17377751 17377751
17377751 17377751
!side !side
#created by ... #created by ...
#main #main
89631139 89631139
89631139 89631139
89631139 89631139
38517737 38517737
38517737 38517737
38517737 38517737
45467446 45467446
45467446 45467446
71039903 71039903
71039903 71039903
71039903 71039903
79814787 79814787
79814787 79814787
8240199 8240199
8240199 8240199
8240199 8240199
5133471 5133471
5133471 5133471
6853254 6853254
6853254 6853254
6853254 6853254
18144506 18144506
35261759 35261759
35261759 35261759
38120068 38120068
38120068 38120068
38120068 38120068
39701395 39701395
39701395 39701395
39701395 39701395
41620959 41620959
41620959 41620959
48800175 48800175
48800175 48800175
48800175 48800175
54447022 54447022
83764718 83764718
87025064 87025064
87025064 87025064
87025064 87025064
#extra #extra
63422098 63422098
40908371 40908371
40908371 40908371
40908371 40908371
59822133 59822133
59822133 59822133
59822133 59822133
58820923 58820923
2530830 2530830
39030163 39030163
31801517 31801517
18963306 18963306
63767246 63767246
63767246 63767246
33909817 33909817
!side !side
#created by ... #created by ...
#main #main
4162088 4162088
68774379 68774379
70095154 70095154
70095154 70095154
70095154 70095154
59281922 59281922
59281922 59281922
59281922 59281922
3370104 3370104
67159705 67159705
26439287 26439287
26439287 26439287
26439287 26439287
76986005 76986005
23893227 23893227
23893227 23893227
23893227 23893227
3657444 3657444
11961740 11961740
11961740 11961740
24094653 24094653
24094653 24094653
37630732 37630732
37630732 37630732
37630732 37630732
52875873 52875873
52875873 52875873
53129443 53129443
66607691 66607691
95286165 95286165
29401950 29401950
29401950 29401950
44095762 44095762
44095762 44095762
91989718 91989718
92773018 92773018
92773018 92773018
97077563 97077563
97077563 97077563
3819470 3819470
#extra #extra
1546123 1546123
1546123 1546123
1546123 1546123
74157028 74157028
74157028 74157028
74157028 74157028
10443957 10443957
10443957 10443957
10443957 10443957
58069384 58069384
58069384 58069384
58069384 58069384
!side !side
#created by ... #created by ...
#main #main
77542832 77542832
77542832 77542832
77542832 77542832
40921545 40921545
79785958 79785958
79785958 79785958
79785958 79785958
59546797 59546797
59546797 59546797
72429240 72429240
4756629 4756629
4756629 4756629
4756629 4756629
8814959 8814959
8814959 8814959
8814959 8814959
85138716 85138716
85138716 85138716
85138716 85138716
23434538 23434538
23434538 23434538
911883 911883
1475311 1475311
1475311 1475311
18144506 18144506
32807846 32807846
8267140 8267140
27541267 27541267
27541267 27541267
26708437 26708437
26708437 26708437
5851097 5851097
35419032 35419032
58921041 58921041
58921041 58921041
40605147 40605147
40605147 40605147
40605147 40605147
41420027 41420027
84749824 84749824
#extra #extra
88754763 88754763
9272381 9272381
56832966 56832966
86532744 86532744
36757171 36757171
93568288 93568288
21044178 21044178
91279700 91279700
46772449 46772449
82633039 82633039
84013237 84013237
76067258 76067258
359563 359563
91279700 91279700
91279700 91279700
!side !side
8233522 8233522
8233522 8233522
5318639 5318639
8267140 8267140
12923641 12923641
12923641 12923641
12923641 12923641
18161786 18161786
18161786 18161786
11109820 11109820
11109820 11109820
11109820 11109820
94192409 94192409
94192409 94192409
58921041 58921041
#created by ... #created by ...
#main #main
25524823 25524823
36521459 36521459
3825890 3825890
62473983 62473983
17393207 17393207
17393207 17393207
17393207 17393207
25262697 25262697
30213599 30213599
30213599 30213599
30213599 30213599
24317029 24317029
24317029 24317029
24317029 24317029
93023479 93023479
93023479 93023479
93023479 93023479
72405967 72405967
72405967 72405967
5318639 5318639
5318639 5318639
5318639 5318639
14087893 14087893
14087893 14087893
70000776 70000776
70000776 70000776
47355498 47355498
47355498 47355498
47355498 47355498
29401950 29401950
29401950 29401950
30450531 30450531
30450531 30450531
53582587 53582587
53582587 53582587
70342110 70342110
70342110 70342110
84749824 84749824
90434657 90434657
90434657 90434657
#extra #extra
44508094 44508094
!side !side
#created by ... #created by ...
#main #main
20056760 20056760
20056760 20056760
20056760 20056760
29834183 29834183
29834183 29834183
29834183 29834183
93445074 93445074
93445074 93445074
93445074 93445074
66451379 66451379
66451379 66451379
66451379 66451379
23434538 23434538
23434538 23434538
23434538 23434538
97268402 97268402
97268402 97268402
97268402 97268402
18144507 18144507
33057951 33057951
33057951 33057951
33057951 33057951
53129443 53129443
83764718 83764718
98645731 98645731
98645731 98645731
98645731 98645731
2759860 2759860
2759860 2759860
2759860 2759860
58120309 58120309
75361204 75361204
75361204 75361204
49966595 49966595
49966595 49966595
49966595 49966595
82732705 82732705
82732705 82732705
82732705 82732705
41420027 41420027
#extra #extra
52687916 52687916
80666118 80666118
39765958 39765958
52145422 52145422
52145422 52145422
70902743 70902743
76774528 76774528
44508094 44508094
83994433 83994433
95040215 95040215
98012938 98012938
88033975 88033975
26593852 26593852
98558751 98558751
78156759 78156759
!side !side
46565218 46565218
46565218 46565218
46565218 46565218
5318639 5318639
5318639 5318639
5318639 5318639
95561280 95561280
95561280 95561280
95561280 95561280
47475363 47475363
47475363 47475363
47475363 47475363
98643358 98643358
98643358 98643358
98643358 98643358
#created by ... #created by ...
#main #main
77558536 77558536
18144506 18144506
57774843 57774843
57774843 57774843
57774843 57774843
58996430 58996430
58996430 58996430
58996430 58996430
59019082 59019082
77558536 77558536
77558536 77558536
22624373 22624373
22624373 22624373
67696066 67696066
67696066 67696066
67696066 67696066
25259669 25259669
25259669 25259669
25259669 25259669
1833916 1833916
1833916 1833916
73176465 73176465
73176465 73176465
37742478 37742478
37742478 37742478
95503687 95503687
95503687 95503687
95503687 95503687
40164421 40164421
21502796 21502796
67441435 67441435
691925 691925
691925 691925
691925 691925
5133471 5133471
32807846 32807846
73594093 73594093
94886282 94886282
94886282 94886282
94886282 94886282
#extra #extra
52687916 52687916
80666118 80666118
74586817 74586817
4779823 4779823
37192109 37192109
56832966 56832966
84013237 84013237
82633039 82633039
30100551 30100551
30100551 30100551
30100551 30100551
46772449 46772449
83531441 83531441
1861629 1861629
3987233 3987233
!side !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 ... #created by ...
#main #main
52738610 52738610
52738610 52738610
52738610 52738610
23401839 23401839
23401839 23401839
23401839 23401839
95492061 95492061
95492061 95492061
95492061 95492061
30312361 30312361
90307777 90307777
88240999 88240999
88240999 88240999
52068432 52068432
52068432 52068432
52068432 52068432
74122412 74122412
74122412 74122412
26674724 26674724
89463537 89463537
99185129 99185129
99185129 99185129
99185129 99185129
32807846 32807846
53129443 53129443
96729612 96729612
96729612 96729612
14735698 14735698
14735698 14735698
14735698 14735698
51124303 51124303
51124303 51124303
51124303 51124303
97211663 97211663
5318639 5318639
5318639 5318639
5318639 5318639
51452091 51452091
51452091 51452091
51452091 51452091
#extra #extra
35952884 35952884
35952884 35952884
41517789 41517789
41517789 41517789
24696097 24696097
24696097 24696097
52687916 52687916
74586817 74586817
37192109 37192109
42566602 42566602
90953320 90953320
79606837 79606837
79606837 79606837
79606837 79606837
46772449 46772449
!side !side
#created by ... #created by ...
#main #main
18108166 18108166
18108166 18108166
18108166 18108166
74852097 74852097
74852097 74852097
74852097 74852097
81823360 81823360
81823360 81823360
81823360 81823360
75195825 75195825
75195825 75195825
75195825 75195825
87979586 87979586
87979586 87979586
87979586 87979586
33256280 33256280
33256280 33256280
33256280 33256280
85138716 85138716
85138716 85138716
85138716 85138716
911883 911883
911883 911883
911883 911883
18144506 18144506
35261759 35261759
35261759 35261759
35261759 35261759
97169186 97169186
97169186 97169186
97169186 97169186
5650082 5650082
20522190 20522190
29401950 29401950
29616929 29616929
40838625 40838625
44095762 44095762
47475363 47475363
58120309 58120309
75249652 75249652
#extra #extra
80666118 80666118
18239909 18239909
44508094 44508094
56832966 56832966
37279508 37279508
84013237 84013237
74294676 74294676
82697249 82697249
82633039 82633039
61344030 61344030
22653490 22653490
46772449 46772449
12014404 12014404
359563 359563
6511113 6511113
!side !side
#created by ... #created by ...
#main #main
23950192 23950192
23950192 23950192
90311614 90311614
90311614 90311614
90311614 90311614
9126351 9126351
9126351 9126351
9126351 9126351
50088247 50088247
50088247 50088247
50088247 50088247
1357146 1357146
1357146 1357146
1357146 1357146
46239604 46239604
46239604 46239604
46239604 46239604
80250319 80250319
80250319 80250319
80250319 80250319
5133471 5133471
5133471 5133471
5133471 5133471
18144506 18144506
33057951 33057951
33057951 33057951
33057951 33057951
53129443 53129443
72892473 72892473
81439173 81439173
83764718 83764718
84206435 84206435
84206435 84206435
84206435 84206435
96947648 96947648
96947648 96947648
96947648 96947648
29047353 29047353
29047353 29047353
29047353 29047353
#extra #extra
79606837 79606837
79606837 79606837
79606837 79606837
90809975 90809975
90809975 90809975
90809975 90809975
36776089 36776089
36776089 36776089
36776089 36776089
2766877 2766877
2766877 2766877
2766877 2766877
84224627 84224627
84224627 84224627
84224627 84224627
!side !side
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#main #main
98169343 98169343
98169343 98169343
9929398
61283655 61283655
61283655 61283655
61283655 61283655
...@@ -11,20 +10,21 @@ ...@@ -11,20 +10,21 @@
35199656 35199656
14558127 14558127
14558127 14558127
14558127
59438930
59438930 59438930
98700941 98700941
23434538 23434538
23434538 23434538
23434538 23434538
67441435 94145021
63845230 63845230
63845230 63845230
63845230 63845230
18144506 18144506
35261759 35261759
35261759 35261759
53129443
53129443
53129443
73628505 73628505
73915051 73915051
73915051 73915051
...@@ -42,18 +42,18 @@ ...@@ -42,18 +42,18 @@
84749824 84749824
#extra #extra
41999284 41999284
3987233
41999284 41999284
3987233
2857636
50588353 50588353
98558751 98558751
74997493 86221741
2857636
38342335
99111753
31833038 31833038
3987233 3987233
99111753
38342335
50588353 50588353
41999284
9753964 9753964
41999284
34408491 34408491
!side !side
#created by ... #created by ...
#main #main
92246806 92246806
92246806 92246806
92246806 92246806
65247798 65247798
65247798 65247798
65247798 65247798
28630501 28630501
28630501 28630501
28630501 28630501
25244515 25244515
25244515 25244515
18144507 18144507
53129443 53129443
59750328 59750328
59750328 59750328
98645731 98645731
98645731 98645731
98645731 98645731
8267140 8267140
8267140 8267140
8267140 8267140
40838625 40838625
40838625 40838625
47475363 47475363
47475363 47475363
47475363 47475363
58120309 58120309
58120309 58120309
58120309 58120309
5851097 5851097
30241314 30241314
30241314 30241314
30241314 30241314
40605147 40605147
40605147 40605147
41420027 41420027
59344077 59344077
59344077 59344077
59344077 59344077
84749824 84749824
#extra #extra
44508094 44508094
56832966 56832966
86532744 86532744
16195942 16195942
84013237 84013237
94380860 94380860
96381979 96381979
63746411 63746411
82633039 82633039
95169481 95169481
22653490 22653490
46772449 46772449
21044178 21044178
12014404 12014404
12014404 12014404
!side !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 ...@@ -296,6 +296,44 @@ namespace WindBot.Game.AI
return Duel.ChainTargets.Count == 1 && card.Equals(Duel.ChainTargets[0]); 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> /// <summary>
/// Select cards listed in preferred. /// Select cards listed in preferred.
/// </summary> /// </summary>
......
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic; using System.Collections.Generic;
using WindBot; using WindBot;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
// NOT FINISHED YET // NOT FINISHED YET
[Deck("Blackwing", "AI_Blackwing", "NotFinished")] [Deck("Blackwing", "AI_Blackwing", "NotFinished")]
public class BlackwingExecutor : DefaultExecutor public class BlackwingExecutor : DefaultExecutor
{ {
public class CardId public class CardId
{ {
public const int KrisTheCrackOfDawn = 81105204; public const int KrisTheCrackOfDawn = 81105204;
public const int SiroccoTheDawn = 75498415; public const int SiroccoTheDawn = 75498415;
public const int ShuraTheBlueFlame = 58820853; public const int ShuraTheBlueFlame = 58820853;
public const int BoraTheSpear = 49003716; public const int BoraTheSpear = 49003716;
public const int KalutTheMoonShadow = 85215458; public const int KalutTheMoonShadow = 85215458;
public const int GaleTheWhirlwind = 2009101; public const int GaleTheWhirlwind = 2009101;
public const int BlizzardTheFarNorth = 22835145; public const int BlizzardTheFarNorth = 22835145;
public const int MistralTheSilverShield = 46710683; public const int MistralTheSilverShield = 46710683;
public const int Raigeki = 12580477; public const int Raigeki = 12580477;
public const int DarkHole = 53129443; public const int DarkHole = 53129443;
public const int MysticalSpaceTyphoon = 5318639; public const int MysticalSpaceTyphoon = 5318639;
public const int BlackWhirlwind = 91351370; public const int BlackWhirlwind = 91351370;
public const int MirrorForce = 44095762; public const int MirrorForce = 44095762;
public const int DeltaCrowAntiReverse = 59839761; public const int DeltaCrowAntiReverse = 59839761;
public const int DimensionalPrison = 70342110; public const int DimensionalPrison = 70342110;
public const int SilverwindTheAscendant = 33236860; public const int SilverwindTheAscendant = 33236860;
public const int BlackWingedDragon = 9012916; public const int BlackWingedDragon = 9012916;
public const int ArmorMaster = 69031175; public const int ArmorMaster = 69031175;
public const int ArmedWing = 76913983; public const int ArmedWing = 76913983;
public const int GramTheShiningStar = 17377751; public const int GramTheShiningStar = 17377751;
} }
public BlackwingExecutor(GameAI ai, Duel duel) public BlackwingExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet); AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon); AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole); AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki); AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, CardId.BlackWhirlwind, BlackWhirlwindEffect); AddExecutor(ExecutorType.Activate, CardId.BlackWhirlwind, BlackWhirlwindEffect);
AddExecutor(ExecutorType.SpSummon, CardId.KrisTheCrackOfDawn); AddExecutor(ExecutorType.SpSummon, CardId.KrisTheCrackOfDawn);
AddExecutor(ExecutorType.SummonOrSet, CardId.KrisTheCrackOfDawn); AddExecutor(ExecutorType.SummonOrSet, CardId.KrisTheCrackOfDawn);
AddExecutor(ExecutorType.Summon, CardId.SiroccoTheDawn, SiroccoTheDawnSummon); AddExecutor(ExecutorType.Summon, CardId.SiroccoTheDawn, SiroccoTheDawnSummon);
AddExecutor(ExecutorType.Summon, CardId.ShuraTheBlueFlame, ShuraTheBlueFlameSummon); AddExecutor(ExecutorType.Summon, CardId.ShuraTheBlueFlame, ShuraTheBlueFlameSummon);
AddExecutor(ExecutorType.SummonOrSet, CardId.ShuraTheBlueFlame); AddExecutor(ExecutorType.SummonOrSet, CardId.ShuraTheBlueFlame);
AddExecutor(ExecutorType.SpSummon, CardId.BoraTheSpear); AddExecutor(ExecutorType.SpSummon, CardId.BoraTheSpear);
AddExecutor(ExecutorType.SummonOrSet, CardId.BoraTheSpear); AddExecutor(ExecutorType.SummonOrSet, CardId.BoraTheSpear);
AddExecutor(ExecutorType.SummonOrSet, CardId.KalutTheMoonShadow, KalutTheMoonShadowSummon); AddExecutor(ExecutorType.SummonOrSet, CardId.KalutTheMoonShadow, KalutTheMoonShadowSummon);
AddExecutor(ExecutorType.SpSummon, CardId.GaleTheWhirlwind); AddExecutor(ExecutorType.SpSummon, CardId.GaleTheWhirlwind);
AddExecutor(ExecutorType.SummonOrSet, CardId.GaleTheWhirlwind); AddExecutor(ExecutorType.SummonOrSet, CardId.GaleTheWhirlwind);
AddExecutor(ExecutorType.Summon, CardId.BlizzardTheFarNorth, BlizzardTheFarNorthSummon); AddExecutor(ExecutorType.Summon, CardId.BlizzardTheFarNorth, BlizzardTheFarNorthSummon);
AddExecutor(ExecutorType.MonsterSet, CardId.MistralTheSilverShield); AddExecutor(ExecutorType.MonsterSet, CardId.MistralTheSilverShield);
AddExecutor(ExecutorType.SpSummon, CardId.SilverwindTheAscendant); AddExecutor(ExecutorType.SpSummon, CardId.SilverwindTheAscendant);
AddExecutor(ExecutorType.SpSummon, CardId.ArmorMaster); AddExecutor(ExecutorType.SpSummon, CardId.ArmorMaster);
AddExecutor(ExecutorType.SpSummon, CardId.GramTheShiningStar); AddExecutor(ExecutorType.SpSummon, CardId.GramTheShiningStar);
AddExecutor(ExecutorType.SpSummon, CardId.ArmedWing); AddExecutor(ExecutorType.SpSummon, CardId.ArmedWing);
AddExecutor(ExecutorType.SpSummon, CardId.BlackWingedDragon); AddExecutor(ExecutorType.SpSummon, CardId.BlackWingedDragon);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultUniqueTrap); AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.DimensionalPrison, DefaultUniqueTrap); AddExecutor(ExecutorType.Activate, CardId.DimensionalPrison, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.DeltaCrowAntiReverse, DeltaCrowAntiReverseEffect); AddExecutor(ExecutorType.Activate, CardId.DeltaCrowAntiReverse, DeltaCrowAntiReverseEffect);
AddExecutor(ExecutorType.Activate, CardId.BlizzardTheFarNorth); AddExecutor(ExecutorType.Activate, CardId.BlizzardTheFarNorth);
AddExecutor(ExecutorType.Activate, CardId.ShuraTheBlueFlame); AddExecutor(ExecutorType.Activate, CardId.ShuraTheBlueFlame);
AddExecutor(ExecutorType.Activate, CardId.BoraTheSpear, BoraTheSpearEffect); AddExecutor(ExecutorType.Activate, CardId.BoraTheSpear, BoraTheSpearEffect);
AddExecutor(ExecutorType.Activate, CardId.KalutTheMoonShadow, AttackUpEffect); AddExecutor(ExecutorType.Activate, CardId.KalutTheMoonShadow, AttackUpEffect);
AddExecutor(ExecutorType.Activate, CardId.SiroccoTheDawn, AttackUpEffect); AddExecutor(ExecutorType.Activate, CardId.SiroccoTheDawn, AttackUpEffect);
AddExecutor(ExecutorType.Activate, CardId.GaleTheWhirlwind, GaleTheWhirlwindEffect); AddExecutor(ExecutorType.Activate, CardId.GaleTheWhirlwind, GaleTheWhirlwindEffect);
AddExecutor(ExecutorType.Activate, CardId.SilverwindTheAscendant); AddExecutor(ExecutorType.Activate, CardId.SilverwindTheAscendant);
AddExecutor(ExecutorType.Activate, CardId.BlackWingedDragon); AddExecutor(ExecutorType.Activate, CardId.BlackWingedDragon);
AddExecutor(ExecutorType.Activate, CardId.ArmorMaster); AddExecutor(ExecutorType.Activate, CardId.ArmorMaster);
AddExecutor(ExecutorType.Activate, CardId.ArmedWing); AddExecutor(ExecutorType.Activate, CardId.ArmedWing);
AddExecutor(ExecutorType.Activate, CardId.GramTheShiningStar); AddExecutor(ExecutorType.Activate, CardId.GramTheShiningStar);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos); AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
} }
private bool ShuraTheBlueFlameSummon() private bool ShuraTheBlueFlameSummon()
{ {
if (Bot.HasInMonstersZone(CardId.SiroccoTheDawn) && Bot.GetMonsters().GetHighestAttackMonster().Attack < 3800) if (Bot.HasInMonstersZone(CardId.SiroccoTheDawn) && Bot.GetMonsters().GetHighestAttackMonster().Attack < 3800)
return true; return true;
return false; return false;
} }
private bool BlackWhirlwindEffect() private bool BlackWhirlwindEffect()
{ {
if (Card.Location == CardLocation.Hand && Bot.HasInSpellZone(Card.Id)) if (Card.Location == CardLocation.Hand && Bot.HasInSpellZone(Card.Id))
return false; return false;
if (ActivateDescription == AI.Utils.GetStringId((int)Card.Id,0)) if (ActivateDescription == AI.Utils.GetStringId((int)Card.Id,0))
AI.SelectCard(CardId.GaleTheWhirlwind); AI.SelectCard(CardId.GaleTheWhirlwind);
return true; return true;
} }
private bool SiroccoTheDawnSummon() private bool SiroccoTheDawnSummon()
{ {
int OpponentMonster = Enemy.GetMonsterCount(); int OpponentMonster = Enemy.GetMonsterCount();
int AIMonster = Bot.GetMonsterCount(); int AIMonster = Bot.GetMonsterCount();
if (OpponentMonster != 0 && AIMonster == 0) if (OpponentMonster != 0 && AIMonster == 0)
return true; return true;
return false; return false;
} }
private bool BoraTheSpearEffect() private bool BoraTheSpearEffect()
{ {
List<ClientCard> monster = Bot.GetMonsters(); List<ClientCard> monster = Bot.GetMonsters();
foreach (ClientCard card in monster) 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) 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 true;
return false; return false;
} }
private bool KalutTheMoonShadowSummon() private bool KalutTheMoonShadowSummon()
{ {
foreach (ClientCard card in Bot.Hand) 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) 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 false;
return true; return true;
} }
private bool BlizzardTheFarNorthSummon() private bool BlizzardTheFarNorthSummon()
{ {
foreach (ClientCard card in Bot.Graveyard) 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) if (card != null && card.Id == CardId.KalutTheMoonShadow || card.Id == CardId.BoraTheSpear || card.Id == CardId.ShuraTheBlueFlame || card.Id == CardId.KrisTheCrackOfDawn)
return true; return true;
return false; return false;
} }
private bool DeltaCrowAntiReverseEffect() private bool DeltaCrowAntiReverseEffect()
{ {
int Count = 0; int Count = 0;
List<ClientCard> monster = Bot.GetMonsters(); List<ClientCard> monster = Bot.GetMonsters();
foreach (ClientCard card in monster) 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) 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++; Count++;
if (Count == 3) if (Count == 3)
return true; return true;
return false; return false;
} }
private bool GaleTheWhirlwindEffect() private bool GaleTheWhirlwindEffect()
{ {
if (Card.Position == (int)CardPosition.FaceUp) if (Card.Position == (int)CardPosition.FaceUp)
{ {
AI.SelectCard(Enemy.GetMonsters().GetHighestAttackMonster()); AI.SelectCard(Enemy.GetMonsters().GetHighestAttackMonster());
return true; return true;
} }
return false; return false;
} }
private bool AttackUpEffect() private bool AttackUpEffect()
{ {
ClientCard bestMy = Bot.GetMonsters().GetHighestAttackMonster(); ClientCard bestMy = Bot.GetMonsters().GetHighestAttackMonster();
ClientCard bestEnemyATK = Enemy.GetMonsters().GetHighestAttackMonster(); ClientCard bestEnemyATK = Enemy.GetMonsters().GetHighestAttackMonster();
ClientCard bestEnemyDEF = Enemy.GetMonsters().GetHighestDefenseMonster(); ClientCard bestEnemyDEF = Enemy.GetMonsters().GetHighestDefenseMonster();
if (bestMy == null || (bestEnemyATK == null && bestEnemyDEF == null)) if (bestMy == null || (bestEnemyATK == null && bestEnemyDEF == null))
return false; return false;
if (bestEnemyATK != null && bestMy.Attack < bestEnemyATK.Attack) if (bestEnemyATK != null && bestMy.Attack < bestEnemyATK.Attack)
return true; return true;
if (bestEnemyDEF != null && bestMy.Attack < bestEnemyDEF.Defense) if (bestEnemyDEF != null && bestMy.Attack < bestEnemyDEF.Defense)
return true; return true;
return false; return false;
} }
} }
} }
\ No newline at end of file
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic; using System.Collections.Generic;
using WindBot; using WindBot;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
[Deck("Blue-Eyes", "AI_BlueEyes")] [Deck("Blue-Eyes", "AI_BlueEyes")]
class BlueEyesExecutor : DefaultExecutor class BlueEyesExecutor : DefaultExecutor
{ {
public class CardId public class CardId
{ {
public const int WhiteDragon = 89631139; public const int WhiteDragon = 89631139;
public const int AlternativeWhiteDragon = 38517737; public const int AlternativeWhiteDragon = 38517737;
public const int DragonSpiritOfWhite = 45467446; public const int DragonSpiritOfWhite = 45467446;
public const int WhiteStoneOfAncients = 71039903; public const int WhiteStoneOfAncients = 71039903;
public const int WhiteStoneOfLegend = 79814787; public const int WhiteStoneOfLegend = 79814787;
public const int SageWithEyesOfBlue = 8240199; public const int SageWithEyesOfBlue = 8240199;
public const int EffectVeiler = 97268402; public const int EffectVeiler = 97268402;
public const int GalaxyCyclone = 5133471; public const int GalaxyCyclone = 5133471;
public const int HarpiesFeatherDuster = 18144506; public const int HarpiesFeatherDuster = 18144506;
public const int ReturnOfTheDragonLords = 6853254; public const int ReturnOfTheDragonLords = 6853254;
public const int PotOfDesires = 35261759; public const int PotOfDesires = 35261759;
public const int TradeIn = 38120068; public const int TradeIn = 38120068;
public const int CardsOfConsonance = 39701395; public const int CardsOfConsonance = 39701395;
public const int DragonShrine = 41620959; public const int DragonShrine = 41620959;
public const int MelodyOfAwakeningDragon = 48800175; public const int MelodyOfAwakeningDragon = 48800175;
public const int SoulCharge = 54447022; public const int SoulCharge = 54447022;
public const int MonsterReborn = 83764718; public const int MonsterReborn = 83764718;
public const int SilversCry = 87025064; public const int SilversCry = 87025064;
public const int Giganticastle = 63422098; public const int Giganticastle = 63422098;
public const int AzureEyesSilverDragon = 40908371; public const int AzureEyesSilverDragon = 40908371;
public const int BlueEyesSpiritDragon = 59822133; public const int BlueEyesSpiritDragon = 59822133;
public const int GalaxyEyesDarkMatterDragon = 58820923; public const int GalaxyEyesDarkMatterDragon = 58820923;
public const int GalaxyEyesCipherBladeDragon = 2530830; public const int GalaxyEyesCipherBladeDragon = 2530830;
public const int GalaxyEyesFullArmorPhotonDragon = 39030163; public const int GalaxyEyesFullArmorPhotonDragon = 39030163;
public const int GalaxyEyesPrimePhotonDragon = 31801517; public const int GalaxyEyesPrimePhotonDragon = 31801517;
public const int GalaxyEyesCipherDragon = 18963306; public const int GalaxyEyesCipherDragon = 18963306;
public const int HopeHarbingerDragonTitanicGalaxy = 63767246; public const int HopeHarbingerDragonTitanicGalaxy = 63767246;
public const int SylvanPrincessprite = 33909817; public const int SylvanPrincessprite = 33909817;
} }
private List<ClientCard> UsedAlternativeWhiteDragon = new List<ClientCard>(); private List<ClientCard> UsedAlternativeWhiteDragon = new List<ClientCard>();
ClientCard UsedGalaxyEyesCipherDragon; ClientCard UsedGalaxyEyesCipherDragon;
bool AlternativeWhiteDragonSummoned = false; bool AlternativeWhiteDragonSummoned = false;
bool SoulChargeUsed = false; bool SoulChargeUsed = false;
public BlueEyesExecutor(GameAI ai, Duel duel) public BlueEyesExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
// destroy traps // destroy traps
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst); AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, CardId.GalaxyCyclone, DefaultGalaxyCyclone); AddExecutor(ExecutorType.Activate, CardId.GalaxyCyclone, DefaultGalaxyCyclone);
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster); AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, CardId.DragonShrine, DragonShrineEffect); AddExecutor(ExecutorType.Activate, CardId.DragonShrine, DragonShrineEffect);
// Sage search // Sage search
AddExecutor(ExecutorType.Summon, CardId.SageWithEyesOfBlue, SageWithEyesOfBlueSummon); AddExecutor(ExecutorType.Summon, CardId.SageWithEyesOfBlue, SageWithEyesOfBlueSummon);
// search Alternative White Dragon // search Alternative White Dragon
AddExecutor(ExecutorType.Activate, CardId.MelodyOfAwakeningDragon, MelodyOfAwakeningDragonEffect); AddExecutor(ExecutorType.Activate, CardId.MelodyOfAwakeningDragon, MelodyOfAwakeningDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.CardsOfConsonance, CardsOfConsonanceEffect); AddExecutor(ExecutorType.Activate, CardId.CardsOfConsonance, CardsOfConsonanceEffect);
AddExecutor(ExecutorType.Activate, CardId.TradeIn, TradeInEffect); AddExecutor(ExecutorType.Activate, CardId.TradeIn, TradeInEffect);
AddExecutor(ExecutorType.Activate, CardId.PotOfDesires, DefaultPotOfDesires); AddExecutor(ExecutorType.Activate, CardId.PotOfDesires, DefaultPotOfDesires);
// spsummon Alternative White Dragon if possible // spsummon Alternative White Dragon if possible
AddExecutor(ExecutorType.SpSummon, CardId.AlternativeWhiteDragon, AlternativeWhiteDragonSummon); AddExecutor(ExecutorType.SpSummon, CardId.AlternativeWhiteDragon, AlternativeWhiteDragonSummon);
// reborn // reborn
AddExecutor(ExecutorType.Activate, CardId.ReturnOfTheDragonLords, RebornEffect); AddExecutor(ExecutorType.Activate, CardId.ReturnOfTheDragonLords, RebornEffect);
AddExecutor(ExecutorType.Activate, CardId.SilversCry, RebornEffect); AddExecutor(ExecutorType.Activate, CardId.SilversCry, RebornEffect);
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, RebornEffect); AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, RebornEffect);
// monster effects // monster effects
AddExecutor(ExecutorType.Activate, CardId.AlternativeWhiteDragon, AlternativeWhiteDragonEffect); AddExecutor(ExecutorType.Activate, CardId.AlternativeWhiteDragon, AlternativeWhiteDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.SageWithEyesOfBlue, SageWithEyesOfBlueEffect); AddExecutor(ExecutorType.Activate, CardId.SageWithEyesOfBlue, SageWithEyesOfBlueEffect);
AddExecutor(ExecutorType.Activate, CardId.WhiteStoneOfAncients, WhiteStoneOfAncientsEffect); AddExecutor(ExecutorType.Activate, CardId.WhiteStoneOfAncients, WhiteStoneOfAncientsEffect);
AddExecutor(ExecutorType.Activate, CardId.DragonSpiritOfWhite, DragonSpiritOfWhiteEffect); AddExecutor(ExecutorType.Activate, CardId.DragonSpiritOfWhite, DragonSpiritOfWhiteEffect);
AddExecutor(ExecutorType.Activate, CardId.BlueEyesSpiritDragon, BlueEyesSpiritDragonEffect); AddExecutor(ExecutorType.Activate, CardId.BlueEyesSpiritDragon, BlueEyesSpiritDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.HopeHarbingerDragonTitanicGalaxy, HopeHarbingerDragonTitanicGalaxyEffect); AddExecutor(ExecutorType.Activate, CardId.HopeHarbingerDragonTitanicGalaxy, HopeHarbingerDragonTitanicGalaxyEffect);
AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesCipherDragon, GalaxyEyesCipherDragonEffect); AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesCipherDragon, GalaxyEyesCipherDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesPrimePhotonDragon, GalaxyEyesPrimePhotonDragonEffect); AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesPrimePhotonDragon, GalaxyEyesPrimePhotonDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesFullArmorPhotonDragon, GalaxyEyesFullArmorPhotonDragonEffect); AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesFullArmorPhotonDragon, GalaxyEyesFullArmorPhotonDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesCipherBladeDragon, GalaxyEyesCipherBladeDragonEffect); AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesCipherBladeDragon, GalaxyEyesCipherBladeDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesDarkMatterDragon, GalaxyEyesDarkMatterDragonEffect); AddExecutor(ExecutorType.Activate, CardId.GalaxyEyesDarkMatterDragon, GalaxyEyesDarkMatterDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.AzureEyesSilverDragon, AzureEyesSilverDragonEffect); AddExecutor(ExecutorType.Activate, CardId.AzureEyesSilverDragon, AzureEyesSilverDragonEffect);
AddExecutor(ExecutorType.Activate, CardId.SylvanPrincessprite, SylvanPrincesspriteEffect); AddExecutor(ExecutorType.Activate, CardId.SylvanPrincessprite, SylvanPrincesspriteEffect);
// normal summon // normal summon
AddExecutor(ExecutorType.Summon, CardId.SageWithEyesOfBlue, WhiteStoneSummon); AddExecutor(ExecutorType.Summon, CardId.SageWithEyesOfBlue, WhiteStoneSummon);
AddExecutor(ExecutorType.Summon, CardId.WhiteStoneOfAncients, WhiteStoneSummon); AddExecutor(ExecutorType.Summon, CardId.WhiteStoneOfAncients, WhiteStoneSummon);
AddExecutor(ExecutorType.Summon, CardId.WhiteStoneOfLegend, WhiteStoneSummon); AddExecutor(ExecutorType.Summon, CardId.WhiteStoneOfLegend, WhiteStoneSummon);
// special summon from extra // special summon from extra
AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesCipherDragon, GalaxyEyesCipherDragonSummon); AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesCipherDragon, GalaxyEyesCipherDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesPrimePhotonDragon, GalaxyEyesPrimePhotonDragonSummon); AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesPrimePhotonDragon, GalaxyEyesPrimePhotonDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesFullArmorPhotonDragon, GalaxyEyesFullArmorPhotonDragonSummon); AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesFullArmorPhotonDragon, GalaxyEyesFullArmorPhotonDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesCipherBladeDragon, GalaxyEyesCipherBladeDragonSummon); AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesCipherBladeDragon, GalaxyEyesCipherBladeDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesDarkMatterDragon, GalaxyEyesDarkMatterDragonSummon); AddExecutor(ExecutorType.SpSummon, CardId.GalaxyEyesDarkMatterDragon, GalaxyEyesDarkMatterDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.Giganticastle, GiganticastleSummon); AddExecutor(ExecutorType.SpSummon, CardId.Giganticastle, GiganticastleSummon);
AddExecutor(ExecutorType.SpSummon, CardId.BlueEyesSpiritDragon, BlueEyesSpiritDragonSummon); AddExecutor(ExecutorType.SpSummon, CardId.BlueEyesSpiritDragon, BlueEyesSpiritDragonSummon);
AddExecutor(ExecutorType.SpSummon, CardId.HopeHarbingerDragonTitanicGalaxy, HopeHarbingerDragonTitanicGalaxySummon); AddExecutor(ExecutorType.SpSummon, CardId.HopeHarbingerDragonTitanicGalaxy, HopeHarbingerDragonTitanicGalaxySummon);
AddExecutor(ExecutorType.SpSummon, CardId.SylvanPrincessprite, SylvanPrincesspriteSummon); AddExecutor(ExecutorType.SpSummon, CardId.SylvanPrincessprite, SylvanPrincesspriteSummon);
// if we don't have other things to do... // if we don't have other things to do...
AddExecutor(ExecutorType.Activate, CardId.SoulCharge, SoulChargeEffect); AddExecutor(ExecutorType.Activate, CardId.SoulCharge, SoulChargeEffect);
AddExecutor(ExecutorType.Repos, Repos); AddExecutor(ExecutorType.Repos, Repos);
// summon White Stone to use the hand effect of Sage // summon White Stone to use the hand effect of Sage
AddExecutor(ExecutorType.Summon, CardId.WhiteStoneOfLegend, WhiteStoneSummonForSage); AddExecutor(ExecutorType.Summon, CardId.WhiteStoneOfLegend, WhiteStoneSummonForSage);
AddExecutor(ExecutorType.Summon, CardId.WhiteStoneOfAncients, WhiteStoneSummonForSage); AddExecutor(ExecutorType.Summon, CardId.WhiteStoneOfAncients, WhiteStoneSummonForSage);
AddExecutor(ExecutorType.Summon, CardId.SageWithEyesOfBlue, WhiteStoneSummonForSage); AddExecutor(ExecutorType.Summon, CardId.SageWithEyesOfBlue, WhiteStoneSummonForSage);
AddExecutor(ExecutorType.Activate, CardId.SageWithEyesOfBlue, SageWithEyesOfBlueEffectInHand); AddExecutor(ExecutorType.Activate, CardId.SageWithEyesOfBlue, SageWithEyesOfBlueEffectInHand);
// set White Stone of Legend frist // set White Stone of Legend frist
AddExecutor(ExecutorType.MonsterSet, CardId.WhiteStoneOfLegend); AddExecutor(ExecutorType.MonsterSet, CardId.WhiteStoneOfLegend);
AddExecutor(ExecutorType.MonsterSet, CardId.WhiteStoneOfAncients); AddExecutor(ExecutorType.MonsterSet, CardId.WhiteStoneOfAncients);
AddExecutor(ExecutorType.SpellSet, SpellSet); AddExecutor(ExecutorType.SpellSet, SpellSet);
} }
public override void OnNewTurn() public override void OnNewTurn()
{ {
// reset // reset
UsedAlternativeWhiteDragon.Clear(); UsedAlternativeWhiteDragon.Clear();
UsedGalaxyEyesCipherDragon = null; UsedGalaxyEyesCipherDragon = null;
AlternativeWhiteDragonSummoned = false; AlternativeWhiteDragonSummoned = false;
SoulChargeUsed = false; SoulChargeUsed = false;
} }
public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable) public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable)
{ {
Logger.DebugWriteLine("OnSelectCard " + cards.Count + " " + min + " " + max); Logger.DebugWriteLine("OnSelectCard " + cards.Count + " " + min + " " + max);
if (max == 2 && cards[0].Location == CardLocation.Deck) if (max == 2 && cards[0].Location == CardLocation.Deck)
{ {
Logger.DebugWriteLine("OnSelectCard MelodyOfAwakeningDragon"); Logger.DebugWriteLine("OnSelectCard MelodyOfAwakeningDragon");
IList<ClientCard> result = new List<ClientCard>(); IList<ClientCard> result = new List<ClientCard>();
if (!Bot.HasInHand(CardId.WhiteDragon)) if (!Bot.HasInHand(CardId.WhiteDragon))
{ {
foreach (ClientCard card in cards) foreach (ClientCard card in cards)
{ {
if (card.Id == CardId.WhiteDragon) if (card.Id == CardId.WhiteDragon)
{ {
result.Add(card); result.Add(card);
break; break;
} }
} }
} }
foreach (ClientCard card in cards) foreach (ClientCard card in cards)
{ {
if (card.Id == CardId.AlternativeWhiteDragon && result.Count < max) if (card.Id == CardId.AlternativeWhiteDragon && result.Count < max)
{ {
result.Add(card); result.Add(card);
} }
} }
AI.Utils.CheckSelectCount(result, cards, min, max); AI.Utils.CheckSelectCount(result, cards, min, max);
return result; return result;
} }
Logger.DebugWriteLine("Use default."); Logger.DebugWriteLine("Use default.");
return null; return null;
} }
public override IList<ClientCard> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max) public override IList<ClientCard> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max)
{ {
Logger.DebugWriteLine("OnSelectXyzMaterial " + cards.Count + " " + min + " " + max); Logger.DebugWriteLine("OnSelectXyzMaterial " + cards.Count + " " + min + " " + max);
IList<ClientCard> result = new List<ClientCard>(); IList<ClientCard> result = new List<ClientCard>();
AI.Utils.SelectPreferredCards(result, UsedAlternativeWhiteDragon, cards, min, max); AI.Utils.SelectPreferredCards(result, UsedAlternativeWhiteDragon, cards, min, max);
AI.Utils.CheckSelectCount(result, cards, min, max); AI.Utils.CheckSelectCount(result, cards, min, max);
return result; return result;
} }
public override IList<ClientCard> OnSelectSynchroMaterial(IList<ClientCard> cards, int sum, int min, int max) public override IList<ClientCard> OnSelectSynchroMaterial(IList<ClientCard> cards, int sum, int min, int max)
{ {
Logger.DebugWriteLine("OnSelectSynchroMaterial " + cards.Count + " " + sum + " " + min + " " + max); Logger.DebugWriteLine("OnSelectSynchroMaterial " + cards.Count + " " + sum + " " + min + " " + max);
if (sum != 8) if (sum != 8)
return null; return null;
foreach (ClientCard AlternativeWhiteDragon in UsedAlternativeWhiteDragon) foreach (ClientCard AlternativeWhiteDragon in UsedAlternativeWhiteDragon)
{ {
if (cards.IndexOf(AlternativeWhiteDragon) > 0) if (cards.IndexOf(AlternativeWhiteDragon) > 0)
{ {
UsedAlternativeWhiteDragon.Remove(AlternativeWhiteDragon); UsedAlternativeWhiteDragon.Remove(AlternativeWhiteDragon);
Logger.DebugWriteLine("select UsedAlternativeWhiteDragon"); Logger.DebugWriteLine("select UsedAlternativeWhiteDragon");
return new[] { AlternativeWhiteDragon }; return new[] { AlternativeWhiteDragon };
} }
} }
return null; return null;
} }
private bool DragonShrineEffect() private bool DragonShrineEffect()
{ {
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.DragonSpiritOfWhite, CardId.DragonSpiritOfWhite,
CardId.WhiteDragon, CardId.WhiteDragon,
CardId.WhiteStoneOfAncients, CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend CardId.WhiteStoneOfLegend
}); });
if (!Bot.HasInHand(CardId.WhiteDragon)) if (!Bot.HasInHand(CardId.WhiteDragon))
{ {
AI.SelectNextCard(CardId.WhiteStoneOfLegend); AI.SelectNextCard(CardId.WhiteStoneOfLegend);
} }
else else
{ {
AI.SelectNextCard(new[] AI.SelectNextCard(new[]
{ {
CardId.WhiteStoneOfAncients, CardId.WhiteStoneOfAncients,
CardId.DragonSpiritOfWhite, CardId.DragonSpiritOfWhite,
CardId.WhiteStoneOfLegend CardId.WhiteStoneOfLegend
}); });
} }
return true; return true;
} }
private bool MelodyOfAwakeningDragonEffect() private bool MelodyOfAwakeningDragonEffect()
{ {
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.WhiteStoneOfAncients, CardId.WhiteStoneOfAncients,
CardId.DragonSpiritOfWhite, CardId.DragonSpiritOfWhite,
CardId.WhiteStoneOfLegend, CardId.WhiteStoneOfLegend,
CardId.GalaxyCyclone, CardId.GalaxyCyclone,
CardId.EffectVeiler, CardId.EffectVeiler,
CardId.TradeIn, CardId.TradeIn,
CardId.SageWithEyesOfBlue CardId.SageWithEyesOfBlue
}); });
return true; return true;
} }
private bool CardsOfConsonanceEffect() private bool CardsOfConsonanceEffect()
{ {
if (!Bot.HasInHand(CardId.WhiteDragon)) if (!Bot.HasInHand(CardId.WhiteDragon))
{ {
AI.SelectCard(CardId.WhiteStoneOfLegend); AI.SelectCard(CardId.WhiteStoneOfLegend);
} }
else if (Bot.HasInHand(CardId.TradeIn)) else if (Bot.HasInHand(CardId.TradeIn))
{ {
AI.SelectCard(CardId.WhiteStoneOfLegend); AI.SelectCard(CardId.WhiteStoneOfLegend);
} }
else else
{ {
AI.SelectCard(CardId.WhiteStoneOfAncients); AI.SelectCard(CardId.WhiteStoneOfAncients);
} }
return true; return true;
} }
private bool TradeInEffect() private bool TradeInEffect()
{ {
if (Bot.HasInHand(CardId.DragonSpiritOfWhite)) if (Bot.HasInHand(CardId.DragonSpiritOfWhite))
{ {
AI.SelectCard(CardId.DragonSpiritOfWhite); AI.SelectCard(CardId.DragonSpiritOfWhite);
return true; return true;
} }
else if (HasTwoInHand(CardId.WhiteDragon)) else if (HasTwoInHand(CardId.WhiteDragon))
{ {
AI.SelectCard(CardId.WhiteDragon); AI.SelectCard(CardId.WhiteDragon);
return true; return true;
} }
else if (HasTwoInHand(CardId.AlternativeWhiteDragon)) else if (HasTwoInHand(CardId.AlternativeWhiteDragon))
{ {
AI.SelectCard(CardId.AlternativeWhiteDragon); AI.SelectCard(CardId.AlternativeWhiteDragon);
return true; return true;
} }
else if (!Bot.HasInHand(CardId.WhiteDragon) || !Bot.HasInHand(CardId.AlternativeWhiteDragon)) else if (!Bot.HasInHand(CardId.WhiteDragon) || !Bot.HasInHand(CardId.AlternativeWhiteDragon))
{ {
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.WhiteDragon, CardId.WhiteDragon,
CardId.AlternativeWhiteDragon CardId.AlternativeWhiteDragon
}); });
return true; return true;
} }
else else
{ {
return false; return false;
} }
} }
private bool AlternativeWhiteDragonEffect() private bool AlternativeWhiteDragonEffect()
{ {
ClientCard target = AI.Utils.GetProblematicEnemyMonster(Card.GetDefensePower()); ClientCard target = AI.Utils.GetProblematicEnemyMonster(Card.GetDefensePower());
if (target != null) if (target != null)
{ {
AI.SelectCard(target); AI.SelectCard(target);
UsedAlternativeWhiteDragon.Add(Card); UsedAlternativeWhiteDragon.Add(Card);
return true; return true;
} }
if (CanDealWithUsedAlternativeWhiteDragon()) if (CanDealWithUsedAlternativeWhiteDragon())
{ {
target = AI.Utils.GetBestEnemyMonster(); target = AI.Utils.GetBestEnemyMonster();
AI.SelectCard(target); AI.SelectCard(target);
UsedAlternativeWhiteDragon.Add(Card); UsedAlternativeWhiteDragon.Add(Card);
return true; return true;
} }
return false; return false;
} }
private bool RebornEffect() private bool RebornEffect()
{ {
if (Duel.Player == 0 && CurrentChain.Count > 0) if (Duel.Player == 0 && Duel.CurrentChain.Count > 0)
{ {
// Silver's Cry spsummon Dragon Spirit at chain 2 will miss the timing // Silver's Cry spsummon Dragon Spirit at chain 2 will miss the timing
return false; return false;
} }
if (Duel.Player == 0 && (Duel.Phase == DuelPhase.Draw || Duel.Phase == DuelPhase.Standby)) if (Duel.Player == 0 && (Duel.Phase == DuelPhase.Draw || Duel.Phase == DuelPhase.Standby))
{ {
// Let Azure-Eyes spsummon first // Let Azure-Eyes spsummon first
return false; return false;
} }
IList<int> targets = new[] { IList<int> targets = new[] {
CardId.HopeHarbingerDragonTitanicGalaxy, CardId.HopeHarbingerDragonTitanicGalaxy,
CardId.GalaxyEyesDarkMatterDragon, CardId.GalaxyEyesDarkMatterDragon,
CardId.AlternativeWhiteDragon, CardId.AlternativeWhiteDragon,
CardId.AzureEyesSilverDragon, CardId.AzureEyesSilverDragon,
CardId.BlueEyesSpiritDragon, CardId.BlueEyesSpiritDragon,
CardId.WhiteDragon, CardId.WhiteDragon,
CardId.DragonSpiritOfWhite CardId.DragonSpiritOfWhite
}; };
if (!Bot.HasInGraveyard(targets)) if (!Bot.HasInGraveyard(targets))
{ {
return false; return false;
} }
ClientCard floodgate = Enemy.SpellZone.GetFloodgate(); ClientCard floodgate = Enemy.SpellZone.GetFloodgate();
if (floodgate != null && Bot.HasInGraveyard(CardId.DragonSpiritOfWhite)) if (floodgate != null && Bot.HasInGraveyard(CardId.DragonSpiritOfWhite))
{ {
AI.SelectCard(CardId.DragonSpiritOfWhite); AI.SelectCard(CardId.DragonSpiritOfWhite);
} }
else else
{ {
AI.SelectCard(targets); AI.SelectCard(targets);
} }
return true; return true;
} }
private bool AzureEyesSilverDragonEffect() private bool AzureEyesSilverDragonEffect()
{ {
if (Enemy.GetSpellCount() > 0) if (Enemy.GetSpellCount() > 0)
{ {
AI.SelectCard(CardId.DragonSpiritOfWhite); AI.SelectCard(CardId.DragonSpiritOfWhite);
} }
else else
{ {
AI.SelectCard(CardId.WhiteDragon); AI.SelectCard(CardId.WhiteDragon);
} }
return true; return true;
} }
private bool SageWithEyesOfBlueSummon() private bool SageWithEyesOfBlueSummon()
{ {
return !Bot.HasInHand(new[] return !Bot.HasInHand(new[]
{ {
CardId.WhiteStoneOfAncients, CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend CardId.WhiteStoneOfLegend
}); });
} }
private bool SageWithEyesOfBlueEffect() private bool SageWithEyesOfBlueEffect()
{ {
if (Card.Location == CardLocation.Hand) if (Card.Location == CardLocation.Hand)
{ {
return false; return false;
} }
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.WhiteStoneOfAncients, CardId.WhiteStoneOfAncients,
CardId.EffectVeiler, CardId.EffectVeiler,
CardId.WhiteStoneOfLegend CardId.WhiteStoneOfLegend
}); });
return true; return true;
} }
private bool WhiteStoneSummonForSage() private bool WhiteStoneSummonForSage()
{ {
return Bot.HasInHand(CardId.SageWithEyesOfBlue); return Bot.HasInHand(CardId.SageWithEyesOfBlue);
} }
private bool SageWithEyesOfBlueEffectInHand() private bool SageWithEyesOfBlueEffectInHand()
{ {
if (Card.Location != CardLocation.Hand) if (Card.Location != CardLocation.Hand)
{ {
return false; return false;
} }
if (!Bot.HasInMonstersZone(new[] if (!Bot.HasInMonstersZone(new[]
{ {
CardId.WhiteStoneOfLegend, CardId.WhiteStoneOfLegend,
CardId.WhiteStoneOfAncients CardId.WhiteStoneOfAncients
}) || Bot.HasInMonstersZone(new[] }) || Bot.HasInMonstersZone(new[]
{ {
CardId.AlternativeWhiteDragon, CardId.AlternativeWhiteDragon,
CardId.WhiteDragon, CardId.WhiteDragon,
CardId.DragonSpiritOfWhite CardId.DragonSpiritOfWhite
})) }))
{ {
return false; return false;
} }
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.WhiteStoneOfLegend, CardId.WhiteStoneOfLegend,
CardId.WhiteStoneOfAncients CardId.WhiteStoneOfAncients
}); });
if (Enemy.GetSpellCount() > 0) if (Enemy.GetSpellCount() > 0)
{ {
AI.SelectNextCard(CardId.DragonSpiritOfWhite); AI.SelectNextCard(CardId.DragonSpiritOfWhite);
} }
else else
{ {
AI.SelectNextCard(CardId.WhiteDragon); AI.SelectNextCard(CardId.WhiteDragon);
} }
return true; return true;
} }
private bool DragonSpiritOfWhiteEffect() private bool DragonSpiritOfWhiteEffect()
{ {
if (ActivateDescription == -1) if (ActivateDescription == -1)
{ {
ClientCard target = AI.Utils.GetBestEnemySpell(); ClientCard target = AI.Utils.GetBestEnemySpell();
AI.SelectCard(target); AI.SelectCard(target);
return true; return true;
} }
else if (HaveEnoughWhiteDragonInHand()) else if (HaveEnoughWhiteDragonInHand())
{ {
if (Duel.Player == 0 && Duel.Phase == DuelPhase.BattleStart) if (Duel.Player == 0 && Duel.Phase == DuelPhase.BattleStart)
{ {
return Card.Attacked; return Card.Attacked;
} }
if (Duel.Player == 1 && Duel.Phase == DuelPhase.End) if (Duel.Player == 1 && Duel.Phase == DuelPhase.End)
{ {
return Bot.HasInMonstersZone(CardId.AzureEyesSilverDragon, true) return Bot.HasInMonstersZone(CardId.AzureEyesSilverDragon, true)
&& !Bot.HasInGraveyard(CardId.DragonSpiritOfWhite) && !Bot.HasInGraveyard(CardId.DragonSpiritOfWhite)
&& !Bot.HasInGraveyard(CardId.WhiteDragon); && !Bot.HasInGraveyard(CardId.WhiteDragon);
} }
if (AI.Utils.IsChainTarget(Card)) if (AI.Utils.IsChainTarget(Card))
{ {
return true; return true;
} }
} }
return false; return false;
} }
private bool BlueEyesSpiritDragonEffect() private bool BlueEyesSpiritDragonEffect()
{ {
if (ActivateDescription == -1 || ActivateDescription == AI.Utils.GetStringId(CardId.BlueEyesSpiritDragon, 0)) if (ActivateDescription == -1 || ActivateDescription == AI.Utils.GetStringId(CardId.BlueEyesSpiritDragon, 0))
{ {
return LastChainPlayer == 1; return Duel.LastChainPlayer == 1;
} }
else if (Duel.Player == 1 && (Duel.Phase == DuelPhase.BattleStart || Duel.Phase == DuelPhase.End)) else if (Duel.Player == 1 && (Duel.Phase == DuelPhase.BattleStart || Duel.Phase == DuelPhase.End))
{ {
AI.SelectCard(CardId.AzureEyesSilverDragon); AI.SelectCard(CardId.AzureEyesSilverDragon);
return true; return true;
} }
else else
{ {
if (AI.Utils.IsChainTarget(Card)) if (AI.Utils.IsChainTarget(Card))
{ {
AI.SelectCard(CardId.AzureEyesSilverDragon); AI.SelectCard(CardId.AzureEyesSilverDragon);
return true; return true;
} }
return false; return false;
} }
} }
private bool HopeHarbingerDragonTitanicGalaxyEffect() private bool HopeHarbingerDragonTitanicGalaxyEffect()
{ {
if (ActivateDescription == -1 || ActivateDescription == AI.Utils.GetStringId(CardId.HopeHarbingerDragonTitanicGalaxy, 0)) if (ActivateDescription == -1 || ActivateDescription == AI.Utils.GetStringId(CardId.HopeHarbingerDragonTitanicGalaxy, 0))
{ {
return LastChainPlayer == 1; return Duel.LastChainPlayer == 1;
} }
return true; return true;
} }
private bool WhiteStoneOfAncientsEffect() private bool WhiteStoneOfAncientsEffect()
{ {
if (ActivateDescription == AI.Utils.GetStringId(CardId.WhiteStoneOfAncients, 0)) if (ActivateDescription == AI.Utils.GetStringId(CardId.WhiteStoneOfAncients, 0))
{ {
if (Bot.HasInHand(CardId.TradeIn) if (Bot.HasInHand(CardId.TradeIn)
&& !Bot.HasInHand(CardId.WhiteDragon) && !Bot.HasInHand(CardId.WhiteDragon)
&& !Bot.HasInHand(CardId.AlternativeWhiteDragon)) && !Bot.HasInHand(CardId.AlternativeWhiteDragon))
{ {
AI.SelectCard(CardId.WhiteDragon); AI.SelectCard(CardId.WhiteDragon);
return true; return true;
} }
if (AlternativeWhiteDragonSummoned) if (AlternativeWhiteDragonSummoned)
{ {
return false; return false;
} }
if (Bot.HasInHand(CardId.WhiteDragon) if (Bot.HasInHand(CardId.WhiteDragon)
&& !Bot.HasInHand(CardId.AlternativeWhiteDragon) && !Bot.HasInHand(CardId.AlternativeWhiteDragon)
&& Bot.HasInGraveyard(CardId.AlternativeWhiteDragon)) && Bot.HasInGraveyard(CardId.AlternativeWhiteDragon))
{ {
AI.SelectCard(CardId.AlternativeWhiteDragon); AI.SelectCard(CardId.AlternativeWhiteDragon);
return true; return true;
} }
if (Bot.HasInHand(CardId.AlternativeWhiteDragon) if (Bot.HasInHand(CardId.AlternativeWhiteDragon)
&& !Bot.HasInHand(CardId.WhiteDragon) && !Bot.HasInHand(CardId.WhiteDragon)
&& Bot.HasInGraveyard(CardId.WhiteDragon)) && Bot.HasInGraveyard(CardId.WhiteDragon))
{ {
AI.SelectCard(CardId.WhiteDragon); AI.SelectCard(CardId.WhiteDragon);
return true; return true;
} }
return false; return false;
} }
else else
{ {
if (Enemy.GetSpellCount() > 0) if (Enemy.GetSpellCount() > 0)
{ {
AI.SelectCard(CardId.DragonSpiritOfWhite); AI.SelectCard(CardId.DragonSpiritOfWhite);
} }
else else
{ {
AI.SelectCard(CardId.WhiteDragon); AI.SelectCard(CardId.WhiteDragon);
} }
return true; return true;
} }
} }
private bool AlternativeWhiteDragonSummon() private bool AlternativeWhiteDragonSummon()
{ {
AlternativeWhiteDragonSummoned = true; AlternativeWhiteDragonSummoned = true;
return true; return true;
} }
private bool WhiteStoneSummon() private bool WhiteStoneSummon()
{ {
return Bot.HasInMonstersZone(new[] return Bot.HasInMonstersZone(new[]
{ {
CardId.SageWithEyesOfBlue, CardId.SageWithEyesOfBlue,
CardId.WhiteStoneOfAncients, CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend, CardId.WhiteStoneOfLegend,
CardId.AlternativeWhiteDragon, CardId.AlternativeWhiteDragon,
CardId.WhiteDragon, CardId.WhiteDragon,
CardId.DragonSpiritOfWhite CardId.DragonSpiritOfWhite
}); });
} }
private bool GalaxyEyesCipherDragonSummon() private bool GalaxyEyesCipherDragonSummon()
{ {
if (Duel.Turn == 1 || SoulChargeUsed) if (Duel.Turn == 1 || SoulChargeUsed)
{ {
return false; return false;
} }
List<ClientCard> monsters = Enemy.GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
if (monsters.Count == 1 && !monsters[0].IsFacedown() && ((monsters[0].IsDefense() && monsters[0].GetDefensePower() >= 3000) && monsters[0].HasType(CardType.Xyz))) if (monsters.Count == 1 && !monsters[0].IsFacedown() && ((monsters[0].IsDefense() && monsters[0].GetDefensePower() >= 3000) && monsters[0].HasType(CardType.Xyz)))
{ {
return true; return true;
} }
if (monsters.Count >= 3) if (monsters.Count >= 3)
{ {
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (!monster.IsFacedown() && ((monster.IsDefense() && monster.GetDefensePower() >= 3000) || monster.HasType(CardType.Xyz))) if (!monster.IsFacedown() && ((monster.IsDefense() && monster.GetDefensePower() >= 3000) || monster.HasType(CardType.Xyz)))
{ {
return true; return true;
} }
} }
} }
return false; return false;
} }
private bool GalaxyEyesPrimePhotonDragonSummon() private bool GalaxyEyesPrimePhotonDragonSummon()
{ {
if (Duel.Turn == 1) if (Duel.Turn == 1)
{ {
return false; return false;
} }
if (AI.Utils.IsOneEnemyBetterThanValue(2999, false)) if (AI.Utils.IsOneEnemyBetterThanValue(2999, false))
{ {
return true; return true;
} }
return false; return false;
} }
private bool GalaxyEyesFullArmorPhotonDragonSummon() private bool GalaxyEyesFullArmorPhotonDragonSummon()
{ {
if (Bot.HasInMonstersZone(CardId.GalaxyEyesCipherDragon)) if (Bot.HasInMonstersZone(CardId.GalaxyEyesCipherDragon))
{ {
foreach (ClientCard monster in Bot.GetMonsters()) foreach (ClientCard monster in Bot.GetMonsters())
{ {
if ((monster.IsDisabled() && monster.HasType(CardType.Xyz) && !monster.Equals(UsedGalaxyEyesCipherDragon)) if ((monster.IsDisabled() && monster.HasType(CardType.Xyz) && !monster.Equals(UsedGalaxyEyesCipherDragon))
|| (Duel.Phase == DuelPhase.Main2 && monster.Equals(UsedGalaxyEyesCipherDragon))) || (Duel.Phase == DuelPhase.Main2 && monster.Equals(UsedGalaxyEyesCipherDragon)))
{ {
AI.SelectCard(monster); AI.SelectCard(monster);
return true; return true;
} }
} }
} }
if (Bot.HasInMonstersZone(CardId.GalaxyEyesPrimePhotonDragon)) if (Bot.HasInMonstersZone(CardId.GalaxyEyesPrimePhotonDragon))
{ {
if (!AI.Utils.IsOneEnemyBetterThanValue(4000, false)) if (!AI.Utils.IsOneEnemyBetterThanValue(4000, false))
{ {
AI.SelectCard(CardId.GalaxyEyesPrimePhotonDragon); AI.SelectCard(CardId.GalaxyEyesPrimePhotonDragon);
return true; return true;
} }
} }
return false; return false;
} }
private bool GalaxyEyesCipherBladeDragonSummon() private bool GalaxyEyesCipherBladeDragonSummon()
{ {
if (Bot.HasInMonstersZone(CardId.GalaxyEyesFullArmorPhotonDragon) && AI.Utils.GetProblematicEnemyCard() != null) if (Bot.HasInMonstersZone(CardId.GalaxyEyesFullArmorPhotonDragon) && AI.Utils.GetProblematicEnemyCard() != null)
{ {
AI.SelectCard(CardId.GalaxyEyesFullArmorPhotonDragon); AI.SelectCard(CardId.GalaxyEyesFullArmorPhotonDragon);
return true; return true;
} }
return false; return false;
} }
private bool GalaxyEyesDarkMatterDragonSummon() private bool GalaxyEyesDarkMatterDragonSummon()
{ {
if (Bot.HasInMonstersZone(CardId.GalaxyEyesFullArmorPhotonDragon)) if (Bot.HasInMonstersZone(CardId.GalaxyEyesFullArmorPhotonDragon))
{ {
AI.SelectCard(CardId.GalaxyEyesFullArmorPhotonDragon); AI.SelectCard(CardId.GalaxyEyesFullArmorPhotonDragon);
return true; return true;
} }
return false; return false;
} }
private bool GalaxyEyesPrimePhotonDragonEffect() private bool GalaxyEyesPrimePhotonDragonEffect()
{ {
return true; return true;
} }
private bool GalaxyEyesCipherDragonEffect() private bool GalaxyEyesCipherDragonEffect()
{ {
List<ClientCard> monsters = Enemy.GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.HasType(CardType.Xyz)) if (monster.HasType(CardType.Xyz))
{ {
AI.SelectCard(monster); AI.SelectCard(monster);
UsedGalaxyEyesCipherDragon = Card; UsedGalaxyEyesCipherDragon = Card;
return true; return true;
} }
} }
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.IsDefense()) if (monster.IsDefense())
{ {
AI.SelectCard(monster); AI.SelectCard(monster);
UsedGalaxyEyesCipherDragon = Card; UsedGalaxyEyesCipherDragon = Card;
return true; return true;
} }
} }
UsedGalaxyEyesCipherDragon = Card; UsedGalaxyEyesCipherDragon = Card;
return true; return true;
} }
private bool GalaxyEyesFullArmorPhotonDragonEffect() private bool GalaxyEyesFullArmorPhotonDragonEffect()
{ {
ClientCard target = AI.Utils.GetProblematicEnemySpell(); ClientCard target = AI.Utils.GetProblematicEnemySpell();
if (target != null) if (target != null)
{ {
AI.SelectCard(target); AI.SelectCard(target);
return true; return true;
} }
target = AI.Utils.GetProblematicEnemyMonster(); target = AI.Utils.GetProblematicEnemyMonster();
if (target != null) if (target != null)
{ {
AI.SelectCard(target); AI.SelectCard(target);
return true; return true;
} }
foreach (ClientCard spell in Enemy.GetSpells()) foreach (ClientCard spell in Enemy.GetSpells())
{ {
if (spell.IsFaceup()) if (spell.IsFaceup())
{ {
AI.SelectCard(spell); AI.SelectCard(spell);
return true; return true;
} }
} }
List<ClientCard> monsters = Enemy.GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
if (monsters.Count >= 2) if (monsters.Count >= 2)
{ {
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.IsDefense()) if (monster.IsDefense())
{ {
AI.SelectCard(monster); AI.SelectCard(monster);
return true; return true;
} }
} }
return true; return true;
} }
if (monsters.Count == 2) if (monsters.Count == 2)
{ {
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.IsMonsterInvincible() || monster.IsMonsterDangerous() || monster.GetDefensePower() > 4000) if (monster.IsMonsterInvincible() || monster.IsMonsterDangerous() || monster.GetDefensePower() > 4000)
{ {
AI.SelectCard(monster); AI.SelectCard(monster);
return true; return true;
} }
} }
} }
if (monsters.Count == 1) if (monsters.Count == 1)
{ {
return true; return true;
} }
return false; return false;
} }
private bool GalaxyEyesCipherBladeDragonEffect() private bool GalaxyEyesCipherBladeDragonEffect()
{ {
if (Card.Location == CardLocation.Grave) if (Card.Location == CardLocation.Grave)
{ {
return true; return true;
} }
ClientCard target = AI.Utils.GetProblematicEnemyCard(); ClientCard target = AI.Utils.GetProblematicEnemyCard();
if (target != null) if (target != null)
{ {
AI.SelectCard(target); AI.SelectCard(target);
return true; return true;
} }
List<ClientCard> monsters = Enemy.GetMonsters(); List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.IsDefense()) if (monster.IsDefense())
{ {
AI.SelectCard(monster); AI.SelectCard(monster);
return true; return true;
} }
} }
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
AI.SelectCard(monster); AI.SelectCard(monster);
return true; return true;
} }
List<ClientCard> spells = Enemy.GetSpells(); List<ClientCard> spells = Enemy.GetSpells();
foreach (ClientCard spell in spells) foreach (ClientCard spell in spells)
{ {
if (spell.IsFacedown()) if (spell.IsFacedown())
{ {
AI.SelectCard(spell); AI.SelectCard(spell);
return true; return true;
} }
} }
foreach (ClientCard spell in spells) foreach (ClientCard spell in spells)
{ {
AI.SelectCard(spell); AI.SelectCard(spell);
return true; return true;
} }
return false; return false;
} }
private bool GalaxyEyesDarkMatterDragonEffect() private bool GalaxyEyesDarkMatterDragonEffect()
{ {
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.WhiteStoneOfAncients, CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend, CardId.WhiteStoneOfLegend,
CardId.DragonSpiritOfWhite, CardId.DragonSpiritOfWhite,
CardId.WhiteDragon CardId.WhiteDragon
}); });
AI.SelectNextCard(new[] AI.SelectNextCard(new[]
{ {
CardId.WhiteStoneOfAncients, CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend, CardId.WhiteStoneOfLegend,
CardId.DragonSpiritOfWhite, CardId.DragonSpiritOfWhite,
CardId.WhiteDragon CardId.WhiteDragon
}); });
return true; return true;
} }
private bool GiganticastleSummon() private bool GiganticastleSummon()
{ {
if (Duel.Phase != DuelPhase.Main1 || Duel.Turn == 1 || SoulChargeUsed) if (Duel.Phase != DuelPhase.Main1 || Duel.Turn == 1 || SoulChargeUsed)
return false; return false;
int bestSelfAttack = AI.Utils.GetBestAttack(Bot); int bestSelfAttack = AI.Utils.GetBestAttack(Bot);
int bestEnemyAttack = AI.Utils.GetBestPower(Enemy); int bestEnemyAttack = AI.Utils.GetBestPower(Enemy);
return bestSelfAttack <= bestEnemyAttack && bestEnemyAttack > 2500 && bestEnemyAttack <= 3100; return bestSelfAttack <= bestEnemyAttack && bestEnemyAttack > 2500 && bestEnemyAttack <= 3100;
} }
private bool BlueEyesSpiritDragonSummon() private bool BlueEyesSpiritDragonSummon()
{ {
if (Duel.Phase == DuelPhase.Main1) if (Duel.Phase == DuelPhase.Main1)
{ {
if (UsedAlternativeWhiteDragon.Count > 0) if (UsedAlternativeWhiteDragon.Count > 0)
{ {
return true; return true;
} }
if (Duel.Turn == 1 || SoulChargeUsed) if (Duel.Turn == 1 || SoulChargeUsed)
{ {
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
return true; return true;
} }
} }
if (Duel.Phase == DuelPhase.Main2) if (Duel.Phase == DuelPhase.Main2)
{ {
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
return true; return true;
} }
return false; return false;
} }
private bool HopeHarbingerDragonTitanicGalaxySummon() private bool HopeHarbingerDragonTitanicGalaxySummon()
{ {
if (Duel.Phase == DuelPhase.Main1) if (Duel.Phase == DuelPhase.Main1)
{ {
if (UsedAlternativeWhiteDragon.Count > 0) if (UsedAlternativeWhiteDragon.Count > 0)
{ {
return true; return true;
} }
if (Duel.Turn == 1 || SoulChargeUsed) if (Duel.Turn == 1 || SoulChargeUsed)
{ {
return true; return true;
} }
} }
if (Duel.Phase == DuelPhase.Main2) if (Duel.Phase == DuelPhase.Main2)
{ {
return true; return true;
} }
return false; return false;
} }
private bool SylvanPrincesspriteSummon() private bool SylvanPrincesspriteSummon()
{ {
if (Duel.Turn == 1) if (Duel.Turn == 1)
{ {
return true; return true;
} }
if (Duel.Phase == DuelPhase.Main1 && !Bot.HasInMonstersZone(new[] if (Duel.Phase == DuelPhase.Main1 && !Bot.HasInMonstersZone(new[]
{ {
CardId.AlternativeWhiteDragon, CardId.AlternativeWhiteDragon,
CardId.WhiteDragon, CardId.WhiteDragon,
CardId.DragonSpiritOfWhite CardId.DragonSpiritOfWhite
})) }))
{ {
return true; return true;
} }
if (Duel.Phase == DuelPhase.Main2 || SoulChargeUsed) if (Duel.Phase == DuelPhase.Main2 || SoulChargeUsed)
{ {
return true; return true;
} }
return false; return false;
} }
private bool SylvanPrincesspriteEffect() private bool SylvanPrincesspriteEffect()
{ {
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.WhiteStoneOfLegend, CardId.WhiteStoneOfLegend,
CardId.WhiteStoneOfAncients CardId.WhiteStoneOfAncients
}); });
return true; return true;
} }
private bool SoulChargeEffect() private bool SoulChargeEffect()
{ {
if (Bot.HasInMonstersZone(CardId.BlueEyesSpiritDragon, true)) if (Bot.HasInMonstersZone(CardId.BlueEyesSpiritDragon, true))
return false; return false;
int count = Bot.GetGraveyardMonsters().Count; int count = Bot.GetGraveyardMonsters().Count;
int space = 5 - Bot.GetMonstersInMainZone().Count; int space = 5 - Bot.GetMonstersInMainZone().Count;
if (count < space) if (count < space)
count = space; count = space;
if (count < 2 || Duel.LifePoints[0] < count*1000) if (count < 2 || Bot.LifePoints < count*1000)
return false; return false;
if (Duel.Turn != 1) if (Duel.Turn != 1)
{ {
int attack = 0; int attack = 0;
int defence = 0; int defence = 0;
foreach (ClientCard monster in Bot.GetMonsters()) foreach (ClientCard monster in Bot.GetMonsters())
{ {
if (!monster.IsDefense()) if (!monster.IsDefense())
{ {
attack += monster.Attack; attack += monster.Attack;
} }
} }
foreach (ClientCard monster in Enemy.GetMonsters()) foreach (ClientCard monster in Enemy.GetMonsters())
{ {
defence += monster.GetDefensePower(); defence += monster.GetDefensePower();
} }
if (attack - defence > Duel.LifePoints[1]) if (attack - defence > Enemy.LifePoints)
return false; return false;
} }
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.BlueEyesSpiritDragon, CardId.BlueEyesSpiritDragon,
CardId.HopeHarbingerDragonTitanicGalaxy, CardId.HopeHarbingerDragonTitanicGalaxy,
CardId.AlternativeWhiteDragon, CardId.AlternativeWhiteDragon,
CardId.WhiteDragon, CardId.WhiteDragon,
CardId.DragonSpiritOfWhite, CardId.DragonSpiritOfWhite,
CardId.AzureEyesSilverDragon, CardId.AzureEyesSilverDragon,
CardId.WhiteStoneOfAncients, CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend CardId.WhiteStoneOfLegend
}); });
SoulChargeUsed = true; SoulChargeUsed = true;
return true; return true;
} }
private bool Repos() private bool Repos()
{ {
bool enemyBetter = AI.Utils.IsAllEnemyBetter(true); bool enemyBetter = AI.Utils.IsAllEnemyBetter(true);
if (Card.IsAttack() && enemyBetter) if (Card.IsAttack() && enemyBetter)
return true; return true;
if (Card.IsFacedown()) if (Card.IsFacedown())
return true; return true;
if (Card.IsDefense() && !enemyBetter && Card.Attack >= Card.Defense) if (Card.IsDefense() && !enemyBetter && Card.Attack >= Card.Defense)
return true; return true;
if (Card.IsDefense() && ( if (Card.IsDefense() && (
Card.Id == CardId.BlueEyesSpiritDragon Card.Id == CardId.BlueEyesSpiritDragon
|| Card.Id == CardId.AzureEyesSilverDragon || Card.Id == CardId.AzureEyesSilverDragon
)) ))
return true; return true;
if (Card.IsAttack() && ( if (Card.IsAttack() && (
Card.Id == CardId.SageWithEyesOfBlue Card.Id == CardId.SageWithEyesOfBlue
|| Card.Id == CardId.WhiteStoneOfAncients || Card.Id == CardId.WhiteStoneOfAncients
|| Card.Id == CardId.WhiteStoneOfLegend || Card.Id == CardId.WhiteStoneOfLegend
)) ))
return true; return true;
return false; return false;
} }
private bool SpellSet() private bool SpellSet()
{ {
return (Card.IsTrap() || (Card.Id==CardId.SilversCry)) && Bot.GetSpellCountWithoutField() < 4; return (Card.IsTrap() || (Card.Id==CardId.SilversCry)) && Bot.GetSpellCountWithoutField() < 4;
} }
private bool HasTwoInHand(int id) private bool HasTwoInHand(int id)
{ {
int num = 0; int num = 0;
foreach (ClientCard card in Bot.Hand) foreach (ClientCard card in Bot.Hand)
{ {
if (card != null && card.Id == id) if (card != null && card.Id == id)
num++; num++;
} }
return num >= 2; return num >= 2;
} }
private bool CanDealWithUsedAlternativeWhiteDragon() private bool CanDealWithUsedAlternativeWhiteDragon()
{ {
return Bot.HasInMonstersZone(new[] return Bot.HasInMonstersZone(new[]
{ {
CardId.SageWithEyesOfBlue, CardId.SageWithEyesOfBlue,
CardId.WhiteStoneOfAncients, CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend, CardId.WhiteStoneOfLegend,
CardId.WhiteDragon, CardId.WhiteDragon,
CardId.DragonSpiritOfWhite CardId.DragonSpiritOfWhite
}) || Bot.GetCountCardInZone(Bot.MonsterZone, CardId.AlternativeWhiteDragon)>=2 ; }) || Bot.GetCountCardInZone(Bot.MonsterZone, CardId.AlternativeWhiteDragon)>=2 ;
} }
private bool HaveEnoughWhiteDragonInHand() private bool HaveEnoughWhiteDragonInHand()
{ {
return HasTwoInHand(CardId.WhiteDragon) || ( return HasTwoInHand(CardId.WhiteDragon) || (
Bot.HasInGraveyard(CardId.WhiteDragon) Bot.HasInGraveyard(CardId.WhiteDragon)
&& Bot.HasInGraveyard(CardId.WhiteStoneOfAncients) && Bot.HasInGraveyard(CardId.WhiteStoneOfAncients)
); );
} }
} }
} }
...@@ -90,7 +90,7 @@ namespace WindBot.Game.AI.Decks ...@@ -90,7 +90,7 @@ namespace WindBot.Game.AI.Decks
private bool SupremacyBerry() private bool SupremacyBerry()
{ {
return Duel.LifePoints[0] < Duel.LifePoints[1]; return Bot.LifePoints < Enemy.LifePoints;
} }
private bool PoisonOfTheOldMan() private bool PoisonOfTheOldMan()
......
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic; using System.Collections.Generic;
using WindBot; using WindBot;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
// NOT FINISHED YET // NOT FINISHED YET
[Deck("CyberDragon", "AI_CyberDragon", "NotFinished")] [Deck("CyberDragon", "AI_CyberDragon", "NotFinished")]
public class CyberDragonExecutor : DefaultExecutor public class CyberDragonExecutor : DefaultExecutor
{ {
bool PowerBondUsed = false; bool PowerBondUsed = false;
public class CardId public class CardId
{ {
public const int CyberLaserDragon = 4162088; public const int CyberLaserDragon = 4162088;
public const int CyberBarrierDragon = 68774379; public const int CyberBarrierDragon = 68774379;
public const int CyberDragon = 70095154; public const int CyberDragon = 70095154;
public const int CyberDragonDrei = 59281922; public const int CyberDragonDrei = 59281922;
public const int CyberPhoenix = 3370104; public const int CyberPhoenix = 3370104;
public const int ArmoredCybern = 67159705; public const int ArmoredCybern = 67159705;
public const int ProtoCyberDragon = 26439287; public const int ProtoCyberDragon = 26439287;
public const int CyberKirin = 76986005; public const int CyberKirin = 76986005;
public const int CyberDragonCore = 23893227; public const int CyberDragonCore = 23893227;
public const int CyberValley = 3657444; public const int CyberValley = 3657444;
public const int Raigeki = 12580477; public const int Raigeki = 12580477;
public const int DarkHole = 53129443; public const int DarkHole = 53129443;
public const int DifferentDimensionCapsule = 11961740; public const int DifferentDimensionCapsule = 11961740;
public const int Polymerization = 24094653; public const int Polymerization = 24094653;
public const int PowerBond = 37630732; public const int PowerBond = 37630732;
public const int EvolutionBurst = 52875873; public const int EvolutionBurst = 52875873;
public const int PhotonGeneratorUnit = 66607691; public const int PhotonGeneratorUnit = 66607691;
public const int DeFusion = 95286165; public const int DeFusion = 95286165;
public const int BottomlessTrapHole = 29401950; public const int BottomlessTrapHole = 29401950;
public const int MirrorForce = 44095762; public const int MirrorForce = 44095762;
public const int AttackReflectorUnit = 91989718; public const int AttackReflectorUnit = 91989718;
public const int CyberneticHiddenTechnology = 92773018; public const int CyberneticHiddenTechnology = 92773018;
public const int CallOfTheHaunted = 97077563; public const int CallOfTheHaunted = 97077563;
public const int SevenToolsOfTheBandit = 3819470; public const int SevenToolsOfTheBandit = 3819470;
public const int CyberTwinDragon = 74157028; public const int CyberTwinDragon = 74157028;
public const int CyberEndDragon = 1546123; public const int CyberEndDragon = 1546123;
public const int CyberDragonNova = 58069384; public const int CyberDragonNova = 58069384;
} }
public CyberDragonExecutor(GameAI ai, Duel duel) public CyberDragonExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
AddExecutor(ExecutorType.SpellSet, CardId.DeFusion); AddExecutor(ExecutorType.SpellSet, CardId.DeFusion);
AddExecutor(ExecutorType.Activate, CardId.DifferentDimensionCapsule, Capsule); AddExecutor(ExecutorType.Activate, CardId.DifferentDimensionCapsule, Capsule);
AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki); AddExecutor(ExecutorType.Activate, CardId.Raigeki, DefaultRaigeki);
AddExecutor(ExecutorType.Activate, CardId.Polymerization, PolymerizationEffect); AddExecutor(ExecutorType.Activate, CardId.Polymerization, PolymerizationEffect);
AddExecutor(ExecutorType.Activate, CardId.PowerBond, PowerBondEffect); AddExecutor(ExecutorType.Activate, CardId.PowerBond, PowerBondEffect);
AddExecutor(ExecutorType.Activate, CardId.EvolutionBurst, EvolutionBurstEffect); AddExecutor(ExecutorType.Activate, CardId.EvolutionBurst, EvolutionBurstEffect);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole); AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.PhotonGeneratorUnit); AddExecutor(ExecutorType.Activate, CardId.PhotonGeneratorUnit);
AddExecutor(ExecutorType.Activate, CardId.DeFusion, DeFusionEffect); AddExecutor(ExecutorType.Activate, CardId.DeFusion, DeFusionEffect);
AddExecutor(ExecutorType.Activate, CardId.BottomlessTrapHole, DefaultUniqueTrap); AddExecutor(ExecutorType.Activate, CardId.BottomlessTrapHole, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultUniqueTrap); AddExecutor(ExecutorType.Activate, CardId.MirrorForce, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.AttackReflectorUnit); AddExecutor(ExecutorType.Activate, CardId.AttackReflectorUnit);
AddExecutor(ExecutorType.Activate, CardId.SevenToolsOfTheBandit, DefaultTrap); AddExecutor(ExecutorType.Activate, CardId.SevenToolsOfTheBandit, DefaultTrap);
AddExecutor(ExecutorType.Activate, CardId.CallOfTheHaunted, DefaultCallOfTheHaunted); AddExecutor(ExecutorType.Activate, CardId.CallOfTheHaunted, DefaultCallOfTheHaunted);
AddExecutor(ExecutorType.SummonOrSet, CardId.CyberDragonDrei, NoCyberDragonSpsummon); AddExecutor(ExecutorType.SummonOrSet, CardId.CyberDragonDrei, NoCyberDragonSpsummon);
AddExecutor(ExecutorType.SummonOrSet, CardId.CyberPhoenix, NoCyberDragonSpsummon); AddExecutor(ExecutorType.SummonOrSet, CardId.CyberPhoenix, NoCyberDragonSpsummon);
AddExecutor(ExecutorType.Summon, CardId.CyberValley, NoCyberDragonSpsummon); AddExecutor(ExecutorType.Summon, CardId.CyberValley, NoCyberDragonSpsummon);
AddExecutor(ExecutorType.MonsterSet, CardId.CyberDragonCore, NoCyberDragonSpsummon); AddExecutor(ExecutorType.MonsterSet, CardId.CyberDragonCore, NoCyberDragonSpsummon);
AddExecutor(ExecutorType.MonsterSet, CardId.ArmoredCybern, ArmoredCybernSet); AddExecutor(ExecutorType.MonsterSet, CardId.ArmoredCybern, ArmoredCybernSet);
AddExecutor(ExecutorType.SummonOrSet, CardId.ProtoCyberDragon, ProtoCyberDragonSummon); AddExecutor(ExecutorType.SummonOrSet, CardId.ProtoCyberDragon, ProtoCyberDragonSummon);
AddExecutor(ExecutorType.Summon, CardId.CyberKirin, CyberKirinSummon); AddExecutor(ExecutorType.Summon, CardId.CyberKirin, CyberKirinSummon);
AddExecutor(ExecutorType.SpSummon, CardId.CyberDragon); AddExecutor(ExecutorType.SpSummon, CardId.CyberDragon);
AddExecutor(ExecutorType.SpSummon, CardId.CyberEndDragon); AddExecutor(ExecutorType.SpSummon, CardId.CyberEndDragon);
AddExecutor(ExecutorType.SpSummon, CardId.CyberTwinDragon); AddExecutor(ExecutorType.SpSummon, CardId.CyberTwinDragon);
AddExecutor(ExecutorType.SpSummon, CardId.CyberBarrierDragon); AddExecutor(ExecutorType.SpSummon, CardId.CyberBarrierDragon);
AddExecutor(ExecutorType.SpSummon, CardId.CyberLaserDragon); AddExecutor(ExecutorType.SpSummon, CardId.CyberLaserDragon);
AddExecutor(ExecutorType.Activate, CardId.CyberBarrierDragon); AddExecutor(ExecutorType.Activate, CardId.CyberBarrierDragon);
AddExecutor(ExecutorType.Activate, CardId.CyberLaserDragon); AddExecutor(ExecutorType.Activate, CardId.CyberLaserDragon);
AddExecutor(ExecutorType.Activate, CardId.CyberDragonDrei); AddExecutor(ExecutorType.Activate, CardId.CyberDragonDrei);
AddExecutor(ExecutorType.Activate, CardId.CyberPhoenix); AddExecutor(ExecutorType.Activate, CardId.CyberPhoenix);
AddExecutor(ExecutorType.Activate, CardId.CyberKirin); AddExecutor(ExecutorType.Activate, CardId.CyberKirin);
AddExecutor(ExecutorType.Activate, CardId.ArmoredCybern, ArmoredCybernEffect); AddExecutor(ExecutorType.Activate, CardId.ArmoredCybern, ArmoredCybernEffect);
AddExecutor(ExecutorType.Activate, CardId.CyberValley); AddExecutor(ExecutorType.Activate, CardId.CyberValley);
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet); AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos); AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
} }
private bool CyberDragonInHand() { return Bot.HasInHand(CardId.CyberDragon); } private bool CyberDragonInHand() { return Bot.HasInHand(CardId.CyberDragon); }
private bool CyberDragonInGraveyard() { return Bot.HasInGraveyard(CardId.CyberDragon); } private bool CyberDragonInGraveyard() { return Bot.HasInGraveyard(CardId.CyberDragon); }
private bool CyberDragonInMonsterZone() { return Bot.HasInMonstersZone(CardId.CyberDragon); } private bool CyberDragonInMonsterZone() { return Bot.HasInMonstersZone(CardId.CyberDragon); }
private bool CyberDragonIsBanished() { return Bot.HasInBanished(CardId.CyberDragon); } private bool CyberDragonIsBanished() { return Bot.HasInBanished(CardId.CyberDragon); }
private bool Capsule() private bool Capsule()
{ {
IList<int> SelectedCard = new List<int>(); IList<int> SelectedCard = new List<int>();
SelectedCard.Add(CardId.PowerBond); SelectedCard.Add(CardId.PowerBond);
SelectedCard.Add(CardId.DarkHole); SelectedCard.Add(CardId.DarkHole);
SelectedCard.Add(CardId.Raigeki); SelectedCard.Add(CardId.Raigeki);
AI.SelectCard(SelectedCard); AI.SelectCard(SelectedCard);
return true; return true;
} }
private bool PolymerizationEffect() 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) 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); AI.SelectCard(CardId.CyberEndDragon);
else else
AI.SelectCard(CardId.CyberTwinDragon); AI.SelectCard(CardId.CyberTwinDragon);
return true; return true;
} }
private bool PowerBondEffect() private bool PowerBondEffect()
{ {
PowerBondUsed = true; 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) 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); AI.SelectCard(CardId.CyberEndDragon);
else else
AI.SelectCard(CardId.CyberTwinDragon); AI.SelectCard(CardId.CyberTwinDragon);
return true; return true;
} }
private bool EvolutionBurstEffect() private bool EvolutionBurstEffect()
{ {
ClientCard bestMy = Bot.GetMonsters().GetHighestAttackMonster(); ClientCard bestMy = Bot.GetMonsters().GetHighestAttackMonster();
if (bestMy == null || !AI.Utils.IsOneEnemyBetterThanValue(bestMy.Attack, false)) if (bestMy == null || !AI.Utils.IsOneEnemyBetterThanValue(bestMy.Attack, false))
return false; return false;
else else
AI.SelectCard(Enemy.MonsterZone.GetHighestAttackMonster()); AI.SelectCard(Enemy.MonsterZone.GetHighestAttackMonster());
return true; return true;
} }
private bool NoCyberDragonSpsummon() private bool NoCyberDragonSpsummon()
{ {
if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Enemy.GetMonsterCount() != 0)) if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Enemy.GetMonsterCount() != 0))
return false; return false;
return true; return true;
} }
private bool ArmoredCybernSet() private bool ArmoredCybernSet()
{ {
if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Enemy.GetMonsterCount() != 0) || (Bot.HasInHand(CardId.CyberDragonDrei) || Bot.HasInHand(CardId.CyberPhoenix)) && !AI.Utils.IsOneEnemyBetterThanValue(1800,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 false;
return true; return true;
} }
private bool ProtoCyberDragonSummon() 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)) 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; return true;
if (CyberDragonInHand() && (Bot.GetMonsterCount() == 0 && Enemy.GetMonsterCount() != 0) || (Bot.HasInHand(CardId.CyberDragonDrei) || Bot.HasInHand(CardId.CyberPhoenix)) && !AI.Utils.IsOneEnemyBetterThanValue(1800, 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 false;
return true; return true;
} }
private bool CyberKirinSummon() private bool CyberKirinSummon()
{ {
return PowerBondUsed; return PowerBondUsed;
} }
private bool ArmoredCybernEffect() private bool ArmoredCybernEffect()
{ {
if (Card.Location == CardLocation.Hand) if (Card.Location == CardLocation.Hand)
return true; return true;
else if (Card.Location == CardLocation.SpellZone) else if (Card.Location == CardLocation.SpellZone)
{ {
if (AI.Utils.IsOneEnemyBetterThanValue(Bot.GetMonsters().GetHighestAttackMonster().Attack, true)) if (AI.Utils.IsOneEnemyBetterThanValue(Bot.GetMonsters().GetHighestAttackMonster().Attack, true))
if (ActivateDescription == AI.Utils.GetStringId(CardId.ArmoredCybern, 2)) if (ActivateDescription == AI.Utils.GetStringId(CardId.ArmoredCybern, 2))
return true; return true;
return false; return false;
} }
return false; return false;
} }
private bool DeFusionEffect() private bool DeFusionEffect()
{ {
if (Duel.Phase == DuelPhase.Battle) if (Duel.Phase == DuelPhase.Battle)
{ {
if (!Bot.HasAttackingMonster()) if (!Bot.HasAttackingMonster())
return true; return true;
} }
return false; return false;
} }
} }
} }
\ No newline at end of file
...@@ -399,7 +399,7 @@ namespace WindBot.Game.AI.Decks ...@@ -399,7 +399,7 @@ namespace WindBot.Game.AI.Decks
private bool CrystalWingSynchroDragonEffect() private bool CrystalWingSynchroDragonEffect()
{ {
return LastChainPlayer != 0; return Duel.LastChainPlayer != 0;
} }
private bool DragunityPhalanxSummon() private bool DragunityPhalanxSummon()
......
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic; using System.Collections.Generic;
using WindBot; using WindBot;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
// NOT FINISHED YET // NOT FINISHED YET
[Deck("Evilswarm", "AI_Evilswarm", "NotFinished")] [Deck("Evilswarm", "AI_Evilswarm", "NotFinished")]
public class EvilswarmExecutor : DefaultExecutor public class EvilswarmExecutor : DefaultExecutor
{ {
public class CardId public class CardId
{ {
public const int DarkHole = 53129443; public const int DarkHole = 53129443;
public const int CosmicCyclone = 8267140; public const int CosmicCyclone = 8267140;
public const int InfestationPandemic = 27541267; public const int InfestationPandemic = 27541267;
public const int SolemnJudgment = 41420027; public const int SolemnJudgment = 41420027;
public const int SolemnWarning = 84749824; public const int SolemnWarning = 84749824;
public const int SolemnStrike = 40605147; public const int SolemnStrike = 40605147;
} }
public EvilswarmExecutor(GameAI ai, Duel duel) public EvilswarmExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole); AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.CosmicCyclone, DefaultCosmicCyclone); AddExecutor(ExecutorType.Activate, CardId.CosmicCyclone, DefaultCosmicCyclone);
AddExecutor(ExecutorType.Activate, CardId.SolemnJudgment, DefaultSolemnJudgment); AddExecutor(ExecutorType.Activate, CardId.SolemnJudgment, DefaultSolemnJudgment);
AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning); AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike); AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.SpellSet, CardId.InfestationPandemic); AddExecutor(ExecutorType.SpellSet, CardId.InfestationPandemic);
AddExecutor(ExecutorType.Activate, DefaultDontChainMyself); AddExecutor(ExecutorType.Activate, DefaultDontChainMyself);
AddExecutor(ExecutorType.Summon); AddExecutor(ExecutorType.Summon);
AddExecutor(ExecutorType.SpSummon); AddExecutor(ExecutorType.SpSummon);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos); AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.SpellSet); AddExecutor(ExecutorType.SpellSet);
} }
// will be added soon...? // will be added soon...?
} }
} }
\ No newline at end of file
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic; using System.Collections.Generic;
using WindBot; using WindBot;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
// NOT FINISHED YET // NOT FINISHED YET
[Deck("Gravekeeper", "AI_Gravekeeper", "NotFinished")] [Deck("Gravekeeper", "AI_Gravekeeper", "NotFinished")]
public class GravekeeperExecutor : DefaultExecutor public class GravekeeperExecutor : DefaultExecutor
{ {
public class CardId public class CardId
{ {
public const int GravekeepersOracle = 25524823; public const int GravekeepersOracle = 25524823;
public const int MaleficStardustDragon = 36521459; public const int MaleficStardustDragon = 36521459;
public const int GravekeepersVisionary = 3825890; public const int GravekeepersVisionary = 3825890;
public const int GravekeepersChief = 62473983; public const int GravekeepersChief = 62473983;
public const int ThunderKingRaiOh = 71564252; public const int ThunderKingRaiOh = 71564252;
public const int GravekeepersCommandant = 17393207; public const int GravekeepersCommandant = 17393207;
public const int GravekeepersAssailant = 25262697; public const int GravekeepersAssailant = 25262697;
public const int GravekeepersDescendant = 30213599; public const int GravekeepersDescendant = 30213599;
public const int GravekeepersSpy = 24317029; public const int GravekeepersSpy = 24317029;
public const int GravekeepersRecruiter = 93023479; public const int GravekeepersRecruiter = 93023479;
public const int AllureOfDarkness = 1475311; public const int AllureOfDarkness = 1475311;
public const int DarkHole = 53129443; public const int DarkHole = 53129443;
public const int RoyalTribute = 72405967; public const int RoyalTribute = 72405967;
public const int GravekeepersStele = 99523325; public const int GravekeepersStele = 99523325;
public const int MysticalSpaceTyphoon = 5318639; public const int MysticalSpaceTyphoon = 5318639;
public const int BookofMoon = 14087893; public const int BookofMoon = 14087893;
public const int HiddenTemplesOfNecrovalley = 70000776; public const int HiddenTemplesOfNecrovalley = 70000776;
public const int Necrovalley = 47355498; public const int Necrovalley = 47355498;
public const int BottomlessTrapHole = 29401950; public const int BottomlessTrapHole = 29401950;
public const int RiteOfSpirit = 30450531; public const int RiteOfSpirit = 30450531;
public const int TorrentialTribute = 53582587; public const int TorrentialTribute = 53582587;
public const int DimensionalPrison = 70342110; public const int DimensionalPrison = 70342110;
public const int SolemnWarning = 84749824; public const int SolemnWarning = 84749824;
public const int ImperialTombsOfNecrovalley = 90434657; public const int ImperialTombsOfNecrovalley = 90434657;
} }
public GravekeeperExecutor(GameAI ai, Duel duel) public GravekeeperExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet); AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Activate, CardId.AllureOfDarkness); AddExecutor(ExecutorType.Activate, CardId.AllureOfDarkness);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole); AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.RoyalTribute); AddExecutor(ExecutorType.Activate, CardId.RoyalTribute);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersStele); AddExecutor(ExecutorType.Activate, CardId.GravekeepersStele);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon); AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.BookofMoon, DefaultBookOfMoon); AddExecutor(ExecutorType.Activate, CardId.BookofMoon, DefaultBookOfMoon);
AddExecutor(ExecutorType.Activate, CardId.HiddenTemplesOfNecrovalley, HiddenTemplesOfNecrovalleyEffect); AddExecutor(ExecutorType.Activate, CardId.HiddenTemplesOfNecrovalley, HiddenTemplesOfNecrovalleyEffect);
AddExecutor(ExecutorType.Activate, CardId.Necrovalley, NecrovalleyActivate); AddExecutor(ExecutorType.Activate, CardId.Necrovalley, NecrovalleyActivate);
AddExecutor(ExecutorType.Activate, CardId.BottomlessTrapHole, DefaultUniqueTrap); AddExecutor(ExecutorType.Activate, CardId.BottomlessTrapHole, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning); AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, CardId.DimensionalPrison, DefaultUniqueTrap); AddExecutor(ExecutorType.Activate, CardId.DimensionalPrison, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.RiteOfSpirit, DefaultUniqueTrap); AddExecutor(ExecutorType.Activate, CardId.RiteOfSpirit, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.ImperialTombsOfNecrovalley, DefaultUniqueTrap); AddExecutor(ExecutorType.Activate, CardId.ImperialTombsOfNecrovalley, DefaultUniqueTrap);
AddExecutor(ExecutorType.Activate, CardId.TorrentialTribute, DefaultTorrentialTribute); AddExecutor(ExecutorType.Activate, CardId.TorrentialTribute, DefaultTorrentialTribute);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersOracle); AddExecutor(ExecutorType.Summon, CardId.GravekeepersOracle);
AddExecutor(ExecutorType.SpSummon, CardId.MaleficStardustDragon, MaleficStardustDragonSummon); AddExecutor(ExecutorType.SpSummon, CardId.MaleficStardustDragon, MaleficStardustDragonSummon);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersVisionary); AddExecutor(ExecutorType.Summon, CardId.GravekeepersVisionary);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersChief); AddExecutor(ExecutorType.Summon, CardId.GravekeepersChief);
AddExecutor(ExecutorType.Summon, CardId.ThunderKingRaiOh); AddExecutor(ExecutorType.Summon, CardId.ThunderKingRaiOh);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersCommandant, GravekeepersCommandantSummon); AddExecutor(ExecutorType.Summon, CardId.GravekeepersCommandant, GravekeepersCommandantSummon);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersAssailant); AddExecutor(ExecutorType.Summon, CardId.GravekeepersAssailant);
AddExecutor(ExecutorType.Summon, CardId.GravekeepersDescendant); AddExecutor(ExecutorType.Summon, CardId.GravekeepersDescendant);
AddExecutor(ExecutorType.MonsterSet, CardId.GravekeepersSpy); AddExecutor(ExecutorType.MonsterSet, CardId.GravekeepersSpy);
AddExecutor(ExecutorType.MonsterSet, CardId.GravekeepersRecruiter); AddExecutor(ExecutorType.MonsterSet, CardId.GravekeepersRecruiter);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersOracle); AddExecutor(ExecutorType.Activate, CardId.GravekeepersOracle);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersVisionary); AddExecutor(ExecutorType.Activate, CardId.GravekeepersVisionary);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersChief); AddExecutor(ExecutorType.Activate, CardId.GravekeepersChief);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersCommandant, GravekeepersCommandantEffect); AddExecutor(ExecutorType.Activate, CardId.GravekeepersCommandant, GravekeepersCommandantEffect);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersAssailant, GravekeepersAssailantEffect); AddExecutor(ExecutorType.Activate, CardId.GravekeepersAssailant, GravekeepersAssailantEffect);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersDescendant, GravekeepersDescendantEffect); AddExecutor(ExecutorType.Activate, CardId.GravekeepersDescendant, GravekeepersDescendantEffect);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersSpy, SearchForDescendant); AddExecutor(ExecutorType.Activate, CardId.GravekeepersSpy, SearchForDescendant);
AddExecutor(ExecutorType.Activate, CardId.GravekeepersRecruiter, SearchForDescendant); AddExecutor(ExecutorType.Activate, CardId.GravekeepersRecruiter, SearchForDescendant);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos); AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
} }
private bool HiddenTemplesOfNecrovalleyEffect() private bool HiddenTemplesOfNecrovalleyEffect()
{ {
if (Card.Location == CardLocation.Hand && Bot.HasInSpellZone((int)Card.Id)) if (Card.Location == CardLocation.Hand && Bot.HasInSpellZone((int)Card.Id))
return false; return false;
return true; return true;
} }
private bool NecrovalleyActivate() private bool NecrovalleyActivate()
{ {
if (Bot.SpellZone[5] != null) if (Bot.SpellZone[5] != null)
return false; return false;
return true; return true;
} }
private bool MaleficStardustDragonSummon() private bool MaleficStardustDragonSummon()
{ {
if (Bot.SpellZone[5] != null) if (Bot.SpellZone[5] != null)
return true; return true;
return false; return false;
} }
private bool GravekeepersCommandantEffect() private bool GravekeepersCommandantEffect()
{ {
if (!Bot.HasInHand(CardId.Necrovalley) && !Bot.HasInSpellZone(CardId.Necrovalley)) if (!Bot.HasInHand(CardId.Necrovalley) && !Bot.HasInSpellZone(CardId.Necrovalley))
return true; return true;
return false; return false;
} }
private bool GravekeepersCommandantSummon() private bool GravekeepersCommandantSummon()
{ {
return !GravekeepersCommandantEffect(); return !GravekeepersCommandantEffect();
} }
private bool GravekeepersAssailantEffect() private bool GravekeepersAssailantEffect()
{ {
if (!Card.IsAttack()) if (!Card.IsAttack())
return false; return false;
foreach (ClientCard card in Enemy.GetMonsters()) foreach (ClientCard card in Enemy.GetMonsters())
{ {
if (card.IsDefense() && card.Defense > 1500 && card.Attack < 1500 || card.Attack > 1500 && card.Defense < 1500) if (card.IsDefense() && card.Defense > 1500 && card.Attack < 1500 || card.Attack > 1500 && card.Defense < 1500)
return true; return true;
} }
return false; return false;
} }
private bool GravekeepersDescendantEffect() private bool GravekeepersDescendantEffect()
{ {
int bestatk = Bot.GetMonsters().GetHighestAttackMonster().Attack; int bestatk = Bot.GetMonsters().GetHighestAttackMonster().Attack;
if (AI.Utils.IsOneEnemyBetterThanValue(bestatk, true)) if (AI.Utils.IsOneEnemyBetterThanValue(bestatk, true))
{ {
AI.SelectCard(Enemy.GetMonsters().GetHighestAttackMonster()); AI.SelectCard(Enemy.GetMonsters().GetHighestAttackMonster());
return true; return true;
} }
return false; return false;
} }
private bool SearchForDescendant() private bool SearchForDescendant()
{ {
AI.SelectCard(CardId.GravekeepersDescendant); AI.SelectCard(CardId.GravekeepersDescendant);
return true; return true;
} }
} }
} }
\ No newline at end of file
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic; using System.Collections.Generic;
using WindBot; using WindBot;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
// NOT FINISHED YET // NOT FINISHED YET
[Deck("Graydle", "AI_Graydle", "NotFinished")] [Deck("Graydle", "AI_Graydle", "NotFinished")]
public class GraydleExecutor : DefaultExecutor public class GraydleExecutor : DefaultExecutor
{ {
public class CardId public class CardId
{ {
public const int DarkHole = 53129443; public const int DarkHole = 53129443;
public const int CosmicCyclone = 8267140; public const int CosmicCyclone = 8267140;
public const int SolemnJudgment = 41420027; public const int SolemnJudgment = 41420027;
public const int SolemnWarning = 84749824; public const int SolemnWarning = 84749824;
public const int SolemnStrike = 40605147; public const int SolemnStrike = 40605147;
} }
public GraydleExecutor(GameAI ai, Duel duel) public GraydleExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole); AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.CosmicCyclone, DefaultCosmicCyclone); AddExecutor(ExecutorType.Activate, CardId.CosmicCyclone, DefaultCosmicCyclone);
AddExecutor(ExecutorType.Activate, CardId.SolemnJudgment, DefaultSolemnJudgment); AddExecutor(ExecutorType.Activate, CardId.SolemnJudgment, DefaultSolemnJudgment);
AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning); AddExecutor(ExecutorType.Activate, CardId.SolemnWarning, DefaultSolemnWarning);
AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike); AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
AddExecutor(ExecutorType.Activate, DefaultDontChainMyself); AddExecutor(ExecutorType.Activate, DefaultDontChainMyself);
AddExecutor(ExecutorType.MonsterSet); AddExecutor(ExecutorType.MonsterSet);
AddExecutor(ExecutorType.SpSummon); AddExecutor(ExecutorType.SpSummon);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos); AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.SpellSet); AddExecutor(ExecutorType.SpellSet);
} }
// will be added soon...? // will be added soon...?
} }
} }
\ No newline at end of file
...@@ -162,7 +162,7 @@ namespace WindBot.Game.AI.Decks ...@@ -162,7 +162,7 @@ namespace WindBot.Game.AI.Decks
private bool HorusTheBlackFlameDragonLv8() private bool HorusTheBlackFlameDragonLv8()
{ {
return LastChainPlayer == 1; return Duel.LastChainPlayer == 1;
} }
private bool DragonsRebirth() private bool DragonsRebirth()
......
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic; using System.Collections.Generic;
using WindBot; using WindBot;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
// NOT FINISHED YET // NOT FINISHED YET
[Deck("Lightsworn", "AI_Lightsworn", "NotFinished")] [Deck("Lightsworn", "AI_Lightsworn", "NotFinished")]
public class LightswornExecutor : DefaultExecutor public class LightswornExecutor : DefaultExecutor
{ {
public class CardId public class CardId
{ {
public const int JudgmentDragon = 57774843; public const int JudgmentDragon = 57774843;
public const int Wulf = 58996430; public const int Wulf = 58996430;
public const int Garoth = 59019082; public const int Garoth = 59019082;
public const int Raiden = 77558536; public const int Raiden = 77558536;
public const int Lyla = 22624373; public const int Lyla = 22624373;
public const int Felis = 73176465; public const int Felis = 73176465;
public const int Lumina = 95503687; public const int Lumina = 95503687;
public const int Minerva = 40164421; public const int Minerva = 40164421;
public const int Ryko = 21502796; public const int Ryko = 21502796;
public const int PerformageTrickClown = 67696066; public const int PerformageTrickClown = 67696066;
public const int Goblindbergh = 25259669; public const int Goblindbergh = 25259669;
public const int ThousandBlades = 1833916; public const int ThousandBlades = 1833916;
public const int Honest = 37742478; public const int Honest = 37742478;
public const int GlowUpBulb = 67441435; public const int GlowUpBulb = 67441435;
public const int SolarRecharge = 691925; public const int SolarRecharge = 691925;
public const int GalaxyCyclone = 5133471; public const int GalaxyCyclone = 5133471;
public const int HarpiesFeatherDuster = 18144506; public const int HarpiesFeatherDuster = 18144506;
public const int ReinforcementOfTheArmy = 32807846; public const int ReinforcementOfTheArmy = 32807846;
public const int MetalfoesFusion = 73594093; public const int MetalfoesFusion = 73594093;
public const int ChargeOfTheLightBrigade = 94886282; public const int ChargeOfTheLightBrigade = 94886282;
public const int Michael = 4779823; public const int Michael = 4779823;
public const int MinervaTheExalted = 30100551; public const int MinervaTheExalted = 30100551;
public const int TrishulaDragonOfTheIceBarrier = 52687916; public const int TrishulaDragonOfTheIceBarrier = 52687916;
public const int ScarlightRedDragonArchfiend = 80666118; public const int ScarlightRedDragonArchfiend = 80666118;
public const int PSYFramelordOmega = 74586817; public const int PSYFramelordOmega = 74586817;
public const int PSYFramelordZeta = 37192109; public const int PSYFramelordZeta = 37192109;
public const int NumberS39UtopiatheLightning = 56832966; public const int NumberS39UtopiatheLightning = 56832966;
public const int Number39Utopia = 84013237; public const int Number39Utopia = 84013237;
public const int CastelTheSkyblasterMusketeer = 82633039; public const int CastelTheSkyblasterMusketeer = 82633039;
public const int EvilswarmExcitonKnight = 46772449; public const int EvilswarmExcitonKnight = 46772449;
public const int DanteTravelerOfTheBurningAbyss = 83531441; public const int DanteTravelerOfTheBurningAbyss = 83531441;
public const int DecodeTalker = 1861629; public const int DecodeTalker = 1861629;
public const int MissusRadiant = 3987233; public const int MissusRadiant = 3987233;
} }
bool ClownUsed = false; bool ClownUsed = false;
public LightswornExecutor(GameAI ai, Duel duel) public LightswornExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst); AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, CardId.GalaxyCyclone, DefaultGalaxyCyclone); AddExecutor(ExecutorType.Activate, CardId.GalaxyCyclone, DefaultGalaxyCyclone);
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster); AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, CardId.MetalfoesFusion); AddExecutor(ExecutorType.Activate, CardId.MetalfoesFusion);
AddExecutor(ExecutorType.Activate, CardId.GlowUpBulb); AddExecutor(ExecutorType.Activate, CardId.GlowUpBulb);
AddExecutor(ExecutorType.Activate, CardId.JudgmentDragon, DefaultDarkHole); AddExecutor(ExecutorType.Activate, CardId.JudgmentDragon, DefaultDarkHole);
AddExecutor(ExecutorType.SpSummon, CardId.JudgmentDragon); AddExecutor(ExecutorType.SpSummon, CardId.JudgmentDragon);
AddExecutor(ExecutorType.Activate, CardId.ReinforcementOfTheArmy, ReinforcementOfTheArmyEffect); AddExecutor(ExecutorType.Activate, CardId.ReinforcementOfTheArmy, ReinforcementOfTheArmyEffect);
AddExecutor(ExecutorType.Activate, CardId.ChargeOfTheLightBrigade, ChargeOfTheLightBrigadeEffect); AddExecutor(ExecutorType.Activate, CardId.ChargeOfTheLightBrigade, ChargeOfTheLightBrigadeEffect);
AddExecutor(ExecutorType.Activate, CardId.SolarRecharge, SolarRechargeEffect); AddExecutor(ExecutorType.Activate, CardId.SolarRecharge, SolarRechargeEffect);
AddExecutor(ExecutorType.Summon, CardId.Goblindbergh, GoblindberghSummon); AddExecutor(ExecutorType.Summon, CardId.Goblindbergh, GoblindberghSummon);
AddExecutor(ExecutorType.Activate, CardId.Goblindbergh, GoblindberghEffect); AddExecutor(ExecutorType.Activate, CardId.Goblindbergh, GoblindberghEffect);
AddExecutor(ExecutorType.SpSummon, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightSummon); AddExecutor(ExecutorType.SpSummon, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightSummon);
AddExecutor(ExecutorType.Activate, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightEffect); AddExecutor(ExecutorType.Activate, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightEffect);
AddExecutor(ExecutorType.SpSummon, CardId.CastelTheSkyblasterMusketeer, DefaultCastelTheSkyblasterMusketeerSummon); AddExecutor(ExecutorType.SpSummon, CardId.CastelTheSkyblasterMusketeer, DefaultCastelTheSkyblasterMusketeerSummon);
AddExecutor(ExecutorType.Activate, CardId.CastelTheSkyblasterMusketeer, DefaultCastelTheSkyblasterMusketeerEffect); AddExecutor(ExecutorType.Activate, CardId.CastelTheSkyblasterMusketeer, DefaultCastelTheSkyblasterMusketeerEffect);
AddExecutor(ExecutorType.SpSummon, CardId.ScarlightRedDragonArchfiend, DefaultScarlightRedDragonArchfiendSummon); AddExecutor(ExecutorType.SpSummon, CardId.ScarlightRedDragonArchfiend, DefaultScarlightRedDragonArchfiendSummon);
AddExecutor(ExecutorType.Activate, CardId.ScarlightRedDragonArchfiend, DefaultScarlightRedDragonArchfiendEffect); AddExecutor(ExecutorType.Activate, CardId.ScarlightRedDragonArchfiend, DefaultScarlightRedDragonArchfiendEffect);
AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon); AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning); AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning); AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning, DefaultNumberS39UtopiaTheLightningEffect);
AddExecutor(ExecutorType.Activate, CardId.PerformageTrickClown, PerformageTrickClownEffect); AddExecutor(ExecutorType.Activate, CardId.PerformageTrickClown, PerformageTrickClownEffect);
AddExecutor(ExecutorType.Activate, CardId.ThousandBlades); AddExecutor(ExecutorType.Activate, CardId.ThousandBlades);
AddExecutor(ExecutorType.Activate, CardId.Honest, HonestEffect); AddExecutor(ExecutorType.Activate, CardId.Honest, DefaultHonestEffect);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos); AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
} }
public override void OnNewTurn() public override void OnNewTurn()
{ {
ClownUsed = false; ClownUsed = false;
} }
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender) public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{ {
if (!defender.IsMonsterHasPreventActivationEffectInBattle()) if (!defender.IsMonsterHasPreventActivationEffectInBattle())
{ {
if (attacker.Attribute == (int)CardAttribute.Light && Bot.HasInHand(CardId.Honest)) if (attacker.Attribute == (int)CardAttribute.Light && Bot.HasInHand(CardId.Honest))
attacker.RealPower = attacker.RealPower + defender.Attack; attacker.RealPower = attacker.RealPower + defender.Attack;
} }
return base.OnPreBattleBetween(attacker, defender); return base.OnPreBattleBetween(attacker, defender);
} }
public override IList<ClientCard> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max) public override IList<ClientCard> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max)
{ {
Logger.DebugWriteLine("OnSelectXyzMaterial " + cards.Count + " " + min + " " + max); Logger.DebugWriteLine("OnSelectXyzMaterial " + cards.Count + " " + min + " " + max);
IList<ClientCard> result = new List<ClientCard>(); IList<ClientCard> result = new List<ClientCard>();
foreach (ClientCard card in cards) foreach (ClientCard card in cards)
{ {
if (!result.Contains(card) && (!ClownUsed || card.Id != CardId.PerformageTrickClown)) if (!result.Contains(card) && (!ClownUsed || card.Id != CardId.PerformageTrickClown))
result.Add(card); result.Add(card);
if (result.Count >= max) if (result.Count >= max)
break; break;
} }
AI.Utils.CheckSelectCount(result, cards, min, max); AI.Utils.CheckSelectCount(result, cards, min, max);
return result; return result;
} }
private bool ReinforcementOfTheArmyEffect() private bool ReinforcementOfTheArmyEffect()
{ {
if (!Bot.HasInHand(CardId.Raiden)) if (!Bot.HasInHand(CardId.Raiden))
{ {
AI.SelectCard(CardId.Raiden); AI.SelectCard(CardId.Raiden);
return true; return true;
} }
else if (!Bot.HasInHand(CardId.Goblindbergh)) else if (!Bot.HasInHand(CardId.Goblindbergh))
{ {
AI.SelectCard(CardId.Goblindbergh); AI.SelectCard(CardId.Goblindbergh);
return true; return true;
} }
return false; return false;
} }
private bool ChargeOfTheLightBrigadeEffect() private bool ChargeOfTheLightBrigadeEffect()
{ {
if (!Bot.HasInHand(CardId.Lumina)) if (!Bot.HasInHand(CardId.Lumina))
AI.SelectCard(CardId.Lumina); AI.SelectCard(CardId.Lumina);
else else
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.Raiden, CardId.Raiden,
CardId.Lumina, CardId.Lumina,
CardId.Minerva, CardId.Minerva,
CardId.Lyla CardId.Lyla
}); });
return true; return true;
} }
private bool SolarRechargeEffect() private bool SolarRechargeEffect()
{ {
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.Wulf, CardId.Wulf,
CardId.Felis, CardId.Felis,
CardId.Minerva, CardId.Minerva,
CardId.Lyla, CardId.Lyla,
CardId.Raiden CardId.Raiden
}); });
return true; return true;
} }
private bool GoblindberghSummon() private bool GoblindberghSummon()
{ {
foreach (ClientCard card in Bot.Hand.GetMonsters()) foreach (ClientCard card in Bot.Hand.GetMonsters())
{ {
if (!card.Equals(Card) && card.Level == 4) if (!card.Equals(Card) && card.Level == 4)
return true; return true;
} }
return false; return false;
} }
private bool GoblindberghEffect() private bool GoblindberghEffect()
{ {
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.Felis, CardId.Felis,
CardId.Wulf, CardId.Wulf,
CardId.Raiden, CardId.Raiden,
CardId.PerformageTrickClown, CardId.PerformageTrickClown,
CardId.ThousandBlades CardId.ThousandBlades
}); });
return true; return true;
} }
private bool LuminaEffect() private bool LuminaEffect()
{ {
if (!Bot.HasInGraveyard(CardId.Raiden) && Bot.HasInHand(CardId.Raiden)) if (!Bot.HasInGraveyard(CardId.Raiden) && Bot.HasInHand(CardId.Raiden))
{ {
AI.SelectCard(CardId.Raiden); AI.SelectCard(CardId.Raiden);
} }
else if (!ClownUsed && Bot.HasInHand(CardId.PerformageTrickClown)) else if (!ClownUsed && Bot.HasInHand(CardId.PerformageTrickClown))
{ {
AI.SelectCard(CardId.PerformageTrickClown); AI.SelectCard(CardId.PerformageTrickClown);
} }
else else
{ {
AI.SelectCard(new[] { AI.SelectCard(new[] {
CardId.Wulf, CardId.Wulf,
CardId.Felis, CardId.Felis,
CardId.Minerva, CardId.Minerva,
CardId.ThousandBlades CardId.ThousandBlades
}); });
} }
AI.SelectNextCard(new[] { AI.SelectNextCard(new[] {
CardId.Raiden, CardId.Raiden,
CardId.Felis CardId.Felis
}); });
return true; return true;
} }
private bool PerformageTrickClownEffect() private bool PerformageTrickClownEffect()
{ {
ClownUsed = true; ClownUsed = true;
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
return true; return true;
} }
private bool MinervaTheExaltedEffect() private bool MinervaTheExaltedEffect()
{ {
if (Card.Location == CardLocation.MonsterZone) if (Card.Location == CardLocation.MonsterZone)
{ {
return true; return true;
} }
else else
{ {
IList<ClientCard> targets = new List<ClientCard>(); IList<ClientCard> targets = new List<ClientCard>();
ClientCard target1 = AI.Utils.GetBestEnemyMonster(); ClientCard target1 = AI.Utils.GetBestEnemyMonster();
if (target1 != null) if (target1 != null)
targets.Add(target1); targets.Add(target1);
ClientCard target2 = AI.Utils.GetBestEnemySpell(); ClientCard target2 = AI.Utils.GetBestEnemySpell();
if (target2 != null) if (target2 != null)
targets.Add(target2); targets.Add(target2);
foreach (ClientCard target in Enemy.GetMonsters()) foreach (ClientCard target in Enemy.GetMonsters())
{ {
if (targets.Count >= 3) if (targets.Count >= 3)
break; break;
if (!targets.Contains(target)) if (!targets.Contains(target))
targets.Add(target); targets.Add(target);
} }
foreach (ClientCard target in Enemy.GetSpells()) foreach (ClientCard target in Enemy.GetSpells())
{ {
if (targets.Count >= 3) if (targets.Count >= 3)
break; break;
if (!targets.Contains(target)) if (!targets.Contains(target))
targets.Add(target); targets.Add(target);
} }
if (targets.Count == 0) if (targets.Count == 0)
return false; return false;
AI.SelectNextCard(targets); AI.SelectNextCard(targets);
return true; 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("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 YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic; using System.Collections.Generic;
using WindBot; using WindBot;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
// NOT FINISHED YET // NOT FINISHED YET
[Deck("Nekroz", "AI_Nekroz", "NotFinished")] [Deck("Nekroz", "AI_Nekroz", "NotFinished")]
public class NekrozExecutor : DefaultExecutor public class NekrozExecutor : DefaultExecutor
{ {
public class CardId public class CardId
{ {
public const int DancePrincess = 52738610; public const int DancePrincess = 52738610;
public const int ThousandHands = 23401839; public const int ThousandHands = 23401839;
public const int TenThousandHands = 95492061; public const int TenThousandHands = 95492061;
public const int Shurit = 90307777; public const int Shurit = 90307777;
public const int MaxxC = 23434538; public const int MaxxC = 23434538;
public const int DecisiveArmor = 88240999; public const int DecisiveArmor = 88240999;
public const int Trishula = 52068432; public const int Trishula = 52068432;
public const int Valkyrus = 25857246; public const int Valkyrus = 25857246;
public const int Gungnir = 74122412; public const int Gungnir = 74122412;
public const int Brionac = 26674724; public const int Brionac = 26674724;
public const int Unicore = 89463537; public const int Unicore = 89463537;
public const int Clausolas = 99185129; public const int Clausolas = 99185129;
public const int PhantomOfChaos = 30312361; public const int PhantomOfChaos = 30312361;
public const int DarkHole = 53129443; public const int DarkHole = 53129443;
public const int ReinforcementOfTheArmy = 32807846; public const int ReinforcementOfTheArmy = 32807846;
public const int TradeIn = 38120068; public const int TradeIn = 38120068;
public const int PreparationOfRites = 96729612; public const int PreparationOfRites = 96729612;
public const int Mirror = 14735698; public const int Mirror = 14735698;
public const int Kaleidoscope = 51124303; public const int Kaleidoscope = 51124303;
public const int Cycle = 97211663; public const int Cycle = 97211663;
public const int MysticalSpaceTyphoon = 5318639; public const int MysticalSpaceTyphoon = 5318639;
public const int RoyalDecree = 51452091; public const int RoyalDecree = 51452091;
public const int EvilswarmExcitonKnight = 46772449; public const int EvilswarmExcitonKnight = 46772449;
public const int HeraldOfTheArcLight = 79606837; public const int HeraldOfTheArcLight = 79606837;
} }
List<int> NekrozRituelCard = new List<int>(); List<int> NekrozRituelCard = new List<int>();
List<int> NekrozSpellCard = new List<int>(); List<int> NekrozSpellCard = new List<int>();
public NekrozExecutor(GameAI ai, Duel duel) public NekrozExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
NekrozRituelCard.Add(CardId.Clausolas); NekrozRituelCard.Add(CardId.Clausolas);
NekrozRituelCard.Add(CardId.Unicore); NekrozRituelCard.Add(CardId.Unicore);
NekrozRituelCard.Add(CardId.DecisiveArmor); NekrozRituelCard.Add(CardId.DecisiveArmor);
NekrozRituelCard.Add(CardId.Brionac); NekrozRituelCard.Add(CardId.Brionac);
NekrozRituelCard.Add(CardId.Trishula); NekrozRituelCard.Add(CardId.Trishula);
NekrozRituelCard.Add(CardId.Gungnir); NekrozRituelCard.Add(CardId.Gungnir);
NekrozRituelCard.Add(CardId.Valkyrus); NekrozRituelCard.Add(CardId.Valkyrus);
NekrozSpellCard.Add(CardId.Mirror); NekrozSpellCard.Add(CardId.Mirror);
NekrozSpellCard.Add(CardId.Kaleidoscope); NekrozSpellCard.Add(CardId.Kaleidoscope);
NekrozSpellCard.Add(CardId.Cycle); NekrozSpellCard.Add(CardId.Cycle);
AddExecutor(ExecutorType.SpellSet, DefaultSpellSet); AddExecutor(ExecutorType.SpellSet, DefaultSpellSet);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos); AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole); AddExecutor(ExecutorType.Activate, CardId.DarkHole, DefaultDarkHole);
AddExecutor(ExecutorType.Activate, CardId.ReinforcementOfTheArmy, ReinforcementOfTheArmyEffect); AddExecutor(ExecutorType.Activate, CardId.ReinforcementOfTheArmy, ReinforcementOfTheArmyEffect);
AddExecutor(ExecutorType.Activate, CardId.TradeIn); AddExecutor(ExecutorType.Activate, CardId.TradeIn);
AddExecutor(ExecutorType.Activate, CardId.PreparationOfRites); AddExecutor(ExecutorType.Activate, CardId.PreparationOfRites);
AddExecutor(ExecutorType.Activate, CardId.Mirror); AddExecutor(ExecutorType.Activate, CardId.Mirror);
AddExecutor(ExecutorType.Activate, CardId.Kaleidoscope); AddExecutor(ExecutorType.Activate, CardId.Kaleidoscope);
AddExecutor(ExecutorType.Activate, CardId.Cycle); AddExecutor(ExecutorType.Activate, CardId.Cycle);
AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon); AddExecutor(ExecutorType.Activate, CardId.MysticalSpaceTyphoon, DefaultMysticalSpaceTyphoon);
AddExecutor(ExecutorType.Activate, CardId.RoyalDecree); AddExecutor(ExecutorType.Activate, CardId.RoyalDecree);
AddExecutor(ExecutorType.SummonOrSet, CardId.DancePrincess, DancePrincessSummon); AddExecutor(ExecutorType.SummonOrSet, CardId.DancePrincess, DancePrincessSummon);
AddExecutor(ExecutorType.MonsterSet, CardId.Shurit, ShuritSet); AddExecutor(ExecutorType.MonsterSet, CardId.Shurit, ShuritSet);
AddExecutor(ExecutorType.Summon, CardId.ThousandHands, ThousandHandsSummon); AddExecutor(ExecutorType.Summon, CardId.ThousandHands, ThousandHandsSummon);
AddExecutor(ExecutorType.Summon, CardId.TenThousandHands, TenThousandHandsSummon); AddExecutor(ExecutorType.Summon, CardId.TenThousandHands, TenThousandHandsSummon);
AddExecutor(ExecutorType.Summon, CardId.PhantomOfChaos, PhantomOfChaosSummon); AddExecutor(ExecutorType.Summon, CardId.PhantomOfChaos, PhantomOfChaosSummon);
AddExecutor(ExecutorType.Activate, CardId.Unicore, UnicoreEffect); AddExecutor(ExecutorType.Activate, CardId.Unicore, UnicoreEffect);
AddExecutor(ExecutorType.Activate, CardId.DecisiveArmor, DecisiveArmorEffect); AddExecutor(ExecutorType.Activate, CardId.DecisiveArmor, DecisiveArmorEffect);
AddExecutor(ExecutorType.Activate, CardId.Valkyrus, ValkyrusEffect); AddExecutor(ExecutorType.Activate, CardId.Valkyrus, ValkyrusEffect);
AddExecutor(ExecutorType.Activate, CardId.Gungnir, GungnirEffect); AddExecutor(ExecutorType.Activate, CardId.Gungnir, GungnirEffect);
AddExecutor(ExecutorType.Activate, CardId.Brionac, BrionacEffect); AddExecutor(ExecutorType.Activate, CardId.Brionac, BrionacEffect);
AddExecutor(ExecutorType.Activate, CardId.Clausolas, ClausolasEffect); AddExecutor(ExecutorType.Activate, CardId.Clausolas, ClausolasEffect);
AddExecutor(ExecutorType.Activate, CardId.Trishula); AddExecutor(ExecutorType.Activate, CardId.Trishula);
AddExecutor(ExecutorType.Activate, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightEffect); AddExecutor(ExecutorType.Activate, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightEffect);
AddExecutor(ExecutorType.Activate, CardId.PhantomOfChaos, PhantomOfChaosEffect); AddExecutor(ExecutorType.Activate, CardId.PhantomOfChaos, PhantomOfChaosEffect);
AddExecutor(ExecutorType.Activate, CardId.MaxxC); AddExecutor(ExecutorType.Activate, CardId.MaxxC);
AddExecutor(ExecutorType.Activate, CardId.ThousandHands, ThousandHandsEffect); AddExecutor(ExecutorType.Activate, CardId.ThousandHands, ThousandHandsEffect);
AddExecutor(ExecutorType.Activate, CardId.TenThousandHands, BrionacEffect); AddExecutor(ExecutorType.Activate, CardId.TenThousandHands, BrionacEffect);
AddExecutor(ExecutorType.Activate, CardId.HeraldOfTheArcLight); AddExecutor(ExecutorType.Activate, CardId.HeraldOfTheArcLight);
AddExecutor(ExecutorType.Activate, CardId.Shurit); AddExecutor(ExecutorType.Activate, CardId.Shurit);
AddExecutor(ExecutorType.SpSummon, CardId.Trishula); AddExecutor(ExecutorType.SpSummon, CardId.Trishula);
AddExecutor(ExecutorType.SpSummon, CardId.DecisiveArmor); AddExecutor(ExecutorType.SpSummon, CardId.DecisiveArmor);
AddExecutor(ExecutorType.SpSummon, CardId.Valkyrus); AddExecutor(ExecutorType.SpSummon, CardId.Valkyrus);
AddExecutor(ExecutorType.SpSummon, CardId.Gungnir); AddExecutor(ExecutorType.SpSummon, CardId.Gungnir);
AddExecutor(ExecutorType.SpSummon, CardId.Brionac); AddExecutor(ExecutorType.SpSummon, CardId.Brionac);
AddExecutor(ExecutorType.SpSummon, CardId.Unicore); AddExecutor(ExecutorType.SpSummon, CardId.Unicore);
AddExecutor(ExecutorType.SpSummon, CardId.Clausolas); AddExecutor(ExecutorType.SpSummon, CardId.Clausolas);
AddExecutor(ExecutorType.SpSummon, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightSummon); AddExecutor(ExecutorType.SpSummon, CardId.EvilswarmExcitonKnight, DefaultEvilswarmExcitonKnightSummon);
} }
private bool ThousandHandsSummon() private bool ThousandHandsSummon()
{ {
if (!Bot.HasInHand(NekrozRituelCard) || Bot.HasInHand(CardId.Shurit) || !Bot.HasInHand(NekrozSpellCard)) if (!Bot.HasInHand(NekrozRituelCard) || Bot.HasInHand(CardId.Shurit) || !Bot.HasInHand(NekrozSpellCard))
return true; return true;
foreach (ClientCard Card in Bot.Hand) foreach (ClientCard Card in Bot.Hand)
if (Card != null && Card.Id == CardId.Kaleidoscope && !Bot.HasInHand(CardId.Unicore)) if (Card != null && Card.Id == CardId.Kaleidoscope && !Bot.HasInHand(CardId.Unicore))
return true; return true;
else if (Card.Id == CardId.Trishula || Card.Id == CardId.DecisiveArmor && !Bot.HasInHand(CardId.Mirror) || !Bot.HasInHand(CardId.Shurit)) else if (Card.Id == CardId.Trishula || Card.Id == CardId.DecisiveArmor && !Bot.HasInHand(CardId.Mirror) || !Bot.HasInHand(CardId.Shurit))
return true; return true;
return false; return false;
} }
private bool ReinforcementOfTheArmyEffect() private bool ReinforcementOfTheArmyEffect()
{ {
if (!Bot.HasInGraveyard(CardId.Shurit) && !Bot.HasInHand(CardId.Shurit)) if (!Bot.HasInGraveyard(CardId.Shurit) && !Bot.HasInHand(CardId.Shurit))
{ {
AI.SelectCard(CardId.Shurit); AI.SelectCard(CardId.Shurit);
return true; return true;
} }
return false; return false;
} }
private bool TenThousandHandsSummon() private bool TenThousandHandsSummon()
{ {
if (!Bot.HasInHand(CardId.ThousandHands) || !Bot.HasInHand(CardId.Shurit)) if (!Bot.HasInHand(CardId.ThousandHands) || !Bot.HasInHand(CardId.Shurit))
return true; return true;
return false; return false;
} }
private bool DancePrincessSummon() private bool DancePrincessSummon()
{ {
if (!Bot.HasInHand(CardId.ThousandHands) && !Bot.HasInHand(CardId.TenThousandHands)) if (!Bot.HasInHand(CardId.ThousandHands) && !Bot.HasInHand(CardId.TenThousandHands))
return true; return true;
return false; return false;
} }
private bool PhantomOfChaosSummon() private bool PhantomOfChaosSummon()
{ {
if (Bot.HasInGraveyard(CardId.Shurit) && Bot.HasInHand(NekrozSpellCard) && Bot.HasInHand(NekrozRituelCard)) if (Bot.HasInGraveyard(CardId.Shurit) && Bot.HasInHand(NekrozSpellCard) && Bot.HasInHand(NekrozRituelCard))
return true; return true;
return false; return false;
} }
private bool PhantomOfChaosEffect() private bool PhantomOfChaosEffect()
{ {
AI.SelectCard(CardId.Shurit); AI.SelectCard(CardId.Shurit);
return true; return true;
} }
private bool ShuritSet() private bool ShuritSet()
{ {
if (!Bot.HasInHand(CardId.ThousandHands) && !Bot.HasInHand(CardId.TenThousandHands) && !Bot.HasInHand(CardId.DancePrincess)) if (!Bot.HasInHand(CardId.ThousandHands) && !Bot.HasInHand(CardId.TenThousandHands) && !Bot.HasInHand(CardId.DancePrincess))
return true; return true;
return false; return false;
} }
private bool DecisiveArmorEffect() private bool DecisiveArmorEffect()
{ {
if (AI.Utils.IsAllEnemyBetterThanValue(3300, true)) if (AI.Utils.IsAllEnemyBetterThanValue(3300, true))
{ {
AI.SelectCard(CardId.DecisiveArmor); AI.SelectCard(CardId.DecisiveArmor);
return true; return true;
} }
return false; return false;
} }
private bool ValkyrusEffect() private bool ValkyrusEffect()
{ {
if (Duel.Phase == DuelPhase.Battle) if (Duel.Phase == DuelPhase.Battle)
return true; return true;
return false; return false;
} }
private bool GungnirEffect() private bool GungnirEffect()
{ {
if (AI.Utils.IsOneEnemyBetter(true) && Duel.Phase == DuelPhase.Main1) if (AI.Utils.IsOneEnemyBetter(true) && Duel.Phase == DuelPhase.Main1)
{ {
AI.SelectCard(Enemy.GetMonsters().GetHighestAttackMonster()); AI.SelectCard(Enemy.GetMonsters().GetHighestAttackMonster());
return true; return true;
} }
return false; return false;
} }
private bool BrionacEffect() private bool BrionacEffect()
{ {
if (!Bot.HasInHand(CardId.Shurit)) if (!Bot.HasInHand(CardId.Shurit))
{ {
AI.SelectCard(CardId.Shurit); AI.SelectCard(CardId.Shurit);
return true; return true;
} }
else if (!Bot.HasInHand(NekrozSpellCard)) else if (!Bot.HasInHand(NekrozSpellCard))
{ {
AI.SelectCard(CardId.Mirror); AI.SelectCard(CardId.Mirror);
return true; return true;
} }
else if (AI.Utils.IsOneEnemyBetterThanValue(3300, true) && !Bot.HasInHand(CardId.Trishula)) else if (AI.Utils.IsOneEnemyBetterThanValue(3300, true) && !Bot.HasInHand(CardId.Trishula))
{ {
AI.SelectCard(CardId.Trishula); AI.SelectCard(CardId.Trishula);
return true; return true;
} }
else if (AI.Utils.IsAllEnemyBetterThanValue(2700,true) && !Bot.HasInHand(CardId.DecisiveArmor)) else if (AI.Utils.IsAllEnemyBetterThanValue(2700,true) && !Bot.HasInHand(CardId.DecisiveArmor))
{ {
AI.SelectCard(CardId.DecisiveArmor); AI.SelectCard(CardId.DecisiveArmor);
return true; return true;
} }
else if (Bot.HasInHand(CardId.Unicore) && !Bot.HasInHand(CardId.Kaleidoscope)) else if (Bot.HasInHand(CardId.Unicore) && !Bot.HasInHand(CardId.Kaleidoscope))
{ {
AI.SelectCard(CardId.Kaleidoscope); AI.SelectCard(CardId.Kaleidoscope);
return true; return true;
} }
else if (!Bot.HasInHand(CardId.Unicore) && Bot.HasInHand(CardId.Kaleidoscope)) else if (!Bot.HasInHand(CardId.Unicore) && Bot.HasInHand(CardId.Kaleidoscope))
{ {
AI.SelectCard(CardId.Unicore); AI.SelectCard(CardId.Unicore);
return true; return true;
} }
return true; return true;
} }
private bool ThousandHandsEffect() private bool ThousandHandsEffect()
{ {
if (AI.Utils.IsOneEnemyBetterThanValue(3300, true) && !Bot.HasInHand(CardId.Trishula)) if (AI.Utils.IsOneEnemyBetterThanValue(3300, true) && !Bot.HasInHand(CardId.Trishula))
{ {
AI.SelectCard(CardId.Trishula); AI.SelectCard(CardId.Trishula);
return true; return true;
} }
else if (AI.Utils.IsAllEnemyBetterThanValue(2700, true) && !Bot.HasInHand(CardId.DecisiveArmor)) else if (AI.Utils.IsAllEnemyBetterThanValue(2700, true) && !Bot.HasInHand(CardId.DecisiveArmor))
{ {
AI.SelectCard(CardId.DecisiveArmor); AI.SelectCard(CardId.DecisiveArmor);
return true; return true;
} }
else if (!Bot.HasInHand(CardId.Unicore) && Bot.HasInHand(CardId.Kaleidoscope)) else if (!Bot.HasInHand(CardId.Unicore) && Bot.HasInHand(CardId.Kaleidoscope))
{ {
AI.SelectCard(CardId.Unicore); AI.SelectCard(CardId.Unicore);
return true; return true;
} }
return true; return true;
} }
private bool UnicoreEffect() private bool UnicoreEffect()
{ {
if (Bot.HasInGraveyard(CardId.Shurit)) if (Bot.HasInGraveyard(CardId.Shurit))
{ {
AI.SelectCard(CardId.Shurit); AI.SelectCard(CardId.Shurit);
return true; return true;
} }
return false; return false;
} }
private bool ClausolasEffect() private bool ClausolasEffect()
{ {
if (!Bot.HasInHand(NekrozSpellCard)) if (!Bot.HasInHand(NekrozSpellCard))
{ {
AI.SelectCard(CardId.Mirror); AI.SelectCard(CardId.Mirror);
return true; return true;
} }
return false; return false;
} }
private bool IsTheLastPossibility() private bool IsTheLastPossibility()
{ {
if (!Bot.HasInHand(CardId.DecisiveArmor) && !Bot.HasInHand(CardId.Trishula)) if (!Bot.HasInHand(CardId.DecisiveArmor) && !Bot.HasInHand(CardId.Trishula))
return true; return true;
return false; return false;
} }
private bool SelectNekrozWhoInvoke() private bool SelectNekrozWhoInvoke()
{ {
List<int> NekrozCard = new List<int>(); List<int> NekrozCard = new List<int>();
try try
{ {
foreach (ClientCard Card in Bot.Hand) foreach (ClientCard Card in Bot.Hand)
if (Card != null && NekrozRituelCard.Contains((int)Card.Id)) if (Card != null && NekrozRituelCard.Contains((int)Card.Id))
NekrozCard.Add(Card.Id); NekrozCard.Add(Card.Id);
foreach (int Id in NekrozCard) foreach (int Id in NekrozCard)
{ {
if (Id == CardId.Trishula && AI.Utils.IsAllEnemyBetterThanValue(2700, true) && Bot.HasInHand(CardId.DecisiveArmor)) if (Id == CardId.Trishula && AI.Utils.IsAllEnemyBetterThanValue(2700, true) && Bot.HasInHand(CardId.DecisiveArmor))
{ {
AI.SelectCard(CardId.Trishula); AI.SelectCard(CardId.Trishula);
return true; return true;
} }
else if (Id == CardId.DecisiveArmor) else if (Id == CardId.DecisiveArmor)
{ {
AI.SelectCard(CardId.DecisiveArmor); AI.SelectCard(CardId.DecisiveArmor);
return true; return true;
} }
else if (Id == CardId.Unicore && Bot.HasInHand(CardId.Kaleidoscope) && !Bot.HasInGraveyard(CardId.Shurit)) else if (Id == CardId.Unicore && Bot.HasInHand(CardId.Kaleidoscope) && !Bot.HasInGraveyard(CardId.Shurit))
{ {
AI.SelectCard(CardId.Unicore); AI.SelectCard(CardId.Unicore);
return true; return true;
} }
else if (Id == CardId.Valkyrus) else if (Id == CardId.Valkyrus)
{ {
if (IsTheLastPossibility()) if (IsTheLastPossibility())
{ {
AI.SelectCard(CardId.Valkyrus); AI.SelectCard(CardId.Valkyrus);
return true; return true;
} }
} }
else if (Id == CardId.Gungnir) else if (Id == CardId.Gungnir)
{ {
if (IsTheLastPossibility()) if (IsTheLastPossibility())
{ {
AI.SelectCard(CardId.Gungnir); AI.SelectCard(CardId.Gungnir);
return true; return true;
} }
} }
else if (Id == CardId.Clausolas) else if (Id == CardId.Clausolas)
{ {
if (IsTheLastPossibility()) if (IsTheLastPossibility())
{ {
AI.SelectCard(CardId.Clausolas); AI.SelectCard(CardId.Clausolas);
return true; return true;
} }
} }
} }
return false; return false;
} }
catch catch
{ return false; } { return false; }
} }
} }
} }
...@@ -161,7 +161,7 @@ namespace WindBot.Game.AI.Decks ...@@ -161,7 +161,7 @@ namespace WindBot.Game.AI.Decks
private bool SkillDrainEffect() private bool SkillDrainEffect()
{ {
return (Duel.LifePoints[0] > 1000) && DefaultUniqueTrap(); return (Bot.LifePoints > 1000) && DefaultUniqueTrap();
} }
private bool PotOfDualityEffect() private bool PotOfDualityEffect()
...@@ -191,7 +191,7 @@ namespace WindBot.Game.AI.Decks ...@@ -191,7 +191,7 @@ namespace WindBot.Game.AI.Decks
} }
return false; return false;
} }
private bool TrapSetUnique() private bool TrapSetUnique()
{ {
foreach (ClientCard card in Bot.GetSpells()) foreach (ClientCard card in Bot.GetSpells())
...@@ -315,7 +315,7 @@ namespace WindBot.Game.AI.Decks ...@@ -315,7 +315,7 @@ namespace WindBot.Game.AI.Decks
{ {
AI.SelectCard(HighScaleCards); AI.SelectCard(HighScaleCards);
} }
return Duel.LifePoints[0] > 800; return Bot.LifePoints > 800;
} }
private bool StealthEffect() private bool StealthEffect()
......
...@@ -107,7 +107,7 @@ namespace WindBot.Game.AI.Decks ...@@ -107,7 +107,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon); AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning); AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning); AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning, DefaultNumberS39UtopiaTheLightningEffect);
AddExecutor(ExecutorType.SpSummon, CardId.StardustDragon, DefaultStardustDragonSummon); AddExecutor(ExecutorType.SpSummon, CardId.StardustDragon, DefaultStardustDragonSummon);
AddExecutor(ExecutorType.Activate, CardId.StardustDragon, DefaultStardustDragonEffect); AddExecutor(ExecutorType.Activate, CardId.StardustDragon, DefaultStardustDragonEffect);
...@@ -267,7 +267,7 @@ namespace WindBot.Game.AI.Decks ...@@ -267,7 +267,7 @@ namespace WindBot.Game.AI.Decks
private bool GagagaCowboySummon() private bool GagagaCowboySummon()
{ {
if (Duel.LifePoints[1] <= 800) if (Enemy.LifePoints <= 800)
{ {
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
return true; return true;
......
...@@ -262,9 +262,9 @@ namespace WindBot.Game.AI.Decks ...@@ -262,9 +262,9 @@ namespace WindBot.Game.AI.Decks
private bool CyberDragonInfinityEffect() private bool CyberDragonInfinityEffect()
{ {
if (CurrentChain.Count > 0) if (Duel.CurrentChain.Count > 0)
{ {
return LastChainPlayer == 1; return Duel.LastChainPlayer == 1;
} }
else else
{ {
......
...@@ -117,7 +117,7 @@ namespace WindBot.Game.AI.Decks ...@@ -117,7 +117,7 @@ namespace WindBot.Game.AI.Decks
if (!defender.IsMonsterHasPreventActivationEffectInBattle()) if (!defender.IsMonsterHasPreventActivationEffectInBattle())
{ {
if (attacker.Id == CardId.SkyCavalryCentaurea && !attacker.IsDisabled() && attacker.HasXyzMaterial()) 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); return base.OnPreBattleBetween(attacker, defender);
} }
...@@ -302,7 +302,7 @@ namespace WindBot.Game.AI.Decks ...@@ -302,7 +302,7 @@ namespace WindBot.Game.AI.Decks
private bool ToadallyAwesomeEffect() private bool ToadallyAwesomeEffect()
{ {
if (CurrentChain.Count > 0) if (Duel.CurrentChain.Count > 0)
{ {
// negate effect, select a cost for it // negate effect, select a cost for it
List<ClientCard> monsters = Bot.GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
...@@ -506,7 +506,7 @@ namespace WindBot.Game.AI.Decks ...@@ -506,7 +506,7 @@ namespace WindBot.Game.AI.Decks
{ {
defence += monster.GetDefensePower(); 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 true;
} }
return false; return false;
......
...@@ -249,9 +249,9 @@ namespace WindBot.Game.AI.Decks ...@@ -249,9 +249,9 @@ namespace WindBot.Game.AI.Decks
ClientCard tosolve = AI.Utils.GetProblematicEnemyCard(); ClientCard tosolve = AI.Utils.GetProblematicEnemyCard();
if (tosolve == null) 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; if (target.HasPosition(CardPosition.FaceUp) && (target.Location == CardLocation.MonsterZone || target.Location == CardLocation.SpellZone)) tosolve = target;
} }
} }
...@@ -337,7 +337,7 @@ namespace WindBot.Game.AI.Decks ...@@ -337,7 +337,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (Duel.Player == 0) return false; if (Duel.Player == 0) return false;
if (Duel.Phase == DuelPhase.End) return true; 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) if (Duel.Phase == DuelPhase.BattleStart)
{ {
int total_atk = 0; int total_atk = 0;
...@@ -346,7 +346,7 @@ namespace WindBot.Game.AI.Decks ...@@ -346,7 +346,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (m.IsAttack() && !m.Attacked) total_atk += m.Attack; 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; return false;
} }
...@@ -369,7 +369,7 @@ namespace WindBot.Game.AI.Decks ...@@ -369,7 +369,7 @@ namespace WindBot.Game.AI.Decks
stage_locked = null; stage_locked = null;
return true; 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[] AI.SelectCard(new[]
{ {
...@@ -423,7 +423,7 @@ namespace WindBot.Game.AI.Decks ...@@ -423,7 +423,7 @@ namespace WindBot.Game.AI.Decks
if (NormalSummoned) 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[] AI.SelectCard(new[]
{ {
...@@ -483,12 +483,12 @@ namespace WindBot.Game.AI.Decks ...@@ -483,12 +483,12 @@ namespace WindBot.Game.AI.Decks
if (GraveCall_count > 0 && GraveCall_id == Card.Id) return false; 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.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; 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() public bool Exterio_counter()
{ {
if (LastChainPlayer == 1) if (Duel.LastChainPlayer == 1)
{ {
AI.SelectCard(Useless_List()); AI.SelectCard(Useless_List());
return true; return true;
...@@ -505,15 +505,15 @@ namespace WindBot.Game.AI.Decks ...@@ -505,15 +505,15 @@ namespace WindBot.Game.AI.Decks
{ {
if (Card.Location == CardLocation.Hand) if (Card.Location == CardLocation.Hand)
{ {
if ((Duel.LifePoints[1] <= 1000 && Bot.HasInSpellZone(CardId.Stage)) if ((Enemy.LifePoints <= 1000 && Bot.HasInSpellZone(CardId.Stage))
|| Duel.LifePoints[1] <= 800 || Enemy.LifePoints <= 800
|| (!NormalSummoned && Bot.HasInGraveyard(CardId.Red)) || (!NormalSummoned && Bot.HasInGraveyard(CardId.Red))
) )
{ {
pink_ss = true; pink_ss = true;
return 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; pink_ss = true;
return true; return true;
} }
...@@ -580,19 +580,15 @@ namespace WindBot.Game.AI.Decks ...@@ -580,19 +580,15 @@ namespace WindBot.Game.AI.Decks
public bool Eater_eff() public bool Eater_eff()
{ {
ClientCard self_card = (Duel.Player == 0) ? AI.GetAttacker() : AI.GetDefender(); if (Enemy.BattlingMonster.HasPosition(CardPosition.Attack) && (Bot.BattlingMonster.Attack - Enemy.BattlingMonster.GetDefensePower() >= Enemy.LifePoints)) return false;
ClientCard enemy_card = (Duel.Player == 1) ? AI.GetAttacker() : AI.GetDefender(); return true;
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));
} }
public bool Red_ss() public bool Red_ss()
{ {
if (red_ss_count >= 6) return false; if (red_ss_count >= 6) return false;
if ((ChainContainsCard(CardId.DarkHole) || ChainContainsCard(99330325) || ChainContainsCard(53582587)) && ChainContainsCard(CardId.Red)) return false; if ((AI.Utils.ChainContainsCard(CardId.DarkHole) || AI.Utils.ChainContainsCard(99330325) || AI.Utils.ChainContainsCard(53582587)) && AI.Utils.ChainContainsCard(CardId.Red)) return false;
if (LastChainPlayer == 0 && GetLastChainCard().Id == CardId.Red) if (Duel.LastChainPlayer == 0 && AI.Utils.GetLastChainCard().Id == CardId.Red)
{ {
foreach (ClientCard m in Bot.GetMonsters()) foreach (ClientCard m in Bot.GetMonsters())
{ {
...@@ -604,7 +600,7 @@ namespace WindBot.Game.AI.Decks ...@@ -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 (Duel.Player == 0)
{ {
if (AI.Utils.IsTurn1OrMain2()) return false; if (AI.Utils.IsTurn1OrMain2()) return false;
...@@ -695,7 +691,7 @@ namespace WindBot.Game.AI.Decks ...@@ -695,7 +691,7 @@ namespace WindBot.Game.AI.Decks
}); });
return true; return true;
} }
if (Duel.LifePoints[1] <= 1000) if (Enemy.LifePoints <= 1000)
{ {
if (Bot.GetRemainingCount(CardId.Pink, 1) > 0 && !pink_ss) if (Bot.GetRemainingCount(CardId.Pink, 1) > 0 && !pink_ss)
{ {
...@@ -754,7 +750,7 @@ namespace WindBot.Game.AI.Decks ...@@ -754,7 +750,7 @@ namespace WindBot.Game.AI.Decks
CardId.Yellow 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[] AI.SelectCard(new[]
{ {
...@@ -875,10 +871,8 @@ namespace WindBot.Game.AI.Decks ...@@ -875,10 +871,8 @@ namespace WindBot.Game.AI.Decks
return true; return true;
} }
*/ */
ClientCard self_monster = (Duel.Player == 0) ? AI.GetAttacker() : AI.GetDefender(); if (Bot.BattlingMonster == null || Enemy.BattlingMonster == null || !IsTrickstar(Bot.BattlingMonster.Id) || Bot.BattlingMonster.HasPosition(CardPosition.Defence)) return false;
ClientCard enemy_monster = (Duel.Player == 1) ? AI.GetAttacker() : AI.GetDefender(); if (Bot.BattlingMonster.Attack <= Enemy.BattlingMonster.RealPower && Bot.BattlingMonster.Attack + Bot.BattlingMonster.BaseAttack >= Enemy.BattlingMonster.RealPower)
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)
{ {
white_eff_used = true; white_eff_used = true;
return true; return true;
...@@ -934,8 +928,8 @@ namespace WindBot.Game.AI.Decks ...@@ -934,8 +928,8 @@ namespace WindBot.Game.AI.Decks
lockbird_useful = true; lockbird_useful = true;
if (Bot.HasInSpellZone(CardId.Re)) if (Bot.HasInSpellZone(CardId.Re))
{ {
if (ChainContainsCard(CardId.Re)) lockbird_used = true; if (AI.Utils.ChainContainsCard(CardId.Re)) lockbird_used = true;
return ChainContainsCard(CardId.Re); return AI.Utils.ChainContainsCard(CardId.Re);
} }
lockbird_used = true; lockbird_used = true;
return true; return true;
...@@ -946,7 +940,7 @@ namespace WindBot.Game.AI.Decks ...@@ -946,7 +940,7 @@ namespace WindBot.Game.AI.Decks
if (Card.Location == CardLocation.Grave) return Ts_reborn(); if (Card.Location == CardLocation.Grave) return Ts_reborn();
if (Bot.HasInHand(CardId.LockBird)) 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; lockbird_useful = false;
return true; return true;
} }
...@@ -973,7 +967,7 @@ namespace WindBot.Game.AI.Decks ...@@ -973,7 +967,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (hand.IsMonster() && IsTrickstar(hand.Id)) 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 (hand.Id != CardId.Yellow)
{ {
if (AI.Utils.GetOneEnemyBetterThanValue(hand.Attack, false) == null) return true; if (AI.Utils.GetOneEnemyBetterThanValue(hand.Attack, false) == null) return true;
...@@ -986,7 +980,7 @@ namespace WindBot.Game.AI.Decks ...@@ -986,7 +980,7 @@ namespace WindBot.Game.AI.Decks
public bool Ts_reborn() public bool Ts_reborn()
{ {
if (Duel.Player == 0 && Duel.LifePoints[1] <= 1000) if (Duel.Player == 0 && Enemy.LifePoints <= 1000)
{ {
AI.SelectCard(CardId.Pink); AI.SelectCard(CardId.Pink);
return true; return true;
...@@ -1033,7 +1027,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1033,7 +1027,7 @@ namespace WindBot.Game.AI.Decks
public bool Red_sum() 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; NormalSummoned = true;
return true; return true;
...@@ -1043,7 +1037,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1043,7 +1037,7 @@ namespace WindBot.Game.AI.Decks
public bool Pink_sum() public bool Pink_sum()
{ {
if (Duel.LifePoints[1] <= 1000) if (Enemy.LifePoints <= 1000)
{ {
NormalSummoned = true; NormalSummoned = true;
return true; return true;
...@@ -1094,7 +1088,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1094,7 +1088,7 @@ namespace WindBot.Game.AI.Decks
public bool Ring_act() 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(); ClientCard target = AI.Utils.GetProblematicEnemyMonster();
if (target == null && AI.Utils.IsChainTarget(Card)) if (target == null && AI.Utils.IsChainTarget(Card))
{ {
...@@ -1102,7 +1096,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1102,7 +1096,7 @@ namespace WindBot.Game.AI.Decks
} }
if (target != null) if (target != null)
{ {
if (Duel.LifePoints[0] <= target.Attack) return false; if (Bot.LifePoints <= target.Attack) return false;
AI.SelectCard(target); AI.SelectCard(target);
return true; return true;
} }
...@@ -1124,7 +1118,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1124,7 +1118,7 @@ namespace WindBot.Game.AI.Decks
public bool Linkuri_eff() 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 }); AI.SelectCard(new[] { CardId.Tuner, CardId.BF + 1 });
return true; return true;
} }
...@@ -1216,7 +1210,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1216,7 +1210,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (getLinkMarker(ex_m.Id) >= 4) return false; 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) if (Enemy.GetMonsterCount() == 0 && Duel.Phase < DuelPhase.Battle)
{ {
...@@ -1261,7 +1255,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1261,7 +1255,7 @@ namespace WindBot.Game.AI.Decks
ClientCard m = AI.Utils.GetProblematicEnemySpell(); ClientCard m = AI.Utils.GetProblematicEnemySpell();
if (m == null) 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>(); IList<ClientCard> m_list = new List<ClientCard>();
List<ClientCard> list = new List<ClientCard>(Bot.GetMonsters()); List<ClientCard> list = new List<ClientCard>(Bot.GetMonsters());
...@@ -1320,7 +1314,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1320,7 +1314,7 @@ namespace WindBot.Game.AI.Decks
int link_count = 0; int link_count = 0;
if (m == null) 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>(); IList<ClientCard> m_list = new List<ClientCard>();
List<ClientCard> _sort_list = new List<ClientCard>(Bot.GetMonsters()); List<ClientCard> _sort_list = new List<ClientCard>(Bot.GetMonsters());
...@@ -1412,7 +1406,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1412,7 +1406,7 @@ namespace WindBot.Game.AI.Decks
} }
if (targets.Count >= 4) 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.SelectMaterials(targets);
AI.SelectYesNo(true); AI.SelectYesNo(true);
snake_four_s = true; snake_four_s = true;
...@@ -1491,7 +1485,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1491,7 +1485,7 @@ namespace WindBot.Game.AI.Decks
IList<ClientCard> material_list = new List<ClientCard>(); IList<ClientCard> material_list = new List<ClientCard>();
if (AI.Utils.GetProblematicEnemyMonster(2000) == null) Logger.DebugWriteLine("***borrel:null"); if (AI.Utils.GetProblematicEnemyMonster(2000) == null) Logger.DebugWriteLine("***borrel:null");
else Logger.DebugWriteLine("***borrel:" + (AI.Utils.GetProblematicEnemyMonster(2000).Name ?? "unknown")); 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()) foreach(ClientCard e_m in Bot.GetMonstersInExtraZone())
{ {
...@@ -1521,7 +1515,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1521,7 +1515,7 @@ namespace WindBot.Game.AI.Decks
} }
if ((already_link2 && material_list.Count == 3) || (!already_link2 && material_list.Count == 4)) 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; if (GetTotalATK(material_list) >= 3000) return false;
} }
...@@ -1552,14 +1546,14 @@ namespace WindBot.Game.AI.Decks ...@@ -1552,14 +1546,14 @@ namespace WindBot.Game.AI.Decks
public bool GraveCall_eff() public bool GraveCall_eff()
{ {
if (LastChainPlayer == 1) if (Duel.LastChainPlayer == 1)
{ {
Logger.DebugWriteLine(GetLastChainCard().Name.ToString()); Logger.DebugWriteLine(AI.Utils.GetLastChainCard().Name.ToString());
Logger.DebugWriteLine(GetLastChainCard().IsMonster().ToString()); Logger.DebugWriteLine(AI.Utils.GetLastChainCard().IsMonster().ToString());
Logger.DebugWriteLine(Enemy.HasInGraveyard(GetLastChainCard().Id).ToString()); Logger.DebugWriteLine(Enemy.HasInGraveyard(AI.Utils.GetLastChainCard().Id).ToString());
if (GetLastChainCard().IsMonster() && Enemy.HasInGraveyard(GetLastChainCard().Id)) if (AI.Utils.GetLastChainCard().IsMonster() && Enemy.HasInGraveyard(AI.Utils.GetLastChainCard().Id))
{ {
GraveCall_id = GetLastChainCard().Id; GraveCall_id = AI.Utils.GetLastChainCard().Id;
GraveCall_count = 2; GraveCall_count = 2;
AI.SelectCard(GraveCall_id); AI.SelectCard(GraveCall_id);
return true; return true;
......
...@@ -129,7 +129,7 @@ namespace WindBot.Game.AI.Decks ...@@ -129,7 +129,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon); AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiaOne); AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiaOne);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning); AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning); AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning, DefaultNumberS39UtopiaTheLightningEffect);
AddExecutor(ExecutorType.Activate, CardId.StardustDragon, DefaultStardustDragonEffect); AddExecutor(ExecutorType.Activate, CardId.StardustDragon, DefaultStardustDragonEffect);
...@@ -291,7 +291,7 @@ namespace WindBot.Game.AI.Decks ...@@ -291,7 +291,7 @@ namespace WindBot.Game.AI.Decks
private bool GagagaCowboySummon() 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); AI.SelectPosition(CardPosition.FaceUpDefence);
return true; return true;
......
...@@ -72,7 +72,7 @@ namespace WindBot.Game.AI.Decks ...@@ -72,7 +72,7 @@ namespace WindBot.Game.AI.Decks
// XYZ effects // XYZ effects
AddExecutor(ExecutorType.Activate, CardId.Number39Utopia, Number39Utopia); AddExecutor(ExecutorType.Activate, CardId.Number39Utopia, Number39Utopia);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiaOne); 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.ZwLionArms, ZwLionArms);
AddExecutor(ExecutorType.Activate, CardId.AdreusKeeperOfArmageddon); AddExecutor(ExecutorType.Activate, CardId.AdreusKeeperOfArmageddon);
AddExecutor(ExecutorType.Activate, CardId.Number61Volcasaurus); AddExecutor(ExecutorType.Activate, CardId.Number61Volcasaurus);
...@@ -105,7 +105,7 @@ namespace WindBot.Game.AI.Decks ...@@ -105,7 +105,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.TinGoldfish, GoblindberghEffect); AddExecutor(ExecutorType.Activate, CardId.TinGoldfish, GoblindberghEffect);
AddExecutor(ExecutorType.Activate, CardId.Kagetokage); AddExecutor(ExecutorType.Activate, CardId.Kagetokage);
AddExecutor(ExecutorType.Activate, CardId.SummonerMonk, SummonerMonkEffect); AddExecutor(ExecutorType.Activate, CardId.SummonerMonk, SummonerMonkEffect);
AddExecutor(ExecutorType.Activate, CardId.Honest, Honest); AddExecutor(ExecutorType.Activate, CardId.Honest, DefaultHonestEffect);
// Reposition // Reposition
AddExecutor(ExecutorType.Repos, MonsterRepos); AddExecutor(ExecutorType.Repos, MonsterRepos);
...@@ -150,7 +150,7 @@ namespace WindBot.Game.AI.Decks ...@@ -150,7 +150,7 @@ namespace WindBot.Game.AI.Decks
private bool Number39Utopia() 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 true;
return false; return false;
} }
...@@ -184,7 +184,7 @@ namespace WindBot.Game.AI.Decks ...@@ -184,7 +184,7 @@ namespace WindBot.Game.AI.Decks
private bool InstantFusion() private bool InstantFusion()
{ {
if (Duel.LifePoints[0] <= 1000) if (Bot.LifePoints <= 1000)
return false; return false;
int count4 = 0; int count4 = 0;
int count5 = 0; int count5 = 0;
...@@ -210,17 +210,7 @@ namespace WindBot.Game.AI.Decks ...@@ -210,17 +210,7 @@ namespace WindBot.Game.AI.Decks
private bool XyzChangeTactics() private bool XyzChangeTactics()
{ {
return Duel.LifePoints[0] > 500; return Bot.LifePoints > 500;
}
private bool NumberS39UtopiatheLightning()
{
return Card.Attack < 5000;
}
private bool Honest()
{
return Duel.Phase != DuelPhase.Main1 || Duel.Turn == 1;
} }
private bool GoblindberghFirst() private bool GoblindberghFirst()
......
...@@ -73,7 +73,7 @@ namespace WindBot.Game.AI.Decks ...@@ -73,7 +73,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon); AddExecutor(ExecutorType.SpSummon, CardId.Number39Utopia, DefaultNumberS39UtopiaTheLightningSummon);
AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning); AddExecutor(ExecutorType.SpSummon, CardId.NumberS39UtopiatheLightning);
AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning); AddExecutor(ExecutorType.Activate, CardId.NumberS39UtopiatheLightning, DefaultNumberS39UtopiaTheLightningEffect);
AddExecutor(ExecutorType.Activate, CardId.InvokedMechaba, DefaultTrap); AddExecutor(ExecutorType.Activate, CardId.InvokedMechaba, DefaultTrap);
...@@ -486,7 +486,7 @@ namespace WindBot.Game.AI.Decks ...@@ -486,7 +486,7 @@ namespace WindBot.Game.AI.Decks
private bool DridentEffect() private bool DridentEffect()
{ {
if (LastChainPlayer == 0) if (Duel.LastChainPlayer == 0)
return false; return false;
ClientCard target = AI.Utils.GetBestEnemyCard(true); ClientCard target = AI.Utils.GetBestEnemyCard(true);
if (target == null) if (target == null)
...@@ -571,7 +571,7 @@ namespace WindBot.Game.AI.Decks ...@@ -571,7 +571,7 @@ namespace WindBot.Game.AI.Decks
private bool ZoodiacComboEffect() private bool ZoodiacComboEffect()
{ {
if (CurrentChain.Count > 0) if (Duel.CurrentChain.Count > 0)
return false; return false;
if (Card.Location != CardLocation.Grave) if (Card.Location != CardLocation.Grave)
{ {
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
using WindBot; using WindBot;
...@@ -12,14 +12,15 @@ namespace WindBot.Game.AI ...@@ -12,14 +12,15 @@ namespace WindBot.Game.AI
protected class _CardId protected class _CardId
{ {
public const int JizukirutheStarDestroyingKaiju = 63941210; 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 ThunderKingtheLightningstrikeKaiju = 48770333;
public const int DogorantheMadFlameKaiju = 93332803; 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 SuperAntiKaijuWarMachineMechaDogoran = 84769941;
public const int DupeFrog = 46239604; public const int DupeFrog = 46239604;
public const int MaraudingCaptain = 2460565; public const int MaraudingCaptain = 2460565;
...@@ -44,13 +45,40 @@ namespace WindBot.Game.AI ...@@ -44,13 +45,40 @@ namespace WindBot.Game.AI
AddExecutor(ExecutorType.Activate, _CardId.ChickenGame, DefaultChickenGame); 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> /// <summary>
/// Decide whether to declare attack between attacker and defender. /// Decide whether to declare attack between attacker and defender.
/// Can be overrided to update the RealPower of attacker for cards like Honest. /// Can be overrided to update the RealPower of attacker for cards like Honest.
/// </summary> /// </summary>
/// <param name="attacker">Card that attack.</param> /// <param name="attacker">Card that attack.</param>
/// <param name="defender">Card that defend.</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) public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{ {
if (attacker.RealPower <= 0) if (attacker.RealPower <= 0)
...@@ -68,9 +96,9 @@ namespace WindBot.Game.AI ...@@ -68,9 +96,9 @@ namespace WindBot.Game.AI
defender.RealPower = 5000; defender.RealPower = 5000;
if (defender.Id == _CardId.VampireFräulein && !defender.IsDisabled()) 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; defender.RealPower += 3000;
} }
...@@ -99,12 +127,27 @@ namespace WindBot.Game.AI ...@@ -99,12 +127,27 @@ namespace WindBot.Game.AI
return true; 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> /// <summary>
/// Destroy face-down cards first, in our turn. /// Destroy face-down cards first, in our turn.
/// </summary> /// </summary>
protected bool DefaultMysticalSpaceTyphoon() protected bool DefaultMysticalSpaceTyphoon()
{ {
foreach (ClientCard card in CurrentChain) foreach (ClientCard card in Duel.CurrentChain)
if (card.Id == _CardId.MysticalSpaceTyphoon) if (card.Id == _CardId.MysticalSpaceTyphoon)
return false; return false;
...@@ -137,10 +180,10 @@ namespace WindBot.Game.AI ...@@ -137,10 +180,10 @@ namespace WindBot.Game.AI
/// </summary> /// </summary>
protected bool DefaultCosmicCyclone() protected bool DefaultCosmicCyclone()
{ {
foreach (ClientCard card in CurrentChain) foreach (ClientCard card in Duel.CurrentChain)
if (card.Id == _CardId.CosmicCyclone) if (card.Id == _CardId.CosmicCyclone)
return false; return false;
return (Duel.LifePoints[0] > 1000) && DefaultMysticalSpaceTyphoon(); return (Bot.LifePoints > 1000) && DefaultMysticalSpaceTyphoon();
} }
/// <summary> /// <summary>
...@@ -243,11 +286,12 @@ namespace WindBot.Game.AI ...@@ -243,11 +286,12 @@ namespace WindBot.Game.AI
/// </summary> /// </summary>
protected bool DefaultBreakthroughSkill() protected bool DefaultBreakthroughSkill()
{ {
ClientCard LastChainCard = GetLastChainCard(); ClientCard LastChainCard = AI.Utils.GetLastChainCard();
if (LastChainCard == null) if (LastChainCard == null)
return false; return false;
AI.SelectCard(LastChainCard);
return LastChainCard.Controller == 1 && LastChainCard.Location == CardLocation.MonsterZone && DefaultUniqueTrap(); return LastChainCard.Controller == 1 && LastChainCard.Location == CardLocation.MonsterZone && DefaultUniqueTrap();
} }
...@@ -256,7 +300,7 @@ namespace WindBot.Game.AI ...@@ -256,7 +300,7 @@ namespace WindBot.Game.AI
/// </summary> /// </summary>
protected bool DefaultSolemnJudgment() 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> /// <summary>
...@@ -264,7 +308,7 @@ namespace WindBot.Game.AI ...@@ -264,7 +308,7 @@ namespace WindBot.Game.AI
/// </summary> /// </summary>
protected bool DefaultSolemnWarning() 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> /// <summary>
...@@ -272,7 +316,7 @@ namespace WindBot.Game.AI ...@@ -272,7 +316,7 @@ namespace WindBot.Game.AI
/// </summary> /// </summary>
protected bool DefaultSolemnStrike() 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> /// <summary>
...@@ -280,7 +324,7 @@ namespace WindBot.Game.AI ...@@ -280,7 +324,7 @@ namespace WindBot.Game.AI
/// </summary> /// </summary>
protected bool DefaultTorrentialTribute() protected bool DefaultTorrentialTribute()
{ {
return !HasChainedTrap(0) && AI.Utils.IsAllEnemyBetter(true); return !AI.Utils.HasChainedTrap(0) && AI.Utils.IsAllEnemyBetter(true);
} }
/// <summary> /// <summary>
...@@ -395,7 +439,7 @@ namespace WindBot.Game.AI ...@@ -395,7 +439,7 @@ namespace WindBot.Game.AI
/// </summary> /// </summary>
protected bool DefaultTrap() protected bool DefaultTrap()
{ {
return (LastChainPlayer == -1 && Duel.LastSummonPlayer != 0) || LastChainPlayer == 1; return (Duel.LastChainPlayer == -1 && Duel.LastSummonPlayer != 0) || Duel.LastChainPlayer == 1;
} }
/// <summary> /// <summary>
...@@ -403,7 +447,7 @@ namespace WindBot.Game.AI ...@@ -403,7 +447,7 @@ namespace WindBot.Game.AI
/// </summary> /// </summary>
protected bool DefaultUniqueTrap() protected bool DefaultUniqueTrap()
{ {
if (HasChainedTrap(0)) if (AI.Utils.HasChainedTrap(0))
return false; return false;
return UniqueFaceupSpell(); return UniqueFaceupSpell();
...@@ -445,7 +489,7 @@ namespace WindBot.Game.AI ...@@ -445,7 +489,7 @@ namespace WindBot.Game.AI
if (exec.Type == Type && exec.CardId == Card.Id) if (exec.Type == Type && exec.CardId == Card.Id)
return false; return false;
} }
return LastChainPlayer != 0; return Duel.LastChainPlayer != 0;
} }
/// <summary> /// <summary>
...@@ -459,12 +503,35 @@ namespace WindBot.Game.AI ...@@ -459,12 +503,35 @@ namespace WindBot.Game.AI
if (exec.Type == Type && exec.CardId == Card.Id) if (exec.Type == Type && exec.CardId == Card.Id)
count++; count++;
} }
if (count > 1 || Duel.LifePoints[0] <= 1000) if (count > 1 || Bot.LifePoints <= 1000)
return false; 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; 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 true;
}
return false; return false;
} }
...@@ -518,8 +585,8 @@ namespace WindBot.Game.AI ...@@ -518,8 +585,8 @@ namespace WindBot.Game.AI
return true; return true;
} }
} }
ClientCard lastchaincard = GetLastChainCard(); ClientCard lastchaincard = AI.Utils.GetLastChainCard();
if (LastChainPlayer == 1 && lastchaincard != null && !lastchaincard.IsDisabled()) if (Duel.LastChainPlayer == 1 && lastchaincard != null && !lastchaincard.IsDisabled())
{ {
if (lastchaincard.HasType(CardType.Ritual)) if (lastchaincard.HasType(CardType.Ritual))
{ {
...@@ -556,7 +623,7 @@ namespace WindBot.Game.AI ...@@ -556,7 +623,7 @@ namespace WindBot.Game.AI
} }
/// <summary> /// <summary>
/// Clever enough. /// Clever enough
/// </summary> /// </summary>
protected bool DefaultInterruptedKaijuSlumber() protected bool DefaultInterruptedKaijuSlumber()
{ {
...@@ -566,24 +633,34 @@ namespace WindBot.Game.AI ...@@ -566,24 +633,34 @@ namespace WindBot.Game.AI
{ {
_CardId.GamecieltheSeaTurtleKaiju, _CardId.GamecieltheSeaTurtleKaiju,
_CardId.KumongoustheStickyStringKaiju, _CardId.KumongoustheStickyStringKaiju,
_CardId.GadarlatheMysteryDustKaiju,
_CardId.RadiantheMultidimensionalKaiju, _CardId.RadiantheMultidimensionalKaiju,
_CardId.GadarlatheMysteryDustKaiju _CardId.DogorantheMadFlameKaiju,
_CardId.ThunderKingtheLightningstrikeKaiju,
_CardId.JizukirutheStarDestroyingKaiju,
}); });
return true; return true;
} }
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
_CardId.JizukirutheStarDestroyingKaiju, _CardId.JizukirutheStarDestroyingKaiju,
_CardId.ThunderKingtheLightningstrikeKaiju,
_CardId.DogorantheMadFlameKaiju,
_CardId.RadiantheMultidimensionalKaiju, _CardId.RadiantheMultidimensionalKaiju,
_CardId.GadarlatheMysteryDustKaiju, _CardId.GadarlatheMysteryDustKaiju,
_CardId.KumongoustheStickyStringKaiju _CardId.KumongoustheStickyStringKaiju,
_CardId.GamecieltheSeaTurtleKaiju,
}); });
AI.SelectNextCard(new[] AI.SelectNextCard(new[]
{ {
_CardId.SuperAntiKaijuWarMachineMechaDogoran,
_CardId.GamecieltheSeaTurtleKaiju, _CardId.GamecieltheSeaTurtleKaiju,
_CardId.KumongoustheStickyStringKaiju, _CardId.KumongoustheStickyStringKaiju,
_CardId.GadarlatheMysteryDustKaiju, _CardId.GadarlatheMysteryDustKaiju,
_CardId.RadiantheMultidimensionalKaiju _CardId.RadiantheMultidimensionalKaiju,
_CardId.DogorantheMadFlameKaiju,
_CardId.ThunderKingtheLightningstrikeKaiju,
}); });
return DefaultDarkHole(); return DefaultDarkHole();
} }
...@@ -638,6 +715,14 @@ namespace WindBot.Game.AI ...@@ -638,6 +715,14 @@ namespace WindBot.Game.AI
return AI.Utils.IsOneEnemyBetterThanValue(bestBotAttack, false); 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> /// <summary>
/// Summon when it can and should use effect. /// Summon when it can and should use effect.
/// </summary> /// </summary>
...@@ -691,7 +776,7 @@ namespace WindBot.Game.AI ...@@ -691,7 +776,7 @@ namespace WindBot.Game.AI
/// </summary> /// </summary>
protected bool DefaultStardustDragonEffect() protected bool DefaultStardustDragonEffect()
{ {
return (Card.Location == CardLocation.Grave) || LastChainPlayer == 1; return (Card.Location == CardLocation.Grave) || Duel.LastChainPlayer == 1;
} }
/// <summary> /// <summary>
...@@ -753,5 +838,20 @@ namespace WindBot.Game.AI ...@@ -753,5 +838,20 @@ namespace WindBot.Game.AI
return (oppoCount > 0 && selfCount <= oppoCount) || oppoCount >= 3; 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 @@ ...@@ -14,6 +14,7 @@
MetaionTheTimelord = 74530899, MetaionTheTimelord = 74530899,
KamionTheTimelord = 91712985, KamionTheTimelord = 91712985,
LazionTheTimelord = 92435533, LazionTheTimelord = 92435533,
EaterOfMillions = 63845230 EaterOfMillions = 63845230,
} ElShaddollConstruct = 20366274,
}
} }
namespace WindBot.Game.AI.Enums namespace WindBot.Game.AI.Enums
{ {
/// <summary> /// <summary>
/// Cards that restrict player from performing some action. Bot will preferentially destroy them. /// Cards that restrict player from performing some action. Bot will preferentially destroy them.
/// </summary> /// </summary>
public enum Floodgate public enum Floodgate
{ {
BarrierStatueoftheTorrent = 10963799, BarrierStatueoftheTorrent = 10963799,
BarrierStatueoftheDrought = 19740112, BarrierStatueoftheDrought = 19740112,
BarrierStatueoftheHeavens = 46145256, BarrierStatueoftheHeavens = 46145256,
BarrierStatueoftheInferno = 47961808, BarrierStatueoftheInferno = 47961808,
BarrierStatueoftheStormwinds = 73356503, BarrierStatueoftheStormwinds = 73356503,
BarrierStatueoftheAbyss = 84478195, BarrierStatueoftheAbyss = 84478195,
ThunderKingRaiOh = 71564252, ThunderKingRaiOh = 71564252,
FossilDynaPachycephalo = 42009836, FossilDynaPachycephalo = 42009836,
VanitysFiend = 47084486, VanitysFiend = 47084486,
MajestysFiend = 33746252, MajestysFiend = 33746252,
VanitysRuler = 72634965, VanitysRuler = 72634965,
KycootheGhostDestroyer = 88240808, KycootheGhostDestroyer = 88240808,
ConsecratedLight = 2980764, ConsecratedLight = 2980764,
ArchlordKristya = 59509952, ArchlordKristya = 59509952,
KoakiMeiruDrago = 12435193, KoakiMeiruDrago = 12435193,
DenkoSekka = 13974207, DenkoSekka = 13974207,
ZapMustung = 29951323, ZapMustung = 29951323,
Jinzo = 77585513, Jinzo = 77585513,
SpellCanceller = 84636823, SpellCanceller = 84636823,
LevelLimitAreaB = 3136426, LevelLimitAreaB = 3136426,
DimensionalFissure = 81674782, DimensionalFissure = 81674782,
Necrovalley = 47355498, Necrovalley = 47355498,
SavageColosseum = 32391631, SavageColosseum = 32391631,
SecretVillageoftheSpellcasters = 68462976, SecretVillageoftheSpellcasters = 68462976,
SwordsofRevealingLight = 72302403, SwordsofRevealingLight = 72302403,
MessengerofPeace = 44656491, MessengerofPeace = 44656491,
KaiserColosseum = 35059553, KaiserColosseum = 35059553,
DomainoftheTrueMonarchs = 84171830, DomainoftheTrueMonarchs = 84171830,
ZombieWorld = 4064256, ZombieWorld = 4064256,
ImperialOrder = 61740673, ImperialOrder = 61740673,
MacroCosmos = 30241314, MacroCosmos = 30241314,
MindDrain = 68937720, MindDrain = 68937720,
SoulDrain = 73599290, SoulDrain = 73599290,
SkillDrain = 82732705, SkillDrain = 82732705,
Eisbahn = 54059040, Eisbahn = 54059040,
GozenMatch = 53334471, GozenMatch = 53334471,
RivalryofWarlords = 90846359, RivalryofWarlords = 90846359,
AntiSpellFragrance = 58921041, AntiSpellFragrance = 58921041,
LightImprisoningMirror = 53341729, LightImprisoningMirror = 53341729,
ShadowImprisoningMirror = 99735427, ShadowImprisoningMirror = 99735427,
WallofRevealingLight = 17078030, WallofRevealingLight = 17078030,
GravityBind = 85742772, GravityBind = 85742772,
VanitysEmptiness = 5851097, VanitysEmptiness = 5851097,
Lose1Turn = 24348804, Lose1Turn = 24348804,
Reqliate = 20426907, Reqliate = 20426907,
SummonLimit = 23516703, SummonLimit = 23516703,
AndtheBandPlayedOn = 47594939, AndtheBandPlayedOn = 47594939,
StygianDirge = 81489939, StygianDirge = 81489939,
RoyalDecree = 51452091, RoyalDecree = 51452091,
ImperialIronWall = 30459350, ImperialIronWall = 30459350,
DNASurgery = 74701381, DNASurgery = 74701381,
NaturiaExterio = 99916754, NaturiaExterio = 99916754,
TheLastWarriorfromAnotherPlanet = 86099788, TheLastWarriorfromAnotherPlanet = 86099788,
ThousandEyesRestrict = 63519819, ThousandEyesRestrict = 63519819,
ElShaddollWinda = 94977269, ElShaddollWinda = 94977269,
MaskedHERODarkLaw = 58481572, MaskedHERODarkLaw = 58481572,
NaturiaBeast = 33198837, NaturiaBeast = 33198837,
NaturiaBarkion = 2956282, NaturiaBarkion = 2956282,
EvilswarmOphion = 91279700, EvilswarmOphion = 91279700,
MermailAbyssgaios = 74371660, MermailAbyssgaios = 74371660,
AbyssDweller = 21044178, AbyssDweller = 21044178,
ZoodiacDrident = 48905153 ZoodiacDrident = 48905153
} }
} }
...@@ -21,9 +21,6 @@ namespace WindBot.Game.AI ...@@ -21,9 +21,6 @@ namespace WindBot.Game.AI
protected ClientCard Card { get; private set; } protected ClientCard Card { get; private set; }
protected int ActivateDescription { 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 Bot { get; private set; }
protected ClientField Enemy { get; private set; } protected ClientField Enemy { get; private set; }
...@@ -33,9 +30,6 @@ namespace WindBot.Game.AI ...@@ -33,9 +30,6 @@ namespace WindBot.Game.AI
AI = ai; AI = ai;
Executors = new List<CardExecutor>(); Executors = new List<CardExecutor>();
LastChainPlayer = -1;
CurrentChain = new List<ClientCard>();
Bot = Duel.Fields[0]; Bot = Duel.Fields[0];
Enemy = Duel.Fields[1]; Enemy = Duel.Fields[1];
} }
...@@ -58,47 +52,26 @@ namespace WindBot.Game.AI ...@@ -58,47 +52,26 @@ namespace WindBot.Game.AI
/// <returns>A new BattlePhaseAction containing the action to do.</returns> /// <returns>A new BattlePhaseAction containing the action to do.</returns>
public virtual BattlePhaseAction OnBattle(IList<ClientCard> attackers, IList<ClientCard> defenders) public virtual BattlePhaseAction OnBattle(IList<ClientCard> attackers, IList<ClientCard> defenders)
{ {
if (attackers.Count == 0) // For overriding
return AI.ToMainPhase2(); return null;
}
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);
}
}
if (!Battle.CanMainPhaseTwo) /// <summary>
return AI.Attack(attackers[0], (defenders.Count == 0) ? null : defenders[0]); /// 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) public virtual bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
...@@ -109,14 +82,12 @@ namespace WindBot.Game.AI ...@@ -109,14 +82,12 @@ namespace WindBot.Game.AI
public virtual void OnChaining(int player, ClientCard card) public virtual void OnChaining(int player, ClientCard card)
{ {
CurrentChain.Add(card);
LastChainPlayer = player;
} }
public virtual void OnChainEnd() public virtual void OnChainEnd()
{ {
LastChainPlayer = -1;
CurrentChain.Clear();
} }
public virtual void OnNewTurn() public virtual void OnNewTurn()
...@@ -182,44 +153,12 @@ namespace WindBot.Game.AI ...@@ -182,44 +153,12 @@ namespace WindBot.Game.AI
return -1; return -1;
} }
public bool ChainContainsCard(int id) public virtual bool OnSelectBattleReplay()
{
foreach (ClientCard card in CurrentChain)
{
if (card.Id == id)
return true;
}
return false;
}
public int ChainCountPlayer(int player)
{ {
int count = 0; // Overrided in DefalultExecutor
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;
}
return false; return false;
} }
public ClientCard GetLastChainCard()
{
if (CurrentChain.Count > 0)
return CurrentChain[CurrentChain.Count - 1];
return null;
}
public void SetMain(MainPhase main) public void SetMain(MainPhase main)
{ {
Main = main; Main = main;
......
...@@ -36,6 +36,7 @@ namespace WindBot.Game ...@@ -36,6 +36,7 @@ namespace WindBot.Game
public bool CanDirectAttack { get; set; } public bool CanDirectAttack { get; set; }
public bool ShouldDirectAttack { get; set; } public bool ShouldDirectAttack { get; set; }
public bool Attacked { get; set; } public bool Attacked { get; set; }
public bool IsLastAttacker { get; set; }
public int[] ActionIndex { get; set; } public int[] ActionIndex { get; set; }
public IDictionary<int, int> ActionActivateIndex { get; private set; } public IDictionary<int, int> ActionActivateIndex { get; private set; }
......
...@@ -13,6 +13,9 @@ namespace WindBot.Game ...@@ -13,6 +13,9 @@ namespace WindBot.Game
public IList<ClientCard> Deck { get; private set; } public IList<ClientCard> Deck { get; private set; }
public IList<ClientCard> ExtraDeck { get; private set; } public IList<ClientCard> ExtraDeck { get; private set; }
public int LifePoints;
public ClientCard BattlingMonster;
public ClientField() public ClientField()
{ {
} }
...@@ -33,6 +36,15 @@ namespace WindBot.Game ...@@ -33,6 +36,15 @@ namespace WindBot.Game
ExtraDeck.Add(new ClientCard(0, CardLocation.Extra)); 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() public int GetMonsterCount()
{ {
return GetCount(MonsterZone); return GetCount(MonsterZone);
...@@ -58,6 +70,19 @@ namespace WindBot.Game ...@@ -58,6 +70,19 @@ namespace WindBot.Game
} }
return count; return count;
} }
public int GetFieldCount()
{
return GetSpellCount() + GetMonsterCount();
}
public int GetFieldHandCount()
{
return GetSpellCount() + GetMonsterCount() + GetHandCount();
}
public bool IsFieldEmpty() public bool IsFieldEmpty()
{ {
...@@ -68,6 +93,7 @@ namespace WindBot.Game ...@@ -68,6 +93,7 @@ namespace WindBot.Game
{ {
return GetCards(MonsterZone); return GetCards(MonsterZone);
} }
public List<ClientCard> GetGraveyardMonsters() public List<ClientCard> GetGraveyardMonsters()
{ {
......
...@@ -8,7 +8,6 @@ namespace WindBot.Game ...@@ -8,7 +8,6 @@ namespace WindBot.Game
public bool IsFirst { get; set; } public bool IsFirst { get; set; }
public bool IsNewRule { get; set; } public bool IsNewRule { get; set; }
public int[] LifePoints { get; private set; }
public ClientField[] Fields { get; private set; } public ClientField[] Fields { get; private set; }
public int Turn { get; set; } public int Turn { get; set; }
...@@ -16,15 +15,19 @@ namespace WindBot.Game ...@@ -16,15 +15,19 @@ namespace WindBot.Game
public DuelPhase Phase { get; set; } public DuelPhase Phase { get; set; }
public MainPhase MainPhase { get; set; } public MainPhase MainPhase { get; set; }
public BattlePhase BattlePhase { 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 IList<ClientCard> ChainTargets { get; set; }
public int LastSummonPlayer { get; set; } public int LastSummonPlayer { get; set; }
public Duel() public Duel()
{ {
LifePoints = new int[2];
Fields = new ClientField[2]; Fields = new ClientField[2];
Fields[0] = new ClientField(); Fields[0] = new ClientField();
Fields[1] = new ClientField(); Fields[1] = new ClientField();
LastChainPlayer = -1;
CurrentChain = new List<ClientCard>();
ChainTargets = new List<ClientCard>(); ChainTargets = new List<ClientCard>();
LastSummonPlayer = -1; LastSummonPlayer = -1;
} }
......
using System.Linq; using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using WindBot.Game.AI; using WindBot.Game.AI;
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
...@@ -90,9 +90,6 @@ namespace WindBot.Game ...@@ -90,9 +90,6 @@ namespace WindBot.Game
m_option = -1; m_option = -1;
m_yesno = -1; m_yesno = -1;
m_position = CardPosition.FaceUpAttack; m_position = CardPosition.FaceUpAttack;
m_attacker = null;
m_defender = null;
Duel.LastSummonPlayer = -1;
if (Duel.Player == 0 && Duel.Phase == DuelPhase.Draw) if (Duel.Player == 0 && Duel.Phase == DuelPhase.Draw)
{ {
_dialogs.SendNewTurn(); _dialogs.SendNewTurn();
...@@ -114,7 +111,6 @@ namespace WindBot.Game ...@@ -114,7 +111,6 @@ namespace WindBot.Game
/// <param name="player">Player who is currently chaining.</param> /// <param name="player">Player who is currently chaining.</param>
public void OnChaining(ClientCard card, int player) public void OnChaining(ClientCard card, int player)
{ {
Duel.LastSummonPlayer = -1;
Executor.OnChaining(player,card); Executor.OnChaining(player,card);
} }
...@@ -147,13 +143,57 @@ namespace WindBot.Game ...@@ -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); List<ClientCard> attackers = new List<ClientCard>(battle.AttackableCards);
attackers.Sort(AIFunctions.CompareCardAttack); attackers.Sort(AIFunctions.CompareCardAttack);
attackers.Reverse();
List<ClientCard> defenders = new List<ClientCard>(Duel.Fields[1].GetMonsters()); List<ClientCard> defenders = new List<ClientCard>(Duel.Fields[1].GetMonsters());
defenders.Sort(AIFunctions.CompareDefensePower); 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> /// <summary>
...@@ -607,6 +647,15 @@ namespace WindBot.Game ...@@ -607,6 +647,15 @@ namespace WindBot.Game
return Executor.OnSelectYesNo(desc); 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> /// <summary>
/// Called when the AI has to declare a card. /// Called when the AI has to declare a card.
/// </summary> /// </summary>
...@@ -630,27 +679,9 @@ namespace WindBot.Game ...@@ -630,27 +679,9 @@ namespace WindBot.Game
private int m_number; private int m_number;
private int m_announce; private int m_announce;
private int m_yesno; private int m_yesno;
private ClientCard m_attacker;
private ClientCard m_defender;
private IList<CardAttribute> m_attributes = new List<CardAttribute>(); private IList<CardAttribute> m_attributes = new List<CardAttribute>();
private IList<CardRace> m_races = new List<CardRace>(); 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) public void SelectCard(ClientCard card)
{ {
m_selector = new CardSelector(card); m_selector = new CardSelector(card);
...@@ -916,4 +947,4 @@ namespace WindBot.Game ...@@ -916,4 +947,4 @@ namespace WindBot.Game
return false; return false;
} }
} }
} }
\ No newline at end of file
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
...@@ -108,6 +108,7 @@ namespace WindBot.Game ...@@ -108,6 +108,7 @@ namespace WindBot.Game
_messages.Add(GameMessage.BecomeTarget, OnBecomeTarget); _messages.Add(GameMessage.BecomeTarget, OnBecomeTarget);
_messages.Add(GameMessage.SelectBattleCmd, OnSelectBattleCmd); _messages.Add(GameMessage.SelectBattleCmd, OnSelectBattleCmd);
_messages.Add(GameMessage.SelectCard, OnSelectCard); _messages.Add(GameMessage.SelectCard, OnSelectCard);
_messages.Add(GameMessage.SelectUnselectCard, OnSelectUnselectCard);
_messages.Add(GameMessage.SelectChain, OnSelectChain); _messages.Add(GameMessage.SelectChain, OnSelectChain);
_messages.Add(GameMessage.SelectCounter, OnSelectCounter); _messages.Add(GameMessage.SelectCounter, OnSelectCounter);
_messages.Add(GameMessage.SelectDisfield, OnSelectDisfield); _messages.Add(GameMessage.SelectDisfield, OnSelectDisfield);
...@@ -327,8 +328,8 @@ namespace WindBot.Game ...@@ -327,8 +328,8 @@ namespace WindBot.Game
int type = packet.ReadByte(); int type = packet.ReadByte();
_duel.IsFirst = (type & 0xF) == 0; _duel.IsFirst = (type & 0xF) == 0;
_duel.Turn = 0; _duel.Turn = 0;
_duel.LifePoints[GetLocalPlayer(0)] = packet.ReadInt32(); _duel.Fields[GetLocalPlayer(0)].LifePoints = packet.ReadInt32();
_duel.LifePoints[GetLocalPlayer(1)] = packet.ReadInt32(); _duel.Fields[GetLocalPlayer(1)].LifePoints = packet.ReadInt32();
int deck = packet.ReadInt16(); int deck = packet.ReadInt16();
int extra = packet.ReadInt16(); int extra = packet.ReadInt16();
_duel.Fields[GetLocalPlayer(0)].Init(deck, extra); _duel.Fields[GetLocalPlayer(0)].Init(deck, extra);
...@@ -424,27 +425,30 @@ namespace WindBot.Game ...@@ -424,27 +425,30 @@ namespace WindBot.Game
private void OnNewPhase(BinaryReader packet) private void OnNewPhase(BinaryReader packet)
{ {
_duel.Phase = (DuelPhase)packet.ReadInt16(); _duel.Phase = (DuelPhase)packet.ReadInt16();
_duel.LastSummonPlayer = -1;
_duel.Fields[0].BattlingMonster = null;
_duel.Fields[1].BattlingMonster = null;
_ai.OnNewPhase(); _ai.OnNewPhase();
} }
private void OnDamage(BinaryReader packet) private void OnDamage(BinaryReader packet)
{ {
int player = GetLocalPlayer(packet.ReadByte()); 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; if (final < 0) final = 0;
_duel.LifePoints[player] = final; _duel.Fields[player].LifePoints = final;
} }
private void OnRecover(BinaryReader packet) private void OnRecover(BinaryReader packet)
{ {
int player = GetLocalPlayer(packet.ReadByte()); int player = GetLocalPlayer(packet.ReadByte());
_duel.LifePoints[player] += packet.ReadInt32(); _duel.Fields[player].LifePoints += packet.ReadInt32();
} }
private void OnLpUpdate(BinaryReader packet) private void OnLpUpdate(BinaryReader packet)
{ {
int player = GetLocalPlayer(packet.ReadByte()); int player = GetLocalPlayer(packet.ReadByte());
_duel.LifePoints[player] = packet.ReadInt32(); _duel.Fields[player].LifePoints = packet.ReadInt32();
} }
private void OnMove(BinaryReader packet) private void OnMove(BinaryReader packet)
...@@ -497,13 +501,16 @@ namespace WindBot.Game ...@@ -497,13 +501,16 @@ namespace WindBot.Game
int la = packet.ReadByte(); int la = packet.ReadByte();
int sa = packet.ReadByte(); int sa = packet.ReadByte();
packet.ReadByte(); // packet.ReadByte(); //
int cd = GetLocalPlayer(packet.ReadByte()); // cd int cd = GetLocalPlayer(packet.ReadByte());
int ld = packet.ReadByte(); int ld = packet.ReadByte();
int sd = packet.ReadByte(); // sd int sd = packet.ReadByte();
packet.ReadByte(); // packet.ReadByte(); //
ClientCard attackcard = _duel.GetCard(ca, (CardLocation)la, sa); ClientCard attackcard = _duel.GetCard(ca, (CardLocation)la, sa);
ClientCard defendcard = _duel.GetCard(cd, (CardLocation)ld, sd); 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)) if (ld == 0 && (attackcard != null) && (ca != 0))
{ {
_ai.OnDirectAttack(attackcard); _ai.OnDirectAttack(attackcard);
...@@ -534,11 +541,17 @@ namespace WindBot.Game ...@@ -534,11 +541,17 @@ namespace WindBot.Game
int cc = GetLocalPlayer(packet.ReadByte()); int cc = GetLocalPlayer(packet.ReadByte());
_ai.OnChaining(card, cc); _ai.OnChaining(card, cc);
_duel.ChainTargets.Clear(); _duel.ChainTargets.Clear();
_duel.LastSummonPlayer = -1;
_duel.CurrentChain.Add(card);
_duel.LastChainPlayer = cc;
} }
private void OnChainEnd(BinaryReader packet) private void OnChainEnd(BinaryReader packet)
{ {
_ai.OnChainEnd(); _ai.OnChainEnd();
_duel.LastChainPlayer = -1;
_duel.CurrentChain.Clear();
//_duel.ChainTargets.Clear(); //_duel.ChainTargets.Clear();
} }
...@@ -1170,7 +1183,12 @@ namespace WindBot.Game ...@@ -1170,7 +1183,12 @@ namespace WindBot.Game
private void OnSelectYesNo(BinaryReader packet) private void OnSelectYesNo(BinaryReader packet)
{ {
packet.ReadByte(); // player 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); Connection.Send(CtosMessage.Response, reply);
} }
......
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
<Compile Include="Game\AI\Decks\EvilswarmExecutor.cs" /> <Compile Include="Game\AI\Decks\EvilswarmExecutor.cs" />
<Compile Include="Game\AI\Decks\GraydleExecutor.cs" /> <Compile Include="Game\AI\Decks\GraydleExecutor.cs" />
<Compile Include="Game\AI\Decks\LightswornExecutor.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\QliphortExecutor.cs" />
<Compile Include="Game\AI\Decks\ST1732Executor.cs" /> <Compile Include="Game\AI\Decks\ST1732Executor.cs" />
<Compile Include="Game\AI\Decks\TrickstarExecutor.cs" /> <Compile Include="Game\AI\Decks\TrickstarExecutor.cs" />
......
using System; using System;
namespace WindBot 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