Commit 811e3d61 authored by mercury233's avatar mercury233

add new master rule check

parent a9450a78
......@@ -153,6 +153,18 @@ namespace WindBot.Game.AI
return card;
}
public ClientCard GetPZone(int player, int id)
{
if (Duel.IsNewRule)
{
return Duel.Fields[player].SpellZone[id*4];
}
else
{
return Duel.Fields[player].SpellZone[6+id];
}
}
public int GetStringId(int id, int option)
{
return id * 16 + option;
......
......@@ -221,8 +221,8 @@ namespace WindBot.Game.AI.Decks
{
if (Card.Location == CardLocation.Grave)
{
ClientCard l = Duel.Fields[0].SpellZone[6];
ClientCard r = Duel.Fields[0].SpellZone[7];
ClientCard l = AI.Utils.GetPZone(0, 0);
ClientCard r = AI.Utils.GetPZone(0, 1);
if (l == null && r == null)
AI.SelectCard((int)CardId.机壳工具丑恶);
}
......@@ -233,8 +233,8 @@ namespace WindBot.Game.AI.Decks
{
if (Card.Location != CardLocation.Hand)
return false;
ClientCard l = Duel.Fields[0].SpellZone[6];
ClientCard r = Duel.Fields[0].SpellZone[7];
ClientCard l = AI.Utils.GetPZone(0, 0);
ClientCard r = AI.Utils.GetPZone(0, 1);
if (l == null && r == null)
return true;
if (l == null && r.RScale != Card.LScale)
......@@ -259,8 +259,8 @@ namespace WindBot.Game.AI.Decks
if (card.HasType(CardType.Pendulum) && card.IsFaceup())
count++;
}
ClientCard l = Duel.Fields[0].SpellZone[6];
ClientCard r = Duel.Fields[0].SpellZone[7];
ClientCard l = AI.Utils.GetPZone(0, 0);
ClientCard r = AI.Utils.GetPZone(0, 1);
if (l == null && r == null)
{
if (已发动削命)
......@@ -406,8 +406,8 @@ namespace WindBot.Game.AI.Decks
private bool 应进行灵摆召唤()
{
ClientCard l = Duel.Fields[0].SpellZone[6];
ClientCard r = Duel.Fields[0].SpellZone[7];
ClientCard l = AI.Utils.GetPZone(0, 0);
ClientCard r = AI.Utils.GetPZone(0, 1);
if (l != null && r != null && l.LScale != r.RScale)
{
int count = 0;
......
......@@ -6,6 +6,7 @@ namespace WindBot.Game
public class Duel
{
public bool IsFirst { get; set; }
public bool IsNewRule { get; set; }
public int[] LifePoints { get; private set; }
public ClientField[] Fields { get; private set; }
......
......@@ -120,6 +120,11 @@ namespace WindBot.Game
private void OnJoinGame(BinaryReader packet)
{
/*int lflist = (int)*/ packet.ReadUInt32();
/*int rule = */ packet.ReadByte();
/*int mode = */ packet.ReadByte();
int duel_rule = packet.ReadByte();
_ai.Duel.IsNewRule = (duel_rule == 4);
BinaryWriter deck = GamePacketFactory.Create(CtosMessage.UpdateDeck);
deck.Write(Deck.Cards.Count + Deck.ExtraCards.Count);
deck.Write(Deck.SideCards.Count);
......
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