From 458f4c831623966402f78d1ec00b24aebf674e66 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期三, 12 十二月 2018 09:46:22 +0800
Subject: [PATCH] Merge branch 'master' into Cross_Server
---
Core/GameEngine/Model/Config/ModelResConfig.cs | 15 +
System/Realm/ActivateShow.cs | 6
Fight/GameActor/GActorNpcNoFight.cs | 4
System/GeneralConfig/GeneralDefine.cs | 16 ++
Fight/GameActor/GAMgr.cs | 25 +++
System/Rank/RankHeadCell.cs | 15 -
System/Role/MagicianModel.cs | 96 +++++++++++
Fight/GameActor/GActor.cs | 14 +
Fight/GameActor/GActorNpcFight.cs | 4
Core/GameEngine/Model/Config/ModelResConfig.cs.meta | 2
Fight/GameActor/BattleEffectPlayRule.cs | 39 ++++
Fight/GameActor/GA_Pet.cs | 35 ++++
System/Role/GodWeaponPreviewWin.cs | 35 ++++
Fight/GameActor/GActorFight.cs | 4
Fight/GameActor/GActorPlayerBase.cs | 43 +++++
Fight/GameActor/PartialModelResConfig.cs | 72 ++++++++
16 files changed, 397 insertions(+), 28 deletions(-)
diff --git a/Core/GameEngine/Model/Config/ModelResConfig.cs b/Core/GameEngine/Model/Config/ModelResConfig.cs
index f32ee00..48c2907 100644
--- a/Core/GameEngine/Model/Config/ModelResConfig.cs
+++ b/Core/GameEngine/Model/Config/ModelResConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: 绗簩涓栫晫
-// [ Date ]: Wednesday, November 28, 2018
+// [ Date ]: Monday, December 10, 2018
//--------------------------------------------------------
using UnityEngine;
@@ -20,6 +20,7 @@
public string Material_Fight_Suit { get ; private set; }
public string Material_UI_Normal { get ; private set; }
public string Material_UI_Suit { get ; private set; }
+ public string boneNameList { get ; private set; }
public string EffFileName { get ; private set; }
public Vector3 UIOffset { get ; private set; }
public Vector3 UIRotation { get ; private set; }
@@ -52,15 +53,17 @@
Material_UI_Suit = rawContents[8].Trim();
- EffFileName = rawContents[9].Trim();
+ boneNameList = rawContents[9].Trim();
- UIOffset=rawContents[10].Vector3Parse();
+ EffFileName = rawContents[10].Trim();
- UIRotation=rawContents[11].Vector3Parse();
+ UIOffset=rawContents[11].Vector3Parse();
- UIScale=rawContents[12].Vector3Parse();
+ UIRotation=rawContents[12].Vector3Parse();
- Scale=rawContents[13].Vector3Parse();
+ UIScale=rawContents[13].Vector3Parse();
+
+ Scale=rawContents[14].Vector3Parse();
}
catch (Exception ex)
{
diff --git a/Core/GameEngine/Model/Config/ModelResConfig.cs.meta b/Core/GameEngine/Model/Config/ModelResConfig.cs.meta
index 2969b78..86b0e0b 100644
--- a/Core/GameEngine/Model/Config/ModelResConfig.cs.meta
+++ b/Core/GameEngine/Model/Config/ModelResConfig.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 290b3d02a826d6b4daabb2e80dfaa3ab
-timeCreated: 1543388296
+timeCreated: 1544430338
licenseType: Pro
MonoImporter:
serializedVersion: 2
diff --git a/Fight/GameActor/BattleEffectPlayRule.cs b/Fight/GameActor/BattleEffectPlayRule.cs
index ce36ecf..c978839 100644
--- a/Fight/GameActor/BattleEffectPlayRule.cs
+++ b/Fight/GameActor/BattleEffectPlayRule.cs
@@ -82,6 +82,45 @@
}
}
+ public int petEffectLimit
+ {
+ get
+ {
+ if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.High)
+ {
+ return GeneralDefine.highQualityPetEffectCount;
+ }
+ else if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Medium)
+ {
+ return GeneralDefine.medQualityPetEffectCount;
+ }
+ else
+ {
+ return GeneralDefine.lowQualityPetEffectCount;
+ }
+ }
+ }
+
+ public int horseEffectLimit
+ {
+ get
+ {
+ if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.High)
+ {
+ return GeneralDefine.highQualityHorseEffectCount;
+ }
+ else if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Medium)
+ {
+ return GeneralDefine.medQualityHorseEffectCount;
+ }
+ else
+ {
+ return GeneralDefine.lowQualityHorseEffectCount;
+ }
+ }
+ }
+
+
public float timeEscape;
private void SortList()
diff --git a/Fight/GameActor/GAMgr.cs b/Fight/GameActor/GAMgr.cs
index de033e4..4806117 100644
--- a/Fight/GameActor/GAMgr.cs
+++ b/Fight/GameActor/GAMgr.cs
@@ -118,6 +118,7 @@
if (_player == null || !_player.ShowOrHide)
{
_pet.ShowOrHideModel(false);
+ _pet.HideEffect();
//Debug.LogFormat("瀹犵墿: {0} 鐨勬嫢鏈夎��: {1} 涓嶅彲瑙�, 杩欓噷闅愯棌.", _pet.ServerInstID, _parentID);
continue;
}
@@ -133,6 +134,15 @@
_pet.ShowOrHideModel(false);
//Debug.LogFormat("瀹犵墿: {0} 鐨勬嫢鏈夎��: {1} 鍦ㄥ垪琛ㄤ腑涓斾綅浜�: {2}, 澶т簬闄愬埗鏁伴噺: {3}", _pet.ServerInstID, _parentID, _index, BattleEffectPlayRule.Instance.petLimit);
}
+
+ if (_index != -1 && _index < BattleEffectPlayRule.Instance.petEffectLimit)
+ {
+ _pet.ShowEffect();
+ }
+ else
+ {
+ _pet.HideEffect();
+ }
}
}
@@ -146,6 +156,7 @@
if (_chkPlayer == null || !_chkPlayer.ShowOrHide)
{
_player.SwitchGuard(0);
+ _player.HideHorseEffect();
//Debug.LogFormat("_list: {0} 鐨勬嫢鏈夎��: {1} 涓嶅彲瑙�, 杩欓噷闅愯棌.", _chkPlayer.ServerInstID, _player.ServerInstID);
continue;
}
@@ -159,6 +170,17 @@
else
{
_player.SwitchGuard(0);
+ //Debug.LogFormat("_list: {0} 鐨勬嫢鏈夎��: {1} 鍦ㄥ垪琛ㄤ腑涓斾綅浜�: {2}, 澶т簬闄愬埗鏁伴噺: {3}", _chkPlayer.ServerInstID, _player.ServerInstID, _index, BattleEffectPlayRule.Instance.petLimit);
+ }
+
+ if (_index != -1 && _index < BattleEffectPlayRule.Instance.horseEffectLimit)
+ {
+ _player.ShowHorseEffect();
+ //Debug.LogFormat("_list: {0} 鐨勬嫢鏈夎��: {1} 鍦ㄥ垪琛ㄤ腑涓斾綅浜�: {2}, 灏忎簬闄愬埗鏁伴噺: {3}", _chkPlayer.ServerInstID, _player.ServerInstID, _index, BattleEffectPlayRule.Instance.petLimit);
+ }
+ else
+ {
+ _player.HideHorseEffect();
//Debug.LogFormat("_list: {0} 鐨勬嫢鏈夎��: {1} 鍦ㄥ垪琛ㄤ腑涓斾綅浜�: {2}, 澶т簬闄愬埗鏁伴噺: {3}", _chkPlayer.ServerInstID, _player.ServerInstID, _index, BattleEffectPlayRule.Instance.petLimit);
}
}
@@ -1263,7 +1285,8 @@
else if (_type == typeof(GA_NpcFightZZPlayer))
{
return (byte)E_ActorClassType.PlayerZZ;
- }else if(_type == typeof(GA_NpcFightSgzcZZ))
+ }
+ else if (_type == typeof(GA_NpcFightSgzcZZ))
{
return (byte)E_ActorClassType.PlayerSgzcRobot;
}
diff --git a/Fight/GameActor/GA_Pet.cs b/Fight/GameActor/GA_Pet.cs
index 8aa555e..5592138 100644
--- a/Fight/GameActor/GA_Pet.cs
+++ b/Fight/GameActor/GA_Pet.cs
@@ -1,4 +1,5 @@
锘�
+using System.Collections.Generic;
using Snxxz.UI;
using UnityEngine;
@@ -31,11 +32,32 @@
}
}
+ public sealed override void ShowEffect()
+ {
+ HideEffect();
+
+ string _modelName = NpcConfig.MODE;
+ var _config = TableConfig.ModelResConfig.GetPetConfig(_modelName);
+ if (_config != null)
+ {
+ var _dict = TableConfig.ModelResConfig.GetEffectDict(_modelName);
+ if (_dict != null)
+ {
+ foreach (var _bone in _dict.Keys)
+ {
+ var _ctrl = SFXPlayUtility.Instance.PlayBattleEffect(_dict[_bone], m_Model.transform.GetChildTransformDeeply(_bone));
+ m_EffectList.Add(_ctrl);
+ }
+ }
+ }
+ }
+
protected sealed override void OnMainModelLoaded()
{
base.OnMainModelLoaded();
uint _parentSID = ServerInstID / 10;
+
if (_parentSID != PlayerDatas.Instance.PlayerId)
{
GA_Player _player = GAMgr.Instance.GetBySID(_parentSID) as GA_Player;
@@ -64,9 +86,18 @@
}
}
- protected sealed override void OnUnit()
+ public sealed override void ShowOrHideModel(bool showOrHide)
{
- base.OnUnit();
+ base.ShowOrHideModel(showOrHide);
+
+ if (showOrHide)
+ {
+ ShowEffect();
+ }
+ else
+ {
+ HideEffect();
+ }
}
public sealed override void RequestLifeBar() { }
diff --git a/Fight/GameActor/GActor.cs b/Fight/GameActor/GActor.cs
index 8973d42..82c775f 100644
--- a/Fight/GameActor/GActor.cs
+++ b/Fight/GameActor/GActor.cs
@@ -1,4 +1,5 @@
-锘縰sing Snxxz.UI;
+锘縰sing System.Collections.Generic;
+using Snxxz.UI;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Events;
@@ -552,7 +553,18 @@
#endregion
+ protected List<SFXController> m_EffectList = new List<SFXController>();
+
public abstract void ShowOrHideModel(bool showOrHide);
+ public abstract void ShowEffect();
+ public virtual void HideEffect()
+ {
+ foreach (var _ctrl in m_EffectList)
+ {
+ SFXPlayUtility.Instance.Release(_ctrl);
+ }
+ m_EffectList.Clear();
+ }
protected Vector3 MP_Name_Pos;
diff --git a/Fight/GameActor/GActorFight.cs b/Fight/GameActor/GActorFight.cs
index 13fe686..0ad9dbc 100644
--- a/Fight/GameActor/GActorFight.cs
+++ b/Fight/GameActor/GActorFight.cs
@@ -88,6 +88,8 @@
protected override void OnUnit()
{
+ HideEffect();
+
m_StartedFlash = false;
m_FlashLastTime = 0;
SelectTarget = null;
@@ -128,6 +130,8 @@
}
}
+ public override void ShowEffect() { }
+
public abstract override void Destroy();
/// <summary>
diff --git a/Fight/GameActor/GActorNpcFight.cs b/Fight/GameActor/GActorNpcFight.cs
index 1c6b5c4..8d44aa3 100644
--- a/Fight/GameActor/GActorNpcFight.cs
+++ b/Fight/GameActor/GActorNpcFight.cs
@@ -192,6 +192,8 @@
protected override void OnUnit()
{
+ HideEffect();
+
StatusMgr.Instance.ReleaseActor(ServerInstID);
if (!ShowOrHide)
@@ -577,7 +579,7 @@
/// 鏄剧ず鎴栬�呴殣钘忚〃鐜板眰
/// </summary>
/// <param name="showOrHide">鏄剧ず: true, 闅愯棌: false</param>
- public sealed override void ShowOrHideModel(bool showOrHide)
+ public override void ShowOrHideModel(bool showOrHide)
{
if (ShowOrHide == showOrHide)
{
diff --git a/Fight/GameActor/GActorNpcNoFight.cs b/Fight/GameActor/GActorNpcNoFight.cs
index fd3660d..d86d772 100644
--- a/Fight/GameActor/GActorNpcNoFight.cs
+++ b/Fight/GameActor/GActorNpcNoFight.cs
@@ -78,6 +78,8 @@
InstanceResourcesLoader.AsyncLoadNpc(NpcConfig.NPCID, OnPrefabLoadFinished);
}
+ public override void ShowEffect() { }
+
protected virtual void HandleNpcConfig(int npcID)
{
NpcConfig = Config.Instance.Get<NPCConfig>(npcID);
@@ -85,6 +87,8 @@
protected override void OnUnit()
{
+ HideEffect();
+
if (m_LoadDefaultRes)
{
GameObjectPoolManager.Instance.ReleaseDefaultFuncNPC(m_Model);
diff --git a/Fight/GameActor/GActorPlayerBase.cs b/Fight/GameActor/GActorPlayerBase.cs
index 29d5022..41d328d 100644
--- a/Fight/GameActor/GActorPlayerBase.cs
+++ b/Fight/GameActor/GActorPlayerBase.cs
@@ -230,6 +230,8 @@
GameObject _prefab = null;
+ HideHorseEffect();
+
if (m_HorseModel)
{
HorseConfig _horseConfig = Config.Instance.Get<HorseConfig>((int)HorseID);
@@ -1142,6 +1144,8 @@
if (_newHorseID <= 0)
{
+ HideHorseEffect();
+
if (MovingState != E_MovingState.Ride)
{
return;
@@ -1378,6 +1382,43 @@
}
HorseID = _newHorseID;
+
+ if (ShowOrHide)
+ {
+ ShowHorseEffect();
+ }
+ }
+
+ private List<SFXController> m_HorseEffectList = new List<SFXController>();
+
+ public void HideHorseEffect()
+ {
+ foreach (var _ctrl in m_HorseEffectList)
+ {
+ SFXPlayUtility.Instance.Release(_ctrl);
+ }
+ m_HorseEffectList.Clear();
+ }
+
+ public void ShowHorseEffect()
+ {
+ HideHorseEffect();
+ var _horseConfig = Config.Instance.Get<HorseConfig>((int)HorseID);
+ var _config = Config.Instance.Get<ModelResConfig>(_horseConfig.Model);
+ if (_config == null)
+ {
+ Debug.LogError("鎵句笉鍒伴厤缃�: " + HorseID);
+ return;
+ }
+ var _dict = ModelResConfig.GetEffectDict(_config.ResourcesName);
+ if (_dict != null)
+ {
+ foreach (var _bone in _dict.Keys)
+ {
+ var _ctrl = SFXPlayUtility.Instance.PlayBattleEffect(_dict[_bone], m_HorseModel.transform.GetChildTransformDeeply(_bone));
+ m_HorseEffectList.Add(_ctrl);
+ }
+ }
}
public abstract void ChangeEquip(EquipInfo equipInfo);
@@ -2250,7 +2291,7 @@
return 12600 + index;
}
}
- else if(this is GA_NpcFightSgzcZZ)
+ else if (this is GA_NpcFightSgzcZZ)
{
switch (JobSetup.Job)
{
diff --git a/Fight/GameActor/PartialModelResConfig.cs b/Fight/GameActor/PartialModelResConfig.cs
index ad282e3..6ef4ca6 100644
--- a/Fight/GameActor/PartialModelResConfig.cs
+++ b/Fight/GameActor/PartialModelResConfig.cs
@@ -5,7 +5,10 @@
{
public partial class ModelResConfig : ConfigBase, IConfigPostProcess
{
- private static readonly Dictionary<string, ModelResConfig> dict = new Dictionary<string, ModelResConfig>();
+ private static readonly Dictionary<string, ModelResConfig> suitDict = new Dictionary<string, ModelResConfig>();
+ private static readonly Dictionary<string, ModelResConfig> petDict = new Dictionary<string, ModelResConfig>();
+ private static readonly Dictionary<string, ModelResConfig> horseDict = new Dictionary<string, ModelResConfig>();
+ private static readonly Dictionary<string, Dictionary<string, int>> effectDict = new Dictionary<string, Dictionary<string, int>>();
public void OnConfigParseCompleted()
{
@@ -17,15 +20,76 @@
{
_name = _name.Substring(_index + 1);
}
- dict[_name] = this;
+ suitDict[_name] = this;
}
+ else if (Type == (int)E_ModelResType.Horse)
+ {
+ horseDict[ResourcesName] = this;
+ }
+ else if (Type == (int)E_ModelResType.Pet)
+ {
+ petDict[ResourcesName] = this;
+ }
+
+ if (Type == (int)E_ModelResType.Horse
+ || Type == (int)E_ModelResType.Pet)
+ {
+ if (!string.IsNullOrEmpty(boneNameList))
+ {
+ var _bones = boneNameList.Split('|');
+ var _effects = EffFileName.Split('|');
+
+ if (_bones.Length != _effects.Length)
+ {
+ Debug.LogWarningFormat("{0} 绑定骨骼的数量和特效的数量无法对应 {1} != {2}", ID, _bones.Length, _effects.Length);
+ }
+
+ var _dict = new Dictionary<string, int>();
+
+ for (int i = 0; i < _bones.Length && i < _effects.Length; ++i)
+ {
+ _dict[_bones[i]] = int.Parse(_effects[i]);
+
+// Debug.LogFormat("设置特效配置: {0} => {1}", _bones[i], _dict[_bones[i]]);
+ }
+
+ effectDict[ResourcesName] = _dict;
+ }
+ }
+ }
+
+ public static Dictionary<string, int> GetEffectDict(string name)
+ {
+ if (effectDict.ContainsKey(name))
+ {
+ return effectDict[name];
+ }
+ return null;
}
public static ModelResConfig GetClothesConfig(string name)
{
- if(dict.ContainsKey(name))
+ if (suitDict.ContainsKey(name))
{
- return dict[name];
+ return suitDict[name];
+ }
+ return null;
+ }
+
+ public static ModelResConfig GetHorseConfig(string name)
+ {
+ if (horseDict.ContainsKey(name))
+ {
+ return horseDict[name];
+ }
+ return null;
+ }
+
+ public static ModelResConfig GetPetConfig(string name)
+ {
+ if (petDict.ContainsKey(name))
+ {
+ return petDict[name];
}
return null;
}
diff --git a/System/GeneralConfig/GeneralDefine.cs b/System/GeneralConfig/GeneralDefine.cs
index b364584..36443ea 100644
--- a/System/GeneralConfig/GeneralDefine.cs
+++ b/System/GeneralConfig/GeneralDefine.cs
@@ -155,6 +155,12 @@
public static int lowQualityGuardCount { get; private set; }
public static int medQualityGuardCount { get; private set; }
public static int highQualityGuardCount { get; private set; }
+ public static int lowQualityPetEffectCount { get; private set; }
+ public static int medQualityPetEffectCount { get; private set; }
+ public static int highQualityPetEffectCount { get; private set; }
+ public static int lowQualityHorseEffectCount { get; private set; }
+ public static int medQualityHorseEffectCount { get; private set; }
+ public static int highQualityHorseEffectCount { get; private set; }
public static int fairyLandBuffCondition { get; private set; }
public static int fairyLandBuffId { get; private set; }
@@ -546,6 +552,16 @@
lowQualityGuardCount = int.Parse(func.Numerical1);
medQualityGuardCount = int.Parse(func.Numerical2);
highQualityGuardCount = int.Parse(func.Numerical3);
+
+ func = Config.Instance.Get<FuncConfigConfig>("QualityPetEffectCount");
+ lowQualityPetEffectCount = int.Parse(func.Numerical1);
+ medQualityPetEffectCount = int.Parse(func.Numerical2);
+ highQualityPetEffectCount = int.Parse(func.Numerical3);
+
+ func = Config.Instance.Get<FuncConfigConfig>("QualityHorseEffectCount");
+ lowQualityHorseEffectCount = int.Parse(func.Numerical1);
+ medQualityHorseEffectCount = int.Parse(func.Numerical2);
+ highQualityHorseEffectCount = int.Parse(func.Numerical3);
fairyLandBuffCondition = GetInt("XjmjAddHarm", 1);
fairyLandBuffId = GetInt("XjmjAddHarm", 2);
diff --git a/System/Rank/RankHeadCell.cs b/System/Rank/RankHeadCell.cs
index c83eb22..2a395f8 100644
--- a/System/Rank/RankHeadCell.cs
+++ b/System/Rank/RankHeadCell.cs
@@ -115,16 +115,13 @@
realmLv = (int)data.value1;
break;
}
- if (realmLv > 0)
+ RealmConfig presentCfg = Config.Instance.Get<RealmConfig>(realmLv);
+ if (presentCfg != null)
{
- RealmConfig presentCfg = Config.Instance.Get<RealmConfig>(realmLv);
- if (presentCfg != null)
- {
- realmImg.gameObject.SetActive(data.type != (int)PlayerRankData.RankType.Realm);
- m_CompareImg.gameObject.SetActive(data.type == (int)PlayerRankData.RankType.Realm);
- realmImg.SetSprite(presentCfg.Img);
- m_CompareImg.SetSprite(presentCfg.Img);
- }
+ realmImg.gameObject.SetActive(data.type != (int)PlayerRankData.RankType.Realm);
+ m_CompareImg.gameObject.SetActive(data.type == (int)PlayerRankData.RankType.Realm);
+ realmImg.SetSprite(presentCfg.Img);
+ m_CompareImg.SetSprite(presentCfg.Img);
}
bool isSelf = data.ID == PlayerDatas.Instance.PlayerId;
diff --git a/System/Realm/ActivateShow.cs b/System/Realm/ActivateShow.cs
index 8d0806a..a7a9872 100644
--- a/System/Realm/ActivateShow.cs
+++ b/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, stage);
titleIconKey = "GodWeaponEffectTitle";
diff --git a/System/Role/GodWeaponPreviewWin.cs b/System/Role/GodWeaponPreviewWin.cs
index a4244da..5c70ab4 100644
--- a/System/Role/GodWeaponPreviewWin.cs
+++ b/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,37 @@
m_RequireLevel.text = Language.Get("GodWeaponStageRequireLevel", config.Name, requireLevel);
}
+ private void DisplayFightPower()
+ {
+ var fightPower = 0;
+ var dict = model.GetEffectPropertyUpper(selectGodWeaponType, selectStage);
+ fightPower += model.TryGetEffectFightPower(selectGodWeaponType, selectStage);
+ 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);
diff --git a/System/Role/MagicianModel.cs b/System/Role/MagicianModel.cs
index 4ecc046..fbf0456 100644
--- a/System/Role/MagicianModel.cs
+++ b/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,73 @@
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 stage)
+ {
+ var previousFightPower = 0;
+ if (stage - 1 > 0)
+ {
+ var previousLevel = GetGodWeaponStageRequireLevel(type, stage - 1);
+ if (effectFightPower.ContainsKey(type)
+ && effectFightPower[type].ContainsKey(previousLevel))
+ {
+ previousFightPower = effectFightPower[type][previousLevel];
+ }
+ }
+ var level = GetGodWeaponStageRequireLevel(type, stage);
+ if (effectFightPower.ContainsKey(type)
+ && effectFightPower[type].ContainsKey(level))
+ {
+ return effectFightPower[type][level] - previousFightPower;
+ }
+ 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 +783,11 @@
public int cost;
public int exp;
}
+
+ public struct GodWeaponEffectProperty
+ {
+ public int level;
+ public Dictionary<int, int> propertyDict;
+ }
}
--
Gitblit v1.8.0