Skip to content

Commit fabdff0

Browse files
committed
2 parents 5363702 + 560ccf0 commit fabdff0

10 files changed

+110
-81
lines changed

Game/AI/DefaultExecutor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ protected bool DefaultMonsterRepos()
134134

135135
protected bool DefaultTrap()
136136
{
137-
return LastChainPlayer == 1;
137+
return LastChainPlayer == -1 || LastChainPlayer == 1;
138138
}
139139

140140
protected bool DefaultUniqueTrap()

Game/AI/Executor.cs

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ protected Executor(GameAI ai, Duel duel)
2626
Duel = duel;
2727
AI = ai;
2828
Executors = new List<CardExecutor>();
29+
30+
LastChainPlayer = -1;
2931
CurrentChain = new List<ClientCard>();
3032
}
3133

Game/ClientCard.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using OCGWrapper;
22
using OCGWrapper.Enums;
33
using System.Collections.Generic;
4+
using System.IO;
45
using YGOSharp.Network;
56

67
namespace WindBot.Game
@@ -54,7 +55,7 @@ public void SetId(int id)
5455
Name = Data.Name;
5556
}
5657

57-
public void Update(GamePacketReader packet, Duel duel)
58+
public void Update(BinaryReader packet, Duel duel)
5859
{
5960
int flag = packet.ReadInt32();
6061
if ((flag & (int)Query.Code) != 0)

Game/GameAI.cs

-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
using OCGWrapper.Enums;
22
using System.Collections.Generic;
33
using WindBot.Game.AI;
4-
using YGOSharp.Network;
54

65
namespace WindBot.Game
76
{
87
public class GameAI
98
{
109
public GameClient Game { get; private set; }
11-
public CoreClient Connection { get; private set; }
1210
public Duel Duel { get; private set; }
1311
public Executor Executor { get; set; }
1412
public AIFunctions Utils { get; private set; }
@@ -18,7 +16,6 @@ public class GameAI
1816
public GameAI(GameClient game, Duel duel)
1917
{
2018
Game = game;
21-
Connection = game.Connection;
2219
Duel = duel;
2320
Utils = new AIFunctions(duel);
2421

0 commit comments

Comments
 (0)