示例#1
0
        // 从已经出牌区域删除一个卡牌,这个目前就是战斗删除
        protected void psstRetRemoveBattleCardUserCmd(ByteBuffer bu)
        {
            stRetRemoveBattleCardUserCmd cmd = new stRetRemoveBattleCardUserCmd();

            cmd.derialize(bu);

            Ctx.m_instance.m_logSys.log(string.Format("删除一个卡牌 thisid: {0}", cmd.dwThisID));

            int           side      = 0;
            SceneCardItem sceneItem = null;

            if (!Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[0].removeOneSceneCardByThisID(cmd.dwThisID, ref sceneItem))
            {
                side = 1;
                Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[1].removeOneSceneCardByThisID(cmd.dwThisID, ref sceneItem);
            }
            UISceneDZ uiSceneDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ);

            if (uiSceneDZ != null && uiSceneDZ.isVisible())
            {
                if (sceneItem != null)
                {
                    uiSceneDZ.psstRetRemoveBattleCardUserCmd(cmd, side, sceneItem);
                }
            }
        }
示例#2
0
        // 对方信息
        protected void psstNotifyFightEnemyInfoUserCmd(ByteBuffer bu)
        {
            Ctx.m_instance.m_logSys.log("开始客户端初始动画播放");

            stNotifyFightEnemyInfoUserCmd cmd = new stNotifyFightEnemyInfoUserCmd();

            cmd.derialize(bu);

            Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[(int)EnDZPlayer.ePlayerEnemy].m_heroName       = cmd.name;
            Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[(int)EnDZPlayer.ePlayerEnemy].m_heroOccupation = cmd.occupation;

            UISceneDZ uiSceneDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ);

            if (uiSceneDZ != null && uiSceneDZ.isVisible())
            {
                uiSceneDZ.psstNotifyFightEnemyInfoUserCmd(cmd);
            }

            IUIDZ uiDZ = Ctx.m_instance.m_uiMgr.getForm(UIFormID.eUIDZ) as IUIDZ;

            if (uiDZ != null)
            {
                uiDZ.psstNotifyFightEnemyInfoUserCmd();
            }
        }
示例#3
0
        // 添加一个卡牌
        protected void psstAddBattleCardPropertyUserCmd(ByteBuffer bu)
        {
            stAddBattleCardPropertyUserCmd cmd = new stAddBattleCardPropertyUserCmd();

            cmd.derialize(bu);

            Ctx.m_instance.m_logSys.log(string.Format("添加一个卡牌 thisid: {0}", cmd.mobject.qwThisID));

            if (cmd.byActionType == 1)
            {
                // 填充数据
                cmd.sceneItem = Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[cmd.who - 1].createCardItemBySvrData((EnDZPlayer)(cmd.who - 1), cmd.mobject);
                Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[cmd.who - 1].addOneSceneCard(cmd.sceneItem);       // 添加数据
            }
            else
            {
                cmd.sceneItem = Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[cmd.who - 1].updateCardInfoByCardItem(cmd.mobject);
            }

            if (cmd.sceneItem != null)      // 更新或者添加都需要这个数据必须存在
            {
                UISceneDZ uiDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ);
                if (uiDZ != null && uiDZ.isVisible())
                {
                    uiDZ.psstAddBattleCardPropertyUserCmd(cmd);
                }
            }
        }
示例#4
0
        // 清除自己的卡牌(除了手牌)的攻击次数
        protected void psstNotifyResetAttackTimesUserCmd(ByteBuffer bu)
        {
            UISceneDZ uiSceneDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ);

            if (uiSceneDZ != null && uiSceneDZ.isVisible())
            {
                uiSceneDZ.psstNotifyResetAttackTimesUserCmd();
            }
        }
示例#5
0
        protected void psstNotifyBattleFlowEndUserCmd(ByteBuffer bu)
        {
            UISceneDZ uiSceneDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ);

            if (uiSceneDZ != null && uiSceneDZ.isVisible())
            {
                uiSceneDZ.psstNotifyBattleFlowEndUserCmd(bu);
            }
        }
示例#6
0
        // enemy 增加一个卡牌
        protected void psstAddEnemyHandCardPropertyUserCmd(ByteBuffer bu)
        {
            UISceneDZ uiSceneDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ);

            if (uiSceneDZ != null && uiSceneDZ.isVisible())
            {
                uiSceneDZ.psstAddEnemyHandCardPropertyUserCmd();
            }
        }
示例#7
0
        protected void psstNotifyOutCardInfoUserCmd(ByteBuffer bu)
        {
            stNotifyOutCardInfoUserCmd cmd = new stNotifyOutCardInfoUserCmd();

            cmd.derialize(bu);

            UISceneDZ uiSceneDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ);

            if (uiSceneDZ != null && uiSceneDZ.isVisible())
            {
                uiSceneDZ.psstNotifyOutCardInfoUserCmd(cmd);
            }
        }
示例#8
0
        // 法术攻击失败
        protected void psstRetCardAttackFailUserCmd(ByteBuffer bu)
        {
            stRetCardAttackFailUserCmd cmd = new stRetCardAttackFailUserCmd();

            cmd.derialize(bu);
            // 将不能使用的法术牌退回去
            UISceneDZ uiSceneDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ);

            if (uiSceneDZ != null && uiSceneDZ.isVisible())
            {
                uiSceneDZ.psstRetCardAttackFailUserCmd(cmd);
            }
        }
示例#9
0
        // 刷新战斗状态
        protected void psstRetRefreshBattleStateUserCmd(ByteBuffer bu)
        {
            stRetRefreshBattleStateUserCmd cmd = new stRetRefreshBattleStateUserCmd();

            cmd.derialize(bu);

            Ctx.m_instance.m_dataPlayer.m_dzData.m_state = cmd.state;

            UISceneDZ uiDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ);

            if (uiDZ != null && uiDZ.isVisible())
            {
                uiDZ.psstRetRefreshBattleStateUserCmd(cmd);
            }
        }
示例#10
0
        // 返回 magic 点的数量
        protected void psstRetMagicPointInfoUserCmd(ByteBuffer bu)
        {
            stRetMagicPointInfoUserCmd cmd = new stRetMagicPointInfoUserCmd();

            cmd.derialize(bu);

            Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[(int)EnDZPlayer.ePlayerSelf].m_heroMagicPoint  = cmd.self;
            Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[(int)EnDZPlayer.ePlayerEnemy].m_heroMagicPoint = cmd.other;

            UISceneDZ uiDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ);

            if (uiDZ != null && uiDZ.isVisible())
            {
                uiDZ.psstRetMagicPointInfoUserCmd(cmd);
            }
        }
示例#11
0
        // 回归剩余卡牌数量
        protected void psstRetLeftCardLibNumUserCmd(ByteBuffer msg)
        {
            stRetLeftCardLibNumUserCmd cmd = new stRetLeftCardLibNumUserCmd();

            cmd.derialize(msg);

            Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[(int)EnDZPlayer.ePlayerSelf].m_leftCardNum  = cmd.selfNum;
            Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[(int)EnDZPlayer.ePlayerEnemy].m_leftCardNum = cmd.otherNum;

            UISceneDZ uiDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ);

            if (uiDZ != null && uiDZ.isVisible())
            {
                uiDZ.psstRetLeftCardLibNumUserCmd(cmd);
            }
        }
示例#12
0
        // 第一次几张牌
        protected void psstRetFirstHandCardUserCmd(ByteBuffer bu)
        {
            Ctx.m_instance.m_logSys.log("收到初始卡片列白");

            stRetFirstHandCardUserCmd cmd = new stRetFirstHandCardUserCmd();

            cmd.derialize(bu);

            Ctx.m_instance.m_dataPlayer.m_dzData.m_playerArr[(int)EnDZPlayer.ePlayerSelf].m_startCardList = cmd.id;

            UISceneDZ uiSceneDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ);

            if (uiSceneDZ != null && uiSceneDZ.isVisible())
            {
                uiSceneDZ.psstRetFirstHandCardUserCmd(cmd);
            }
        }
示例#13
0
        protected void psstRetBattleGameResultUserCmd(ByteBuffer bu)
        {
            stRetBattleGameResultUserCmd cmd = new stRetBattleGameResultUserCmd();

            cmd.derialize(bu);

            //if (cmd.win == 1 || cmd.win == 0)        // 赢了输了
            //{
            //    Ctx.m_instance.m_gameSys.loadGameScene();        // 加载游戏场景
            //}

            UISceneDZ uiSceneDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ);

            if (uiSceneDZ != null && uiSceneDZ.isVisible())
            {
                uiSceneDZ.psstRetBattleGameResultUserCmd(cmd);
            }
        }
示例#14
0
        // 返回当前谁出牌
        protected void psstRetRefreshBattlePrivilegeUserCmd(ByteBuffer bu)
        {
            // 增加当前出牌次数
            ++Ctx.m_instance.m_dataPlayer.m_dzData.curPlayCardCount;

            stRetRefreshBattlePrivilegeUserCmd cmd = new stRetRefreshBattlePrivilegeUserCmd();

            cmd.derialize(bu);

            Ctx.m_instance.m_dataPlayer.m_dzData.m_priv = cmd.priv;

            UISceneDZ uiDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ);

            if (uiDZ != null && uiDZ.isVisible())
            {
                uiDZ.psstRetRefreshBattlePrivilegeUserCmd(cmd);
            }
        }
示例#15
0
        // 卡牌移动
        protected void psstRetMoveGameCardUserCmd(ByteBuffer bu)
        {
            stRetMoveGameCardUserCmd cmd = new stRetMoveGameCardUserCmd();

            cmd.derialize(bu);

            if (cmd.success == 1)
            {
                // 更新数据
                cmd.side = Ctx.m_instance.m_dataPlayer.m_dzData.updateCardInfo(cmd);
            }

            UISceneDZ uiSceneDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ);

            if (uiSceneDZ != null && uiSceneDZ.isVisible())
            {
                uiSceneDZ.psstRetMoveGameCardUserCmd(cmd);
            }
        }