| | |
| | | public class Treasure
|
| | | {
|
| | | public int id { get; private set; }
|
| | |
|
| | | public int level { get; private set; }
|
| | |
|
| | | public int exp { get; private set; }
|
| | | public int level { get; private set; }
|
| | | public TreasureState state { get; set; }
|
| | |
|
| | | TreasureState m_State = TreasureState.Locked;
|
| | | public TreasureState state
|
| | | public List<TreasureStage> treasureStages = new List<TreasureStage>();
|
| | |
|
| | | public Treasure(int id)
|
| | | {
|
| | | get { return m_State; }
|
| | | set { m_State = value; }
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public int skillId
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public List<TreasureStage> treasureStages = new List<TreasureStage>();
|
| | |
|
| | | public Treasure(int id)
|
| | | {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public void RefreshLevel(int level, int exp)
|
| | | {
|
| | | this.level = level;
|
| | |
| | |
|
| | | public void ParseStage(TreasureUpConfig config)
|
| | | {
|
| | | var _stage = new TreasureStage(config);
|
| | | treasureStages.Add(_stage);
|
| | | treasureStages.Add(new TreasureStage(config));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public class TreasureStage
|
| | | {
|
| | | public int id { get; private set; }
|
| | |
|
| | | public int stage { get; set; }
|
| | | public TreasureStageUnlock unlockType { get; private set; }
|
| | | public Dictionary<int, int> propertyDict { get; private set; }
|
| | | public Dictionary<int, int> skillDict { get; private set; }
|
| | | public int func { get; private set; }
|
| | | public Item item { get; private set; }
|
| | | public int treasure { get; private set; }
|
| | | public int treasureSoul { get; private set; }
|
| | | public int exp { get; set; }
|
| | | public int powerEx { get; set; }
|
| | | public int stateSfxId { get; private set; }
|
| | | public const int selectedSfxId = 5144;
|
| | | public string sfxGotState { get; private set; }
|
| | | public string sfxUnGotState { get; private set; }
|
| | |
|
| | | public TreasureStage(TreasureUpConfig _config)
|
| | | public TreasureStage(TreasureUpConfig config)
|
| | | {
|
| | | id = _config.ID;
|
| | | unlockType = TreasureStageUnlock.None;
|
| | | if (_config.UnLockFuncID != 0)
|
| | | if (config.UnLockFuncID != 0)
|
| | | {
|
| | | unlockType = TreasureStageUnlock.Func;
|
| | | func = _config.UnLockFuncID;
|
| | | func = config.UnLockFuncID;
|
| | | }
|
| | | else if (_config.UnLockSkill != null && _config.UnLockSkill.Length > 1)
|
| | | else if (config.UnLockSkill != null && config.UnLockSkill.Length > 1)
|
| | | {
|
| | | unlockType = TreasureStageUnlock.Skill;
|
| | | skillDict = new Dictionary<int, int>();
|
| | | for (int i = 0; i < _config.UnLockSkill.Length; i++)
|
| | | for (int i = 0; i < config.UnLockSkill.Length; i++)
|
| | | {
|
| | | skillDict.Add(i + 1, _config.UnLockSkill[i]);
|
| | | skillDict.Add(i + 1, config.UnLockSkill[i]);
|
| | | }
|
| | | }
|
| | | else if (!string.IsNullOrEmpty(_config.AddAttr))
|
| | | else if (!string.IsNullOrEmpty(config.AddAttr))
|
| | | {
|
| | | unlockType = TreasureStageUnlock.Property;
|
| | | propertyDict = ConfigParse.GetDic<int, int>(_config.AddAttr);
|
| | | propertyDict = ConfigParse.GetDic<int, int>(config.AddAttr);
|
| | | }
|
| | |
|
| | | exp = _config.NeedExp;
|
| | | stage = _config.LV;
|
| | | powerEx = _config.PowerEx;
|
| | |
|
| | | switch (unlockType)
|
| | | {
|
| | | case TreasureStageUnlock.Property:
|
| | | stateSfxId = propertyDict.ContainsKey(6) ? 5142 : 5139;
|
| | | sfxGotState = propertyDict.ContainsKey(6) ? "Effect_FaBao_Icon_ShengMing" : "Effect_FaBao_Icon_GongJi";
|
| | | sfxUnGotState = propertyDict.ContainsKey(6) ? "Effect_FaBao_Icon_ShengMing" : "Effect_FaBao_Icon_GongJi";
|
| | | break;
|
| | | default:
|
| | | stateSfxId = 5141;
|
| | | sfxGotState = "Effect_FaBao_Icon_JiNeng_01";
|
| | | sfxUnGotState = "Effect_FaBao_Icon_JiNeng_02";
|
| | | break;
|
| | | }
|
| | | exp = config.NeedExp;
|
| | | stage = config.LV;
|
| | | powerEx = config.PowerEx;
|
| | | }
|
| | |
|
| | | public int GetSkill(int _job)
|
| | |
| | | case TreasureStageUnlock.Property:
|
| | | return UIHelper.GetFightPower(propertyDict);
|
| | | case TreasureStageUnlock.Skill:
|
| | | var _job = PlayerDatas.Instance.baseData.Job;
|
| | | var _skillCfg = SkillConfig.Get(GetSkill(_job));
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | | var _skillCfg = SkillConfig.Get(GetSkill(job));
|
| | | if (_skillCfg != null)
|
| | | {
|
| | | return _skillCfg.FightPower;
|