| | |
| | | {
|
| | | ParseConfig();
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | PlayerTaskDatas.Event_TaskInformation += TaskInformationUpdate;
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
|
| | | PlayerTaskDatas.Event_TaskInformation -= TaskInformationUpdate;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | | equipPassSkills.Clear();
|
| | | playerLoginOk = false;
|
| | | equipPassPage = false;
|
| | | taskHoleCondition = 0;
|
| | | }
|
| | |
|
| | | #region 配置
|
| | |
| | | passSkillLimits.Add(limit);
|
| | | }
|
| | | passEquipCnt = int.Parse(funcCfg.Numerical2);
|
| | | taskHoleDict = ConfigParse.GetDic<int, int>(funcCfg.Numerical4);
|
| | | }
|
| | | funcCfg = Config.Instance.Get<FuncConfigConfig>("PassSkillEquipGetWay");
|
| | | if (funcCfg != null)
|
| | |
| | | public int presentEquipPage { get; private set; }
|
| | | public bool playerLoginOk = false;
|
| | | private Dictionary<int, Dictionary<int, int>> equipPassSkills = new Dictionary<int, Dictionary<int, int>>();
|
| | | public Dictionary<int, int> taskHoleDict { get; private set; }
|
| | | public event Action UpdatePassEquipSkillEvent;
|
| | | public bool equipPassPage { get; set; }
|
| | | public bool TryGetEquipPassSkills(int page, int hole, out int _skillId)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public event Action taskUnlockUpdate;
|
| | |
|
| | | public int taskHoleCondition { get; private set; }
|
| | |
|
| | | public const string TASKHOLEKEY = "OpenSkillSlots";
|
| | |
|
| | | public int UnlockPassHole
|
| | | {
|
| | | get { return LocalSave.GetInt(StringUtility.Contact(TASKHOLEKEY, "_", PlayerDatas.Instance.baseData.PlayerID)); }
|
| | | set { LocalSave.SetInt(StringUtility.Contact(TASKHOLEKEY, "_", PlayerDatas.Instance.baseData.PlayerID), value); }
|
| | | }
|
| | |
|
| | | public bool IsTaskHoleUnlock(int condition)
|
| | | {
|
| | | if (task._DicTaskInformation.ContainsKey(1)
|
| | | && task._DicTaskInformation[1].ContainsKey(TASKHOLEKEY))
|
| | | {
|
| | | var value = 0;
|
| | | int.TryParse(task._DicTaskInformation[1][TASKHOLEKEY], out value);
|
| | | return value >= condition;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | private void TaskInformationUpdate(int _id, Dictionary<int, Dictionary<string, string>> _Dic)
|
| | | {
|
| | | if (_Dic != null && _Dic.ContainsKey(1))
|
| | | {
|
| | | var dict = _Dic[1];
|
| | | if (dict.ContainsKey(TASKHOLEKEY))
|
| | | {
|
| | | var result = 0;
|
| | | int.TryParse(dict[TASKHOLEKEY], out result);
|
| | | if (result != taskHoleCondition && playerLoginOk)
|
| | | {
|
| | | UnlockPassHole = result;
|
| | | if (taskUnlockUpdate != null)
|
| | | {
|
| | | taskUnlockUpdate();
|
| | | }
|
| | | }
|
| | | taskHoleCondition = result;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | RolePromoteModel m_PromoteModel;
|
| | | RolePromoteModel promoteModel
|
| | | {
|
| | |
| | | return m_PromoteModel ?? (m_PromoteModel = ModelCenter.Instance.GetModel<RolePromoteModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | PlayerTaskDatas task { get { return ModelCenter.Instance.GetModel<PlayerTaskDatas>(); } }
|
| | |
|
| | | public void SendEquipPassSkill(int _page, int _index, int _skillId)
|
| | | {
|
| | |
| | | else if (limit.MountLv > 0)
|
| | | {
|
| | | if (promoteModel.GetMountTotallv() < limit.MountLv)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | else if (limit.OpenSkillSlots > 0)
|
| | | {
|
| | | if (!IsTaskHoleUnlock(limit.OpenSkillSlots))
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
| | | public int level;
|
| | | public int vipLv;
|
| | | public int MountLv;
|
| | | public int OpenSkillSlots;
|
| | | }
|
| | |
|
| | | [Serializable]
|