Exemplo n.º 1
0
    public void Excute(stReturnSelfTokenTAskScriptUserCmd_S cmd)
    {
        RewardMisssionMgr taskMgr = DataManager.Manager <TaskDataManager>().RewardMisssionData;

        if (taskMgr != null)
        {
            taskMgr.InitTask(cmd.data, cmd.acceptTaskRemain, cmd.publicTaskRemain);
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// 添加cd显示
    /// </summary>
    /// <returns></returns>
    string AddCdFormat(string strDesc)
    {
        RewardMisssionMgr rewardMisssionMgr = DataManager.Manager <TaskDataManager>().RewardMisssionData;

        if (rewardMisssionMgr != null)
        {
            if (rewardMisssionMgr.receiveReward != null)
            {
                uint leftTime = (uint)rewardMisssionMgr.receiveReward.nleftTime;
                //string strCd = string.Format("<color value=\"red\">{0}</color>", StringUtil.GetStringBySeconds(leftTime));
                string strCd = string.Format("[ff0000]{0}[-]", StringUtil.GetStringBySeconds(leftTime));

                strDesc = strDesc.Insert(strDesc.Length, strCd);
            }
        }
        return(strDesc);
    }
Exemplo n.º 3
0
    public void FormatXmlName()
    {
        if (taskType == GameCmd.TaskType.TaskType_Normal)
        {
            m_strXmlName = string.Format("[主]{0}", m_clienDB.strName);
        }
        else if (taskType == GameCmd.TaskType.TaskType_Sub)
        {
            m_strXmlName = string.Format("[支]{0}", m_clienDB.strName);
        }

        else if (taskType == GameCmd.TaskType.TaskType_Clan)
        {
            m_strXmlName = string.Format("[{0}]{1}",
                                         DataManager.Manager <TextManager>().GetLocalText(LocalTextType.Local_TXT_Clan)
                                         , m_clienDB.strName);
        }
        //日环
        else if (taskType == GameCmd.TaskType.TaskType_Loop)
        {
            int Ring = DataManager.Manager <TaskDataManager>().Ring;

            Ring = Ring > 10 ? Ring - 10 : Ring;

            if (Ring > 0)
            {
                m_strXmlName = string.Format("[日]{0}({1}/{2})", m_clienDB.strName, Ring, maxRing);
            }
            else
            {
                m_strXmlName = string.Format("[日]{0}", m_clienDB.strName);
            }
        }
        //如果是悬赏任务 要加上已经接了多少次
        else if (taskType == GameCmd.TaskType.TaskType_Token)
        {
            RewardMisssionMgr rmm = DataManager.Manager <TaskDataManager>().RewardMisssionData;
            m_strXmlName = string.Format("[日]{0}({1}/{2})", m_clienDB.strName, rmm.RewardAcceptTimes, rmm.RewardAcceptAllTimes);
        }
        else
        {
            m_strXmlName = string.Format("[日]{0}", m_clienDB.strName);
        }
    }
Exemplo n.º 4
0
    public void Initialize()
    {
        CompleteTask = new Dictionary <uint, uint>();

        Engine.Utility.EventEngine.Instance().AddEventListener((int)Client.GameEventID.TASK_VISITNPC, OnEvent);
        Engine.Utility.EventEngine.Instance().AddEventListener((int)Client.GameEventID.SYSTEM_LOADUICOMPELETE, OnEvent);
        //Engine.Utility.EventEngine.Instance().AddEventListener((int)Client.GameEventID.NETWORK_CONNECTE_CLOSE, OnEvent);
        Engine.Utility.EventEngine.Instance().AddEventListener((int)Client.GameEventID.RECONNECT_SUCESS, OnEvent);
        Engine.Utility.EventEngine.Instance().AddVoteListener((int)Client.GameVoteEventID.TASK_VISITNPC_COLLECT, OnVote);
        Engine.Utility.EventEngine.Instance().AddEventListener((int)Client.GameEventID.TASK_ITEM_COLLECT_USE, OnEvent);
        Engine.Utility.EventEngine.Instance().AddEventListener((int)Client.GameEventID.ENTITYSYSTEM_CREATEENTITY, OnEvent);
        Engine.Utility.EventEngine.Instance().AddEventListener((int)Client.GameEventID.ENTITYSYSTEM_REMOVEENTITY, OnEvent);
        Engine.Utility.EventEngine.Instance().AddEventListener((int)Client.GameEventID.TASK_CANSUBMIT, OnEvent);

        m_DictNpceffect = new Dictionary <uint, int>();
        //IsShowSlider = false;

        QuestTranceManager.Instance.Initialize();
        NpcHeadTipsManager.Instance.Initialize();
        m_RewardMisssionMgr = new RewardMisssionMgr();
        AutoMission.Instance.Initialize();
    }