Commit bf22e2d0 authored by nanahira's avatar nanahira

mg

parents 8667065b f92f918b
using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace BotWrapper
{
class BotWrapper
{
[DllImport("User32.dll", CharSet = CharSet.Unicode)]
public static extern int MessageBox(IntPtr hWnd, string lpText, string lpCaption, int uType);
static void Main(string[] args)
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.UseShellExecute = false;
startInfo.WorkingDirectory = Path.GetFullPath("WindBot");
startInfo.FileName = startInfo.WorkingDirectory + "\\WindBot.exe";
if (args.Length == 3)
{
startInfo.CreateNoWindow = true;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
string arg = args[0].Replace("'","\"");
if (int.Parse(args[1]) == 1)
{
arg += " Hand=1";
}
arg += " Port=" + args[2];
startInfo.Arguments = arg;
}
try
{
Process.Start(startInfo);
}
catch
{
MessageBox((IntPtr)0, "WindBot can't be started!", "WindBot", 0x00000010); // MB_ICONERROR
}
}
}
}
using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Linq;
namespace BotWrapper
{
class BotWrapper
{
[DllImport("User32.dll", CharSet = CharSet.Unicode)]
public static extern int MessageBox(IntPtr hWnd, string lpText, string lpCaption, int uType);
const int MB_ICONERROR = 0x00000010;
static void Main(string[] args)
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.UseShellExecute = false;
startInfo.WorkingDirectory = Path.GetFullPath("WindBot");
startInfo.FileName = startInfo.WorkingDirectory + "\\WindBot.exe";
if (args.Length == 3)
{
startInfo.CreateNoWindow = true;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
string arg = args[0];
Match match = Regex.Match(arg, "Random=(.*)");
if (match.Success)
{
string randomFlag = match.Groups[1].Value;
ReadBots();
arg = GetRandomBot(randomFlag);
if (arg == "")
{
MessageBox((IntPtr)0, "Can't find random bot with this flag!\n\nA totally random bot will appear instead.", "WindBot", MB_ICONERROR);
}
}
arg = arg.Replace("'", "\"");
if (int.Parse(args[1]) == 1)
{
arg += " Hand=1";
}
arg += " Port=" + args[2];
startInfo.Arguments = arg;
}
try
{
Process.Start(startInfo);
}
catch
{
MessageBox((IntPtr)0, "WindBot can't be started!", "WindBot", MB_ICONERROR);
}
}
public class BotInfo
{
public string name;
public string command;
public string desc;
public string[] flags;
}
static public IList<BotInfo> Bots = new List<BotInfo>();
static void ReadBots()
{
using (StreamReader reader = new StreamReader("bot.conf"))
{
while (!reader.EndOfStream)
{
string line = reader.ReadLine().Trim();
if (line.Length > 0 && line[0] == '!')
{
BotInfo newBot = new BotInfo();
newBot.name = line;
newBot.command = reader.ReadLine().Trim();
newBot.desc = reader.ReadLine().Trim();
line = reader.ReadLine().Trim();
newBot.flags = line.Split(' ');
Bots.Add(newBot);
}
}
}
}
static string GetRandomBot(string flag)
{
IList<BotInfo> foundBots = Bots.Where(bot => bot.flags.Contains(flag)).ToList();
if (foundBots.Count > 0)
{
Random rand = new Random();
BotInfo bot = foundBots[rand.Next(foundBots.Count)];
return bot.command;
}
return "";
}
}
}
......@@ -4,25 +4,40 @@
# description
# flags (avail flags: SUPPORT_MASTER_RULE_3, SUPPORT_NEW_MASTER_RULE)
!随机-非常简单
Random=AI_LV1
主要是一些沙包。
SUPPORT_NEW_MASTER_RULE
!随机-简单
Random=AI_LV2
一些比较弱的卡组。
SUPPORT_NEW_MASTER_RULE
!随机-普通
Random=AI_LV3
一些环境里可以看到的卡组。
SUPPORT_NEW_MASTER_RULE
!谜之剑士LV4-龙骑星爆
Name=谜之剑士LV4 Deck=Dragunity Dialog=swordsman.zh-CN
龙骑轴星尘龙爆裂体卡组。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!谜之剑士LV4-R5
Name=谜之剑士LV4 Deck='Rank V' Dialog=swordsman.zh-CN
5阶超量卡组。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!谜之剑士LV4-异热同心武器
Name=谜之剑士LV4 Deck='Zexal Weapons' Dialog=swordsman.zh-CN
神装电光皇卡组。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!琪露诺-彩虹
Name=琪露诺 Deck=Rainbow Dialog=cirno.zh-CN
全属性凡骨卡组。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!琪露诺-饼蛙
Name=琪露诺 Deck='Toadally Awesome' Dialog=cirno.zh-CN
......@@ -32,7 +47,7 @@ SUPPORT_MASTER_RULE_3
!复制植物-青眼
Name=复制植物 Deck=Blue-Eyes Dialog=copy.zh-CN
青眼卡组。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!复制植物-十二兽
Name=复制植物 Deck=Zoodiac Dialog=copy.zh-CN
......@@ -42,17 +57,22 @@ SUPPORT_MASTER_RULE_3
!尼亚-妖仙兽
Name=尼亚 Deck=Yosenju Dialog=near.zh-CN
妖仙兽卡组。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!尼亚-机壳
Name=尼亚 Deck=Qliphort Dialog=near.zh-CN
机壳卡组。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!尼亚-淘气仙星
Name=尼亚 Deck=Trickstar Dialog=near.zh-CN
淘气仙星卡组。
SUPPORT_NEW_MASTER_RULE
AI_LV3 SUPPORT_NEW_MASTER_RULE
!尼亚-幻变骚灵
Name=尼亚 Deck=Altergeist Dialog=near.zh-CN
幻变骚灵卡组。
AI_LV3 SUPPORT_NEW_MASTER_RULE
!永远之魂-削血
Name=永远之魂 Deck=Burn Dialog=soul.zh-CN
......@@ -62,44 +82,59 @@ SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!永远之魂-青蛙
Name=永远之魂 Deck=Frog Dialog=soul.zh-CN
老式青蛙卡组。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
AI_LV1 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!永远之魂-荷鲁斯
Name=永远之魂 Deck=Horus Dialog=soul.zh-CN
老式龙族卡组。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
AI_LV1 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!悠悠
Name=悠悠 Deck=MokeyMokey Dialog=mokey.zh-CN
沙包。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
AI_LV1 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!悠悠王
Name=悠悠王 Deck=MokeyMokeyKing Dialog=mokey.zh-CN
大沙包。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
AI_LV1 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!试作型机器人1732
Name=试作型机器人1732 Deck=ST1732 Dialog=zh-CN
由三盒ST17和三盒SD32组成的卡组。
SUPPORT_NEW_MASTER_RULE
AI_LV2 SUPPORT_NEW_MASTER_RULE
!奇異果
Name=奇異果 Deck=LightswornShaddoldinosour Dialog=kiwi.zh-TW
光道影依恐龙卡组。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!奇魔果
Name=奇魔果 Deck=DarkMagician Dialog=kiwi.zh-TW
黑魔术师卡组。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!MAX龍果
Name=MAX龍果 Deck=BlueEyesMaxDragon Dialog=kiwi.zh-TW
青眼混沌极龙卡组。
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!幻煌果
Name=幻煌果 Deck=Phantasm Dialog=kiwi.zh-TW
幻煌龙卡组。
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!燃血鬥士
Name=燃血鬥士 Deck=ChainBurn Dialog=kiwi.zh-TW
连锁烧卡组。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!報社鬥士
Name=報社鬥士 Deck=GrenMajuThunderBoarder Dialog=kiwi.zh-TW
红莲雷王滑板卡组。
AI_LV3 SUPPORT_NEW_MASTER_RULE
!复制梁龙-闪刀姬
Name=复制梁龙 Deck=SkyStriker Dialog=anothercopy.zh-CN
纯闪刀姬卡组。
SUPPORT_NEW_MASTER_RULE
AI_LV3 SUPPORT_NEW_MASTER_RULE
#created by ...
#main
52927340
53143898
53143898
53143898
42790071
42790071
14558127
14558127
59438930
62015408
62015408
89538537
89538537
23434538
23434538
23434538
25533642
25533642
25533642
2295440
18144506
35261759
68462976
68462976
10045474
10045474
10045474
10813327
23924608
35146019
35146019
27541563
27541563
53936268
53936268
53936268
61740673
40605147
40605147
41420027
41420027
#extra
99916754
86221741
85289965
5043010
49725936
24094258
59934749
1508649
1508649
1508649
50588353
63288573
90673288
41999284
94259633
!side
#created by ...
#main
89631139
55410871
89631139
80701178
31036355
38517737
80701178
80701178
95492061
95492061
95492061
53303460
53303460
53303460
14558127
14558127
23434538
55410871
55410871
31036355
31036355
48800175
48800175
48800175
70368879
70368879
70368879
21082832
46052429
46052429
46052429
24224830
24224830
24224830
73915051
10045474
10045474
37576645
37576645
37576645
#extra
31833038
85289965
74997493
5043010
65330383
38342335
2857636
28776350
75452921
3987233
3987233
99111753
98978921
41999284
41999284
!side
75732622
15397015
15397015
73642296
23434538
5821478
77058170
3679218
25774450
43898403
23002292
23002292
84749824
84749824
#created by ...
#main
15397015
15397015
15397015
71564252
71564252
71564252
14558127
14558127
36584821
36584821
36584821
23434538
23434538
63845230
63845230
63845230
18144506
35261759
35261759
35261759
59750328
59750328
98645731
98645731
98645731
73915051
73915051
10045474
10045474
10813327
15693423
23924608
47475363
47475363
30241314
30241314
58921041
58921041
61740673
61936647
69452756
40605147
40605147
77538567
77538567
#extra
86221741
31833038
85289965
5043010
30194529
38342335
2857636
24094258
50588353
3987233
3987233
63288573
98978921
41999284
41999284
!side
10000080
86937530
62015408
9742784
70368879
19508728
10045474
15693423
24207889
69452756
23002292
41420027
41420027
#created by ...
#main
81823360
81823360
81823360
14558127
14558127
63845230
18144506
35261759
35261759
47325505
47325505
59750328
59750328
59750328
73628505
98645731
98645731
98645731
73915051
73915051
2819435
2819435
2819435
10045474
34302287
34302287
34302287
47475363
58120309
61397885
61397885
89208725
89208725
19089195
19089195
19089195
53334471
53334471
82732705
99188141
#extra
44508094
5821478
31833038
85289965
65330383
72529749
61665245
38342335
2857636
75452921
50588353
3987233
98978921
41999284
41999284
!side
24094258
47475363
61397885
30241314
30241314
82732705
This diff is collapsed.
using System.Collections.Generic;
using YGOSharp.OCGWrapper.Enums;
using System;
using System.Linq;
namespace WindBot.Game.AI
......@@ -8,175 +9,90 @@ namespace WindBot.Game.AI
{
public static ClientCard GetHighestAttackMonster(this IEnumerable<ClientCard> cards, bool canBeTarget = false)
{
int highestAtk = 0;
ClientCard selected = null;
foreach (ClientCard card in cards)
{
if (card == null || card.Data == null || card.IsFacedown() || (canBeTarget && card.IsShouldNotBeTarget())) continue;
if (card.HasType(CardType.Monster) && card.Attack > highestAtk)
{
highestAtk = card.Attack;
selected = card;
}
}
return selected;
return cards
.Where(card => card?.Data != null && card.HasType(CardType.Monster) && card.IsFaceup() && !(canBeTarget && card.IsShouldNotBeTarget()))
.OrderBy(card => card.Attack).FirstOrDefault();
}
public static ClientCard GetHighestDefenseMonster(this IEnumerable<ClientCard> cards, bool canBeTarget = false)
{
int highestDef = 0;
ClientCard selected = null;
foreach (ClientCard card in cards)
{
if (card == null || card.Data == null || card.IsFacedown() || (canBeTarget && card.IsShouldNotBeTarget())) continue;
if (card.HasType(CardType.Monster) && card.Defense > highestDef)
{
highestDef = card.Defense;
selected = card;
}
}
return selected;
return cards
.Where(card => card?.Data != null && card.HasType(CardType.Monster) && card.IsFaceup() && !(canBeTarget && card.IsShouldNotBeTarget()))
.OrderBy(card => card.Defense).FirstOrDefault();
}
public static ClientCard GetLowestAttackMonster(this IEnumerable<ClientCard> cards, bool canBeTarget = false)
{
int lowestAtk = 0;
ClientCard selected = null;
foreach (ClientCard card in cards)
{
if (card == null || card.Data == null || card.IsFacedown() || (canBeTarget && card.IsShouldNotBeTarget())) continue;
if (lowestAtk == 0 && card.HasType(CardType.Monster) ||
card.HasType(CardType.Monster) && card.Attack < lowestAtk)
{
lowestAtk = card.Attack;
selected = card;
}
}
return selected;
return cards
.Where(card => card?.Data != null && card.HasType(CardType.Monster) && card.IsFaceup() && !(canBeTarget && card.IsShouldNotBeTarget()))
.OrderByDescending(card => card.Attack).FirstOrDefault();
}
public static ClientCard GetLowestDefenseMonster(this IEnumerable<ClientCard> cards, bool canBeTarget = false)
{
int lowestDef = 0;
ClientCard selected = null;
foreach (ClientCard card in cards)
{
if (card == null || card.Data == null || card.IsFacedown() || (canBeTarget && card.IsShouldNotBeTarget())) continue;
if (lowestDef == 0 && card.HasType(CardType.Monster) ||
card.HasType(CardType.Monster) && card.Defense < lowestDef)
{
lowestDef = card.Defense;
selected = card;
}
}
return selected;
return cards
.Where(card => card?.Data != null && card.HasType(CardType.Monster) && card.IsFaceup() && !(canBeTarget && card.IsShouldNotBeTarget()))
.OrderByDescending(card => card.Defense).FirstOrDefault();
}
public static bool ContainsMonsterWithLevel(this IEnumerable<ClientCard> cards, int level)
{
foreach (ClientCard card in cards)
{
if (card == null)
continue;
if (!card.HasType(CardType.Xyz) && card.Level == level)
return true;
}
return false;
return cards.Where(card => card?.Data != null).Any(card => !card.HasType(CardType.Xyz) && card.Level == level);
}
public static bool ContainsMonsterWithRank(this IEnumerable<ClientCard> cards, int rank)
{
foreach (ClientCard card in cards)
{
if (card == null)
continue;
if (card.HasType(CardType.Xyz) && card.Rank == rank)
return true;
}
return false;
return cards.Where(card => card?.Data != null).Any(card => card.HasType(CardType.Xyz) && card.Rank == rank);
}
public static bool ContainsCardWithId(this IEnumerable<ClientCard> cards, int id)
{
foreach (ClientCard card in cards)
{
if (card == null)
continue;
if (card.Id == id)
return true;
}
return false;
return cards.Where(card => card?.Data != null).Any(card => card.IsCode(id));
}
public static int GetCardCount(this IEnumerable<ClientCard> cards, int id)
{
int count = 0;
foreach (ClientCard card in cards)
{
if (card == null)
continue;
if (card.Id == id)
count++;
}
return count;
return cards.Where(card => card?.Data != null).Count(card => card.IsCode(id));
}
public static List<ClientCard> GetMonsters(this IEnumerable<ClientCard> cards)
{
List<ClientCard> cardlist = new List<ClientCard>();
foreach (ClientCard card in cards)
{
if (card == null)
continue;
if (card.HasType(CardType.Monster))
cardlist.Add(card);
}
return cardlist;
return cards.Where(card => card?.Data != null && card.HasType(CardType.Monster)).ToList();
}
public static List<ClientCard> GetFaceupPendulumMonsters(this IEnumerable<ClientCard> cards)
{
List<ClientCard> cardlist = new List<ClientCard>();
foreach (ClientCard card in cards)
{
if (card == null)
continue;
if (card.HasType(CardType.Monster) && card.IsFaceup() && card.HasType(CardType.Pendulum))
cardlist.Add(card);
}
return cardlist;
return cards.Where(card => card?.Data != null && card.HasType(CardType.Monster) && card.IsFaceup() && card.HasType(CardType.Pendulum)).ToList();
}
public static ClientCard GetInvincibleMonster(this IEnumerable<ClientCard> cards, bool canBeTarget = false)
{
foreach (ClientCard card in cards)
{
if (card != null && card.IsMonsterInvincible() && card.IsFaceup() && (!canBeTarget || !card.IsShouldNotBeTarget()))
return card;
}
return null;
return cards.FirstOrDefault(card => card?.Data != null && card.IsMonsterInvincible() && card.IsFaceup() && (!canBeTarget || !card.IsShouldNotBeTarget()));
}
public static ClientCard GetDangerousMonster(this IEnumerable<ClientCard> cards, bool canBeTarget = false)
{
foreach (ClientCard card in cards)
{
if (card != null && card.IsMonsterDangerous() && card.IsFaceup() && (!canBeTarget || !card.IsShouldNotBeTarget()))
return card;
}
return null;
return cards.FirstOrDefault(card => card?.Data != null && card.IsMonsterDangerous() && card.IsFaceup() && (!canBeTarget || !card.IsShouldNotBeTarget()));
}
public static ClientCard GetFloodgate(this IEnumerable<ClientCard> cards, bool canBeTarget = false)
{
foreach (ClientCard card in cards)
{
if (card != null && card.IsFloodgate() && card.IsFaceup() && (!canBeTarget || !card.IsShouldNotBeTarget()))
return card;
}
return null;
return cards.FirstOrDefault(card => card?.Data != null && card.IsFloodgate() && card.IsFaceup() && (!canBeTarget || !card.IsShouldNotBeTarget()));
}
public static ClientCard GetFirstMatchingCard(this IEnumerable<ClientCard> cards, Func<ClientCard, bool> filter)
{
return cards.FirstOrDefault(card => card?.Data != null && filter.Invoke(card));
}
public static ClientCard GetFirstMatchingFaceupCard(this IEnumerable<ClientCard> cards, Func<ClientCard, bool> filter)
{
return cards.FirstOrDefault(card => card?.Data != null && card.IsFaceup() && filter.Invoke(card));
}
public static ClientCard GetShouldBeDisabledBeforeItUseEffectMonster(this IEnumerable<ClientCard> cards, bool canBeTarget = true)
{
return cards.FirstOrDefault(card => card?.Data != null && card.IsMonsterShouldBeDisabledBeforeItUseEffect() && card.IsFaceup() && (!canBeTarget || !card.IsShouldNotBeTarget()));
}
public static IEnumerable<IEnumerable<T>> GetCombinations<T>(this IEnumerable<T> elements, int k)
......
......@@ -63,18 +63,18 @@ namespace WindBot.Game.AI
break;
case SelectType.Cards:
foreach (ClientCard card in _cards)
if (cards.Contains(card))
if (cards.Contains(card) && !result.Contains(card))
result.Add(card);
break;
case SelectType.Id:
foreach (ClientCard card in cards)
if (card.Id == _id)
if (card.IsCode(_id))
result.Add(card);
break;
case SelectType.Ids:
foreach (int id in _ids)
foreach (ClientCard card in cards)
if (card.Id == id)
if (card.IsCode(id) && !result.Contains(card))
result.Add(card);
break;
case SelectType.Location:
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -111,7 +111,7 @@ namespace WindBot.Game.AI.Decks
{
List<ClientCard> monster = Bot.GetMonsters();
foreach (ClientCard card in monster)
if (card != null && card.Id == CardId.KrisTheCrackOfDawn || card.Id == CardId.KalutTheMoonShadow || card.Id == CardId.GaleTheWhirlwind || card.Id == CardId.BoraTheSpear || card.Id == CardId.SiroccoTheDawn || card.Id == CardId.ShuraTheBlueFlame || card.Id == CardId.BlizzardTheFarNorth)
if (card != null && card.IsCode(CardId.KrisTheCrackOfDawn, CardId.KalutTheMoonShadow, CardId.GaleTheWhirlwind, CardId.BoraTheSpear, CardId.SiroccoTheDawn, CardId.ShuraTheBlueFlame, CardId.BlizzardTheFarNorth))
return true;
return false;
}
......@@ -119,7 +119,7 @@ namespace WindBot.Game.AI.Decks
private bool KalutTheMoonShadowSummon()
{
foreach (ClientCard card in Bot.Hand)
if (card != null && card.Id == CardId.KrisTheCrackOfDawn || card.Id == CardId.GaleTheWhirlwind || card.Id == CardId.BoraTheSpear || card.Id == CardId.SiroccoTheDawn || card.Id == CardId.ShuraTheBlueFlame || card.Id == CardId.BlizzardTheFarNorth)
if (card != null && card.IsCode(CardId.KrisTheCrackOfDawn, CardId.GaleTheWhirlwind, CardId.BoraTheSpear, CardId.SiroccoTheDawn, CardId.ShuraTheBlueFlame, CardId.BlizzardTheFarNorth))
return false;
return true;
}
......@@ -127,7 +127,7 @@ namespace WindBot.Game.AI.Decks
private bool BlizzardTheFarNorthSummon()
{
foreach (ClientCard card in Bot.Graveyard)
if (card != null && card.Id == CardId.KalutTheMoonShadow || card.Id == CardId.BoraTheSpear || card.Id == CardId.ShuraTheBlueFlame || card.Id == CardId.KrisTheCrackOfDawn)
if (card != null && card.IsCode(CardId.KalutTheMoonShadow, CardId.BoraTheSpear, CardId.ShuraTheBlueFlame, CardId.KrisTheCrackOfDawn))
return true;
return false;
}
......@@ -138,7 +138,7 @@ namespace WindBot.Game.AI.Decks
List<ClientCard> monster = Bot.GetMonsters();
foreach (ClientCard card in monster)
if (card != null && card.Id == CardId.KrisTheCrackOfDawn || card.Id == CardId.KalutTheMoonShadow || card.Id == CardId.GaleTheWhirlwind || card.Id == CardId.BoraTheSpear || card.Id == CardId.SiroccoTheDawn || card.Id == CardId.ShuraTheBlueFlame || card.Id == CardId.BlizzardTheFarNorth)
if (card != null && card.IsCode(CardId.KrisTheCrackOfDawn, CardId.KalutTheMoonShadow, CardId.GaleTheWhirlwind, CardId.BoraTheSpear, CardId.SiroccoTheDawn, CardId.ShuraTheBlueFlame, CardId.BlizzardTheFarNorth))
Count++;
if (Count == 3)
......
using YGOSharp.OCGWrapper.Enums;
using System.Collections.Generic;
using System.Linq;
using WindBot;
using WindBot.Game;
using WindBot.Game.AI;
......@@ -138,27 +139,11 @@ namespace WindBot.Game.AI.Decks
if (max == 2 && cards[0].Location == CardLocation.Deck)
{
Logger.DebugWriteLine("OnSelectCard MelodyOfAwakeningDragon");
IList<ClientCard> result = new List<ClientCard>();
List<ClientCard> result = new List<ClientCard>();
if (!Bot.HasInHand(CardId.WhiteDragon))
{
foreach (ClientCard card in cards)
{
if (card.Id == CardId.WhiteDragon)
{
result.Add(card);
break;
}
}
}
foreach (ClientCard card in cards)
{
if (card.Id == CardId.AlternativeWhiteDragon && result.Count < max)
{
result.Add(card);
}
}
AI.Utils.CheckSelectCount(result, cards, min, max);
return result;
result.AddRange(cards.Where(card => card.IsCode(CardId.WhiteDragon)).Take(1));
result.AddRange(cards.Where(card => card.IsCode(CardId.AlternativeWhiteDragon)));
return AI.Utils.CheckSelectCount(result, cards, min, max);
}
Logger.DebugWriteLine("Use default.");
return null;
......@@ -167,10 +152,8 @@ namespace WindBot.Game.AI.Decks
public override IList<ClientCard> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max)
{
Logger.DebugWriteLine("OnSelectXyzMaterial " + cards.Count + " " + min + " " + max);
IList<ClientCard> result = new List<ClientCard>();
AI.Utils.SelectPreferredCards(result, UsedAlternativeWhiteDragon, cards, min, max);
AI.Utils.CheckSelectCount(result, cards, min, max);
return result;
IList<ClientCard> result = AI.Utils.SelectPreferredCards(UsedAlternativeWhiteDragon, cards, min, max);
return AI.Utils.CheckSelectCount(result, cards, min, max);
}
public override IList<ClientCard> OnSelectSynchroMaterial(IList<ClientCard> cards, int sum, int min, int max)
......@@ -194,41 +177,38 @@ namespace WindBot.Game.AI.Decks
private bool DragonShrineEffect()
{
AI.SelectCard(new[]
{
CardId.DragonSpiritOfWhite,
CardId.WhiteDragon,
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend
});
AI.SelectCard(
CardId.DragonSpiritOfWhite,
CardId.WhiteDragon,
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend
);
if (!Bot.HasInHand(CardId.WhiteDragon))
{
AI.SelectNextCard(CardId.WhiteStoneOfLegend);
}
else
{
AI.SelectNextCard(new[]
{
AI.SelectNextCard(
CardId.WhiteStoneOfAncients,
CardId.DragonSpiritOfWhite,
CardId.WhiteStoneOfLegend
});
);
}
return true;
}
private bool MelodyOfAwakeningDragonEffect()
{
AI.SelectCard(new[]
{
CardId.WhiteStoneOfAncients,
CardId.DragonSpiritOfWhite,
CardId.WhiteStoneOfLegend,
CardId.GalaxyCyclone,
CardId.EffectVeiler,
CardId.TradeIn,
CardId.SageWithEyesOfBlue
});
AI.SelectCard(
CardId.WhiteStoneOfAncients,
CardId.DragonSpiritOfWhite,
CardId.WhiteStoneOfLegend,
CardId.GalaxyCyclone,
CardId.EffectVeiler,
CardId.TradeIn,
CardId.SageWithEyesOfBlue
);
return true;
}
......@@ -268,11 +248,7 @@ namespace WindBot.Game.AI.Decks
}
else if (!Bot.HasInHand(CardId.WhiteDragon) || !Bot.HasInHand(CardId.AlternativeWhiteDragon))
{
AI.SelectCard(new[]
{
CardId.WhiteDragon,
CardId.AlternativeWhiteDragon
});
AI.SelectCard(CardId.WhiteDragon, CardId.AlternativeWhiteDragon);
return true;
}
else
......@@ -365,12 +341,11 @@ namespace WindBot.Game.AI.Decks
{
return false;
}
AI.SelectCard(new[]
{
CardId.WhiteStoneOfAncients,
CardId.EffectVeiler,
CardId.WhiteStoneOfLegend
});
AI.SelectCard(
CardId.WhiteStoneOfAncients,
CardId.EffectVeiler,
CardId.WhiteStoneOfLegend
);
return true;
}
......@@ -398,11 +373,7 @@ namespace WindBot.Game.AI.Decks
{
return false;
}
AI.SelectCard(new[]
{
CardId.WhiteStoneOfLegend,
CardId.WhiteStoneOfAncients
});
AI.SelectCard(CardId.WhiteStoneOfLegend, CardId.WhiteStoneOfAncients);
if (Enemy.GetSpellCount() > 0)
{
AI.SelectNextCard(CardId.DragonSpiritOfWhite);
......@@ -747,20 +718,18 @@ namespace WindBot.Game.AI.Decks
private bool GalaxyEyesDarkMatterDragonEffect()
{
AI.SelectCard(new[]
{
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend,
CardId.DragonSpiritOfWhite,
CardId.WhiteDragon
});
AI.SelectNextCard(new[]
{
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend,
CardId.DragonSpiritOfWhite,
CardId.WhiteDragon
});
AI.SelectCard(
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend,
CardId.DragonSpiritOfWhite,
CardId.WhiteDragon
);
AI.SelectNextCard(
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend,
CardId.DragonSpiritOfWhite,
CardId.WhiteDragon
);
return true;
}
......@@ -839,11 +808,7 @@ namespace WindBot.Game.AI.Decks
private bool SylvanPrincesspriteEffect()
{
AI.SelectCard(new[]
{
CardId.WhiteStoneOfLegend,
CardId.WhiteStoneOfAncients
});
AI.SelectCard(CardId.WhiteStoneOfLegend, CardId.WhiteStoneOfAncients);
return true;
}
......@@ -875,17 +840,16 @@ namespace WindBot.Game.AI.Decks
if (attack - defence > Enemy.LifePoints)
return false;
}
AI.SelectCard(new[]
{
CardId.BlueEyesSpiritDragon,
CardId.HopeHarbingerDragonTitanicGalaxy,
CardId.AlternativeWhiteDragon,
CardId.WhiteDragon,
CardId.DragonSpiritOfWhite,
CardId.AzureEyesSilverDragon,
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend
});
AI.SelectCard(
CardId.BlueEyesSpiritDragon,
CardId.HopeHarbingerDragonTitanicGalaxy,
CardId.AlternativeWhiteDragon,
CardId.WhiteDragon,
CardId.DragonSpiritOfWhite,
CardId.AzureEyesSilverDragon,
CardId.WhiteStoneOfAncients,
CardId.WhiteStoneOfLegend
);
SoulChargeUsed = true;
return true;
}
......@@ -900,23 +864,16 @@ namespace WindBot.Game.AI.Decks
return true;
if (Card.IsDefense() && !enemyBetter && Card.Attack >= Card.Defense)
return true;
if (Card.IsDefense() && (
Card.Id == CardId.BlueEyesSpiritDragon
|| Card.Id == CardId.AzureEyesSilverDragon
))
if (Card.IsDefense() && Card.IsCode(CardId.BlueEyesSpiritDragon, CardId.AzureEyesSilverDragon))
return true;
if (Card.IsAttack() && (
Card.Id == CardId.SageWithEyesOfBlue
|| Card.Id == CardId.WhiteStoneOfAncients
|| Card.Id == CardId.WhiteStoneOfLegend
))
if (Card.IsAttack() && Card.IsCode(CardId.SageWithEyesOfBlue, CardId.WhiteStoneOfAncients, CardId.WhiteStoneOfLegend))
return true;
return false;
}
private bool SpellSet()
{
return (Card.IsTrap() || (Card.Id==CardId.SilversCry)) && Bot.GetSpellCountWithoutField() < 4;
return (Card.IsTrap() || Card.IsCode(CardId.SilversCry)) && Bot.GetSpellCountWithoutField() < 4;
}
private bool HasTwoInHand(int id)
......@@ -924,7 +881,7 @@ namespace WindBot.Game.AI.Decks
int num = 0;
foreach (ClientCard card in Bot.Hand)
{
if (card != null && card.Id == id)
if (card != null && card.IsCode(id))
num++;
}
return num >= 2;
......
This diff is collapsed.
......@@ -108,7 +108,7 @@ namespace WindBot.Game.AI.Decks
{
foreach (ClientCard card in Bot.GetMonsters())
{
if (card.Id == CardId.Marshmallon || card.Id == CardId.SpiritReaper)
if (card.IsCode(CardId.Marshmallon, CardId.SpiritReaper))
{
return false;
}
......@@ -134,9 +134,9 @@ namespace WindBot.Game.AI.Decks
private bool ReposEverything()
{
if (Card.Id == CardId.ReflectBounder)
if (Card.IsCode(CardId.ReflectBounder))
return Card.IsDefense();
if (Card.Id == CardId.FencingFireFerret)
if (Card.IsCode(CardId.FencingFireFerret))
return DefaultMonsterRepos();
if (Card.IsAttack())
return true;
......
......@@ -227,7 +227,7 @@ namespace WindBot.Game.AI.Decks
{
return (id == CardId.SandaionTheTimelord ||
id == CardId.BattleFader ||
id ==CardId.MichionTimelord
id == CardId.MichionTimelord
);
}
bool no_sp = false;
......@@ -322,49 +322,49 @@ namespace WindBot.Game.AI.Decks
IList<ClientCard> check = Bot.GetSpells();
foreach (ClientCard card in check)
{
if (card.Id == CardId.AccuulatedFortune)
if (card.IsCode(CardId.AccuulatedFortune))
HasAccuulatedFortune++;
}
foreach (ClientCard card in check)
{
if (card.Id == CardId.SecretBlast)
if (card.IsCode(CardId.SecretBlast))
blast_count++;
}
foreach (ClientCard card in check)
{
if (card.Id == CardId.SectetBarrel)
if (card.IsCode(CardId.SectetBarrel))
barrel_count++;
}
foreach (ClientCard card in check)
{
if (card.Id == CardId.JustDesserts)
if (card.IsCode(CardId.JustDesserts))
just_count++;
}
foreach (ClientCard card in check)
{
if (card.Id == CardId.ChainStrike)
if (card.IsCode(CardId.ChainStrike))
strike_count++;
}
foreach (ClientCard card in Bot.GetSpells())
{
if (card.Id == CardId.RecklessGreed)
if (card.IsCode(CardId.RecklessGreed))
greed_count++;
}
foreach (ClientCard card in check)
{
if (card.Id == CardId.Waboku)
if (card.IsCode(CardId.Waboku))
Waboku_count++;
}
foreach (ClientCard card in check)
{
if (card.Id == CardId.ThreateningRoar)
if (card.IsCode(CardId.ThreateningRoar))
Roar_count++;
}
......@@ -418,7 +418,7 @@ namespace WindBot.Game.AI.Decks
if (AI.Utils.IsChainTarget(Card)) return true;
foreach (ClientCard card in Enemy.GetSpells())
{
if (card.Id == CardId.HarpiesFeatherDuster&&card.IsFaceup())
if (card.IsCode(CardId.HarpiesFeatherDuster)&&card.IsFaceup())
{
return true;
}
......@@ -432,7 +432,7 @@ namespace WindBot.Game.AI.Decks
}
private bool BrunSpellSet()
{
if (Card.Id == CardId.OjamaTrio && Bot.HasInSpellZone(CardId.OjamaTrio))return false;
if (Card.IsCode(CardId.OjamaTrio) && Bot.HasInSpellZone(CardId.OjamaTrio))return false;
return (Card.IsTrap() || Card.HasType(CardType.QuickPlay)) && Bot.GetSpellCountWithoutField() < 5;
}
private bool MichionTimelordsummon()
......@@ -565,7 +565,7 @@ namespace WindBot.Game.AI.Decks
int count=0;
foreach (ClientCard card in Bot.GetSpells())
{
if (card.Id == CardId.RecklessGreed)
if (card.IsCode(CardId.RecklessGreed))
count++;
}
......@@ -668,7 +668,7 @@ namespace WindBot.Game.AI.Decks
{
foreach (ClientCard card in Bot.GetMonsters())
{
if (card.Id == CardId.CardcarD && card.IsFaceup())
if (card.IsCode(CardId.CardcarD) && card.IsFaceup())
return false;
}
if (Bot.GetHandCount() == 1 && Bot.GetSpellCountWithoutField() <= 3)
......@@ -694,7 +694,7 @@ namespace WindBot.Game.AI.Decks
foreach (ClientCard card in Bot.GetMonsters())
{
if (card.Id == CardId.DiceJar && card.IsFacedown())
if (card.IsCode(CardId.DiceJar) && card.IsFacedown())
return true;
break;
}
......@@ -725,24 +725,24 @@ namespace WindBot.Game.AI.Decks
if (GetTotalATK(newlist) / 2 >= Enemy.LifePoints && Bot.HasInSpellZone(CardId.BlazingMirrorForce))
return false;
if (AI.Utils.GetLastChainCard() == null) return true;
if (AI.Utils.GetLastChainCard().Id == CardId.Linkuriboh) return false;
if (AI.Utils.GetLastChainCard().IsCode(CardId.Linkuriboh)) return false;
return true;
}
public bool MonsterRepos()
{
if (Card.IsFacedown() && Card.Id!=CardId.DiceJar)
if (Card.IsFacedown() && !Card.IsCode(CardId.DiceJar))
return true;
return base.DefaultMonsterRepos();
}
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
if (attacker.Id == CardId.Linkuriboh && defender.IsFacedown()) return false;
if (attacker.Id == CardId.SandaionTheTimelord && !attacker.IsDisabled())
if (attacker.IsCode(CardId.Linkuriboh) && defender.IsFacedown()) return false;
if (attacker.IsCode(CardId.SandaionTheTimelord) && !attacker.IsDisabled())
{
attacker.RealPower = 9999;
return true;
}
if(attacker.Id==CardId.MichionTimelord && !attacker.IsDisabled())
if(attacker.IsCode(CardId.MichionTimelord) && !attacker.IsDisabled())
{
attacker.RealPower = 9999;
return true;
......@@ -771,49 +771,49 @@ namespace WindBot.Game.AI.Decks
IList<ClientCard> check = Bot.GetSpells();
foreach (ClientCard card1 in check)
{
if (card1.Id == CardId.AccuulatedFortune)
if (card1.IsCode(CardId.AccuulatedFortune))
HasAccuulatedFortune++;
}
foreach (ClientCard card1 in check)
{
if (card1.Id == CardId.SecretBlast)
if (card1.IsCode(CardId.SecretBlast))
blast_count++;
}
foreach (ClientCard card1 in check)
{
if (card1.Id == CardId.SectetBarrel)
if (card1.IsCode(CardId.SectetBarrel))
barrel_count++;
}
foreach (ClientCard card1 in check)
{
if (card1.Id == CardId.JustDesserts)
if (card1.IsCode(CardId.JustDesserts))
just_count++;
}
foreach (ClientCard card1 in check)
{
if (card1.Id == CardId.ChainStrike)
if (card1.IsCode(CardId.ChainStrike))
strike_count++;
}
foreach (ClientCard card1 in Bot.GetSpells())
{
if (card1.Id == CardId.RecklessGreed)
if (card1.IsCode(CardId.RecklessGreed))
greed_count++;
}
foreach (ClientCard card1 in check)
{
if (card1.Id == CardId.Waboku)
if (card1.IsCode(CardId.Waboku))
Waboku_count++;
}
foreach (ClientCard card1 in check)
{
if (card1.Id == CardId.ThreateningRoar)
if (card1.IsCode(CardId.ThreateningRoar))
Roar_count++;
}
......
This diff is collapsed.
......@@ -136,7 +136,7 @@ namespace WindBot.Game.AI.Decks
int count = 0;
foreach (ClientCard card in Bot.Hand)
{
if (card.Id == CardId.DragunityDux)
if (card.IsCode(CardId.DragunityDux))
++count;
}
if (count >= 2)
......@@ -164,7 +164,7 @@ namespace WindBot.Game.AI.Decks
/*bool hasRealMonster = false;
foreach (ClientCard card in Bot.GetMonsters())
{
if (card.Id != CardId.AssaultBeast)
if (!card.IsCode(CardId.AssaultBeast))
{
hasRealMonster = true;
break;
......@@ -184,13 +184,13 @@ namespace WindBot.Game.AI.Decks
int remaining = 3;
foreach (ClientCard card in Bot.Hand)
if (card.Id == needId)
if (card.IsCode(needId))
remaining--;
foreach (ClientCard card in Bot.Graveyard)
if (card.Id == needId)
if (card.IsCode(needId))
remaining--;
foreach (ClientCard card in Bot.Banished)
if (card.Id == needId)
if (card.IsCode(needId))
remaining--;
if (remaining <= 0)
return false;
......@@ -243,12 +243,11 @@ namespace WindBot.Game.AI.Decks
private bool FoolishBurial()
{
AI.SelectCard(new[]
{
AI.SelectCard(
CardId.DragunityPhalanx,
CardId.AssaultBeast,
CardId.StardustDragonAssaultMode
});
);
return true;
}
......@@ -262,8 +261,7 @@ namespace WindBot.Game.AI.Decks
ClientCard card = cards[i];
if (card.Attack < 2000)
break;
if (card.Id == (int) CardId.StardustDragonAssaultMode ||
card.Id == (int) CardId.FiveHeadedDragon)
if (card.IsCode(CardId.StardustDragonAssaultMode, CardId.FiveHeadedDragon))
continue;
if (card.IsMonster())
{
......@@ -298,7 +296,7 @@ namespace WindBot.Game.AI.Decks
int phalanxCount = 0;
foreach (ClientCard card in Bot.Graveyard)
{
if (card.Id == (int) CardId.DragunityPhalanx)
if (card.IsCode(CardId.DragunityPhalanx))
{
phalanxCount++;
break;
......@@ -315,7 +313,7 @@ namespace WindBot.Game.AI.Decks
{
foreach (ClientCard card in Bot.Graveyard)
{
if (card.Id == (int) CardId.DragunityPhalanx)
if (card.IsCode(CardId.DragunityPhalanx))
{
phalanxCount--;
tributes.Add(card);
......@@ -382,9 +380,7 @@ namespace WindBot.Game.AI.Decks
if (destroyCard == null)
return false;
if (tributeId != -1)
AI.SelectCard(tributeId);
AI.SelectCard(tributeId);
AI.SelectNextCard(destroyCard);
return true;
......@@ -464,7 +460,7 @@ namespace WindBot.Game.AI.Decks
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (monster.Id == CardId.StardustDragon && monster.Attacked)
if (monster.IsCode(CardId.StardustDragon) && monster.Attacked)
{
AI.SelectCard(monster);
return true;
......
......@@ -147,7 +147,7 @@ namespace WindBot.Game.AI.Decks
if (AI.Utils.IsOneEnemyBetterThanValue(atk, true))
return false;
if (Card.Id == CardId.SwapFrog)
if (Card.IsCode(CardId.SwapFrog))
m_swapFrogSummoned = Duel.Turn;
return true;
}
......@@ -200,7 +200,7 @@ namespace WindBot.Game.AI.Decks
List<ClientCard> spells = Bot.GetSpells();
foreach (ClientCard spell in spells)
{
if (spell.Id == CardId.GravityBind && !spell.IsFacedown())
if (spell.IsCode(CardId.GravityBind) && !spell.IsFacedown())
return false;
}
return true;
......@@ -208,9 +208,9 @@ namespace WindBot.Game.AI.Decks
private bool FrogMonsterRepos()
{
if (Card.Id == CardId.Unifrog)
if (Card.IsCode(CardId.Unifrog))
return Card.IsDefense();
if (Card.Id == CardId.DewdarkOfTheIceBarrier)
if (Card.IsCode(CardId.DewdarkOfTheIceBarrier))
return Card.IsDefense();
bool enemyBetter = AI.Utils.IsOneEnemyBetterThanValue(Card.Attack + (Card.IsFacedown() ? GetSpellBonus() : 0), true);
......@@ -222,10 +222,10 @@ namespace WindBot.Game.AI.Decks
if (Card.IsDefense() && !enemyBetter)
result = true;
if (!result && Card.Id == CardId.FlipFlopFrog && Enemy.GetMonsterCount() > 0 && Card.IsFacedown())
if (!result && Card.IsCode(CardId.FlipFlopFrog) && Enemy.GetMonsterCount() > 0 && Card.IsFacedown())
result = true;
if (Card.Id == CardId.FlipFlopFrog && Card.IsFacedown() && result)
if (Card.IsCode(CardId.FlipFlopFrog) && Card.IsFacedown() && result)
m_flipFlopFrogSummoned = Duel.Turn;
return result;
......@@ -242,7 +242,7 @@ namespace WindBot.Game.AI.Decks
{
foreach (ClientCard card in Bot.GetSpells())
{
if (card.Id == CardId.Solidarity)
if (card.IsCode(CardId.Solidarity))
atk += 800;
}
}
......
This diff is collapsed.
......@@ -79,7 +79,7 @@ namespace WindBot.Game.AI.Decks
return false;
int remaining = 2;
foreach (ClientCard card in Bot.Banished)
if (card.Id == CardId.WhiteNightDragon)
if (card.IsCode(CardId.WhiteNightDragon))
remaining--;
if (remaining > 0)
{
......@@ -154,7 +154,7 @@ namespace WindBot.Game.AI.Decks
// We should summon Horus the Black Flame Dragon LV6 if he can lvlup.
if (Enemy.GetMonsterCount() != 0 && !AI.Utils.IsAllEnemyBetterThanValue(2300 - 1, false))
foreach (ClientCard card in Main.SummonableCards)
if (card.Id == 11224103)
if (card.IsCode(11224103))
return false;
return DefaultTributeSummon();
......@@ -197,7 +197,7 @@ namespace WindBot.Game.AI.Decks
ClientCard monster = cards[i];
if (monster.Attack < 2300)
return false;
if (monster.Race == (int)CardRace.Dragon && monster.Id != CardId.HorusTheBlackFlameDragonLv8)
if (monster.Race == (int)CardRace.Dragon && !monster.IsCode(CardId.HorusTheBlackFlameDragonLv8))
{
summonCard = monster;
break;
......
......@@ -91,6 +91,7 @@ namespace WindBot.Game.AI.Decks
public override void OnNewTurn()
{
ClownUsed = false;
base.OnNewTurn();
}
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
......@@ -109,13 +110,13 @@ namespace WindBot.Game.AI.Decks
IList<ClientCard> result = new List<ClientCard>();
foreach (ClientCard card in cards)
{
if (!result.Contains(card) && (!ClownUsed || card.Id != CardId.PerformageTrickClown))
if (!result.Contains(card) && (!ClownUsed || !card.IsCode(CardId.PerformageTrickClown)))
result.Add(card);
if (result.Count >= max)
break;
}
AI.Utils.CheckSelectCount(result, cards, min, max);
return result;
return AI.Utils.CheckSelectCount(result, cards, min, max);
}
private bool ReinforcementOfTheArmyEffect()
......@@ -138,26 +139,24 @@ namespace WindBot.Game.AI.Decks
if (!Bot.HasInHand(CardId.Lumina))
AI.SelectCard(CardId.Lumina);
else
AI.SelectCard(new[]
{
AI.SelectCard(
CardId.Raiden,
CardId.Lumina,
CardId.Minerva,
CardId.Lyla
});
);
return true;
}
private bool SolarRechargeEffect()
{
AI.SelectCard(new[]
{
CardId.Wulf,
CardId.Felis,
CardId.Minerva,
CardId.Lyla,
CardId.Raiden
});
AI.SelectCard(
CardId.Wulf,
CardId.Felis,
CardId.Minerva,
CardId.Lyla,
CardId.Raiden
);
return true;
}
......@@ -173,14 +172,13 @@ namespace WindBot.Game.AI.Decks
private bool GoblindberghEffect()
{
AI.SelectCard(new[]
{
CardId.Felis,
CardId.Wulf,
CardId.Raiden,
CardId.PerformageTrickClown,
CardId.ThousandBlades
});
AI.SelectCard(
CardId.Felis,
CardId.Wulf,
CardId.Raiden,
CardId.PerformageTrickClown,
CardId.ThousandBlades
);
return true;
}
......@@ -196,17 +194,14 @@ namespace WindBot.Game.AI.Decks
}
else
{
AI.SelectCard(new[] {
AI.SelectCard(
CardId.Wulf,
CardId.Felis,
CardId.Minerva,
CardId.ThousandBlades
});
);
}
AI.SelectNextCard(new[] {
CardId.Raiden,
CardId.Felis
});
AI.SelectNextCard(CardId.Raiden, CardId.Felis);
return true;
}
......
......@@ -106,9 +106,9 @@ namespace WindBot.Game.AI.Decks
if (!Bot.HasInHand(NekrozRituelCard) || Bot.HasInHand(CardId.Shurit) || !Bot.HasInHand(NekrozSpellCard))
return true;
foreach (ClientCard Card in Bot.Hand)
if (Card != null && Card.Id == CardId.Kaleidoscope && !Bot.HasInHand(CardId.Unicore))
if (Card != null && Card.IsCode(CardId.Kaleidoscope) && !Bot.HasInHand(CardId.Unicore))
return true;
else if (Card.Id == CardId.Trishula || Card.Id == CardId.DecisiveArmor && !Bot.HasInHand(CardId.Mirror) || !Bot.HasInHand(CardId.Shurit))
else if (Card.IsCode(CardId.Trishula) || Card.IsCode(CardId.DecisiveArmor) && !Bot.HasInHand(CardId.Mirror) || !Bot.HasInHand(CardId.Shurit))
return true;
return false;
}
......@@ -271,9 +271,9 @@ namespace WindBot.Game.AI.Decks
List<int> NekrozCard = new List<int>();
try
{
foreach (ClientCard Card in Bot.Hand)
if (Card != null && NekrozRituelCard.Contains((int)Card.Id))
NekrozCard.Add(Card.Id);
foreach (ClientCard card in Bot.Hand)
if (card != null && card.IsCode(NekrozRituelCard))
NekrozCard.Add(card.Id);
foreach (int Id in NekrozCard)
{
......
This diff is collapsed.
......@@ -141,7 +141,7 @@ namespace WindBot.Game.AI.Decks
for (int i = 1; i <= max; ++i)
{
ClientCard card = cards[cards.Count - i];
if (card.Id != CardId.Scout || (card.Location == CardLocation.Extra && !Duel.IsNewRule))
if (!card.IsCode(CardId.Scout) || (card.Location == CardLocation.Extra && !Duel.IsNewRule))
selected.Add(card);
}
if (selected.Count == 0)
......@@ -152,7 +152,7 @@ namespace WindBot.Game.AI.Decks
private bool NormalSummon()
{
if (Card.Id == CardId.Scout)
if (Card.IsCode(CardId.Scout))
return false;
if (Card.Level < 8)
AI.SelectOption(1);
......@@ -166,19 +166,18 @@ namespace WindBot.Game.AI.Decks
private bool PotOfDualityEffect()
{
AI.SelectCard(new[]
{
CardId.Scout,
CardId.SkillDrain,
CardId.VanitysEmptiness,
CardId.DimensionalBarrier,
CardId.Stealth,
CardId.Shell,
CardId.Helix,
CardId.Carrier,
CardId.SolemnStrike,
CardId.CardOfDemise
});
AI.SelectCard(
CardId.Scout,
CardId.SkillDrain,
CardId.VanitysEmptiness,
CardId.DimensionalBarrier,
CardId.Stealth,
CardId.Shell,
CardId.Helix,
CardId.Carrier,
CardId.SolemnStrike,
CardId.CardOfDemise
);
return !ShouldPendulum();
}
......@@ -196,7 +195,7 @@ namespace WindBot.Game.AI.Decks
{
foreach (ClientCard card in Bot.GetSpells())
{
if (card.Id == Card.Id)
if (card.IsCode(Card.Id))
return false;
}
return TrapSetWhenZoneFree();
......@@ -304,12 +303,7 @@ namespace WindBot.Game.AI.Decks
}
else if (handcount>0 || fieldcount>0)
{
AI.SelectCard(new[]
{
CardId.Saqlifice,
CardId.Shell,
CardId.Helix
});
AI.SelectCard(CardId.Saqlifice, CardId.Shell, CardId.Helix);
}
else
{
......
......@@ -162,7 +162,7 @@ namespace WindBot.Game.AI.Decks
{
foreach (ClientCard card2 in cards)
{
if (card1.Id == card2.Id && !card1.Equals(card2))
if (card1.IsCode(card2.Id) && !card1.Equals(card2))
{
result.Add(card1);
result.Add(card2);
......@@ -172,19 +172,18 @@ namespace WindBot.Game.AI.Decks
if (result.Count > 0)
break;
}
AI.Utils.CheckSelectCount(result, cards, min, max);
return result;
return AI.Utils.CheckSelectCount(result, cards, min, max);
}
private bool UnexpectedDaiEffect()
{
if (Bot.HasInHand(CardId.RescueRabbit) || NormalSummoned)
AI.SelectCard(new[]
{
AI.SelectCard(
CardId.MysteryShellDragon,
CardId.PhantomGryphon,
CardId.MegalosmasherX
});
);
else if (AI.Utils.IsTurn1OrMain2())
{
if (Bot.HasInHand(CardId.MysteryShellDragon))
......@@ -203,11 +202,7 @@ namespace WindBot.Game.AI.Decks
else if (Bot.HasInHand(CardId.PhantomGryphon))
AI.SelectCard(CardId.PhantomGryphon);
else if (Bot.HasInHand(CardId.AngelTrumpeter))
AI.SelectCard(new[]
{
CardId.MetalfoesGoldriver,
CardId.MasterPendulumTheDracoslayer
});
AI.SelectCard(CardId.MetalfoesGoldriver, CardId.MasterPendulumTheDracoslayer);
}
return true;
}
......@@ -216,22 +211,20 @@ namespace WindBot.Game.AI.Decks
{
if (AI.Utils.IsTurn1OrMain2())
{
AI.SelectCard(new[]
{
CardId.MegalosmasherX,
CardId.MysteryShellDragon
});
AI.SelectCard(
CardId.MegalosmasherX,
CardId.MysteryShellDragon
);
}
else
{
AI.SelectCard(new[]
{
CardId.MasterPendulumTheDracoslayer,
CardId.PhantomGryphon,
CardId.MegalosmasherX,
CardId.MetalfoesGoldriver,
CardId.AngelTrumpeter
});
AI.SelectCard(
CardId.MasterPendulumTheDracoslayer,
CardId.PhantomGryphon,
CardId.MegalosmasherX,
CardId.MetalfoesGoldriver,
CardId.AngelTrumpeter
);
}
return true;
}
......@@ -358,6 +351,7 @@ namespace WindBot.Game.AI.Decks
private bool LightningChidoriEffect()
{
ClientCard problematicCard = AI.Utils.GetProblematicEnemyCard();
AI.SelectCard(0);
AI.SelectNextCard(problematicCard);
return true;
}
......@@ -423,6 +417,7 @@ namespace WindBot.Game.AI.Decks
ClientCard result = AI.Utils.GetOneEnemyBetterThanValue(2000, true);
if (result != null)
{
AI.SelectCard(0);
AI.SelectNextCard(result);
return true;
}
......
......@@ -120,15 +120,13 @@ namespace WindBot.Game.AI.Decks
public override IList<ClientCard> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max)
{
IList<ClientCard> result = new List<ClientCard>();
AI.Utils.SelectPreferredCards(result, new[] {
IList<ClientCard> result = AI.Utils.SelectPreferredCards(new[] {
CardId.MistArchfiend,
CardId.PanzerDragon,
CardId.SolarWindJammer,
CardId.StarDrawing
}, cards, min, max);
AI.Utils.CheckSelectCount(result, cards, min, max);
return result;
return AI.Utils.CheckSelectCount(result, cards, min, max);
}
private bool NormalSummon()
......@@ -149,17 +147,16 @@ namespace WindBot.Game.AI.Decks
{
if (!NeedLV5())
return false;
AI.SelectCard(new[]
{
CardId.QuickdrawSynchron,
CardId.ZWEagleClaw,
CardId.SolarWindJammer,
CardId.CyberDragon,
CardId.MistArchfiend,
CardId.WindUpSoldier,
CardId.StarDrawing,
CardId.ChronomalyGoldenJet
});
AI.SelectCard(
CardId.QuickdrawSynchron,
CardId.ZWEagleClaw,
CardId.SolarWindJammer,
CardId.CyberDragon,
CardId.MistArchfiend,
CardId.WindUpSoldier,
CardId.StarDrawing,
CardId.ChronomalyGoldenJet
);
return true;
}
......@@ -187,15 +184,15 @@ namespace WindBot.Game.AI.Decks
int lv5Count = 0;
foreach (ClientCard card in Bot.Hand)
{
if (card.Id == CardId.SolarWindJammer && Bot.GetMonsterCount() == 0)
if (card.IsCode(CardId.SolarWindJammer) && Bot.GetMonsterCount() == 0)
++lv5Count;
if (card.Id == CardId.InstantFusion && !InstantFusionUsed)
if (card.IsCode(CardId.InstantFusion) && !InstantFusionUsed)
++lv5Count;
if (card.Id == CardId.QuickdrawSynchron && Bot.Hand.ContainsMonsterWithLevel(4))
if (card.IsCode(CardId.QuickdrawSynchron) && Bot.Hand.ContainsMonsterWithLevel(4))
++lv5Count;
if (card.Id == CardId.MistArchfiend && !NormalSummoned)
if (card.IsCode(CardId.MistArchfiend) && !NormalSummoned)
++lv5Count;
if (card.Id == CardId.DoubleSummon && DoubleSummonEffect())
if (card.IsCode(CardId.DoubleSummon) && DoubleSummonEffect())
++lv5Count;
}
if (lv5Count >= 2)
......@@ -335,14 +332,13 @@ namespace WindBot.Game.AI.Decks
{
if (!UniqueFaceupSpell())
return false;
AI.SelectCard(new[]
{
CardId.CyberDragonInfinity,
CardId.CyberDragonNova,
CardId.TirasKeeperOfGenesis,
CardId.SharkFortress,
CardId.Number61Volcasaurus
});
AI.SelectCard(
CardId.CyberDragonInfinity,
CardId.CyberDragonNova,
CardId.TirasKeeperOfGenesis,
CardId.SharkFortress,
CardId.Number61Volcasaurus
);
return true;
}
......@@ -389,8 +385,8 @@ namespace WindBot.Game.AI.Decks
if (monster.HasType(CardType.Monster) &&
!monster.HasType(CardType.Xyz) &&
(monster.Level == 5
|| monster.Id == CardId.StarDrawing
|| (monster.Id == CardId.WindUpSoldier) && !monster.Equals(Card)))
|| monster.IsCode(CardId.StarDrawing)
|| (monster.IsCode(CardId.WindUpSoldier)) && !monster.Equals(Card)))
return true;
}
return false;
......
......@@ -175,12 +175,12 @@ namespace WindBot.Game.AI.Decks
IList<ClientCard> targets = Enemy.GetSpells();
if (targets.Count > 0)
{
AI.SelectCard(new[]{
AI.SelectCard(
CardId.DualAssembloom,
CardId.Bitron,
CardId.Digitron,
CardId.RecodedAlive
});
);
AI.SelectNextCard(targets);
return true;
}
......@@ -284,7 +284,7 @@ namespace WindBot.Game.AI.Decks
List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters)
{
if (monster.Id == CardId.BalancerLord)
if (monster.IsCode(CardId.BalancerLord))
{
AI.SelectCard(monster);
selected = true;
......@@ -306,14 +306,13 @@ namespace WindBot.Game.AI.Decks
}
if (selected)
{
AI.SelectNextCard(new[]
{
AI.SelectNextCard(
CardId.ROMCloudia,
CardId.BalancerLord,
CardId.Kleinant,
CardId.Draconnet,
CardId.Backlinker
});
);
return true;
}
return false;
......@@ -360,24 +359,24 @@ namespace WindBot.Game.AI.Decks
{
if (Card.Location == CardLocation.MonsterZone)
{
AI.SelectCard(new[]{
AI.SelectCard(
CardId.BootStagguard,
CardId.BalancerLord,
CardId.Kleinant,
CardId.Linkslayer,
CardId.Draconnet,
CardId.RAMClouder
});
);
return true;
}
else
{
AI.SelectCard(new[]{
AI.SelectCard(
CardId.BalancerLord,
CardId.Kleinant,
CardId.RAMClouder,
CardId.DotScaper
});
);
return true;
}
}
......@@ -404,7 +403,7 @@ namespace WindBot.Game.AI.Decks
};
foreach (ClientCard monster in Bot.Hand)
{
if (targets.Contains(monster.Id))
if (monster.IsCode(targets))
{
AI.SelectCard(targets);
return true;
......@@ -418,7 +417,7 @@ namespace WindBot.Game.AI.Decks
};
foreach (ClientCard monster in Bot.GetMonsters())
{
if (targets2.Contains(monster.Id))
if (monster.IsCode(targets2))
{
AI.SelectCard(targets2);
return true;
......@@ -429,28 +428,28 @@ namespace WindBot.Game.AI.Decks
private bool RAMClouderEffect()
{
AI.SelectCard(new[]{
CardId.StagToken,
CardId.Bitron,
CardId.Digitron,
CardId.DotScaper,
CardId.Draconnet,
CardId.Backlinker,
CardId.RAMClouder
});
AI.SelectNextCard(new[]{
CardId.DecodeTalker,
CardId.EncodeTalker,
CardId.TriGateWizard,
CardId.BinarySorceress,
CardId.Honeybot,
CardId.DualAssembloom,
CardId.BootStagguard,
CardId.BalancerLord,
CardId.ROMCloudia,
CardId.Linkslayer,
CardId.RAMClouder
});
AI.SelectCard(
CardId.StagToken,
CardId.Bitron,
CardId.Digitron,
CardId.DotScaper,
CardId.Draconnet,
CardId.Backlinker,
CardId.RAMClouder
);
AI.SelectNextCard(
CardId.DecodeTalker,
CardId.EncodeTalker,
CardId.TriGateWizard,
CardId.BinarySorceress,
CardId.Honeybot,
CardId.DualAssembloom,
CardId.BootStagguard,
CardId.BalancerLord,
CardId.ROMCloudia,
CardId.Linkslayer,
CardId.RAMClouder
);
return true;
}
......
......@@ -152,7 +152,7 @@ namespace WindBot.Game.AI.Decks
{
if (!defender.IsMonsterHasPreventActivationEffectInBattle())
{
if (attacker.Id == CardId.HiSpeedroidChanbara && !attacker.IsDisabled())
if (attacker.IsCode(CardId.HiSpeedroidChanbara) && !attacker.IsDisabled())
attacker.RealPower = attacker.RealPower + 200;
}
return base.OnPreBattleBetween(attacker, defender);
......@@ -229,12 +229,12 @@ namespace WindBot.Game.AI.Decks
private bool FoolishBurialGoodsEffect()
{
AI.SelectCard(new[]{
AI.SelectCard(
CardId.MetalfoesFusion,
CardId.WidowAnchor,
CardId.Engage,
CardId.HornetDrones
});
);
return true;
}
......@@ -312,13 +312,13 @@ namespace WindBot.Game.AI.Decks
if (target > 0)
AI.SelectCard(target);
else
AI.SelectCard(new[] {
AI.SelectCard(
CardId.Multirole,
CardId.AreaZero,
CardId.Afterburners,
CardId.JammingWave,
CardId.Raye
});
);
return true;
}
......@@ -330,13 +330,13 @@ namespace WindBot.Game.AI.Decks
if (target > 0)
AI.SelectCard(target);
else
AI.SelectCard(new[] {
AI.SelectCard(
CardId.Multirole,
CardId.AreaZero,
CardId.Afterburners,
CardId.JammingWave,
CardId.Raye
});
);
return true;
}
......@@ -399,7 +399,7 @@ namespace WindBot.Game.AI.Decks
IList<ClientCard> targets = new List<ClientCard>();
foreach(ClientCard card in Bot.GetGraveyardMonsters())
{
if (card.Id == CardId.Hayate || card.Id == CardId.Kagari || card.Id == CardId.Shizuku)
if (card.IsCode(CardId.Hayate, CardId.Kagari, CardId.Shizuku))
targets.Add(card);
}
if (targets.Count > 0)
......@@ -451,7 +451,7 @@ namespace WindBot.Game.AI.Decks
}
foreach (ClientCard target in Bot.GetMonsters())
{
if (target.Id == CardId.Raye && Bot.GetMonstersExtraZoneCount() == 0)
if (target.IsCode(CardId.Raye) && Bot.GetMonstersExtraZoneCount() == 0)
{
AI.SelectCard(target);
return true;
......@@ -459,7 +459,7 @@ namespace WindBot.Game.AI.Decks
}
foreach (ClientCard target in Bot.GetSpells())
{
if (target.Id != CardId.AreaZero && target.Id != CardId.Multirole && target.Id != CardId.WidowAnchor && target.IsSpell())
if (!target.IsCode(CardId.AreaZero, CardId.Multirole, CardId.WidowAnchor) && target.IsSpell())
{
AI.SelectCard(target);
return true;
......@@ -482,7 +482,7 @@ namespace WindBot.Game.AI.Decks
}
foreach (ClientCard target in Bot.GetMonsters())
{
if (target.Id == CardId.Raye && Bot.GetMonstersExtraZoneCount() == 0)
if (target.IsCode(CardId.Raye) && Bot.GetMonstersExtraZoneCount() == 0)
{
AI.SelectCard(target);
return true;
......@@ -490,7 +490,7 @@ namespace WindBot.Game.AI.Decks
}
foreach (ClientCard target in Bot.GetSpells())
{
if (target.Id == CardId.AreaZero)
if (target.IsCode(CardId.AreaZero))
{
AI.SelectCard(target);
return true;
......@@ -498,7 +498,7 @@ namespace WindBot.Game.AI.Decks
}
foreach (ClientCard target in Bot.GetSpells())
{
if (target.Id != CardId.Multirole && target.Id != CardId.WidowAnchor && target.IsSpell())
if (!target.IsCode(CardId.Multirole, CardId.WidowAnchor) && target.IsSpell())
{
AI.SelectCard(target);
return true;
......@@ -562,11 +562,7 @@ namespace WindBot.Game.AI.Decks
}
else
{
AI.SelectCard(new[] {
CardId.Shizuku,
CardId.Kagari,
CardId.Hayate
});
AI.SelectCard(CardId.Shizuku, CardId.Kagari, CardId.Hayate);
}
}
......@@ -595,11 +591,7 @@ namespace WindBot.Game.AI.Decks
AI.SelectCard(CardId.JammingWave);
}
else
AI.SelectCard(new[] {
CardId.Engage,
CardId.HornetDrones,
CardId.WidowAnchor
});
AI.SelectCard(CardId.Engage, CardId.HornetDrones, CardId.WidowAnchor);
return true;
}
......@@ -619,11 +611,7 @@ namespace WindBot.Game.AI.Decks
if (target != 0)
AI.SelectCard(target);
else
AI.SelectCard(new[] {
CardId.Engage,
CardId.HornetDrones,
CardId.WidowAnchor
});
AI.SelectCard(CardId.Engage, CardId.HornetDrones, CardId.WidowAnchor);
return true;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -163,7 +163,7 @@ namespace WindBot.Game.AI.Decks
if (Card == null)
return true;
// Logger.DebugWriteLine(Card.Name);
if (Card.Id == CardId.YosenjuKama2)
if (Card.IsCode(CardId.YosenjuKama2))
return Card.ShouldDirectAttack;
else
return true;
......@@ -181,18 +181,15 @@ namespace WindBot.Game.AI.Decks
public override IList<ClientCard> OnSelectXyzMaterial(IList<ClientCard> cards, int min, int max)
{
IList<ClientCard> result = new List<ClientCard>();
AI.Utils.SelectPreferredCards(result, CardId.YosenjuTsujik, cards, min, max);
AI.Utils.CheckSelectCount(result, cards, min, max);
return result;
IList<ClientCard> result = AI.Utils.SelectPreferredCards(CardId.YosenjuTsujik, cards, min, max);
return AI.Utils.CheckSelectCount(result, cards, min, max);
}
private bool PotOfDualityEffect()
{
if (CardOfDemiseUsed)
{
AI.SelectCard(new[]
{
AI.SelectCard(
CardId.StarlightRoad,
CardId.MagicDrain,
CardId.SolemnJudgment,
......@@ -204,12 +201,11 @@ namespace WindBot.Game.AI.Decks
CardId.SolemnWarning,
CardId.MacroCosmos,
CardId.CardOfDemise
});
);
}
else
{
AI.SelectCard(new[]
{
AI.SelectCard(
CardId.YosenjuKama3,
CardId.YosenjuKama1,
CardId.YosenjuKama2,
......@@ -223,8 +219,8 @@ namespace WindBot.Game.AI.Decks
CardId.SolemnJudgment,
CardId.SolemnWarning,
CardId.MacroCosmos,
CardId.CardOfDemise,
});
CardId.CardOfDemise
);
}
return true;
}
......@@ -243,7 +239,7 @@ namespace WindBot.Game.AI.Decks
{
foreach (ClientCard card in Bot.Hand.GetMonsters())
{
if (!card.Equals(Card) && card.Id == Card.Id)
if (!card.Equals(Card) && card.IsCode(Card.Id))
return true;
}
return false;
......@@ -253,7 +249,7 @@ namespace WindBot.Game.AI.Decks
{
foreach (ClientCard card in Bot.GetSpells())
{
if (card.Id == Card.Id)
if (card.IsCode(Card.Id))
return false;
}
return TrapSetWhenZoneFree();
......@@ -274,12 +270,7 @@ namespace WindBot.Game.AI.Decks
// Don't activate the return to hand effect first
if (Duel.Phase == DuelPhase.End)
return false;
AI.SelectCard(new[]
{
CardId.YosenjuKama1,
CardId.YosenjuKama2,
CardId.YosenjuKama3
});
AI.SelectCard(CardId.YosenjuKama1, CardId.YosenjuKama2, CardId.YosenjuKama3);
return true;
}
......@@ -312,6 +303,7 @@ namespace WindBot.Game.AI.Decks
ClientCard target = AI.Utils.GetOneEnemyBetterThanValue(oppoBestAttack, true);
if (target != null)
{
AI.SelectCard(0);
AI.SelectNextCard(target);
}
return true;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -127,7 +127,7 @@ namespace WindBot.Game.AI
public void SendOnDirectAttack(string attacker)
{
if (attacker == "" || attacker == null)
if (string.IsNullOrEmpty(attacker))
{
attacker = _facedownmonstername;
}
......
......@@ -74,6 +74,12 @@
UltimateConductorTytanno = 18940556,
OvertexCoatls = 41782653,
FirePrison = 269510,
LairOfDarkness = 59160188
LairOfDarkness = 59160188,
SuperboltThunderDragon = 15291624,
ThunderDragonLord = 41685633,
CyberDragonInfinity = 10443957,
ImperialCustom = 9995766,
InspectorBoarder = 15397015
}
}
This diff is collapsed.
......@@ -32,6 +32,7 @@
HazyFlamePeryton = 37803172,
HazyFlameGriffin = 74010769,
BlueEyesChaosMAXDragon = 55410871,
BlueEyesChaosDragon = 20654247,
SupremeKingZARC = 13331639,
CrimsonNovaTrinitytheDarkCubicLord = 72664875,
LunalightLeoDancer = 24550676,
......
using System;
using System.Collections.Generic;
using System.Linq;
using YGOSharp.OCGWrapper.Enums;
using WindBot;
using WindBot.Game;
......@@ -82,12 +83,12 @@ namespace WindBot.Game.AI
public virtual void OnChaining(int player, ClientCard card)
{
// For overriding
}
public virtual void OnChainEnd()
{
// For overriding
}
public virtual void OnNewPhase()
{
......@@ -239,12 +240,7 @@ namespace WindBot.Game.AI
private bool DefaultNoExecutor()
{
foreach (CardExecutor exec in Executors)
{
if (exec.Type == Type && exec.CardId == Card.Id)
return false;
}
return true;
return Executors.All(exec => exec.Type != Type || exec.CardId != Card.Id);
}
}
}
\ No newline at end of file
......@@ -8,6 +8,9 @@
MonsterSet,
SpellSet,
Activate,
SummonOrSet
SummonOrSet,
GoToBattlePhase,
GoToMainPhase2,
GoToEndPhase
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
No preview for this file type
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment