private void OnChaining(GameServerPacket packet)
        {
            packet.ReadInt32();             // card id
            int        pcc  = GetLocalPlayer(packet.ReadByte());
            int        pcl  = packet.ReadByte();
            int        pcs  = packet.ReadSByte();
            int        subs = packet.ReadSByte();
            ClientCard card = _duel.GetCard(pcc, pcl, pcs, subs);
            int        cc   = GetLocalPlayer(packet.ReadByte());

            _ai.OnChaining(card, cc);
        }
        private void OnMove(GameServerPacket packet)
        {
            int cardId = packet.ReadInt32();
            int pc     = GetLocalPlayer(packet.ReadByte());
            int pl     = packet.ReadByte();
            int ps     = packet.ReadSByte();

            packet.ReadSByte();             // pp
            int cc = GetLocalPlayer(packet.ReadByte());
            int cl = packet.ReadByte();
            int cs = packet.ReadSByte();
            int cp = packet.ReadSByte();

            packet.ReadInt32();             // reason

            ClientCard card = _duel.GetCard(pc, (CardLocation)pl, ps);

            if ((pl & (int)CardLocation.Overlay) != 0)
            {
                pl   = pl & 0x7f;
                card = _duel.GetCard(pc, (CardLocation)pl, ps);
                if (card != null)
                {
                    card.Overlays.Remove(cardId);
                }
            }
            else
            {
                _duel.RemoveCard((CardLocation)pl, card, pc, ps);
            }

            if ((cl & (int)CardLocation.Overlay) != 0)
            {
                cl   = cl & 0x7f;
                card = _duel.GetCard(cc, (CardLocation)cl, cs);
                if (card != null)
                {
                    card.Overlays.Add(cardId);
                }
            }
            else
            {
                _duel.AddCard((CardLocation)cl, cardId, cc, cs, cp);
                if ((pl & (int)CardLocation.Overlay) == 0 && card != null)
                {
                    ClientCard newcard = _duel.GetCard(cc, (CardLocation)cl, cs);
                    if (newcard != null)
                    {
                        newcard.Overlays.AddRange(card.Overlays);
                    }
                }
            }
        }
Exemple #3
0
        private void OnChaining(GameServerPacket packet)
        {
            packet.ReadInt32(); // card id
            int pcc = GetLocalPlayer(packet.ReadByte());
            int pcl = packet.ReadByte();
            int pcs = packet.ReadSByte();

            packet.ReadSByte(); // subs
            ClientCard card = m_duel.GetCard(pcc, (CardLocation)pcl, pcs);
            int        cc   = GetLocalPlayer(packet.ReadByte());

            m_ai.OnChaining(card, cc);
        }
        private void OnPosChange(GameServerPacket packet)
        {
            packet.ReadInt32();             // card id
            int pc = GetLocalPlayer(packet.ReadByte());
            int pl = packet.ReadByte();
            int ps = packet.ReadSByte();

            packet.ReadSByte();             // pp
            int        cp   = packet.ReadSByte();
            ClientCard card = _duel.GetCard(pc, (CardLocation)pl, ps);

            if (card != null)
            {
                card.Position = cp;
            }
        }
Exemple #5
0
        private void OnMove(GameServerPacket packet)
        {
            int cardId = packet.ReadInt32();
            int pc     = GetLocalPlayer(packet.ReadByte());
            int pl     = packet.ReadByte();
            int ps     = packet.ReadSByte();

            packet.ReadSByte(); // pp
            int cc = GetLocalPlayer(packet.ReadByte());
            int cl = packet.ReadByte();
            int cs = packet.ReadSByte();
            int cp = packet.ReadSByte();

            packet.ReadInt32(); // reason

            ClientCard card = m_duel.GetCard(pc, (CardLocation)pl, ps);

            m_duel.RemoveCard((CardLocation)pl, card, pc, ps);
            m_duel.AddCard((CardLocation)cl, cardId, cc, cs, cp);
        }