Commit 3a410a1f authored by wind2009's avatar wind2009

Merge remote-tracking branch 'upstream/master' into 2pick

parents 5950a280 eb5d8f48
......@@ -15,12 +15,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1
uses: microsoft/setup-msbuild@v2
- name: Build!
run: msbuild $env:Solution_Name /t:Build /p:Configuration=Release
......@@ -36,7 +36,7 @@ jobs:
cd ..
- name: Upload build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: dist\WindBot.7z
......@@ -46,7 +46,7 @@ jobs:
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
prerelease: false
title: "Development Build"
files: |
dist/WindBot.7z
......@@ -14,9 +14,19 @@ Random=AI_LV2
一些比较弱的卡组。
SUPPORT_MASTER_RULE_2020
!随机-普通
!随机-一般
Random=AI_LV3
一些环境里可以看到的卡组。
一些不是很弱的卡组。
SUPPORT_MASTER_RULE_2020
!随机-普通
Random=AI_LV4
一些可以(或者曾经可以)在竞技环境里看到的卡组。
SUPPORT_MASTER_RULE_2020
!随机-狂野
Random=AI_WILD
普通的人机的卡组会符合其使用的卡池对应的环境的禁限卡表,但狂野模式的人机的卡组一般不符合任何禁限卡表。
SUPPORT_MASTER_RULE_2020
!随机-报社
......@@ -57,7 +67,7 @@ AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
!琪露诺-饼蛙
Name=琪露诺 Deck='Toadally Awesome' Dialog=cirno.zh-CN
大师规则三的全盛饼蛙卡组。
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
!复制植物-青眼
Name=复制植物 Deck=Blue-Eyes Dialog=copy.zh-CN
......@@ -67,7 +77,7 @@ AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
!复制植物-十二兽
Name=复制植物 Deck=Zoodiac Dialog=copy.zh-CN
大师规则三的十四兽卡组。
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
AI_LV4 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
!尼亚-妖仙兽
Name=尼亚 Deck=Yosenju Dialog=near.zh-CN
......@@ -82,13 +92,43 @@ AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!尼亚-淘气仙星
Name=尼亚 Deck=Trickstar Dialog=near.zh-CN
旧式淘气仙星卡组。
AI_LV3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
AI_LV4 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!尼亚-幻变骚灵
Name=尼亚 Deck=Altergeist Dialog=near.zh-CN
幻变骚灵卡组。
AI_LV4 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!尼亚-拉比林斯迷宫
Name=尼亚 Deck=Labrynth Dialog=near.zh-CN
拉比林斯迷宫卡组。
AI_LV4 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!复制梁龙-闪刀姬
Name=复制梁龙 Deck=SkyStriker Dialog=anothercopy.zh-CN
旧式闪刀姬卡组。
AI_LV3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!复制梁龙-自奏圣乐
Name=复制梁龙 Deck=Orcust Dialog=anothercopy.zh-CN
旧式自奏圣乐卡组。
AI_LV4 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!复制梁龙-转生炎兽
Name=复制梁龙 Deck=Salamangreat Dialog=anothercopy.zh-CN
转生炎兽卡组。
AI_LV3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!VI-1911-凭依装着
Name=VI-1911 Deck=FamiliarPossessed Dialog=VI-1911.zh-CN
凭依装着卡组。
AI_ANTI_META SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!VI-1911-时劫者
Name=VI-1911 Deck=TimeThief Dialog=VI-1911.zh-CN
时间潜行者卡组。
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!永远之魂-削血
Name=永远之魂 Deck=Burn Dialog=soul.zh-CN
老式削血卡组。
......@@ -122,47 +162,7 @@ AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!试作型机器人1732
Name=试作型机器人1732 Deck=ST1732 Dialog=zh-CN
由三盒ST17和三盒SD32组成的卡组。
AI_LV2 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!千奈-影灵衣
Name=千奈 Deck=Nekroz Dialog=sennai.zh-CN
To be added.
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!千奈-光道
Name=千奈 Deck=Lightsworn Dialog=sennai.zh-CN
To be added.
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!弥音-黑羽
Name=弥音 Deck=Blackwing Dialog=meon.zh-CN
To be added.
AI_LV1 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!弥音-电子龙
Name=弥音 Deck=CyberDragon Dialog=meon.zh-CN
To be added.
AI_LV1 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!弥音-入魔
Name=弥音 Deck=Evilswarm Dialog=meon.zh-CN
To be added.
AI_LV1 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!早苗-守墓
Name=早苗 Deck=Gravekeeper Dialog=sanae.zh-CN
早苗的奇迹。
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!早苗-灰篮
Name=早苗 Deck=Graydle Dialog=sanae.zh-CN
早苗的秘术。
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!早苗-???
Name=早苗 Deck='Old School' Dialog=sanae.zh-CN
早苗的信仰。
AI_LV1 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
AI_LV1 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!奇異果
Name=奇異果 Deck=LightswornShaddoldinosour Dialog=kiwi.zh-TW
......@@ -172,7 +172,7 @@ AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!MAX龍果
Name=MAX龍果 Deck=BlueEyesMaxDragon Dialog=kiwi.zh-TW
青眼混沌极龙卡组。
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!幻煌果
Name=幻煌果 Deck=Phantasm Dialog=kiwi.zh-TW
......@@ -212,17 +212,32 @@ AI_LV3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!我太帅了-真红眼龙骑士
Name=我太帅了 Deck=Dragun Dialog=smart.zh-CN
超魔导真红眼龙骑士卡组。
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
AI_LV4 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!我太帅了-水百凤凰勇者
Name=我太帅了 Deck=Brave Dialog=smart.zh-CN
水机百头龙凤凰人勇者卡组。
AI_LV3 SUPPORT_MASTER_RULE_2020
AI_LV4 SUPPORT_MASTER_RULE_2020
!玻璃女巫
!玻璃女巫-魔女术
Name=玻璃女巫 Deck=Witchcraft Dialog=verre.zh-CN
魔女术卡组。
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
AI_LV4 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!玻璃女巫-救祓少女
Name=玻璃女巫 Deck=Exosister Dialog=verre.zh-CN
救祓少女卡组。
AI_LV4 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
!艾克莉西娅-相剑
Name=艾克莉西娅 Deck=Swordsoul Dialog=ecclesia.zh-CN
相剑卡组。
AI_LV4 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
!艾克莉西娅-教导
Name=艾克莉西娅 Deck=Dogmatika Dialog=ecclesia.zh-CN
教导卡组。
AI_LV4 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!源千雪-凭依装着
Name=源千雪 Deck=FamiliarPossessed Dialog=default.zh-CN
......@@ -233,3 +248,28 @@ AI_ANTI_META SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2
Name=璃璃子 Deck=TimeThief Dialog=default.zh-CN
时间潜行者卡组。
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!神数不神-刹帝利
Name=神数不神 Deck=Kashtira Dialog=Zefra.zh-CN
俱舍怒威族卡组。
AI_LV4 SUPPORT_MASTER_RULE_2020
![狂野]神数不神-雷龙
Name=神数不神 Deck=ThunderDragon Dialog=Zefra.zh-CN
深渊混沌雷龙卡组。
AI_WILD SUPPORT_MASTER_RULE_2020
!神数不神-珠泪哀歌
Name=神数不神 Deck=Tearlaments Dialog=Zefra.zh-CN
旧式地天使珠泪哀歌族卡组。
AI_LV4 AI_WILD SUPPORT_MASTER_RULE_2020
!神数不神-神数
Name=神数不神 Deck=Zefra Dialog=Zefra.zh-CN
神数卡组。
AI_LV4 SUPPORT_MASTER_RULE_2020
!今晚有宵夜吗-超重武者
Name=今晚有宵夜吗 Deck=SuperheavySamurai Dialog=superheavysamurai.zh-CN
超重武者卡组。
AI_LV4 SUPPORT_MASTER_RULE_2020
#created by ...
#main
51522296
51522296
62849088
69680031
69680031
95679145
72270339
60303688
60303688
60303688
14558127
14558127
14558127
23434538
23434538
23434538
10158145
10158145
10158145
1984618
1984618
1984618
31002402
60921537
16240772
24224830
24224830
65681983
80845034
80845034
80845034
35569555
35569555
35569555
10045474
10045474
10045474
82956214
82956214
82956214
#extra
24915933
41373230
11765832
11765832
80532587
80532587
80532587
53971455
53971455
74586817
79606837
93039339
2220237
24842059
60303245
!side
\ No newline at end of file
#created by ...
#main
37343995
37343995
37343995
16889337
16889337
16889337
16474916
16474916
16474916
67972302
67972302
67972302
79858629
79858629
43863925
43863925
43863925
5352328
5352328
14558127
14558127
14558127
23434538
23434538
23434538
84211599
84211599
4408198
24224830
24224830
77913594
77913594
77913594
197042
197042
10045474
10045474
77891946
77891946
77891946
#extra
90448279
59242457
59242457
9272381
42741437
42741437
42741437
78135071
78135071
41524885
41524885
46772449
5530780
58858807
8728498
!side
74689476
#created by ...
#main
27204311
68304193
68304193
68304193
32909498
32909498
32909498
4928565
78534861
78534861
91800273
91800273
72090076
31149212
31149212
31149212
14558127
14558127
14558127
23434538
23434538
31480215
34447918
34447918
34447918
73628505
84211599
84211599
24224830
24224830
65681983
69540484
69540484
69540484
71832012
71832012
71832012
10045474
10045474
33925864
#extra
15291624
27548199
21915012
48626373
48626373
95474755
95474755
95474755
10389142
73542331
73542331
21887175
44097050
22423493
65741786
!side
#created by ...
#main
81497285
81497285
2347656
41165831
73602965
73602965
75730490
1225009
1225009
1225009
37629703
37629703
37629703
14558127
14558127
14558127
23434538
23434538
23434538
74018812
74018812
74018812
2511
2511
2511
49238328
49238328
5380979
5380979
6351147
6351147
10045474
10045474
10045474
30748475
53417695
83326048
92714517
92714517
92714517
#extra
22850702
22850702
93039339
93039339
29479265
93084621
93084621
24269961
24269961
24269961
67680512
67680512
29301450
71607202
94259633
!side
#created by ...
#main
83334932
83334932
83334932
82112494
82112494
82112494
19510093
19510093
34496660
34496660
34496660
90361010
90361010
90361010
78391364
78391364
56727340
56727340
14624296
95500396
10604644
23434538
23434538
23434538
14558127
14558127
14558127
49036338
38814750
38814750
97268402
97268402
73642296
73642296
59438930
59438930
59438930
94145021
94145021
94145021
#extra
64193046
84815190
30983281
44508094
27548199
76471944
74586817
28912357
38342335
27381364
22423493
65741786
33918636
33918636
33918636
!side
#created by ...
#main
27204311
87052196
87052196
23431858
93490856
93490856
93490856
56495147
56495147
56495147
20001443
20001443
20001443
55273560
55273560
55273560
14558127
14558127
14558127
23434538
23434538
23434538
97268402
97268402
97268402
98159737
35261759
35261759
56465981
56465981
56465981
93850690
24224830
24224830
65681983
10045474
10045474
10045474
14821890
14821890
#extra
42632209
60465049
96633955
84815190
47710198
9464441
5041348
69248256
69248256
83755611
43202238
78917791
32519092
32519092
32519092
!side
#created by ...
#main
3717252
77723643
572850
572850
572850
73956664
73956664
25926710
25926710
25926710
99937011
99937011
99937011
62320425
62320425
62320425
63542003
63542003
97518132
37961969
37961969
37961969
74078255
74078255
74078255
92919429
92919429
92919429
17266660
17266660
17266660
21074344
21074344
21074344
40177746
6767771
77103950
77103950
74920585
74920585
#extra
28226490
84330567
69946549
92731385
92731385
94977269
80532587
84815190
33158448
21044178
98127546
21887175
38342335
27381364
65741786
!side
#created by ...
#main
5206415
32731036
32731036
90488465
6637331
6637331
33854624
33854624
29596581
29596581
83107873
83107873
31786629
31786629
31786629
56713174
56713174
56713174
61901281
61901281
99234526
99234526
92998610
92998610
44586426
44586426
44586426
14558127
14558127
23434538
23434538
23434538
76218313
20318029
20318029
20318029
1475311
1475311
1475311
75500286
95238394
95238394
99266988
99266988
99266988
24224830
24224830
34090915
10045474
10045474
#extra
41685633
41685633
15291624
21044178
98127546
21887175
86066372
4280258
38342335
83152482
65741786
50277355
70369116
73539069
41999284
!side
#created by ...
#main
49036338
29432356
29432356
29432356
3611830
76794549
5560911
96227613
96227613
27354732
58990362
58990362
58990362
20773176
22617205
69610326
14785765
95401059
31314549
96223501
52159691
21495657
21495657
57777714
92559258
92559258
92559258
38814750
38814750
38814750
72291078
23434538
23434538
23434538
94693857
9742784
19580308
11609969
61488417
2295440
23581825
38943357
38943357
38943357
41620959
41620959
41620959
73628505
74580251
74580251
74580251
81439173
24224830
24224830
46372010
32354768
32354768
32354768
35561352
57831349
#extra
27548199
74586817
80696379
33158448
65536818
79606837
88581108
96157835
73347079
74997493
44097050
24094258
50588353
36429703
41999284
!side
{
"welcome": [
"你好呀,打牌人",
"你好,欢迎和我耍牌"
],
"deckerror": [
"抱歉,我的卡组需要{0}才可以耍"
],
"duelstart": [
"嘿嘿,我要用二哥打爆你。",
"我的卡组不屁股,也就塞了几张禁卡捏",
"我只会耍简单的卡组,不要用禁卡和我打拉"
],
"newturn": [
"到我喽,抽卡!(裤裆偷偷掏出)",
"我抽一张卡"
],
"endturn": [
"我耍完了,到你了",
"到你回合了哦,不会是多线程决斗吧?"
],
"directattack": [
"{0},攻击对手!",
"{0},撞烂它!",
"{0},小拳揍它!"
],
"attack": [
"{0},把{1}打倒!",
"嘿嘿,{0},攻击{1}!"
],
"ondirectattack": [
"啊,不要打我,我放禁卡给你玩",
"呀,太强辣,可以带带我嘛",
"好痛...想拔电源"
],
"facedownmonstername": "怪兽",
"activate": [
"嘿嘿,我发动{0}",
"嘎嘎,我使用{0}的力量"
],
"summon": [
"我召唤(掏出){0}!",
"出来,我的小怪兽{0}!"
],
"setmonster": [
"我放置一只不知名怪兽。"
],
"chaining": [
"嘿,我能用禁卡气不气?",
"乎,我发动{0}!",
"不好意思拉,我有{0}",
"哈哈,发动{0}的效果!"
],
"custom": [
"呱!本体出征!",
"凸(艹皿艹 )卡手不玩拉!!!",
"嘿不慌,还有摆子场( ̄y▽ ̄)╭"
]
}
......@@ -64,5 +64,11 @@
"Before you do that, I'll chain {0}!",
"Nice try, but I have {0}!",
"Didn't expect {0}, did you?"
],
"surrender": [
"I surrender.",
"You win this time.",
"I can't win this duel.",
"Good game."
]
}
\ No newline at end of file
{
"welcome": [
"这里就是大灵峰吗?",
"这里是教导龙国。"
],
"deckerror": [
"{0}被冰水咒缚了!"
],
"duelstart": [
"走了好久,肚子饿了……",
"前方会遇到怎样的同伴呢?",
"有阿不思在一起的话……"
],
"newturn": [
"我的回合!"
],
"endturn": [
"姐姐到底在哪里……",
"阿不思的干粮也吃完了啊。",
"什么时候开饭呢?"
],
"directattack": [
"{0},直接攻击!",
"开饭!"
],
"attack": [
"用{0}攻击{1}!"
],
"ondirectattack": [
"好饿……",
"呜呜……",
"姐姐……"
],
"facedownmonstername": "怪兽",
"activate": [
"发动{0}的效果!"
],
"summon": [
"{0}召唤!",
"出来吧,{0}!"
],
"setmonster": [
"……"
],
"chaining": [
"发动{0}的效果!",
"{0}!"
]
}
......@@ -55,5 +55,10 @@
"但我鸽了",
"无此服务",
"可怕"
],
"surrender": [
"太可怕了(跑路",
"这游戏好难玩(跑路",
"还好我不玩游戏王(跑路"
]
}
{
"welcome": [
"是宵夜哒哟!",
"什么灵摆卡组都会玩的哟!",
"什么?你说超重不是灵摆卡组?"
],
"deckerror": [
"{0}的数量不对!快去改成无禁限模式!。"
],
"duelstart": [
"给你展现一下超重的魅力!"
],
"newturn": [
"抽卡!弁庆你别上手救我了!",
"抽卡!P身子你别上手救我了!"
],
"endturn": [
"哼哼,到你的回合了!",
"喜不喜欢我的展开呢?"
],
"directattack": [
"我用{0}直接攻击!"
],
"attack": [
"我用{0}攻击{1}!"
],
"ondirectattack": [
"不许打!不许打呀!",
"呜哇!要被打倒惹~"
],
"facedownmonstername": "怪兽",
"activate": [
"呼呼呼,{0}的效果太厉害了!",
"呼呼呼,我使用{0}的效果。"
],
"summon": [
"呼呼呼,我召唤{0}!"
],
"setmonster": [
"呼呼呼,我盖放了一只怪兽。"
],
"chaining": [
"此刻!{0}的效果发动!"
]
}
......@@ -71,5 +71,9 @@
"我不认同。{0},发动!",
"看样子你忘了我的{0}!",
"你考虑过我有{0}吗?"
],
"surrender": [
"我认输。",
"我承认你的胜利。"
]
}
......@@ -424,7 +424,7 @@ namespace WindBot.Game.AI
/// </summary>
public IList<ClientCard> CheckSelectCount(IList<ClientCard> _selected, IList<ClientCard> cards, int min, int max)
{
var selected = _selected.ToList();
var selected = _selected.Distinct().ToList();
if (selected.Count < min)
{
foreach (ClientCard card in cards)
......@@ -434,6 +434,15 @@ namespace WindBot.Game.AI
if (selected.Count >= max)
break;
}
if (selected.Count < min)
{
#if DEBUG
throw new Exception("Not enough cards to CheckSelectCount");
#else
Logger.WriteErrorLine("Not enough cards to CheckSelectCount, using default");
return null;
#endif
}
}
while (selected.Count > max)
{
......@@ -442,5 +451,115 @@ namespace WindBot.Game.AI
return selected;
}
/// <summary>
/// Get all xyz materials lists that xyz monster required level in the 'pre_materials' list
/// </summary>
/// <param name="param_pre_materials">Original materials</param>
/// <param name="level">Xyz monster required level</param>
/// <param name="material_count">SpSummon rule:number of xyz materials</param>
/// <param name="material_count_above">More xyz materials</param>
/// <param name="material_func">Filter xyz materials func</param>
/// <returns></returns>
public List<List<ClientCard>> GetXyzMaterials(IList<ClientCard> param_pre_materials, int level, int material_count, bool material_count_above = false, Func<ClientCard, bool> material_func = null)
{
List<List<ClientCard>> result = new List<List<ClientCard>>();
List<ClientCard> pre_materials = param_pre_materials?.Where(card => card != null && !(card.IsFacedown() & card.Location == CardLocation.MonsterZone) && card.Level == level && !card.IsMonsterNotBeXyzMaterial()).ToList();
if (pre_materials?.Count() < material_count) return result;
Func<ClientCard, bool> default_func = card => true;
material_func = material_func ?? default_func;
for (int i = 1; i < Math.Pow(2, pre_materials.Count); i++)
{
List<ClientCard> temp_materials = new List<ClientCard>();
string binaryString = Convert.ToString(i, 2).PadLeft(pre_materials.Count, '0');
char[] reversedBinaryChars = binaryString.Reverse().ToArray();
for (int j = 0; j < pre_materials.Count; j++)
{
if (reversedBinaryChars[j] == '1' && material_func(pre_materials[j]))
{
temp_materials.Add(pre_materials[j]);
}
}
if (material_count_above ? temp_materials.Count >= material_count : temp_materials.Count == material_count)
{
result.Add(temp_materials);
}
}
return result;
}
/// <summary>
/// Get all synchro materials lists that synchro monster level == param 'level' in the 'pre_materials' list
/// </summary>
/// <param name="pre_materials">Original materials</param>
/// <param name="level">Synchro monster level</param>
/// <param name="tuner_count">SpSummon rule:number of tuner monsters </param>
/// <param name="n_tuner_count">SpSummon rule:number of non-tuner monsters count</param>
/// <param name="tuner_count_above">More tuner monsters</param>
/// <param name="n_tuner_count_above">More non-tuner monsters</param>
/// <param name="tuner_func">Filter tuner monsters func</param>
/// <param name="n_tuner_func">Filter non-tuner monsters func</param>
/// <returns></returns>
public List<List<ClientCard>> GetSynchroMaterials(IList<ClientCard> param_pre_materials, int level, int tuner_count, int n_tuner_count, bool tuner_count_above = false, bool n_tuner_count_above = true, Func<ClientCard, bool> tuner_func = null, Func<ClientCard, bool> n_tuner_func = null)
{
List<List<ClientCard>> t_result = new List<List<ClientCard>>();
List<ClientCard> pre_materials = param_pre_materials?.Where(card => card != null && !(card.IsFacedown() & card.Location == CardLocation.MonsterZone) && card.Level > 0 && !card.IsMonsterNotBeSynchroMaterial()).ToList();
if (pre_materials?.Count() < tuner_count + n_tuner_count) return t_result;
Func<ClientCard, bool> default_func = card => true;
tuner_func = tuner_func ?? default_func;
n_tuner_func = n_tuner_func ?? default_func;
pre_materials.Sort(CardContainer.CompareCardLevel);
Stack<object[]> materials_stack = new Stack<object[]>();
for (var i = 0; i < pre_materials.Count; i++)
{
if (pre_materials[i].Level > level) break;
materials_stack.Push(new object[] { pre_materials[i].Level, i, pre_materials[i].Level, new List<ClientCard> { pre_materials[i] } });
}
while (materials_stack.Count > 0)
{
object[] data = materials_stack.Pop();
int num = (int)data[0];
int index = (int)data[1];
int sum = (int)data[2];
List<ClientCard> temp_materials = (List<ClientCard>)data[3];
if (sum == level)
{
t_result.Add(temp_materials);
}
else if (sum < level)
{
for (var i = index + 1; i < pre_materials.Count; i++)
{
if (pre_materials[i].Level > level - sum) break;
if (i > index + 1 && pre_materials[i].Level == pre_materials[i - 1].Level) continue;
var new_temp_materials = new List<ClientCard>(temp_materials);
new_temp_materials.Add(pre_materials[i]);
materials_stack.Push(new object[] { pre_materials[i].Level, i, sum + pre_materials[i].Level, new_temp_materials });
}
}
}
List<List<ClientCard>> result = new List<List<ClientCard>>();
for (int i = 0; i < t_result.Count; i++)
{
List<ClientCard> materials = t_result[i];
List<ClientCard> tuner_materials = new List<ClientCard>();
List<ClientCard> n_tuner_materials = new List<ClientCard>();
foreach (ClientCard material in materials)
{
if (material.HasType(CardType.Tuner) && tuner_func(material))
{
tuner_materials.Add(material);
}
else if (material.Level > 0 && n_tuner_func(material))
{
n_tuner_materials.Add(material);
}
}
if ((tuner_count_above ? tuner_materials.Count >= tuner_count : tuner_materials.Count == tuner_count)
&& (n_tuner_count_above ? n_tuner_materials.Count >= n_tuner_count : n_tuner_materials.Count == n_tuner_count))
result.Add(materials);
}
return result;
}
}
}
\ No newline at end of file
......@@ -25,6 +25,15 @@ namespace WindBot.Game.AI
return 1;
}
public static int CompareCardLink(ClientCard cardA, ClientCard cardB)
{
if (cardA.LinkCount < cardB.LinkCount)
return -1;
if (cardA.LinkCount == cardB.LinkCount)
return 0;
return 1;
}
public static int CompareDefensePower(ClientCard cardA, ClientCard cardB)
{
if (cardA == null && cardB == null)
......
......@@ -21,7 +21,8 @@ namespace WindBot.Game.AI
/// </summary>
public static bool IsMonsterDangerous(this ClientCard card)
{
return !card.IsDisabled() && Enum.IsDefined(typeof(DangerousMonster), card.Id);
return !card.IsDisabled() &&
(Enum.IsDefined(typeof(DangerousMonster), card.Id) || (card.HasSetcode(0x18d) && (card.HasType(CardType.Ritual) || card.EquipCards.Count > 0)));
}
/// <summary>
......@@ -78,5 +79,21 @@ namespace WindBot.Game.AI
{
return Enum.IsDefined(typeof(FusionSpell), card.Id);
}
/// <summary>
/// Is this monster not be synchro material?
/// </summary>
public static bool IsMonsterNotBeSynchroMaterial(this ClientCard card)
{
return Enum.IsDefined(typeof(NotBeSynchroMaterialMonster), card.Id);
}
/// <summary>
/// Is this monster not be xyz material?
/// </summary>
public static bool IsMonsterNotBeXyzMaterial(this ClientCard card)
{
return Enum.IsDefined(typeof(NotBeXyzMaterialMonster), card.Id);
}
}
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
using System.Linq;
namespace WindBot.Game.AI.Decks
{
......@@ -220,8 +221,7 @@ namespace WindBot.Game.AI.Decks
public bool isAltergeist(ClientCard card)
{
return card.IsCode(CardId.Marionetter, CardId.Hexstia, CardId.Protocol, CardId.Multifaker, CardId.Meluseek,
CardId.Kunquery, CardId.Manifestation, CardId.Silquitous);
return card != null && card.HasSetcode(0x103);
}
public int GetSequence(ClientCard card)
......@@ -324,23 +324,37 @@ namespace WindBot.Game.AI.Decks
public int SelectSTPlace(ClientCard card=null, bool avoid_Impermanence = false)
{
List<int> list = new List<int> { 0, 1, 2, 3, 4 };
if (card == null) card = Card;
List<int> list = new List<int>();
for (int seq = 0; seq < 5; ++seq)
{
if (Bot.SpellZone[seq] == null)
{
if (card != null && card.Location == CardLocation.Hand && avoid_Impermanence && Impermanence_list.Contains(seq)) continue;
list.Add(seq);
}
}
int n = list.Count;
while (n-- > 1)
{
int index = Program.Rand.Next(n + 1);
int temp = list[index];
list[index] = list[n];
list[n] = temp;
int index = Program.Rand.Next(list.Count);
int nextIndex = (index + Program.Rand.Next(list.Count - 1)) % list.Count;
int tempInt = list[index];
list[index] = list[nextIndex];
list[nextIndex] = tempInt;
}
foreach (int seq in list)
if (avoid_Impermanence && Bot.GetMonsters().Any(c => c.IsFaceup() && !c.IsDisabled()))
{
int zone = (int)System.Math.Pow(2, seq);
if (Bot.SpellZone[seq] == null)
foreach (int seq in list)
{
if (card != null && card.Location == CardLocation.Hand && avoid_Impermanence && Impermanence_list.Contains(seq)) continue;
return zone;
};
ClientCard enemySpell = Enemy.SpellZone[4 - seq];
if (enemySpell != null && enemySpell.IsFacedown()) continue;
return (int)System.Math.Pow(2, seq);
}
}
foreach (int seq in list)
{
return (int)System.Math.Pow(2, seq);
}
return 0;
}
......@@ -376,6 +390,7 @@ namespace WindBot.Game.AI.Decks
public bool spell_trap_activate(bool isCounter = false, ClientCard target = null)
{
if (target == null) target = Card;
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (target.Location != CardLocation.SpellZone && target.Location != CardLocation.Hand) return true;
if (Enemy.HasInMonstersZone(CardId.NaturalExterio, true) && !Bot.HasInHandOrHasInMonstersZone(CardId.GO_SR) && !isCounter && !Bot.HasInSpellZone(CardId.SolemnStrike)) return false;
if (target.IsSpell())
......@@ -649,7 +664,7 @@ namespace WindBot.Game.AI.Decks
public bool G_activate()
{
return (Duel.Player == 1);
return (Duel.Player == 1) && !DefaultCheckWhetherCardIsNegated(Card);
}
public bool NaturalExterio_eff()
......@@ -806,6 +821,7 @@ namespace WindBot.Game.AI.Decks
public bool Hand_act_eff()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Card.IsCode(CardId.AB_JS) && Util.GetLastChainCard().HasSetcode(0x11e) && Util.GetLastChainCard().Location == CardLocation.Hand) // Danger! archtype hand effect
return false;
if (Card.IsCode(CardId.GO_SR) && Card.Location == CardLocation.Hand && Bot.HasInMonstersZone(CardId.GO_SR)) return false;
......@@ -886,6 +902,7 @@ namespace WindBot.Game.AI.Decks
public bool GR_WC_activate()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
int warrior_count = 0;
int pendulum_count = 0;
int link_count = 0;
......@@ -1248,7 +1265,7 @@ namespace WindBot.Game.AI.Decks
if (linked_card != null && linked_card.IsCode(CardId.Hexstia))
{
int next_seq = get_Hexstia_linkzone(this_seq);
if (next_seq != -1 && Bot.MonsterZone[next_seq] != null && isAltergeist(Bot.MonsterZone[next_seq].Id)) return false;
if (next_seq != -1 && Bot.MonsterZone[next_seq] != null && isAltergeist(Bot.MonsterZone[next_seq])) return false;
}
}
return true;
......@@ -1675,7 +1692,7 @@ namespace WindBot.Game.AI.Decks
if (target.IsCode(CardId.Hexstia))
{
int next_index = get_Hexstia_linkzone(i);
if (next_index != -1 && Bot.MonsterZone[next_index] != null && Bot.MonsterZone[next_index].IsFaceup() && isAltergeist(Bot.MonsterZone[next_index].Id)) continue;
if (next_index != -1 && Bot.MonsterZone[next_index] != null && Bot.MonsterZone[next_index].IsFaceup() && isAltergeist(Bot.MonsterZone[next_index])) continue;
}
if (!get_linked_by_Hexstia(i))
{
......@@ -2654,6 +2671,28 @@ namespace WindBot.Game.AI.Decks
ss_other_monster = false;
Impermanence_list.Clear();
attacked_Meluseek.Clear();
base.OnNewTurn();
}
public override void OnChaining(int player, ClientCard card)
{
if (card == null) return;
if (player == 1)
{
if (card.IsCode(_CardId.InfiniteImpermanence))
{
for (int i = 0; i < 5; ++i)
{
if (Enemy.SpellZone[i] == card)
{
Impermanence_list.Add(4-i);
break;
}
}
}
}
base.OnChaining(player, card);
}
public bool MonsterRepos()
......@@ -2797,7 +2836,8 @@ namespace WindBot.Game.AI.Decks
// throw all??
return null;
}
return null;
return base.OnSelectCard(cards, min, max, hint, cancelable);
}
public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions)
......@@ -2853,16 +2893,16 @@ namespace WindBot.Game.AI.Decks
if (cardId == CardId.Hexstia)
{
// ex zone
if ((Zones.z5 & available) > 0 && Bot.MonsterZone[1] != null && isAltergeist(Bot.MonsterZone[1].Id)) return Zones.z5;
if ((Zones.z6 & available) > 0 && Bot.MonsterZone[3] != null && isAltergeist(Bot.MonsterZone[3].Id)) return Zones.z6;
if ( ((Zones.z6 & available) > 0 && Bot.MonsterZone[3] != null && !isAltergeist(Bot.MonsterZone[3].Id))
if ((Zones.z5 & available) > 0 && Bot.MonsterZone[1] != null && isAltergeist(Bot.MonsterZone[1])) return Zones.z5;
if ((Zones.z6 & available) > 0 && Bot.MonsterZone[3] != null && isAltergeist(Bot.MonsterZone[3])) return Zones.z6;
if ( ((Zones.z6 & available) > 0 && Bot.MonsterZone[3] != null && !isAltergeist(Bot.MonsterZone[3]))
|| ((Zones.z5 & available) > 0 && Bot.MonsterZone[1] == null) ) return Zones.z5;
if (((Zones.z5 & available) > 0 && Bot.MonsterZone[1] != null && !isAltergeist(Bot.MonsterZone[1].Id))
if (((Zones.z5 & available) > 0 && Bot.MonsterZone[1] != null && !isAltergeist(Bot.MonsterZone[1]))
|| ((Zones.z6 & available) > 0 && Bot.MonsterZone[3] == null)) return Zones.z6;
// main zone
for (int i = 1; i < 5; ++i)
{
if (Bot.MonsterZone[i] != null && isAltergeist(Bot.MonsterZone[i].Id))
if (Bot.MonsterZone[i] != null && isAltergeist(Bot.MonsterZone[i]))
{
if ((available & (int)System.Math.Pow(2, i - 1)) > 0) return (int)System.Math.Pow(2, i - 1);
}
......@@ -2876,5 +2916,15 @@ namespace WindBot.Game.AI.Decks
}
return base.OnSelectPlace(cardId, player, location, available);
}
protected override bool DefaultSetForDiabellze()
{
if (base.DefaultSetForDiabellze())
{
AI.SelectPlace(SelectSTPlace(Card, true));
return true;
}
return false;
}
}
}
\ No newline at end of file
......@@ -131,6 +131,7 @@ namespace WindBot.Game.AI.Decks
UsedGalaxyEyesCipherDragon = null;
AlternativeWhiteDragonSummoned = false;
SoulChargeUsed = false;
base.OnNewTurn();
}
public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable)
......@@ -146,7 +147,8 @@ namespace WindBot.Game.AI.Decks
return Util.CheckSelectCount(result, cards, min, max);
}
Logger.DebugWriteLine("Use default.");
return null;
return base.OnSelectCard(cards, min, max, hint, cancelable);
}
public override IList<ClientCard> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max)
......
......@@ -121,6 +121,7 @@ namespace WindBot.Game.AI.Decks
private bool MaxxCeff()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return Duel.Player == 1;
}
......@@ -464,6 +465,7 @@ namespace WindBot.Game.AI.Decks
private bool Linkuriboheff()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Duel.LastChainPlayer == 0 && Util.GetLastChainCard().IsCode(CardId.Linkuriboh)) return false;
return true;
}
......
......@@ -180,6 +180,7 @@ namespace WindBot.Game.AI.Decks
FusionDestinyUsed = false;
PhoenixTarget = null;
PhoenixSelectingTarget = 0;
base.OnNewTurn();
}
public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions)
......@@ -354,8 +355,8 @@ namespace WindBot.Game.AI.Decks
return true;
else
{
ClientCard target = Util.GetProblematicEnemyCard();
if (target != null)
ClientCard target = Util.GetProblematicEnemyCard(2500);
if (target != null && !Util.ChainContainPlayer(0))
{
AI.SelectCard(CardId.DestinyHeroDestroyPhoenixEnforcer);
AI.SelectNextCard(target);
......@@ -479,6 +480,7 @@ namespace WindBot.Game.AI.Decks
private bool AquamancerOfTheSanctuarySearchEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Card.Location == CardLocation.Grave)
{
AI.SelectCard(CardLocation.Deck);
......@@ -626,6 +628,7 @@ namespace WindBot.Game.AI.Decks
private bool JetSynchronEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
int[] materials = new[] {
CardId.MechaPhantomBeastToken
};
......@@ -786,6 +789,7 @@ namespace WindBot.Game.AI.Decks
private bool PredaplantVerteAnacondaEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (ActivateDescription == Util.GetStringId(CardId.PredaplantVerteAnaconda, 0))
return false;
FusionDestinyUsed = true;
......@@ -858,6 +862,7 @@ namespace WindBot.Game.AI.Decks
private bool DestinyHeroCelestialEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (!Bot.HasInGraveyard(CardId.DestinyHeroDasher))
return false;
AI.SelectCard(CardId.DestinyHeroDasher);
......@@ -971,6 +976,7 @@ namespace WindBot.Game.AI.Decks
private bool VirtualWorldKyubiShenshenEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Card.Location == CardLocation.MonsterZone && Bot.HasInBanished(CardId.AquamancerOfTheSanctuary))
{
AI.SelectCard(CardId.AquamancerOfTheSanctuary);
......
......@@ -265,6 +265,7 @@ namespace WindBot.Game.AI.Decks
prevent_used = false;
Linkuribohused = true;
Timelord_check = false;
base.OnNewTurn();
}
public override void OnNewPhase()
{
......
......@@ -316,6 +316,7 @@ namespace WindBot.Game.AI.Decks
big_attack = false;
big_attack_used = false;
soul_used = false;
base.OnNewTurn();
}
public int GetTotalATK(IList<ClientCard> list)
{
......@@ -496,11 +497,13 @@ namespace WindBot.Game.AI.Decks
{
if (Bot.LifePoints > 1500 && Duel.LastChainPlayer == 1)
return true;
if (DefaultOnlyHorusSpSummoning()) return false;
return false;
}
private bool ChainEnemy()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Util.GetLastChainCard() != null &&
Util.GetLastChainCard().IsCode(CardId.UpstartGoblin))
return false;
......@@ -519,6 +522,7 @@ namespace WindBot.Game.AI.Decks
private bool MaxxCeff()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return Duel.Player == 1;
}
/*
......@@ -1417,6 +1421,7 @@ namespace WindBot.Game.AI.Decks
}
else
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Bot.HasInMonstersZone(CardId.VentriloauistsClaraAndLucika))
{
AI.SelectCard(CardId.VentriloauistsClaraAndLucika);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -123,6 +123,7 @@ namespace WindBot.Game.AI.Decks
{
BeastOLionUsed = false;
RedEyesFusionUsed = false;
base.OnNewTurn();
}
public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions)
......@@ -198,6 +199,7 @@ namespace WindBot.Game.AI.Decks
private bool TourGuideFromTheUnderworldSummon()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Bot.GetRemainingCount(CardId.TourGuideFromTheUnderworld, 2) == 0 && Bot.GetRemainingCount(CardId.Sangan, 2) == 0)
return false;
return true;
......@@ -307,6 +309,7 @@ namespace WindBot.Game.AI.Decks
private bool MagiciansSoulsEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Card.Location == CardLocation.Hand)
{
if (RedEyesFusionUsed)
......@@ -375,6 +378,7 @@ namespace WindBot.Game.AI.Decks
private bool PredaplantVerteAnacondaEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (ActivateDescription == Util.GetStringId(CardId.PredaplantVerteAnaconda, 0))
return false;
AI.SelectCard(CardId.RedEyesFusion);
......
......@@ -456,6 +456,7 @@ namespace WindBot.Game.AI.Decks
private bool AssaultBeast()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (!Bot.HasInSpellZone(CardId.AssaultModeActivate))
return true;
return false;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -135,6 +135,7 @@ namespace WindBot.Game.AI.Decks
private bool Ronintoadin()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
List<ClientCard> monsters = Bot.GetGraveyardMonsters();
if (monsters.Count > 2)
{
......
......@@ -128,6 +128,7 @@ namespace WindBot.Game.AI.Decks
{
eater_eff = false;
CardOfDemiseeff_used = false;
base.OnNewTurn();
}
public override void OnNewPhase()
......@@ -437,6 +438,7 @@ namespace WindBot.Game.AI.Decks
private bool ThunderKingRaiOheff()
{
if (DefaultOnlyHorusSpSummoning()) return false;
if(Duel.SummoningCards.Count > 0)
{
foreach(ClientCard m in Duel.SummoningCards)
......@@ -547,7 +549,7 @@ namespace WindBot.Game.AI.Decks
{
targets.Add(s_c);
if (targets.Count >= 5)
{
{
AI.SelectMaterials(targets, HintMsg.Remove);
return true;
}
......@@ -570,6 +572,7 @@ namespace WindBot.Game.AI.Decks
private bool MetalSnakesp()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (ActivateDescription == Util.GetStringId(CardId.MetalSnake, 0) && !Bot.HasInMonstersZone(CardId.MetalSnake))
{
if(Duel.Player == 1 && Duel.Phase >= DuelPhase.BattleStart )
......
This diff is collapsed.
This diff is collapsed.
......@@ -217,11 +217,12 @@ namespace WindBot.Game.AI.Decks
JetSynchronUsed = false;
ScrapWyvernUsed = false;
MaskedChameleonUsed = false;
base.OnNewTurn();
}
public override void OnChainEnd()
{
base.OnChainEnd();
}
public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions)
......
......@@ -274,6 +274,7 @@ namespace WindBot.Game.AI.Decks
ShaddollSquamata_used = false;
ShaddollDragon_used = false;
ShaddollHedgehog_used = false;
base.OnNewTurn();
}
private bool Luminasummon()
......@@ -290,6 +291,7 @@ namespace WindBot.Game.AI.Decks
}
private bool Luminaeff()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Bot.HasInGraveyard(CardId.Raiden))
{
AI.SelectCard(Useless_List());
......@@ -555,6 +557,7 @@ namespace WindBot.Game.AI.Decks
private bool GlowUpBulbeff()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
IList<ClientCard> check = Bot.GetMonstersInExtraZone();
foreach (ClientCard monster in check)
if (monster.HasType(CardType.Fusion)) return false;
......@@ -627,6 +630,7 @@ namespace WindBot.Game.AI.Decks
private bool MaxxC()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return Duel.Player == 1;
}
......@@ -977,6 +981,7 @@ namespace WindBot.Game.AI.Decks
public bool Hand_act_eff()
{
//if (Card.IsCode(CardId.Urara) && Bot.HasInHand(CardId.LockBird) && Bot.HasInSpellZone(CardId.Re)) return false;
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Card.IsCode(CardId.GhostOgre) && Card.Location == CardLocation.Hand && Bot.HasInMonstersZone(CardId.GhostOgre)) return false;
return (Duel.LastChainPlayer == 1);
}
......@@ -998,6 +1003,7 @@ namespace WindBot.Game.AI.Decks
if (Card.Location == CardLocation.Grave)
return true;
if (Bot.LifePoints <= 1000) return false;
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
ClientCard select = Util.GetBestEnemyCard();
if (select == null) return false;
if(select!=null)
......
......@@ -219,11 +219,13 @@ namespace WindBot.Game.AI.Decks
private bool ImFeelingLucky()
{
if (Type == ExecutorType.Activate && DefaultCheckWhetherCardIsNegated(Card)) return false;
return Program.Rand.Next(10) >= 5 && DefaultDontChainMyself();
}
private bool ImFeelingUnlucky()
{
if (Type == ExecutorType.Activate && DefaultCheckWhetherCardIsNegated(Card)) return false;
return DefaultDontChainMyself();
}
......
......@@ -214,11 +214,13 @@ namespace WindBot.Game.AI.Decks
CymbalSkeletonUsed = false;
BorrelswordDragonUsed = false;
RustyBardicheTarget = null;
base.OnNewTurn();
}
public override void OnChainEnd()
{
RustyBardicheTarget = null;
base.OnChainEnd();
}
public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions)
......@@ -465,6 +467,7 @@ namespace WindBot.Game.AI.Decks
private bool JetSynchronEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
AI.SelectCard(HandCosts);
return true;
}
......@@ -488,6 +491,7 @@ namespace WindBot.Game.AI.Decks
private bool DestrudoSummon()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return Bot.GetMonsterCount() < 3 && Bot.HasInExtra(new[] { CardId.CrystronNeedlefiber, CardId.KnightmarePhoenix });
}
......@@ -659,6 +663,7 @@ namespace WindBot.Game.AI.Decks
private bool KnightmarePhoenixEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
int costcount = Bot.Hand.GetMatchingCardsCount(card => card.IsCode(HandCosts));
ClientCard target = Enemy.SpellZone.GetFloodgate();
ClientCard anytarget = Enemy.SpellZone.GetFirstMatchingCard(card => !card.OwnTargets.Any(cont => cont.IsCode(CardId.TrickstarLightStage)));
......@@ -685,6 +690,7 @@ namespace WindBot.Game.AI.Decks
private bool KnightmareMermaidEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
AI.SelectCard(HandCosts);
return true;
}
......@@ -703,6 +709,7 @@ namespace WindBot.Game.AI.Decks
private bool OrcustKnightmareEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (!Bot.HasInGraveyard(CardId.OrcustHarpHorror))
{
AI.SelectCard(Util.GetBestBotMonster());
......@@ -726,6 +733,7 @@ namespace WindBot.Game.AI.Decks
private bool HarpHorrorEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
HarpHorrorUsed = true;
AI.SelectCard(CardId.OrcustCymbalSkeleton);
return true;
......@@ -733,6 +741,7 @@ namespace WindBot.Game.AI.Decks
private bool WorldWandEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
AI.SelectCard(CardId.OrcustCymbalSkeleton);
return true;
}
......@@ -783,6 +792,7 @@ namespace WindBot.Game.AI.Decks
private bool CymbalSkeletonEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
int[] botTurnTargets = new[] { CardId.GalateaTheOrcustAutomaton, CardId.SheorcustDingirsu };
int[] emenyTurnTargets = new[] { CardId.SheorcustDingirsu, CardId.GalateaTheOrcustAutomaton };
if (Duel.Player == 0 && Bot.HasInGraveyard(CardId.GalateaTheOrcustAutomaton) && !Bot.HasInMonstersZone(CardId.GalateaTheOrcustAutomaton) && Bot.HasInExtra(CardId.SheorcustDingirsu) && !SheorcustDingirsuSummoned)
......@@ -867,6 +877,7 @@ namespace WindBot.Game.AI.Decks
private bool AncientCloakEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Bot.HasInMonstersZone(CardId.SalamangreatAlmiraj) && Bot.HasInExtra(CardId.KnightmarePhoenix))
AI.SelectCard(CardId.ThePhantomKnightsofShadeBrigandine);
else
......@@ -881,6 +892,7 @@ namespace WindBot.Game.AI.Decks
private bool SilentBootsEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Bot.HasInMonstersZone(CardId.SalamangreatAlmiraj) && Bot.HasInExtra(CardId.KnightmarePhoenix))
AI.SelectCard(CardId.ThePhantomKnightsofShadeBrigandine);
else
......@@ -1033,6 +1045,7 @@ namespace WindBot.Game.AI.Decks
{
if (Card.Location == CardLocation.Grave)
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
IList<ClientCard> costCards = Bot.Hand.GetMatchingCards(card => card.IsCode(HandCosts));
if (costCards.Count > 0)
{
......@@ -1113,6 +1126,7 @@ namespace WindBot.Game.AI.Decks
}
else if (Bot.HasInGraveyard(CardId.ThePhantomKnightsofRustyBardiche) || Bot.GetMonsterCount() < 2)
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
AI.SelectCard(CardId.ThePhantomKnightsofRustyBardiche);
return true;
}
......
......@@ -555,6 +555,7 @@ namespace WindBot.Game.AI.Decks
}
private bool SpeedroidTaketomborgeff()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if ((Bot.GetRemainingCount(CardId.SpeedroidRedEyedDice, 1) >= 1) &&
Bot.HasInMonstersZone(CardId.SpeedroidTerrortop))
{
......
......@@ -130,6 +130,7 @@ namespace WindBot.Game.AI.Decks
public override void OnNewTurn()
{
CardOfDemiseUsed = false;
base.OnNewTurn();
}
public override IList<ClientCard> OnSelectPendulumSummon(IList<ClientCard> cards, int max)
......@@ -281,6 +282,7 @@ namespace WindBot.Game.AI.Decks
{
if (Card.Location == CardLocation.Hand)
return false;
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
int count = 0;
int handcount = 0;
int fieldcount = 0;
......
......@@ -142,6 +142,7 @@ namespace WindBot.Game.AI.Decks
public override void OnNewTurn()
{
NormalSummoned = false;
base.OnNewTurn();
}
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
......@@ -210,6 +211,7 @@ namespace WindBot.Game.AI.Decks
private bool RescueRabbitSummon()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return Util.GetBotAvailZonesFromExtraDeck() > 0
|| !Enemy.MonsterZone.IsExistingMatchingCard(card => card.GetDefensePower() >= 1900)
|| Enemy.MonsterZone.GetMatchingCardsCount(card => card.GetDefensePower() < 1900) > Bot.MonsterZone.GetMatchingCardsCount(card => card.Attack >= 1900);
......
......@@ -116,6 +116,7 @@ namespace WindBot.Game.AI.Decks
DoubleSummonUsed = false;
CyberDragonInfinitySummoned = false;
Number61VolcasaurusUsed = false;
base.OnNewTurn();
}
public override IList<ClientCard> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max)
......
......@@ -153,6 +153,7 @@ namespace WindBot.Game.AI.Decks
{
// reset
BalancerLordUsed = false;
base.OnNewTurn();
}
public override int OnSelectOption(IList<int> options)
......
......@@ -594,6 +594,7 @@ namespace WindBot.Game.AI.Decks
}
else
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Bot.HasInHand(CardId.Spinny) || FalcoToGY(false))
{
if (Bot.HasInHand(CardId.Spinny) && !Bot.HasInGraveyard(CardId.Spinny))
......@@ -779,10 +780,12 @@ namespace WindBot.Game.AI.Decks
public bool G_activate()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return (Duel.Player == 1);
}
public bool Hand_act_eff()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return (Duel.LastChainPlayer == 1);
}
......
......@@ -146,6 +146,7 @@ namespace WindBot.Game.AI.Decks
ShizukuSummoned = false;
HayateSummoned = false;
WidowAnchorTarget = null;
base.OnNewTurn();
}
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
......@@ -194,6 +195,7 @@ namespace WindBot.Game.AI.Decks
private bool MaxxCEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return Duel.Player == 1;
}
......@@ -667,6 +669,7 @@ namespace WindBot.Game.AI.Decks
private bool JetSynchronEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Bot.HasInMonstersZone(CardId.Raye) || Bot.HasInMonstersZone(CardId.CrystronNeedlefiber))
{
AI.SelectCard(GetDiscardHand());
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -192,6 +192,7 @@ namespace WindBot.Game.AI.Decks
{
if (Card.Location == CardLocation.MonsterZone)
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
AI.SelectCard(Monsters.TimeThiefCronocorder);
AI.SelectCard(Monsters.TimeThiefWinder);
return true;
......@@ -370,6 +371,7 @@ namespace WindBot.Game.AI.Decks
}
private bool ThunderKingRaiOheff()
{
if (DefaultOnlyHorusSpSummoning()) return false;
if (Duel.SummoningCards.Count > 0)
{
foreach (ClientCard m in Duel.SummoningCards)
......
......@@ -231,6 +231,7 @@ namespace WindBot.Game.AI.Decks
}
else
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Bot.HasInHand(CardId.DupeFrog))
{
AI.SelectCard(
......@@ -267,6 +268,7 @@ namespace WindBot.Game.AI.Decks
private bool RonintoadinEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
......@@ -297,6 +299,7 @@ namespace WindBot.Game.AI.Decks
{
if (Duel.CurrentChain.Count > 0)
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
// negate effect, select a cost for it
List<ClientCard> monsters = Bot.GetMonsters();
IList<int> suitableCost = new[] {
......@@ -381,6 +384,7 @@ namespace WindBot.Game.AI.Decks
}
else if (Duel.Phase == DuelPhase.Standby)
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
SelectXYZDetach(Card.Overlays);
if (Duel.Player == 0)
{
......
This diff is collapsed.
This diff is collapsed.
......@@ -155,6 +155,7 @@ namespace WindBot.Game.AI.Decks
public override void OnNewTurn()
{
CardOfDemiseUsed = false;
base.OnNewTurn();
}
public override bool OnSelectYesNo(int desc)
......
This diff is collapsed.
......@@ -127,6 +127,7 @@ namespace WindBot.Game.AI.Decks
TigermortarSpsummoned = false;
ChakanineSpsummoned = false;
BroadbullSpsummoned = false;
base.OnNewTurn();
}
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
......@@ -150,6 +151,7 @@ namespace WindBot.Game.AI.Decks
{
if (Card.Location == CardLocation.Hand)
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (!(Duel.Phase == DuelPhase.BattleStep
|| Duel.Phase == DuelPhase.BattleStart
|| Duel.Phase == DuelPhase.Damage))
......@@ -429,8 +431,7 @@ namespace WindBot.Game.AI.Decks
{
if (Duel.Phase == DuelPhase.Main1 || Duel.Phase == DuelPhase.Main2)
return false;
if (Card.IsDisabled())
return false;
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
ClientCard target = null;
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
......
This diff is collapsed.
......@@ -34,7 +34,11 @@ namespace WindBot.Game.AI
[DataMember]
public string[] setmonster { get; set; }
[DataMember]
public string[] chaining { get; set; }
public string[] chaining { get; set; }
[DataMember]
public string[] surrender { get; set; }
[DataMember]
public string[] custom { get; set; }
}
public class Dialogs
{
......@@ -53,7 +57,9 @@ namespace WindBot.Game.AI
private string[] _summon;
private string[] _setmonster;
private string[] _chaining;
private string[] _surrender;
private string[] _custom;
public Dialogs(GameClient game)
{
_game = game;
......@@ -75,6 +81,8 @@ namespace WindBot.Game.AI
_summon = data.summon;
_setmonster = data.setmonster;
_chaining = data.chaining;
_surrender = data.surrender;
_custom = data.custom;
}
}
......@@ -158,10 +166,17 @@ namespace WindBot.Game.AI
InternalSendMessage(_chaining, card);
}
public void SendSurrender()
{
InternalSendMessage(_surrender);
}
private void InternalSendMessage(IList<string> array, params object[] opts)
{
if (!_game._chat)
return;
if (array == null || array.Count == 0)
return;
string message = string.Format(array[Program.Rand.Next(array.Count)], opts);
if (message != "")
_game.Chat(message);
......@@ -176,5 +191,14 @@ namespace WindBot.Game.AI
Logger.WriteLine("Error: " + message);
}
}
public void SendCustomChat(int index, params object[] opts)
{
if (!_game._chat || _custom == null)
return;
string message = string.Format(_custom[index], opts);
if (message != "")
_game.Chat(message);
}
}
}
......@@ -24,5 +24,8 @@
ZushintheSleepingGiant = 67547370,
Heart_eartHDragon = 97403510,
DaigustoSphreeze = 29552709,
OhimetheManifestedMikanko = 81260679,
ArahimetheManifestedMikanko = 75771170,
YubelDasEwigLiebeWachter = 47172959
}
}
This diff is collapsed.
......@@ -51,9 +51,41 @@
FusionGate = 33550694,
DFusion = 26841274,
FusionDestiny = 52947044,
PyroxeneFusion = 55824220,
FragmentFusion = 72029628,
NecroFusion = 81223446,
PredaplantVerteAnaconda = 70369116,
DreamMirrorofChaos = 98570539,
PlunderPatrollShipshapeShipsShipping = 44227727,
FireFormationIngen = 29143457,
ParametalfoesFusion = 58549532,
ReadyFusion = 63854005,
BrandedinWhite = 34995106,
BrandedinRed = 82738008,
FaceCardFusion = 29062925,
MyutantFusion = 42577802,
MyutantCry = 31855260,
FallenOfAlbaz = 68468459,
GreaterPolymerization = 7614732,
UltimateFusion = 71143015,
BrandedFusion = 44362883,
GhostFusion = 35705817,
WitchcrafterConfusionConfession = 35098357,
BrandedBanishment = 6763530,
DinomorphiaDomain = 26631975,
DinomorphiaFrenzy = 78420796,
SouloftheSupremeKing = 92428405,
InstantContact = 16169772,
ScatterFusion = 40597694,
FavoriteContact = 75047173,
AmazonessSecretArts = 86758746,
DarkWorldAccession = 65956182,
BeetrooperLanding = 13234975,
FusionReproduction = 43331750,
ChimeraFusion = 63136489,
HarmonicSynchroFusion = 7473735,
SouloftheSupremeCelestialKing = 76840111
}
}
......@@ -25,7 +25,11 @@
DaigustoSphreez = 29552709,
Number92HearteartHDragon = 97403510,
NumberC96DarkStorm = 77205367,
Number54LionHeart = 54366836
Number54LionHeart = 54366836,
Number2NinjaShadowMosquito = 32453837,
OhimetheManifestedMikanko = 81260679,
NightmareMagician = 40221691,
ArahimetheManifestedMikanko = 75771170
}
/// <summary>
/// Cards that are invincible to battle.
......@@ -93,6 +97,23 @@
GoukiTheGiantOgre = 47946130,
BorrelswordDragon = 85289965,
NumberF0UtopicFutureDragon = 26973555,
BorrelendDragon = 98630720
BorrelendDragon = 98630720,
MimickingMan_EaterBug = 72427512,
ShiningPiecephilia = 49776811,
BrigrandtheGloryDragon = 34848821,
AmazonessQueen = 15951532,
Number2NinjaShadowMosquito = 32453837,
OhimetheManifestedMikanko = 81260679,
CornfieldCoatl = 92565383,
MirrorSwordknight = 28954097,
NightmareMagician = 40221691,
ArahimetheManifestedMikanko = 75771170,
UFOLight = 9275482,
TaotheGreatChanter = 34541543,
SpiritOfYubel = 90829280,
DarkGuardian = 26746975,
EnvoyOfTheWaxState = 87462901,
Fluffyfluff = 85401123,
YubelDasEwigLiebeWachter = 47172959
}
}
namespace WindBot.Game.AI.Enums
{
public enum NotBeSynchroMaterialMonster
{
Ronintoadin = 1357146,
GagagaCaesar = 9583383,
VagueShadowToken = 9929399,
TourGuideFromtheUnderworld = 10802915,
PhotonToken = 17418745,
KagemuchaKnight = 19353570,
SharkStickers = 20838380,
GagagaMagician = 26082117,
RadianToken = 28674153,
Kurivolt = 40817915,
BlueMountainButterspy = 54582424,
Lightserpent = 55501446,
SaberShark = 63193879,
ConstellarKaus = 70908596,
CeremonialToken = 82340057,
HeroicChallenger_DoubleLance = 89774530,
SteelswarmScout = 90727556,
Kagetokage = 94656263,
YellowDuston = 16366810,
BlueDuston = 40217358,
Centerfrog = 47346782,
GreenDuston = 52182715,
RedDuston = 61019812,
EaterofMillions = 63845230,
PutridPuddingBodyBuddies = 85101097,
Click_Echo = 2992467
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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