Пример #1
0
    public void SwitchKillModeOnOk()
    {
        if (m_nPKModle != (int)CharacterDefine.PKMODLE.KILL || m_nPKCDTime > 0)
        {
            Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

            if (_mainPlayer)
            {
                //发包请求切换
                CG_CHANGE_PKMODLE pkChange = (CG_CHANGE_PKMODLE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_CHANGE_PKMODLE);
                pkChange.SetObjId(_mainPlayer.ServerID);
                pkChange.SetPKModle((int)CharacterDefine.PKMODLE.KILL);
                pkChange.SendPacket();
            }
        }
        OnCloseClick();
        if (FunctionButtonLogic.Instance() != null)
        {
            FunctionButtonLogic.Instance().UpdateNewFunctionButtonState(FunctionButtonLogic.DynamicLogo.PKModel);
        }
    }
Пример #2
0
    void OnNormalModleClick()
    {
        Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

        if (_mainPlayer == null)
        {
            return;
        }
        if (m_nPKModle == (int)CharacterDefine.PKMODLE.NORMAL)
        {
            _mainPlayer.SendNoticMsg(false, "#{1108}");
            return;
        }
        if (m_nPKCDTime > 0)
        {
            int nMin    = m_nPKCDTime / 60000;
            int nSecond = (m_nPKCDTime % 60000) / 1000;
            //字典提示
            _mainPlayer.SendNoticMsg(false, "#{1110}", nMin, nSecond);
            return;
        }
        if (m_nPKModle != (int)CharacterDefine.PKMODLE.NORMAL && m_nPKCDTime <= 0)
        {
            //发包请求切换
            CG_CHANGE_PKMODLE pkChange = (CG_CHANGE_PKMODLE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_CHANGE_PKMODLE);
            pkChange.SetObjId(_mainPlayer.ServerID);
            pkChange.SetPKModle((int)CharacterDefine.PKMODLE.NORMAL);
            pkChange.SendPacket();
            OnCloseClick();
        }
        m_IsModeClick = true;
        if (FunctionButtonLogic.Instance() != null)
        {
            FunctionButtonLogic.Instance().UpdateNewFunctionButtonState(FunctionButtonLogic.DynamicLogo.PKModel);
        }
    }