From ac03dfd8e7f8d904ead253ac5e36023c4d7ad023 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期五, 21 九月 2018 15:23:50 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
---
System/Strengthening/GodBeastModel.cs | 76 ++++++++++++++++++++++++-
System/Strengthening/GodBeastReinforcementWin.cs | 18 ++++++
System/Strengthening/GodBeastAttributes.cs | 27 ++++----
3 files changed, 105 insertions(+), 16 deletions(-)
diff --git a/System/Strengthening/GodBeastAttributes.cs b/System/Strengthening/GodBeastAttributes.cs
index 846ccac..fb9f986 100644
--- a/System/Strengthening/GodBeastAttributes.cs
+++ b/System/Strengthening/GodBeastAttributes.cs
@@ -39,9 +39,9 @@
[SerializeField] GameObject m_Text_two;//涓嬬骇灞炴��
[SerializeField] Button m_StrengthenDoubleBtn;//鍙屽�嶅己鍖栨寜閽�
[SerializeField] Text m_NeedFairy;//鎵�闇�鐨勪粰鐜�
+ [SerializeField] GameObject m_BottomBox;
DogzModel Dogz_model;
- DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } }
- private Dictionary<int, int> QualityLimit = new Dictionary<int, int>();
+ DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } }
PlayerPackModel _playerPack;
PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } }
ItemTipsModel _itemTipsModel;
@@ -74,17 +74,14 @@
}
private void OnDisable()
{
+ GodBeast_Number = 0;
+ GodBeast_Part = 0;
GodBeastReinforcementWin.ChooseToModify -= ChooseToModify;
godBeastModel.AbsorbEvent -= AbsorbEvent;
}
public void Init()
{
- if (QualityLimit.Count <= 0)
- {
- string DogzAssist = Config.Instance.Get<FuncConfigConfig>("DogzAssist").Numerical4;//鑾峰彇涓嶅悓鍝佽川鐨勭鍏藉己鍖栦笂闄�
- QualityLimit = ConfigParse.GetDic<int, int>(DogzAssist);
- }
}
public void Unit()
@@ -160,8 +157,7 @@
}
m_UIAlphaTween.gameObject.SetActive(true);
m_FrameNull.SetActive(true);
- m_FullLevel.SetActive(false);
- m_StrengthenBtn.interactable = true;
+ m_FullLevel.SetActive(false);
GetDogZLevelAndExp();
AttributeAssignment();
}
@@ -182,7 +178,7 @@
m_FrameNull.SetActive(false);
m_FullLevel.SetActive(false);
m_UIAlphaTween.gameObject.SetActive(false);
- m_StrengthenBtn.interactable = false;
+ m_BottomBox.SetActive(false);
}
}
@@ -193,13 +189,15 @@
return;
}
GainProficiency();//鑾峰彇鐔熺粌搴�
+ m_BottomBox.SetActive(true);
var IudetDogzEquipPlus = m_DogZItemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
if (IudetDogzEquipPlus != null)
{
- int lv = QualityLimit[m_DogZItemModel.chinItemModel.ItemColor];
+ int lv = godBeastModel.QualityLimit[m_DogZItemModel.chinItemModel.ItemColor];
var DogzEquipConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(GodBeastPart, lv);
if (DogZLv >= lv)
{
+ m_BottomBox.SetActive(false);
m_Text_two.SetActive(false);
m_FrameNull.SetActive(false);
m_TextAttributes1.gameObject.SetActive(false);
@@ -220,10 +218,13 @@
var Dogz_EquipConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(GodBeastPart, DogZLv - 1);
NeedExp -= Dogz_EquipConfig.upExpTotal;
}
- m_ExpNum.text = DogZExp + "/" + NeedExp;
+ m_ExpNum.text = NeedExp + "/" + NeedExp;
}
else
{
+
+ m_StrengthenDoubleBtn.interactable = true;
+ m_StrengthenBtn.interactable = true;
m_Text_two.SetActive(true);
if (m_DoubleToggle.isOn)
{
@@ -373,7 +374,7 @@
{
return DogzLv;
}
- int lv = QualityLimit[m_DogZItemModel.chinItemModel.ItemColor];
+ int lv = godBeastModel.QualityLimit[m_DogZItemModel.chinItemModel.ItemColor];
var IudetDogzEquipPlus = m_DogZItemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
if (IudetDogzEquipPlus != null)
{
diff --git a/System/Strengthening/GodBeastModel.cs b/System/Strengthening/GodBeastModel.cs
index f890d88..eac4735 100644
--- a/System/Strengthening/GodBeastModel.cs
+++ b/System/Strengthening/GodBeastModel.cs
@@ -16,15 +16,20 @@
public Dictionary<int, int> Absorption_Dic = new Dictionary<int, int>();//鑾峰彇閫夋嫨鐨勭墿鍝�
public event Action AbsorbEvent;
public int ItemInde = 0;//鐗╁搧涓嬫爣
- public ItemModel Crystal_ItemModel;
- public int ItemPlace =-1;//绁炲吔瑁呭浣嶇疆淇℃伅
+ public ItemModel Crystal_ItemModel;//褰撳墠鎵�閫変腑鐨勬按鏅剁墿鍝�
+ public int ItemPlace = -1;//绁炲吔瑁呭浣嶇疆淇℃伅
+ public Dictionary<int, int> QualityLimit = new Dictionary<int, int>();//瀵瑰簲鍝佽川鎵�鑳介�夋嫨鐨勬渶澶у己鍖栫瓑绾�
DogzModel Dogz_model;
DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } }
PlayerPackModel _playerPack;
PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } }
public override void Init()
{
-
+ if (QualityLimit.Count <= 0)
+ {
+ string DogzAssist = Config.Instance.Get<FuncConfigConfig>("DogzAssist").Numerical4;//鑾峰彇涓嶅悓鍝佽川鐨勭鍏藉己鍖栦笂闄�
+ QualityLimit = ConfigParse.GetDic<int, int>(DogzAssist);
+ }
}
public void OnBeforePlayerDataInitialize()
@@ -118,7 +123,72 @@
return SiteEnhancementAttributeDic;
}
+ public int DogZBagIndex = 0;
+ public bool IsFullLevel()//鏄兘婊$骇鑳藉缁х画鍚告敹
+ {
+ bool IsBool = false;
+ int DogZLV = 0;//鑾峰彇褰撳墠绁炲吔绛夌骇
+ int DogProficiency = 0;//褰撳墠绁炲吔鐨勭啛缁冨害
+ int SingleProficiency = 0;//鍗曞�嶇啛缁冨害
+ int DoubleProficiency = 0;//鍙屽�嶇啛缁冨害
+ ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptDogzEquip, DogZBagIndex);
+ if (itemModel == null)
+ {
+ return false;
+ }
+ int lv = QualityLimit[itemModel.chinItemModel.ItemColor];
+ var DogzEquipMaxConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(itemModel.chinItemModel.EquipPlace, lv);
+ var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
+ if (IudetDogzEquipPlus != null)
+ {
+ DogZLV = IudetDogzEquipPlus[0];
+ DogProficiency = IudetDogzEquipPlus[1];
+ }
+ foreach (var key in Absorption_Dic.Keys)
+ {
+ ItemModel item_Model = playerPack.GetItemModelByIndex(PackType.rptDogzItem, key);
+ if (item_Model != null)
+ {
+ if (item_Model.chinItemModel.Effect1 == 235)
+ {
+ var _IudetDogzEquipPlus = item_Model.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
+ SingleProficiency += item_Model.chinItemModel.EffectValueA1 * Absorption_Dic[key];
+ if (_IudetDogzEquipPlus != null)
+ {
+ SingleProficiency += _IudetDogzEquipPlus[1];
+ DoubleProficiency += item_Model.chinItemModel.EffectValueA1;
+ }
+ else
+ {
+ DoubleProficiency += item_Model.chinItemModel.EffectValueA1 * 2 * Absorption_Dic[key];
+ }
+ }
+ }
+ }
+ if (true)
+ {
+ if (DogProficiency + DoubleProficiency >= DogzEquipMaxConfig.upExpTotal)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ if (DogProficiency + SingleProficiency >= DogzEquipMaxConfig.upExpTotal)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
}
diff --git a/System/Strengthening/GodBeastReinforcementWin.cs b/System/Strengthening/GodBeastReinforcementWin.cs
index 36ca3c3..4361029 100644
--- a/System/Strengthening/GodBeastReinforcementWin.cs
+++ b/System/Strengthening/GodBeastReinforcementWin.cs
@@ -61,6 +61,7 @@
if (GodBeastList[i].ItemPlace == godBeastModel.ItemPlace)
{
CurrentlySelected = GodBeastList[i].LocationMarker;
+ GetDogZBagIndex();
int Index = 0;
Index = GodBeastList.FindIndex((x) =>
{
@@ -75,6 +76,7 @@
if (GodBeastList.Count > 0)
{
CurrentlySelected = GodBeastList[0].LocationMarker;
+ GetDogZBagIndex();
m_ScrollerController.JumpIndex(0);
}
}
@@ -94,6 +96,7 @@
protected override void OnPreClose()
{
godBeastModel.ItemPlace = -1;
+ // godBeastModel.Absorption_Dic.Clear();
playerPack.RefreshItemCountAct -= RefreshItemCountAct;
m_ScrollerController.OnRefreshCell -= OnRefreshGridCell;
DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent -= MakeItemAnswerEvent;
@@ -219,6 +222,7 @@
if (locationMarker != CurrentlySelected)
{
CurrentlySelected = locationMarker;
+ GetDogZBagIndex();
m_ScrollerController.m_Scorller.RefreshActiveCellViews();//鍒锋柊鍙
if (ChooseToModify != null)
{
@@ -227,6 +231,20 @@
}
});
}
+
+ private void GetDogZBagIndex()//鑾峰彇閫夋嫨鐨勭鍏借澶囩殑瑁呭涓嬫爣
+ {
+ for (int i = 0; i < GodBeastList.Count; i++)
+ {
+ if (CurrentlySelected == GodBeastList[i].LocationMarker)
+ {
+ godBeastModel.DogZBagIndex = GodBeastList[i].ItemPlace;
+ // DebugEx.LogError(godBeastModel.DogZBagIndex);
+ return;
+ }
+ }
+
+ }
}
}
--
Gitblit v1.8.0