Exemple #1
0
    /** "Channel" phase */
    CGTurnState Phase1()
    {
        Debug.Log("Phase 1: Channel phase");

        //SendPhaseTransition("Channel step");

        List <SpellChannelData> commandData = new List <SpellChannelData>();

        foreach (CGCardObject card in m_activePlayer.GetSpells())
        {
            // Channel the spell
            card.ChannelSpell();

            // Send channel data to client
            SpellChannelData data = new SpellChannelData();
            data.cardID     = card.m_cardID;
            data.playerID   = m_activePlayerID;
            data.newChannel = card.GetTimeRemaining();
            commandData.Add(data);
        }

        CGC_ChannelSpell command = new CGC_ChannelSpell(commandData);

        m_connection.TransmitStream(command.PackCommand(), 0);
        m_connection.TransmitStream(command.PackCommand(), 1);

        ResolveStack();

        return(CGTurnState.DEFAULT);
    }
Exemple #2
0
    public override void UnpackCommand(BKSystem.IO.BitStream packet)
    {
        int dataCount;

        packet.Read(out dataCount, 0, 16);
        for (int i = 0; i < dataCount; i++)
        {
            SpellChannelData data = new SpellChannelData();
            packet.Read(out data.cardID, 0, 16);
            packet.Read(out data.playerID, 0, 8);
            packet.Read(out data.newChannel, 0, 5);
            m_data.Add(data);
        }
    }
Exemple #3
0
    /** "Channel" phase */
    CGTurnState Phase1()
    {
        Debug.Log("Phase 1: Channel phase");
        List <SpellChannelData> commandData = new List <SpellChannelData>();

        foreach (CGCardObject card in m_activePlayer.GetSpells())
        {
            card.ChannelSpell();

            SpellChannelData data = new SpellChannelData();
            data.cardID     = card.m_cardID;
            data.playerID   = m_activePlayerID;
            data.newChannel = card.GetTimeRemaining();
            commandData.Add(data);
        }

        CGC_ChannelSpell command = new CGC_ChannelSpell(commandData);

        CGVisualManager.instance.AddCommand(command);

        ResolveStack();

        return(CGTurnState.DEFAULT);
    }