From 958a3925462bfd78b91727f8a98021c5e5805c81 Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期一, 13 十一月 2023 14:50:13 +0800 Subject: [PATCH] 9895 子 【BT0.1】【主干】坐骑、灵宠、称号升星 / 【BT0.1】坐骑、灵宠、称号升星 - 坐骑升星, 并删除了很古老的坐骑升级消耗表 --- Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CE_tagMCTitleStarInfo.cs | 11 Core/GameEngine/Model/Config/HorseStarUpConfig.cs.meta | 5 Core/NetworkPackage/ServerPack/HA3_Function/HA3CE_tagMCTitleStarInfo.cs | 29 Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA536_tagCMTitleStarUp.cs | 18 Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA535_tagCMHorseStarUp.cs.meta | 5 System/RoleParticulars/RoleParticularModel.cs | 266 ------ Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA535_tagCMHorseStarUp.cs | 18 Core/GameEngine/Model/Config/HorseStarUpConfig.cs | 88 +- Core/NetworkPackage/ServerPack/HA3_Function/HA3CD_tagMCHorseStarInfo.cs.meta | 5 System/Mount/MountSkinWin.cs | 913 ++++++++++++++--------- Core/GameEngine/Model/TelPartialConfig/HorseStarUpConfig.cs.meta | 5 System/KnapSack/Logic/ItemTipsModel.cs | 21 Utility/ConfigInitiator.cs | 2 System/Mount/MountModel.cs | 187 ++-- Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CD_tagMCHorseStarInfo.cs.meta | 5 Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CE_tagMCTitleStarInfo.cs.meta | 5 System/Mount/SelectThemount.cs | 8 Core/GameEngine/Model/TelPartialConfig/HorseStarUpConfig.cs | 29 /dev/null | 257 ------ Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA536_tagCMTitleStarUp.cs.meta | 5 Core/NetworkPackage/ServerPack/HA3_Function/HA3CD_tagMCHorseStarInfo.cs | 29 System/RoleParticulars/ViewHorseDetailWin.cs | 50 - System/Pet/TargetPetAttrWin.cs | 93 -- System/RoleParticulars/RoleParticularsWin.cs | 2 System/Pet/RidingAndPetActivationModel.cs | 40 - Core/NetworkPackage/ServerPack/HA3_Function/HA3CE_tagMCTitleStarInfo.cs.meta | 5 Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CD_tagMCHorseStarInfo.cs | 15 System/ItemTip/TipPetMountSkillWidget.cs | 150 +-- 28 files changed, 904 insertions(+), 1,362 deletions(-) diff --git a/Core/GameEngine/Model/Config/HorseUpConfig.cs b/Core/GameEngine/Model/Config/HorseStarUpConfig.cs similarity index 62% rename from Core/GameEngine/Model/Config/HorseUpConfig.cs rename to Core/GameEngine/Model/Config/HorseStarUpConfig.cs index f502a57..a0a49ec 100644 --- a/Core/GameEngine/Model/Config/HorseUpConfig.cs +++ b/Core/GameEngine/Model/Config/HorseStarUpConfig.cs @@ -1,6 +1,6 @@ 锘�//-------------------------------------------------------- // [Author]: Fish -// [ Date ]: Wednesday, May 15, 2019 +// [ Date ]: 2023骞�10鏈�22鏃� //-------------------------------------------------------- using System.Collections.Generic; @@ -8,60 +8,50 @@ using System.Threading; using System; using UnityEngine; +using LitJson; +using System.Linq; - -public partial class HorseUpConfig +public partial class HorseStarUpConfig { - public readonly int ID; + public readonly int id; public readonly int HorseID; - public readonly int LV; - public readonly int NeedExp; - public readonly int[] AttrType; - public readonly int[] AttrValue; - public readonly int[] SkillID; - public readonly int NeedExpTotal; + public readonly int HorseStar; + public readonly List<int[]> StarUpNeedItemList; + public readonly int[] StarAttrType; + public readonly int[] StarAttrValue; - public HorseUpConfig() + public HorseStarUpConfig() { } - public HorseUpConfig(string input) + public HorseStarUpConfig(string input) { try { var tables = input.Split('\t'); - int.TryParse(tables[0],out ID); + int.TryParse(tables[0],out id); int.TryParse(tables[1],out HorseID); - int.TryParse(tables[2],out LV); + int.TryParse(tables[2],out HorseStar); - int.TryParse(tables[3],out NeedExp); + StarUpNeedItemList = JsonMapper.ToObject<int[][]>(tables[3]).ToList(); - string[] AttrTypeStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); - AttrType = new int[AttrTypeStringArray.Length]; - for (int i=0;i<AttrTypeStringArray.Length;i++) - { - int.TryParse(AttrTypeStringArray[i],out AttrType[i]); + string[] StarAttrTypeStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); + StarAttrType = new int[StarAttrTypeStringArray.Length]; + for (int i=0;i<StarAttrTypeStringArray.Length;i++) + { + int.TryParse(StarAttrTypeStringArray[i],out StarAttrType[i]); } - string[] AttrValueStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); - AttrValue = new int[AttrValueStringArray.Length]; - for (int i=0;i<AttrValueStringArray.Length;i++) - { - int.TryParse(AttrValueStringArray[i],out AttrValue[i]); + string[] StarAttrValueStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); + StarAttrValue = new int[StarAttrValueStringArray.Length]; + for (int i=0;i<StarAttrValueStringArray.Length;i++) + { + int.TryParse(StarAttrValueStringArray[i],out StarAttrValue[i]); } - - string[] SkillIDStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); - SkillID = new int[SkillIDStringArray.Length]; - for (int i=0;i<SkillIDStringArray.Length;i++) - { - int.TryParse(SkillIDStringArray[i],out SkillID[i]); - } - - int.TryParse(tables[7],out NeedExpTotal); } catch (Exception ex) { @@ -69,12 +59,12 @@ } } - static Dictionary<string, HorseUpConfig> configs = new Dictionary<string, HorseUpConfig>(); - public static HorseUpConfig Get(string id) + static Dictionary<string, HorseStarUpConfig> configs = new Dictionary<string, HorseStarUpConfig>(); + public static HorseStarUpConfig Get(string id) { if (!inited) { - Debug.Log("HorseUpConfig 杩樻湭瀹屾垚鍒濆鍖栥��"); + Debug.Log("HorseStarUpConfig 杩樻湭瀹屾垚鍒濆鍖栥��"); return null; } @@ -83,17 +73,17 @@ return configs[id]; } - HorseUpConfig config = null; + HorseStarUpConfig config = null; if (rawDatas.ContainsKey(id)) { - config = configs[id] = new HorseUpConfig(rawDatas[id]); + config = configs[id] = new HorseStarUpConfig(rawDatas[id]); rawDatas.Remove(id); } return config; } - public static HorseUpConfig Get(int id) + public static HorseStarUpConfig Get(int id) { return Get(id.ToString()); } @@ -106,15 +96,15 @@ return keys; } - public static List<HorseUpConfig> GetValues() + public static List<HorseStarUpConfig> GetValues() { - var values = new List<HorseUpConfig>(); + var values = new List<HorseStarUpConfig>(); values.AddRange(configs.Values); var keys = new List<string>(rawDatas.Keys); - foreach (var key in keys) + for (int i = 0; i < keys.Count; i++) { - values.Add(Get(key)); + values.Add(Get(keys[i])); } return values; @@ -138,15 +128,15 @@ var path = string.Empty; if (AssetSource.refdataFromEditor) { - path = ResourcesPath.CONFIG_FODLER +"/HorseUp.txt"; + path = ResourcesPath.CONFIG_FODLER +"/HorseStarUp.txt"; } else { - path = AssetVersionUtility.GetAssetFilePath("config/HorseUp.txt"); + path = AssetVersionUtility.GetAssetFilePath("config/HorseStarUp.txt"); } configs.Clear(); - var tempConfig = new HorseUpConfig(); + var tempConfig = new HorseStarUpConfig(); var preParse = tempConfig is IConfigPostProcess; if (sync) @@ -170,7 +160,7 @@ if (preParse) { - var config = new HorseUpConfig(line); + var config = new HorseStarUpConfig(line); configs[id] = config; (config as IConfigPostProcess).OnConfigParseCompleted(); } @@ -209,7 +199,7 @@ if (preParse) { - var config = new HorseUpConfig(line); + var config = new HorseStarUpConfig(line); configs[id] = config; (config as IConfigPostProcess).OnConfigParseCompleted(); } diff --git a/Core/GameEngine/Model/TelPartialConfig/tagHorseUpConfig.cs.meta b/Core/GameEngine/Model/Config/HorseStarUpConfig.cs.meta similarity index 69% copy from Core/GameEngine/Model/TelPartialConfig/tagHorseUpConfig.cs.meta copy to Core/GameEngine/Model/Config/HorseStarUpConfig.cs.meta index b6f6932..286fc4a 100644 --- a/Core/GameEngine/Model/TelPartialConfig/tagHorseUpConfig.cs.meta +++ b/Core/GameEngine/Model/Config/HorseStarUpConfig.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 95567471ba5b9dd44b507afebe648e87 -timeCreated: 1502963061 -licenseType: Pro +guid: b16167c21e45f054a9629b81bdc6461e MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Core/GameEngine/Model/Config/HorseUpConfig.cs.meta b/Core/GameEngine/Model/Config/HorseUpConfig.cs.meta deleted file mode 100644 index 320cf21..0000000 --- a/Core/GameEngine/Model/Config/HorseUpConfig.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 75c1dd130a2c06b4d8e9dead97744f6d -timeCreated: 1557892038 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Core/GameEngine/Model/TelPartialConfig/HorseStarUpConfig.cs b/Core/GameEngine/Model/TelPartialConfig/HorseStarUpConfig.cs new file mode 100644 index 0000000..759685c --- /dev/null +++ b/Core/GameEngine/Model/TelPartialConfig/HorseStarUpConfig.cs @@ -0,0 +1,29 @@ +锘縰sing System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public partial class HorseStarUpConfig : IConfigPostProcess +{ + public static Dictionary<int, List<int>> horseIDToIDs = new Dictionary<int, List<int>>(); //鍧愰獞骞诲寲鍗囨槦 + + public void OnConfigParseCompleted() + { + if (!horseIDToIDs.ContainsKey(HorseID)) + { + horseIDToIDs.Add(HorseID, new List<int>()); + } + + horseIDToIDs[HorseID].Add(id); + } + + public static List<int> GetIdsByHorseID(int horseID) + { + if (horseIDToIDs.ContainsKey(horseID)) + { + return horseIDToIDs[horseID]; + } + + return null; + } + +} diff --git a/Core/GameEngine/Model/TelPartialConfig/tagHorseUpConfig.cs.meta b/Core/GameEngine/Model/TelPartialConfig/HorseStarUpConfig.cs.meta similarity index 69% rename from Core/GameEngine/Model/TelPartialConfig/tagHorseUpConfig.cs.meta rename to Core/GameEngine/Model/TelPartialConfig/HorseStarUpConfig.cs.meta index b6f6932..0e7e9ad 100644 --- a/Core/GameEngine/Model/TelPartialConfig/tagHorseUpConfig.cs.meta +++ b/Core/GameEngine/Model/TelPartialConfig/HorseStarUpConfig.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 95567471ba5b9dd44b507afebe648e87 -timeCreated: 1502963061 -licenseType: Pro +guid: d237c2b8c0ed77642ad62ce20c50e052 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Core/GameEngine/Model/TelPartialConfig/tagHorseUpConfig.cs b/Core/GameEngine/Model/TelPartialConfig/tagHorseUpConfig.cs deleted file mode 100644 index f161328..0000000 --- a/Core/GameEngine/Model/TelPartialConfig/tagHorseUpConfig.cs +++ /dev/null @@ -1,94 +0,0 @@ -锘縰sing System.Collections; -using System.Collections.Generic; -using System.Text; - -public partial class HorseUpConfig : IConfigPostProcess -{ - private static Dictionary<string, HorseUpConfig> t_Horse = new Dictionary<string, HorseUpConfig>(); - private static Dictionary<int, List<HorseUpConfig>> mountIdDict = new Dictionary<int, List<HorseUpConfig>>(); - private static Dictionary<int, int> horseSkillDict = new Dictionary<int, int>(); - - public void OnConfigParseCompleted() - { - t_Horse.Add(StringUtility.Contact(HorseID, LV).ToString(), this); - if (!mountIdDict.ContainsKey(HorseID)) - { - List<HorseUpConfig> list = new List<HorseUpConfig>(); - list.Add(this); - mountIdDict.Add(HorseID, list); - } - else - { - mountIdDict[HorseID].Add(this); - } - - if (SkillID.Length > 0 && SkillID[0] != 0) - { - if (!horseSkillDict.ContainsKey(SkillID[0])) - { - horseSkillDict.Add(SkillID[0], HorseID); - } - } - } - - public static HorseUpConfig GetHorseIDAndLV(int _HorseID, int _LV) - { - HorseUpConfig tagHorse = null; - t_Horse.TryGetValue(StringUtility.Contact(_HorseID, _LV).ToString(), out tagHorse); - return tagHorse; - } - - public static List<HorseUpConfig> GetMountlistById(int _HorseID) - { - List<HorseUpConfig> list = null; - mountIdDict.TryGetValue(_HorseID, out list); - return list; - } - - public static void GetHorseSkills(int _id, int _lv, bool onlyActive, ref List<int> skills) - { - skills.Clear(); - var list = GetMountlistById(_id); - if (list != null) - { - for (int i = 0; i < list.Count; i++) - { - if (list[i].SkillID.Length == 0 || list[i].SkillID[0] == 0) - { - continue; - } - if (_lv < list[i].LV && onlyActive) - { - continue; - } - if (list[i].SkillID[0] != 0) - { - skills.Add(list[i].SkillID[0]); - } - } - } - } - - public static int GetSkillCondition(int _id, int skillId) - { - var list = GetMountlistById(_id); - if (list != null) - { - for (int i = 0; i < list.Count; i++) - { - if (list[i].SkillID.Length > 0 && - list[i].SkillID[0] == skillId) - { - return list[i].LV; - } - } - } - return 0; - } - - public static bool TryGetHorseBySkill(int skillId, out int horseId) - { - return horseSkillDict.TryGetValue(skillId, out horseId); - } - -} diff --git a/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA535_tagCMHorseStarUp.cs b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA535_tagCMHorseStarUp.cs new file mode 100644 index 0000000..5271f08 --- /dev/null +++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA535_tagCMHorseStarUp.cs @@ -0,0 +1,18 @@ +using UnityEngine; +using System.Collections; + +// A5 35 鍧愰獞鍗囨槦 #tagCMHorseStarUp + +public class CA535_tagCMHorseStarUp : GameNetPackBasic { + public uint HorseID; //鍧愰獞ID锛屽搴斿潗楠戣〃ID + + public CA535_tagCMHorseStarUp () { + combineCmd = (ushort)0x03FE; + _cmd = (ushort)0xA535; + } + + public override void WriteToBytes () { + WriteBytes (HorseID, NetDataType.DWORD); + } + +} diff --git a/System/Mount/AutoTrainTipsWin.cs.meta b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA535_tagCMHorseStarUp.cs.meta similarity index 68% rename from System/Mount/AutoTrainTipsWin.cs.meta rename to Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA535_tagCMHorseStarUp.cs.meta index 65396d0..18edda5 100644 --- a/System/Mount/AutoTrainTipsWin.cs.meta +++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA535_tagCMHorseStarUp.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 11720f48ce490cb4eb9282355be5f5ff -timeCreated: 1516001401 -licenseType: Free +guid: 73af8ddf1a5acbd43a3c7634c51d56ae MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA536_tagCMTitleStarUp.cs b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA536_tagCMTitleStarUp.cs new file mode 100644 index 0000000..034bdcb --- /dev/null +++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA536_tagCMTitleStarUp.cs @@ -0,0 +1,18 @@ +using UnityEngine; +using System.Collections; + +// A5 36 绉板彿鍗囨槦 #tagCMTitleStarUp + +public class CA536_tagCMTitleStarUp : GameNetPackBasic { + public uint TitleID; //绉板彿ID + + public CA536_tagCMTitleStarUp () { + combineCmd = (ushort)0x03FE; + _cmd = (ushort)0xA536; + } + + public override void WriteToBytes () { + WriteBytes (TitleID, NetDataType.DWORD); + } + +} diff --git a/System/Mount/AutoTrainTipsWin.cs.meta b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA536_tagCMTitleStarUp.cs.meta similarity index 68% copy from System/Mount/AutoTrainTipsWin.cs.meta copy to Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA536_tagCMTitleStarUp.cs.meta index 65396d0..7484bfd 100644 --- a/System/Mount/AutoTrainTipsWin.cs.meta +++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA536_tagCMTitleStarUp.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 11720f48ce490cb4eb9282355be5f5ff -timeCreated: 1516001401 -licenseType: Free +guid: 47bd2356f8f54de468961466c91b7996 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CD_tagMCHorseStarInfo.cs b/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CD_tagMCHorseStarInfo.cs new file mode 100644 index 0000000..d946e38 --- /dev/null +++ b/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CD_tagMCHorseStarInfo.cs @@ -0,0 +1,15 @@ +using UnityEngine; +using System.Collections; +using Snxxz.UI; + +// A3 CD 鍧愰獞鏄熺骇淇℃伅 #tagMCHorseStarInfo + +public class DTCA3CD_tagMCHorseStarInfo : DtcBasic { + + MountModel mountModel { get { return ModelCenter.Instance.GetModel<MountModel>(); } } + public override void Done(GameNetPackBasic vNetPack) { + base.Done(vNetPack); + HA3CD_tagMCHorseStarInfo vNetData = vNetPack as HA3CD_tagMCHorseStarInfo; + mountModel.UpdateHorseStarInfo(vNetData); + } +} diff --git a/System/Mount/AutoTrainTipsWin.cs.meta b/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CD_tagMCHorseStarInfo.cs.meta similarity index 68% copy from System/Mount/AutoTrainTipsWin.cs.meta copy to Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CD_tagMCHorseStarInfo.cs.meta index 65396d0..155c210 100644 --- a/System/Mount/AutoTrainTipsWin.cs.meta +++ b/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CD_tagMCHorseStarInfo.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 11720f48ce490cb4eb9282355be5f5ff -timeCreated: 1516001401 -licenseType: Free +guid: cccbe4ed544541e4ab18164430e884e2 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CE_tagMCTitleStarInfo.cs b/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CE_tagMCTitleStarInfo.cs new file mode 100644 index 0000000..2a98795 --- /dev/null +++ b/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CE_tagMCTitleStarInfo.cs @@ -0,0 +1,11 @@ +using UnityEngine; +using System.Collections; + +// A3 CE 绉板彿鏄熺骇淇℃伅 #tagMCTitleStarInfo + +public class DTCA3CE_tagMCTitleStarInfo : DtcBasic { + public override void Done(GameNetPackBasic vNetPack) { + base.Done(vNetPack); + HA3CE_tagMCTitleStarInfo vNetData = vNetPack as HA3CE_tagMCTitleStarInfo; + } +} diff --git a/System/Mount/AutoTrainTipsWin.cs.meta b/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CE_tagMCTitleStarInfo.cs.meta similarity index 68% copy from System/Mount/AutoTrainTipsWin.cs.meta copy to Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CE_tagMCTitleStarInfo.cs.meta index 65396d0..8a68f10 100644 --- a/System/Mount/AutoTrainTipsWin.cs.meta +++ b/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3CE_tagMCTitleStarInfo.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 11720f48ce490cb4eb9282355be5f5ff -timeCreated: 1516001401 -licenseType: Free +guid: 57a249eb6099d224e87801e94dbdb655 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Core/NetworkPackage/ServerPack/HA3_Function/HA3CD_tagMCHorseStarInfo.cs b/Core/NetworkPackage/ServerPack/HA3_Function/HA3CD_tagMCHorseStarInfo.cs new file mode 100644 index 0000000..7c72f78 --- /dev/null +++ b/Core/NetworkPackage/ServerPack/HA3_Function/HA3CD_tagMCHorseStarInfo.cs @@ -0,0 +1,29 @@ +using UnityEngine; +using System.Collections; + +// A3 CD 鍧愰獞鏄熺骇淇℃伅 #tagMCHorseStarInfo + +public class HA3CD_tagMCHorseStarInfo : GameNetPackBasic { + public byte Count; + public tagMCHorseStar[] HorseStarList; + + public HA3CD_tagMCHorseStarInfo () { + _cmd = (ushort)0xA3CD; + } + + public override void ReadFromBytes (byte[] vBytes) { + TransBytes (out Count, vBytes, NetDataType.BYTE); + HorseStarList = new tagMCHorseStar[Count]; + for (int i = 0; i < Count; i ++) { + HorseStarList[i] = new tagMCHorseStar(); + TransBytes (out HorseStarList[i].HorseID, vBytes, NetDataType.DWORD); + TransBytes (out HorseStarList[i].Star, vBytes, NetDataType.BYTE); + } + } + + public struct tagMCHorseStar { + public uint HorseID; // 鍧愰獞琛↖D + public byte Star; // 鏄熺骇 + } + +} diff --git a/System/Mount/AutoTrainTipsWin.cs.meta b/Core/NetworkPackage/ServerPack/HA3_Function/HA3CD_tagMCHorseStarInfo.cs.meta similarity index 68% copy from System/Mount/AutoTrainTipsWin.cs.meta copy to Core/NetworkPackage/ServerPack/HA3_Function/HA3CD_tagMCHorseStarInfo.cs.meta index 65396d0..9073d33 100644 --- a/System/Mount/AutoTrainTipsWin.cs.meta +++ b/Core/NetworkPackage/ServerPack/HA3_Function/HA3CD_tagMCHorseStarInfo.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 11720f48ce490cb4eb9282355be5f5ff -timeCreated: 1516001401 -licenseType: Free +guid: b9db0f104a0f45b4dac9f82736b83c51 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Core/NetworkPackage/ServerPack/HA3_Function/HA3CE_tagMCTitleStarInfo.cs b/Core/NetworkPackage/ServerPack/HA3_Function/HA3CE_tagMCTitleStarInfo.cs new file mode 100644 index 0000000..af74a2e --- /dev/null +++ b/Core/NetworkPackage/ServerPack/HA3_Function/HA3CE_tagMCTitleStarInfo.cs @@ -0,0 +1,29 @@ +using UnityEngine; +using System.Collections; + +// A3 CE 绉板彿鏄熺骇淇℃伅 #tagMCTitleStarInfo + +public class HA3CE_tagMCTitleStarInfo : GameNetPackBasic { + public byte Count; + public tagMCTitleStar[] TitleStarList; + + public HA3CE_tagMCTitleStarInfo () { + _cmd = (ushort)0xA3CE; + } + + public override void ReadFromBytes (byte[] vBytes) { + TransBytes (out Count, vBytes, NetDataType.BYTE); + TitleStarList = new tagMCTitleStar[Count]; + for (int i = 0; i < Count; i ++) { + TitleStarList[i] = new tagMCTitleStar(); + TransBytes (out TitleStarList[i].TitleID, vBytes, NetDataType.DWORD); + TransBytes (out TitleStarList[i].Star, vBytes, NetDataType.BYTE); + } + } + + public struct tagMCTitleStar { + public uint TitleID; // 绉板彿ID + public byte Star; // 鏄熺骇 + } + +} diff --git a/System/Mount/AutoTrainTipsWin.cs.meta b/Core/NetworkPackage/ServerPack/HA3_Function/HA3CE_tagMCTitleStarInfo.cs.meta similarity index 68% copy from System/Mount/AutoTrainTipsWin.cs.meta copy to Core/NetworkPackage/ServerPack/HA3_Function/HA3CE_tagMCTitleStarInfo.cs.meta index 65396d0..dcb00aa 100644 --- a/System/Mount/AutoTrainTipsWin.cs.meta +++ b/Core/NetworkPackage/ServerPack/HA3_Function/HA3CE_tagMCTitleStarInfo.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 11720f48ce490cb4eb9282355be5f5ff -timeCreated: 1516001401 -licenseType: Free +guid: 6d0589f4972dc7249a7c849972bc392a MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/System/ItemTip/TipPetMountSkillWidget.cs b/System/ItemTip/TipPetMountSkillWidget.cs index 401bf28..6bfb0c3 100644 --- a/System/ItemTip/TipPetMountSkillWidget.cs +++ b/System/ItemTip/TipPetMountSkillWidget.cs @@ -1,81 +1,69 @@ -锘�//-------------------------------------------------------- -// [Author]: 绗簩涓栫晫 -// [ Date ]: Tuesday, April 16, 2019 -//-------------------------------------------------------- -using UnityEngine; -using System.Collections; -using UnityEngine.UI; -using System.Collections.Generic; - -namespace Snxxz.UI -{ - - public class TipPetMountSkillWidget : MonoBehaviour - { - [SerializeField] ScrollerController m_Scroll; - - public void Display(PetMountTipWin.ShowType showType, int itemId) - { - var skillInfos = new List<SkillInfo>(); - - switch (showType) - { - case PetMountTipWin.ShowType.Pet: - var petId = PetInfoConfig.GetItemUnLockPet(itemId); - var petConfig = PetInfoConfig.Get(petId); - - var min = Mathf.Min(petConfig.SkillID.Length, petConfig.SkillUnLock.Length); - for (var i = 0; i < min; i++) - { - var skillId = petConfig.SkillID[i]; - var unlockLevel = petConfig.SkillUnLock[i]; - skillInfos.Add(new SkillInfo() { skillId = skillId, unlockLevel = unlockLevel }); - } - break; - case PetMountTipWin.ShowType.Mount: - var horseId = HorseConfig.GetItemUnLockHorse(itemId); - var horseUpConfigs = HorseUpConfig.GetMountlistById(horseId); - foreach (var config in horseUpConfigs) - { - foreach (var skill in config.SkillID) - { - if (skill > 0) - { - skillInfos.Add(new SkillInfo() { skillId = skill, unlockLevel = config.LV }); - } - } - } - break; - } - m_Scroll.OnRefreshCell -= OnRefreshCell; - m_Scroll.OnRefreshCell += OnRefreshCell; - - //m_Scroll.Init(skillInfos); - m_Scroll.Refresh(); - foreach (var skillinfo in skillInfos) - { - CellInfo info = new CellInfo(); - info.infoInt1 = skillinfo.unlockLevel; - m_Scroll.AddCell(ScrollerDataType.Header, skillinfo.skillId, info); - } - m_Scroll.Restart(); - } - - void OnRefreshCell(ScrollerDataType type, CellView cell) - { - var _cell = cell as TipPetMountSkillBehaviour; - _cell.Display(cell.index, cell.info.Value.infoInt1); - } - - public struct SkillInfo - { - public int skillId; - public int unlockLevel; - } - - } - -} - - - +锘�//-------------------------------------------------------- +// [Author]: 绗簩涓栫晫 +// [ Date ]: Tuesday, April 16, 2019 +//-------------------------------------------------------- +using UnityEngine; +using System.Collections; +using UnityEngine.UI; +using System.Collections.Generic; + +namespace Snxxz.UI +{ + + public class TipPetMountSkillWidget : MonoBehaviour + { + [SerializeField] ScrollerController m_Scroll; + + public void Display(PetMountTipWin.ShowType showType, int itemId) + { + var skillInfos = new List<SkillInfo>(); + + switch (showType) + { + case PetMountTipWin.ShowType.Pet: + var petId = PetInfoConfig.GetItemUnLockPet(itemId); + var petConfig = PetInfoConfig.Get(petId); + + var min = Mathf.Min(petConfig.SkillID.Length, petConfig.SkillUnLock.Length); + for (var i = 0; i < min; i++) + { + var skillId = petConfig.SkillID[i]; + var unlockLevel = petConfig.SkillUnLock[i]; + skillInfos.Add(new SkillInfo() { skillId = skillId, unlockLevel = unlockLevel }); + } + break; + case PetMountTipWin.ShowType.Mount: + break; + } + m_Scroll.OnRefreshCell -= OnRefreshCell; + m_Scroll.OnRefreshCell += OnRefreshCell; + + //m_Scroll.Init(skillInfos); + m_Scroll.Refresh(); + foreach (var skillinfo in skillInfos) + { + CellInfo info = new CellInfo(); + info.infoInt1 = skillinfo.unlockLevel; + m_Scroll.AddCell(ScrollerDataType.Header, skillinfo.skillId, info); + } + m_Scroll.Restart(); + } + + void OnRefreshCell(ScrollerDataType type, CellView cell) + { + var _cell = cell as TipPetMountSkillBehaviour; + _cell.Display(cell.index, cell.info.Value.infoInt1); + } + + public struct SkillInfo + { + public int skillId; + public int unlockLevel; + } + + } + +} + + + diff --git a/System/KnapSack/Logic/ItemTipsModel.cs b/System/KnapSack/Logic/ItemTipsModel.cs index e5aa367..23ffbfa 100644 --- a/System/KnapSack/Logic/ItemTipsModel.cs +++ b/System/KnapSack/Logic/ItemTipsModel.cs @@ -70,27 +70,6 @@ { unlockMountDict.Add(horselist[i].UnlockItemID, horselist[i]); } - Dictionary<int, List<int>> skillDict = new Dictionary<int, List<int>>(); - List<HorseUpConfig> mountlist = HorseUpConfig.GetMountlistById(horselist[i].HorseID); - if (mountlist != null) - { - for (int j = 0; j < mountlist.Count; j++) - { - int[] skills = mountlist[j].SkillID; - List<int> skilllist = new List<int>(); - if (skills != null) - { - for (int k = 0; k < skills.Length; k++) - { - if (skills[k] != 0) - { - skilllist.Add(skills[k]); - skillDict.Add(mountlist[j].LV, skilllist); - } - } - } - } - } } #endregion diff --git a/System/Mount/AutoTrainTipsWin.cs b/System/Mount/AutoTrainTipsWin.cs deleted file mode 100644 index 0619eca..0000000 --- a/System/Mount/AutoTrainTipsWin.cs +++ /dev/null @@ -1,257 +0,0 @@ -锘�//-------------------------------------------------------- -// [Author]: 绗簩涓栫晫 -// [ Date ]: Monday, January 15, 2018 -//-------------------------------------------------------- - -using System; -using System.Collections; -using System.Collections.Generic; - -using UnityEngine; -using UnityEngine.UI; -//鍧愰獞鐨勫脊妗� -namespace Snxxz.UI -{ - - public class AutoTrainTipsWin : Window - { - #region Built-in - [SerializeField] Button m_CloseBtn;//鍏抽棴 - [SerializeField] Button m_CancelBtn;//鍙栨秷 - [SerializeField] Button m_ConfirmBtn;//纭畾 - [SerializeField] Button m_BtnReduce;//鍑� - [SerializeField] Button m_BtnPlus;//鍔� - - [SerializeField] Button _DotText1Btn;//璁$畻鍣ㄦ寜閽� - [SerializeField] Button _NumKeyBoardBGM;//璁$畻鏈洪潰鏉挎寜閽� - [SerializeField] NumKeyBoard _NumKeyBoard;//璁$畻鏈� - - [SerializeField] Text NextToLvText;//闇�瑕侀┋鍏荤瓑绾� - [SerializeField] Text NeedNumberText;//鎵�闇�璐拱鐨勯鏁� - [SerializeField] Text m_NowLevelTxt;//褰撳墠绛夌骇 - [SerializeField] Text m_AutoUpRemind; - - private int horseID = 0; - public static int _Lvnumber = 0;//鏍囪闇�瑕佸崌鍒版墍闇�鐨勯樁鏁� - public static int DomesticateNumber = 0;//椹吇娆℃暟 - private bool isBool = true; - public static bool IsFairy = false; - List<HorseSkillClass> MountSkills = new List<HorseSkillClass>(); - MountModel m_MountModel; - MountModel mountModel { get { return m_MountModel ?? (m_MountModel = ModelCenter.Instance.GetModel<MountModel>()); } } - protected override void BindController() - { - } - - protected override void AddListeners() - { - m_CloseBtn.AddListener(OnClickCloseButton); - m_CancelBtn.AddListener(OnClickCancelButton); - m_ConfirmBtn.AddListener(OnClickConfirmButton); - m_BtnReduce.AddListener(OnClickReduceButton); - m_BtnPlus.AddListener(OnClickPlusButton); - _DotText1Btn.AddListener(OnClickDotText1); - _NumKeyBoardBGM.AddListener(OnClickNumKeyBoardBGM); - _NumKeyBoard.onValueChange.AddListener(OnClickNumKeyBoardValueChange); - _NumKeyBoard.onConfirm.AddListener(onConfirm); - - } - - protected override void OnPreOpen() - { - IsFairy = false; - _NumKeyBoardBGM.SetActive(false); - isBool = true; - horseID = 1; - m_NowLevelTxt.text = string.Format(Language.Get("Z1031"), mountModel._DicHorse[horseID].Lv); - GetMountSkills(horseID); - PropertyEntries(horseID);//榛樿鑷姩閫夋嫨 - int GetLvNow = mountModel._DicHorse[horseID].Lv; - int MaxLv = HorseConfig.Get(horseID).MaxLV; - _NumKeyBoard.min = (uint)(GetLvNow + 1); - _NumKeyBoard.max = (uint)MaxLv; - m_AutoUpRemind.text = Language.Get("HorseAutoLevelUpRemind", mountModel.horseUpItemCost); - } - - protected override void OnAfterOpen() - { - } - - protected override void OnPreClose() - { - } - - protected override void OnAfterClose() - { - } - #endregion - - private void GetMountSkills(int MountID)//鑾峰彇鍧愰獞鐨勬妧鑳� - { - MountSkills.Clear(); - foreach (var key in mountModel.GetMountSkillAndItem.Keys) - { - if (mountModel.GetMountSkillAndItem[key].HorseID == MountID) - { - MountSkills.Add(mountModel.GetMountSkillAndItem[key]); - } - } - } - private void PropertyEntries(int MountID)//榛樿鑷姩閫夋嫨 - { - int NextMountLv = 0; - int getLv = mountModel._DicHorse[MountID].Lv; - HorseConfig horseconfig = HorseConfig.Get(MountID); - bool IsBool = true; - for (int i = 0; i < MountSkills.Count; i++) - { - if (MountSkills[i].HorseLV > getLv && IsBool) - { - NextMountLv = MountSkills[i].HorseLV; - IsBool = false; - } - } - if (IsBool) - { - NextMountLv = horseconfig.MaxLV; - } - _Lvnumber = NextMountLv; - int NowHorseExp = HorseUpConfig.GetHorseIDAndLV(MountID, getLv).NeedExpTotal + mountModel._DicHorse[MountID].Exp;//褰撳墠绛夌骇鐨勭粡楠� - int NeedNumber = Mathf.CeilToInt((float)(HorseUpConfig.GetHorseIDAndLV(MountID, NextMountLv).NeedExpTotal - NowHorseExp) / 100);//鎵�闇�瑕佺殑棰楁暟 - DomesticateNumber = NeedNumber; - NeedNumberText.text = NeedNumber.ToString(); - NextToLvText.text = NextMountLv + Language.Get("Z1041"); - } - - private void SetMountSelectionInformation(int MountID, int LV) - { - int getLv = mountModel._DicHorse[MountID].Lv; - int NowHorseExp = HorseUpConfig.GetHorseIDAndLV(MountID, getLv).NeedExpTotal + mountModel._DicHorse[MountID].Exp;//褰撳墠绛夌骇鐨勭粡楠� - int NeedNumber = Mathf.CeilToInt((float)(HorseUpConfig.GetHorseIDAndLV(MountID, LV).NeedExpTotal - NowHorseExp) / 100);//鎵�闇�瑕佺殑棰楁暟 - DomesticateNumber = NeedNumber; - NextToLvText.text = LV + Language.Get("Z1041"); - NeedNumberText.text = NeedNumber.ToString(); - } - - private void OnClickCloseButton() - { - Close(); - } - private void OnClickCancelButton() - { - Close(); - } - private void OnClickConfirmButton()//纭畾 - { - int NeedFairyJade = DomesticateNumber * mountModel.horseUpItemCost; - - int gold = (int)UIHelper.GetMoneyCnt(1); - if (NeedFairyJade > 0 && gold >= NeedFairyJade) - { - IsFairy = true; - Close(); - } - else - { - if (VersionConfig.Get().isBanShu) - { - SysNotifyMgr.Instance.ShowTip("GoldErr"); - return; - } - WindowCenter.Instance.Open<RechargeTipWin>(); - } - - } - private void OnClickReduceButton()//鍑� - { - int getLvNow = mountModel._DicHorse[horseID].Lv; - if (_Lvnumber - 1 < getLvNow + 1) - { - ScrollTip.ShowTip(Language.Get("BelowCultureLevel_Z")); - } - else - { - _Lvnumber -= 1; - SetMountSelectionInformation(horseID, _Lvnumber); - } - - } - private void OnClickPlusButton()//鍔� - { - int MaxLv = HorseConfig.Get(horseID).MaxLV; - if (_Lvnumber + 1 <= MaxLv) - { - _Lvnumber += 1; - SetMountSelectionInformation(horseID, _Lvnumber); - } - else - { - ScrollTip.ShowTip(Language.Get("MoreThanDomestication_Z")); - } - } - private void OnClickDotText1()//涓棿鐐瑰嚮 - { - if (!_NumKeyBoardBGM.gameObject.activeSelf) - { - _NumKeyBoardBGM.SetActive(true); - } - } - private void OnClickNumKeyBoardBGM()//鍏抽棴闈㈡澘 - { - if (_NumKeyBoardBGM.gameObject.activeSelf) - { - _NumKeyBoardBGM.SetActive(false); - } - } - - private void OnClickNumKeyBoardValueChange() - { - if (int.Parse(_NumKeyBoard.Value) > 999) - { - NextToLvText.text = 999 + Language.Get("Z1041"); - } - else - { - NextToLvText.text = int.Parse(_NumKeyBoard.Value) + Language.Get("Z1041"); - } - - - } - private void NumKeyBoardValueChange() - { - int GetLvNow = mountModel._DicHorse[horseID].Lv; - int MaxLv = HorseConfig.Get(horseID).MaxLV; - if (int.Parse(_NumKeyBoard.Value) < GetLvNow + 1) - { - _Lvnumber = GetLvNow + 1; - SetMountSelectionInformation(horseID, _Lvnumber); - ScrollTip.ShowTip(Language.Get("LessThanTheDomesticated_Z")); - } - else if (int.Parse(_NumKeyBoard.Value) > MaxLv) - { - _Lvnumber = MaxLv; - SetMountSelectionInformation(horseID, _Lvnumber); - ScrollTip.ShowTip(Language.Get("MoreThanDomestication_Z")); - } - else if(int.Parse(_NumKeyBoard.Value)>= GetLvNow + 1 && int.Parse(_NumKeyBoard.Value)<= MaxLv) - { - _Lvnumber = int.Parse(_NumKeyBoard.Value); - SetMountSelectionInformation(horseID, _Lvnumber); - } - - } - private void onConfirm(bool _bool) - { - if (_bool) - { - NumKeyBoardValueChange(); - _NumKeyBoardBGM.SetActive(false); - } - } - } - -} - - - - diff --git a/System/Mount/MountModel.cs b/System/Mount/MountModel.cs index 966727e..283c666 100644 --- a/System/Mount/MountModel.cs +++ b/System/Mount/MountModel.cs @@ -81,6 +81,7 @@ Dictionary<SkillEffectGroup, List<int>> integrationHorseSkills = new Dictionary<SkillEffectGroup, List<int>>(); Dictionary<int, SkillEffectGroup> horseSkillEffectValues = new Dictionary<int, SkillEffectGroup>(); Dictionary<int, int> horseSkills = new Dictionary<int, int>(); + public Dictionary<int, int> horseStarDict = new Dictionary<int, int>(); //鍧愰獞骞诲寲鍗囨槦 Dictionary<int, int> unLockSkinItems = new Dictionary<int, int>(); @@ -184,6 +185,7 @@ HorseRidingBool = false; Wait = true; MountHA301MorePack = false; + horseStarDict.Clear(); } public void OnPlayerLoginOk() @@ -227,7 +229,6 @@ } List<HorseConfig> Hconfigs = new List<HorseConfig>(); - List<HorseUpConfig> Uconfigs = new List<HorseUpConfig>(); public int RedPoint_HuaxingID = MainRedDot.RedPoint_MountPackKey * 10; //鍖栧舰绾㈢偣 int RedPoint_DanID = MainRedDot.RedPoint_MountPackKey * 10 + 1; //鍙敤鍧愰獞涓圭孩鐐� @@ -247,73 +248,7 @@ } } - private void MountChangeRedPoint()//鍧愰獞婵�娲荤孩鐐� - { - return; - //foreach (var key in DeblockingRedPoint.Keys) - //{ - // DeblockingRedPoint[key].state = RedPointState.None; - //} - //if (!FuncOpen.Instance.IsFuncOpen(8)) - //{ - // return; - //} - //if (Hconfigs.Count <= 0) - //{ - // Hconfigs = HorseConfig.GetValues(); - //} - //// var configs = HorseConfig.GetValues(); - //foreach (var config in Hconfigs) - //{ - // int unlockItemID = config.UnlockItemID; - // int itemCount = playerPack.GetItemCountByID(PackType.Item, unlockItemID); - // int unlockItemCnt = config.UnlockItemCnt; - // if (itemCount >= unlockItemCnt && !_DicHorse.ContainsKey(config.HorseID)) - // { - // DeblockingRedPoint[config.HorseID].state = RedPointState.Simple; - // } - //} - } - //void MountSkillAndItem()//鑾峰彇鍧愰獞鎶�鑳� - //{ - // if (GetMountSkillAndItem.Count != 0) - // return; - // if (Uconfigs.Count <= 0) - // { - // Uconfigs = HorseUpConfig.GetValues(); - // } - // //var configs = HorseUpConfig.GetValues(); - // foreach (var config in Uconfigs) - // { - // if (!HorseConfig.Has(config.HorseID)) - // { - // continue; - // } - - // for (int i = 0; i < config.SkillID.Length; i++) - // { - // int skillID = config.SkillID[i]; - // if (skillID != 0 && !GetMountSkillAndItem.ContainsKey(skillID)) - // { - // SkillConfig _skillModel = SkillConfig.Get(skillID); - // if (_skillModel == null) - // { - // Debug.Log(skillID); - // } - - // HorseSkillClass horseSkillClass = new HorseSkillClass(); - // horseSkillClass.SkillID = skillID; - // horseSkillClass.SkillItem = _skillModel.ExAttr4; - // horseSkillClass.HorseID = config.HorseID; - // horseSkillClass.HorseLV = config.LV; - // GetMountSkillAndItem.Add(skillID, horseSkillClass); - // } - // } - // } - //} - //private const int Redpoint_key1 = 1050101; - //public Redpoint redPointStre1 = new Redpoint(MainRedDot.RedPoint_MountPackKey, Redpoint_key1);//鍧愰獞澶栬 private const int Redpoint_key2 = MainRedDot.RedPoint_MountPackKey * 10 + 2; public Redpoint redPointStre2 = new Redpoint(MainRedDot.RedPoint_MountPackKey, Redpoint_key2);//鍧愰獞鍏介瓊 @@ -344,6 +279,11 @@ { DeblockingRedPoint[activeID].state = RedPointState.Simple; } + else + { + RefreshStarRedpoint(id); + } + } ForsterHorseRed(id); @@ -368,10 +308,43 @@ { DeblockingRedPoint[activeID].state = RedPointState.Simple; } + else + { + RefreshStarRedpoint(id); + } } ForsterHorseRed(id); } + } + + //鍗囨槦鍜岃В閿佸叡鐢ㄧ孩鐐� + void RefreshStarRedpoint(int itemID) + { + int activeID = unLockSkinItems[itemID]; + int horseID = HorseConfig.GetItemUnLockHorse(itemID); + if (!HorseStarUpConfig.horseIDToIDs.ContainsKey(horseID)) + return; + if (!isMountSkinActive(horseID)) + return; + + DeblockingRedPoint[activeID].state = RedPointState.None; + + int star = 0; + horseStarDict.TryGetValue(horseID, out star); + //婊℃槦 + if (star == HorseStarUpConfig.horseIDToIDs[horseID].Count) + return; + + var id = HorseStarUpConfig.horseIDToIDs[horseID][star]; + var nextStarConfig = HorseStarUpConfig.Get(id); + List<int[]> awards = nextStarConfig.StarUpNeedItemList; + for (int i = 0; i < awards.Count; i++) + { + if (playerPack.GetItemCountByID(PackType.Item, awards[i][0]) < awards[i][1]) + return; + } + DeblockingRedPoint[activeID].state = RedPointState.Simple; } //private void OnFuncStateChangeEvent(int funcId) @@ -418,7 +391,7 @@ } } - private void MountStoneRed()//鍧愰獞榄傜煶绾㈢偣 + public void MountStoneRed()//鍧愰獞榄傜煶绾㈢偣 { redPointStre2.state = RedPointState.None; if (!FuncOpen.Instance.IsFuncOpen(8)) @@ -458,39 +431,6 @@ } - - private int GetRedPointMountID(List<int> MountList) - { - int GetSkillMinLv = 999; - for (int i = 0; i < MountList.Count; i++) - { - int SkillminLv = GetSkillLvDis(MountList[i]); - if (SkillminLv < GetSkillMinLv && SkillminLv != 0) - { - GetSkillMinLv = SkillminLv; - } - } - - int mountId = 0; - int ExpNumber = 999999999; - for (int i = 0; i < MountList.Count; i++) - { - int SkillLv = GetSkillLvDis(MountList[i]); - if (SkillLv > GetSkillMinLv || SkillLv == 0) - { - continue; - } - var Hor1 = HorseUpConfig.GetHorseIDAndLV(MountList[i], SkillLv); - var Hor2 = HorseUpConfig.GetHorseIDAndLV(MountList[i], _DicHorse[(MountList[i])].Lv); - int Exp = Hor1.NeedExpTotal - Hor2.NeedExpTotal - _DicHorse[(MountList[i])].Exp; - if (Exp < ExpNumber) - { - ExpNumber = Exp; - mountId = MountList[i]; - } - } - return mountId; - } private int GetSkillLvDis(int MountId)//鑾峰彇绂诲崌绾ф渶杩戠殑鎶�鑳界瓑绾� { @@ -670,15 +610,7 @@ else { int _AttT = 0;//鏀诲嚮 - foreach (int key in _DicHorse.Keys) - { - HorseUpConfig tagMode = HorseUpConfig.GetHorseIDAndLV(key, _DicHorse[key].Lv); - int[] intAttrValue = tagMode.AttrValue; - if (intAttrValue.Length != 0) - { - _AttT += intAttrValue[1]; - } - } + return _AttT + dicStone[7]; } } @@ -1113,4 +1045,39 @@ RankHorseIDList.Add(horseConfig.HorseID); } } + + //鍧愰獞骞诲寲鍗囨槦 + public void UpdateHorseStarInfo(HA3CD_tagMCHorseStarInfo netPack) + { + for (int i = 0; i < netPack.HorseStarList.Length; i++) + { + horseStarDict[(int)netPack.HorseStarList[i].HorseID] = netPack.HorseStarList[i].Star; + } + onMountSkinActive?.Invoke(); + + foreach (var id in unLockSkinItems.Keys) + { + RefreshStarRedpoint(id); + } + } + + //鍧愰獞骞诲寲鐗╁搧鏄惁鍙敤浜庤閱� + public bool IsHorseSkinCanAwake(int horseID) + { + if (!isMountSkinActive(horseID)) + { + return false; + } + + if (!HorseStarUpConfig.horseIDToIDs.ContainsKey(horseID)) + return true; + + int star = 0; + horseStarDict.TryGetValue(horseID, out star); + //婊℃槦 + if (star != HorseStarUpConfig.horseIDToIDs[horseID].Count) + return false; + + return true; + } } diff --git a/System/Mount/MountSkinWin.cs b/System/Mount/MountSkinWin.cs index 4c9e76e..7ca89d0 100644 --- a/System/Mount/MountSkinWin.cs +++ b/System/Mount/MountSkinWin.cs @@ -1,376 +1,537 @@ -锘�//-------------------------------------------------------- -// [Author]: 绗簩涓栫晫 -// [ Date ]: Friday, January 05, 2018 -//-------------------------------------------------------- - -using Snxxz.UI; -using System; -using System.Collections; -using System.Collections.Generic; - -using UnityEngine; -using UnityEngine.UI; -//鍧愰獞闈㈡澘 -namespace Snxxz.UI -{ - - public class MountSkinWin : Window, SecondWindowInterface - { - [SerializeField] ScrollerController m_ScrollerController; - [SerializeField] Button m_DeblockingBtton;//瑙i攣鎸夐挳 - [SerializeField] Button m_RideBtton;//楠戜箻 - [SerializeField] RawImage m_Mount3D; - [SerializeField] Text m_FightPower; - [SerializeField] Text m_MountName;//琚�変腑鐨勫潗楠戝悕 - [SerializeField] ItemCell MountItem; - [SerializeField] Text MountItemName; - [SerializeField] List<Text> AttrNameList; - [SerializeField] List<Text> AttrValueList; - - List<Int3> sortMountlist = new List<Int3>();//鍧愰獞椤哄簭鎺掑垪 - public int signHorseID = 0;//鐢ㄦ潵鏍囪鍧愰獞ID - - public Button close { get; set; } - #region Built-in - - PackModel _playerPack; - PackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); } } - MountModel m_MountModel; - MountModel mountModel { get { return m_MountModel ?? (m_MountModel = ModelCenter.Instance.GetModel<MountModel>()); } } - - RidingAndPetActivationModel ridingAndPetActivationModel { get { return ModelCenter.Instance.GetModel<RidingAndPetActivationModel>(); } } - - - protected override void BindController() - { - if (this is SecondWindowInterface) - { - var frame = this.GetComponentInChildren<SecondFrameLoader>(); - frame.Create(); - close = frame.GetComponentInChildren<Button>(); - } - - } - - protected override void AddListeners() - { - m_DeblockingBtton.SetListener(OnClickDeblockingBtton); - close.SetListener(() => - { - CloseClick(); - WindowCenter.Instance.Open<PetWin>(false, 0); - }); - - m_RideBtton.SetListener(() => { - mountModel.AppearanceSwitch((byte)mountModel.mountSkin[signHorseID], 2); - }); - } - - private void onMountSkinActive() - { - m_ScrollerController.m_Scorller.RefreshActiveCellViews();//鍒锋柊鍙 - RefreshMountSkinPanel(); - ridingAndPetActivationModel.RidingAndPetActivationSet(RidingAndPetActivation.MountActivation, signHorseID); - sortMountlist.Clear(); - ToAddSorting(); - } - - protected override void OnPreOpen() - { - MountModel.Event_MountHA301A += OnMountSkinAdd; - m_ScrollerController.OnRefreshCell += OnRefreshGridCell; - mountModel.onMountSkinActive += onMountSkinActive; - MountModel.Event_MountAlteration += Event_MountAlteration; - ToAddSorting(); - int jumpIndex = JumpSelect(OpenChooseIndex()); - OnCreateGridLineCell(m_ScrollerController); - m_ScrollerController.JumpIndex(JumpSelect(jumpIndex)); - - RefreshMountSkinPanel(); - } - protected override void OnActived() - { - base.OnActived(); - } - protected override void OnAfterOpen() - { - } - - protected override void OnPreClose() - { - MountModel.Event_MountHA301A -= OnMountSkinAdd; - m_ScrollerController.OnRefreshCell -= OnRefreshGridCell; - mountModel.onMountSkinActive -= onMountSkinActive; - MountModel.Event_MountAlteration -= Event_MountAlteration; - UI3DModelExhibition.Instance.StopShow(); - signHorseID = 0; - } - - - - - protected override void OnAfterClose() - { - - } - - - private int JumpIndex(int HorseID = 0) - { - int Index = 0; - Index = sortMountlist.FindIndex((x) => - { - return x.x == signHorseID; - }); - if (Index == -1) - { - Index = 0; - } - return JumpSelect(Index); - } - - - private int OpenChooseIndex() - { - // 绾㈢偣-楠戜箻涓�-绗竴涓� - int selectIndex = 0; - int ridingHorseSkinID = -1; - if (mountModel.mountSkin.ContainsKey(mountModel.HorseIDNow)) - { - ridingHorseSkinID = mountModel.mountSkin[mountModel.HorseIDNow]; - } - int index = 0; - foreach (var sortInfo in sortMountlist) - { - if (ridingHorseSkinID != -1 && ridingHorseSkinID == sortInfo[0]) - { - selectIndex = index; - } - if (mountModel.DeblockingRedPoint[sortInfo[0]].state != RedPointState.None) - { - signHorseID = HorseSkinPlusConfig.Get(sortInfo[0]).HorseID; - return index; - } - index++; - } - - signHorseID = HorseSkinPlusConfig.Get(sortMountlist[selectIndex][0]).HorseID; - return selectIndex; - } - - void OnCreateGridLineCell(ScrollerController gridCtrl) - { - gridCtrl.Refresh(); - for (int i = 0; i < sortMountlist.Count; i++) - { - gridCtrl.AddCell(ScrollerDataType.Header, HorseSkinPlusConfig.Get(sortMountlist[i].x).HorseID); - } - gridCtrl.Restart(); - } - private void OnRefreshGridCell(ScrollerDataType type, CellView cell) - { - SelectThemount selectThemount = cell.GetComponent<SelectThemount>(); - int horseID = cell.index; - var horseConfig = HorseConfig.Get(horseID); - selectThemount.QualityTxt1.text = ProductOrder(horseConfig.Quality.ToString()); - selectThemount.MountNameTxt.text = horseConfig.Name; - selectThemount.MountLvActivation.SetActive(!mountModel.isMountSkinActive(horseID)); - - if (horseID == signHorseID) - { - selectThemount.ChoosenImg.SetActive(true); - selectThemount.DarkImage.SetActive(false); - } - else - { - selectThemount.ChoosenImg.SetActive(false); - selectThemount.DarkImage.SetActive(true); - } - selectThemount.HidingTips.SetActive(mountModel.HorseIDNow == horseID ? true : false); - - selectThemount.MountButton.SetListener(()=> { - if (signHorseID == horseID) - return; - signHorseID = horseID; - m_ScrollerController.m_Scorller.RefreshActiveCellViews();//鍒锋柊鍙 - RefreshMountSkinPanel(); - }); - - selectThemount.RedPoint.redpointId = mountModel.DeblockingRedPoint[mountModel.mountSkin[horseID]].id; - } - - private void RefreshMountSkinPanel() - { - if (signHorseID == 0) - return; - HorseConfig _model = HorseConfig.Get(signHorseID); - m_MountName.text = _model.Name; - - if (!m_Mount3D.gameObject.activeSelf) - { - m_Mount3D.SetActive(true); - } - - UI3DModelExhibition.Instance.ShowHourse(_model.Model, m_Mount3D); - if (UI3DModelExhibition.Instance.NpcModelHorse != null) - { - var animator = UI3DModelExhibition.Instance.NpcModelHorse.GetComponent<Animator>(); - if (animator != null) - { - animator.Play(GAStaticDefine.State_Dance); - - } - } - - ShowAttrText(); - DisplayButton(); - } - - private void Event_MountAlteration() - { - DisplayButton(); - - m_ScrollerController.m_Scorller.RefreshActiveCellViews();//鍒锋柊鍙 - } - - private void DisplayButton() - { - if (mountModel.isMountSkinActive(signHorseID)) - { - m_DeblockingBtton.SetActive(false); - m_RideBtton.SetActive(true); - if (signHorseID == mountModel.HorseIDNow) - { - m_RideBtton.SetActive(false); - } - - return; - } - //AppearanceSwitch - HorseConfig horsefig = HorseConfig.Get(signHorseID); - - ItemCellModel cellModel = new ItemCellModel(horsefig.UnlockItemID, false, 1); - MountItem.Init(cellModel); - MountItem.countText.SetActive(true); - MountItem.countText.text = playerPack.GetItemCountByID(PackType.Item, horsefig.UnlockItemID).ToString(); - var itemConfig = ItemConfig.Get(horsefig.UnlockItemID); - MountItemName.text = UIHelper.AppendColor(itemConfig.ItemColor, itemConfig.ItemName); - MountItem.button.SetListener(() => - { - ItemTipUtility.Show(horsefig.UnlockItemID); - }); - - m_DeblockingBtton.SetActive(true); - m_RideBtton.SetActive(false); - } - - private void ShowAttrText() - { - ClearAttrText(); - var config = HorseSkinPlusConfig.Get(mountModel.mountSkin[signHorseID]); - int showIndex = 0; - Dictionary<int, int> allAttr = new Dictionary<int, int>(); - foreach (var attrID in config.AttrType) - { - allAttr[attrID] = config.AttrValue[showIndex]; - AttrNameList[showIndex].text = PlayerPropertyConfig.Get(attrID).ShowName; - AttrValueList[showIndex].text = PlayerPropertyConfig.GetValueDescription(attrID, config.AttrValue[showIndex]); - showIndex++; - } - - m_FightPower.text = (UIHelper.GetFightPower(allAttr) + config.InitFightPower).ToString(); - } - - private void ClearAttrText() - { - for (int i = 0; i < AttrNameList.Count; i++) - { - AttrNameList[i].text = string.Empty; - AttrValueList[i].text = string.Empty; - - } - - } - - - private void OnClickDeblockingBtton()//瑙i攣鎸夐挳 - { - HorseConfig horsefig = HorseConfig.Get(signHorseID); - int MaterialNumber = playerPack.GetItemCountByID(PackType.Item, horsefig.UnlockItemID);//鑾峰彇鑳屽寘瑙i攣鏉愭枡鐨勬暟閲� - if (MaterialNumber >= horsefig.UnlockItemCnt) - { - CA501_tagPlayerActivateHorse _tagA501 = new CA501_tagPlayerActivateHorse(); - _tagA501.HorseID = (uint)mountModel.mountSkin[signHorseID]; - GameNetSystem.Instance.SendInfo(_tagA501); - - } - else - { - ScrollTip.ShowTip(Language.Get("Z1063"));//鎵�闇�鏉愭枡涓嶈冻 - } - } - - - #endregion - - void ToAddSorting()//鍧愰獞鐨勫垪琛ㄦ帓搴� - { - - if (sortMountlist.Count <= 0) - { - - foreach (var mountSkin in mountModel.MountSkinActive) - { - var config = HorseSkinPlusConfig.Get(mountSkin.Key); - sortMountlist.Add(new Int3(mountSkin.Key, mountSkin.Value, config.sortIndex)); - } - } - sortMountlist.Sort(Compare); - } - int Compare(Int3 skin1, Int3 skin2)//鏁扮粍鎺掑垪 - { - - var xActive = skin1.y; - var yActive = skin2.y; - - if (xActive != yActive) - { - return yActive.CompareTo(xActive); - } - return skin1.z.CompareTo(skin2.z); - } - - - string ProductOrder(string _petProductOrder)//鍧愰獞鍝佽川 - { - FuncConfigConfig _PetQuality = FuncConfigConfig.Get("PetQuality"); - string[] _productlist = _PetQuality.Numerical1.Split('|'); - for (int i = 0; i < _productlist.Length; i++) - { - if (_petProductOrder == _productlist[i]) - { - string[] _productText = _PetQuality.Numerical2.Split('|'); - string str = _productText[i]; - return str; - } - } - return null; - } - private int JumpSelect(int Index) - { - if (Index <= 4) - { - return 0; - } - return Index; - } - - private void OnMountSkinAdd(int id) - { - } - } -} - - - - +锘�//-------------------------------------------------------- +// [Author]: 绗簩涓栫晫 +// [ Date ]: Friday, January 05, 2018 +//-------------------------------------------------------- + +using LitJson; +using Snxxz.UI; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEngine.UI; +//鍧愰獞闈㈡澘 +namespace Snxxz.UI +{ + + public class MountSkinWin : Window, SecondWindowInterface + { + [SerializeField] ScrollerController m_ScrollerController; + [SerializeField] Button m_DeblockingBtton;//瑙i攣鎸夐挳 + [SerializeField] Button m_RideBtton;//楠戜箻 + [SerializeField] RawImage m_Mount3D; + [SerializeField] Text m_FightPower; + [SerializeField] Text m_MountName;//琚�変腑鐨勫潗楠戝悕 + [SerializeField] ItemCell MountItem; + [SerializeField] Text MountItemName; + [SerializeField] List<Text> AttrNameList; + [SerializeField] List<Text> AttrValueList; + + [SerializeField] Transform starUpObj; + [SerializeField] List<Transform> starsObj; + [SerializeField] List<ItemCell> itemCells; + [SerializeField] ButtonEx starUpBtn; + [SerializeField] Transform maxObj; + [SerializeField] UIEffect starEffect; + + List<Int3> sortMountlist = new List<Int3>();//鍧愰獞椤哄簭鎺掑垪 + public int signHorseID = 0;//鐢ㄦ潵鏍囪鍧愰獞ID + + public Button close { get; set; } + #region Built-in + + PackModel _playerPack; + PackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); } } + MountModel m_MountModel; + MountModel mountModel { get { return m_MountModel ?? (m_MountModel = ModelCenter.Instance.GetModel<MountModel>()); } } + + RidingAndPetActivationModel ridingAndPetActivationModel { get { return ModelCenter.Instance.GetModel<RidingAndPetActivationModel>(); } } + + + protected override void BindController() + { + if (this is SecondWindowInterface) + { + var frame = this.GetComponentInChildren<SecondFrameLoader>(); + frame.Create(); + close = frame.GetComponentInChildren<Button>(); + } + + } + + protected override void AddListeners() + { + m_DeblockingBtton.SetListener(OnClickDeblockingBtton); + close.SetListener(() => + { + CloseClick(); + WindowCenter.Instance.Open<PetWin>(false, 0); + }); + + m_RideBtton.SetListener(() => { + mountModel.AppearanceSwitch((byte)mountModel.mountSkin[signHorseID], 2); + }); + } + + private void onMountSkinActive() + { + m_ScrollerController.m_Scorller.RefreshActiveCellViews();//鍒锋柊鍙 + RefreshMountSkinPanel(); + if (mountModel.horseStarDict.ContainsKey(signHorseID) && mountModel.horseStarDict[signHorseID] > 0) + { + starEffect.Play(); + } + else + { + ridingAndPetActivationModel.RidingAndPetActivationSet(RidingAndPetActivation.MountActivation, signHorseID); + } + sortMountlist.Clear(); + ToAddSorting(); + } + + protected override void OnPreOpen() + { + MountModel.Event_MountHA301A += OnMountSkinAdd; + m_ScrollerController.OnRefreshCell += OnRefreshGridCell; + mountModel.onMountSkinActive += onMountSkinActive; + MountModel.Event_MountAlteration += Event_MountAlteration; + ToAddSorting(); + int jumpIndex = JumpSelect(OpenChooseIndex()); + OnCreateGridLineCell(m_ScrollerController); + m_ScrollerController.JumpIndex(JumpSelect(jumpIndex)); + + RefreshMountSkinPanel(); + } + protected override void OnActived() + { + base.OnActived(); + } + protected override void OnAfterOpen() + { + } + + protected override void OnPreClose() + { + MountModel.Event_MountHA301A -= OnMountSkinAdd; + m_ScrollerController.OnRefreshCell -= OnRefreshGridCell; + mountModel.onMountSkinActive -= onMountSkinActive; + MountModel.Event_MountAlteration -= Event_MountAlteration; + UI3DModelExhibition.Instance.StopShow(); + signHorseID = 0; + } + + + + + protected override void OnAfterClose() + { + + } + + + private int JumpIndex(int HorseID = 0) + { + int Index = 0; + Index = sortMountlist.FindIndex((x) => + { + return x.x == signHorseID; + }); + if (Index == -1) + { + Index = 0; + } + return JumpSelect(Index); + } + + + private int OpenChooseIndex() + { + // 绾㈢偣-楠戜箻涓�-绗竴涓� + int selectIndex = 0; + int ridingHorseSkinID = -1; + if (mountModel.mountSkin.ContainsKey(mountModel.HorseIDNow)) + { + ridingHorseSkinID = mountModel.mountSkin[mountModel.HorseIDNow]; + } + int index = 0; + foreach (var sortInfo in sortMountlist) + { + if (ridingHorseSkinID != -1 && ridingHorseSkinID == sortInfo[0]) + { + selectIndex = index; + } + if (mountModel.DeblockingRedPoint[sortInfo[0]].state != RedPointState.None) + { + signHorseID = HorseSkinPlusConfig.Get(sortInfo[0]).HorseID; + return index; + } + index++; + } + + signHorseID = HorseSkinPlusConfig.Get(sortMountlist[selectIndex][0]).HorseID; + return selectIndex; + } + + void OnCreateGridLineCell(ScrollerController gridCtrl) + { + gridCtrl.Refresh(); + for (int i = 0; i < sortMountlist.Count; i++) + { + gridCtrl.AddCell(ScrollerDataType.Header, HorseSkinPlusConfig.Get(sortMountlist[i].x).HorseID); + } + gridCtrl.Restart(); + } + private void OnRefreshGridCell(ScrollerDataType type, CellView cell) + { + SelectThemount selectThemount = cell.GetComponent<SelectThemount>(); + int horseID = cell.index; + var horseConfig = HorseConfig.Get(horseID); + selectThemount.QualityTxt1.text = ProductOrder(horseConfig.Quality.ToString()); + selectThemount.MountNameTxt.text = horseConfig.Name; + selectThemount.MountLvActivation.SetActive(!mountModel.isMountSkinActive(horseID)); + + int star = 0; + mountModel.horseStarDict.TryGetValue(horseID, out star); + for (int i = 0; i < selectThemount.starsImg.Count; i++) + { + selectThemount.starsImg[i].SetActive(i < star); + } + + if (horseID == signHorseID) + { + selectThemount.ChoosenImg.SetActive(true); + selectThemount.DarkImage.SetActive(false); + } + else + { + selectThemount.ChoosenImg.SetActive(false); + selectThemount.DarkImage.SetActive(true); + } + selectThemount.HidingTips.SetActive(mountModel.HorseIDNow == horseID ? true : false); + + selectThemount.MountButton.SetListener(()=> { + if (signHorseID == horseID) + return; + signHorseID = horseID; + m_ScrollerController.m_Scorller.RefreshActiveCellViews();//鍒锋柊鍙 + RefreshMountSkinPanel(); + }); + + selectThemount.RedPoint.redpointId = mountModel.DeblockingRedPoint[mountModel.mountSkin[horseID]].id; + } + + private void RefreshMountSkinPanel() + { + if (signHorseID == 0) + return; + HorseConfig _model = HorseConfig.Get(signHorseID); + m_MountName.text = _model.Name; + + if (!m_Mount3D.gameObject.activeSelf) + { + m_Mount3D.SetActive(true); + } + + UI3DModelExhibition.Instance.ShowHourse(_model.Model, m_Mount3D); + if (UI3DModelExhibition.Instance.NpcModelHorse != null) + { + var animator = UI3DModelExhibition.Instance.NpcModelHorse.GetComponent<Animator>(); + if (animator != null) + { + animator.Play(GAStaticDefine.State_Dance); + + } + } + + ShowAttrText(); + DisplayButton(); + } + + private void Event_MountAlteration() + { + DisplayButton(); + + m_ScrollerController.m_Scorller.RefreshActiveCellViews();//鍒锋柊鍙 + } + + private void DisplayButton() + { + if (mountModel.isMountSkinActive(signHorseID)) + { + m_DeblockingBtton.SetActive(false); + m_RideBtton.SetActive(true); + if (signHorseID == mountModel.HorseIDNow) + { + m_RideBtton.SetActive(false); + } + if (HorseStarUpConfig.horseIDToIDs.ContainsKey(signHorseID)) + { + starUpObj.SetActive(true); + int star = 0; + mountModel.horseStarDict.TryGetValue(signHorseID, out star); + int maxStar = HorseStarUpConfig.horseIDToIDs[signHorseID].Count; + for (int i = 0; i < starsObj.Count; i++) + { + if (i < maxStar) + { + starsObj[i].SetActive(true); + starsObj[i].FindComponent("Image", "Img_Star_True").SetActive(i < star); + } + else + { + starsObj[i].SetActive(false); + } + } + + List<int[]> awards = new List<int[]>(); + if (star != maxStar) + { + var id = HorseStarUpConfig.horseIDToIDs[signHorseID][star]; + var nextStarConfig = HorseStarUpConfig.Get(id); + awards = nextStarConfig.StarUpNeedItemList; + } + + for (int i = 0; i < itemCells.Count; i++) + { + if (i < awards.Count) + { + itemCells[i].SetActive(true); + int itemID = awards[i][0]; + int needCnt = awards[i][1]; + int hasCnt = playerPack.GetItemCountByID(PackType.Item, itemID); + itemCells[i].Init(new ItemCellModel(itemID, false, 1)); + itemCells[i].button.AddListener(() => + { + ItemTipUtility.Show(itemID); + }); + + var cntTxt = itemCells[i].FindComponent("Text", "count") as Text; + if (hasCnt >= needCnt) + { + cntTxt.text = UIHelper.AppendColor(TextColType.Green, hasCnt.ToString()) + "/" + needCnt.ToString(); + } + else + { + cntTxt.text = UIHelper.AppendColor(TextColType.Red, hasCnt.ToString()) + "/" + needCnt.ToString(); + } + } + else + { + itemCells[i].SetActive(false); + } + } + starUpBtn.SetActive(star != maxStar); + maxObj.SetActive(star == maxStar); + starUpBtn.AddListener(() => + { + if (star < maxStar) + starsObj[star].GetComponent<UIEffect>().Play(); + CA535_tagCMHorseStarUp pak = new CA535_tagCMHorseStarUp(); + pak.HorseID = (uint)signHorseID; + GameNetSystem.Instance.SendInfo(pak); + }); + } + else + { + starUpObj.SetActive(false); + } + + return; + } + //AppearanceSwitch + HorseConfig horsefig = HorseConfig.Get(signHorseID); + + ItemCellModel cellModel = new ItemCellModel(horsefig.UnlockItemID, false, 1); + MountItem.Init(cellModel); + MountItem.countText.SetActive(true); + MountItem.countText.text = playerPack.GetItemCountByID(PackType.Item, horsefig.UnlockItemID).ToString(); + var itemConfig = ItemConfig.Get(horsefig.UnlockItemID); + MountItemName.text = UIHelper.AppendColor(itemConfig.ItemColor, itemConfig.ItemName); + MountItem.button.SetListener(() => + { + ItemTipUtility.Show(horsefig.UnlockItemID); + }); + + m_DeblockingBtton.SetActive(true); + m_RideBtton.SetActive(false); + starUpObj.SetActive(false); + } + + private void ShowAttrText() + { + ClearAttrText(); + var config = HorseSkinPlusConfig.Get(mountModel.mountSkin[signHorseID]); + int showIndex = 0; + Dictionary<int, int> allAttr = new Dictionary<int, int>(); + foreach (var attrID in config.AttrType) + { + allAttr[attrID] = config.AttrValue[showIndex]; + AttrNameList[showIndex].text = PlayerPropertyConfig.Get(attrID).ShowName; + AttrValueList[showIndex].text = PlayerPropertyConfig.GetValueDescription(attrID, config.AttrValue[showIndex]); + showIndex++; + } + + int star = 0; + mountModel.horseStarDict.TryGetValue(signHorseID, out star); + Dictionary<int, int> addAttr = new Dictionary<int, int>(); + if (HorseStarUpConfig.horseIDToIDs.ContainsKey(signHorseID)) + { + int[] starTypeArr = new int[] { }; + int[] starValueArr = new int[] { }; + if (star > 0) + { + var id = HorseStarUpConfig.horseIDToIDs[signHorseID][star - 1]; + var starConfig = HorseStarUpConfig.Get(id); + showIndex = 0; + starTypeArr = starConfig.StarAttrType; + starValueArr = starConfig.StarAttrValue; + foreach (var attrID in starTypeArr) + { + if (allAttr.ContainsKey(attrID)) + { + allAttr[attrID] = allAttr[attrID] + starValueArr[showIndex]; + } + else + { + allAttr[attrID] = starValueArr[showIndex]; + } + showIndex++; + } + } + + + if (star < HorseStarUpConfig.horseIDToIDs[signHorseID].Count) + { + var id = HorseStarUpConfig.horseIDToIDs[signHorseID][star]; + var nextStarConfig = HorseStarUpConfig.Get(id); + for (int i = 0; i < nextStarConfig.StarAttrType.Length; i++) + { + if (!allAttr.ContainsKey(nextStarConfig.StarAttrType[i])) + { + //棰勮鐢� + allAttr[nextStarConfig.StarAttrType[i]] = 0; + } + if (Array.IndexOf(starTypeArr, nextStarConfig.StarAttrType[i]) >= 0) + { + addAttr[nextStarConfig.StarAttrType[i]] = nextStarConfig.StarAttrValue[i] - starValueArr[i]; + } + else + { + addAttr[nextStarConfig.StarAttrType[i]] = nextStarConfig.StarAttrValue[i]; + } + } + } + } + + showIndex = 0; + foreach (var attrID in allAttr.Keys) + { + AttrNameList[showIndex].text = PlayerPropertyConfig.Get(attrID).ShowName; + if (addAttr.ContainsKey(attrID)) + { + AttrValueList[showIndex].text = PlayerPropertyConfig.GetValueDescription(attrID, allAttr[attrID]) + UIHelper.AppendColor(TextColType.Green, string.Format(" +{0}", PlayerPropertyConfig.GetValueDescription(attrID, addAttr[attrID]))); + } + else + { + AttrValueList[showIndex].text = PlayerPropertyConfig.GetValueDescription(attrID, allAttr[attrID]); + } + showIndex++; + } + + m_FightPower.text = (UIHelper.GetFightPower(allAttr) + config.InitFightPower).ToString(); + } + + private void ClearAttrText() + { + for (int i = 0; i < AttrNameList.Count; i++) + { + AttrNameList[i].text = string.Empty; + AttrValueList[i].text = string.Empty; + + } + + } + + + private void OnClickDeblockingBtton()//瑙i攣鎸夐挳 + { + HorseConfig horsefig = HorseConfig.Get(signHorseID); + int MaterialNumber = playerPack.GetItemCountByID(PackType.Item, horsefig.UnlockItemID);//鑾峰彇鑳屽寘瑙i攣鏉愭枡鐨勬暟閲� + if (MaterialNumber >= horsefig.UnlockItemCnt) + { + CA501_tagPlayerActivateHorse _tagA501 = new CA501_tagPlayerActivateHorse(); + _tagA501.HorseID = (uint)mountModel.mountSkin[signHorseID]; + GameNetSystem.Instance.SendInfo(_tagA501); + + } + else + { + ScrollTip.ShowTip(Language.Get("Z1063"));//鎵�闇�鏉愭枡涓嶈冻 + } + } + + + #endregion + + void ToAddSorting()//鍧愰獞鐨勫垪琛ㄦ帓搴� + { + + if (sortMountlist.Count <= 0) + { + + foreach (var mountSkin in mountModel.MountSkinActive) + { + var config = HorseSkinPlusConfig.Get(mountSkin.Key); + sortMountlist.Add(new Int3(mountSkin.Key, mountSkin.Value, config.sortIndex)); + } + } + sortMountlist.Sort(Compare); + } + int Compare(Int3 skin1, Int3 skin2)//鏁扮粍鎺掑垪 + { + + var xActive = skin1.y; + var yActive = skin2.y; + + if (xActive != yActive) + { + return yActive.CompareTo(xActive); + } + return skin1.z.CompareTo(skin2.z); + } + + + string ProductOrder(string _petProductOrder)//鍧愰獞鍝佽川 + { + FuncConfigConfig _PetQuality = FuncConfigConfig.Get("PetQuality"); + string[] _productlist = _PetQuality.Numerical1.Split('|'); + for (int i = 0; i < _productlist.Length; i++) + { + if (_petProductOrder == _productlist[i]) + { + string[] _productText = _PetQuality.Numerical2.Split('|'); + string str = _productText[i]; + return str; + } + } + return null; + } + private int JumpSelect(int Index) + { + if (Index <= 4) + { + return 0; + } + return Index; + } + + private void OnMountSkinAdd(int id) + { + } + } +} + + + + diff --git a/System/Mount/SelectThemount.cs b/System/Mount/SelectThemount.cs index 24f54c8..61b4629 100644 --- a/System/Mount/SelectThemount.cs +++ b/System/Mount/SelectThemount.cs @@ -5,6 +5,7 @@ using UnityEngine; using System.Collections; using UnityEngine.UI; +using System.Collections.Generic; namespace Snxxz.UI { @@ -61,6 +62,13 @@ get { return m_QualityTxt1; } set { m_QualityTxt1 = value; } } + + [SerializeField] List<Image> m_starsImg;//鏄熺骇 + public List<Image> starsImg + { + get { return m_starsImg; } + set { starsImg = value; } + } } } diff --git a/System/Pet/RidingAndPetActivationModel.cs b/System/Pet/RidingAndPetActivationModel.cs index b7f50f9..d2f042b 100644 --- a/System/Pet/RidingAndPetActivationModel.cs +++ b/System/Pet/RidingAndPetActivationModel.cs @@ -294,22 +294,6 @@ private Dictionary<int, float> GetMountProperty(int mountID, int ValueKey, int Value) { Dictionary<int, float> DicSkill = new Dictionary<int, float>(); - DicSkill.Add(6, 0f); - DicSkill.Add(7, 0f); - if (mountModel._DicHorse.ContainsKey(mountID)) - { - HorseUpConfig tagMode = HorseUpConfig.GetHorseIDAndLV(mountID, mountModel._DicHorse[mountID].Lv); - int[] attrType = tagMode.AttrType; - int[] attrValue = tagMode.AttrValue; - for (int i = 0; i < attrType.Length; i++) - { - if (attrType[i] == ValueKey && DicSkill.ContainsKey(ValueKey)) - { - DicSkill[ValueKey] = (float)attrValue[i] * ((float)Value / 10000); - } - } - return DicSkill; - } return DicSkill; } public Dictionary<int, float> GetOneMountProperty(int MountID)//鑾峰彇鍗曞彧鍧愰獞鐨勬妧鑳藉睘鎬у姞鎴� @@ -409,29 +393,7 @@ private Dictionary<int, float> GetMountPropertyQuality(int Quality, int ValueKey, int Value) { Dictionary<int, float> DicSkill = new Dictionary<int, float>(); - DicSkill.Add(6, 0f); - DicSkill.Add(7, 0f); - if (mountModel._DicHorse.Count > 0) - { - foreach (var key in mountModel._DicHorse.Keys) - { - HorseConfig horseConfig = HorseConfig.Get(key); - if (horseConfig.Quality == Quality) - { - HorseUpConfig tagMode = HorseUpConfig.GetHorseIDAndLV(key, mountModel._DicHorse[key].Lv); - int[] attrType = tagMode.AttrType; - int[] attrValue =tagMode.AttrValue; - for (int i = 0; i < attrType.Length; i++) - { - if (attrType[i] == ValueKey && DicSkill.ContainsKey(ValueKey)) - { - DicSkill[ValueKey] += (float)attrValue[i] * ((float)Value / 10000); - } - } - } - } - return DicSkill; - } + return DicSkill; } public Dictionary<int, float> GetOneMountPropertyQuality(int MountID)//鏍规嵁鍝佽川鑾峰彇鍗曞彧鍧愰獞鐨勬妧鑳藉睘鎬у姞鎴� diff --git a/System/Pet/TargetPetAttrWin.cs b/System/Pet/TargetPetAttrWin.cs index 1dad7ba..afe27d3 100644 --- a/System/Pet/TargetPetAttrWin.cs +++ b/System/Pet/TargetPetAttrWin.cs @@ -88,7 +88,6 @@ switch (propertyTip) { case PropertyTip.Mount: - CurMountAttrCtrl(Id); break; case PropertyTip.Pet: CurPetAttrCtrl(); @@ -168,98 +167,6 @@ } _scoreNumAll1 = Mathf.FloorToInt(_tagPetClassNext.AtkAdd * 2.5f) + _scoreNum1; curPetAttackText1.text = _scoreNumAll1.ToString(); - } - } - List<HorseSkillClass> MountSkills = new List<HorseSkillClass>(); - private void CurMountAttrCtrl(int ID) - { - MountSkills.Clear(); - foreach (var key in mountModel.GetMountSkillAndItem.Keys) - { - if (mountModel.GetMountSkillAndItem[key].HorseID == ID) - { - MountSkills.Add(mountModel.GetMountSkillAndItem[key]); - } - } - NowAttTipPet1.SetActive(false); - NowAttTipPet.SetActive(false); - NowAttTipMount.SetActive(true); - NowAttTipMount1.SetActive(true); - HorseConfig horseconfig = HorseConfig.Get(ID); - HorseUpConfig horseUpconfig = HorseUpConfig.GetHorseIDAndLV(ID, mountModel._DicHorse[ID].Lv); - m_Property_Text.text = Language.Get("MountAttributes_Z"); - m_LVtextP.text = mountModel._DicHorse[ID].Lv + Language.Get("Z1041"); - int[] strAttrValue = horseUpconfig.AttrValue; - Dictionary<int, int> AddPowerDic = new Dictionary<int, int>(); - AddPowerDic.Clear(); - if (strAttrValue.Length != 0) - { - curMountLifeText.text = strAttrValue[0].ToString();//鐢熷懡 - curMountAttackText.text = strAttrValue[1].ToString();//鏀诲嚮 - curMountSpeedText.text = strAttrValue[2].ToString();//閫熷害 - AddPowerDic.Add(6, strAttrValue[0]); - AddPowerDic.Add(7, strAttrValue[1]); - } - int _scoreNum = 0; - int _scoreNumAll = 0; - for (int i = 0; i < MountSkills.Count; i++) - { - if (mountModel._DicHorse[ID].Lv >= MountSkills[i].HorseLV) - { - SkillConfig skillconfig = SkillConfig.Get(MountSkills[i].SkillID); - if (skillconfig != null) - { - _scoreNum += skillconfig.FightPower; - } - } - } - _scoreNumAll = UIHelper.GetFightPower(AddPowerDic) + _scoreNum; - curMountFightingText.text = _scoreNumAll.ToString(); - if (mountModel._DicHorse[ID].Lv >= horseconfig.MaxLV) - { - m_LVtextP1.transform.parent.SetActive(false); - curMountFightingText1.transform.parent.SetActive(false); - curMountLifeText1.transform.parent.SetActive(false); - curMountAttackText1.transform.parent.SetActive(false); - curMountSpeedText1.transform.parent.SetActive(false); - m_ManJiImage.SetActive(true); - } - else - { - m_ManJiImage.SetActive(false); - m_LVtextP1.transform.parent.SetActive(true); - curMountFightingText1.transform.parent.SetActive(true); - curMountLifeText1.transform.parent.SetActive(true); - curMountAttackText1.transform.parent.SetActive(true); - curMountSpeedText1.transform.parent.SetActive(true); - m_LVtextP1.text = (mountModel._DicHorse[ID].Lv+1) + Language.Get("Z1041"); - HorseUpConfig horseUpconfigNext = HorseUpConfig.GetHorseIDAndLV(ID, mountModel._DicHorse[ID].Lv + 1); - int[] strAttrValueNext = horseUpconfigNext.AttrValue; - Dictionary<int, int> AddPowerDic1 = new Dictionary<int, int>(); - AddPowerDic1.Clear(); - if (strAttrValueNext.Length != 0) - { - curMountLifeText1.text = strAttrValueNext[0].ToString();//鐢熷懡 - curMountAttackText1.text = strAttrValueNext[1].ToString();//鏀诲嚮 - curMountSpeedText1.text = strAttrValueNext[2].ToString();//閫熷害 - AddPowerDic1.Add(6, strAttrValueNext[0]); - AddPowerDic1.Add(7, strAttrValueNext[1]); - } - int _scoreNum1 = 0; - int _scoreNumAll1 = 0; - for (int i = 0; i < MountSkills.Count; i++) - { - if (mountModel._DicHorse[ID].Lv+1 >= MountSkills[i].HorseLV) - { - SkillConfig skillconfig = SkillConfig.Get(MountSkills[i].SkillID); - if (skillconfig != null) - { - _scoreNum1 += skillconfig.FightPower; - } - } - } - _scoreNumAll1 = UIHelper.GetFightPower(AddPowerDic1) + _scoreNum1; - curMountFightingText1.text = _scoreNumAll1.ToString();//鎴樻枟鍔� } } diff --git a/System/RoleParticulars/RoleParticularModel.cs b/System/RoleParticulars/RoleParticularModel.cs index 5bbbfcd..305bc19 100644 --- a/System/RoleParticulars/RoleParticularModel.cs +++ b/System/RoleParticulars/RoleParticularModel.cs @@ -211,93 +211,14 @@ public int GetHorseFightPower(int _id, int lv) { var fightPower = GetHorseSkillFightPower(_id, lv); - var horseUpConfig = HorseUpConfig.GetHorseIDAndLV(_id, lv); - if (horseUpConfig == null) - { - return 0; - } - Dictionary<int, int> dict = new Dictionary<int, int>(); - int[] propertys = horseUpConfig.AttrType; - int[] values = horseUpConfig.AttrValue; - for (int i = 0; i < propertys.Length; i++) - { - if (propertys[i] == (int)PropertyType.ATK || propertys[i] == (int)PropertyType.HP) - { - if (!dict.ContainsKey(propertys[i])) - { - dict.Add(propertys[i], values[i]); - } - else - { - dict[propertys[i]] += values[i]; - } - } - } - fightPower += UIHelper.GetFightPower(dict); - var config = HorseConfig.Get(_id); - fightPower += config.InitFightPower; + return fightPower; } public int GetHorseSkillFightPower(int _id, int lv) { var fightPower = 0; - HorseUpConfig.GetHorseSkills(_id, lv, true, ref skills); - for (int i = 0; i < skills.Count; i++) - { - Dictionary<int, int> dict1 = null; - Dictionary<int, int> dict2 = null; - var skillConfig = SkillConfig.Get(skills[i]); - if (skillConfig == null) - { - continue; - } - if (skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1 - || skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2) - { - bool single = skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1; - Dictionary<int, int> dict = single ? dict1 : dict2; - dict = GetHorseSkillProperty(skillConfig.EffectValue11, skillConfig.EffectValue12, skillConfig.EffectValue13, single); - } - if (skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1 - || skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2) - { - bool single = skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1; - Dictionary<int, int> dict = single ? dict1 : dict2; - dict = GetHorseSkillProperty(skillConfig.EffectValue21, skillConfig.EffectValue22, skillConfig.EffectValue23, single); - } - if (skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1 - || skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2) - { - bool single = skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1; - Dictionary<int, int> dict = single ? dict1 : dict2; - dict = GetHorseSkillProperty(skillConfig.EffectValue31, skillConfig.EffectValue32, skillConfig.EffectValue33, single); - } - if (skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1 - || skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2) - { - bool single = skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1; - Dictionary<int, int> dict = single ? dict1 : dict2; - dict = GetHorseSkillProperty(skillConfig.EffectValue41, skillConfig.EffectValue42, skillConfig.EffectValue43, single); - } - if (skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1 - || skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2) - { - bool single = skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1; - Dictionary<int, int> dict = single ? dict1 : dict2; - dict = GetHorseSkillProperty(skillConfig.EffectValue51, skillConfig.EffectValue52, skillConfig.EffectValue53, single); - } - if (skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1 - || skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2) - { - bool single = skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1; - Dictionary<int, int> dict = single ? dict1 : dict2; - dict = GetHorseSkillProperty(skillConfig.EffectValue61, skillConfig.EffectValue62, skillConfig.EffectValue63, single); - } - fightPower += dict1 == null ? 0 : UIHelper.GetFightPower(dict1); - fightPower += dict2 == null ? 0 : UIHelper.GetFightPower(dict2); - fightPower += skillConfig.FightPower; - } + return fightPower; } @@ -308,139 +229,12 @@ return; } propertyDict.Clear(); - for (int i = 0; i < horses.Count; i++) - { - HorseUpConfig horseUpConfig = HorseUpConfig.GetHorseIDAndLV(horses[i].id, horses[i].lv); - if (horseUpConfig == null) - { - continue; - } - GetHorseProperty(horses[i].id, horses[i].lv, ref propertyDict); - int[] propertys = horseUpConfig.AttrType; - int[] values = horseUpConfig.AttrValue; - for (int k = 0; k < propertys.Length; k++) - { - if (!propertyDict.ContainsKey(propertys[k])) - { - propertyDict.Add(propertys[k], values[k]); - } - else - { - if (propertys[k] == (int)PropertyType.MoveSpeed) - { - if (values[k] > propertyDict[propertys[k]]) - { - propertyDict[propertys[k]] = values[k]; - } - } - else - { - propertyDict[propertys[k]] += values[k]; - } - } - } - } + } public void GetHorseProperty(int _id, int lv, ref Dictionary<int, int> propertyDict) { - HorseUpConfig.GetHorseSkills(_id, lv, true, ref skills); - for (int i = 0; i < skills.Count; i++) - { - Dictionary<int, int> dict1 = null; - Dictionary<int, int> dict2 = null; - var skillConfig = SkillConfig.Get(skills[i]); - if (skillConfig == null) - { - continue; - } - if (skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1 - || skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2) - { - bool single = skillConfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1; - if (single) - { - dict1 = GetHorseSkillProperty(skillConfig.EffectValue11, skillConfig.EffectValue12, skillConfig.EffectValue13, single); - } - else - { - dict2 = GetHorseSkillProperty(skillConfig.EffectValue11, skillConfig.EffectValue12, skillConfig.EffectValue13, single); - } - } - if (skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1 - || skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2) - { - bool single = skillConfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1; - if (single) - { - dict1 = GetHorseSkillProperty(skillConfig.EffectValue21, skillConfig.EffectValue22, skillConfig.EffectValue23, single); - } - else - { - dict2 = GetHorseSkillProperty(skillConfig.EffectValue21, skillConfig.EffectValue22, skillConfig.EffectValue23, single); - } - } - if (skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1 - || skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2) - { - bool single = skillConfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1; - if (single) - { - dict1 = GetHorseSkillProperty(skillConfig.EffectValue31, skillConfig.EffectValue32, skillConfig.EffectValue33, single); - } - else - { - dict2 = GetHorseSkillProperty(skillConfig.EffectValue31, skillConfig.EffectValue32, skillConfig.EffectValue33, single); - } - } - if (skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1 - || skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2) - { - bool single = skillConfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1; - if (single) - { - dict1 = GetHorseSkillProperty(skillConfig.EffectValue41, skillConfig.EffectValue42, skillConfig.EffectValue43, single); - } - else - { - dict2 = GetHorseSkillProperty(skillConfig.EffectValue41, skillConfig.EffectValue42, skillConfig.EffectValue43, single); - } - } - if (skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1 - || skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2) - { - bool single = skillConfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1; - if (single) - { - dict1 = GetHorseSkillProperty(skillConfig.EffectValue51, skillConfig.EffectValue52, skillConfig.EffectValue53, single); - } - else - { - dict2 = GetHorseSkillProperty(skillConfig.EffectValue51, skillConfig.EffectValue52, skillConfig.EffectValue53, single); - } - } - if (skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1 - || skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty2) - { - bool single = skillConfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.MountProperty1; - if (single) - { - dict1 = GetHorseSkillProperty(skillConfig.EffectValue61, skillConfig.EffectValue62, skillConfig.EffectValue63, single); - } - else - { - dict2 = GetHorseSkillProperty(skillConfig.EffectValue61, skillConfig.EffectValue62, skillConfig.EffectValue63, single); - } - } - if (dict1 != null) - { - PastePropertyDict(dict1, propertyDict); - } - if (dict2 != null) - { - PastePropertyDict(dict2, propertyDict); - } - } + } private void PastePropertyDict(Dictionary<int, int> source, Dictionary<int, int> target) @@ -480,57 +274,7 @@ private Dictionary<int, int> GetHorseSkillProperty(int condition, int property, int percent, bool single) { Dictionary<int, int> dict = new Dictionary<int, int>(); - dict.Add(6, 0); - dict.Add(7, 0); - - var viewplayer = GetViewPlayerData(viewPlayer); - var horses = viewplayer.rolePlusData.horses; - - if (single) - { - var horseInfo = horses.Find((x) => - { - return x.id == condition; - }); - HorseUpConfig horseUpConfig = HorseUpConfig.GetHorseIDAndLV(horseInfo.id, horseInfo.lv); - if (horseUpConfig == null) - { - return dict; - } - int[] propertys = horseUpConfig.AttrType; - int[] values = horseUpConfig.AttrValue; - for (int k = 0; k < propertys.Length; k++) - { - if (propertys[k] == property && dict.ContainsKey(property)) - { - dict[property] += (int)(values[k] * ((float)percent / 10000)); - } - } - } - else - { - for (int i = 0; i < horses.Count; i++) - { - HorseConfig horseConfig = HorseConfig.Get(horses[i].id); - if (horseConfig == null) - { - continue; - } - if (horseConfig.Quality == condition) - { - HorseUpConfig horseUpConfig = HorseUpConfig.GetHorseIDAndLV(horses[i].id, horses[i].lv); - int[] propertys = horseUpConfig.AttrType; - int[] values = horseUpConfig.AttrValue; - for (int k = 0; k < propertys.Length; k++) - { - if (propertys[k] == property && dict.ContainsKey(property)) - { - dict[property] += (int)(values[k] * ((float)percent / 10000)); - } - } - } - } - } + return dict; } diff --git a/System/RoleParticulars/RoleParticularsWin.cs b/System/RoleParticulars/RoleParticularsWin.cs index 6d9a05e..1fbcf37 100644 --- a/System/RoleParticulars/RoleParticularsWin.cs +++ b/System/RoleParticulars/RoleParticularsWin.cs @@ -155,7 +155,7 @@ if (viewPlayerData != null) { - m_ViewHorse.SetActive(viewPlayerData.rolePlusData.horses.Count > 0); + m_ViewHorse.SetActive(false); m_ViewPet.SetActive(viewPlayerData.rolePlusData.pets.Count > 0); if (viewPlayerData.rolePropData.FamilyID == 0) diff --git a/System/RoleParticulars/ViewHorseDetailWin.cs b/System/RoleParticulars/ViewHorseDetailWin.cs index dbc5de7..2555a77 100644 --- a/System/RoleParticulars/ViewHorseDetailWin.cs +++ b/System/RoleParticulars/ViewHorseDetailWin.cs @@ -148,20 +148,6 @@ void DisplaySkills(int id, int lv) { - HorseUpConfig.GetHorseSkills(id, lv, false, ref skills); - for (int i = 0; i < m_HorseSkills.Length; i++) - { - if (i < skills.Count) - { - m_HorseSkills[i].SetActive(true); - var condition = HorseUpConfig.GetSkillCondition(id, skills[i]); - m_HorseSkills[i].Display(id, skills[i], lv >= condition ? 0 : condition); - } - else - { - m_HorseSkills[i].SetActive(false); - } - } } void DisplayTotalSkills(List<RoleParticularModel.HorseInfo> horses) @@ -169,36 +155,7 @@ displayTotalSkills.Clear(); unlockTotalSkills.Clear(); - for (int i = 0; i < horses.Count; i++) - { - HorseUpConfig.GetHorseSkills(horses[i].id, horses[i].lv, true, ref skills); - unlockTotalSkills.AddRange(skills); - foreach (var id in skills) - { - var config = SkillConfig.Get(id); - var effect = SkillConfig.GetSkillEffectValue(config); - var skillId = 0; - if (mountModel.TryGetIntegrationSkill(effect, out skillId)) - { - if (!displayTotalSkills.Contains(skillId)) - { - displayTotalSkills.Add(skillId); - } - continue; - } - displayTotalSkills.Add(id); - } - } - - displayTotalSkills.Sort(Compare); - - m_SkillController.Refresh(); - var line = Mathf.CeilToInt((float)displayTotalSkills.Count / m_LineCount); - for (int i = 0; i < line; i++) - { - m_SkillController.AddCell(ScrollerDataType.Header, i); - } - m_SkillController.Restart(); + } void DisplayModel(int id) @@ -305,11 +262,6 @@ private void OnClickSkill() { - var config = HorseConfig.Get(horseId); - var skillConfig = SkillConfig.Get(skillId); - var label1 = skillConfig.Description; - var label2 = Language.Get("pet_SkillTipLv", config.Name, HorseUpConfig.GetSkillCondition(horseId, skillId)); - SkillDetails.ShowSkillDetails(skillId, SkillDetails.SkillSourceType.ViewHorsePet, skillConfig.FightPower, label1, label2); } public void SetActive(bool active) diff --git a/Utility/ConfigInitiator.cs b/Utility/ConfigInitiator.cs index cd9a6f1..8f1f59d 100644 --- a/Utility/ConfigInitiator.cs +++ b/Utility/ConfigInitiator.cs @@ -276,7 +276,6 @@ normalTasks.Add(new ConfigInitTask("HolidayHomingConfig", () => { HolidayHomingConfig.Init(); }, () => { return HolidayHomingConfig.inited; })); normalTasks.Add(new ConfigInitTask("HolidayHomingPointConfig", () => { HolidayHomingPointConfig.Init(); }, () => { return HolidayHomingPointConfig.inited; })); normalTasks.Add(new ConfigInitTask("HorseConfig", () => { HorseConfig.Init(); }, () => { return HorseConfig.inited; })); - normalTasks.Add(new ConfigInitTask("HorseUpConfig", () => { HorseUpConfig.Init(); }, () => { return HorseUpConfig.inited; })); normalTasks.Add(new ConfigInitTask("IceLodeStarAwardConfig", () => { IceLodeStarAwardConfig.Init(); }, () => { return IceLodeStarAwardConfig.inited; })); normalTasks.Add(new ConfigInitTask("XMZZAchievementConfig", () => { XMZZAchievementConfig.Init(); }, () => { return XMZZAchievementConfig.inited; })); normalTasks.Add(new ConfigInitTask("CrossRealmPKOrderAwardConfig", () => { CrossRealmPKOrderAwardConfig.Init(); }, () => { return CrossRealmPKOrderAwardConfig.inited; })); @@ -327,6 +326,7 @@ normalTasks.Add(new ConfigInitTask("CustomAward", () => { CustomAwardConfig.Init(); }, () => { return CustomAwardConfig.inited; })); normalTasks.Add(new ConfigInitTask("FamilyBossHurtAward", () => { FamilyBossHurtAwardConfig.Init(); }, () => { return FamilyBossHurtAwardConfig.inited; })); normalTasks.Add(new ConfigInitTask("RealmXXZL", () => { RealmXXZLConfig.Init(); }, () => { return RealmXXZLConfig.inited; })); + normalTasks.Add(new ConfigInitTask("HorseStarUp", () => { HorseStarUpConfig.Init(); }, () => { return HorseStarUpConfig.inited; })); } -- Gitblit v1.8.0