Commit 62cf4fa6 authored by mercury233's avatar mercury233

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

parents 7d2a40df 0448ed76
...@@ -2,8 +2,10 @@ ...@@ -2,8 +2,10 @@
using System.IO; using System.IO;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using System.Diagnostics; using System.Diagnostics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Linq;
namespace BotWrapper namespace BotWrapper
{ {
...@@ -12,6 +14,8 @@ namespace BotWrapper ...@@ -12,6 +14,8 @@ namespace BotWrapper
[DllImport("User32.dll", CharSet = CharSet.Unicode)] [DllImport("User32.dll", CharSet = CharSet.Unicode)]
public static extern int MessageBox(IntPtr hWnd, string lpText, string lpCaption, int uType); public static extern int MessageBox(IntPtr hWnd, string lpText, string lpCaption, int uType);
const int MB_ICONERROR = 0x00000010;
static void Main(string[] args) static void Main(string[] args)
{ {
ProcessStartInfo startInfo = new ProcessStartInfo(); ProcessStartInfo startInfo = new ProcessStartInfo();
...@@ -24,7 +28,19 @@ namespace BotWrapper ...@@ -24,7 +28,19 @@ namespace BotWrapper
startInfo.CreateNoWindow = true; startInfo.CreateNoWindow = true;
startInfo.WindowStyle = ProcessWindowStyle.Hidden; startInfo.WindowStyle = ProcessWindowStyle.Hidden;
string arg = args[0].Replace("'","\""); 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) if (int.Parse(args[1]) == 1)
{ {
arg += " Hand=1"; arg += " Hand=1";
...@@ -39,8 +55,51 @@ namespace BotWrapper ...@@ -39,8 +55,51 @@ namespace BotWrapper
} }
catch catch
{ {
MessageBox((IntPtr)0, "WindBot can't be started!", "WindBot", 0x00000010); // MB_ICONERROR 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 @@ ...@@ -4,25 +4,40 @@
# description # description
# flags (avail flags: SUPPORT_MASTER_RULE_3, SUPPORT_NEW_MASTER_RULE) # 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-龙骑星爆 !谜之剑士LV4-龙骑星爆
Name=谜之剑士LV4 Deck=Dragunity Dialog=swordsman.zh-CN 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 !谜之剑士LV4-R5
Name=谜之剑士LV4 Deck='Rank V' Dialog=swordsman.zh-CN Name=谜之剑士LV4 Deck='Rank V' Dialog=swordsman.zh-CN
5阶超量卡组。 5阶超量卡组。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!谜之剑士LV4-异热同心武器 !谜之剑士LV4-异热同心武器
Name=谜之剑士LV4 Deck='Zexal Weapons' Dialog=swordsman.zh-CN 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 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 Name=琪露诺 Deck='Toadally Awesome' Dialog=cirno.zh-CN
...@@ -32,7 +47,7 @@ SUPPORT_MASTER_RULE_3 ...@@ -32,7 +47,7 @@ SUPPORT_MASTER_RULE_3
!复制植物-青眼 !复制植物-青眼
Name=复制植物 Deck=Blue-Eyes Dialog=copy.zh-CN 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 Name=复制植物 Deck=Zoodiac Dialog=copy.zh-CN
...@@ -42,64 +57,64 @@ SUPPORT_MASTER_RULE_3 ...@@ -42,64 +57,64 @@ SUPPORT_MASTER_RULE_3
!尼亚-妖仙兽 !尼亚-妖仙兽
Name=尼亚 Deck=Yosenju Dialog=near.zh-CN 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 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 Name=尼亚 Deck=Trickstar Dialog=near.zh-CN
淘气仙星卡组。 淘气仙星卡组。
SUPPORT_NEW_MASTER_RULE AI_LV3 SUPPORT_NEW_MASTER_RULE
!永远之魂-削血 !永远之魂-削血
Name=永远之魂 Deck=Burn Dialog=soul.zh-CN Name=永远之魂 Deck=Burn Dialog=soul.zh-CN
老式削血卡组。 老式削血卡组。
SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE AI_LV1 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE
!永远之魂-青蛙 !永远之魂-青蛙
Name=永远之魂 Deck=Frog Dialog=soul.zh-CN 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 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 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 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 !试作型机器人1732
Name=试作型机器人1732 Deck=ST1732 Dialog=zh-CN Name=试作型机器人1732 Deck=ST1732 Dialog=zh-CN
由三盒ST17和三盒SD32组成的卡组。 由三盒ST17和三盒SD32组成的卡组。
SUPPORT_NEW_MASTER_RULE AI_LV2 SUPPORT_NEW_MASTER_RULE
!奇異果 !奇異果
Name=奇異果 Deck=LightswornShaddoldinosour Dialog=kiwi.zh-TW 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 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
!燃血鬥士 !燃血鬥士
Name=燃血鬥士 Deck=ChainBurn Dialog=kiwi.zh-TW 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=SkyStriker Dialog=anothercopy.zh-CN 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
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
15397015
15397015
15397015
71564252
71564252
71564252
36584821
36584821
36584821
23434538
23434538
63845230
63845230
63845230
18144506
35261759
35261759
35261759
59750328
59750328
70368879
70368879
70368879
98645731
98645731
98645731
73915051
73915051
10045474
10045474
10045474
10813327
15693423
23924608
30241314
30241314
58921041
58921041
61740673
69452756
40605147
40605147
77538567
77538567
84749824
84749824
#extra
86221741
31833038
85289965
5043010
30194529
38342335
2857636
24094258
50588353
3987233
3987233
63288573
98978921
41999284
41999284
!side
10000080
86937530
14558127
62015408
9742784
67441435
72529749
43898403
19508728
15693423
24207889
69452756
23002292
41420027
41420027
...@@ -350,7 +350,7 @@ namespace WindBot.Game.AI ...@@ -350,7 +350,7 @@ namespace WindBot.Game.AI
public bool IsChainTargetOnly(ClientCard card) public bool IsChainTargetOnly(ClientCard card)
{ {
return Duel.ChainTargets.Count == 1 && card.Equals(Duel.ChainTargets[0]); return Duel.ChainTargetOnly.Count == 1 && card.Equals(Duel.ChainTargetOnly[0]);
} }
public bool ChainContainsCard(int id) public bool ChainContainsCard(int id)
......
...@@ -179,6 +179,16 @@ namespace WindBot.Game.AI ...@@ -179,6 +179,16 @@ namespace WindBot.Game.AI
return null; return null;
} }
public static ClientCard GetShouldBeDisabledBeforeItUseEffectMonster(this IEnumerable<ClientCard> cards)
{
foreach (ClientCard card in cards)
{
if (card != null && card.IsMonsterShouldBeDisabledBeforeItUseEffect() && card.IsFaceup())
return card;
}
return null;
}
public static IEnumerable<IEnumerable<T>> GetCombinations<T>(this IEnumerable<T> elements, int k) public static IEnumerable<IEnumerable<T>> GetCombinations<T>(this IEnumerable<T> elements, int k)
{ {
return k == 0 ? new[] { new T[0] } : return k == 0 ? new[] { new T[0] } :
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
...@@ -887,8 +887,7 @@ namespace WindBot.Game.AI ...@@ -887,8 +887,7 @@ namespace WindBot.Game.AI
List<ClientCard> monsters = Bot.GetMonsters(); List<ClientCard> monsters = Bot.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
// The bot don't know if the card is special summoned, so let we assume all monsters are special summoned if (!monster.Equals(Card) && monster.IsSpecialSummoned && monster.HasType(CardType.Effect) && monster.Attack <= Card.Attack)
if (!monster.Equals(Card) && monster.HasType(CardType.Effect) && monster.Attack <= Card.Attack)
selfCount++; selfCount++;
} }
...@@ -896,7 +895,7 @@ namespace WindBot.Game.AI ...@@ -896,7 +895,7 @@ namespace WindBot.Game.AI
monsters = Enemy.GetMonsters(); monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters) foreach (ClientCard monster in monsters)
{ {
if (monster.HasType(CardType.Effect) && monster.Attack <= Card.Attack) if (monster.IsSpecialSummoned && monster.HasType(CardType.Effect) && monster.Attack <= Card.Attack)
oppoCount++; oppoCount++;
} }
......
...@@ -74,6 +74,8 @@ ...@@ -74,6 +74,8 @@
UltimateConductorTytanno = 18940556, UltimateConductorTytanno = 18940556,
OvertexCoatls = 41782653, OvertexCoatls = 41782653,
FirePrison = 269510, FirePrison = 269510,
LairOfDarkness = 59160188 LairOfDarkness = 59160188,
SuperboltThunderDragon = 15291624,
ThunderDragonLord = 41685633
} }
} }
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
HazyFlamePeryton = 37803172, HazyFlamePeryton = 37803172,
HazyFlameGriffin = 74010769, HazyFlameGriffin = 74010769,
BlueEyesChaosMAXDragon = 55410871, BlueEyesChaosMAXDragon = 55410871,
BlueEyesChaosDragon = 20654247,
SupremeKingZARC = 13331639, SupremeKingZARC = 13331639,
CrimsonNovaTrinitytheDarkCubicLord = 72664875, CrimsonNovaTrinitytheDarkCubicLord = 72664875,
LunalightLeoDancer = 24550676, LunalightLeoDancer = 24550676,
......
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
MonsterSet, MonsterSet,
SpellSet, SpellSet,
Activate, Activate,
SummonOrSet SummonOrSet,
GoToBattlePhase,
GoToMainPhase2,
GoToEndPhase
} }
} }
\ No newline at end of file
...@@ -39,6 +39,7 @@ namespace WindBot.Game ...@@ -39,6 +39,7 @@ namespace WindBot.Game
public bool ShouldDirectAttack { get; set; } public bool ShouldDirectAttack { get; set; }
public bool Attacked { get; set; } public bool Attacked { get; set; }
public bool IsLastAttacker { get; set; } public bool IsLastAttacker { get; set; }
public bool IsSpecialSummoned { get; set; }
public int[] ActionIndex { get; set; } public int[] ActionIndex { get; set; }
public IDictionary<int, int> ActionActivateIndex { get; private set; } public IDictionary<int, int> ActionActivateIndex { get; private set; }
......
...@@ -19,7 +19,10 @@ namespace WindBot.Game ...@@ -19,7 +19,10 @@ namespace WindBot.Game
public int LastChainPlayer { get; set; } public int LastChainPlayer { get; set; }
public IList<ClientCard> CurrentChain { get; set; } public IList<ClientCard> CurrentChain { get; set; }
public IList<ClientCard> ChainTargets { get; set; } public IList<ClientCard> ChainTargets { get; set; }
public IList<ClientCard> ChainTargetOnly { get; set; }
public int LastSummonPlayer { get; set; } public int LastSummonPlayer { get; set; }
public IList<ClientCard> SummoningCards { get; set; }
public IList<ClientCard> LastSummonedCards { get; set; }
public Duel() public Duel()
{ {
...@@ -29,7 +32,10 @@ namespace WindBot.Game ...@@ -29,7 +32,10 @@ namespace WindBot.Game
LastChainPlayer = -1; LastChainPlayer = -1;
CurrentChain = new List<ClientCard>(); CurrentChain = new List<ClientCard>();
ChainTargets = new List<ClientCard>(); ChainTargets = new List<ClientCard>();
ChainTargetOnly = new List<ClientCard>();
LastSummonPlayer = -1; LastSummonPlayer = -1;
SummoningCards = new List<ClientCard>();
LastSummonedCards = new List<ClientCard>();
} }
public ClientCard GetCard(int player, CardLocation loc, int index) public ClientCard GetCard(int player, CardLocation loc, int index)
......
This diff is collapsed.
...@@ -129,8 +129,12 @@ namespace WindBot.Game ...@@ -129,8 +129,12 @@ namespace WindBot.Game
_messages.Add(GameMessage.AnnounceCardFilter, OnAnnounceCard); _messages.Add(GameMessage.AnnounceCardFilter, OnAnnounceCard);
_messages.Add(GameMessage.RockPaperScissors, OnRockPaperScissors); _messages.Add(GameMessage.RockPaperScissors, OnRockPaperScissors);
_messages.Add(GameMessage.SpSummoning, OnSpSummon); _messages.Add(GameMessage.Summoning, OnSummoning);
_messages.Add(GameMessage.SpSummoned, OnSpSummon); _messages.Add(GameMessage.Summoned, OnSummoned);
_messages.Add(GameMessage.SpSummoning, OnSpSummoning);
_messages.Add(GameMessage.SpSummoned, OnSpSummoned);
_messages.Add(GameMessage.FlipSummoning, OnSummoning);
_messages.Add(GameMessage.FlipSummoned, OnSummoned);
} }
private void OnJoinGame(BinaryReader packet) private void OnJoinGame(BinaryReader packet)
...@@ -478,6 +482,8 @@ namespace WindBot.Game ...@@ -478,6 +482,8 @@ namespace WindBot.Game
if (_debug) if (_debug)
Logger.WriteLine("(Go to " + (_duel.Phase.ToString()) + ")"); Logger.WriteLine("(Go to " + (_duel.Phase.ToString()) + ")");
_duel.LastSummonPlayer = -1; _duel.LastSummonPlayer = -1;
_duel.SummoningCards.Clear();
_duel.LastSummonedCards.Clear();
_duel.Fields[0].BattlingMonster = null; _duel.Fields[0].BattlingMonster = null;
_duel.Fields[1].BattlingMonster = null; _duel.Fields[1].BattlingMonster = null;
_ai.OnNewPhase(); _ai.OnNewPhase();
...@@ -557,6 +563,8 @@ namespace WindBot.Game ...@@ -557,6 +563,8 @@ namespace WindBot.Game
else else
{ {
_duel.AddCard((CardLocation)currentLocation, card, currentControler, currentSequence, currentPosition, cardId); _duel.AddCard((CardLocation)currentLocation, card, currentControler, currentSequence, currentPosition, cardId);
if (card != null && previousLocation != currentLocation)
card.IsSpecialSummoned = false;
if (_debug && card != null) if (_debug && card != null)
Logger.WriteLine("(" + previousControler.ToString() + " 's " + (card.Name ?? "UnKnowCard") Logger.WriteLine("(" + previousControler.ToString() + " 's " + (card.Name ?? "UnKnowCard")
+ " from " + + " from " +
...@@ -621,7 +629,8 @@ namespace WindBot.Game ...@@ -621,7 +629,8 @@ namespace WindBot.Game
if (_debug) if (_debug)
if (card != null) Logger.WriteLine("(" + cc.ToString() + " 's " + (card.Name ?? "UnKnowCard") + " activate effect)"); if (card != null) Logger.WriteLine("(" + cc.ToString() + " 's " + (card.Name ?? "UnKnowCard") + " activate effect)");
_ai.OnChaining(card, cc); _ai.OnChaining(card, cc);
_duel.ChainTargets.Clear(); //_duel.ChainTargets.Clear();
_duel.ChainTargetOnly.Clear();
_duel.LastSummonPlayer = -1; _duel.LastSummonPlayer = -1;
_duel.CurrentChain.Add(card); _duel.CurrentChain.Add(card);
_duel.LastChainPlayer = cc; _duel.LastChainPlayer = cc;
...@@ -633,7 +642,8 @@ namespace WindBot.Game ...@@ -633,7 +642,8 @@ namespace WindBot.Game
_ai.OnChainEnd(); _ai.OnChainEnd();
_duel.LastChainPlayer = -1; _duel.LastChainPlayer = -1;
_duel.CurrentChain.Clear(); _duel.CurrentChain.Clear();
//_duel.ChainTargets.Clear(); _duel.ChainTargets.Clear();
_duel.ChainTargetOnly.Clear();
} }
private void OnCardSorting(BinaryReader packet) private void OnCardSorting(BinaryReader packet)
...@@ -758,6 +768,7 @@ namespace WindBot.Game ...@@ -758,6 +768,7 @@ namespace WindBot.Game
if (_debug) if (_debug)
Logger.WriteLine("(" + (CardLocation)loc + " 's " + (card.Name ?? "UnKnowCard") + " become target)"); Logger.WriteLine("(" + (CardLocation)loc + " 's " + (card.Name ?? "UnKnowCard") + " become target)");
_duel.ChainTargets.Add(card); _duel.ChainTargets.Add(card);
_duel.ChainTargetOnly.Add(card);
} }
} }
...@@ -1397,9 +1408,50 @@ namespace WindBot.Game ...@@ -1397,9 +1408,50 @@ namespace WindBot.Game
Connection.Send(CtosMessage.Response, result); Connection.Send(CtosMessage.Response, result);
} }
private void OnSpSummon(BinaryReader packet) private void OnSummoning(BinaryReader packet)
{ {
_duel.LastSummonedCards.Clear();
int code = packet.ReadInt32();
int currentControler = GetLocalPlayer(packet.ReadByte());
int currentLocation = packet.ReadByte();
int currentSequence = packet.ReadSByte();
int currentPosition = packet.ReadSByte();
ClientCard card = _duel.GetCard(currentControler, (CardLocation)currentLocation, currentSequence);
_duel.SummoningCards.Add(card);
_duel.LastSummonPlayer = currentControler;
}
private void OnSummoned(BinaryReader packet)
{
foreach (ClientCard card in _duel.SummoningCards)
{
_duel.LastSummonedCards.Add(card);
}
_duel.SummoningCards.Clear();
}
private void OnSpSummoning(BinaryReader packet)
{
_duel.LastSummonedCards.Clear();
_ai.CleanSelectMaterials(); _ai.CleanSelectMaterials();
int code = packet.ReadInt32();
int currentControler = GetLocalPlayer(packet.ReadByte());
int currentLocation = packet.ReadByte();
int currentSequence = packet.ReadSByte();
int currentPosition = packet.ReadSByte();
ClientCard card = _duel.GetCard(currentControler, (CardLocation)currentLocation, currentSequence);
_duel.SummoningCards.Add(card);
_duel.LastSummonPlayer = currentControler;
}
private void OnSpSummoned(BinaryReader packet)
{
foreach (ClientCard card in _duel.SummoningCards)
{
card.IsSpecialSummoned = true;
_duel.LastSummonedCards.Add(card);
}
_duel.SummoningCards.Clear();
} }
} }
} }
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
<Compile Include="Game\AI\CardSelector.cs" /> <Compile Include="Game\AI\CardSelector.cs" />
<Compile Include="Game\AI\DeckAttribute.cs" /> <Compile Include="Game\AI\DeckAttribute.cs" />
<Compile Include="Game\AI\DecksManager.cs" /> <Compile Include="Game\AI\DecksManager.cs" />
<Compile Include="Game\AI\Decks\AltergeistExecutor.cs" />
<Compile Include="Game\AI\Decks\BlackwingExecutor.cs" /> <Compile Include="Game\AI\Decks\BlackwingExecutor.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" />
...@@ -81,6 +82,7 @@ ...@@ -81,6 +82,7 @@
<Compile Include="Game\AI\Decks\ChainBurnExecutor.cs" /> <Compile Include="Game\AI\Decks\ChainBurnExecutor.cs" />
<Compile Include="Game\AI\Decks\EvilswarmExecutor.cs" /> <Compile Include="Game\AI\Decks\EvilswarmExecutor.cs" />
<Compile Include="Game\AI\Decks\GraydleExecutor.cs" /> <Compile Include="Game\AI\Decks\GraydleExecutor.cs" />
<Compile Include="Game\AI\Decks\GrenMajuThunderBoarderExecutor.cs" />
<Compile Include="Game\AI\Decks\LightswornExecutor.cs" /> <Compile Include="Game\AI\Decks\LightswornExecutor.cs" />
<Compile Include="Game\AI\Decks\LightswornShaddoldinosourExecutor.cs" /> <Compile Include="Game\AI\Decks\LightswornShaddoldinosourExecutor.cs" />
<Compile Include="Game\AI\Decks\QliphortExecutor.cs" /> <Compile Include="Game\AI\Decks\QliphortExecutor.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