| | |
| | | {
|
| | | Dictionary<int, TreasureSkill> treasureSkills = new Dictionary<int, TreasureSkill>();
|
| | | Dictionary<int, List<int>> jobTreasureSkills = new Dictionary<int, List<int>>();
|
| | | Dictionary<int, int> m_ExpertSkills = new Dictionary<int, int>();
|
| | |
|
| | | public List<int> skillLevelUpItems = new List<int>();
|
| | |
|
| | |
| | | public event Action<int> treasureSkillRefresh;
|
| | | public event Action<int> skillLevelUpRefresh;
|
| | | public event Action<int, int> potentialLevelRefresh;
|
| | | public event Action<int> expertSkillRefresh;
|
| | | public override void Init()
|
| | | {
|
| | | ParseConfig();
|
| | |
| | | {
|
| | | skill.Reset();
|
| | | }
|
| | | m_ExpertSkills.Clear();
|
| | | serverInited = false;
|
| | | }
|
| | |
|
| | |
| | | treasureSkills.Add(config.limitSkillId, treasureSkill);
|
| | | index++;
|
| | | }
|
| | | treasureSkill.potentials.Add(new TreasurePotential(config.id, 0,
|
| | | config.limitLevel, treasureSkill.redpoint.id));
|
| | | treasureSkill.potentials.Add(new TreasurePotential(config.id, 0, treasureSkill.redpoint.id));
|
| | | var skillConfig = SkillConfig.Get(config.limitSkillId);
|
| | |
|
| | | List<int> skills;
|
| | |
| | | return treasureSkills.TryGetValue(skillId, out treasureSkill);
|
| | | }
|
| | |
|
| | | public bool TryGetExpertSkill(int skillId,out int _skill)
|
| | | {
|
| | | return m_ExpertSkills.TryGetValue(skillId, out _skill);
|
| | | }
|
| | |
|
| | | public bool TryGetPotential(int skillId, out TreasurePotential potential)
|
| | | {
|
| | | var treasureSkillId = 0;
|
| | |
| | | return x.id == skillId;
|
| | | });
|
| | | return potential != null;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool IsPotentialUnlock(int skillId)
|
| | | {
|
| | | var treasureSkillId = 0;
|
| | | if (ContainsSkill(skillId, out treasureSkillId))
|
| | | {
|
| | | var treasureSkill = treasureSkills[treasureSkillId];
|
| | | TreasurePotential potential;
|
| | | if (TryGetPotential(skillId, out potential))
|
| | | {
|
| | | return treasureSkill.level >= potential.openLevel;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | |
|
| | | public void OnReceivePackage(HA309_tagMCSkillElementInfo package)
|
| | | {
|
| | | for (int i = 0; i < package.Cnt; i++)
|
| | | {
|
| | | var data = package.InfoList[i];
|
| | | m_ExpertSkills[(int)data.MainSkillID] = (int)data.ElementSkillID;
|
| | | if (expertSkillRefresh != null)
|
| | | {
|
| | | expertSkillRefresh((int)data.MainSkillID);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | skill.levelUpRedpoint.state = RedPointState.None;
|
| | | }
|
| | |
|
| | | foreach (var potential in skill.potentials)
|
| | | {
|
| | | if (requireRemind && funcOpen && IsPotentialUnlock(potential.id) &&
|
| | | TryLevelUpPotential(potential.id, out error)
|
| | | && skill.level > 0)
|
| | | {
|
| | | potential.levelUpRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | else
|
| | | {
|
| | | potential.levelUpRedpoint.state = RedPointState.None;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public class TreasurePotential
|
| | | {
|
| | | public readonly int id;
|
| | | public readonly int openLevel;
|
| | | public readonly int maxLevel;
|
| | | public int level { get; private set; }
|
| | |
|
| | | public Redpoint levelUpRedpoint { get; private set; }
|
| | |
|
| | | public TreasurePotential(int id, int level, int openLevel, int redpointBase)
|
| | | public TreasurePotential(int id, int level, int redpointBase)
|
| | | {
|
| | | this.id = id;
|
| | | this.level = level;
|
| | | this.openLevel = openLevel;
|
| | |
|
| | | var config = SkillConfig.Get(id);
|
| | | maxLevel = config.SkillMaxLV;
|
| | |
|
| | | levelUpRedpoint = new Redpoint(redpointBase,
|
| | | TreasureSkillModel.REDPOINTID_BASE + TreasureSkillModel.redpointIndex++);
|
| | | }
|
| | |
|
| | | public SkillConfig GetSkillConfig(int level)
|