| | |
| | | for (int i = 0; i < sortedBossIds.Count; i++)
|
| | | {
|
| | | var bossId = sortedBossIds[i];
|
| | | if (IsBossUnLockedOrUnlockSoon(bossId))
|
| | | if (findPreciousModel.IsBossUnlockOrUnlockSoon(bossId))
|
| | | {
|
| | | activedBossIds.Add(bossId);
|
| | | }
|
| | |
| | | return bosses;
|
| | | }
|
| | |
|
| | | public bool IsBossUnLocked(int _bossId)
|
| | | {
|
| | | return worldBosses.ContainsKey(_bossId) && worldBosses[_bossId].isUnLocked;
|
| | | }
|
| | |
|
| | | public int GetRecommendBoss()
|
| | | {
|
| | | var playerLevel = PlayerDatas.Instance.baseData.LV;
|
| | |
| | | {
|
| | | var bossId = sortedBossIds[i];
|
| | | var npcConfig = NPCConfig.Get(bossId);
|
| | | if (IsBossUnLocked(bossId) && findPreciousModel.IsBossAlive(bossId) && playerLevel >= npcConfig.NPCLV)
|
| | | if (findPreciousModel.IsBossUnlock(bossId) |
| | | && findPreciousModel.IsBossAlive(bossId) |
| | | && playerLevel >= npcConfig.NPCLV)
|
| | | {
|
| | | return bossId;
|
| | | }
|
| | | }
|
| | |
|
| | | return sortedBossIds[0];
|
| | | }
|
| | |
|
| | | public int GetBossUnLockRealm(int bossId)
|
| | | {
|
| | | if (!worldBosses.ContainsKey(bossId))
|
| | | {
|
| | | return 0;
|
| | | }
|
| | |
|
| | | var config = NPCConfig.Get(bossId);
|
| | | var realmStage = realmModel.GetRealmStage(config.Realm);
|
| | | var realms = new List<int>();
|
| | | if (realmModel.TryGetRealmStages(realmStage, out realms))
|
| | | {
|
| | | return realms[0];
|
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | private bool IsBossUnLockedOrUnlockSoon(int bossId)
|
| | | {
|
| | | var myRealmLevel = PlayerDatas.Instance.baseData.realmLevel;
|
| | | var myRealmStage = realmModel.GetRealmStage(myRealmLevel);
|
| | |
|
| | | var config = NPCConfig.Get(bossId);
|
| | | var bossRealmStage = realmModel.GetRealmStage(config.Realm);
|
| | |
|
| | | if (myRealmStage >= bossRealmStage)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | if (myRealmStage + 1 >= bossRealmStage)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | return false;
|
| | | }
|
| | |
|
| | | private void OnFunctionChange(int id)
|
| | |
| | |
|
| | | public class WorldBossData
|
| | | {
|
| | | RealmModel realmModel { get { return ModelCenter.Instance.GetModel<RealmModel>(); } }
|
| | |
|
| | | public int id { get; private set; }
|
| | | public bool isUnLocked {
|
| | | get {
|
| | | var myRealmLevel = PlayerDatas.Instance.baseData.realmLevel;
|
| | | var myRealmStage = realmModel.GetRealmStage(myRealmLevel);
|
| | |
|
| | | var config = NPCConfig.Get(id);
|
| | | var bossRealmStage = realmModel.GetRealmStage(config.Realm);
|
| | |
|
| | | return myRealmStage >= bossRealmStage;
|
| | | }
|
| | | }
|
| | |
|
| | | public WorldBossData(int _id)
|
| | | {
|
| | | this.id = _id;
|