// 从已经出牌区域删除一个卡牌,这个目前就是战斗删除 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); } } }
// 对方信息 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(); } }
// 添加一个卡牌 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); } } }
// 清除自己的卡牌(除了手牌)的攻击次数 protected void psstNotifyResetAttackTimesUserCmd(ByteBuffer bu) { UISceneDZ uiSceneDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ); if (uiSceneDZ != null && uiSceneDZ.isVisible()) { uiSceneDZ.psstNotifyResetAttackTimesUserCmd(); } }
protected void psstNotifyBattleFlowEndUserCmd(ByteBuffer bu) { UISceneDZ uiSceneDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ); if (uiSceneDZ != null && uiSceneDZ.isVisible()) { uiSceneDZ.psstNotifyBattleFlowEndUserCmd(bu); } }
// enemy 增加一个卡牌 protected void psstAddEnemyHandCardPropertyUserCmd(ByteBuffer bu) { UISceneDZ uiSceneDZ = Ctx.m_instance.m_uiSceneMgr.getSceneUI <UISceneDZ>(UISceneFormID.eUISceneDZ); if (uiSceneDZ != null && uiSceneDZ.isVisible()) { uiSceneDZ.psstAddEnemyHandCardPropertyUserCmd(); } }
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); } }
// 法术攻击失败 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); } }
// 刷新战斗状态 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); } }
// 返回 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); } }
// 回归剩余卡牌数量 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); } }
// 第一次几张牌 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); } }
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); } }
// 返回当前谁出牌 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); } }
// 卡牌移动 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); } }