Commit 0974c33d authored by mercury233's avatar mercury233
parents 124f7da2 e85abe26
#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
...@@ -76,18 +76,3 @@ ...@@ -76,18 +76,3 @@
50588353 50588353
50588353 50588353
!side !side
67696066
73176465
37742478
15341821
54757758
13529466
74586817
6983839
82633039
46772449
1861629
1845204
53129443
43898403
48130397
#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
#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}嗎?"
]
}
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
"duelstart": [ "duelstart": [
"這只是AI,打贏不要太高興阿。", "這只是AI,打贏不要太高興阿。",
"十分致謝233服讓我們有遊戲可以玩,別忘記去拜訪他們。", "十分致謝233服讓我們有遊戲可以玩,別忘記去拜訪他們。",
"反主流學院請洽NOVA。", "反主流學院請洽NOVA。"
], ],
"newturn": [ "newturn": [
"到我的回合了,抽牌!", "到我的回合了,抽牌!",
...@@ -71,7 +70,6 @@ ...@@ -71,7 +70,6 @@
"看這裡!發動{0}!", "看這裡!發動{0}!",
"我使用{0}的力量。", "我使用{0}的力量。",
"很不錯的戰術...但是我拒絕!{0}!", "很不錯的戰術...但是我拒絕!{0}!",
"真不愧是納粹,竟然能識破我的蓋牌......你說你只是單純的決鬥者?{0},發動!",
"看樣子你忘了我的{0}!", "看樣子你忘了我的{0}!",
"你考慮過我有{0}嗎?" "你考慮過我有{0}嗎?"
] ]
......
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
{ {
// 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
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("Test", "AI_Test", "Test")] [Deck("Test", "AI_Test", "Test")]
public class DoEverythingExecutor : DefaultExecutor public class DoEverythingExecutor : DefaultExecutor
{ {
public class CardId public class CardId
{ {
public const int LeoWizard = 4392470; public const int LeoWizard = 4392470;
public const int Bunilla = 69380702; public const int Bunilla = 69380702;
} }
public DoEverythingExecutor(GameAI ai, Duel duel) public DoEverythingExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
AddExecutor(ExecutorType.SpSummon); AddExecutor(ExecutorType.SpSummon);
AddExecutor(ExecutorType.Activate, DefaultDontChainMyself); AddExecutor(ExecutorType.Activate, DefaultDontChainMyself);
AddExecutor(ExecutorType.SummonOrSet); AddExecutor(ExecutorType.SummonOrSet);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos); AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.SpellSet); AddExecutor(ExecutorType.SpellSet);
} }
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)
{ {
if (Duel.Phase == DuelPhase.BattleStart) if (Duel.Phase == DuelPhase.BattleStart)
return null; return null;
IList<ClientCard> selected = new List<ClientCard>(); IList<ClientCard> selected = new List<ClientCard>();
// select the last cards // select the last cards
for (int i = 1; i <= max; ++i) for (int i = 1; i <= max; ++i)
selected.Add(cards[cards.Count-i]); selected.Add(cards[cards.Count-i]);
return selected; return selected;
} }
public override int OnSelectOption(IList<int> options) public override int OnSelectOption(IList<int> options)
{ {
return Program.Rand.Next(options.Count); return Program.Rand.Next(options.Count);
} }
} }
} }
\ 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("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
...@@ -22,7 +22,7 @@ namespace WindBot.Game.AI.Decks ...@@ -22,7 +22,7 @@ namespace WindBot.Game.AI.Decks
public const int GiantRex = 80280944; public const int GiantRex = 80280944;
public const int ShaddollDragon = 77723643; public const int ShaddollDragon = 77723643;
public const int FairyTailSnow = 55623480; public const int FairyTailSnow = 55623480;
public const int KeeeperOfDragonicMagic = 48048590; public const int KeeperOfDragonicMagic = 48048590;
public const int ShaddollSquamata = 30328508; public const int ShaddollSquamata = 30328508;
public const int SouleatingOviraptor = 44335251; public const int SouleatingOviraptor = 44335251;
public const int Raiden = 77558536; public const int Raiden = 77558536;
...@@ -34,7 +34,7 @@ namespace WindBot.Game.AI.Decks ...@@ -34,7 +34,7 @@ namespace WindBot.Game.AI.Decks
public const int MaxxC = 23434538; public const int MaxxC = 23434538;
public const int PlaguespreaderZombie = 33420078; public const int PlaguespreaderZombie = 33420078;
public const int GlowUpBulb = 67441435; public const int GlowUpBulb = 67441435;
//spell //spell
public const int AllureofDarkness = 1475311; public const int AllureofDarkness = 1475311;
public const int ThatGrassLooksgreener = 11110587; public const int ThatGrassLooksgreener = 11110587;
...@@ -53,7 +53,7 @@ namespace WindBot.Game.AI.Decks ...@@ -53,7 +53,7 @@ namespace WindBot.Game.AI.Decks
public const int LostWind = 74003290; public const int LostWind = 74003290;
public const int SinisterShadowGames = 77505534; public const int SinisterShadowGames = 77505534;
public const int ShaddollCore = 4904633; public const int ShaddollCore = 4904633;
//extra //extra
public const int ElShaddollShekhinaga = 74822425; public const int ElShaddollShekhinaga = 74822425;
public const int ElShaddollConstruct = 20366274; public const int ElShaddollConstruct = 20366274;
...@@ -72,36 +72,38 @@ namespace WindBot.Game.AI.Decks ...@@ -72,36 +72,38 @@ namespace WindBot.Game.AI.Decks
} }
bool Pillused = false; bool Pillused = false;
bool CrystalWingSynchroDragoneff_used = false;
bool OvertexCoatlseff_used = false;
public LightswornShaddoldinosour(GameAI ai, Duel duel) public LightswornShaddoldinosour(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
{ {
//counter //counter
AddExecutor(ExecutorType.SpSummon, CardId.CrystalWingSynchroDragon, CrystalWingSynchroDragonesp);
AddExecutor(ExecutorType.Activate, CardId.GhostOgre, Hand_act_eff); AddExecutor(ExecutorType.Activate, CardId.GhostOgre, Hand_act_eff);
AddExecutor(ExecutorType.Activate, CardId.AshBlossom, Hand_act_eff); AddExecutor(ExecutorType.Activate, CardId.AshBlossom, Hand_act_eff);
AddExecutor(ExecutorType.Activate, CardId.MaxxC,MaxxC); AddExecutor(ExecutorType.Activate, CardId.MaxxC,MaxxC);
//first do //first do
AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst); AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster, DefaultHarpiesFeatherDusterFirst);
AddExecutor(ExecutorType.Activate, CardId.infiniteTransience, infiniteTransience); AddExecutor(ExecutorType.Activate, CardId.infiniteTransience, DefaultBreakthroughSkill);
AddExecutor(ExecutorType.Activate, CardId.ThatGrassLooksgreener); AddExecutor(ExecutorType.Activate, CardId.ThatGrassLooksgreener);
AddExecutor(ExecutorType.Summon, CardId.SouleatingOviraptor); AddExecutor(ExecutorType.Summon, CardId.SouleatingOviraptor);
AddExecutor(ExecutorType.Activate, CardId.SouleatingOviraptor, SouleatingOviraptor); AddExecutor(ExecutorType.Activate, CardId.SouleatingOviraptor, SouleatingOviraptoreff);
AddExecutor(ExecutorType.Activate, CardId.AllureofDarkness, AllureofDarkness); AddExecutor(ExecutorType.Activate, CardId.AllureofDarkness, DefaultAllureofDarkness);
AddExecutor(ExecutorType.Activate, CardId.PotOfAvarice, PotofAvarice); AddExecutor(ExecutorType.Activate, CardId.PotOfAvarice, PotofAvarice);
// AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster); // AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster);
AddExecutor(ExecutorType.Activate, CardId.ChargeOfTheLightBrigade, ChargeOfTheLightBrigadeEffect); AddExecutor(ExecutorType.Activate, CardId.ChargeOfTheLightBrigade, ChargeOfTheLightBrigadeEffect);
AddExecutor(ExecutorType.Activate, CardId.FoolishBurial, FoolishBurialEffect); AddExecutor(ExecutorType.Activate, CardId.FoolishBurial, FoolishBurialEffect);
AddExecutor(ExecutorType.Activate, CardId.InterruptedKaijuSlumber, DefaultInterruptedKaijuSlumber); AddExecutor(ExecutorType.Activate, CardId.InterruptedKaijuSlumber, DefaultInterruptedKaijuSlumber);
AddExecutor(ExecutorType.Activate, CardId.ShaddollFusion, ShaddollFusion); AddExecutor(ExecutorType.Activate, CardId.ShaddollFusion, ShaddollFusioneff);
//Reborn //Reborn
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, RebornEffect); AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, RebornEffect);
//Normal Summon //Normal Summon
AddExecutor(ExecutorType.Summon, CardId.Raiden); AddExecutor(ExecutorType.Summon, CardId.Raiden);
AddExecutor(ExecutorType.Activate, CardId.Raiden); AddExecutor(ExecutorType.Activate, CardId.Raiden);
AddExecutor(ExecutorType.Summon , CardId.KeeeperOfDragonicMagic); AddExecutor(ExecutorType.Summon , CardId.KeeperOfDragonicMagic);
AddExecutor(ExecutorType.Activate, CardId.KeeeperOfDragonicMagic, KeeeperOfDragonicMagic); AddExecutor(ExecutorType.Activate, CardId.KeeperOfDragonicMagic, KeeperOfDragonicMagic);
AddExecutor(ExecutorType.MonsterSet, CardId.ShaddollSquamata); AddExecutor(ExecutorType.MonsterSet, CardId.ShaddollSquamata);
AddExecutor(ExecutorType.MonsterSet, CardId.GlowUpBulb); AddExecutor(ExecutorType.MonsterSet, CardId.GlowUpBulb);
AddExecutor(ExecutorType.MonsterSet, CardId.ShaddollHedgehog); AddExecutor(ExecutorType.MonsterSet, CardId.ShaddollHedgehog);
...@@ -112,28 +114,30 @@ namespace WindBot.Game.AI.Decks ...@@ -112,28 +114,30 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.Lumina); AddExecutor(ExecutorType.Activate, CardId.Lumina);
//Sp Summon //Sp Summon
AddExecutor(ExecutorType.SpSummon, CardId.UltimateConductorTytanno, UltimateConductorTytannosp); AddExecutor(ExecutorType.SpSummon, CardId.UltimateConductorTytanno, UltimateConductorTytannosp);
AddExecutor(ExecutorType.Activate, CardId.UltimateConductorTytanno, UltimateConductorTytanno); AddExecutor(ExecutorType.Activate, CardId.UltimateConductorTytanno, UltimateConductorTytannoeff);
AddExecutor(ExecutorType.Activate, CardId.DoubleEvolutionPill, DoubleEvolutionPill); AddExecutor(ExecutorType.Activate, CardId.DoubleEvolutionPill, DoubleEvolutionPilleff);
AddExecutor(ExecutorType.SpSummon, CardId.MinervaTheExalte); AddExecutor(ExecutorType.SpSummon, CardId.MinervaTheExalte);
AddExecutor(ExecutorType.Activate, CardId.MinervaTheExalte, MinervaTheExaltedEffect); AddExecutor(ExecutorType.Activate, CardId.MinervaTheExalte, MinervaTheExaltedEffect);
AddExecutor(ExecutorType.SpSummon, CardId.GamecieltheSeaTurtleKaiju, DefaultKaijuSpsummon);
//activate //activate
AddExecutor(ExecutorType.Activate , CardId.GlowUpBulb,GlowUpBulb); AddExecutor(ExecutorType.SpSummon , CardId.GlowUpBulb,GlowUpBulbeff);
//activate chain //activate chain
AddExecutor(ExecutorType.Activate, CardId.OvertexCoatls); AddExecutor(ExecutorType.Activate, CardId.OvertexCoatls, OvertexCoatlseff);
AddExecutor(ExecutorType.Activate, CardId.ShaddollBeast); AddExecutor(ExecutorType.Activate, CardId.ShaddollBeast);
AddExecutor(ExecutorType.Activate, CardId.ShaddollFalco, ShaddollFalco); AddExecutor(ExecutorType.Activate, CardId.ShaddollFalco, ShaddollFalcoeff);
AddExecutor(ExecutorType.Activate, CardId.ShaddollSquamata, ShaddollSquamata); AddExecutor(ExecutorType.Activate, CardId.ShaddollSquamata, ShaddollSquamataeff);
AddExecutor(ExecutorType.Activate, CardId.ShaddollDragon); AddExecutor(ExecutorType.Activate, CardId.ShaddollDragon, ShaddollDragoneff);
AddExecutor(ExecutorType.Activate, CardId.ShaddollHedgehog); AddExecutor(ExecutorType.Activate, CardId.ShaddollHedgehog, ShaddollHedgehogeff);
AddExecutor(ExecutorType.Activate, CardId.GiantRex); AddExecutor(ExecutorType.Activate, CardId.GiantRex);
AddExecutor(ExecutorType.Activate, CardId.ElShaddollConstruct); AddExecutor(ExecutorType.Activate, CardId.ElShaddollConstruct);
AddExecutor(ExecutorType.Activate, CardId.ElShaddollGrysra); AddExecutor(ExecutorType.Activate, CardId.ElShaddollGrysra);
AddExecutor(ExecutorType.Activate, CardId.ElShaddollShekhinaga); AddExecutor(ExecutorType.Activate, CardId.ElShaddollShekhinaga, ElShaddollShekhinagaeff);
AddExecutor(ExecutorType.Activate, CardId.ElShaddollWinda); AddExecutor(ExecutorType.Activate, CardId.ElShaddollWinda);
AddExecutor(ExecutorType.Activate, CardId.CrystalWingSynchroDragon, CrystalWingSynchroDragoneff);
AddExecutor(ExecutorType.Activate, CardId.TG_WonderMagician); AddExecutor(ExecutorType.Activate, CardId.TG_WonderMagician);
//spellset //spellset
AddExecutor(ExecutorType.SpellSet, CardId.MonsterReborn, spellset); AddExecutor(ExecutorType.SpellSet, CardId.MonsterReborn, spellset);
...@@ -142,7 +146,7 @@ namespace WindBot.Game.AI.Decks ...@@ -142,7 +146,7 @@ namespace WindBot.Game.AI.Decks
//trap //trap
AddExecutor(ExecutorType.SpellSet, CardId.LostWind, TrapSetWhenZoneFree); AddExecutor(ExecutorType.SpellSet, CardId.LostWind, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.SinisterShadowGames, TrapSetWhenZoneFree); AddExecutor(ExecutorType.SpellSet, CardId.SinisterShadowGames, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.ShaddollCore); AddExecutor(ExecutorType.SpellSet, CardId.ShaddollCore);
AddExecutor(ExecutorType.SpellSet, CardId.infiniteTransience, SetIsFieldEmpty); AddExecutor(ExecutorType.SpellSet, CardId.infiniteTransience, SetIsFieldEmpty);
//trap activate //trap activate
AddExecutor(ExecutorType.Activate, CardId.LostWind, DefaultBreakthroughSkill); AddExecutor(ExecutorType.Activate, CardId.LostWind, DefaultBreakthroughSkill);
...@@ -163,7 +167,7 @@ namespace WindBot.Game.AI.Decks ...@@ -163,7 +167,7 @@ namespace WindBot.Game.AI.Decks
CardId.GiantRex, CardId.GiantRex,
CardId.ShaddollDragon, CardId.ShaddollDragon,
CardId.FairyTailSnow, CardId.FairyTailSnow,
CardId.KeeeperOfDragonicMagic, CardId.KeeperOfDragonicMagic,
CardId.ShaddollSquamata, CardId.ShaddollSquamata,
CardId.SouleatingOviraptor, CardId.SouleatingOviraptor,
CardId.Raiden, CardId.Raiden,
...@@ -206,19 +210,75 @@ namespace WindBot.Game.AI.Decks ...@@ -206,19 +210,75 @@ namespace WindBot.Game.AI.Decks
CardId.ChargeOfTheLightBrigade, CardId.ChargeOfTheLightBrigade,
CardId.FoolishBurial, CardId.FoolishBurial,
CardId.HarpiesFeatherDuster, CardId.HarpiesFeatherDuster,
CardId.ThatGrassLooksgreener, CardId.ThatGrassLooksgreener,
CardId.FairyTailSnow, CardId.FairyTailSnow,
CardId.GiantRex, CardId.GiantRex,
CardId.Lumina, CardId.Lumina,
CardId.OvertexCoatls, CardId.OvertexCoatls,
}; };
} }
private bool UltimateConductorTytanno() public override void OnNewTurn()
{ {
AI.SelectCard(new[] 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.OvertexCoatls,
CardId.ShaddollBeast, CardId.ShaddollBeast,
CardId.ShaddollSquamata, CardId.ShaddollSquamata,
...@@ -227,11 +287,35 @@ namespace WindBot.Game.AI.Decks ...@@ -227,11 +287,35 @@ namespace WindBot.Game.AI.Decks
CardId.GlowUpBulb, CardId.GlowUpBulb,
CardId.PlaguespreaderZombie, CardId.PlaguespreaderZombie,
CardId.FairyTailSnow, 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; return true;
} }
private bool UltimateConductorTytannosp() private bool UltimateConductorTytannosp()
{ {
Pillused = true; Pillused = true;
...@@ -243,22 +327,126 @@ namespace WindBot.Game.AI.Decks ...@@ -243,22 +327,126 @@ namespace WindBot.Game.AI.Decks
return true; return true;
} }
private bool KeeeperOfDragonicMagic()
private bool KeeperOfDragonicMagic()
{ {
AI.SelectCard(Useless_List()); if (ActivateDescription == -1)
{
AI.SelectCard(Useless_List());
return true;
}
return true; return true;
} }
private bool MonsterRepos() private bool MonsterRepos()
{ {
if (Card.Id == CardId.ElShaddollConstruct && Card.IsAttack()) if (Card.Id == CardId.ElShaddollConstruct && Card.IsAttack())
return false; return false;
return base.DefaultMonsterRepos(); return base.DefaultMonsterRepos();
} }
public override void OnNewTurn()
private bool OvertexCoatlseff()
{ {
Pillused = false; 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() private bool ShaddollCoreeff()
{ {
if (Card.Location == CardLocation.SpellZone) if (Card.Location == CardLocation.SpellZone)
...@@ -268,113 +456,63 @@ namespace WindBot.Game.AI.Decks ...@@ -268,113 +456,63 @@ namespace WindBot.Game.AI.Decks
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
return true; return true;
} }
return false; return false;
} }
return true; return true;
} }
private bool FairyTailSnow() private bool FairyTailSnow()
{ {
if (Card.Location == CardLocation.MonsterZone) if (Card.Location == CardLocation.MonsterZone)
{ {
return true; return true;
} }
return false; return false;
} }
private bool SouleatingOviraptor()
private bool SouleatingOviraptoreff()
{ {
AI.SelectCard(CardId.OvertexCoatls); if (!OvertexCoatlseff_used)
AI.SelectYesNo(false); {
AI.SelectCard(CardId.OvertexCoatls);
AI.SelectYesNo(false);
}
else
{
AI.SelectCard(CardId.UltimateConductorTytanno);
AI.SelectYesNo(true);
}
return true; return true;
} }
private bool GlowUpBulb()
private bool GlowUpBulbeff()
{ {
if(Bot.HasInMonstersZone(CardId.Lumina)||
Bot.HasInMonstersZone(CardId.FairyTailSnow)||
Bot.HasInMonstersZone(CardId.KeeperOfDragonicMagic)||
Bot.HasInMonstersZone(CardId.SouleatingOviraptor)
)
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
return true; return true;
} }
private bool ShaddollFusion()
private bool ShaddollFusioneff()
{ {
if (Enemy.GetMonstersExtraZoneCount() != 0) if (Enemy.GetMonstersExtraZoneCount() != 0)
{ {
IList<ClientCard> materials0 = Bot.Deck;
IList<ClientCard> materials1 = Bot.Deck;
IList<ClientCard> mats = new List<ClientCard>();
ClientCard mat = null;
foreach (ClientCard card in materials0)
{
if (card.HasAttribute(CardAttribute.Light))
{
mat = card;
break;
}
}
foreach (ClientCard card in materials1)
{
AI.SelectCard(new[]
{
CardId.ShaddollBeast,
CardId.ShaddollSquamata,
CardId.ShaddollHedgehog,
CardId.ShaddollDragon,
CardId.ShaddollFalco,
});
}
if (mat != null)
{
mats.Add(mat);
AI.SelectMaterials(mats);
AI.SelectCard(CardId.ElShaddollConstruct);
AI.SelectPosition(CardPosition.FaceUpAttack);
return true;
}
foreach (ClientCard card in materials0) AI.SelectCard(new[]
{
if (card.HasAttribute(CardAttribute.Earth))
{
mat = card;
break;
}
}
foreach (ClientCard card in materials1)
{ {
AI.SelectCard(new[] CardId.ElShaddollConstruct,
{ CardId.ElShaddollShekhinaga,
CardId.ShaddollBeast, CardId.ElShaddollGrysra,
CardId.ShaddollSquamata, CardId.ElShaddollWinda
CardId.ShaddollHedgehog,
CardId.ShaddollDragon,
CardId.ShaddollFalco,
}); });
} AI.SelectNextCard(new[]
if (mat != null)
{
mats.Add(mat);
AI.SelectMaterials(mats);
AI.SelectCard(CardId.ElShaddollShekhinaga);
AI.SelectPosition(CardPosition.FaceUpAttack);
return true;
}
foreach (ClientCard card in materials0)
{
if (card.HasAttribute(CardAttribute.Fire))
{
mat = card;
break;
}
}
foreach (ClientCard card in materials1)
{
AI.SelectCard(new[]
{ {
CardId.ShaddollBeast, CardId.ShaddollBeast,
CardId.ShaddollSquamata, CardId.ShaddollSquamata,
...@@ -383,47 +521,8 @@ namespace WindBot.Game.AI.Decks ...@@ -383,47 +521,8 @@ namespace WindBot.Game.AI.Decks
CardId.ShaddollFalco, CardId.ShaddollFalco,
}); });
} AI.SelectPosition(CardPosition.FaceUpAttack);
if (mat != null) return true;
{
mats.Add(mat);
AI.SelectMaterials(mats);
AI.SelectCard(CardId.ElShaddollGrysra);
AI.SelectPosition(CardPosition.FaceUpAttack);
return true;
}
foreach (ClientCard card in materials0)
{
if (card.HasAttribute(CardAttribute.Dark))
{
mat = card;
break;
}
}
foreach (ClientCard card in materials1)
{
AI.SelectCard(new[]
{
CardId.ShaddollBeast,
CardId.ShaddollSquamata,
CardId.ShaddollHedgehog,
CardId.ShaddollDragon,
CardId.ShaddollFalco,
});
}
if (mat != null)
{
mats.Add(mat);
AI.SelectMaterials(mats);
AI.SelectCard(CardId.ElShaddollWinda);
AI.SelectPosition(CardPosition.FaceUpAttack);
return true;
}
} }
else else
{ {
...@@ -435,45 +534,7 @@ namespace WindBot.Game.AI.Decks ...@@ -435,45 +534,7 @@ namespace WindBot.Game.AI.Decks
return true; return true;
} }
/* private ClientCard GetAleisterInGrave()
{
foreach (ClientCard card in Enemy.Graveyard)
{
if (card.Id == CardId.AleisterTheInvoker)
{
return card;
}
}
foreach (ClientCard card in Bot.Graveyard)
{
if (card.Id == CardId.AleisterTheInvoker)
{
return card;
}
}
return null;
}*/
private bool DoubleEvolutionPill()
{
if (Pillused == true)return false;
Pillused = true;
if (Bot.HasInGraveyard(CardId.UltimateConductorTytanno) )
{
AI.SelectCard(CardId.UltimateConductorTytanno);
}
AI.SelectThirdCard(new[] {
CardId.UltimateConductorTytanno,
});
return Enemy.GetMonsterCount()>=1;
}
private bool ShaddollCore() private bool ShaddollCore()
{ {
return Bot.HasInGraveyard(CardId.ShaddollFusion); return Bot.HasInGraveyard(CardId.ShaddollFusion);
...@@ -495,7 +556,7 @@ namespace WindBot.Game.AI.Decks ...@@ -495,7 +556,7 @@ namespace WindBot.Game.AI.Decks
{ {
return true; return true;
} }
return false; return false;
} }
private bool spellset() private bool spellset()
{ {
...@@ -503,12 +564,13 @@ namespace WindBot.Game.AI.Decks ...@@ -503,12 +564,13 @@ namespace WindBot.Game.AI.Decks
} }
private bool RebornEffect() private bool RebornEffect()
{ {
IList<int> targets = new[] { IList<int> targets = new[] {
CardId.UltimateConductorTytanno, CardId.UltimateConductorTytanno,
CardId.ElShaddollConstruct, CardId.ElShaddollConstruct,
CardId.DogorantheMadFlameKaiju, CardId.DogorantheMadFlameKaiju,
CardId.GamecieltheSeaTurtleKaiju, CardId.GamecieltheSeaTurtleKaiju,
CardId.SouleatingOviraptor, CardId.SouleatingOviraptor,
}; };
if (!Bot.HasInGraveyard(targets)) if (!Bot.HasInGraveyard(targets))
{ {
...@@ -519,12 +581,10 @@ namespace WindBot.Game.AI.Decks ...@@ -519,12 +581,10 @@ namespace WindBot.Game.AI.Decks
} }
private bool PotofAvarice() private bool PotofAvarice()
{ {
return true; return true;
} }
private bool infiniteTransience()
{
return Duel.LastChainPlayer == 1;
}
private bool MaxxC() private bool MaxxC()
{ {
return Duel.Player == 1; return Duel.Player == 1;
...@@ -544,30 +604,48 @@ namespace WindBot.Game.AI.Decks ...@@ -544,30 +604,48 @@ namespace WindBot.Game.AI.Decks
AI.SelectCard(CardId.Raiden); AI.SelectCard(CardId.Raiden);
else else
AI.SelectCard(new[] AI.SelectCard(new[]
{ {
CardId.Lumina, CardId.Lumina,
}); });
return true; return true;
} }
private bool SinisterShadowGames() private bool SinisterShadowGames()
{
AI.SelectCard(new[]
{
CardId.ShaddollBeast,
});
return true;
}
private bool ElShaddollShekhinagaeff()
{ {
if (Card.Location != CardLocation.MonsterZone) if (Card.Location != CardLocation.MonsterZone)
return true; return true;
else else
{ {
AI.SelectCard(new[] if(Duel.LastChainPlayer==1)
{ {
CardId.ShaddollBeast, AI.SelectCard(new[]
CardId.ShaddollCore, {
} CardId.ElShaddollConstruct,
CardId.ElShaddollShekhinaga,
CardId.ElShaddollGrysra,
CardId.ElShaddollWinda,
CardId.ShaddollSquamata,
}
); );
}
} }
return true; return true;
} }
private bool ShaddollFalco() private bool ShaddollFalcoeff()
{ {
if (Card.Location != CardLocation.MonsterZone) if (Card.Location != CardLocation.MonsterZone)
return true; return true;
...@@ -582,38 +660,87 @@ namespace WindBot.Game.AI.Decks ...@@ -582,38 +660,87 @@ namespace WindBot.Game.AI.Decks
CardId.ShaddollSquamata, CardId.ShaddollSquamata,
} }
); );
} }
return true; return true;
} }
private bool ShaddollSquamata() private bool ShaddollHedgehogeff()
{ {
AI.SelectCard(new[] if (Card.Location != CardLocation.MonsterZone)
{ {
CardId.ShaddollBeast, AI.SelectCard(new[]
{
CardId.ShaddollSquamata,
});
}
else
{
AI.SelectCard(new[] { CardId.ShaddollFusion, CardId.SinisterShadowGames });
} }
);
return true; return true;
} }
private bool FoolishBurialEffect() 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[] AI.SelectCard(new[]
{ {
CardId.OvertexCoatls, CardId.ShaddollBeast,
CardId.ShaddollSquamata,
CardId.ShaddollBeast,
CardId.ShaddollCore,
CardId.ShaddollHedgehog,
CardId.ShaddollFalco,
CardId.ShaddollDragon,
CardId.FairyTailSnow,
}); });
}
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; return true;
} }
private bool GoblindberghSummon() private bool GoblindberghSummon()
{ {
...@@ -625,9 +752,9 @@ namespace WindBot.Game.AI.Decks ...@@ -625,9 +752,9 @@ namespace WindBot.Game.AI.Decks
return false; return false;
} }
private bool PerformageTrickClownEffect() private bool PerformageTrickClownEffect()
{ {
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
......
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; }
} }
} }
} }
...@@ -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())
......
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,6 +127,21 @@ namespace WindBot.Game.AI ...@@ -99,6 +127,21 @@ 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>
...@@ -469,6 +512,29 @@ namespace WindBot.Game.AI ...@@ -469,6 +512,29 @@ namespace WindBot.Game.AI
return false; return false;
} }
/// <summary>
/// Draw when we have Dark monster in hand,and banish random one. Can be overrided.
/// </summary>
protected bool DefaultAllureofDarkness()
{
IList<ClientCard> condition = Bot.Hand;
IList<ClientCard> check = new List<ClientCard>();
ClientCard con = null;
foreach (ClientCard card in condition)
{
if (card.HasAttribute(CardAttribute.Dark))
{
con = card;
break;
}
}
if (con != null)
{
return true;
}
return false;
}
/// <summary> /// <summary>
/// Clever enough. /// Clever enough.
/// </summary> /// </summary>
...@@ -557,7 +623,7 @@ namespace WindBot.Game.AI ...@@ -557,7 +623,7 @@ namespace WindBot.Game.AI
} }
/// <summary> /// <summary>
/// Clever enough. /// Clever enough
/// </summary> /// </summary>
protected bool DefaultInterruptedKaijuSlumber() protected bool DefaultInterruptedKaijuSlumber()
{ {
...@@ -567,24 +633,34 @@ namespace WindBot.Game.AI ...@@ -567,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();
} }
......
...@@ -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
} }
} }
...@@ -52,47 +52,26 @@ namespace WindBot.Game.AI ...@@ -52,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)
...@@ -174,6 +153,12 @@ namespace WindBot.Game.AI ...@@ -174,6 +153,12 @@ namespace WindBot.Game.AI
return -1; return -1;
} }
public virtual bool OnSelectBattleReplay()
{
// Overrided in DefalultExecutor
return false;
}
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; }
......
...@@ -70,6 +70,19 @@ namespace WindBot.Game ...@@ -70,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()
{ {
......
...@@ -143,13 +143,57 @@ namespace WindBot.Game ...@@ -143,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>
...@@ -165,9 +209,9 @@ namespace WindBot.Game ...@@ -165,9 +209,9 @@ namespace WindBot.Game
{ {
const int HINTMSG_FMATERIAL = 511; const int HINTMSG_FMATERIAL = 511;
const int HINTMSG_SMATERIAL = 512; const int HINTMSG_SMATERIAL = 512;
const int HINTMSG_XMATERIAL = 513; const int HINTMSG_XMATERIAL = 513;
const int HINTMSG_LMATERIAL = 533; const int HINTMSG_LMATERIAL = 533;
const int HINTMSG_SPSUMMON = 509; const int HINTMSG_SPSUMMON = 509;
// Check for the executor. // Check for the executor.
IList<ClientCard> result = Executor.OnSelectCard(cards, min, max, hint, cancelable); IList<ClientCard> result = Executor.OnSelectCard(cards, min, max, hint, cancelable);
...@@ -220,9 +264,11 @@ namespace WindBot.Game ...@@ -220,9 +264,11 @@ namespace WindBot.Game
// Always select the first available cards and choose the minimum. // Always select the first available cards and choose the minimum.
IList<ClientCard> selected = new List<ClientCard>(); IList<ClientCard> selected = new List<ClientCard>();
for (int i = 0; i < min; ++i) if (cards.Count >= min)
selected.Add(cards[i]); {
for (int i = 0; i < min; ++i)
selected.Add(cards[i]);
}
return selected; return selected;
} }
...@@ -601,6 +647,15 @@ namespace WindBot.Game ...@@ -601,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>
......
...@@ -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);
...@@ -750,11 +751,84 @@ namespace WindBot.Game ...@@ -750,11 +751,84 @@ namespace WindBot.Game
Connection.Send(reply); Connection.Send(reply);
} }
private void InternalOnSelectUnselectCard(BinaryReader packet, Func<IList<ClientCard>, int, int, int, bool, IList<ClientCard>> func)
{
packet.ReadByte(); // player
packet.ReadByte(); // buttonok
bool cancelable = packet.ReadByte() != 0;
int min = packet.ReadByte();
int max = packet.ReadByte();
IList<ClientCard> cards = new List<ClientCard>();
int count = packet.ReadByte();
for (int i = 0; i < count; ++i)
{
int id = packet.ReadInt32();
int player = GetLocalPlayer(packet.ReadByte());
CardLocation loc = (CardLocation)packet.ReadByte();
int seq = packet.ReadByte();
packet.ReadByte(); // pos
ClientCard card;
if (((int)loc & (int)CardLocation.Overlay) != 0)
card = new ClientCard(id, CardLocation.Overlay);
else
card = _duel.GetCard(player, loc, seq);
if (card == null) continue;
if (card.Id == 0)
card.SetId(id);
cards.Add(card);
}
int count2 = packet.ReadByte();
for (int i = 0; i < count2; ++i)
{
int id = packet.ReadInt32();
int player = GetLocalPlayer(packet.ReadByte());
CardLocation loc = (CardLocation)packet.ReadByte();
int seq = packet.ReadByte();
packet.ReadByte(); // pos
}
IList<ClientCard> selected = func(cards, min, max, _select_hint, cancelable);
_select_hint = 0;
if (selected.Count == 0 && cancelable)
{
Connection.Send(CtosMessage.Response, -1);
return;
}
byte[] result = new byte[selected.Count + 1];
result[0] = (byte)selected.Count;
for (int i = 0; i < selected.Count; ++i)
{
int id = 0;
for (int j = 0; j < count; ++j)
{
if (cards[j] == null) continue;
if (cards[j].Equals(selected[i]))
{
id = j;
break;
}
}
result[i + 1] = (byte)id;
}
BinaryWriter reply = GamePacketFactory.Create(CtosMessage.Response);
reply.Write(result);
Connection.Send(reply);
}
private void OnSelectCard(BinaryReader packet) private void OnSelectCard(BinaryReader packet)
{ {
InternalOnSelectCard(packet, _ai.OnSelectCard); InternalOnSelectCard(packet, _ai.OnSelectCard);
} }
private void OnSelectUnselectCard(BinaryReader packet)
{
InternalOnSelectUnselectCard(packet, _ai.OnSelectCard);
}
private void OnSelectChain(BinaryReader packet) private void OnSelectChain(BinaryReader packet)
{ {
packet.ReadByte(); // player packet.ReadByte(); // player
...@@ -1106,7 +1180,12 @@ namespace WindBot.Game ...@@ -1106,7 +1180,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);
} }
......
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