Commit a83c5e3a authored by nanahira's avatar nanahira

Merge branch 'master' of github.com:IceYGO/windbot

parents 61e96415 a75d41f0
...@@ -89,6 +89,36 @@ Name=尼亚 Deck=Altergeist Dialog=near.zh-CN ...@@ -89,6 +89,36 @@ Name=尼亚 Deck=Altergeist Dialog=near.zh-CN
幻变骚灵卡组。 幻变骚灵卡组。
AI_LV3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020 AI_LV3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!尼亚-拉比林斯迷宫
Name=尼亚 Deck=Labrynth Dialog=near.zh-CN
拉比林斯迷宫卡组。
AI_LV3 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_LV3 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 Name=永远之魂 Deck=Burn Dialog=soul.zh-CN
老式削血卡组。 老式削血卡组。
...@@ -244,6 +274,16 @@ Name=玻璃女巫 Deck=Exosister Dialog=verre.zh-CN ...@@ -244,6 +274,16 @@ Name=玻璃女巫 Deck=Exosister Dialog=verre.zh-CN
救祓少女卡组。 救祓少女卡组。
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020 AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
!艾克莉西娅-相剑
Name=艾克莉西娅 Deck=Swordsoul Dialog=ecclesia.zh-CN
相剑卡组。
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
!艾克莉西娅-教导
Name=艾克莉西娅 Deck=Dogmatika Dialog=ecclesia.zh-CN
教导卡组。
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!神数不神-刹帝利 !神数不神-刹帝利
Name=神数不神 Deck=Kashtira Dialog=Zefra.zh-CN Name=神数不神 Deck=Kashtira Dialog=Zefra.zh-CN
俱舍怒威族卡组。 俱舍怒威族卡组。
...@@ -258,3 +298,13 @@ SUPPORT_MASTER_RULE_2020 ...@@ -258,3 +298,13 @@ SUPPORT_MASTER_RULE_2020
Name=神数不神 Deck=Tearlaments Dialog=Zefra.zh-CN Name=神数不神 Deck=Tearlaments Dialog=Zefra.zh-CN
旧式地天使珠泪哀歌族卡组。 旧式地天使珠泪哀歌族卡组。
AI_LV3 SUPPORT_MASTER_RULE_2020 AI_LV3 SUPPORT_MASTER_RULE_2020
!神数不神-神数
Name=神数不神 Deck=Zefra Dialog=Zefra.zh-CN
神数卡组。
AI_LV3 SUPPORT_MASTER_RULE_2020
!今晚有宵夜吗-超重武者
Name=今晚有宵夜吗 Deck=SuperheavySamurai Dialog=superheavysamurai.zh-CN
超重武者卡组。
AI_LV3 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
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
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
...@@ -50,5 +50,10 @@ ...@@ -50,5 +50,10 @@
"乎,我发动{0}!", "乎,我发动{0}!",
"不好意思拉,我有{0}", "不好意思拉,我有{0}",
"哈哈,发动{0}的效果!" "哈哈,发动{0}的效果!"
],
"custom": [
"呱!本体出征!",
"凸(艹皿艹 )卡手不玩拉!!!",
"嘿不慌,还有摆子场( ̄y▽ ̄)╭"
] ]
} }
{
"welcome": [
"这里就是大灵峰吗?",
"这里是教导龙国。"
],
"deckerror": [
"{0}被冰水咒缚了!"
],
"duelstart": [
"走了好久,肚子饿了……",
"前方会遇到怎样的同伴呢?",
"有阿不思在一起的话……"
],
"newturn": [
"我的回合!"
],
"endturn": [
"姐姐到底在哪里……",
"阿不思的干粮也吃完了啊。",
"什么时候开饭呢?"
],
"directattack": [
"{0},直接攻击!",
"开饭!"
],
"attack": [
"用{0}攻击{1}!"
],
"ondirectattack": [
"好饿……",
"呜呜……",
"姐姐……"
],
"facedownmonstername": "怪兽",
"activate": [
"发动{0}的效果!"
],
"summon": [
"{0}召唤!",
"出来吧,{0}!"
],
"setmonster": [
"……"
],
"chaining": [
"发动{0}的效果!",
"{0}!"
]
}
{
"welcome": [
"是宵夜哒哟!",
"什么灵摆卡组都会玩的哟!",
"什么?你说超重不是灵摆卡组?"
],
"deckerror": [
"{0}的数量不对!快去改成无禁限模式!。"
],
"duelstart": [
"给你展现一下超重的魅力!"
],
"newturn": [
"抽卡!弁庆你别上手救我了!",
"抽卡!P身子你别上手救我了!"
],
"endturn": [
"哼哼,到你的回合了!",
"喜不喜欢我的展开呢?"
],
"directattack": [
"我用{0}直接攻击!"
],
"attack": [
"我用{0}攻击{1}!"
],
"ondirectattack": [
"不许打!不许打呀!",
"呜哇!要被打倒惹~"
],
"facedownmonstername": "怪兽",
"activate": [
"呼呼呼,{0}的效果太厉害了!",
"呼呼呼,我使用{0}的效果。"
],
"summon": [
"呼呼呼,我召唤{0}!"
],
"setmonster": [
"呼呼呼,我盖放了一只怪兽。"
],
"chaining": [
"此刻!{0}的效果发动!"
]
}
...@@ -434,6 +434,15 @@ namespace WindBot.Game.AI ...@@ -434,6 +434,15 @@ namespace WindBot.Game.AI
if (selected.Count >= max) if (selected.Count >= max)
break; 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) while (selected.Count > max)
{ {
...@@ -442,5 +451,115 @@ namespace WindBot.Game.AI ...@@ -442,5 +451,115 @@ namespace WindBot.Game.AI
return selected; 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 ...@@ -25,6 +25,15 @@ namespace WindBot.Game.AI
return 1; 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) public static int CompareDefensePower(ClientCard cardA, ClientCard cardB)
{ {
if (cardA == null && cardB == null) if (cardA == null && cardB == null)
......
...@@ -21,7 +21,8 @@ namespace WindBot.Game.AI ...@@ -21,7 +21,8 @@ namespace WindBot.Game.AI
/// </summary> /// </summary>
public static bool IsMonsterDangerous(this ClientCard card) 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> /// <summary>
...@@ -78,5 +79,21 @@ namespace WindBot.Game.AI ...@@ -78,5 +79,21 @@ namespace WindBot.Game.AI
{ {
return Enum.IsDefined(typeof(FusionSpell), card.Id); 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; ...@@ -3,6 +3,7 @@ using System.Collections.Generic;
using WindBot; using WindBot;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
using System.Linq;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
...@@ -324,23 +325,37 @@ namespace WindBot.Game.AI.Decks ...@@ -324,23 +325,37 @@ namespace WindBot.Game.AI.Decks
public int SelectSTPlace(ClientCard card=null, bool avoid_Impermanence = false) 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; int n = list.Count;
while (n-- > 1) while (n-- > 1)
{ {
int index = Program.Rand.Next(n + 1); int index = Program.Rand.Next(list.Count);
int temp = list[index]; int nextIndex = (index + Program.Rand.Next(list.Count - 1)) % list.Count;
list[index] = list[n]; int tempInt = list[index];
list[n] = temp; 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); foreach (int seq in list)
if (Bot.SpellZone[seq] == null)
{ {
if (card != null && card.Location == CardLocation.Hand && avoid_Impermanence && Impermanence_list.Contains(seq)) continue; ClientCard enemySpell = Enemy.SpellZone[4 - seq];
return zone; 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; return 0;
} }
...@@ -2656,6 +2671,27 @@ namespace WindBot.Game.AI.Decks ...@@ -2656,6 +2671,27 @@ namespace WindBot.Game.AI.Decks
attacked_Meluseek.Clear(); attacked_Meluseek.Clear();
} }
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() public bool MonsterRepos()
{ {
if (Card.Attack == 0) return (Card.IsAttack()); if (Card.Attack == 0) return (Card.IsAttack());
...@@ -2797,7 +2833,8 @@ namespace WindBot.Game.AI.Decks ...@@ -2797,7 +2833,8 @@ namespace WindBot.Game.AI.Decks
// throw all?? // throw all??
return null; return null;
} }
return null;
return base.OnSelectCard(cards, min, max, hint, cancelable);
} }
public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions) public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions)
......
...@@ -146,7 +146,8 @@ namespace WindBot.Game.AI.Decks ...@@ -146,7 +146,8 @@ namespace WindBot.Game.AI.Decks
return Util.CheckSelectCount(result, cards, min, max); return Util.CheckSelectCount(result, cards, min, max);
} }
Logger.DebugWriteLine("Use default."); 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) public override IList<ClientCard> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -629,25 +629,42 @@ namespace WindBot.Game.AI.Decks ...@@ -629,25 +629,42 @@ namespace WindBot.Game.AI.Decks
/// <param name="avoidList">Whether need to avoid set in this place</param> /// <param name="avoidList">Whether need to avoid set in this place</param>
public void SelectSTPlace(ClientCard card = null, bool avoidImpermanence = false, List<int> avoidList = null) public void SelectSTPlace(ClientCard card = null, bool avoidImpermanence = false, List<int> avoidList = null)
{ {
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 && avoidImpermanence && infiniteImpermanenceList.Contains(seq)) continue;
if (avoidList != null && avoidList.Contains(seq)) continue;
list.Add(seq);
}
}
int n = list.Count; int n = list.Count;
while (n-- > 1) while (n-- > 1)
{ {
int index = Program.Rand.Next(n + 1); int index = Program.Rand.Next(list.Count);
int temp = list[index]; int nextIndex = (index + Program.Rand.Next(list.Count - 1)) % list.Count;
list[index] = list[n]; int tempInt = list[index];
list[n] = temp; list[index] = list[nextIndex];
list[nextIndex] = tempInt;
} }
foreach (int seq in list) if (avoidImpermanence && Bot.GetMonsters().Any(c => c.IsFaceup() && !c.IsDisabled()))
{ {
int zone = (int)System.Math.Pow(2, seq); foreach (int seq in list)
if (Bot.SpellZone[seq] == null)
{ {
if (card != null && card.Location == CardLocation.Hand && avoidImpermanence && infiniteImpermanenceList.Contains(seq)) continue; ClientCard enemySpell = Enemy.SpellZone[4 - seq];
if (avoidList != null && avoidList.Contains(seq)) continue; if (enemySpell != null && enemySpell.IsFacedown()) continue;
int zone = (int)System.Math.Pow(2, seq);
AI.SelectPlace(zone); AI.SelectPlace(zone);
return; return;
}; }
}
foreach (int seq in list)
{
int zone = (int)System.Math.Pow(2, seq);
AI.SelectPlace(zone);
return;
} }
AI.SelectPlace(0); AI.SelectPlace(0);
} }
...@@ -816,6 +833,7 @@ namespace WindBot.Game.AI.Decks ...@@ -816,6 +833,7 @@ namespace WindBot.Game.AI.Decks
public override void OnNewTurn() public override void OnNewTurn()
{ {
if (Duel.Turn <= 1) calledbytheGraveCount.Clear();
enemyActivateMaxxC = false; enemyActivateMaxxC = false;
enemyActivateLockBird = false; enemyActivateLockBird = false;
infiniteImpermanenceList.Clear(); infiniteImpermanenceList.Clear();
...@@ -1950,7 +1968,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1950,7 +1968,7 @@ namespace WindBot.Game.AI.Decks
} }
// become target // become target
if (DefaultOnBecomeTarget() || (Duel.CurrentChain.Any(c => c == Card) && Duel.LastChainPlayer != 0)) if ((DefaultOnBecomeTarget() && !Util.ChainContainsCard(_CardId.EvenlyMatched)) || (Duel.CurrentChain.Any(c => c == Card) && Duel.LastChainPlayer != 0))
{ {
targetedMagnificaList.Add(Card); targetedMagnificaList.Add(Card);
transformDestList.AddRange(new List<int>{CardId.ExosistersMagnifica, CardId.ExosisterMikailis, CardId.ExosisterGibrine, CardId.ExosisterKaspitell, CardId.ExosisterAsophiel}); transformDestList.AddRange(new List<int>{CardId.ExosistersMagnifica, CardId.ExosisterMikailis, CardId.ExosisterGibrine, CardId.ExosisterKaspitell, CardId.ExosisterAsophiel});
...@@ -2025,7 +2043,7 @@ namespace WindBot.Game.AI.Decks ...@@ -2025,7 +2043,7 @@ namespace WindBot.Game.AI.Decks
public bool ExosisterPaxActivate() public bool ExosisterPaxActivate()
{ {
if (potActivate) if (potActivate || Bot.LifePoints <= 800)
{ {
return false; return false;
} }
...@@ -2198,7 +2216,7 @@ namespace WindBot.Game.AI.Decks ...@@ -2198,7 +2216,7 @@ namespace WindBot.Game.AI.Decks
public bool ExosisterPaxActivateForEndSearch() public bool ExosisterPaxActivateForEndSearch()
{ {
if (potActivate) if (potActivate || Bot.LifePoints <= 800)
{ {
return false; return false;
} }
...@@ -2230,6 +2248,10 @@ namespace WindBot.Game.AI.Decks ...@@ -2230,6 +2248,10 @@ namespace WindBot.Game.AI.Decks
public bool ExosisterArmentActivate() public bool ExosisterArmentActivate()
{ {
if (Bot.LifePoints <= 800)
{
return false;
}
ClientCard activateTarget = null; ClientCard activateTarget = null;
if (Duel.Player == 0) if (Duel.Player == 0)
...@@ -2366,6 +2388,11 @@ namespace WindBot.Game.AI.Decks ...@@ -2366,6 +2388,11 @@ namespace WindBot.Game.AI.Decks
public bool ExosisterVadisActivate() public bool ExosisterVadisActivate()
{ {
if (Bot.LifePoints <= 800)
{
return false;
}
List<int> checkListForSpSummon = new List<int>{ List<int> checkListForSpSummon = new List<int>{
CardId.ExosisterSophia, CardId.ExosisterIrene, CardId.ExosisterStella, CardId.ExosisterMartha, CardId.ExosisterElis CardId.ExosisterSophia, CardId.ExosisterIrene, CardId.ExosisterStella, CardId.ExosisterMartha, CardId.ExosisterElis
}; };
...@@ -2435,6 +2462,11 @@ namespace WindBot.Game.AI.Decks ...@@ -2435,6 +2462,11 @@ namespace WindBot.Game.AI.Decks
public bool ExosisterReturniaActivate() public bool ExosisterReturniaActivate()
{ {
if (Bot.LifePoints <= 800)
{
return false;
}
// banish problem card // banish problem card
ClientCard target = GetProblematicEnemyCard(true); ClientCard target = GetProblematicEnemyCard(true);
if (target != null && Duel.LastChainPlayer != 0) if (target != null && Duel.LastChainPlayer != 0)
...@@ -2463,7 +2495,7 @@ namespace WindBot.Game.AI.Decks ...@@ -2463,7 +2495,7 @@ namespace WindBot.Game.AI.Decks
// dump banish // dump banish
target = GetBestEnemyCard(false, true, true); target = GetBestEnemyCard(false, true, true);
bool check1 = DefaultOnBecomeTarget() && target.Id != _CardId.EvenlyMatched; bool check1 = DefaultOnBecomeTarget() && target != null && (target.Location != CardLocation.Onfield || target.Id != _CardId.EvenlyMatched);
bool check2 = Bot.UnderAttack; bool check2 = Bot.UnderAttack;
bool check3 = (Duel.Player == 1 && Duel.Phase == DuelPhase.End && Duel.LastChainPlayer != 0 && target != null && target.Location != CardLocation.Grave); bool check3 = (Duel.Player == 1 && Duel.Phase == DuelPhase.End && Duel.LastChainPlayer != 0 && target != null && target.Location != CardLocation.Grave);
bool check4 = (Duel.Player == 1 && Enemy.GetMonsterCount() >= 2 && Duel.LastChainPlayer != 0); bool check4 = (Duel.Player == 1 && Enemy.GetMonsterCount() >= 2 && Duel.LastChainPlayer != 0);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
using YGOSharp.OCGWrapper;
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using System.Linq;
using System;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
namespace WindBot.Game.AI.Decks
{
[Deck("SuperheavySamurai", "AI_SuperheavySamurai")]
public class SuperheavySamuraiExecutor : DefaultExecutor
{
public class CardId
{
public const int Benkei = 19510093;//弁庆
public const int Wagon = 34496660;//大八
public const int Soulpiercer = 90361010;//岩融
public const int Wakaushi = 82112494;//牛若
public const int Scales = 78391364;//天秤
public const int Booster = 56727340;//地铠
public const int Motorbike = 83334932;//摩托
public const int Soulhorns = 14624296;//双角
public const int Soulpeacemaker = 95500396;//仲裁
public const int Regulus = 10604644;//轩辕十四
public const int MaxxG = 23434538;//增殖的G
public const int JoyousSpring = 14558127;//灰流丽
public const int PsyFrameDriver = 49036338;//PSY骨架驱动者
public const int PsyFramegearGamma = 38814750;//PSY骨架装备·γ
public const int EffectVeiler = 97268402;//效果遮蒙者
public const int HauntedMansion = 73642296;//屋敷童
public const int SnowRabbit = 59438930;//幽鬼兔
public const int LockBird = 94145021;//小丑与锁鸟
//extra
public const int Masurawo = 64193046;//益荒男
public const int Fleur = 84815190;//鲜花女男爵
public const int ASStardustDragon = 30983281;//加速同调星尘龙
public const int StardustDragon = 30983281;//星尘龙
public const int SavageDragon = 27548199;//狞猛龙
public const int Sarutobi = 76471944;//猿飞
public const int PSYFramelordOmega = 74586817;//PSY骨架王·Ω
public const int GearGigant = 28912357;//齿轮齿巨人
public const int Unicorn = 38342335;//独角兽
public const int Elf = 27381364;//卫星闪灵·淘气精灵
public const int Genius = 22423493;//路径灵
public const int IP = 65741786;//I:P伪装舞会莱娜
public const int Scarecrow = 33918636;//案山子
}
private bool normal_summon = false;
private bool p_summoned = false;
private bool p_summoning = false;
private bool activate_Motorbike = false;//摩托
private bool activate_Wakaushi = false;//神童
private bool activate_Scales = false;//天秤
private bool activate_Wagon = false;//大巴
private bool activate_Booster = false;//地铠
private bool activate_Soulpeacemaker = false;//仲裁
private bool activate_Benkei = false;//弁庆
private bool need_Gear = false;//齿轮齿巨人
//案山子
private bool activate_Scarecrow=false;
private bool summon_Scarecrow=false;
private bool activate_Sarutobi = false;//猿飞
private bool activate_Genius = false;//路径灵
//淘气精灵
private bool activate_Elf = false;
private bool summon_Elf = false;
//手坑
private bool activate_MaxxG = false;//增殖的G
private bool activate_PSY = false;//PSY
private bool activate_LockBird = false;//小丑与锁鸟
private bool to_deck = false;
public SuperheavySamuraiExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
AddExecutor(ExecutorType.Activate, CardId.PSYFramelordOmega);
AddExecutor(ExecutorType.Activate, CardId.IP,IPFunction);
AddExecutor(ExecutorType.Activate, CardId.Sarutobi,SarutobiFunction);
AddExecutor(ExecutorType.Activate, CardId.Unicorn,UnicornFunction);
AddExecutor(ExecutorType.Activate, CardId.MaxxG,MaxxCFunction);
AddExecutor(ExecutorType.Activate, CardId.JoyousSpring,DefaultAshBlossomAndJoyousSpring);
AddExecutor(ExecutorType.Activate, CardId.SnowRabbit,DefaultGhostOgreAndSnowRabbit);
AddExecutor(ExecutorType.Activate, CardId.EffectVeiler,DefaultBreakthroughSkill);
AddExecutor(ExecutorType.Activate, CardId.LockBird,LockBirdFunction);
AddExecutor(ExecutorType.Activate, CardId.PsyFramegearGamma,FunctionInHand);
AddExecutor(ExecutorType.Activate, CardId.HauntedMansion,FunctionInHand);
AddExecutor(ExecutorType.Activate, CardId.Masurawo,MasurawoFunction);
AddExecutor(ExecutorType.Activate, CardId.Genius,GeniusFunction);
//Motorbike's Effect
AddExecutor(ExecutorType.Activate, CardId.Motorbike,MotorbikeFunction);
//Scales's Effect
AddExecutor(ExecutorType.SpSummon, CardId.Scales);
AddExecutor(ExecutorType.Activate, CardId.Scales,ScalesFunction);
//Synchron
AddExecutor(ExecutorType.SpSummon, CardId.ASStardustDragon,ASStardustDragonSynchronFunction2);
AddExecutor(ExecutorType.SpSummon, CardId.Fleur,FleurSynchronFunction2);
AddExecutor(ExecutorType.Activate, CardId.Wakaushi,WakaushiFunction);
AddExecutor(ExecutorType.Activate, CardId.Wakaushi,WakaushiEffectFunction);
AddExecutor(ExecutorType.Activate, CardId.Benkei,BenkeiEffectFunction);
//Normal Summon & Effect
AddExecutor(ExecutorType.Summon, CardId.Soulpiercer,NormalSummonFunction);
AddExecutor(ExecutorType.Activate, CardId.Soulpiercer,SoulpiercerFunction);
AddExecutor(ExecutorType.Summon, CardId.Wagon,NormalSummonFunction);
AddExecutor(ExecutorType.Activate, CardId.Wagon,WagonFunction);
AddExecutor(ExecutorType.Activate, CardId.Wagon,WagonFunction);
AddExecutor(ExecutorType.Summon, CardId.Booster,BoosterNormalSummonFunction);
AddExecutor(ExecutorType.Summon, CardId.Scales,ScalesNormalSummonFunction);
//boost & Gear
AddExecutor(ExecutorType.Activate, CardId.Booster,BoosterEquipFunction);
AddExecutor(ExecutorType.Activate, CardId.Booster,BoosterFunction);
AddExecutor(ExecutorType.SpSummon, CardId.GearGigant,GearGigantXyzFunction);
AddExecutor(ExecutorType.Activate, CardId.GearGigant,GearGigantFunction);
//equip Soulpiercer
AddExecutor(ExecutorType.Activate, CardId.Soulpiercer,SoulpiercerEquipFunction);
//Link Scarecrow
AddExecutor(ExecutorType.SpSummon, CardId.Scarecrow,ScarecrowLinkFunction);
AddExecutor(ExecutorType.Activate, CardId.Scarecrow,ScarecrowFunction);
//Synchron
AddExecutor(ExecutorType.SpSummon, CardId.ASStardustDragon,ASStardustDragonSynchronFunction);
//Effect After Synchron
AddExecutor(ExecutorType.Activate, CardId.SavageDragon,SavageDragonFunction);
AddExecutor(ExecutorType.Activate, CardId.ASStardustDragon,ASStardustDragonFunction);
//Wakaushi's Effect After Synchron
AddExecutor(ExecutorType.Activate, CardId.Wakaushi,WakaushiReturnPFunction);
//Synchron
AddExecutor(ExecutorType.SpSummon, CardId.Fleur,FleurSynchronFunction);
AddExecutor(ExecutorType.Activate, CardId.Fleur,FleurFunction);
//equip Soulpeacemaker
AddExecutor(ExecutorType.Activate, CardId.Soulpeacemaker,SoulpeacemakerEquipFunction);
AddExecutor(ExecutorType.Activate, CardId.Soulpeacemaker,SoulpeacemakerFunction);
//Link
AddExecutor(ExecutorType.SpSummon, CardId.Genius,GeniusLinkFunction);
AddExecutor(ExecutorType.SpSummon, Psummon);
//Link
AddExecutor(ExecutorType.SpSummon, CardId.Elf,ElfLinkFunction);
AddExecutor(ExecutorType.Activate, CardId.Elf,ElfFunction);
AddExecutor(ExecutorType.Activate, CardId.Motorbike,MotorbikeFunction);
//Regulus's Effect
AddExecutor(ExecutorType.Activate, CardId.Regulus,RegulusFunction);
//Synchron
AddExecutor(ExecutorType.SpSummon, CardId.SavageDragon,SavageDragonSynchronFunction);
//Link
AddExecutor(ExecutorType.SpSummon, CardId.IP,IPLinkFunction);
//Synchron
AddExecutor(ExecutorType.SpSummon, CardId.Masurawo,MasurawoSynchronFunction);
AddExecutor(ExecutorType.SpSummon, CardId.Sarutobi,DeSynchronFunction);
AddExecutor(ExecutorType.SpSummon, CardId.PSYFramelordOmega);
//equip Soulhorns
AddExecutor(ExecutorType.Activate, CardId.Soulhorns,SoulhornsEquipFunction);
//booster
AddExecutor(ExecutorType.Activate, CardId.Booster,BoosterEquipFunction2);
AddExecutor(ExecutorType.Activate, CardId.Booster,BoosterFunction);
}
public override void OnNewTurn()
{
normal_summon = false;
p_summoned = false;
p_summoning = false;
activate_Motorbike = false;
activate_Wakaushi = false;
activate_Scales = false;
activate_Wagon = false;
activate_Booster = false;
activate_Soulpeacemaker = false;
activate_Benkei = false;
need_Gear = false;
activate_Scarecrow=false;
summon_Scarecrow=false;
activate_Elf = false;
summon_Elf = false;
activate_MaxxG = false;
activate_PSY = false;
activate_LockBird = false;
activate_Genius = false;
activate_Sarutobi = false;
to_deck = false;
}
public override bool OnSelectHand()
{
return true;
}
public override int OnSelectPlace(int cardId, int player, CardLocation location, int available)
{
if (player == 0 && location == CardLocation.MonsterZone)
{
if (cardId == CardId.Scarecrow)
{
int a=(Zones.z6 & available);
int b=(Zones.z5 & available);
if (Bot.MonsterZone[2] != null && Bot.MonsterZone[2].Controller == 0 && !FinalCards(Bot.MonsterZone[2].Id))
a = 0;
else if (Bot.MonsterZone[0] != null && Bot.MonsterZone[0].Controller == 0 && !FinalCards(Bot.MonsterZone[0].Id))
b = 0;
if (b > 0) return Zones.z5;
if (a > 0) return Zones.z6;
}
else if (cardId == CardId.Unicorn || cardId == CardId.Elf || cardId == CardId.IP)
{
if ((Zones.z6 & available) > 0) return Zones.z6;
if ((Zones.z5 & available) > 0) return Zones.z5;
}
else if (cardId == CardId.Genius)
{
int a=(Zones.z6 & available);
int b=(Zones.z5 & available);
if (Bot.MonsterZone[4] != null && Bot.MonsterZone[4].Controller == 0 && !FinalCards(Bot.MonsterZone[4].Id))
a = 0;
else if (Bot.MonsterZone[0] != null && Bot.MonsterZone[0].Controller == 0 && !FinalCards(Bot.MonsterZone[0].Id))
b = 0;
if (a > 0) return Zones.z6;
if (b > 0) return Zones.z5;
}
else if (cardId == CardId.Regulus || cardId == CardId.GearGigant)
{
if ((Zones.z3 & available) > 0) return Zones.z3;
}
else
{
if ((Zones.z1 & available) > 0) return Zones.z1;
if ((Zones.z4 & available) > 0) return Zones.z4;
if ((Zones.z2 & available) > 0) return Zones.z2;
if ((Zones.z3 & available) > 0) return Zones.z3;
if ((Zones.z0 & available) > 0) return Zones.z0;
}
}
return base.OnSelectPlace(cardId, player, location, available);
}
public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable)
{
if (AI.HaveSelectedCards()) return null;
if (p_summoning || ((Card == Bot.SpellZone[0] || Card == Bot.SpellZone[4]) && hint == HintMsg.SpSummon &&
Card.HasType(CardType.Pendulum)))
{
List<ClientCard> result = new List<ClientCard>();
List<ClientCard> scards = cards.Where(card => card != null && card.HasSetcode(0x9a) && card.Level == 4).ToList();
if (scards.Count <2) scards = cards.Where(card => card != null && card.HasSetcode(0x9a)).ToList();
p_summoning = false;
if (scards.Count > 0) return Util.CheckSelectCount(result, scards, 1, 1);
else if (min == 0) return result; // empty
}
return base.OnSelectCard(cards, min, max, hint, cancelable);
}
private List<ClientCard> GetZoneCards(CardLocation loc, ClientField player)
{
List<ClientCard> res = new List<ClientCard>();
List<ClientCard> temp = new List<ClientCard>();
if ((loc & CardLocation.Hand) > 0) { temp = player.Hand.Where(card => card != null).ToList(); if (temp.Count() > 0) res.AddRange(temp); }
if ((loc & CardLocation.MonsterZone) > 0) { temp = player.GetMonsters(); if (temp.Count() > 0) res.AddRange(temp); }
if ((loc & CardLocation.SpellZone) > 0) { temp = player.GetSpells(); if (temp.Count() > 0) res.AddRange(temp); }
if ((loc & CardLocation.Grave) > 0) { temp = player.Graveyard.Where(card => card != null).ToList(); if (temp.Count() > 0) res.AddRange(temp); }
if ((loc & CardLocation.Removed) > 0) { temp = player.Banished.Where(card => card != null).ToList(); if (temp.Count() > 0) res.AddRange(temp); }
if ((loc & CardLocation.Extra) > 0) { temp = player.ExtraDeck.Where(card => card != null).ToList(); if (temp.Count() > 0) res.AddRange(temp); }
return res;
}
private bool FinalCards(int cname)
{
int[] cardsname = new[] {CardId.Masurawo,CardId.Fleur,CardId.SavageDragon,CardId.Sarutobi,CardId.Regulus,CardId.IP};
foreach(var cardname in cardsname)
{
if (cname == cardname) return true;
}
return false;
}
private bool TurnerCards(int cname)
{
int[] cardsname =new[] {CardId.PsyFramegearGamma,CardId.Wakaushi,CardId.Motorbike};
foreach(var cardname in cardsname)
{
if (cname == cardname) return true;
}
return false;
}
private bool Psummon()
{
List<ClientCard> cards = GetZoneCards(CardLocation.Hand, Bot).Where(card => card != null && card.HasSetcode(0x9a) && card.Level > 1 && card.Level < 8).ToList();
if (cards.Count > 0 && Card.Location == CardLocation.SpellZone)
{
p_summoning = true;
p_summoned = true;
return true;
}
return false;
}
private bool MaxxCFunction()
{
activate_MaxxG = true;
return DefaultMaxxC() && !activate_LockBird;
}
private bool FunctionInHand()
{
return Duel.LastChainPlayer == 1;
}
private bool LockBirdFunction()
{
if (Duel.Player == 0)
{
return false;
}
activate_LockBird = true;
return !activate_MaxxG;
}
private bool MotorbikeFunction()
{
if (Card.Location == CardLocation.Hand)
{
int targetid = -1;
if (!(Bot.HasInHand(CardId.Wakaushi)||Bot.HasInMonstersZone(CardId.Wakaushi)||Bot.HasInSpellZone(CardId.Wakaushi))&&!activate_Wakaushi)
{
targetid = CardId.Wakaushi;
}
else if (!Bot.HasInHand(CardId.Soulpeacemaker) && !activate_Soulpeacemaker && !normal_summon)
{
targetid = CardId.Soulpeacemaker;
}
else
{
targetid = CardId.Soulpiercer;
}
if (targetid > 0) AI.SelectCard(targetid);
activate_Motorbike = true;
return true;
}
else if (Card.Location == CardLocation.MonsterZone && activate_Elf)
{
AI.SelectCard(Card);
activate_Elf = false;
return true;
}
return false;
}
private bool BoosterNormalSummonFunction()
{
List<ClientCard> cards = Bot.Hand.GetMonsters().Where(card => card != null && card.Id == CardId.Booster).ToList();
return (NormalSummonFunction() && !activate_Booster && cards.Count >= 2);
}
private bool ScalesNormalSummonFunction()
{
return (NormalSummonFunction() && (Bot.HasInGraveyard(new[] {
CardId.Soulpiercer,
CardId.Motorbike,
CardId.Wakaushi,
CardId.Wagon,
CardId.Booster,
}) || (Bot.HasInHand(CardId.Booster) && !activate_Booster)));
}
private bool NormalSummonFunction()
{
normal_summon = true;
return DefaultMonsterSummon();
}
private bool ScalesFunction()
{
AI.SelectCard(new[] {
CardId.Soulpiercer,
CardId.Motorbike,
CardId.Wakaushi,
CardId.Wagon,
CardId.Booster,
});
activate_Scales = true;
return true;
}
private bool WagonFunction()
{
if (ActivateDescription == Util.GetStringId(CardId.Wagon, 0))
return Card.IsAttack();
if (ActivateDescription == Util.GetStringId(CardId.Wagon, 1))
{
int targetid = -1;
if (!(Bot.HasInHand(CardId.Soulpiercer)||Bot.HasInMonstersZone(CardId.Soulpiercer)))
{
targetid = CardId.Soulpiercer;
}
else if (!Bot.HasInHand(CardId.Soulpeacemaker) && !activate_Soulpeacemaker)
{
targetid = CardId.Soulpeacemaker;
}
else if (!Bot.HasInHand(CardId.Booster) && !activate_Booster)
{
targetid = CardId.Booster;
}
if (targetid > 0) AI.SelectCard(targetid);
activate_Wagon = true;
return true;
}
else
{
return true;
}
}
private bool SoulpiercerFunction()
{
if (Card.Location == CardLocation.Grave)
{
int CardCount = GetZoneCards(CardLocation.Hand, Bot).Count(card => card != null && card.HasSetcode(0x9a) && card.Level >= 2 && card.Level <= 7);
int targetid = -1;
if (!Bot.HasInHand(CardId.Motorbike) && !activate_Motorbike)
{
targetid = CardId.Motorbike;
}
else if (!(Bot.HasInHand(CardId.Wakaushi) || Bot.HasInMonstersZone(CardId.Wakaushi) || Bot.HasInSpellZone(CardId.Wakaushi)) && !activate_Wakaushi)
{
targetid = CardId.Wakaushi;
}
else if (!Bot.HasInHand(CardId.Soulpeacemaker) && !activate_Soulpeacemaker)
{
targetid = CardId.Soulpeacemaker;
}
else if (!Bot.HasInHand(CardId.Scales) && !activate_Scales && (!normal_summon || !p_summoned) && (activate_Soulpeacemaker || (!Bot.HasInHand(CardId.Soulpeacemaker) && !Bot.HasInSpellZone(CardId.Soulpeacemaker))))
{
targetid = CardId.Scales;
}
else if (!Bot.HasInHand(CardId.Wagon) && !activate_Wagon)
{
targetid = CardId.Wagon;
}
else if (CardCount < 2 && !p_summoned)
{
targetid = CardId.Wakaushi;
}
else if (!Bot.HasInHand(CardId.Booster) && !activate_Booster)
{
targetid = CardId.Booster;
}
else if (!Bot.HasInHand(CardId.Soulhorns) && !Bot.HasInSpellZone(CardId.Soulhorns) && (Bot.HasInMonstersZone(CardId.Sarutobi) || Bot.HasInMonstersZone(CardId.Masurawo)))
{
targetid = CardId.Soulhorns;
}
else {targetid = CardId.Wakaushi;}
if (targetid > 0) AI.SelectCard(targetid);
return true;
}
return false;
}
private bool WakaushiFunction()
{
if (Card.Location != CardLocation.Hand||Bot.HasInMonstersZone(CardId.Wakaushi))
return false;
ClientCard l = Util.GetPZone(0, 0);
ClientCard r = Util.GetPZone(0, 1);
if (l == null && r == null)
return true;
if (l == null && r.RScale != Card.LScale)
return true;
if (r == null && l.LScale != Card.RScale)
return true;
return false;
}
private bool WakaushiEffectFunction()
{
if (Card.Location == CardLocation.SpellZone)
{
AI.SelectCard(CardId.Benkei);
activate_Wakaushi = true;
return true;
}
return false;
}
private bool BenkeiEffectFunction()
{
if (Card.Location == CardLocation.SpellZone)
{
int targetid = -1;
if (!(Bot.HasInHand(CardId.Soulpiercer)||Bot.HasInMonstersZone(CardId.Soulpiercer)))
{
targetid = CardId.Soulpiercer;
}
else if (!Bot.HasInHand(CardId.Soulpeacemaker) && !activate_Soulpeacemaker)
{
targetid = CardId.Soulpeacemaker;
}
else if (!Bot.HasInHand(CardId.Booster) && !activate_Booster)
{
targetid = CardId.Booster;
}
if (targetid > 0) AI.SelectCard(targetid);
activate_Benkei = true;
return true;
}
return false;
}
private bool WakaushiReturnPFunction()
{
if (Card.Location == CardLocation.Extra||Card.Location == CardLocation.Removed)
{
ClientCard l = Util.GetPZone(0, 0);
ClientCard r = Util.GetPZone(0, 1);
if (l == null && r == null)
return true;
if (l == null && r.RScale != Card.LScale)
return true;
if (r == null && l.LScale != Card.RScale)
return true;
}
return false;
}
private bool MasurawoFunction()
{
if (ActivateDescription == 96)
{
List<ClientCard> cards = GetZoneCards(CardLocation.SpellZone, Bot).Where(card => card != null && card.HasSetcode(0x9a)).ToList();
if (cards.Count > 0)
{
AI.SelectCard(cards);
return true;
}
else
{
cards = GetZoneCards(CardLocation.MonsterZone, Bot).Where(card => card != null && card.HasSetcode(0x9a) && !FinalCards(card.Id)).ToList();
if (cards.Count > 0)
{
AI.SelectCard(cards);
return true;
}
}
}
return true;
}
private bool MasurawoSynchronFunction()
{
bool chk = true;
if (Bot.HasInMonstersZone(CardId.ASStardustDragon) || Bot.HasInMonstersZone(CardId.Benkei))
chk = false;
var materials_lists = Util.GetSynchroMaterials(Bot.MonsterZone,12,1,1,false,chk,null,
card => { return !FinalCards(card.Id); });
if (materials_lists.Count <= 0) return false;
AI.SelectMaterials(materials_lists[0]);
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool FleurSynchronFunction()
{
bool chk = true;
if (Bot.HasInMonstersZone(CardId.Motorbike) && (Bot.HasInMonstersZone(CardId.ASStardustDragon) || Bot.HasInMonstersZone(CardId.Benkei)))
chk = false;
var materials_lists = Util.GetSynchroMaterials(Bot.MonsterZone,10,1,1,false,chk,null,
card => { return !FinalCards(card.Id); });
if (materials_lists.Count <= 0) return false;
AI.SelectMaterials(materials_lists[0]);
return true;
}
private bool FleurSynchronFunction2()
{
var materials_lists = Util.GetSynchroMaterials(Bot.MonsterZone,10,1,1,false,false,null,
card => { return !FinalCards(card.Id); });
if (materials_lists.Count <= 0) return false;
AI.SelectMaterials(materials_lists[0]);
return true;
}
private bool DeSynchronFunction()
{
AI.SelectPosition(CardPosition.FaceUpDefence);
return true;
}
private bool SavageDragonSynchronFunction()
{
if (Bot.HasInGraveyard(new[] {
CardId.Scarecrow,
CardId.IP,
CardId.Genius,
CardId.Unicorn,
CardId.Elf,
}))
{
return true;
}
return false;
}
private bool ASStardustDragonSynchronFunction()
{
if (Bot.HasInGraveyard(CardId.Motorbike) || Bot.HasInGraveyard(CardId.PsyFramegearGamma))
{
return (Bot.HasInExtra(CardId.Fleur) || Bot.HasInExtra(CardId.Masurawo));
}
return false;
}
private bool ASStardustDragonSynchronFunction2()
{
if (!activate_Scales || !activate_PSY) return false;
if (Bot.HasInGraveyard(CardId.Motorbike) || Bot.HasInGraveyard(CardId.PsyFramegearGamma))
{
return (Bot.HasInExtra(CardId.Fleur) || Bot.HasInExtra(CardId.Masurawo));
}
return false;
}
private bool SavageDragonFunction()
{
if (Duel.LastChainPlayer == 1)
return true;
AI.SelectCard(new[]
{
CardId.Unicorn,
CardId.Genius,
CardId.Elf,
CardId.IP,
CardId.Scarecrow
});
return true;
}
private bool ASStardustDragonFunction()
{
if (Duel.LastChainPlayer == 1 && ActivateDescription == Util.GetStringId(CardId.ASStardustDragon, 0))
{
return true;
}
else if (ActivateDescription == Util.GetStringId(CardId.ASStardustDragon, 0))
{
int targetid = -1;
if (Bot.HasInGraveyard(CardId.Motorbike))
{
targetid = CardId.Motorbike;
}
else if (Bot.HasInGraveyard(CardId.PsyFramegearGamma))
{
targetid = CardId.PsyFramegearGamma;
}
if (targetid > 0) AI.SelectCard(targetid);
if (targetid == CardId.Motorbike && !Bot.HasInExtra(CardId.Fleur) && Bot.HasInExtra(CardId.Masurawo))
activate_Elf = true;
return true;
}
return false;
}
private bool ScarecrowLinkFunction()
{
List<ClientCard> material = new List<ClientCard>();
List<ClientCard> cards = Bot.GetMonstersInExtraZone().Where(card => card != null && card.Id == CardId.Scarecrow).ToList();
if (cards.Count > 0 || summon_Scarecrow || activate_Scarecrow) return false;
int targetid = -1;
if (Bot.MonsterZone[0] != null && Bot.MonsterZone[2] != null) {
if (Bot.MonsterZone[0].Id == CardId.Soulpiercer) material.Add(Bot.MonsterZone[0]);
else if (Bot.MonsterZone[2].Id == CardId.Soulpiercer) material.Add(Bot.MonsterZone[2]);
else if (!FinalCards(Bot.MonsterZone[0].Id) && Bot.MonsterZone[0].HasSetcode(0x9a)) material.Add(Bot.MonsterZone[0]);
else if (!FinalCards(Bot.MonsterZone[2].Id) && Bot.MonsterZone[2].HasSetcode(0x9a)) material.Add(Bot.MonsterZone[2]);
}
else if (Bot.HasInMonstersZone(CardId.Soulpiercer))
{
targetid = CardId.Soulpiercer;
}
else if (Bot.HasInMonstersZone(CardId.Wagon))
{
targetid = CardId.Wagon;
}
if (material.Count > 0) AI.SelectMaterials(material);
else if (targetid > 0) AI.SelectMaterials(targetid);
summon_Scarecrow=true;
return (Bot.HasInGraveyard(new[] {
CardId.Soulpiercer,
CardId.Wakaushi,
CardId.Benkei,
CardId.Wagon,
})||Bot.HasInMonstersZone(new[] {
CardId.Soulpiercer,
CardId.Wagon,
CardId.Wakaushi,
}));
}
private bool DragonRavineField()
{
if (Card.Location == CardLocation.Hand)
return DefaultField();
return false;
}
private bool ScarecrowFunction()
{
int tributeId = -1;
if (Bot.HasInHand(CardId.PsyFrameDriver))
{tributeId = CardId.PsyFrameDriver;}
else if (Bot.HasInHand(CardId.PsyFramegearGamma))
{tributeId = CardId.PsyFramegearGamma;}
else if (Bot.HasInHand(CardId.Benkei))
{tributeId = CardId.Benkei;}
else if (Bot.HasInHand(CardId.HauntedMansion))
{tributeId = CardId.HauntedMansion;}
else if (Bot.HasInHand(CardId.EffectVeiler))
{tributeId = CardId.EffectVeiler;}
else if (Bot.HasInHand(CardId.SnowRabbit))
{tributeId = CardId.SnowRabbit;}
else if (Bot.HasInHand(CardId.JoyousSpring))
{tributeId = CardId.JoyousSpring;}
else if (Bot.HasInHand(CardId.Booster))
{tributeId = CardId.Booster;}
else if (Bot.HasInHand(CardId.Wagon))
{tributeId = CardId.Wagon;}
else if (Bot.HasInHand(CardId.Scales))
{tributeId = CardId.Scales;}
else if (Bot.HasInHand(CardId.LockBird))
{tributeId = CardId.LockBird;}
else if (Bot.HasInHand(CardId.MaxxG))
{tributeId = CardId.MaxxG;}
int needId = -1;
if (Bot.HasInGraveyard(CardId.Soulpiercer))
{
if (Bot.HasInGraveyard(CardId.Scales) && !activate_Scales)
{needId = CardId.Scales;}
else
{needId = CardId.Soulpiercer;}
}
else if (Bot.HasInGraveyard(CardId.Masurawo))
{needId = CardId.Masurawo;}
else if (Bot.HasInGraveyard(CardId.Sarutobi))
{needId = CardId.Sarutobi;}
else if (Bot.HasInMonstersZone(CardId.Soulpiercer))
{
if (Bot.HasInGraveyard(CardId.Wakaushi))
{needId = CardId.Wakaushi;}
if (Bot.HasInGraveyard(CardId.Motorbike))
{needId = CardId.Motorbike;}
}
if (GetZoneCards(CardLocation.Hand, Bot).Count(card => card != null && card.Id == CardId.Scales) + GetZoneCards(CardLocation.Grave, Bot).Count(card => card != null && card.Id == CardId.Scales) + GetZoneCards(CardLocation.Onfield, Bot).Count(card => card != null && card.Id == CardId.Scales) == 2 && GetZoneCards(CardLocation.Hand, Bot).Count(card => card != null && card.Id == CardId.Scales)>=1 && !activate_Scales)
{
tributeId = CardId.Scales;
needId = CardId.Scales;
}
AI.SelectCard(tributeId);
AI.SelectNextCard(needId);
activate_Scarecrow = true;
if (!summon_Scarecrow
&& ((Bot.HasInHand(CardId.Wakaushi) || Bot.HasInSpellZone(CardId.Wakaushi)) && !activate_Wakaushi)
&& (Bot.HasInHand(CardId.Motorbike) && !activate_Motorbike)
&& ((Bot.HasInHand(CardId.Soulpeacemaker) || Bot.HasInSpellZone(CardId.Soulpeacemaker)) && !activate_Soulpeacemaker)
&& (Bot.HasInSpellZone(CardId.Benkei) && !activate_Benkei)
&& (Bot.HasInHand(CardId.Soulpiercer) && !normal_summon)
&& ((Bot.HasInGraveyard(CardId.Scales) || Bot.HasInHand(CardId.Soulpiercer)) && !activate_Scales && !normal_summon)
)
{
activate_Scarecrow = false;
summon_Scarecrow = false;
}
else if (needId != CardId.Soulpiercer)
{
activate_Scarecrow = false;
summon_Scarecrow = false;
}
return true;
}
private bool UnicornFunction()
{
List<ClientCard> Enemycards = GetZoneCards(CardLocation.Onfield,Enemy);
if (Bot.Hand.Count == 0 || Enemycards.Count(card => card != null && !card.IsShouldNotBeTarget()) == 0)
{
if (to_deck) to_deck = false;
return false;
}
int tributeId = -1;
if (Bot.HasInHand(CardId.PsyFrameDriver))
{tributeId = CardId.PsyFrameDriver;}
else if (Bot.HasInHand(CardId.PsyFramegearGamma))
{tributeId = CardId.PsyFramegearGamma;}
else if (Bot.HasInHand(CardId.Benkei))
{tributeId = CardId.Benkei;}
else if (Bot.HasInHand(CardId.HauntedMansion))
{tributeId = CardId.HauntedMansion;}
else if (Bot.HasInHand(CardId.EffectVeiler))
{tributeId = CardId.EffectVeiler;}
else if (Bot.HasInHand(CardId.SnowRabbit))
{tributeId = CardId.SnowRabbit;}
else if (Bot.HasInHand(CardId.JoyousSpring))
{tributeId = CardId.JoyousSpring;}
else if (Bot.HasInHand(CardId.Booster))
{tributeId = CardId.Booster;}
else if (Bot.HasInHand(CardId.Wagon))
{tributeId = CardId.Wagon;}
else if (Bot.HasInHand(CardId.Scales))
{tributeId = CardId.Scales;}
else if (Bot.HasInHand(CardId.LockBird))
{tributeId = CardId.LockBird;}
else if (Bot.HasInHand(CardId.MaxxG))
{tributeId = CardId.MaxxG;}
if (to_deck) to_deck = false;
AI.SelectCard(tributeId);
return true;
}
private bool BoosterEquipFunction()
{
if (Card.Location != CardLocation.Hand || activate_Booster)
return false;
List<ClientCard> ChkCardsHand = Bot.Hand.GetMonsters().ToList();
foreach (var card in ChkCardsHand)
{
if (card.Id == CardId.Motorbike && !activate_Motorbike) return false;
else if (card.Id == CardId.Soulpiercer) return false;
else if (card.Id == CardId.Soulpeacemaker && !activate_Soulpeacemaker) return false;
else if (card.Id == CardId.Wakaushi && !activate_Wakaushi) return false;
else if (card.Id == CardId.Wagon && (!activate_Wagon || !normal_summon)) return false;
else if (card.Id == CardId.Benkei && !activate_Benkei) return false;
}
List<ClientCard> ChkCardsSpell = GetZoneCards(CardLocation.SpellZone,Bot).Where(card => card != null && card.IsFaceup()).ToList();
foreach (var card in ChkCardsSpell)
{
if (card.Id == CardId.Wakaushi && !activate_Wakaushi) return false;
else if (card.Id == CardId.Soulpiercer) return false;
else if (card.Id == CardId.Soulpeacemaker && !activate_Soulpeacemaker) return false;
else if (card.Id == CardId.Wakaushi && !activate_Wakaushi) return false;
else if (card.Id == CardId.Benkei && !activate_Benkei) return false;
}
List<ClientCard> ChkCardsMonster = GetZoneCards(CardLocation.MonsterZone,Bot).Where(card => card != null && card.IsFaceup() && card.Level == 4).ToList();
if (ChkCardsMonster.Count == 0) return false;
foreach (var card in ChkCardsMonster)
{
if (card.Id == CardId.Soulpiercer) return false;
}
List<ClientCard> ChkCardsGrave = GetZoneCards(CardLocation.Grave,Bot).ToList();
foreach (var card in ChkCardsGrave)
{
if (card.Id == CardId.Soulpiercer && (Bot.HasInMonstersZone(CardId.Scarecrow) || Bot.HasInExtra(CardId.Scarecrow))) return false;
else if (card.Level == 4 && card.HasRace(CardRace.Machine) && Bot.HasInHand(CardId.Scales) && !normal_summon) return false;
}
if (Bot.HasInExtra(CardId.IP) && p_summoned) return true;
need_Gear = true;
return true;
}
private bool BoosterEquipFunction2()
{
if (Bot.HasInExtra(CardId.IP) && p_summoned) return true;
return false;
}
private bool BoosterFunction()
{
if (Card.Location == CardLocation.SpellZone)
{
activate_Booster = true;
return true;
}
return false;
}
private bool GearGigantXyzFunction()
{
if (need_Gear)
{
need_Gear = false;
return true;
}
return false;
}
private bool GearGigantFunction()
{
if (Card.Location == CardLocation.MonsterZone)
{
List<ClientCard> ChkCards = GetZoneCards(CardLocation.MonsterZone,Bot).Where(card => card != null && card.IsFaceup() && card.HasSetcode(0x9a)).ToList();
int targetid = -1;
if (!Bot.HasInHand(CardId.Motorbike) && !activate_Motorbike)
{
targetid = CardId.Motorbike;
}
else if (!(Bot.HasInHand(CardId.Wakaushi) || Bot.HasInSpellZone(CardId.Wakaushi)) && !activate_Wakaushi)
{
targetid = CardId.Wakaushi;
}
else if (!Bot.HasInHand(CardId.Soulpiercer) && (!normal_summon || (ChkCards.Count >= 1)))
{
targetid = CardId.Soulpiercer;
}
if (targetid > 0) AI.SelectCard(targetid);
return true;
}
return false;
}
private bool SoulpiercerEquipFunction()
{
if (Card.Location != CardLocation.Hand)
return false;
int tributeId = -1;
if (Bot.HasInMonstersZone(CardId.Wagon))
{tributeId = CardId.Wagon;}
else if (Bot.HasInMonstersZone(CardId.Wakaushi))
{tributeId = CardId.Wakaushi;}
AI.SelectCard(tributeId);
return Bot.HasInMonstersZone(new[] {
CardId.Wakaushi,
CardId.Wagon,
});
}
private bool SoulpeacemakerEquipFunction()
{
if (Card.Location != CardLocation.Hand)
return false;
int tributeId = -1;
if (Bot.HasInMonstersZone(CardId.Scarecrow))
{tributeId = CardId.Scarecrow;}
else if (Bot.HasInMonstersZone(CardId.Soulpiercer))
{tributeId = CardId.Soulpiercer;}
AI.SelectCard(tributeId);
return Bot.HasInMonstersZone(new[] {
CardId.Scarecrow,
CardId.Soulpiercer,
});
}
private bool SoulhornsEquipFunction()
{
if (Card.Location != CardLocation.Hand)
return false;
int tributeId = -1;
if (Bot.HasInMonstersZone(CardId.Masurawo))
{tributeId = CardId.Masurawo;}
else if (Bot.HasInMonstersZone(CardId.Sarutobi))
{tributeId = CardId.Sarutobi;}
AI.SelectCard(tributeId);
return Bot.HasInMonstersZone(new[] {
CardId.Masurawo,
CardId.Sarutobi,
});
}
private bool SoulpeacemakerFunction()
{
if (Card.Location == CardLocation.SpellZone)
{
int tributeId = -1;
if (Bot.HasInMonstersZone(CardId.Soulpiercer))
{tributeId = CardId.Wakaushi;}
else if (Bot.HasInGraveyard(CardId.Soulpiercer)||!activate_Scales)
{tributeId = CardId.Scales;}
else if (!Bot.HasInGraveyard(CardId.Soulpiercer)||activate_Scales)
{tributeId = CardId.Soulpiercer;}
AI.SelectCard(tributeId);
activate_Soulpeacemaker = true;
return true;
}
return false;
}
private bool GeniusLinkFunction()
{
if ((Bot.MonsterZone[4] != null && Bot.MonsterZone[4].Controller == 0 && !FinalCards(Bot.MonsterZone[4].Id)) && (Bot.MonsterZone[0] != null && Bot.MonsterZone[0].Controller == 0 && !FinalCards(Bot.MonsterZone[0].Id)))
return false;
int CardCount = 0;
foreach (ClientCard card in Bot.Hand.GetMonsters())
{
if (card.HasRace(CardRace.Machine) && (card.Level >= 2 && card.Level <= 7))
{CardCount++;}
}
if (CardCount < 2 && !Bot.HasInMonstersZone(CardId.Soulpiercer)){return false;}
if (Bot.HasInHand(CardId.Regulus) || Bot.HasInGraveyard(CardId.Regulus) || Bot.HasInSpellZone(CardId.Regulus) || Bot.HasInMonstersZone(CardId.Regulus)) return false;
bool linkchk = false;
List<ClientCard> materials = new List<ClientCard>();
if (Bot.MonsterZone[6] != null && Bot.MonsterZone[6].Controller == 0 && Bot.MonsterZone[6].Id != CardId.Scarecrow && !FinalCards(Bot.MonsterZone[6].Id))
{
materials.Add(Bot.MonsterZone[6]);
linkchk = true;
}
else if (Bot.MonsterZone[5] != null && Bot.MonsterZone[5].Controller == 0 && Bot.MonsterZone[5].Id != CardId.Scarecrow && !FinalCards(Bot.MonsterZone[6].Id))
{
materials.Add(Bot.MonsterZone[5]);
linkchk = true;
}
List<ClientCard> cards = Bot.GetMonstersInMainZone().Where(card => card != null && card.IsFaceup() && card.HasRace(CardRace.Machine)).ToList();
foreach (var card in cards)
{
if (card == null || FinalCards(card.Id)) continue;
else materials.Add(card);
}
if (materials.Count <=1) return false;
AI.SelectMaterials(materials);
return ((Bot.GetMonstersInExtraZone().Count == 0 || linkchk) && !p_summoned && !activate_Genius);
}
private bool GeniusFunction()
{
if (ActivateDescription == Util.GetStringId(CardId.Genius,1))
{
AI.SelectCard(CardId.Regulus);
activate_Genius = true;
return true;
}
return false;
}
private bool ElfLinkFunction()
{
if (!Bot.HasInGraveyard(CardId.Motorbike)) return false;
List<ClientCard> materials = new List<ClientCard>();
if (Bot.MonsterZone[6] != null && Bot.MonsterZone[6].Controller == 0 && !FinalCards(Bot.MonsterZone[6].Id))
{
materials.Add(Bot.MonsterZone[6]);
}
else if (Bot.MonsterZone[5] != null && Bot.MonsterZone[5].Controller == 0 && !FinalCards(Bot.MonsterZone[5].Id))
{
materials.Add(Bot.MonsterZone[5]);
}
List<ClientCard> TunrerCards = Bot.GetMonstersInMainZone().Where(card => card != null && card.IsFaceup() && TurnerCards(card.Id) && !FinalCards(card.Id)).ToList();
List<ClientCard> UnTunrercards = Bot.GetMonstersInMainZone().Where(card => card != null && card.IsFaceup() && !TurnerCards(card.Id) && !FinalCards(card.Id)).ToList();
if (UnTunrercards.Count == 0) return false;
else if (TunrerCards.Count >= UnTunrercards.Count && UnTunrercards.Count > 0)
{
foreach (var card in TunrerCards)
{
if (card == null) continue;
else if (materials.Count(ccard =>ccard != null && ccard.Id == card.Id) <= 0) materials.Add(card);
}
}
else
{
foreach (var card in UnTunrercards)
{
if (card == null) continue;
else if (materials.Count(ccard =>ccard != null && ccard.Id == card.Id) <= 0) materials.Add(card);
}
}
if (materials.Count <=1) return false;
AI.SelectMaterials(materials);
summon_Elf = true;
return true;
}
private bool ElfFunction()
{
AI.SelectCard(CardId.Motorbike);
AI.SelectPosition(CardPosition.FaceUpDefence);
activate_Elf = true;
return Bot.HasInGraveyard(CardId.Motorbike);
}
private bool RegulusFunction()
{
if (Card.Location == CardLocation.Hand)
{
int tributeId = -1;
if (Bot.HasInGraveyard(CardId.Soulpiercer))
{tributeId = CardId.Soulpiercer;}
else if (Bot.HasInGraveyard(CardId.Motorbike))
{tributeId = CardId.Motorbike;}
AI.SelectCard(tributeId);
activate_Genius = true;
return true;
}
else if (Duel.LastChainPlayer == 1)
{
return true;
}
return false;
}
private bool FleurFunction()
{
if (ActivateDescription == Util.GetStringId(CardId.Fleur, 0))
{
ClientCard card = Util.GetProblematicEnemyMonster(0, true);
if (card != null)
{
AI.SelectCard(card);
return true;
}
card = Util.GetBestEnemySpell(true);
if (card != null)
{
AI.SelectCard(card);
return true;
}
List<ClientCard> cards = GetZoneCards(CardLocation.Onfield, Enemy);
cards = cards.Where(tcard => tcard != null && !tcard.IsShouldNotBeTarget()).ToList();
if (cards.Count <= 0) return false;
AI.SelectCard(cards);
return true;
}
else if (ActivateDescription == Util.GetStringId(CardId.Fleur, 1))
{
return Duel.LastChainPlayer == 1;
}
return false;
}
private bool IPLinkFunction()
{
List<ClientCard> cards = GetZoneCards(CardLocation.MonsterZone,Bot).Where(card => card != null && card.IsFaceup() && card.Id != CardId.Scarecrow && (card.Id != CardId.Elf || (card.Id == CardId.Elf && !summon_Elf)) && !FinalCards(card.Id)).ToList();
if (cards.Count <=1) return false;
AI.SelectMaterials(cards);
return true;
}
private bool IPFunction()
{
if (Duel.LastChainPlayer == 0) return false;
if (Bot.HasInExtra(CardId.Unicorn))
{
List<ClientCard> material = new List<ClientCard>();
List<ClientCard> cards = GetZoneCards(CardLocation.MonsterZone,Bot).Where(card => card != null && card != Card && card.IsFaceup() && !FinalCards(card.Id) && card.Id != CardId.IP && card.Id != CardId.Scarecrow).ToList();
List<ClientCard> Enemycards = GetZoneCards(CardLocation.MonsterZone,Enemy);
if (activate_Sarutobi) Enemycards = GetZoneCards(CardLocation.Onfield,Enemy);
if (Bot.Hand.Count == 0 || Enemycards.Count(card => card != null && !card.IsShouldNotBeTarget()) == 0 || cards.Count == 0) return false;
bool linkchk = false;
foreach (var card in cards)
{
if (card != null && (card.Id != CardId.Elf || (card.Id == CardId.Elf && !summon_Elf)))
{
material.Add(card);
linkchk = true;
break;
}
}
AI.SelectCard(CardId.Unicorn);
material.Insert(0,Card);
AI.SelectMaterials(material);
if (!to_deck) to_deck = true;
return linkchk;
}
return false;
}
private bool SarutobiFunction()
{
List<ClientCard> Enemycards = GetZoneCards(CardLocation.SpellZone,Enemy);
if (Enemycards.Count(card => card != null && !card.IsShouldNotBeTarget()) == 0 || to_deck) return false;
AI.SelectCard(Enemycards);
activate_Sarutobi = true;
return true;
}
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -3,6 +3,7 @@ using System.Collections.Generic; ...@@ -3,6 +3,7 @@ using System.Collections.Generic;
using WindBot; using WindBot;
using WindBot.Game; using WindBot.Game;
using WindBot.Game.AI; using WindBot.Game.AI;
using System.Linq;
namespace WindBot.Game.AI.Decks namespace WindBot.Game.AI.Decks
{ {
...@@ -67,6 +68,7 @@ namespace WindBot.Game.AI.Decks ...@@ -67,6 +68,7 @@ namespace WindBot.Game.AI.Decks
return 1; return 1;
} }
List<int> Impermanence_list = new List<int>();
bool NormalSummoned = false; bool NormalSummoned = false;
ClientCard stage_locked = null; ClientCard stage_locked = null;
bool pink_ss = false; bool pink_ss = false;
...@@ -190,21 +192,39 @@ namespace WindBot.Game.AI.Decks ...@@ -190,21 +192,39 @@ namespace WindBot.Game.AI.Decks
return false; return false;
} }
public int SelectSTPlace() 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; int n = list.Count;
while (n-- > 1) while (n-- > 1)
{ {
int index = Program.Rand.Next(n + 1); int index = Program.Rand.Next(list.Count);
int temp = list[index]; int nextIndex = (index + Program.Rand.Next(list.Count - 1)) % list.Count;
list[index] = list[n]; int tempInt = list[index];
list[n] = temp; 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); foreach (int seq in list)
if (Bot.SpellZone[seq] == null) 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; return 0;
} }
...@@ -505,7 +525,7 @@ namespace WindBot.Game.AI.Decks ...@@ -505,7 +525,7 @@ namespace WindBot.Game.AI.Decks
if (selected == null) if (selected == null)
return false; return false;
AI.SelectCard(selected); AI.SelectCard(selected);
AI.SelectPlace(SelectSTPlace()); AI.SelectPlace(SelectSTPlace(Card, true));
return true; return true;
} }
...@@ -526,13 +546,13 @@ namespace WindBot.Game.AI.Decks ...@@ -526,13 +546,13 @@ namespace WindBot.Game.AI.Decks
if (self_card.IsCode(CardId.Galaxy)) if (self_card.IsCode(CardId.Galaxy))
return false; return false;
} }
AI.SelectPlace(SelectSTPlace()); AI.SelectPlace(SelectSTPlace(Card, true));
return true; return true;
} }
// activate when more than 2 cards // activate when more than 2 cards
if (Enemy.GetSpellCount() <= 1) if (Enemy.GetSpellCount() <= 1)
return false; return false;
AI.SelectPlace(SelectSTPlace()); AI.SelectPlace(SelectSTPlace(Card, true));
return true; return true;
} }
...@@ -627,7 +647,7 @@ namespace WindBot.Game.AI.Decks ...@@ -627,7 +647,7 @@ namespace WindBot.Game.AI.Decks
if (!spell_trap_activate()) return false; if (!spell_trap_activate()) return false;
if (Bot.Deck.Count > 15) if (Bot.Deck.Count > 15)
{ {
AI.SelectPlace(SelectSTPlace()); AI.SelectPlace(SelectSTPlace(Card, true));
return true; return true;
} }
return false; return false;
...@@ -1003,7 +1023,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1003,7 +1023,7 @@ namespace WindBot.Game.AI.Decks
if (!spell_trap_activate()) return false; if (!spell_trap_activate()) return false;
if (Duel.Phase <= DuelPhase.Main1 && Ts_reborn()) if (Duel.Phase <= DuelPhase.Main1 && Ts_reborn())
{ {
AI.SelectPlace(SelectSTPlace()); AI.SelectPlace(SelectSTPlace(Card, true));
return true; return true;
} }
return false; return false;
...@@ -1634,14 +1654,14 @@ namespace WindBot.Game.AI.Decks ...@@ -1634,14 +1654,14 @@ namespace WindBot.Game.AI.Decks
{ {
if (enemy.IsMonsterDangerous()) if (enemy.IsMonsterDangerous())
{ {
AI.SelectPlace(SelectSTPlace()); AI.SelectPlace(SelectSTPlace(Card, true));
return true; return true;
} }
if (enemy.IsFaceup() && (enemy.GetDefensePower() > bestenemy)) bestenemy = enemy.GetDefensePower(); if (enemy.IsFaceup() && (enemy.GetDefensePower() > bestenemy)) bestenemy = enemy.GetDefensePower();
} }
if (bestPower <= bestenemy) if (bestPower <= bestenemy)
{ {
AI.SelectPlace(SelectSTPlace()); AI.SelectPlace(SelectSTPlace(Card, true));
return true; return true;
} }
} }
...@@ -1697,6 +1717,11 @@ namespace WindBot.Game.AI.Decks ...@@ -1697,6 +1717,11 @@ namespace WindBot.Game.AI.Decks
public override void OnNewTurn() public override void OnNewTurn()
{ {
if (Duel.Turn <= 1)
{
GraveCall_count = 0;
GraveCall_id = 0;
}
NormalSummoned = false; NormalSummoned = false;
stage_locked = null; stage_locked = null;
pink_ss = false; pink_ss = false;
...@@ -1705,6 +1730,7 @@ namespace WindBot.Game.AI.Decks ...@@ -1705,6 +1730,7 @@ namespace WindBot.Game.AI.Decks
white_eff_used = false; white_eff_used = false;
lockbird_useful = false; lockbird_useful = false;
lockbird_used = false; lockbird_used = false;
Impermanence_list.Clear();
if (GraveCall_count > 0) if (GraveCall_count > 0)
{ {
if (--GraveCall_count <= 0) if (--GraveCall_count <= 0)
...@@ -1714,6 +1740,27 @@ namespace WindBot.Game.AI.Decks ...@@ -1714,6 +1740,27 @@ namespace WindBot.Game.AI.Decks
} }
} }
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 override BattlePhaseAction OnSelectAttackTarget(ClientCard attacker, IList<ClientCard> defenders) public override BattlePhaseAction OnSelectAttackTarget(ClientCard attacker, IList<ClientCard> defenders)
{ {
ClientCard lowestattack = null; ClientCard lowestattack = null;
......
...@@ -269,6 +269,7 @@ namespace WindBot.Game.AI.Decks ...@@ -269,6 +269,7 @@ namespace WindBot.Game.AI.Decks
// new turn reset // new turn reset
public override void OnNewTurn() public override void OnNewTurn()
{ {
if (Duel.Turn <= 1) CalledbytheGraveCount.Clear();
CrossoutDesignatorTarget = 0; CrossoutDesignatorTarget = 0;
MadameVerreGainedATK = false; MadameVerreGainedATK = false;
summoned = false; summoned = false;
...@@ -858,27 +859,44 @@ namespace WindBot.Game.AI.Decks ...@@ -858,27 +859,44 @@ namespace WindBot.Game.AI.Decks
/// <param name="card">Card to set(default current card)</param> /// <param name="card">Card to set(default current card)</param>
/// <param name="avoid_Impermanence">Whether need to avoid InfiniteImpermanence</param> /// <param name="avoid_Impermanence">Whether need to avoid InfiniteImpermanence</param>
/// <param name="avoid_list">Whether need to avoid set in this place</param> /// <param name="avoid_list">Whether need to avoid set in this place</param>
public void SelectSTPlace(ClientCard card = null, bool avoid_Impermanence = false, List<int> avoid_list=null) public void SelectSTPlace(ClientCard card = null, bool avoid_Impermanence = false, List<int> avoid_list = null)
{ {
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;
if (avoid_list != null && avoid_list.Contains(seq)) continue;
list.Add(seq);
}
}
int n = list.Count; int n = list.Count;
while (n-- > 1) while (n-- > 1)
{ {
int index = Program.Rand.Next(n + 1); int index = Program.Rand.Next(list.Count);
int temp = list[index]; int nextIndex = (index + Program.Rand.Next(list.Count - 1)) % list.Count;
list[index] = list[n]; int tempInt = list[index];
list[n] = temp; 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); foreach (int seq in list)
if (Bot.SpellZone[seq] == null)
{ {
if (card != null && card.Location == CardLocation.Hand && avoid_Impermanence && Impermanence_list.Contains(seq)) continue; ClientCard enemySpell = Enemy.SpellZone[4 - seq];
if (avoid_list != null && avoid_list.Contains(seq)) continue; if (enemySpell != null && enemySpell.IsFacedown()) continue;
int zone = (int)System.Math.Pow(2, seq);
AI.SelectPlace(zone); AI.SelectPlace(zone);
return; return;
}; }
}
foreach (int seq in list)
{
int zone = (int)System.Math.Pow(2, seq);
AI.SelectPlace(zone);
return;
} }
AI.SelectPlace(0); AI.SelectPlace(0);
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -127,6 +127,94 @@ namespace WindBot.Game.AI ...@@ -127,6 +127,94 @@ namespace WindBot.Game.AI
public const int VaylantzWorld_ShinraBansho = 49568943; public const int VaylantzWorld_ShinraBansho = 49568943;
public const int VaylantzWorld_KonigWissen = 75952542; public const int VaylantzWorld_KonigWissen = 75952542;
public const int DivineArsenalAAZEUS_SkyThunder = 90448279; public const int DivineArsenalAAZEUS_SkyThunder = 90448279;
public const int LightningStorm = 14532163;
public const int BelialMarquisOfDarkness = 33655493;
public const int ChirubiméPrincessOfAutumnLeaves = 87294988;
public const int PerformapalBarokuriboh = 19050066;
public const int LabrynthArchfiend = 48745395;
public const int HarpiesPetDragonFearsomeFireBlast = 4991081;
public const int DynaHeroFurHire = 25123713;
public const int Hieracosphinx = 82260502;
public const int SpeedroidPassinglider = 26420373;
public const int TyrOfTheNordicChampions = 2333365;
public const int ValkyrianKnight = 99348756;
public const int Victoria = 75162696;
public const int MadolcheChouxvalier = 75363626;
public const int LadyOfD = 67511500;
public const int MermailAbysslung = 95466842;
public const int HarpiesPetBabyDragon = 6924874;
public const int HandHoldingGenie = 94535485;
public const int GolemDragon = 9666558;
public const int TwilightRoseKnight = 2986553;
public const int PerformapalThunderhino = 70458081;
public const int MiracleFlipper = 131182;
public const int Decoyroid = 25034083;
public const int AltergeistFifinellag = 12977245;
public const int BatterymanD = 55401221;
public const int Watthopper = 61380658;
public const int EgyptianGodSlime = 42166000;
public const int DinowrestlerChimeraTWrextle = 22900219;
public const int DinowrestlerGigaSpinosavate = 58672736;
public const int ScarredWarrior = 45298492;
public const int SharkFortress = 50449881;
public const int HeroicChampionClaivesolish = 97453744;
public const int GhostrickAlucard = 75367227;
public const int DinowrestlerKingTWrextle = 77967790;
public const int PerformapalMissDirector = 92932860;
public const int AncientWarriorsMasterfulSunMou = 40140448;
public const int AncientWarriorsVirtuousLiuXuan = 40428851;
public const int CommandKnight = 10375182;
public const int HunterOwl = 51962254;
public const int RokketRecharger = 5969957;
public const int EmissaryOfTheOasis = 6103294;
public const int Zuttomozaurus = 24454387;
public const int Otoshidamashi = 14957440;
public const int NaturiaMosquito = 17285476;
public const int RescueACEHydrant = 37617348;
public const int MeizenTheBattleNinja = 11825276;
public const int VindikiteRGenex = 73483491;
public const int PrincessCologne = 75574498;
public const int Number48ShadowLich = 1426714;
public const int PhantomToken = 1426715;
public const int DuelLinkDragonTheDuelDragon = 60025883;
public const int DuelDragonToken = 60025884;
public const int SeleneQueenOfTheMasterMagicians = 45819647;
public const int TheWingedDragonofRaSphereMode = 10000080;
public const int RockOfTheVanquisher = 28168628;
public const int SpiralDischarge = 29477860;
public const int GaiaTheDragonChampion = 66889139;
public const int CrusadiaVanguard = 55312487;
public const int GladiatorBeastDomitianus = 33652635;
public const int PatricianOfDarkness = 19153634;
public const int DictatorOfD = 66961194;
public const int NovoxTheSilenforcerDisciple = 25801745;
public const int SilenforcingBarrier = 98477480;
}
protected class _Setcode
{
public const int Watt = 0xe;
public const int Speedroid = 0x2016;
public const int EarthboundImmortal = 0x1021;
public const int Naturia = 0x2a;
public const int Nordic = 0x42;
public const int Harpie = 0x64;
public const int Madolche = 0x71;
public const int Ghostrick = 0x8d;
public const int OddEyes = 0x99;
public const int Performapal = 0x9f;
public const int BlueEyes = 0xdd;
public const int FurHire = 0x114;
public const int Altergeist = 0x103;
public const int Crusadia = 0x116;
public const int Endymion = 0x12a;
public const int AncientWarriors = 0x137;
public const int RescueACE = 0x18b;
public const int VanquishSoul = 0x195;
} }
protected DefaultExecutor(GameAI ai, Duel duel) protected DefaultExecutor(GameAI ai, Duel duel)
...@@ -138,6 +226,79 @@ namespace WindBot.Game.AI ...@@ -138,6 +226,79 @@ namespace WindBot.Game.AI
AddExecutor(ExecutorType.Activate, _CardId.SantaClaws); AddExecutor(ExecutorType.Activate, _CardId.SantaClaws);
} }
protected int lightningStormOption = -1;
/// <summary>
/// Defined:
/// if monster with code as KEY, other monsters with rules as VALUE won't be targeted for attack.
/// </summary>
protected Dictionary<int, Func<ClientCard, bool>> DefenderProtectRule = new Dictionary<int, Func<ClientCard, bool>> {
{_CardId.BelialMarquisOfDarkness, defender => defender.IsFaceup()},
{_CardId.ChirubiméPrincessOfAutumnLeaves, defender => defender.HasRace(CardRace.Plant)},
{_CardId.PerformapalBarokuriboh, defender => true},
{_CardId.LabrynthArchfiend, defender => defender.HasRace(CardRace.Fiend) && !defender.IsCode(_CardId.LabrynthArchfiend)},
{_CardId.HarpiesPetDragonFearsomeFireBlast, defender => defender.Level <= 6 && defender.HasSetcode(_Setcode.Harpie)},
{_CardId.DynaHeroFurHire, defender => defender.HasSetcode(_Setcode.FurHire)},
{_CardId.Hieracosphinx, defender => defender.IsFacedown()},
{_CardId.SpeedroidPassinglider, defender => defender.HasSetcode(_Setcode.Speedroid)},
{_CardId.TyrOfTheNordicChampions, defender => defender.HasSetcode(_Setcode.Nordic)},
{_CardId.ValkyrianKnight, defender => defender.HasRace(CardRace.Warrior) && !defender.IsCode(_CardId.ValkyrianKnight)},
{_CardId.Victoria, defender => defender.HasRace(CardRace.Fairy)},
{_CardId.MadolcheChouxvalier, defender => defender.HasSetcode(_Setcode.Madolche) && !defender.IsCode(_CardId.MadolcheChouxvalier)},
{_CardId.LadyOfD, defender => defender.HasRace(CardRace.Dragon)},
{_CardId.MermailAbysslung, defender => defender.HasAttribute(CardAttribute.Water)},
{_CardId.HarpiesPetBabyDragon, defender => defender.HasSetcode(_Setcode.Harpie) && !defender.IsCode(_CardId.HarpiesPetBabyDragon)},
{_CardId.HandHoldingGenie, defender => true},
{_CardId.GolemDragon, defender => defender.HasRace(CardRace.Dragon)},
{_CardId.MaraudingCaptain, defender => defender.HasRace(CardRace.Warrior)},
{_CardId.TwilightRoseKnight, defender => defender.HasRace(CardRace.Plant)},
{_CardId.PerformapalThunderhino, defender => defender.HasSetcode(_Setcode.Performapal)},
{_CardId.MiracleFlipper, defender => defender.IsFaceup()},
{_CardId.Decoyroid, defender => defender.IsFaceup()},
{_CardId.DupeFrog, defender => true},
{_CardId.AltergeistFifinellag, defender => defender.HasSetcode(_Setcode.Altergeist)},
{_CardId.BatterymanD, defender => defender.HasRace(CardRace.Thunder) && !defender.IsCode(_CardId.BatterymanD)},
{_CardId.Watthopper, defender => defender.HasSetcode(_Setcode.Watt) && defender.IsFaceup()},
{_CardId.EgyptianGodSlime, defender => true},
{_CardId.DinowrestlerChimeraTWrextle, defender => true},
{_CardId.DinowrestlerGigaSpinosavate, defender => true},
{_CardId.ScarredWarrior, defender => defender.HasRace(CardRace.Warrior) && defender.IsFaceup()},
{_CardId.SharkFortress, defender => true},
{_CardId.HeroicChampionClaivesolish, defender => true},
{_CardId.GhostrickAlucard, defender => defender.HasSetcode(_Setcode.Ghostrick) || defender.IsFacedown()},
{_CardId.MekkKnightCrusadiaAstram, defender => true},
{_CardId.DinowrestlerKingTWrextle, defender => true}
};
/// <summary>
/// Defined:
/// if monster with KEY on field, and meet VALUE(monster, all monster), it cannot be targeted for attack.
/// </summary>
protected Dictionary<int, Func<ClientCard, List<ClientCard>, bool>> DefenderInvisbleRule = new Dictionary<int, Func<ClientCard, List<ClientCard>, bool>> {
{_CardId.UltimayaTzolkin, (defender, list) => list.Any(monster => !monster.Equals(defender) && monster.HasType(CardType.Synchro))},
{_CardId.PerformapalMissDirector, (defender, list) => list.Any(monster => monster.HasSetcode(_Setcode.OddEyes))},
{_CardId.AncientWarriorsMasterfulSunMou, (defender, list) => list.Any(monster => !monster.Equals(defender) && monster.HasSetcode(_Setcode.AncientWarriors))},
{_CardId.AncientWarriorsVirtuousLiuXuan, (defender, list) => list.Any(monster => !monster.Equals(defender) && monster.HasSetcode(_Setcode.AncientWarriors))},
{_CardId.CommandKnight, (defender, list) => list.Any(monster => !monster.Equals(defender))},
{_CardId.HunterOwl, (defender, list) => list.Any(monster => !monster.Equals(defender) && monster.HasAttribute(CardAttribute.Wind))},
{_CardId.RokketRecharger, (defender, list) => list.Any(monster => monster.IsExtraCard() && monster.HasAttribute(CardAttribute.Dark))},
{_CardId.EmissaryOfTheOasis, (defender, list) => list.Any(monster => monster.HasType(CardType.Normal) && monster.Level <= 3)},
{_CardId.Zuttomozaurus, (defender, list) => list.Any(monster => !monster.Equals(defender) && monster.HasRace(CardRace.Dinosaur))},
{_CardId.Otoshidamashi, (defender, list) => list.Any(monster => !monster.HasType(CardType.Tuner))},
{_CardId.NaturiaMosquito, (defender, list) => list.Any(monster => !monster.Equals(defender) && monster.HasSetcode(_Setcode.Naturia))},
{_CardId.RescueACEHydrant, (defender, list) => list.Any(monster => !monster.IsCode(_CardId.RescueACEHydrant) && monster.HasSetcode(_Setcode.RescueACE))},
{_CardId.MeizenTheBattleNinja, (defender, list) => list.Any(monster => monster.IsFacedown())},
{_CardId.VindikiteRGenex, (defender, list) => true},
{_CardId.PrincessCologne, (defender, list) => list.Any(monster => !monster.Equals(defender))},
{_CardId.Number48ShadowLich, (defender, list) => list.Any(monster => monster.IsCode(_CardId.PhantomToken))},
{_CardId.DuelLinkDragonTheDuelDragon, (defender, list) => list.Any(monster => monster.IsCode(_CardId.DuelDragonToken))},
{_CardId.SeleneQueenOfTheMasterMagicians, (defender, list) => list.Any(monster => monster.HasSetcode(_Setcode.Endymion))},
{_CardId.TheWingedDragonofRaSphereMode, (defender, list) => true}
};
/// <summary> /// <summary>
/// Decide which card should the attacker attack. /// Decide which card should the attacker attack.
/// </summary> /// </summary>
...@@ -187,21 +348,16 @@ namespace WindBot.Game.AI ...@@ -187,21 +348,16 @@ namespace WindBot.Game.AI
return false; return false;
} }
foreach (ClientCard equip in defender.EquipCards) if (defender.EquipCards.Any(equip => equip.IsCode(_CardId.MoonMirrorShield) && !equip.IsDisabled()))
{ return false;
if (equip.IsCode(_CardId.MoonMirrorShield) && !equip.IsDisabled())
{
return false;
}
}
if (!defender.IsDisabled()) if (!defender.IsDisabled())
{ {
if (defender.IsCode(_CardId.MekkKnightCrusadiaAstram) && defender.IsAttack() && attacker.IsSpecialSummoned) if (defender.IsCode(_CardId.MekkKnightCrusadiaAstram) && defender.IsAttack() && attacker.IsSpecialSummoned)
return false; defender.RealPower += attacker.Attack;
if (defender.IsCode(_CardId.CrystalWingSynchroDragon) && defender.IsAttack() && attacker.Level >= 5) if (defender.IsCode(_CardId.CrystalWingSynchroDragon) && defender.IsAttack() && attacker.Level >= 5)
return false; defender.RealPower += attacker.Attack;
if (defender.IsCode(_CardId.AllyOfJusticeCatastor) && !attacker.HasAttribute(CardAttribute.Dark)) if (defender.IsCode(_CardId.AllyOfJusticeCatastor) && !attacker.HasAttribute(CardAttribute.Dark))
return false; return false;
...@@ -227,34 +383,68 @@ namespace WindBot.Game.AI ...@@ -227,34 +383,68 @@ namespace WindBot.Game.AI
if (attacker.IsMonsterInvincible()) if (attacker.IsMonsterInvincible())
attacker.RealPower = 9999; attacker.RealPower = 9999;
if (attacker.EquipCards.Any(equip => equip.IsCode(_CardId.MoonMirrorShield) && !equip.IsDisabled()))
attacker.RealPower = defender.RealPower + 100;
}
foreach (ClientCard equip in attacker.EquipCards) foreach (ClientCard protecter in Enemy.GetMonsters())
{
if (!protecter.IsDisabled() && protecter != defender)
{ {
if (equip.IsCode(_CardId.MoonMirrorShield) && !equip.IsDisabled()) Func<ClientCard, bool> defenderRule = card => false;
if (DefenderProtectRule.TryGetValue(protecter.Id, out defenderRule))
{ {
attacker.RealPower = defender.RealPower + 100; if (defenderRule(defender)) return false;
} }
} }
} }
if (Enemy.HasInMonstersZone(_CardId.MekkKnightCrusadiaAstram, true) && !(defender).IsCode(_CardId.MekkKnightCrusadiaAstram)) if (attacker.EquipCards.Any(equip => equip.IsCode(_CardId.MoonMirrorShield) && !equip.IsDisabled()))
return false; attacker.RealPower = defender.RealPower + 100;
if (Enemy.HasInMonstersZone(_CardId.DupeFrog, true) && !(defender).IsCode(_CardId.DupeFrog)) if (!defender.IsDisabled())
return false; {
Func<ClientCard, List<ClientCard>, bool> defenderRule = (card, monsterList) => false;
if (DefenderInvisbleRule.TryGetValue(defender.Id, out defenderRule))
{
if (defenderRule(defender, Enemy.GetMonsters())) return false;
}
}
if (Enemy.HasInMonstersZone(_CardId.MaraudingCaptain, true) && !defender.IsCode(_CardId.MaraudingCaptain) && defender.Race == (int)CardRace.Warrior) if (Enemy.GetMonsters().Any(monster => !monster.Equals(defender) && monster.IsCode(_CardId.HamonLordofStrikingThunder) && !monster.IsDisabled() && monster.IsDefense()))
return false; return false;
if (defender.IsCode(_CardId.UltimayaTzolkin) && !defender.IsDisabled() && Enemy.GetMonsters().Any(monster => !monster.Equals(defender) && monster.HasType(CardType.Synchro))) if (defender.OwnTargets.Any(card => card.IsCode(_CardId.PhantomKnightsFogBlade) && !card.IsDisabled()))
return false; return false;
if (Enemy.GetMonsters().Any(monster => !monster.Equals(defender) && monster.IsCode(_CardId.HamonLordofStrikingThunder) && !monster.IsDisabled() && monster.IsDefense())) if (defender.HasSetcode(_Setcode.EarthboundImmortal) && !defender.IsDisabled())
return false; return false;
bool attackHighestMonster =
Enemy.HasInMonstersZone(_CardId.RockOfTheVanquisher, true) && Enemy.GetMonsters().Any(card => card.HasSetcode(_Setcode.VanquishSoul)) ||
Enemy.HasInMonstersZone(_CardId.GladiatorBeastDomitianus, true) || Enemy.HasInMonstersZone(_CardId.PatricianOfDarkness) ||
Enemy.HasInMonstersZone(_CardId.DictatorOfD, true) && Enemy.GetMonsters().Any(card => card.HasSetcode(_Setcode.BlueEyes));
if (attackHighestMonster)
{
if (defender.HasPosition(CardPosition.FaceDown))
return false;
if (Enemy.GetMonsters().Any(card => card.IsFaceup() && card.Attack > defender.Attack))
return false;
}
if (defender.OwnTargets.Any(card => card.IsCode(_CardId.PhantomKnightsFogBlade) && !card.IsDisabled())) if (Enemy.HasInSpellZone(_CardId.SpiralDischarge, true) && Enemy.HasInMonstersZone(_CardId.GaiaTheDragonChampion) && !defender.IsCode(_CardId.GaiaTheDragonChampion))
return false;
if (Enemy.HasInSpellZone(_CardId.CrusadiaVanguard, true) && Enemy.GetMonsters().Any(card => card.HasSetcode(_Setcode.Crusadia) && card.HasType(CardType.Link)) && !defender.HasType(CardType.Link))
return false;
if (defender.IsCode(_CardId.RescueACEHydrant) && !defender.IsDisabled() && Enemy.GetMonsters().Any(monster => monster.HasSetcode(_Setcode.RescueACE) && !monster.IsCode(_CardId.RescueACEHydrant)))
return false; return false;
if (Enemy.HasInSpellZone(_CardId.SilenforcingBarrier, true) && Enemy.HasInMonstersZone(_CardId.NovoxTheSilenforcerDisciple, faceUp: true) && !defender.HasType(CardType.Ritual))
return false;
return true; return true;
} }
...@@ -321,6 +511,40 @@ namespace WindBot.Game.AI ...@@ -321,6 +511,40 @@ namespace WindBot.Game.AI
return card.Level <= 4 && Bot.GetMonsters().Count(m => m.IsFaceup()) == 0 && Util.IsAllEnemyBetterThanValue(card.Attack, true); return card.Level <= 4 && Bot.GetMonsters().Count(m => m.IsFaceup()) == 0 && Util.IsAllEnemyBetterThanValue(card.Attack, true);
} }
/// <summary>
/// Called when the AI has to select one or more cards.
/// </summary>
/// <param name="cards">List of available cards.</param>
/// <param name="min">Minimal quantity.</param>
/// <param name="max">Maximal quantity.</param>
/// <param name="hint">The hint message of the select.</param>
/// <param name="cancelable">True if you can return an empty list.</param>
/// <returns>A new list containing the selected cards.</returns>
public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable)
{
// wordaround for Dogmatika Alba Zoa
int albaZoaCount = Bot.ExtraDeck.Count / 2;
if (!cancelable && min == albaZoaCount && max == albaZoaCount
&& Duel.Player == 1 && (Duel.Phase == DuelPhase.Main1 || Duel.Phase == DuelPhase.Main2) && cards.All(card =>
card.Controller == 0 && (card.Location == CardLocation.Hand || card.Location == CardLocation.Extra)))
{
Logger.DebugWriteLine("Dogmatika Alba Zoa solved");
List<ClientCard> extraDeck = new List<ClientCard>(Bot.ExtraDeck);
int shuffleCount = extraDeck.Count;
while (shuffleCount-- > 1)
{
int index = Program.Rand.Next(extraDeck.Count);
ClientCard tempCard = extraDeck[shuffleCount];
extraDeck[shuffleCount] = extraDeck[index];
extraDeck[index] = tempCard;
}
return Util.CheckSelectCount(extraDeck, cards, min, max);
}
return null;
}
/// <summary> /// <summary>
/// Destroy face-down cards first, in our turn. /// Destroy face-down cards first, in our turn.
/// </summary> /// </summary>
...@@ -812,6 +1036,8 @@ namespace WindBot.Game.AI ...@@ -812,6 +1036,8 @@ namespace WindBot.Game.AI
if (Util.ChainContainsCard(destroyAllList)) return true; if (Util.ChainContainsCard(destroyAllList)) return true;
if (Enemy.HasInSpellZone(destroyAllOpponentSpellList, true) && Card.Location == CardLocation.SpellZone) return true; if (Enemy.HasInSpellZone(destroyAllOpponentSpellList, true) && Card.Location == CardLocation.SpellZone) return true;
if (lightningStormOption == 0 && Card.Location == CardLocation.MonsterZone && Card.IsAttack()) return true;
if (lightningStormOption == 1 && Card.Location == CardLocation.SpellZone) return true;
// TODO: ChainContainsCard(id, player) // TODO: ChainContainsCard(id, player)
return false; return false;
} }
...@@ -907,12 +1133,11 @@ namespace WindBot.Game.AI ...@@ -907,12 +1133,11 @@ namespace WindBot.Game.AI
bool nontuner = false; bool nontuner = false;
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.HasType(CardType.Tuner)) if (!monster.HasType(CardType.Xyz | CardType.Link))
tuner = true;
else if (!monster.HasType(CardType.Xyz) && !monster.HasType(CardType.Link))
{ {
nontuner = true; if (monster.HasType(CardType.Tuner)) tuner = true;
levels[monster.Level] = levels[monster.Level] + 1; else nontuner = true;
if (!monster.HasType(CardType.Token)) levels[monster.Level] = levels[monster.Level] + 1;
} }
if (monster.IsOneForXyz()) if (monster.IsOneForXyz())
...@@ -943,7 +1168,8 @@ namespace WindBot.Game.AI ...@@ -943,7 +1168,8 @@ namespace WindBot.Game.AI
} }
} }
ClientCard lastchaincard = Util.GetLastChainCard(); ClientCard lastchaincard = Util.GetLastChainCard();
if (Duel.LastChainPlayer == 1 && lastchaincard != null && !lastchaincard.IsDisabled()) if (Duel.LastChainPlayer == 1 && lastchaincard != null && !lastchaincard.IsDisabled()
&& (lastchaincard.HasType(CardType.Spell | CardType.Trap) || lastchaincard.Location == CardLocation.MonsterZone))
{ {
if (lastchaincard.HasType(CardType.Ritual)) if (lastchaincard.HasType(CardType.Ritual))
{ {
...@@ -1185,7 +1411,7 @@ namespace WindBot.Game.AI ...@@ -1185,7 +1411,7 @@ namespace WindBot.Game.AI
if (Card.Location == CardLocation.Hand) if (Card.Location == CardLocation.Hand)
{ {
return Bot.BattlingMonster.IsAttack() && return Bot.BattlingMonster.IsAttack() &&
(((Bot.BattlingMonster.Attack < Enemy.BattlingMonster.Attack) || Bot.BattlingMonster.Attack >= Enemy.LifePoints) ((Bot.BattlingMonster.Attack < Enemy.BattlingMonster.Attack) || Bot.BattlingMonster.Attack >= Enemy.LifePoints
|| ((Bot.BattlingMonster.Attack < Enemy.BattlingMonster.Defense) && (Bot.BattlingMonster.Attack + Enemy.BattlingMonster.Attack > Enemy.BattlingMonster.Defense))); || ((Bot.BattlingMonster.Attack < Enemy.BattlingMonster.Defense) && (Bot.BattlingMonster.Attack + Enemy.BattlingMonster.Attack > Enemy.BattlingMonster.Defense)));
} }
...@@ -1235,13 +1461,13 @@ namespace WindBot.Game.AI ...@@ -1235,13 +1461,13 @@ namespace WindBot.Game.AI
List<ClientCard> targetList = new List<ClientCard>(); List<ClientCard> targetList = new List<ClientCard>();
List<ClientCard> floodgateCards = monsters List<ClientCard> floodgateCards = monsters
.Where(card => card?.Data != null && card.IsFloodgate() && card.IsFaceup() && !card.IsShouldNotBeTarget()) .Where(card => card?.Data != null && card.IsFloodgate() && card.IsFaceup() && !card.IsShouldNotBeTarget())
.OrderBy(card => card.Attack).ToList(); .OrderByDescending(card => card.Attack).ToList();
List<ClientCard> dangerousCards = monsters List<ClientCard> dangerousCards = monsters
.Where(card => card?.Data != null && card.IsMonsterDangerous() && card.IsFaceup() && !card.IsShouldNotBeTarget()) .Where(card => card?.Data != null && card.IsMonsterDangerous() && card.IsFaceup() && !card.IsShouldNotBeTarget())
.OrderBy(card => card.Attack).ToList(); .OrderByDescending(card => card.Attack).ToList();
List<ClientCard> attackOrderedCards = monsters List<ClientCard> attackOrderedCards = monsters
.Where(card => card?.Data != null && card.HasType(CardType.Monster) && card.IsFaceup() && card.IsShouldNotBeTarget()) .Where(card => card?.Data != null && card.HasType(CardType.Monster) && card.IsFaceup() && card.IsShouldNotBeTarget())
.OrderBy(card => card.Attack).ToList(); .OrderByDescending(card => card.Attack).ToList();
targetList.AddRange(floodgateCards); targetList.AddRange(floodgateCards);
targetList.AddRange(dangerousCards); targetList.AddRange(dangerousCards);
...@@ -1255,5 +1481,21 @@ namespace WindBot.Game.AI ...@@ -1255,5 +1481,21 @@ namespace WindBot.Game.AI
return false; return false;
} }
public override void OnReceivingAnnouce(int player, int data)
{
if (player == 1 && data == Util.GetStringId(_CardId.LightningStorm, 0) || data == Util.GetStringId(_CardId.LightningStorm, 1))
{
lightningStormOption = data - Util.GetStringId(_CardId.LightningStorm, 0);
}
base.OnReceivingAnnouce(player, data);
}
public override void OnChainEnd()
{
lightningStormOption = -1;
base.OnChainEnd();
}
} }
} }
...@@ -34,7 +34,9 @@ namespace WindBot.Game.AI ...@@ -34,7 +34,9 @@ namespace WindBot.Game.AI
[DataMember] [DataMember]
public string[] setmonster { get; set; } public string[] setmonster { get; set; }
[DataMember] [DataMember]
public string[] chaining { get; set; } public string[] chaining { get; set; }
[DataMember]
public string[] custom { get; set; }
} }
public class Dialogs public class Dialogs
{ {
...@@ -53,7 +55,8 @@ namespace WindBot.Game.AI ...@@ -53,7 +55,8 @@ namespace WindBot.Game.AI
private string[] _summon; private string[] _summon;
private string[] _setmonster; private string[] _setmonster;
private string[] _chaining; private string[] _chaining;
private string[] _custom;
public Dialogs(GameClient game) public Dialogs(GameClient game)
{ {
_game = game; _game = game;
...@@ -75,6 +78,7 @@ namespace WindBot.Game.AI ...@@ -75,6 +78,7 @@ namespace WindBot.Game.AI
_summon = data.summon; _summon = data.summon;
_setmonster = data.setmonster; _setmonster = data.setmonster;
_chaining = data.chaining; _chaining = data.chaining;
_custom = data.custom;
} }
} }
...@@ -176,5 +180,14 @@ namespace WindBot.Game.AI ...@@ -176,5 +180,14 @@ namespace WindBot.Game.AI
Logger.WriteLine("Error: " + message); 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 @@ ...@@ -24,5 +24,8 @@
ZushintheSleepingGiant = 67547370, ZushintheSleepingGiant = 67547370,
Heart_eartHDragon = 97403510, Heart_eartHDragon = 97403510,
DaigustoSphreeze = 29552709, DaigustoSphreeze = 29552709,
OhimetheManifestedMikanko = 81260679,
ArahimetheManifestedMikanko = 75771170,
YubelDasEwigLiebeWächter = 47172959
} }
} }
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
ElShaddollConstruct = 20366274, ElShaddollConstruct = 20366274,
ElShaddollGrysra = 48424886, ElShaddollGrysra = 48424886,
ElShaddollWinda = 94977269, ElShaddollWinda = 94977269,
HotRedDragonArchfiendAbyss = 9753964,
UltimateConductorTytanno = 18940556, UltimateConductorTytanno = 18940556,
OvertexCoatls = 41782653, OvertexCoatls = 41782653,
FirePrison = 269510, FirePrison = 269510,
...@@ -199,6 +200,18 @@ ...@@ -199,6 +200,18 @@
BystialDisPater = 27572350, BystialDisPater = 27572350,
DespianLuluwalilith = 53971455, DespianLuluwalilith = 53971455,
FirewallDragonSingularity = 21637210, FirewallDragonSingularity = 21637210,
BrandedEtude = 45675980 BrandedEtude = 45675980,
EvolzarLars = 35103106,
AltergeistAdminia = 61470213,
EmperorCharlesTheGreat = 97864322,
YouReFinished = 88346805,
VolcanicEmperor = 46412900,
VolcanicInferno = 84138874,
RedZone = 50056656,
TGGlaiveBlaster = 95973569,
StellarNemesisTPHON_DoomsdayStar = 93039339,
SPLittleKnight = 29301450,
AngelRing = 40678060,
SkullGuardianTheSilenforcingProtector = 10774240
} }
} }
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
FaceCardFusion = 29062925, FaceCardFusion = 29062925,
MyutantFusion = 42577802, MyutantFusion = 42577802,
MyutantCry = 31855260, MyutantCry = 31855260,
FallenOfAlbaz = 68468459,
GreaterPolymerization = 7614732, GreaterPolymerization = 7614732,
UltimateFusion = 71143015, UltimateFusion = 71143015,
BrandedFusion = 44362883, BrandedFusion = 44362883,
...@@ -82,6 +83,9 @@ ...@@ -82,6 +83,9 @@
AmazonessSecretArts = 86758746, AmazonessSecretArts = 86758746,
DarkWorldAccession = 65956182, DarkWorldAccession = 65956182,
BeetrooperLanding = 13234975, BeetrooperLanding = 13234975,
FusionReproduction = 43331750 FusionReproduction = 43331750,
ChimeraFusion = 63136489,
HarmonicSynchroFusion = 7473735,
SouloftheSupremeCelestialKing = 76840111
} }
} }
...@@ -27,7 +27,9 @@ ...@@ -27,7 +27,9 @@
NumberC96DarkStorm = 77205367, NumberC96DarkStorm = 77205367,
Number54LionHeart = 54366836, Number54LionHeart = 54366836,
Number2NinjaShadowMosquito = 32453837, Number2NinjaShadowMosquito = 32453837,
OhimetheManifestedMikanko = 81260679 OhimetheManifestedMikanko = 81260679,
NightmareMagician = 40221691,
ArahimetheManifestedMikanko = 75771170
} }
/// <summary> /// <summary>
/// Cards that are invincible to battle. /// Cards that are invincible to battle.
...@@ -101,6 +103,17 @@ ...@@ -101,6 +103,17 @@
BrigrandtheGloryDragon = 34848821, BrigrandtheGloryDragon = 34848821,
AmazonessQueen = 15951532, AmazonessQueen = 15951532,
Number2NinjaShadowMosquito = 32453837, Number2NinjaShadowMosquito = 32453837,
OhimetheManifestedMikanko = 81260679 OhimetheManifestedMikanko = 81260679,
CornfieldCoatl = 92565383,
MirrorSwordknight = 28954097,
NightmareMagician = 40221691,
ArahimetheManifestedMikanko = 75771170,
UFOLight = 9275482,
TaotheGreatChanter = 34541543,
SpiritOfYubel = 90829280,
DarkGuardian = 26746975,
EnvoyOfTheWaxState = 87462901,
Fluffyfluff = 85401123,
YubelDasEwigLiebeWächter = 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
namespace WindBot.Game.AI.Enums
{
public enum NotBeXyzMaterialMonster
{
YellowDuston = 16366810,
BlueDuston = 40217358,
Centerfrog = 47346782,
GreenDuston = 52182715,
RedDuston = 61019812,
EaterofMillions = 63845230,
PutridPuddingBodyBuddies = 85101097,
Click_Echo = 2992467
}
}
\ No newline at end of file
...@@ -59,6 +59,10 @@ ...@@ -59,6 +59,10 @@
BrotherhoodoftheFireFist_Leopard = 39699564, BrotherhoodoftheFireFist_Leopard = 39699564,
SpringansPedor = 56818977, SpringansPedor = 56818977,
GizmekNaganakitheSunriseSignaler = 96399967, GizmekNaganakitheSunriseSignaler = 96399967,
MyutantMutant = 26561172 MyutantMutant = 26561172,
ThreeEyedGhost = 31464658,
UrsarcticPolarStar = 62714453,
BattlinBoxerPromoter = 83315222,
TGRocketSalamander = 77392987
} }
} }
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
Blackwing_FullArmoredWing = 54082269, Blackwing_FullArmoredWing = 54082269,
DragunofRedEyes = 37818794, DragunofRedEyes = 37818794,
RedEyesBDragon = 74677422, // sometimes the name of DragunofRedEyes will be changed to RedEyesBDragon RedEyesBDragon = 74677422, // sometimes the name of DragunofRedEyes will be changed to RedEyesBDragon
TheArrivalCyberseIgnister = 11738489 TheArrivalCyberseIgnister = 11738489,
MajespecterPorcupineYamaarashi = 51073802,
RaidraptorRisingRebellionFalcon = 71222868
} }
} }
...@@ -22,6 +22,7 @@ namespace WindBot.Game.AI ...@@ -22,6 +22,7 @@ namespace WindBot.Game.AI
protected ExecutorType Type { get; private set; } protected ExecutorType Type { get; private set; }
protected ClientCard Card { get; private set; } protected ClientCard Card { get; private set; }
protected int ActivateDescription { get; private set; } protected int ActivateDescription { get; private set; }
protected int CurrentTiming { get; private set; }
protected ClientField Bot { get; private set; } protected ClientField Bot { get; private set; }
protected ClientField Enemy { get; private set; } protected ClientField Enemy { get; private set; }
...@@ -94,10 +95,21 @@ namespace WindBot.Game.AI ...@@ -94,10 +95,21 @@ namespace WindBot.Game.AI
// For overriding // For overriding
} }
public virtual void OnChainSolved(int chainIndex)
{
// For overriding
}
public virtual void OnChainEnd() public virtual void OnChainEnd()
{ {
// For overriding // For overriding
} }
public virtual void OnReceivingAnnouce(int player, int data)
{
// For overriding
}
public virtual void OnNewPhase() public virtual void OnNewPhase()
{ {
// Some AI need do something on new phase // Some AI need do something on new phase
...@@ -112,6 +124,11 @@ namespace WindBot.Game.AI ...@@ -112,6 +124,11 @@ namespace WindBot.Game.AI
// Some AI need do something on draw // Some AI need do something on draw
} }
public virtual void OnMove(ClientCard card, int previousControler, int previousLocation, int currentControler, int currentLocation)
{
// Some AI need do something on card's moving
}
public virtual IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable) public virtual IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable)
{ {
// For overriding // For overriding
...@@ -165,6 +182,7 @@ namespace WindBot.Game.AI ...@@ -165,6 +182,7 @@ namespace WindBot.Game.AI
// For overriding // For overriding
return null; return null;
} }
public virtual void OnSelectChain(IList<ClientCard> cards) public virtual void OnSelectChain(IList<ClientCard> cards)
{ {
return; return;
...@@ -232,11 +250,12 @@ namespace WindBot.Game.AI ...@@ -232,11 +250,12 @@ namespace WindBot.Game.AI
/// <summary> /// <summary>
/// Set global variables Type, Card, ActivateDescription for Executor /// Set global variables Type, Card, ActivateDescription for Executor
/// </summary> /// </summary>
public void SetCard(ExecutorType type, ClientCard card, int description) public void SetCard(ExecutorType type, ClientCard card, int description, int timing = -1)
{ {
Type = type; Type = type;
Card = card; Card = card;
ActivateDescription = description; ActivateDescription = description;
CurrentTiming = timing;
} }
/// <summary> /// <summary>
......
...@@ -57,6 +57,11 @@ ...@@ -57,6 +57,11 @@
ToZone = 571, ToZone = 571,
Counter = 572, Counter = 572,
Disable = 573, Disable = 573,
OperateCard = 574; OperateCard = 574,
RITUAL = 1057,
FUSION = 1056,
SYNCHRO = 1063,
XYZ = 1073,
PENDULUM = 1074;
} }
} }
\ No newline at end of file
...@@ -82,6 +82,9 @@ namespace WindBot.Game ...@@ -82,6 +82,9 @@ namespace WindBot.Game
Name = Data.Name; Name = Data.Name;
if (Data.Alias != 0) if (Data.Alias != 0)
Alias = Data.Alias; Alias = Data.Alias;
} else {
Name = null;
Alias = 0;
} }
} }
......
using System.Collections.Generic; using System.Collections.Generic;
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game namespace WindBot.Game
...@@ -26,6 +26,8 @@ namespace WindBot.Game ...@@ -26,6 +26,8 @@ namespace WindBot.Game
public int LastSummonPlayer { get; set; } public int LastSummonPlayer { get; set; }
public IList<ClientCard> SummoningCards { get; set; } public IList<ClientCard> SummoningCards { get; set; }
public IList<ClientCard> LastSummonedCards { get; set; } public IList<ClientCard> LastSummonedCards { get; set; }
public int SolvingChainIndex { get; set; }
public IList<int> NegatedChainIndexList { get; set; }
public Duel() public Duel()
{ {
...@@ -41,6 +43,8 @@ namespace WindBot.Game ...@@ -41,6 +43,8 @@ namespace WindBot.Game
LastSummonPlayer = -1; LastSummonPlayer = -1;
SummoningCards = new List<ClientCard>(); SummoningCards = new List<ClientCard>();
LastSummonedCards = new List<ClientCard>(); LastSummonedCards = new List<ClientCard>();
SolvingChainIndex = 0;
NegatedChainIndexList = new List<int>();
} }
public ClientCard GetCard(int player, CardLocation loc, int seq) public ClientCard GetCard(int player, CardLocation loc, int seq)
...@@ -169,5 +173,16 @@ namespace WindBot.Game ...@@ -169,5 +173,16 @@ namespace WindBot.Game
{ {
return IsFirst ? player : 1 - player; return IsFirst ? player : 1 - player;
} }
public ClientCard GetCurrentSolvingChainCard()
{
if (SolvingChainIndex == 0 || SolvingChainIndex > CurrentChain.Count) return null;
return CurrentChain[SolvingChainIndex - 1];
}
public bool IsCurrentSolvingChainNegated()
{
return SolvingChainIndex > 0 && NegatedChainIndexList.Contains(SolvingChainIndex);
}
} }
} }
\ No newline at end of file
...@@ -54,6 +54,14 @@ namespace WindBot.Game ...@@ -54,6 +54,14 @@ namespace WindBot.Game
_dialogs.SendDuelStart(); _dialogs.SendDuelStart();
} }
/// <summary>
/// Customized called when the AI do something in a duel.
/// </summary>
public void SendCustomChat(int index, params object[] opts)
{
_dialogs.SendCustomChat(index, opts);
}
/// <summary> /// <summary>
/// Called when the AI do the rock-paper-scissors. /// Called when the AI do the rock-paper-scissors.
/// </summary> /// </summary>
...@@ -111,6 +119,11 @@ namespace WindBot.Game ...@@ -111,6 +119,11 @@ namespace WindBot.Game
Executor.OnNewPhase(); Executor.OnNewPhase();
} }
public void OnMove(ClientCard card, int previousControler, int previousLocation, int currentControler, int currentLocation)
{
Executor.OnMove(card, previousControler, previousLocation, currentControler, currentLocation);
}
/// <summary> /// <summary>
/// Called when the AI got attack directly. /// Called when the AI got attack directly.
/// </summary> /// </summary>
...@@ -128,6 +141,11 @@ namespace WindBot.Game ...@@ -128,6 +141,11 @@ namespace WindBot.Game
{ {
Executor.OnChaining(player,card); Executor.OnChaining(player,card);
} }
public void OnChainSolved(int chainIndex)
{
Executor.OnChainSolved(chainIndex);
}
/// <summary> /// <summary>
/// Called when a chain has been solved. /// Called when a chain has been solved.
...@@ -139,6 +157,16 @@ namespace WindBot.Game ...@@ -139,6 +157,16 @@ namespace WindBot.Game
Executor.OnChainEnd(); Executor.OnChainEnd();
} }
/// <summary>
/// Called when receiving annouce
/// </summary>
/// <param name="player">Player who announce.</param>
/// <param name="data">Annouced info.</param>
public void OnReceivingAnnouce(int player, int data)
{
Executor.OnReceivingAnnouce(player, data);
}
/// <summary> /// <summary>
/// Called when the AI has to do something during the battle phase. /// Called when the AI has to do something during the battle phase.
/// </summary> /// </summary>
...@@ -287,6 +315,8 @@ namespace WindBot.Game ...@@ -287,6 +315,8 @@ 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>();
if (hint == HintMsg.AttackTarget && cancelable) return selected;
if (cards.Count >= min) if (cards.Count >= min)
{ {
for (int i = 0; i < min; ++i) for (int i = 0; i < min; ++i)
...@@ -301,8 +331,9 @@ namespace WindBot.Game ...@@ -301,8 +331,9 @@ namespace WindBot.Game
/// <param name="cards">List of activable cards.</param> /// <param name="cards">List of activable cards.</param>
/// <param name="descs">List of effect descriptions.</param> /// <param name="descs">List of effect descriptions.</param>
/// <param name="forced">You can't return -1 if this param is true.</param> /// <param name="forced">You can't return -1 if this param is true.</param>
/// <param name="timing">Current hint timing</param>
/// <returns>Index of the activated card or -1.</returns> /// <returns>Index of the activated card or -1.</returns>
public int OnSelectChain(IList<ClientCard> cards, IList<int> descs, bool forced) public int OnSelectChain(IList<ClientCard> cards, IList<int> descs, bool forced, int timing = -1)
{ {
Executor.OnSelectChain(cards); Executor.OnSelectChain(cards);
foreach (CardExecutor exec in Executor.Executors) foreach (CardExecutor exec in Executor.Executors)
...@@ -310,7 +341,7 @@ namespace WindBot.Game ...@@ -310,7 +341,7 @@ namespace WindBot.Game
for (int i = 0; i < cards.Count; ++i) for (int i = 0; i < cards.Count; ++i)
{ {
ClientCard card = cards[i]; ClientCard card = cards[i];
if (ShouldExecute(exec, card, ExecutorType.Activate, descs[i])) if (ShouldExecute(exec, card, ExecutorType.Activate, descs[i], timing))
{ {
_dialogs.SendChaining(card.Name); _dialogs.SendChaining(card.Name);
return i; return i;
...@@ -1113,7 +1144,7 @@ namespace WindBot.Game ...@@ -1113,7 +1144,7 @@ namespace WindBot.Game
return new BattlePhaseAction(BattlePhaseAction.BattleAction.ToMainPhaseTwo); return new BattlePhaseAction(BattlePhaseAction.BattleAction.ToMainPhaseTwo);
} }
private bool ShouldExecute(CardExecutor exec, ClientCard card, ExecutorType type, int desc = -1) private bool ShouldExecute(CardExecutor exec, ClientCard card, ExecutorType type, int desc = -1, int timing = -1)
{ {
if (card.Id != 0 && type == ExecutorType.Activate) if (card.Id != 0 && type == ExecutorType.Activate)
{ {
...@@ -1122,7 +1153,7 @@ namespace WindBot.Game ...@@ -1122,7 +1153,7 @@ namespace WindBot.Game
if (!Executor.OnPreActivate(card)) if (!Executor.OnPreActivate(card))
return false; return false;
} }
Executor.SetCard(type, card, desc); Executor.SetCard(type, card, desc, timing);
bool result = card != null && exec.Type == type && bool result = card != null && exec.Type == type &&
(exec.CardId == -1 || exec.CardId == card.Id) && (exec.CardId == -1 || exec.CardId == card.Id) &&
(exec.Func == null || exec.Func()); (exec.Func == null || exec.Func());
......
...@@ -106,7 +106,7 @@ namespace WindBot.Game ...@@ -106,7 +106,7 @@ namespace WindBot.Game
_messages.Add(GameMessage.ShuffleHand, OnShuffleHand); _messages.Add(GameMessage.ShuffleHand, OnShuffleHand);
_messages.Add(GameMessage.ShuffleExtra, OnShuffleExtra); _messages.Add(GameMessage.ShuffleExtra, OnShuffleExtra);
_messages.Add(GameMessage.ShuffleSetCard, OnShuffleSetCard); _messages.Add(GameMessage.ShuffleSetCard, OnShuffleSetCard);
_messages.Add(GameMessage.SwapGraveDeck, OnSwapGraveDeck); _messages.Add(GameMessage.SwapGraveDeck, OnSwapGraveDeck);
_messages.Add(GameMessage.TagSwap, OnTagSwap); _messages.Add(GameMessage.TagSwap, OnTagSwap);
_messages.Add(GameMessage.NewTurn, OnNewTurn); _messages.Add(GameMessage.NewTurn, OnNewTurn);
_messages.Add(GameMessage.NewPhase, OnNewPhase); _messages.Add(GameMessage.NewPhase, OnNewPhase);
...@@ -121,6 +121,10 @@ namespace WindBot.Game ...@@ -121,6 +121,10 @@ namespace WindBot.Game
_messages.Add(GameMessage.AttackDisabled, OnAttackDisabled); _messages.Add(GameMessage.AttackDisabled, OnAttackDisabled);
_messages.Add(GameMessage.PosChange, OnPosChange); _messages.Add(GameMessage.PosChange, OnPosChange);
_messages.Add(GameMessage.Chaining, OnChaining); _messages.Add(GameMessage.Chaining, OnChaining);
_messages.Add(GameMessage.ChainSolving, OnChainSolving);
_messages.Add(GameMessage.ChainNegated, OnChainNegated);
_messages.Add(GameMessage.ChainDisabled, OnChainDisabled);
_messages.Add(GameMessage.ChainSolved, OnChainSolved);
_messages.Add(GameMessage.ChainEnd, OnChainEnd); _messages.Add(GameMessage.ChainEnd, OnChainEnd);
_messages.Add(GameMessage.SortCard, OnCardSorting); _messages.Add(GameMessage.SortCard, OnCardSorting);
_messages.Add(GameMessage.SortChain, OnChainSorting); _messages.Add(GameMessage.SortChain, OnChainSorting);
...@@ -156,6 +160,7 @@ namespace WindBot.Game ...@@ -156,6 +160,7 @@ namespace WindBot.Game
_messages.Add(GameMessage.SpSummoned, OnSpSummoned); _messages.Add(GameMessage.SpSummoned, OnSpSummoned);
_messages.Add(GameMessage.FlipSummoning, OnSummoning); _messages.Add(GameMessage.FlipSummoning, OnSummoning);
_messages.Add(GameMessage.FlipSummoned, OnSummoned); _messages.Add(GameMessage.FlipSummoned, OnSummoned);
_messages.Add(GameMessage.ConfirmCards, OnConfirmCards);
} }
private BinaryWriter buildUpdateDeck(Deck targetDeck) { private BinaryWriter buildUpdateDeck(Deck targetDeck) {
...@@ -389,6 +394,10 @@ namespace WindBot.Game ...@@ -389,6 +394,10 @@ namespace WindBot.Game
{ {
_select_hint = data; _select_hint = data;
} }
if (type == 4) // HINT_OPSELECTED
{
_ai.OnReceivingAnnouce(player, data);
}
} }
private void OnStart(BinaryReader packet) private void OnStart(BinaryReader packet)
...@@ -396,6 +405,11 @@ namespace WindBot.Game ...@@ -396,6 +405,11 @@ namespace WindBot.Game
int type = packet.ReadByte(); int type = packet.ReadByte();
_duel.IsFirst = (type & 0xF) == 0; _duel.IsFirst = (type & 0xF) == 0;
_duel.Turn = 0; _duel.Turn = 0;
_duel.LastChainLocation = 0;
_duel.LastChainPlayer = -1;
_duel.LastChainTargets.Clear();
_duel.LastSummonedCards.Clear();
_duel.LastSummonPlayer = -1;
int duel_rule = packet.ReadByte(); int duel_rule = packet.ReadByte();
_ai.Duel.IsNewRule = (duel_rule >= 4); _ai.Duel.IsNewRule = (duel_rule >= 4);
_ai.Duel.IsNewRule2020 = (duel_rule >= 5); _ai.Duel.IsNewRule2020 = (duel_rule >= 5);
...@@ -408,6 +422,19 @@ namespace WindBot.Game ...@@ -408,6 +422,19 @@ namespace WindBot.Game
extra = packet.ReadInt16(); extra = packet.ReadInt16();
_duel.Fields[GetLocalPlayer(1)].Init(deck, extra); _duel.Fields[GetLocalPlayer(1)].Init(deck, extra);
// in case of ending duel in chain's solving
_duel.LastChainPlayer = -1;
_duel.LastChainLocation = 0;
_duel.CurrentChain.Clear();
_duel.ChainTargets.Clear();
_duel.LastChainTargets.Clear();
_duel.ChainTargetOnly.Clear();
_duel.LastSummonPlayer = -1;
_duel.SummoningCards.Clear();
_duel.LastSummonedCards.Clear();
_duel.SolvingChainIndex = 0;
_duel.NegatedChainIndexList.Clear();
Logger.WriteLine("Duel started: " + _room.Names[0] + " versus " + _room.Names[1]); Logger.WriteLine("Duel started: " + _room.Names[0] + " versus " + _room.Names[1]);
_ai.OnStart(); _ai.OnStart();
} }
...@@ -683,6 +710,8 @@ namespace WindBot.Game ...@@ -683,6 +710,8 @@ namespace WindBot.Game
(CardLocation)previousLocation + " move to " + (CardLocation)currentLocation + ")"); (CardLocation)previousLocation + " move to " + (CardLocation)currentLocation + ")");
} }
} }
_ai.OnMove(card, previousControler, previousLocation, currentControler, currentLocation);
} }
private void OnSwap(BinaryReader packet) private void OnSwap(BinaryReader packet)
...@@ -788,6 +817,30 @@ namespace WindBot.Game ...@@ -788,6 +817,30 @@ namespace WindBot.Game
} }
private void OnChainSolving(BinaryReader packet)
{
int chainIndex = packet.ReadByte();
_duel.SolvingChainIndex = chainIndex;
}
private void OnChainNegated(BinaryReader packet)
{
int chainIndex = packet.ReadByte();
_duel.NegatedChainIndexList.Add(chainIndex);
}
private void OnChainDisabled(BinaryReader packet)
{
int chainIndex = packet.ReadByte();
_duel.NegatedChainIndexList.Add(chainIndex);
}
private void OnChainSolved(BinaryReader packet)
{
int chainIndex = packet.ReadByte();
_ai.OnChainSolved(chainIndex);
}
private void OnChainEnd(BinaryReader packet) private void OnChainEnd(BinaryReader packet)
{ {
_ai.OnChainEnd(); _ai.OnChainEnd();
...@@ -797,6 +850,8 @@ namespace WindBot.Game ...@@ -797,6 +850,8 @@ namespace WindBot.Game
_duel.ChainTargets.Clear(); _duel.ChainTargets.Clear();
_duel.LastChainTargets.Clear(); _duel.LastChainTargets.Clear();
_duel.ChainTargetOnly.Clear(); _duel.ChainTargetOnly.Clear();
_duel.SolvingChainIndex = 0;
_duel.NegatedChainIndexList.Clear();
} }
private void OnCardSorting(BinaryReader packet) private void OnCardSorting(BinaryReader packet)
...@@ -1004,7 +1059,10 @@ namespace WindBot.Game ...@@ -1004,7 +1059,10 @@ namespace WindBot.Game
if (((int)loc & (int)CardLocation.Overlay) != 0) if (((int)loc & (int)CardLocation.Overlay) != 0)
card = new ClientCard(id, CardLocation.Overlay, -1); card = new ClientCard(id, CardLocation.Overlay, -1);
else else
{
card = _duel.GetCard(player, loc, seq); card = _duel.GetCard(player, loc, seq);
card.Controller = player;
}
if (card == null) continue; if (card == null) continue;
if (card.Id == 0) if (card.Id == 0)
card.SetId(id); card.SetId(id);
...@@ -1126,8 +1184,8 @@ namespace WindBot.Game ...@@ -1126,8 +1184,8 @@ namespace WindBot.Game
int count = packet.ReadByte(); int count = packet.ReadByte();
packet.ReadByte(); // specount packet.ReadByte(); // specount
bool forced = packet.ReadByte() != 0; bool forced = packet.ReadByte() != 0;
packet.ReadInt32(); // hint1 int hint1 = packet.ReadInt32(); // hint1
packet.ReadInt32(); // hint2 int hint2 = packet.ReadInt32(); // hint2
IList<ClientCard> cards = new List<ClientCard>(); IList<ClientCard> cards = new List<ClientCard>();
IList<int> descs = new List<int>(); IList<int> descs = new List<int>();
...@@ -1167,7 +1225,7 @@ namespace WindBot.Game ...@@ -1167,7 +1225,7 @@ namespace WindBot.Game
return; return;
} }
Connection.Send(CtosMessage.Response, _ai.OnSelectChain(cards, descs, forced)); Connection.Send(CtosMessage.Response, _ai.OnSelectChain(cards, descs, forced, hint1 | hint2));
} }
private void OnSelectCounter(BinaryReader packet) private void OnSelectCounter(BinaryReader packet)
...@@ -1804,7 +1862,7 @@ namespace WindBot.Game ...@@ -1804,7 +1862,7 @@ namespace WindBot.Game
int count = packet.ReadByte(); int count = packet.ReadByte();
int available = packet.ReadInt32(); int available = packet.ReadInt32();
int filter = 0x1; int filter = 0x1;
for (int i = 0; i < 23; ++i) for (int i = 0; i < 26; ++i)
{ {
if ((available & filter) != 0) if ((available & filter) != 0)
races.Add((CardRace)filter); races.Add((CardRace)filter);
...@@ -1940,5 +1998,22 @@ namespace WindBot.Game ...@@ -1940,5 +1998,22 @@ namespace WindBot.Game
} }
_duel.SummoningCards.Clear(); _duel.SummoningCards.Clear();
} }
private void OnConfirmCards(BinaryReader packet)
{
/*int playerid = */packet.ReadByte();
int count = packet.ReadByte();
for (int i = 0; i < count; ++ i)
{
int cardId = packet.ReadInt32();
int player = GetLocalPlayer(packet.ReadByte());
int loc = packet.ReadByte();
int seq = packet.ReadByte();
ClientCard card = _duel.GetCard(player, (CardLocation)loc, seq);
if (cardId > 0) card.SetId(cardId);
if (_debug)
Logger.WriteLine("(Confirm " + player.ToString() + "'s " + (CardLocation)loc + " card: " + (card.Name ?? "UnKnowCard") + ")");
}
}
} }
} }
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
<Compile Include="Game\AI\Decks\SalamangreatExecutor.cs" /> <Compile Include="Game\AI\Decks\SalamangreatExecutor.cs" />
<Compile Include="Game\AI\Decks\CyberDragonExecutor.cs" /> <Compile Include="Game\AI\Decks\CyberDragonExecutor.cs" />
<Compile Include="Game\AI\Decks\DarkMagicianExecutor.cs" /> <Compile Include="Game\AI\Decks\DarkMagicianExecutor.cs" />
<Compile Include="Game\AI\Decks\DogmatikaExecutor.cs" />
<Compile Include="Game\AI\Decks\OrcustExecutor.cs" /> <Compile Include="Game\AI\Decks\OrcustExecutor.cs" />
<Compile Include="Game\AI\Decks\SkyStrikerExecutor.cs" /> <Compile Include="Game\AI\Decks\SkyStrikerExecutor.cs" />
<Compile Include="Game\AI\Decks\MokeyMokeyKingExecutor.cs" /> <Compile Include="Game\AI\Decks\MokeyMokeyKingExecutor.cs" />
...@@ -102,10 +103,13 @@ ...@@ -102,10 +103,13 @@
<Compile Include="Game\AI\Decks\GraydleExecutor.cs" /> <Compile Include="Game\AI\Decks\GraydleExecutor.cs" />
<Compile Include="Game\AI\Decks\GrenMajuThunderBoarderExecutor.cs" /> <Compile Include="Game\AI\Decks\GrenMajuThunderBoarderExecutor.cs" />
<Compile Include="Game\AI\Decks\LightswornExecutor.cs" /> <Compile Include="Game\AI\Decks\LightswornExecutor.cs" />
<Compile Include="Game\AI\Decks\LabrynthExecutor.cs" />
<Compile Include="Game\AI\Decks\LightswornShaddoldinosourExecutor.cs" /> <Compile Include="Game\AI\Decks\LightswornShaddoldinosourExecutor.cs" />
<Compile Include="Game\AI\Decks\PhantasmExecutor.cs" /> <Compile Include="Game\AI\Decks\PhantasmExecutor.cs" />
<Compile Include="Game\AI\Decks\QliphortExecutor.cs" /> <Compile Include="Game\AI\Decks\QliphortExecutor.cs" />
<Compile Include="Game\AI\Decks\ST1732Executor.cs" /> <Compile Include="Game\AI\Decks\ST1732Executor.cs" />
<Compile Include="Game\AI\Decks\SuperheavySamuraiExecutor.cs" />
<Compile Include="Game\AI\Decks\SwordsoulExecutor.cs" />
<Compile Include="Game\AI\Decks\TrickstarExecutor.cs" /> <Compile Include="Game\AI\Decks\TrickstarExecutor.cs" />
<Compile Include="Game\AI\Decks\WitchcraftExecutor.cs" /> <Compile Include="Game\AI\Decks\WitchcraftExecutor.cs" />
<Compile Include="Game\AI\Decks\YosenjuExecutor.cs" /> <Compile Include="Game\AI\Decks\YosenjuExecutor.cs" />
...@@ -115,12 +119,15 @@ ...@@ -115,12 +119,15 @@
<Compile Include="Game\AI\Decks\DoEveryThingExecutor.cs" /> <Compile Include="Game\AI\Decks\DoEveryThingExecutor.cs" />
<Compile Include="Game\AI\Decks\OldSchoolExecutor.cs" /> <Compile Include="Game\AI\Decks\OldSchoolExecutor.cs" />
<Compile Include="Game\AI\Decks\Rank5Executor.cs" /> <Compile Include="Game\AI\Decks\Rank5Executor.cs" />
<Compile Include="Game\AI\Decks\ZefraExecutor.cs" />
<Compile Include="Game\AI\Decks\ZoodiacExecutor.cs" /> <Compile Include="Game\AI\Decks\ZoodiacExecutor.cs" />
<Compile Include="Game\AI\Decks\ZexalWeaponsExecutor.cs" /> <Compile Include="Game\AI\Decks\ZexalWeaponsExecutor.cs" />
<Compile Include="Game\AI\DefaultExecutor.cs" /> <Compile Include="Game\AI\DefaultExecutor.cs" />
<Compile Include="Game\AI\Dialogs.cs" /> <Compile Include="Game\AI\Dialogs.cs" />
<Compile Include="Game\AI\Enums\DangerousMonster.cs" /> <Compile Include="Game\AI\Enums\DangerousMonster.cs" />
<Compile Include="Game\AI\Enums\FusionSpell.cs" /> <Compile Include="Game\AI\Enums\FusionSpell.cs" />
<Compile Include="Game\AI\Enums\NotBeSynchroMaterialMonster.cs" />
<Compile Include="Game\AI\Enums\NotBeXyzMaterialMonster.cs" />
<Compile Include="Game\AI\Enums\ShouldBeDisabledBeforeItUseEffectMonster.cs" /> <Compile Include="Game\AI\Enums\ShouldBeDisabledBeforeItUseEffectMonster.cs" />
<Compile Include="Game\AI\Enums\ShouldNotBeSpellTarget.cs" /> <Compile Include="Game\AI\Enums\ShouldNotBeSpellTarget.cs" />
<Compile Include="Game\AI\Enums\ShouldNotBeMonsterTarget.cs" /> <Compile Include="Game\AI\Enums\ShouldNotBeMonsterTarget.cs" />
......
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