5923 【前端】【1.5.100】诛仙Boss功能
| | |
| | | MessageWin.Inst.ShowFixedTip(Language.Get("DemonJar18"));
|
| | | return false;
|
| | | }
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var dataMapId = model.GetDataMapIdByMapId(mapId);
|
| | | if (dataMapId == JadeDynastyBossModel.JADEDYNASTY_MAP)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("JadeDynastyBossBuyTimesError");
|
| | | return false;
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
| | | switch (mapId)
|
| | | {
|
| | | case DemonJarModel.DEMONJAR_MAPID:
|
| | | case JadeDynastyBossModel.JADEDYNASTY_MAP:
|
| | | m_Icon.SetSprite("W_XYGuwu_a2");
|
| | | break;
|
| | | default:
|
| | |
| | | && level < model.GetInspireMaxCount(mapId);
|
| | | if (m_InspireProgress != null)
|
| | | {
|
| | | m_InspireProgress.gameObject.SetActive(PlayerDatas.Instance.baseData.MapID == DemonJarModel.DEMONJAR_MAPID);
|
| | | m_InspireProgress.gameObject.SetActive(IsRequireDisplayProgress());
|
| | | m_InspireProgress.text = StringUtility.Contact(level * model.GetDungeonInspireUpper(mapId), "%");
|
| | | }
|
| | | if (!m_Waggle)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private bool IsRequireDisplayProgress()
|
| | | {
|
| | | return PlayerDatas.Instance.baseData.MapID == DemonJarModel.DEMONJAR_MAPID
|
| | | || PlayerDatas.Instance.baseData.MapID == JadeDynastyBossModel.JADEDYNASTY_MAP;
|
| | | }
|
| | |
|
| | | private void ResetTween()
|
| | | {
|
| | | m_Time = 0;
|
| | |
| | | public event Action<int> selectBossRefresh;
|
| | | public event Action bossLineRefresh;
|
| | | public event Action assistTimeRefresh;
|
| | | public event Action jadeDynastyScoreRefresh;
|
| | |
|
| | | public int jadeDynastyScore { get; private set; }
|
| | | public ulong jadeDynastyScore
|
| | | {
|
| | | get
|
| | | {
|
| | | ulong score = 0;
|
| | | SinglePackModel singlePackModel = packModel.GetSinglePackModel(PackType.rptJadeDynastyEquip);
|
| | | if (singlePackModel != null)
|
| | | {
|
| | | Dictionary<int, ItemModel> equipBodyDict = singlePackModel.GetPackModelIndexDict();
|
| | | if (equipBodyDict != null && equipBodyDict.Count > 0)
|
| | | {
|
| | | foreach (var _equip in equipBodyDict.Values)
|
| | | {
|
| | | score += (ulong)_equip.equipScore;
|
| | | }
|
| | | }
|
| | | }
|
| | | return score;
|
| | | }
|
| | | }
|
| | |
|
| | | public int challengeLimitCount { get; private set; }
|
| | | public int challengeTimes { get; private set; }
|
| | | public int assistTimes { get; private set; }
|
| | |
| | | MapModel mapModel { get { return ModelCenter.Instance.GetModel<MapModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } }
|
| | | PlayerPackModel packModel { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | | public override void Init()
|
| | | {
|
| | | ParseConfig();
|
| | | dungeonModel.dungeonRecordChangeEvent += OnDungeonRecordUpdate;
|
| | | dungeonModel.updateDungeonBuyCnt += OnDungeonBuyCount;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | packModel.RefreshItemCountAct += RefreshItemCountAct;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | jadeDynastyScore = 100000000;
|
| | | jadeDynastyBossLineDict.Clear();
|
| | | challengeTimes = 0;
|
| | | assistTimes = 0;
|
| | |
| | | dungeonModel.dungeonRecordChangeEvent -= OnDungeonRecordUpdate;
|
| | | dungeonModel.updateDungeonBuyCnt -= OnDungeonBuyCount;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
|
| | | packModel.RefreshItemCountAct -= RefreshItemCountAct;
|
| | | }
|
| | |
|
| | | void ParseConfig()
|
| | |
| | | condition = 2;
|
| | | return false;
|
| | | }
|
| | | if (jadeDynastyScore < challengeCondition.score)
|
| | | if (jadeDynastyScore < (ulong)challengeCondition.score)
|
| | | {
|
| | | condition = 3;
|
| | | return false;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshItemCountAct(PackType packType, int arg2, int arg3)
|
| | | {
|
| | | if (packType == PackType.rptJadeDynastyEquip)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | if (jadeDynastyScoreRefresh != null)
|
| | | {
|
| | | jadeDynastyScoreRefresh();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void UpdateRedpoint()
|
| | | {
|
| | | if (FuncOpen.Instance.IsFuncOpen(FUNCTIONID))
|
| | |
| | |
|
| | | private int RewardSort(Item _lhs, Item _rhs)
|
| | | {
|
| | | var config1 = Config.Instance.Get<ItemConfig>(_lhs.id);
|
| | | var config2 = Config.Instance.Get<ItemConfig>(_rhs.id);
|
| | | var islhsJadeDynastyEquip = IsJadeDynastyEquip(_lhs);
|
| | | var isrhsJadeDynastyEquip = IsJadeDynastyEquip(_rhs);
|
| | | if (islhsJadeDynastyEquip != isrhsJadeDynastyEquip)
|
| | | {
|
| | | return -islhsJadeDynastyEquip.CompareTo(isrhsJadeDynastyEquip);
|
| | | }
|
| | | var islhsJadeDynasty126 = IsJadeDynasty126(_lhs);
|
| | | var isrhsJadeDynasty126 = IsJadeDynasty126(_rhs);
|
| | | if (islhsJadeDynasty126 == isrhsJadeDynasty126
|
| | | && islhsJadeDynasty126)
|
| | | {
|
| | | return _lhs.id.CompareTo(_rhs.id);
|
| | | }
|
| | | else if (islhsJadeDynasty126 != isrhsJadeDynasty126)
|
| | | {
|
| | | return -islhsJadeDynasty126.CompareTo(isrhsJadeDynasty126);
|
| | | }
|
| | | var lhsConfig = Config.Instance.Get<ItemConfig>(_lhs.id);
|
| | | var rhsConfig = Config.Instance.Get<ItemConfig>(_rhs.id);
|
| | | if (lhsConfig != null && rhsConfig != null)
|
| | | {
|
| | | return -lhsConfig.ItemColor.CompareTo(rhsConfig.ItemColor);
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | var isEquip1 = config1.EquipPlace != 0;
|
| | | var isEquip2 = config2.EquipPlace != 0;
|
| | | bool IsJadeDynastyEquip(Item item)
|
| | | {
|
| | | var config = Config.Instance.Get<ItemConfig>(item.id);
|
| | | var type = 0;
|
| | | if (config != null)
|
| | | {
|
| | | type = config.Type;
|
| | | }
|
| | | return type >= 128 && type <= 137;
|
| | | }
|
| | |
|
| | | if (!isEquip1 && isEquip2)
|
| | | bool IsJadeDynasty126(Item item)
|
| | | {
|
| | | var config = Config.Instance.Get<ItemConfig>(item.id);
|
| | | var type = 0;
|
| | | if (config != null)
|
| | | {
|
| | | return -1;
|
| | | type = config.Type;
|
| | | }
|
| | | else if (isEquip1 && !isEquip2)
|
| | | {
|
| | | return 1;
|
| | | }
|
| | | else if (!isEquip1 && !isEquip2)
|
| | | {
|
| | | if (config1.Type == 13 && config2.Type != 13)
|
| | | {
|
| | | return -1;
|
| | | }
|
| | | else if (config1.Type != 13 && config2.Type == 13)
|
| | | {
|
| | | return 1;
|
| | | }
|
| | | else
|
| | | {
|
| | | return config1.ItemColor > config2.ItemColor ? -1 : 1;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if ((config1.Type == 108 || config1.Type == 109) && (config2.Type != 108 && config2.Type != 109))
|
| | | {
|
| | | return -1;
|
| | | }
|
| | | else if ((config1.Type != 108 && config1.Type == 109) && (config2.Type == 108 || config2.Type == 109))
|
| | | {
|
| | | return 1;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (config1.ItemColor != config2.ItemColor)
|
| | | {
|
| | | return config2.ItemColor.CompareTo(config1.ItemColor);
|
| | | }
|
| | | else if (config1.StarLevel != config2.StarLevel)
|
| | | {
|
| | | return config2.StarLevel.CompareTo(config1.StarLevel);
|
| | | }
|
| | | else
|
| | | {
|
| | | return config2.LV.CompareTo(config1.LV);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return type == 126;
|
| | | }
|
| | |
|
| | | private void GenerateRewardBehaviour(RectTransform _parent, int _needCount)
|
| | |
| | | findPreciousModel.bossInfoUpdateEvent += BossInfoUpdateEvent;
|
| | | model.bossLineRefresh += BossLineRefresh;
|
| | | model.assistTimeRefresh += AssistTimeRefresh;
|
| | | model.jadeDynastyScoreRefresh += JadeDynastyScoreRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | |
| | | findPreciousModel.bossInfoUpdateEvent -= BossInfoUpdateEvent;
|
| | | model.bossLineRefresh -= BossLineRefresh;
|
| | | model.assistTimeRefresh -= AssistTimeRefresh;
|
| | | model.jadeDynastyScoreRefresh -= JadeDynastyScoreRefresh;
|
| | |
|
| | | refreshBossStateTime = -1f;
|
| | | }
|
| | |
| | | DisplayChallengeTimes();
|
| | | }
|
| | |
|
| | | private void JadeDynastyScoreRefresh()
|
| | | {
|
| | | DisplayJadeDynastyScore();
|
| | | }
|
| | |
|
| | | private void BuyTimes()
|
| | | {
|
| | | var totalTimes = dungeonModel.GetTotalTimes(JadeDynastyBossModel.JADEDYNASTY_MAP);
|
| | |
| | | if ((totalTimes - enterTimes) >= model.challengeLimitCount)
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("DemonJar18"));
|
| | | return;
|
| | | }
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var dataMapId = dungeonModel.GetDataMapIdByMapId(mapId);
|
| | | if (dataMapId == JadeDynastyBossModel.JADEDYNASTY_MAP)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("JadeDynastyBossBuyTimesError");
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | retFashionWeapon = 20,//时装武器
|
| | | retFashionClothes = 21,//时装衣服
|
| | | retFashionWeapon2 = 22,//时装副手
|
| | | JadeDynasty_Cloak = 121, //诛仙披风
|
| | | JadeDynasty_FaceMask = 122, //诛仙面罩
|
| | | JadeDynasty_Glove1 = 123, //诛仙手套
|
| | | JadeDynasty_Glove2 = 124, //诛仙手套
|
| | | JadeDynasty_Ruyi = 125, //诛仙如意
|
| | | JadeDynasty_Pendant = 126, //诛仙吊坠
|
| | | JadeDynasty_Ring1 = 127, //诛仙戒指
|
| | | JadeDynasty_Ring2 = 128, //诛仙戒指
|
| | | JadeDynasty_Sword1 = 129, //诛仙剑
|
| | | JadeDynasty_Sword2 = 130, //戮仙剑
|
| | | JadeDynasty_Sword3 = 131, //陷仙剑
|
| | | JadeDynasty_Sword4 = 132, //绝仙剑
|
| | | retMax,
|
| | | };
|
| | |
|
| | |
| | | rptPetPack = 31, //宠物背包
|
| | | rptDogzItem = 32, //神兽物品背包
|
| | | rptDogzEquip = 33, //神兽装备背包(神兽穿戴)
|
| | | rptJadeDynastyItem = 34, //诛仙物品背包
|
| | | rptJadeDynastyEquip = 35,//诛仙装备背包(诛仙穿戴)
|
| | | rptBlastFrunacePack = 253, //炼丹背包
|
| | | rptGatherSoul = 254,//聚魂
|
| | | rptRunePack = 255,//符印背包
|
| | |
| | | Accessories4,// 配饰4
|
| | | Accessories5,// 配饰5
|
| | | Accessories6,// 配饰6
|
| | | JadeDynasty_Cloak = 128, //诛仙披风
|
| | | JadeDynasty_FaceMask = 129, //诛仙面罩
|
| | | JadeDynasty_Glove = 130, //诛仙手套
|
| | | JadeDynasty_Ruyi = 131, //诛仙如意
|
| | | JadeDynasty_Pendant = 132, //诛仙吊坠
|
| | | JadeDynasty_Ring = 133, //诛仙戒指
|
| | | JadeDynasty_Sword1 = 134, //诛仙剑
|
| | | JadeDynasty_Sword2 = 135, //戮仙剑
|
| | | JadeDynasty_Sword3 = 136, //陷仙剑
|
| | | JadeDynasty_Sword4 = 137, //绝仙剑
|
| | | }
|
| | |
|
| | | /** 物品类型 */
|