| Core/GameEngine/Model/Config/GodWeaponEffectConfig.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Core/GameEngine/Model/Config/GodWeaponEffectConfig.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Realm/ActivateShow.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Role/GodWeaponPreviewWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Role/MagicianModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Core/GameEngine/Model/Config/GodWeaponEffectConfig.cs
@@ -1,6 +1,6 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Friday, November 23, 2018 // [ Date ]: Tuesday, December 11, 2018 //-------------------------------------------------------- using UnityEngine; @@ -11,10 +11,12 @@ public partial class GodWeaponEffectConfig : ConfigBase { public int id { get ; private set ; } public int type { get ; private set ; } public int level { get ; private set ; } public string effect { get ; private set; } public int id { get ; private set ; } public int type { get ; private set ; } public int level { get ; private set ; } public string effect { get ; private set; } public int fightPower { get ; private set ; } public string attr { get ; private set; } public override string getKey() { @@ -24,13 +26,17 @@ public override void Parse() { try { id=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; type=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; level=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; effect = rawContents[3].Trim(); id=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; type=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; level=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; effect = rawContents[3].Trim(); fightPower=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; attr = rawContents[5].Trim(); } catch (Exception ex) { Core/GameEngine/Model/Config/GodWeaponEffectConfig.cs.meta
@@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: c7a22e75f9a0eed49aed26e8171f8172 timeCreated: 1542943278 timeCreated: 1544496205 licenseType: Pro MonoImporter: serializedVersion: 2 System/Realm/ActivateShow.cs
@@ -148,7 +148,7 @@ } } public static void GodWeaponStage(int _type, int _level, int _beforeLevel) public static void GodWeaponStage(int _type, int _level, int _beforeLevel,int stage) { activateType = ActivateFunc.GodWeaponEffect; currentLv = _level; @@ -200,6 +200,10 @@ fightPower += skillConfig.FightPower; } } var dict = _model.GetEffectPropertyUpper(_type, stage); fightPower += UIHelper.GetFightPower(dict); var requireLevel = _model.GetGodWeaponStageRequireLevel(_type, stage); fightPower += _model.TryGetEffectFightPower(_type, requireLevel); titleIconKey = "GodWeaponEffectTitle"; System/Role/GodWeaponPreviewWin.cs
@@ -20,6 +20,8 @@ [SerializeField] Button[] m_SelectStages; [SerializeField] Image m_Select; [SerializeField] RawImage m_RawModel; [SerializeField] PropertyBehaviour[] m_Propertys; [SerializeField] Text m_FightPower; [SerializeField] Button m_Close; int selectStage = 1; @@ -79,6 +81,8 @@ DisplayModel(); DisplayStage(); DisplayRequireLevel(); DisplayProperty(); DisplayFightPower(); } private void DisplayStage() @@ -94,6 +98,38 @@ m_RequireLevel.text = Language.Get("GodWeaponStageRequireLevel", config.Name, requireLevel); } private void DisplayFightPower() { var requireLevel = model.GetGodWeaponStageRequireLevel(selectGodWeaponType, selectStage); var fightPower = 0; var dict = model.GetEffectPropertyUpper(selectGodWeaponType, selectStage); fightPower += model.TryGetEffectFightPower(selectGodWeaponType, requireLevel); if (dict != null) { fightPower += UIHelper.GetFightPower(dict); } m_FightPower.text = StringUtility.Contact("+", fightPower); } private void DisplayProperty() { var dict = model.GetEffectPropertyUpper(selectGodWeaponType, selectStage); var index = 0; foreach (var key in dict.Keys) { if (index < m_Propertys.Length) { m_Propertys[index].gameObject.SetActive(true); m_Propertys[index].DisplayUpper(key, dict[key]); } index++; } for (int i = index; i < m_Propertys.Length; i++) { m_Propertys[i].gameObject.SetActive(false); } } private void DisplayModel() { m_RawModel.gameObject.SetActive(true); System/Role/MagicianModel.cs
@@ -88,6 +88,9 @@ Dictionary<int, int> exteriorPowerDict = new Dictionary<int, int>(); Dictionary<int, int> godWeaponSkillEffect = new Dictionary<int, int>(); Dictionary<int, int> singleHarmmerExp = new Dictionary<int, int>(); Dictionary<int, List<GodWeaponEffectProperty>> effectPropertyDict = new Dictionary<int, List<GodWeaponEffectProperty>>(); Dictionary<int, Dictionary<int, int>> effectFightPower = new Dictionary<int, Dictionary<int, int>>(); int[] autoHammerExpArea { get; set; } int[] autoHammerCount { get; set; } @@ -229,6 +232,24 @@ godWeaponStageDict.Add(config.type, stages); } stages.Add(config.level); List<GodWeaponEffectProperty> list; if (!effectPropertyDict.TryGetValue(config.type, out list)) { list = new List<GodWeaponEffectProperty>(); effectPropertyDict.Add(config.type, list); } list.Add(new GodWeaponEffectProperty() { level = config.level, propertyDict = ConfigParse.GetDic<int, int>(config.attr), }); Dictionary<int, int> dict; if (!effectFightPower.TryGetValue(config.type, out dict)) { dict = new Dictionary<int, int>(); effectFightPower.Add(config.type, dict); } dict.Add(config.level, config.fightPower); } funcConfig = Config.Instance.Get<FuncConfigConfig>("MagicExterior"); @@ -390,7 +411,7 @@ { WindowCenter.Instance.CloseImmediately<HowToPlayWin>(); } ActivateShow.GodWeaponStage(_type, _nowLv, _beforeLv); ActivateShow.GodWeaponStage(_type, _nowLv, _beforeLv, stage); } return; } @@ -675,6 +696,64 @@ return godWeaponSkillEffect.TryGetValue(skillId, out effect); } public bool TryGetEffectProperty(int type, int level, out Dictionary<int, int> dict) { dict = null; if (effectPropertyDict.ContainsKey(type)) { var effectProperty = effectPropertyDict[type].Find((x) => { return x.level == level; }); if (!effectProperty.Equals(default(GodWeaponEffectProperty))) { dict = effectProperty.propertyDict; return true; } } return false; } public int TryGetEffectFightPower(int type, int level) { if (effectFightPower.ContainsKey(type)) { if (effectFightPower[type].ContainsKey(level)) { return effectFightPower[type][level]; } } return 0; } Dictionary<int, int> propertyCacheDict = new Dictionary<int, int>(); public Dictionary<int, int> GetEffectPropertyUpper(int type, int stage) { propertyCacheDict.Clear(); Dictionary<int, int> previousPropertyDict = null; if (stage - 1 > 0) { var level = GetGodWeaponStageRequireLevel(type, stage - 1); TryGetEffectProperty(type, level, out previousPropertyDict); } var requireLevel = GetGodWeaponStageRequireLevel(type, stage); Dictionary<int, int> dict; if (TryGetEffectProperty(type, requireLevel, out dict)) { foreach (var key in dict.Keys) { if (previousPropertyDict != null && previousPropertyDict.ContainsKey(key)) { propertyCacheDict.Add(key, dict[key] - previousPropertyDict[key]); } else { propertyCacheDict.Add(key, dict[key]); } } } return propertyCacheDict; } } public class GodWeaponInfo @@ -695,5 +774,11 @@ public int cost; public int exp; } public struct GodWeaponEffectProperty { public int level; public Dictionary<int, int> propertyDict; } }