From 21a1542f9d99466b2aedd0992a1032b37b4154a3 Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期一, 20 八月 2018 20:21:08 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into Skill_Polymorph_BeatBackPlayer
---
System/Realm/ActivateShow.cs | 86 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 86 insertions(+), 0 deletions(-)
diff --git a/System/Realm/ActivateShow.cs b/System/Realm/ActivateShow.cs
index e4e7db4..3edbbc1 100644
--- a/System/Realm/ActivateShow.cs
+++ b/System/Realm/ActivateShow.cs
@@ -14,6 +14,7 @@
public static int currentLv { get; private set; }
public static int beforeLv { get; private set; }
public static int godWeaponType { get; private set; }
+ public static int treasureSoulId { get; private set; }
private static Dictionary<int, int> propertyUpDict = new Dictionary<int, int>();
@@ -177,6 +178,90 @@
}
+ public static void TreasureSoulGetReward(int id, int _beforeLevel, int _currentLevel)
+ {
+ activateType = ActivateFunc.TreasureSoul;
+ treasureSoulId = id;
+ propertyCompares.Clear();
+ propertyUpDict.Clear();
+ var model = ModelCenter.Instance.GetModel<TreasureSoulModel>();
+ TreasureSpecialData special;
+ if (model.TryGetTreasureSoul(treasureSoulId, out special))
+ {
+ switch (special.type)
+ {
+ case TreasurePrivilege.StrengthenAdd:
+ var configs = ConfigManager.Instance.GetAllValues<ItemPlusSumAttrConfig>();
+ var before = -1;
+ var present = 0;
+ for (int i = 0; i < configs.Count; i++)
+ {
+ if (_beforeLevel >= configs[i].countNeed)
+ {
+ before = i;
+ }
+ if (_currentLevel >= configs[i].countNeed)
+ {
+ present = i;
+ }
+ }
+ ItemPlusSumAttrConfig _beforeConfig = null;
+ if (before >= 0 && before < configs.Count)
+ {
+ _beforeConfig = configs[before];
+ }
+ List<int> _beforeProperties = new List<int>();
+ if (_beforeConfig != null)
+ {
+ _beforeProperties.AddRange(_beforeConfig.attType);
+ }
+ var config = (present < 0 || present >= configs.Count) ? null : configs[present];
+ if (config == null)
+ {
+ return;
+ }
+ for (int i = 0; i < config.attType.Length; i++)
+ {
+ var _index = _beforeProperties.IndexOf(config.attType[i]);
+ if (_index == -1 || config.attValue[i] > _beforeConfig.attValue[_index])
+ {
+ propertyUpDict.Add(config.attType[i], config.attValue[i] -
+ (_index == -1 ? 0 : _beforeConfig.attValue[_index]));
+ propertyCompares.Add(new PropertyCompare()
+ {
+ key = config.attType[i],
+ beforeValue = _index == -1 ? 0 : _beforeConfig.attValue[_index],
+ currentValue = config.attValue[i]
+ });
+ }
+ }
+ break;
+ case TreasurePrivilege.DemonJarAtk:
+ case TreasurePrivilege.MountAtk:
+ case TreasurePrivilege.PetHp:
+ case TreasurePrivilege.Sp:
+ foreach (var _key in special.propertyDict.Keys)
+ {
+ var beforeValue = special.propertyDict[_key] * _beforeLevel / special.progress;
+ var nowValue = special.propertyDict[_key] * _currentLevel / special.progress;
+ propertyUpDict.Add(_key, nowValue - beforeValue);
+ propertyCompares.Add(new PropertyCompare()
+ {
+ key = _key,
+ beforeValue = beforeValue,
+ currentValue = nowValue
+ });
+ }
+ break;
+ }
+ fightPower = UIHelper.GetFightPower(propertyUpDict);
+ if (!WindowCenter.Instance.CheckOpen<RealmPropertyUpWin>())
+ {
+ WindowCenter.Instance.Open<RealmPropertyUpWin>();
+ }
+ }
+ }
+
public static void PrepareSkillFly()
{
if (prepareFlySkillEvent != null)
@@ -198,6 +283,7 @@
Realm,
GodWeapon,
Stove, //鐐间腹鐐夊崌绾�
+ TreasureSoul,//娉曞疂榄傞鍙栧睘鎬�
}
public struct PropertyCompare
--
Gitblit v1.8.0