| | |
| | | {
|
| | | 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 配置
|
| | |
| | | public Dictionary<int, Dictionary<int, List<SkillConfig>>> skillActDict { get; private set; }
|
| | | public List<int> betterPassSkills { get; private set; }
|
| | | public bool jumpToPass { get; set; }
|
| | | public int minTaskHole { get; private set; }
|
| | | public int maxTaskHole { get; private set; }
|
| | | public int immediatelyUnlockTask { get; private set; }
|
| | | void ParseConfig()
|
| | | {
|
| | | for (int i = 1; i <= 3; i++)
|
| | |
| | | PassSkillLimit limit = JsonMapper.ToObject<PassSkillLimit>(jsonData[key].ToJson());
|
| | | limit.hole = int.Parse(key);
|
| | | passSkillLimits.Add(limit);
|
| | | if (minTaskHole == 0 && limit.OpenSkillSlots > 0)
|
| | | {
|
| | | minTaskHole = limit.OpenSkillSlots;
|
| | | }
|
| | | if (limit.OpenSkillSlots > maxTaskHole)
|
| | | {
|
| | | maxTaskHole = limit.OpenSkillSlots;
|
| | | }
|
| | | }
|
| | | passEquipCnt = int.Parse(funcCfg.Numerical2);
|
| | | taskHoleDict = ConfigParse.GetDic<int, int>(funcCfg.Numerical4);
|
| | | }
|
| | | funcCfg = Config.Instance.Get<FuncConfigConfig>("PassiveSkillTask");
|
| | | immediatelyUnlockTask = int.Parse(funcCfg.Numerical2);
|
| | | 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 uint 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))
|
| | | {
|
| | | uint value = 0;
|
| | | uint.TryParse(task._DicTaskInformation[1][TASKHOLEKEY], out value);
|
| | | return MathUtility.GetBitValue(value, (ushort)condition);
|
| | | //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))
|
| | | {
|
| | | uint result = 0;
|
| | | uint.TryParse(dict[TASKHOLEKEY], out result);
|
| | | if (playerLoginOk)
|
| | | {
|
| | | for (int k = minTaskHole; k <= maxTaskHole; k++)
|
| | | {
|
| | | if (!MathUtility.GetBitValue(taskHoleCondition, (ushort)k)
|
| | | && MathUtility.GetBitValue(result, (ushort)k))
|
| | | {
|
| | | UnlockPassHole = k;
|
| | | }
|
| | | }
|
| | | if (taskUnlockUpdate != null)
|
| | | {
|
| | | taskUnlockUpdate();
|
| | | }
|
| | | }
|
| | | taskHoleCondition = result;
|
| | | }
|
| | | }
|
| | | UpdateTaskHoleRedpoint();
|
| | | }
|
| | |
|
| | | 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;
|
| | | }
|
| | |
| | | }
|
| | | playerLoginOk = true;
|
| | | UpdateRedpoint();
|
| | | UpdateTaskHoleRedpoint();
|
| | | }
|
| | |
|
| | | public void CheckEquipPassSkill(PlayerSkillData _skill)
|
| | |
| | | DayRemind.Instance.SetDayRemind(DayRemind.PASS_SKILL_REDPOINT, true);
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | public Redpoint taskHoleRedpoint = new Redpoint(10302, 1030299);
|
| | | void UpdateTaskHoleRedpoint()
|
| | | {
|
| | | taskHoleRedpoint.state = RedPointState.None;
|
| | | if (DayRemind.Instance.GetDayRemind(DayRemind.TASK_SKILL_HOLE))
|
| | | {
|
| | | return;
|
| | | }
|
| | | foreach (var hole in taskHoleDict.Keys)
|
| | | {
|
| | | var taskId = taskHoleDict[hole];
|
| | | if (taskId == immediatelyUnlockTask)
|
| | | {
|
| | | var config = Config.Instance.Get<PyTaskConfig>(taskId);
|
| | | if (PlayerDatas.Instance.baseData.LV >= config.lv
|
| | | && !IsTaskHoleUnlock(hole))
|
| | | {
|
| | | taskHoleRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void SetTaskHoleRemind()
|
| | | {
|
| | | DayRemind.Instance.SetDayRemind(DayRemind.TASK_SKILL_HOLE, true);
|
| | | UpdateTaskHoleRedpoint();
|
| | | }
|
| | | #endregion
|
| | |
|
| | | private void OnFuncStateChangeEvent(int _id)
|
| | |
| | | if (_id == 109)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | UpdateTaskHoleRedpoint();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public int level;
|
| | | public int vipLv;
|
| | | public int MountLv;
|
| | | public int OpenSkillSlots;
|
| | | }
|
| | |
|
| | | [Serializable]
|