Exemplo n.º 1
0
    void OnBackTown()
    {
        if (sdGameLevel.instance.levelType == sdGameLevel.LevelType.PVP)
        {
            sdPVPManager.Instance.KillMe(null);
            sdUICharacter.Instance.HideConfigWnd(true);
        }
        else if (sdGameLevel.instance.levelType == sdGameLevel.LevelType.WorldBoss ||
                 sdGameLevel.instance.levelType == sdGameLevel.LevelType.LapBoss)
        {
            //退出世界Boss场景..
            sdActGameMsg.Send_CS_WB_RESULT_REQ(1);
            sdUICharacter.Instance.HideConfigWnd(true);
            sdUICharacter.Instance.TuiTu_To_WorldMap();
        }
        else
        {
            CliProto.CS_LEVEL_RESULT_NTF refMSG = new CliProto.CS_LEVEL_RESULT_NTF();
            refMSG.m_Result = 1; // 主动放弃当前关卡.
            SDNetGlobal.SendMessage(refMSG);


            sdUICharacter.Instance.HideConfigWnd(true);
            sdUICharacter.Instance.TuiTu_To_WorldMap();
        }
    }
Exemplo n.º 2
0
    void OnFail()
    {
        CliProto.CS_LEVEL_RESULT_NTF refMSG = new CliProto.CS_LEVEL_RESULT_NTF();
        refMSG.m_Result = 1; // 主动放弃当前关卡.
        SDNetGlobal.SendMessage(refMSG);

        sdUICharacter.Instance.ShowPTWnd(true);
    }
Exemplo n.º 3
0
    //发送结算协议..
    public static void Send_CS_LEVEL_RESULT_NTF()
    {
        sdUICharacter.Instance.oldExp   = int.Parse(sdGameLevel.instance.mainChar.Property["Experience"].ToString());
        sdUICharacter.Instance.oldLevel = int.Parse(sdGameLevel.instance.mainChar.Property["Level"].ToString());

        CliProto.CS_LEVEL_RESULT_NTF refMSG = new CliProto.CS_LEVEL_RESULT_NTF();
        refMSG.m_Result = 0;

        refMSG.m_Money = (uint)SDGlobal.tmpBag.money;
        if (SDGlobal.tmpBag.itemList.Count > 0)
        {
            refMSG.m_Item      = new CliProto.SDropInfo[SDGlobal.tmpBag.itemList.Count];
            refMSG.m_ItemCount = (ushort)SDGlobal.tmpBag.itemList.Count;

            for (int i = 0; i < refMSG.m_Item.Length; i++)
            {
                refMSG.m_Item[i] = new CliProto.SDropInfo();
                refMSG.m_Item[i].m_TemplateID = (uint)SDGlobal.tmpBag.itemList[i].itemId;
                refMSG.m_Item[i].m_Count      = (ushort)SDGlobal.tmpBag.itemList[i].itemCount;
            }
        }

        //refMSG.m_Potion0Count = (ushort)sdUICharacter.Instance.MedicineNum();
        refMSG.m_ReliveCount = (ushort)sdUICharacter.Instance.ReliveNum();

        //深渊结算评级需要特殊处理..
        if (sdUICharacter.Instance.GetBattleType() == (byte)HeaderProto.LEVEL_BATTLE_TYPE.LEVEL_BATTLE_TYPE_ABYSS)
        {
            //消耗Boss的血量..
            refMSG.m_ActivityAbyssTotalDamage = (int)(sdActGameMgr.Instance.m_uuLapBossLastBlood - sdActGameMgr.Instance.m_uuLapBossNowBlood);
            sdUICharacter.Instance.fightScore = (int)sdConfDataMgr.Instance().GetLapBossResult(sdLevelInfo.GetCurLevelId(),
                                                                                               sdActGameMgr.Instance.m_uuLapBossLastBlood,
                                                                                               refMSG.m_ActivityAbyssTotalDamage);
        }
        else
        {
            sdUICharacter.Instance.fightScore = (int)sdConfDataMgr.Instance().GetResult(sdLevelInfo.GetCurLevelId(), sdUICharacter.Instance.fightTime);
        }

        refMSG.m_CompleteResult = (byte)sdUICharacter.Instance.fightScore;
        //结算类型..
        refMSG.m_LevelBattleType = sdUICharacter.Instance.GetBattleType();
        //深渊BOSS消耗的血量..
        refMSG.m_ActivityAbyssTotalDamage = (int)(sdActGameMgr.Instance.m_uuLapBossLastBlood - sdActGameMgr.Instance.m_uuLapBossNowBlood);

        SDNetGlobal.SendMessage(refMSG);
    }
Exemplo n.º 4
0
    // 发送结算消息aa
    public void ShowFightResult(GameObject boss)
    {
        sdUICharacter.Instance.oldExp   = int.Parse(sdGameLevel.instance.mainChar.Property["Experience"].ToString());
        sdUICharacter.Instance.oldLevel = int.Parse(sdGameLevel.instance.mainChar.Property["Level"].ToString());
        CliProto.CS_LEVEL_RESULT_NTF refMSG = new CliProto.CS_LEVEL_RESULT_NTF();

        if (sdGameLevel.instance.levelType != sdGameLevel.LevelType.PET_TRAIN)
        {
            sdGameMonster monster = boss.GetComponent <sdGameMonster>();
            if (monster.DropInfo != null)
            {
                refMSG.m_Item      = new CliProto.SDropInfo[monster.DropInfo.items.Length];
                refMSG.m_ItemCount = (ushort)monster.DropInfo.items.Length;
                int i = 0;
                foreach (int id in monster.DropInfo.items)
                {
                    refMSG.m_Item[i] = new CliProto.SDropInfo();
                    refMSG.m_Item[i].m_TemplateID = (uint)id;
                    refMSG.m_Item[i].m_Count      = (ushort)1;
                    ++i;
                }
                refMSG.m_Money = (uint)(SDGlobal.tmpBag.money + monster.DropInfo.money);
            }
        }
        else
        {
            if (SDGlobal.tmpBag.itemList.Count > 0)
            {
                refMSG.m_Item      = new CliProto.SDropInfo[SDGlobal.tmpBag.itemList.Count];
                refMSG.m_ItemCount = (ushort)SDGlobal.tmpBag.itemList.Count;

                for (int i = 0; i < refMSG.m_Item.Length; i++)
                {
                    refMSG.m_Item[i] = new CliProto.SDropInfo();
                    refMSG.m_Item[i].m_TemplateID = (uint)SDGlobal.tmpBag.itemList[i].itemId;
                    refMSG.m_Item[i].m_Count      = (ushort)SDGlobal.tmpBag.itemList[i].itemCount;
                }
            }
        }

        refMSG.m_Result = 0;

        //refMSG.m_Potion0Count = (ushort)sdUICharacter.Instance.MedicineNum();
        refMSG.m_ReliveCount = (ushort)sdUICharacter.Instance.ReliveNum();

        // 深渊结算评级需要特殊处理aa
        if (sdUICharacter.Instance.GetBattleType() == (byte)HeaderProto.LEVEL_BATTLE_TYPE.LEVEL_BATTLE_TYPE_ABYSS)
        {
            //消耗Boss的血量..
            refMSG.m_ActivityAbyssTotalDamage = (int)(sdActGameMgr.Instance.m_uuLapBossLastBlood - sdActGameMgr.Instance.m_uuLapBossNowBlood);
            sdUICharacter.Instance.fightScore = (int)sdConfDataMgr.Instance().GetLapBossResult(sdLevelInfo.GetCurLevelId(),
                                                                                               sdActGameMgr.Instance.m_uuLapBossLastBlood,
                                                                                               refMSG.m_ActivityAbyssTotalDamage);
        }
        else
        {
            sdUICharacter.Instance.fightScore = (int)sdConfDataMgr.Instance().GetResult(sdLevelInfo.GetCurLevelId(), sdUICharacter.Instance.fightTime);
        }

        refMSG.m_CompleteResult  = (byte)sdUICharacter.Instance.fightScore;
        refMSG.m_LevelBattleType = sdUICharacter.Instance.GetBattleType();              //< 结算类型aa

        SDNetGlobal.SendMessage(refMSG);
        //gameObject.SetActive(false);
    }