Core/GameEngine/Model/Config/TreasureConfig.cs
@@ -1,6 +1,6 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Friday, June 29, 2018 // [ Date ]: Tuesday, September 18, 2018 //-------------------------------------------------------- using UnityEngine; @@ -9,8 +9,8 @@ namespace TableConfig { public partial class TreasureConfig : ConfigBase { public partial class TreasureConfig : ConfigBase { public int ID { get ; private set ; } public int Category { get ; private set ; } public int PreTreasure { get ; private set ; } @@ -29,20 +29,21 @@ public int LineId { get ; private set ; } public int ChallengeLevel { get ; private set ; } public int[] Potentials; public int[] SkillPower; public string NeedItem { get ; private set; } public int EffectID { get ; private set ; } public string[] Verse; public int ShowNetGotEffect { get ; private set ; } public int PreferredStage { get ; private set ; } public int PreferredStage { get ; private set ; } public override string getKey() { return ID.ToString(); public override string getKey() { return ID.ToString(); } public override void Parse() { try { try { ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; Category=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; @@ -89,19 +90,26 @@ int.TryParse(PotentialsStringArray[i],out Potentials[i]); } NeedItem = rawContents[18].Trim(); string[] SkillPowerStringArray = rawContents[18].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); SkillPower = new int[SkillPowerStringArray.Length]; for (int i=0;i<SkillPowerStringArray.Length;i++) { int.TryParse(SkillPowerStringArray[i],out SkillPower[i]); } EffectID=IsNumeric(rawContents[19]) ? int.Parse(rawContents[19]):0; NeedItem = rawContents[19].Trim(); Verse = rawContents[20].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); EffectID=IsNumeric(rawContents[20]) ? int.Parse(rawContents[20]):0; ShowNetGotEffect=IsNumeric(rawContents[21]) ? int.Parse(rawContents[21]):0; Verse = rawContents[21].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); PreferredStage=IsNumeric(rawContents[22]) ? int.Parse(rawContents[22]):0; } catch (Exception ex) { DebugEx.Log(ex); ShowNetGotEffect=IsNumeric(rawContents[22]) ? int.Parse(rawContents[22]):0; PreferredStage=IsNumeric(rawContents[23]) ? int.Parse(rawContents[23]):0; } catch (Exception ex) { DebugEx.Log(ex); } } Core/GameEngine/Model/Config/TreasureConfig.cs.meta
@@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 607f2341c6f1e3e468b7eb233bc91ff2 timeCreated: 1530238289 timeCreated: 1537237950 licenseType: Pro MonoImporter: serializedVersion: 2 Core/GameEngine/Model/Config/TreasureUpConfig.cs
@@ -1,16 +1,16 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Monday, September 03, 2018 //-------------------------------------------------------- using UnityEngine; using System; namespace TableConfig { public partial class TreasureUpConfig : ConfigBase { //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Tuesday, September 18, 2018 //-------------------------------------------------------- using UnityEngine; using System; namespace TableConfig { public partial class TreasureUpConfig : ConfigBase { public int ID { get ; private set ; } public int MWID { get ; private set ; } public int LV { get ; private set ; } @@ -20,16 +20,17 @@ public int UnLockFuncID { get ; private set ; } public int ActiveMWID { get ; private set ; } public string ItemAward { get ; private set; } public string DescriptionMainWin { get ; private set; } public override string getKey() { return ID.ToString(); } public override void Parse() { try { public int SoulID { get ; private set ; } public string DescriptionMainWin { get ; private set; } public override string getKey() { return ID.ToString(); } public override void Parse() { try { ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; MWID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; @@ -53,18 +54,20 @@ ItemAward = rawContents[8].Trim(); DescriptionMainWin = rawContents[9].Trim(); } catch (Exception ex) { DebugEx.Log(ex); } } } } SoulID=IsNumeric(rawContents[9]) ? int.Parse(rawContents[9]):0; DescriptionMainWin = rawContents[10].Trim(); } catch (Exception ex) { DebugEx.Log(ex); } } } } Core/GameEngine/Model/Config/TreasureUpConfig.cs.meta
@@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 882666fd713678849aebb360643bfe19 timeCreated: 1535946483 timeCreated: 1537237919 licenseType: Pro MonoImporter: serializedVersion: 2 System/Activity/ActivityNotifyBehaviour.cs
@@ -138,7 +138,7 @@ WindowCenter.Instance.Open<UnionPanel>(false, 4); break; case DailyQuestType.FairyGrabBoss: WindowCenter.Instance.Open<LootPreciousFrameWin>(false, 1); WindowCenter.Instance.Open<PetWin>(false, 2); break; } } System/DailyQuest/DailyQuestWin.cs
@@ -293,7 +293,7 @@ break; case DailyQuestType.FairyGrabBoss: WindowCenter.Instance.CloseImmediately<DailyQuestWin>(); WindowCenter.Instance.Open<LootPreciousFrameWin>(false, 1); WindowCenter.Instance.Open<PetWin>(false, 2); break; default: break; System/FairyAu/FairyGrabBossModel.cs
@@ -486,7 +486,7 @@ { if (_ok) { WindowCenter.Instance.Close<LootPreciousFrameWin>(); WindowCenter.Instance.Close<PetWin>(); MapTransferUtility.Instance.MoveToNPC(selectBoss); } } System/FairyAu/FairyGrabBossWin.cs
@@ -185,7 +185,7 @@ SysNotifyMgr.Instance.ShowTip("FairyGrabBossOver"); } WindowJumpMgr.Instance.ClearJumpData(); WindowCenter.Instance.Close<LootPreciousFrameWin>(); WindowCenter.Instance.Close<PetWin>(); MapTransferUtility.Instance.MoveToNPC(model.selectBoss); } else System/FindPrecious/LootPreciousFrameWin.cs
@@ -15,14 +15,11 @@ [SerializeField] FunctionButtonGroup m_FunctionGroup; [SerializeField] FunctionButton m_DemonJar; [SerializeField] FunctionButton m_FairyGrabBoss; [SerializeField] FunctionButton m_DogzDungeon; [SerializeField] Button m_Left; [SerializeField] Button m_Right; [SerializeField] Button m_Close; FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } } #region Built-in protected override void BindController() @@ -33,7 +30,6 @@ { m_DemonJar.AddListener(ShowDemonJar); m_DogzDungeon.AddListener(ShowDogzDungeon); m_FairyGrabBoss.AddListener(FairyGrabBoss); m_Left.AddListener(ShowLastFunction); m_Right.AddListener(ShowNextFunction); m_Close.AddListener(CloseClick); @@ -79,13 +75,6 @@ functionOrder = m_DemonJar.order; } private void FairyGrabBoss() { CloseSubWindows(); WindowCenter.Instance.Open<FairyGrabBossWin>(); functionOrder = m_FairyGrabBoss.order; } private void ShowDogzDungeon() { CloseSubWindows(); @@ -97,7 +86,6 @@ { WindowCenter.Instance.CloseImmediately<DemonJarWin>(); WindowCenter.Instance.CloseImmediately<DogzDungeonWin>(); WindowCenter.Instance.CloseImmediately<FairyGrabBossWin>(); } private void ShowLastFunction() System/MainInterfacePanel/HighSettingTip.cs
@@ -252,14 +252,7 @@ void LootPreciousButton()//夺宝 { WindowCenter.Instance.Close<MainInterfaceWin>(); if (fairyGrabBossModel.InActivityTime) { WindowCenter.Instance.Open<LootPreciousFrameWin>(false, 1); } else { WindowCenter.Instance.Open<LootPreciousFrameWin>(); } WindowCenter.Instance.Open<LootPreciousFrameWin>(); } void RechargeButton()//充值按钮 System/MainInterfacePanel/LowSettingTip.cs
@@ -26,6 +26,8 @@ [SerializeField] Button m_TreasureSoulBtn;//觉醒按钮 [SerializeField] Button m_GodBeastBtn;//神兽按钮 FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } } public void Init() { _Role1Btn.onClick.AddListener(Role1Button); @@ -133,8 +135,15 @@ void Pet1Button() { WindowCenter.Instance.Close<MainInterfaceWin>(); WindowCenter.Instance.Open<PetWin>(); if (fairyGrabBossModel.InActivityTime && !NewBieCenter.Instance.inGuiding) { WindowCenter.Instance.Open<PetWin>(false, 2); } else { WindowCenter.Instance.Open<PetWin>(); } //DesignDebug.Log("宠物按钮"); } System/MainInterfacePanel/PlayerMainDate.cs
@@ -337,6 +337,10 @@ public void PowerAdd(int power) { if (ModelCenter.Instance.GetModel<TreasureModel>().inPotentialModifyPower) { return; } if (prowBool) { prowNum = power; System/Pet/PetWin.cs
@@ -15,6 +15,7 @@ { [SerializeField] FunctionButton PetPanelBtn;//灵宠面板按钮 [SerializeField] FunctionButton EvolveTrainWinBtn;//灵宠培养面板按钮 [SerializeField] FunctionButton m_FairyGrabBoss; [SerializeField] FunctionButtonGroup FuncBtnGroup; [SerializeField] Button _CloseBtn; [SerializeField] Button _LeftBtn; @@ -62,7 +63,7 @@ base.OnActived(); if (!WindowJumpMgr.Instance.IsJumpState)//是否进行跳转 if (!WindowJumpMgr.Instance.IsJumpState && functionOrder < 2)//是否进行跳转 { if (mountModel.IsHorsePanelState() > petmodel.IsPetPanelRedPointState()) { @@ -80,6 +81,7 @@ EvolveTrainWinBtn.AddListener(OnClickEvolveTrainWin); _LeftBtn.AddListener(OnClickLeftBtn); _RightBtn.AddListener(OnClickRightBtn); m_FairyGrabBoss.AddListener(FairyGrabBoss); } @@ -91,6 +93,20 @@ private void OnClickLeftBtn() { FuncBtnGroup.TriggerLast(); } private void FairyGrabBoss() { CloseChild(); if (windowState == WindowState.Opened) { WindowCenter.Instance.OpenWithoutAnimation<FairyGrabBossWin>(); } else { WindowCenter.Instance.Open<FairyGrabBossWin>(true); } functionOrder = m_FairyGrabBoss.order; } private void OnClickPetPanel() @@ -132,6 +148,7 @@ { WindowCenter.Instance.CloseImmediately<MountWin>(); } WindowCenter.Instance.CloseImmediately<FairyGrabBossWin>(); } } } System/Treasure/DragSelectComponent.cs
@@ -23,7 +23,8 @@ { if (Input.touchCount > 1 || NewBieCenter.Instance.inGuiding || WindowCenter.Instance.CheckOpen<TreasureNewStageWin>() || WindowCenter.Instance.CheckOpen<PotentialItemUseWin>()) || WindowCenter.Instance.CheckOpen<PotentialItemUseWin>() || WindowCenter.Instance.CheckOpen<TreasureSoulActiveWin>()) { m_StartDrag = false; return; System/Treasure/TreasureData.cs
@@ -558,6 +558,7 @@ 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 stateSfxId { get; private set; } public const int selectedSfxId = 5144; @@ -591,6 +592,11 @@ { unlockType = TreasureStageUnlock.Treasure; treasure = _config.ActiveMWID; } else if (_config.SoulID != 0) { unlockType = TreasureStageUnlock.TreasureSoul; treasureSoul = _config.SoulID; } else if (!string.IsNullOrEmpty(_config.ItemAward)) { @@ -661,6 +667,7 @@ Func, Item, Treasure, TreasureSoul, } } System/Treasure/TreasureLevelUpWin.cs
@@ -460,6 +460,7 @@ case TreasureStageUnlock.Skill: case TreasureStageUnlock.Func: case TreasureStageUnlock.Treasure: case TreasureStageUnlock.TreasureSoul: m_Controller.AddCell(ScrollerDataType.Header, stage.stage); break; } @@ -503,20 +504,6 @@ m_TreasureChallengeLimit.text = Language.Get("TreasureGetRequire", _taskConfig.lv); break; } } } private void OpenTreasureStageTip(int _stage, RectTransform _target) { model.selectedStage = _stage; if (model.treasureStepUpShow) { return; } if (!WindowCenter.Instance.CheckOpen<TreasureStageTipWin>()) { TreasureStageTipWin.SetTargetPosition(_target); WindowCenter.Instance.Open<TreasureStageTipWin>(); } } @@ -852,7 +839,7 @@ private void WindowAfterCloseEvent(Window _win) { if (_win is TreasureNewStageWin) if (_win is TreasureNewStageWin || _win is TreasureSoulActiveWin) { if (m_Treasure.IsHighestStage && FuncOpen.Instance.IsFuncOpen(82)) { @@ -990,6 +977,10 @@ WindowJumpMgr.Instance.ClearJumpData(); WindowCenter.Instance.Open<MainInterfaceWin>(); CloseImmediately(); break; case TreasureStageUnlock.TreasureSoul: TreasureSoulActiveWin.treasureSoulId = stage.treasureSoul; WindowCenter.Instance.Open<TreasureSoulActiveWin>(true); break; } } @@ -1160,6 +1151,11 @@ m_CurrentStageIcon.SetSprite(_treasureConfig.Icon); m_TreasureStageDesc.text = Language.Get("TreasureLevelUpTreasure", _treasureConfig.Name); break; case TreasureStageUnlock.TreasureSoul: var _treasureSoulConfig = Config.Instance.Get<TreasurePrivilegeConfig>(_nextStage.treasureSoul); m_CurrentStageIcon.SetSprite(_treasureSoulConfig.Icon); m_TreasureStageDesc.text = Language.Get("TreasureLevelUpTreasureSoul", _treasureSoulConfig.Name); break; } } else System/Treasure/TreasureMeridianBehaviour.cs
@@ -188,6 +188,16 @@ m_Descs[0].text = treasureConfig.Name; m_Icon.rectTransform.sizeDelta = new Vector2(86, 86); break; case TreasureStageUnlock.TreasureSoul: m_Descs[0].gameObject.SetActive(true); m_Descs[0].color = UIHelper.s_LightYellow; var treasureSoulConfig = Config.Instance.Get<TreasurePrivilegeConfig>(m_TreasureStage.treasureSoul); m_Icon.SetSprite(treasureSoulConfig.Icon); m_Descs[0].text = treasureSoulConfig.Name; m_Icon.SetNativeSize(); var sizeDelta = m_Icon.rectTransform.sizeDelta; m_Icon.rectTransform.sizeDelta = new Vector2(86, (sizeDelta.y / sizeDelta.x) * 86); break; } } } System/Treasure/TreasureModel.cs
@@ -174,6 +174,7 @@ List<int> m_CacheGotAchievements = new List<int>(); Dictionary<int, int> treasureStageShowDict = new Dictionary<int, int>(); List<int> treasureUnOpens = new List<int>();//版本未开放法宝 Dictionary<int, int[]> potentialInitialPowers = new Dictionary<int, int[]>(); public Dictionary<int, int> fairyTreasureGetDict { get; private set; } @@ -203,6 +204,7 @@ public bool openFromTreasureUnlockShow { get; set; } public bool openFromTreasureCollect { get; set; } public bool openFromTreasureList { get; set; } public bool inPotentialModifyPower { get; set; } public int openFromTaskId = 0; public List<int> castSoulGuideTaskIds { get; private set; } @@ -1208,6 +1210,7 @@ { var caseSoulRedpoint = new Redpoint(CATEGORY_REDPOINTIDS[config.Category - 1], TREASURE_REDPOINTBASE + redpointIndex++); treasure = new HumanTreasure(config.ID, config.Potentials, skillLevelUpRedpoint, achievementRedpoint, caseSoulRedpoint); potentialInitialPowers.Add(config.ID, config.SkillPower); } else { @@ -1410,6 +1413,19 @@ } return true; } public int GetPotentialInitialPower(int treasureId, int index) { if (potentialInitialPowers.ContainsKey(treasureId)) { var powerArray = potentialInitialPowers[treasureId]; if (powerArray != null && index < powerArray.Length && index >= 0) { return powerArray[index]; } } return 0; } } } System/Treasure/TreasureNewGotBehaviour.cs
@@ -71,6 +71,16 @@ m_FuncName.text = treasureConfig.Name; } break; case TreasureStageUnlock.TreasureSoul: m_ContaienrTreasure.gameObject.SetActive(true); var treasureSoulConfig = Config.Instance.Get<TreasurePrivilegeConfig>(treasureStage.treasureSoul); if (treasureSoulConfig != null) { m_TreasureIcon.SetSprite(treasureSoulConfig.Icon); m_Func.text = Language.Get("TreasureUnlockNewTreasureSoul"); m_FuncName.text = treasureSoulConfig.Name; } break; } } } System/Treasure/TreasurePotentialPanel.cs
@@ -261,6 +261,8 @@ m_TreasureAnimation.OnPotentialLineAnimComplete -= OnPotentialLineAnimComplete; m_SelectedPotential = 0; model.inPotentialModifyPower = false; } private void RedpointValueChangeEvent(int _id) @@ -295,11 +297,28 @@ } } private void ModifyPowerUp(int treasureId, int index, int fightPower) { var power = model.GetPotentialInitialPower(treasureId, index); if (power != 0) { ModelCenter.Instance.GetModel<PlayerMainDate>().FabaoPowerAdd(fightPower); model.inPotentialModifyPower = true; } } private void OnUnlockPotentialComplete(int _index) { selectedPotential = m_Treasure.potentials[_index].id; m_TreasureAnimation.DisplayPotentialLine(_index); HandleAchievement(); if (model.inPotentialModifyPower) { var power = model.GetPotentialInitialPower(m_Treasure.id, _index); model.inPotentialModifyPower = false; ModelCenter.Instance.GetModel<PlayerMainDate>().FabaoPowerAdd(power); } } private void OnPotentialLineAnimComplete(int _index) @@ -720,6 +739,26 @@ } } private bool ContainsPotentialBook(int potentialBook) { if (potentialBook == 0) { return false; } var potential = m_Treasure.GetPotential(selectedPotential); var levelUpType = model.GetSkillLevelUpType(potential.id); var levelupId = TreasureModel.GetSkillLevelUpId(levelUpType, potential.level + 1); var config = Config.Instance.Get<TreasureSkillConfig>(levelupId); for (int i = 0; i < config.Meterial2ID.Length; i++) { if (config.Meterial2ID[i] == potentialBook) { return true; } } return false; } private int GetNextPotential(int _potentialId) { for (int i = 0; i < m_Treasure.potentials.Count; i++) @@ -745,12 +784,30 @@ DisplayPotentialEffect(); } var potential = m_Treasure.GetPotential(_potentialId); if (potential != null) if (potential != null && model.serverInited) { PotentialLevelUpAnimation(_potentialId, potential.level); var nextPotential = GetNextPotential(potential.id); if (nextPotential != 0) { var config = Config.Instance.Get<SkillConfig>(nextPotential); if (potential.level == config.LearnSkillLV && potentialBriefInfos != null) { for (int i = 0; i < potentialBriefInfos.Length; i++) { if (potentialBriefInfos[i].potential.id == nextPotential) { var current = Config.Instance.Get<SkillConfig>(potential.id + potential.level - 1); var before = Config.Instance.Get<SkillConfig>(potential.id + potential.level - 2); ModifyPowerUp(m_Treasure.id, i, current.FightPower - before.FightPower); } } } } } var levelUpConfig = GetPotentialLevelUpConfig(); if (levelUpConfig.own < levelUpConfig.need) if (levelUpConfig.own < levelUpConfig.need || !ContainsPotentialBook(model.selectedPotentialBook)) { model.selectedPotentialBook = 0; } System/Treasure/TreasureSoulBehaviour.cs
@@ -38,27 +38,27 @@ { model.treasureSelectSoulChangeEvent += TreasureSelectSoulChangeEvent; model.treasureSoulEvent += TreasureSoulEvent; achievementModel.achievementCompletedEvent += AchievementCompletedEvent; //achievementModel.achievementCompletedEvent += AchievementCompletedEvent; } private void OnDisable() { model.treasureSelectSoulChangeEvent -= TreasureSelectSoulChangeEvent; model.treasureSoulEvent -= TreasureSoulEvent; achievementModel.achievementCompletedEvent -= AchievementCompletedEvent; //achievementModel.achievementCompletedEvent -= AchievementCompletedEvent; } private void AchievementCompletedEvent(int _id) { int achievementId = 0; if (model.TryGetLockAchievement(treasureSoulId, out achievementId)) { if (achievementId == _id) { DisplayState(); } } } //private void AchievementCompletedEvent(int _id) //{ // int achievementId = 0; // if (model.TryGetLockAchievement(treasureSoulId, out achievementId)) // { // if (achievementId == _id) // { // DisplayState(); // } // } //} public void Display(int _id) { @@ -88,25 +88,27 @@ } else { int achievementId = 0; bool unlock = true; if (model.TryGetLockAchievement(treasureSoulId, out achievementId)) { Achievement achievement; if (achievementModel.TryGetAchievement(achievementId, out achievement)) { unlock = achievement.completed; } } if (unlock) { m_SoulState.text = Language.Get("TreasureSoul_Awaking"); } else { var successConfig = Config.Instance.Get<SuccessConfig>(achievementId); m_SoulState.text = Language.Get("TreasureSoulRealm", successConfig.NeedCnt); } m_SoulState.text = Language.Get("TreasureSoul_Awaking"); //int achievementId = 0; //bool unlock = true; //if (model.TryGetLockAchievement(treasureSoulId, out achievementId)) //{ // Achievement achievement; // if (achievementModel.TryGetAchievement(achievementId, out achievement)) // { // unlock = achievement.completed; // } //} //if (unlock) //{ // m_SoulState.text = Language.Get("TreasureSoul_Awaking"); //} //else //{ // var successConfig = Config.Instance.Get<SuccessConfig>(achievementId); // m_SoulState.text = Language.Get("TreasureSoulRealm", successConfig.NeedCnt); //} } } } System/Treasure/TreasureSoulModel.cs
@@ -10,7 +10,6 @@ { Dictionary<int, TreasureSpecialData> treasureSoulDict = new Dictionary<int, TreasureSpecialData>(); List<int> treasureSouls = new List<int>(); Dictionary<int, List<int>> soulAchievements = new Dictionary<int, List<int>>(); public Dictionary<int, int> signAddProperty = new Dictionary<int, int>(); public int signAddTreasure { get; private set; } @@ -42,8 +41,6 @@ { packModel.RefreshItemCountAct += RefreshItemCountAct; PlayerStrengthengDatas.RefreshEquipUpgradLvAct += RefreshEquipSTRLv; achievementModel.achievementProgressUpdateEvent += AchievementUpdate; achievementModel.achievementCompletedEvent += AchievementUpdate; ParseConfig(); } @@ -69,8 +66,6 @@ { packModel.RefreshItemCountAct -= RefreshItemCountAct; PlayerStrengthengDatas.RefreshEquipUpgradLvAct -= RefreshEquipSTRLv; achievementModel.achievementProgressUpdateEvent -= AchievementUpdate; achievementModel.achievementCompletedEvent -= AchievementUpdate; } void ParseConfig() @@ -85,7 +80,6 @@ } treasureSouls.Add(configs[i].PrivilegeID); treasureSoulDict.Add(configs[i].PrivilegeID, new TreasureSpecialData((TreasurePrivilege)configs[i].PrivilegeID)); soulAchievements.Add(configs[i].PrivilegeID, new List<int>(configs[i].successList)); } var funcConfig = Config.Instance.Get<FuncConfigConfig>("MWSignDayAttr"); var jsonData = LitJson.JsonMapper.ToObject(funcConfig.Numerical1); @@ -101,82 +95,9 @@ return treasureSouls; } public bool TryGetLockAchievement(int _id,out int achievementId) { achievementId = 0; List<int> list; if (soulAchievements.TryGetValue(_id, out list)) { for (int i = 0; i < list.Count; i++) { var config = Config.Instance.Get<SuccessConfig>(list[i]); if (config != null && config.Type == 1) { achievementId = list[i]; return true; } } } return false; } public bool TryGetAchievements(int _id,out List<int> list) { return soulAchievements.TryGetValue(_id, out list); } public bool IsCompleteLockAchievement(int _id) { TreasureSpecialData special; if (TryGetTreasureSoul(_id, out special)) { if (special.active) { return true; } int achievementId; if (TryGetLockAchievement(_id, out achievementId)) { Achievement achievement; return achievementModel.TryGetAchievement(achievementId, out achievement) && achievement.completed; } } return true; } public bool IsCompleteAllAchievement(int _id) { if (soulAchievements.ContainsKey(_id)) { var list = soulAchievements[_id]; bool allCompleted = true; for (int i = 0; i < list.Count; i++) { Achievement achievement; achievementModel.TryGetAchievement(list[i], out achievement); if (achievement == null || (!achievement.completed && !Achievement.IsReach(achievement.id, achievement.progress))) { allCompleted = false; } } return allCompleted; } return false; } public bool TryGetTreasureSoul(int _id, out TreasureSpecialData special) { return treasureSoulDict.TryGetValue(_id, out special); } public void ActiveTreasureSoul(int _id) { if (IsCompleteAllAchievement(_id)) { CA512_tagCMActiveMWSoul pak = new CA512_tagCMActiveMWSoul(); pak.ID = (byte)_id; GameNetSystem.Instance.SendInfo(pak); } } public int GetTreasureSoulValue(int _soulId) @@ -222,17 +143,6 @@ } } private void AchievementUpdate(int _id) { foreach (var soulId in soulAchievements.Keys) { if (soulAchievements[soulId].Contains(_id)) { UpdateAchievementRedpoint(soulId); } } } public void UpdateTreasureSoulStrenthen() { UpdateRedpoint((int)TreasurePrivilege.StrengthenAdd); @@ -254,19 +164,18 @@ } bool beforeActived = special.active; special.active = _data.State == 1; if (!beforeActived && special.active && serverInited && WindowCenter.Instance.CheckOpen<TreasureSoulWin>() && !WindowCenter.Instance.CheckOpen<TreasureSoulActiveWin>() && !NewBieCenter.Instance.inGuiding) { TreasureSoulActiveWin.treasureSoulId = (int)_data.PriID; WindowCenter.Instance.Open<TreasureSoulActiveWin>(); } //if (!beforeActived && special.active && serverInited && WindowCenter.Instance.CheckOpen<TreasureSoulWin>() // && !WindowCenter.Instance.CheckOpen<TreasureSoulActiveWin>() && !NewBieCenter.Instance.inGuiding) //{ // TreasureSoulActiveWin.treasureSoulId = (int)_data.PriID; // WindowCenter.Instance.Open<TreasureSoulActiveWin>(); //} if ((TreasurePrivilege)_data.PriID == TreasurePrivilege.StrengthenAdd) { if (treasureSoulEvent != null) { treasureSoulEvent((int)_data.PriID); } UpdateAchievementRedpoint((int)_data.PriID); UpdateRedpoint((int)_data.PriID); continue; } @@ -277,14 +186,12 @@ special.presentGetCount = (int)_data.CurValue; special.itemGet = _data.ItemAwardState == 1; UpdateRedpoint((int)_data.PriID); UpdateAchievementRedpoint((int)_data.PriID); if (treasureSoulEvent != null) { treasureSoulEvent((int)_data.PriID); } if (beforeFinishCount < special.presentFinishCount && serverInited && special.active && !WindowCenter.Instance.CheckOpen<TreasureSoulActiveWin>() && WindowCenter.Instance.CheckOpen<TreasureSoulWin>() && !WindowCenter.Instance.CheckOpen<RealmPropertyUpWin>() && !NewBieCenter.Instance.inGuiding) @@ -308,7 +215,6 @@ _specialData.presentFinishCount = (int)_data.Cnt; UpdateRedpoint((int)TreasurePrivilege.StrengthenAdd); if (beforeFinishCount < _specialData.presentFinishCount && serverInited && _specialData.active && !WindowCenter.Instance.CheckOpen<TreasureSoulActiveWin>() && WindowCenter.Instance.CheckOpen<TreasureSoulWin>() && !WindowCenter.Instance.CheckOpen<RealmPropertyUpWin>()) { @@ -358,37 +264,11 @@ } } private void UpdateAchievementRedpoint(int _id) { if (treasureSoulDict.ContainsKey(_id) && soulAchievements.ContainsKey(_id)) { var special = treasureSoulDict[_id]; special.activeRedpoint.state = RedPointState.None; if (!FuncOpen.Instance.IsFuncOpen(126) || !IsOpenTreasureSoul(_id) || special.active) { return; } var list = soulAchievements[_id]; bool allCompleted = true; for (int i = 0; i < list.Count; i++) { Achievement achievement; achievementModel.TryGetAchievement(list[i], out achievement); if (achievement == null || (!achievement.completed && !Achievement.IsReach(achievement.id, achievement.progress))) { allCompleted = false; } } special.activeRedpoint.state = allCompleted ? RedPointState.Simple : RedPointState.None; } } private void UpdateRedpoints() { foreach (var special in treasureSoulDict.Keys) { UpdateRedpoint(special); UpdateAchievementRedpoint(special); } } } @@ -403,7 +283,6 @@ public Dictionary<int, int> propertyDict { get; private set; } public Redpoint redpoint { get; private set; } public Redpoint privilegeRedpoint { get; private set; } public Redpoint activeRedpoint { get; private set; } public int treasureId { get; set; } public bool active { get; set; } @@ -485,7 +364,6 @@ } redpoint = new Redpoint(TreasureModel.TREASURE_SOUL_ID, TreasureModel.TREASURE_SOUL_ID * 100 + (int)type); activeRedpoint = new Redpoint(redpoint.id, redpoint.id * 100 + 1); switch (_type) { case TreasurePrivilege.DemonJarAtk: System/Treasure/TreasureSoulWin.cs
@@ -26,7 +26,6 @@ [SerializeField] UIEffect m_SoulEffect; [SerializeField] Button m_Active; [SerializeField] Text m_ActiveText; [SerializeField] Button m_GotoRealm; [SerializeField] List<TreasureSoulPattern> m_TreasureSouls; @@ -35,9 +34,6 @@ [SerializeField] RectTransform m_ContainerPreview; [SerializeField] Text m_PreviewTitle; [SerializeField] List<PropertyBehaviour> m_PreviewPropretys; [SerializeField] RectTransform m_ContainerCondition; [SerializeField] ScrollerController m_ConditonControl; TreasureSoulModel m_Model; TreasureSoulModel model @@ -58,9 +54,9 @@ } } AchievementModel achievementModel TreasureModel treasureModel { get { return ModelCenter.Instance.GetModel<AchievementModel>(); } get { return ModelCenter.Instance.GetModel<TreasureModel>(); } } @@ -76,10 +72,8 @@ protected override void AddListeners() { m_Active.onClick.AddListener(Active); m_GotoRealm.onClick.AddListener(GotoRealm); m_CloseBtn.onClick.AddListener(CloseClick); m_ScollerControl.OnRefreshCell += OnRefreshCell; m_ConditonControl.OnRefreshCell += OnRefreshConditionCell; } protected override void OnPreOpen() @@ -87,7 +81,6 @@ model.treasureSelectSoulChangeEvent += TreasureSelectSoulChangeEvent; PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent; model.treasureSoulEvent += TreasureSoulEvent; achievementModel.achievementCompletedEvent += AchievementCompletedEvent; m_TreasureSoulBtn.state = TitleBtnState.Click; Display(); } @@ -115,7 +108,6 @@ model.treasureSelectSoulChangeEvent -= TreasureSelectSoulChangeEvent; PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerDataRefreshInfoEvent; model.treasureSoulEvent -= TreasureSoulEvent; achievementModel.achievementCompletedEvent -= AchievementCompletedEvent; for (int i = 0; i < m_TreasureSouls.Count; i++) { m_TreasureSouls[i].Dispose(); @@ -131,15 +123,6 @@ } } #endregion private void AchievementCompletedEvent(int _id) { List<int> list; if (model.TryGetAchievements(model.selectSoul, out list) && list.Contains(_id)) { DisplaySelect(); } } private void Display() { @@ -228,19 +211,16 @@ private void Active() { model.ActiveTreasureSoul(model.selectSoul); } private void GotoRealm() { WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.RealmFunc1); var config = Config.Instance.Get<TreasurePrivilegeConfig>(model.selectSoul); treasureModel.selectedTreasure = config.treasureId; treasureModel.currentCategory = TreasureCategory.Human; WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.TreasureCollectSoul); } private void DisplaySelect() { TreasureSpecialData special; model.TryGetTreasureSoul(model.selectSoul, out special); m_ContainerCondition.gameObject.SetActive(false); if (special != null) { var config = Config.Instance.Get<TreasurePrivilegeConfig>((int)special.type); @@ -256,27 +236,8 @@ m_SelectSoulImg.material = special.active ? MaterialUtility.GetUIDefaultGraphicMaterial() : MaterialUtility.GetDefaultSpriteGrayMaterial(); m_SelectSoulImg.SetNativeSize(); if (special.active) { m_Active.gameObject.SetActive(false); m_GotoRealm.gameObject.SetActive(false); } else { if (!model.IsCompleteLockAchievement(model.selectSoul)) { m_Active.gameObject.SetActive(false); m_GotoRealm.gameObject.SetActive(false); } else { m_Active.gameObject.SetActive(true); m_GotoRealm.gameObject.SetActive(false); m_Active.SetInteractable(m_ActiveText, model.IsCompleteAllAchievement(model.selectSoul)); m_ContainerCondition.gameObject.SetActive(true); DisplayCondition(); } } m_Active.gameObject.SetActive(!special.active); m_ContainerPreview.gameObject.SetActive(!special.active); m_SoulEffect.StopImediatly(); if (!special.active) @@ -458,33 +419,6 @@ } break; } } private void DisplayCondition() { m_ContainerCondition.gameObject.SetActive(true); List<int> list; model.TryGetAchievements(model.selectSoul, out list); m_ConditonControl.Refresh(); if (list != null) { for (int i = 0; i < list.Count; i++) { var config = Config.Instance.Get<SuccessConfig>(list[i]); if (config != null && config.Type == 1) { continue; } m_ConditonControl.AddCell(ScrollerDataType.Header, list[i]); } } m_ConditonControl.Restart(); } private void OnRefreshConditionCell(ScrollerDataType type, CellView cell) { var _cell = cell as TreasureSoulAchievementCell; _cell.Display(cell.index); } int Compare(int x, int y) System/Treasure/TreasureStageTipWin.cs
@@ -135,6 +135,13 @@ m_StageName.text = treasureConfig.Name; m_Description.text = UIHelper.ReplaceNewLine(treasureConfig.Verse.Length > 0 ? treasureConfig.Verse[0] : string.Empty); break; case TreasureStageUnlock.TreasureSoul: m_ContainerFuncSoul.gameObject.SetActive(true); var treasureSoulConfig = Config.Instance.Get<TreasurePrivilegeConfig>(m_TreasureStage.treasureSoul); m_Icon.SetSprite(treasureSoulConfig.Icon); m_StageName.text = treasureSoulConfig.Name; m_Description.text = UIHelper.ReplaceNewLine(treasureSoulConfig.Description); break; } } System/Treasure/TreasureUnlockCell.cs
@@ -31,7 +31,7 @@ var _stage = treasure.treasureStages[i]; if (stage < _stage.stage && (_stage.unlockType == TreasureStageUnlock.Func || _stage.unlockType == TreasureStageUnlock.Skill || _stage.unlockType == TreasureStageUnlock.Treasure)) || _stage.unlockType == TreasureStageUnlock.Treasure || _stage.unlockType == TreasureStageUnlock.TreasureSoul)) { last = false; break; @@ -66,6 +66,14 @@ m_Func.text = Language.Get("TreasureUnlockNewTreasure"); } break; case TreasureStageUnlock.TreasureSoul: var treasureSoulConfig = Config.Instance.Get<TreasurePrivilegeConfig>(treasureStage.treasureSoul); if (treasureSoulConfig != null) { m_Icon.SetSprite(treasureSoulConfig.Icon); m_Func.text = Language.Get("TreasureUnlockNewTreasureSoul"); } break; } m_Button.AddListener(() => { System/Vip/LimitedTimePackageModel.cs
@@ -143,7 +143,7 @@ public bool IsExpired() { bool IsBool = false; IsBool = OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.GiftPackage); IsBool =(OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.GiftPackage)|| OperationTimeHepler.Instance.SatisfyAdvanceCondition(Operation.GiftPackage)); bool IsBuyBool = false; OperationBase operationBase; if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.GiftPackage, out operationBase)) System/Vip/LimitedTimePackageTime.cs
@@ -11,55 +11,83 @@ public class LimitedTimePackageTime:MonoBehaviour { [SerializeField] Text m_LimitedTimePackageTime_text; [SerializeField] TimerBehaviour m_Time; [SerializeField] RectTransform m_ContainerAdvance; [SerializeField] Text m_AdvanceTime; private void OnEnable() { GlobalTimeEvent.Instance.secondEvent += secondEvent; OperationTimeHepler.Instance.dayResetEvent += DayResetEvent; } private void OnDisable() { GlobalTimeEvent.Instance.secondEvent -= secondEvent; OperationTimeHepler.Instance.dayResetEvent -= DayResetEvent; } private void DayResetEvent(int resetType) { secondEvent(); } private void secondEvent() { int time = OperationTimeHepler.Instance.GetOperationSurplusTime(Operation.GiftPackage); if (time <= 0) OperationBase operationBase; if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.GiftPackage, out operationBase)) { if (m_LimitedTimePackageTime_text.gameObject.activeSelf) var operation = (operationBase as GiftPackageClass); bool inAdvance = false; var seconds = 0; if (operation.InAdvanceTime(TimeUtility.ServerNow)) { m_LimitedTimePackageTime_text.gameObject.SetActive(false); } return; } if (time>86400) { if (m_LimitedTimePackageTime_text.gameObject.activeSelf) { m_LimitedTimePackageTime_text.gameObject.SetActive(false); } } else { if (!m_LimitedTimePackageTime_text.gameObject.activeSelf) { m_LimitedTimePackageTime_text.gameObject.SetActive(true); } if (time<3600) { m_LimitedTimePackageTime_text.text = TimeUtility.SecondsToHMS(time); m_LimitedTimePackageTime_text.color = UIHelper.GetUIColor(TextColType.Red); inAdvance = true; seconds = operation.GetSecondsBeforeStart(TimeUtility.ServerNow); } else { m_LimitedTimePackageTime_text.text = TimeUtility.SecondsToHMS(time); m_LimitedTimePackageTime_text.color = UIHelper.GetUIColor(TextColType.Green); seconds = operation.GetResetSurplusTime(); } m_ContainerAdvance.gameObject.SetActive(inAdvance); if (inAdvance) { if (m_Time.gameObject.activeSelf) { DisplayTime(0); } DisplayAdvance(seconds); } else { if (seconds * TimeSpan.TicksPerSecond >= TimeSpan.TicksPerDay || seconds <= 0) { if (m_Time.gameObject.activeSelf) { DisplayTime(0); } } else { m_Time.timeShow.color = seconds > 3600 ? UIHelper.GetUIColor(TextColType.Green) : UIHelper.GetUIColor(TextColType.Red); if (!m_Time.gameObject.activeSelf) { DisplayTime(seconds); } } } } } void DisplayTime(int seconds) { m_Time.timeShow.color = seconds > 3600 ? UIHelper.GetUIColor(TextColType.Green) : UIHelper.GetUIColor(TextColType.Red); m_Time.Begin(DateTime.Now.AddTicks(seconds * TimeSpan.TicksPerSecond)); } void DisplayAdvance(int seconds) { m_AdvanceTime.text = Language.Get("OperationAdvanceOpen", TimeUtility.SecondsToHMS(seconds)); } } } System/Vip/LimitedTimePackageWin.cs
@@ -107,9 +107,19 @@ if (limitedTimePackageItemModel.IsExpired()) { m_Buy_Btn.interactable = false; time = 0; limitedTimePackageItemModel.OpenFreePlat(str, gift.gifts[0].rmb, gift.gifts[0].OrderInfo); if (OperationTimeHepler.Instance.SatisfyAdvanceCondition(Operation.GiftPackage)) { SysNotifyMgr.Instance.ShowTip("LimitGilt1"); return; } else { m_Buy_Btn.interactable = false; time = 0; limitedTimePackageItemModel.OpenFreePlat(str, gift.gifts[0].rmb, gift.gifts[0].OrderInfo); return; } } else { @@ -160,8 +170,8 @@ } } } // m_Text_ActivityTimeTo.text = StringUtility.Contact(Language.Get("ExpActivity_Text1"), operation.ToDisplayTime()); } DisplaySurplusTime(); } @@ -190,18 +200,42 @@ } private void secondEvent() { int time = OperationTimeHepler.Instance.GetOperationSurplusTime(Operation.GiftPackage); if (time <= 0) DisplaySurplusTime(); } private void DisplaySurplusTime() { OperationBase operationBase; OperationTimeHepler.Instance.TryGetOperationTime(Operation.GiftPackage, out operationBase); var seconds = 0; var inAdvance = false; if (operationBase != null) { m_Text_ActivityTimeTo.text = Language.Get("LimitGift2"); if (operationBase.InAdvanceTime(TimeUtility.ServerNow)) { inAdvance = true; seconds = operationBase.GetSecondsBeforeStart(TimeUtility.ServerNow); } else { GiftPackageClass operation = operationBase as GiftPackageClass; seconds = operation.GetResetSurplusTime(); } } if (time > 0) if (seconds > 0) { string str = String.Format(Language.Get("LimitGift1"), TimeUtility.SecondsToDHMSCHS(time)); m_Text_ActivityTimeTo.text = str; // m_Text_ActivityTimeTo.color = UIHelper.GetUIColor(TextColType.Green); if (inAdvance) { m_Text_ActivityTimeTo.text = Language.Get("OperationAdvanceOpen", TimeUtility.SecondsToDHMSCHS(seconds)); } else { m_Text_ActivityTimeTo.text = Language.Get("LimitGift1", TimeUtility.SecondsToDHMSCHS(seconds)); } } else { m_Text_ActivityTimeTo.text = Language.Get("ActivityEnd"); } } #endregion