| Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA512_tagCMActiveMWSoul.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA512_tagCMActiveMWSoul.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Core/NetworkPackage/ServerPack/HA3_Function/HA353_tagMCMWPrivilegeDataInfo.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Treasure/FairyTreasureCollectPanelPattern5.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Treasure/TreasureModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Treasure/TreasureNewGotWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Treasure/TreasureSoulAchievementCell.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Treasure/TreasureSoulAchievementCell.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Treasure/TreasureSoulBehaviour.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Treasure/TreasureSoulModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Treasure/TreasureSoulWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA512_tagCMActiveMWSoul.cs
New file @@ -0,0 +1,18 @@ using UnityEngine; using System.Collections; // A5 12 激活法宝之魂 #tagCMActiveMWSoul public class CA512_tagCMActiveMWSoul : GameNetPackBasic { public byte ID; //编号 public CA512_tagCMActiveMWSoul () { combineCmd = (ushort)0x03FE; _cmd = (ushort)0xA512; } public override void WriteToBytes () { WriteBytes (ID, NetDataType.BYTE); } } Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA512_tagCMActiveMWSoul.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 0ffb9a375c8c7ad499c781a9d61d3e95 timeCreated: 1534562087 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Core/NetworkPackage/ServerPack/HA3_Function/HA353_tagMCMWPrivilegeDataInfo.cs
@@ -17,6 +17,7 @@ for (int i = 0; i < Count; i ++) { InfoList[i] = new tagMCMWPrivilegeData(); TransBytes (out InfoList[i].PriID, vBytes, NetDataType.DWORD); TransBytes (out InfoList[i].State, vBytes, NetDataType.BYTE); TransBytes (out InfoList[i].CurValue, vBytes, NetDataType.DWORD); TransBytes (out InfoList[i].GotValue, vBytes, NetDataType.DWORD); TransBytes (out InfoList[i].ItemAwardState, vBytes, NetDataType.BYTE); @@ -25,6 +26,7 @@ public struct tagMCMWPrivilegeData { public uint PriID; // 特权ID public byte State; //激活状态 public uint CurValue; //当前总进度 public uint GotValue; //已领取进度 public byte ItemAwardState; //物品奖励是否已领取 System/Treasure/FairyTreasureCollectPanelPattern5.cs
@@ -78,8 +78,6 @@ DisplayFurnace(); DisplayFunc(); achievementModel.achievementCompletedEvent += AchievementCompletedEvent; model.treasureStateChangeEvent -= OnTreasureStateChange; model.treasureStateChangeEvent += OnTreasureStateChange; completedAchivement = 0; @@ -110,23 +108,10 @@ achievementModel.GotoCompleteAchievement(currentAchievement.id); } protected override void OnTreasureStateChange(int _id) { if (_id != treasureId) { return; } if (model.newGotTreasureId == treasureId) { model.newGotTreasureId = 0; } } public override void Dispose() { m_GotoGet.onClick.RemoveAllListeners(); achievementModel.achievementCompletedEvent -= AchievementCompletedEvent; model.treasureStateChangeEvent -= OnTreasureStateChange; for (int i = 0; i < m_FurnacesAchievements.Length; i++) { m_FurnacesAchievements[i].Dispose(); @@ -261,10 +246,6 @@ IEnumerator Co_Fly() { yield return WaitingForSecondConst.WaitMS300; if (model.newGotTreasureId == treasureId) { model.newGotTreasureId = 0; } model.treasureStepUpShow = false; BeginFly(); } System/Treasure/TreasureModel.cs
@@ -522,7 +522,7 @@ } if (serverInited) { newGotTreasureId = id == 301 ? 0 : id; newGotTreasureId = id; treasureEntranceShowId = id; var mapConfig = ConfigManager.Instance.GetTemplate<MapConfig>(PlayerDatas.Instance.baseData.MapID); System/Treasure/TreasureNewGotWin.cs
@@ -58,7 +58,8 @@ Treasure treasure; TreasureStage treasureStage; public int displayStageCount = 0; int displayStageCount = 0; float stageTime = 0.7f; public static event Action CloseTreasureNewGotWinEvent; ShowStep m_ShowStep = ShowStep.None; @@ -239,14 +240,15 @@ } break; case ShowStep.ShowUnlock: m_FuncUnLockSlider.value = timer / (displayStageCount * 0.7f); if (timer > displayStageCount * 0.7f) m_FuncUnLockSlider.value = timer / (3 * stageTime); if (timer > 3 * stageTime) { timer = 0f; showStep = ShowStep.ShowComplete; } var index = (int)(timer / (displayStageCount * 0.7f) * 10); if (index < m_TreasureNewGots.Length && !m_TreasureNewGots[index].gameObject.activeSelf) var index = (int)(timer / stageTime); if (index < displayStageCount && index < m_TreasureNewGots.Length && !m_TreasureNewGots[index].gameObject.activeSelf) { m_TreasureNewGots[index].Show(); } System/Treasure/TreasureSoulAchievementCell.cs
New file @@ -0,0 +1,68 @@ using System; using System.Collections; using System.Collections.Generic; using TableConfig; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { public class TreasureSoulAchievementCell : CellView { [SerializeField] Text m_Description; [SerializeField] Text m_Progress; [SerializeField] Image m_Complete; AchievementModel model { get { return ModelCenter.Instance.GetModel<AchievementModel>(); } } int achievementId = 0; private void OnEnable() { model.achievementProgressUpdateEvent += AchievementProgressUpdateEvent; model.achievementCompletedEvent += AchievementCompletedEvent; } private void OnDisable() { model.achievementProgressUpdateEvent -= AchievementProgressUpdateEvent; model.achievementCompletedEvent -= AchievementCompletedEvent; } private void AchievementProgressUpdateEvent(int _id) { if (_id == achievementId) { Display(achievementId); } } private void AchievementCompletedEvent(int _id) { if (_id == achievementId) { Display(achievementId); } } public void Display(int _achievementId) { achievementId = _achievementId; Achievement achievement; var config = ConfigManager.Instance.GetTemplate<SuccessConfig>(_achievementId); if (config != null) { m_Description.text = config.Describe; } m_Complete.gameObject.SetActive(false); if (model.TryGetAchievement(_achievementId, out achievement)) { var progress = achievement.completed ? config.NeedCnt : Mathf.Clamp(achievement.progress, 0, config.NeedCnt); m_Progress.text = StringUtility.Contact("(", UIHelper.GetTextColorByItemColor(progress >= config.NeedCnt ? TextColType.Green : TextColType.Red, progress.ToString(), true) , "/", config.NeedCnt, ")"); m_Complete.gameObject.SetActive(achievement.completed); } } } } System/Treasure/TreasureSoulAchievementCell.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 5563e9b8650a93448a20b3fa6e58df56 timeCreated: 1534570886 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/Treasure/TreasureSoulBehaviour.cs
@@ -28,6 +28,8 @@ } } AchievementModel achievementModel { get { return ModelCenter.Instance.GetModel<AchievementModel>(); } } private void Awake() { m_SelectBtn.onClick.AddListener(OnSelect); @@ -37,12 +39,26 @@ { model.treasureSelectSoulChangeEvent += TreasureSelectSoulChangeEvent; model.treasureSoulEvent += TreasureSoulEvent; achievementModel.achievementCompletedEvent += AchievementCompletedEvent; } private void OnDisable() { model.treasureSelectSoulChangeEvent -= TreasureSelectSoulChangeEvent; model.treasureSoulEvent -= TreasureSoulEvent; achievementModel.achievementCompletedEvent -= AchievementCompletedEvent; } private void AchievementCompletedEvent(int _id) { int achievementId = 0; if (model.TryGetRealmAchievement(treasureSoulId, out achievementId)) { if (achievementId == _id) { DisplayState(); } } } public void Display(int _id) @@ -69,11 +85,32 @@ { if (special.active) { m_Lock.gameObject.SetActive(false); m_SoulState.text = Language.Get("TreasureSoul_Awoke"); } else { m_SoulState.text = Language.Get("TreasureSoul_Awaking"); int achievementId = 0; bool unlock = true; if (model.TryGetRealmAchievement(treasureSoulId, out achievementId)) { Achievement achievement; if (achievementModel.TryGetAchievement(achievementId, out achievement)) { unlock = achievement.completed; } } m_Lock.gameObject.SetActive(!unlock); if (unlock) { m_SoulState.text = Language.Get("TreasureSoul_Awaking"); } else { var successConfig = ConfigManager.Instance.GetTemplate<SuccessConfig>(achievementId); var realmConfig = ConfigManager.Instance.GetTemplate<RealmConfig>(successConfig.Condition[0]); m_SoulState.text = string.Format("境界<Img img={0}/>解锁", realmConfig.Img); } } } } System/Treasure/TreasureSoulModel.cs
@@ -97,9 +97,82 @@ return treasureSouls; } public bool TryGetRealmAchievement(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 = ConfigManager.Instance.GetTemplate<SuccessConfig>(list[i]); if (config != null && config.Type == 50) { achievementId = list[i]; return true; } } } return false; } public bool TryGetAchievements(int _id,out List<int> list) { return soulAchievements.TryGetValue(_id, out list); } public bool IsCompleteRealmAchievement(int _id) { TreasureSpecialData special; if (TryGetTreasureSoul(_id, out special)) { if (special.active) { return true; } int achievementId; if (TryGetRealmAchievement(_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) @@ -170,17 +243,23 @@ for (int i = 0; i < package.Count; i++) { var _data = package.InfoList[i]; if ((TreasurePrivilege)_data.PriID == TreasurePrivilege.StrengthenAdd) TreasureSpecialData special; if (!treasureSoulDict.TryGetValue((int)_data.PriID, out special)) { continue; } if (treasureSoulDict.ContainsKey((int)_data.PriID)) special.active = _data.State == 1; if ((TreasurePrivilege)_data.PriID == TreasurePrivilege.StrengthenAdd) { var _specialData = treasureSoulDict[(int)_data.PriID]; _specialData.presentFinishCount = (int)_data.GotValue; _specialData.presentGetCount = (int)_data.CurValue; _specialData.itemGet = _data.ItemAwardState == 1; if (treasureSoulEvent != null) { treasureSoulEvent((int)_data.PriID); } continue; } special.presentFinishCount = (int)_data.GotValue; special.presentGetCount = (int)_data.CurValue; special.itemGet = _data.ItemAwardState == 1; UpdateRedpoint((int)_data.PriID); UpdateAchievementRedpoint((int)_data.PriID); if (treasureSoulEvent != null) System/Treasure/TreasureSoulWin.cs
@@ -24,10 +24,19 @@ [SerializeField] Text m_SoulDescription; [SerializeField] Image m_SoulTarget; [SerializeField] Button m_Active; [SerializeField] Text m_ActiveText; [SerializeField] Button m_GotoRealm; [SerializeField] List<TreasureSoulPattern> m_TreasureSouls; [SerializeField] ScrollerController m_ScollerControl; [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 @@ -48,6 +57,11 @@ } } AchievementModel achievementModel { get { return ModelCenter.Instance.GetModel<AchievementModel>(); } } int m_SelectSoul = 0; @@ -61,14 +75,18 @@ 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() { model.treasureSelectSoulChangeEvent += TreasureSelectSoulChangeEvent; PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent; model.treasureSoulEvent += TreasureSoulEvent; achievementModel.achievementCompletedEvent += AchievementCompletedEvent; m_TreasureSoulBtn.state = TitleBtnState.Click; Display(); DisplaySelect(); @@ -90,6 +108,8 @@ { 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(); @@ -102,6 +122,15 @@ WindowCenter.Instance.Open<MainInterfaceWin>(); } #endregion private void AchievementCompletedEvent(int _id) { List<int> list; if (model.TryGetAchievements(model.selectSoul, out list) && list.Contains(_id)) { DisplaySelect(); } } private void Display() { @@ -171,14 +200,33 @@ DisplaySelect(); } private void TreasureSoulEvent(int _id) { if (_id == model.selectSoul) { TreasureSpecialData special; if (model.TryGetTreasureSoul(_id, out special)) { m_SelectSoulImg.material = special.active ? MaterialUtility.GetUIDefaultGraphicMaterial() : MaterialUtility.GetDefaultSpriteGrayMaterial(); } } } private void Active() { model.ActiveTreasureSoul(model.selectSoul); } private void GotoRealm() { WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.RealmFunc1); } private void DisplaySelect() { TreasureSpecialData special; model.TryGetTreasureSoul(model.selectSoul, out special); m_ContainerCondition.gameObject.SetActive(false); if (special != null) { var config = ConfigManager.Instance.GetTemplate<TreasurePrivilegeConfig>((int)special.type); @@ -188,10 +236,37 @@ m_SoulDescription.text = UIHelper.ReplaceNewLine(config.Description); m_SoulTarget.SetSprite(config.targetDescription); m_SoulTarget.SetNativeSize(); m_Active.gameObject.SetActive(model.IsGetTreasureSoul(model.selectSoul)); DisplayPrivilege(special); m_SelectSoulImg.SetSprite(config.Icon); m_SelectSoulImg.material = special.active ? MaterialUtility.GetUIDefaultGraphicMaterial() : MaterialUtility.GetDefaultSpriteGrayMaterial(); if (special.active) { m_Active.gameObject.SetActive(false); m_GotoRealm.gameObject.SetActive(false); } else { if (!model.IsCompleteRealmAchievement(model.selectSoul)) { m_Active.gameObject.SetActive(false); m_GotoRealm.gameObject.SetActive(true); } 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_ContainerPreview.gameObject.SetActive(!special.active); if (!special.active) { DisplayPreview(model.selectSoul); } } } } @@ -230,6 +305,163 @@ } } private void DisplayPreview(int _id) { m_ContainerPreview.gameObject.SetActive(false); TreasureSpecialData special; model.TryGetTreasureSoul(_id, out special); switch (special.type) { case TreasurePrivilege.Wing: case TreasurePrivilege.Suit: case TreasurePrivilege.Property: m_PreviewTitle.text = Language.Get("TreasureSoulAddPropertyTitle"); break; case TreasurePrivilege.DemonJarAtk: case TreasurePrivilege.StrengthenAdd: case TreasurePrivilege.MountAtk: case TreasurePrivilege.PetHp: case TreasurePrivilege.Sp: m_PreviewTitle.text = Language.Get("TreasureSoulGetPropertyTitle"); break; } for (int i = 0; i < m_PreviewPropretys.Count; i++) { m_PreviewPropretys[i].gameObject.SetActive(false); } switch (special.type) { case TreasurePrivilege.Property: var _index = 0; m_ContainerPreview.gameObject.SetActive(true); foreach (var _key in special.propertyDict.Keys) { var _value = special.propertyDict[_key]; m_PreviewPropretys[_index].gameObject.SetActive(true); m_PreviewPropretys[_index].DisplayUpper(_key, _value); _index++; } break; case TreasurePrivilege.Suit: var percentSuit = (float)special.propertyDict[87] / 10000; var dict = suitModel.GetActiveSuitAttr(); var _suitIndex = 0; foreach (var _key in dict.Keys) { var propertyConfig = ConfigManager.Instance.GetTemplate<PlayerPropertyConfig>(_key); if (propertyConfig == null || propertyConfig.type != 1) { continue; } m_PreviewPropretys[_suitIndex].gameObject.SetActive(true); m_PreviewPropretys[_suitIndex].DisplayUpper(_key, (int)(percentSuit * dict[_key])); _suitIndex++; } m_ContainerPreview.gameObject.SetActive(_suitIndex > 0); break; case TreasurePrivilege.Wing: var percentWing = (float)special.propertyDict[86] / 10000; var itemModel = pack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retWing); m_ContainerPreview.gameObject.SetActive(itemModel != null); if (itemModel != null) { var itemConfig = ConfigManager.Instance.GetTemplate<ItemConfig>(itemModel.itemId); float value = 0; if (ContainsProperty(itemConfig, 6, out value)) { if (itemModel.GetUseDataModel(42) != null) { value += strengthengmodel.BackpackWings(itemModel.itemId, itemModel.GetUseDataModel(42)[0])[1]; } } m_PreviewPropretys[0].gameObject.SetActive(true); m_PreviewPropretys[0].Display(6, (int)(value * percentWing)); } break; case TreasurePrivilege.DemonJarAtk: case TreasurePrivilege.PetHp: case TreasurePrivilege.MountAtk: case TreasurePrivilege.Sp: var index = 0; m_ContainerPreview.gameObject.SetActive(true); foreach (var _key in special.propertyDict.Keys) { var _value = special.propertyDict[_key] * (special.presentGetCount / special.progress); if (_value <= 0) { m_ContainerPreview.gameObject.SetActive(false); break; } m_PreviewPropretys[index].gameObject.SetActive(true); m_PreviewPropretys[index].DisplayUpper(_key, _value); index++; } break; case TreasurePrivilege.StrengthenAdd: var configs = ConfigManager.Instance.GetAllValues<ItemPlusSumAttrConfig>(); var present = -1; var next = 0; var presentGetCount = 0; foreach (var value in strengthengmodel._EqInfo.Values) { ItemModel equip = pack.GetItemModelByIndex(PackType.rptEquip, value.EquipIndex); if (equip != null) { presentGetCount += value.EquipPartStarLV; } } for (int i = 0; i < configs.Count; i++) { if (presentGetCount >= configs[i].countNeed) { present = i; } } next = present + 1; m_ContainerPreview.gameObject.SetActive(present >= 0); if (present >= 0) { var config = configs[present]; for (int i = 0; i < m_PreviewPropretys.Count; i++) { m_PreviewPropretys[i].gameObject.SetActive(i < config.attType.Length); if (i < config.attType.Length) { m_PreviewPropretys[i].DisplayUpper(config.attType[i], config.attValue[i]); } } } 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 = ConfigManager.Instance.GetTemplate<SuccessConfig>(list[i]); if (config != null && config.Type == 50) { 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) { TreasureSpecialData special_x; @@ -240,6 +472,37 @@ } return x.CompareTo(y); } bool ContainsProperty(ItemConfig config, int _property, out float value) { value = 0; if (config.Effect1 == _property && config.EffectValueA1 > 0) { value = config.EffectValueA1; return true; } if (config.Effect2 == _property && config.EffectValueA2 > 0) { value = config.EffectValueA2; return true; } if (config.Effect3 == _property && config.EffectValueA3 > 0) { value = config.EffectValueA3; return true; } if (config.Effect4 == _property && config.EffectValueA4 > 0) { value = config.EffectValueA4; return true; } if (config.Effect5 == _property && config.EffectValueA5 > 0) { value = config.EffectValueA5; return true; } return false; } } }