From d1fe47e500458a48b2aa2f5f326eee03eb50f85a Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期二, 18 九月 2018 11:34:34 +0800
Subject: [PATCH] Merge branch '3610法宝之魂改为由各个法宝单独觉醒,取消激活条件'
---
System/Treasure/TreasureSoulModel.cs | 134 ++------------------------------------------
1 files changed, 6 insertions(+), 128 deletions(-)
diff --git a/System/Treasure/TreasureSoulModel.cs b/System/Treasure/TreasureSoulModel.cs
index 4747070..0b6bace 100644
--- a/System/Treasure/TreasureSoulModel.cs
+++ b/System/Treasure/TreasureSoulModel.cs
@@ -10,7 +10,6 @@
{
Dictionary<int, TreasureSpecialData> treasureSoulDict = new Dictionary<int, TreasureSpecialData>();
List<int> treasureSouls = new List<int>();
- Dictionary<int, List<int>> soulAchievements = new Dictionary<int, List<int>>();
public Dictionary<int, int> signAddProperty = new Dictionary<int, int>();
public int signAddTreasure { get; private set; }
@@ -42,8 +41,6 @@
{
packModel.RefreshItemCountAct += RefreshItemCountAct;
PlayerStrengthengDatas.RefreshEquipUpgradLvAct += RefreshEquipSTRLv;
- achievementModel.achievementProgressUpdateEvent += AchievementUpdate;
- achievementModel.achievementCompletedEvent += AchievementUpdate;
ParseConfig();
}
@@ -69,8 +66,6 @@
{
packModel.RefreshItemCountAct -= RefreshItemCountAct;
PlayerStrengthengDatas.RefreshEquipUpgradLvAct -= RefreshEquipSTRLv;
- achievementModel.achievementProgressUpdateEvent -= AchievementUpdate;
- achievementModel.achievementCompletedEvent -= AchievementUpdate;
}
void ParseConfig()
@@ -85,7 +80,6 @@
}
treasureSouls.Add(configs[i].PrivilegeID);
treasureSoulDict.Add(configs[i].PrivilegeID, new TreasureSpecialData((TreasurePrivilege)configs[i].PrivilegeID));
- soulAchievements.Add(configs[i].PrivilegeID, new List<int>(configs[i].successList));
}
var funcConfig = Config.Instance.Get<FuncConfigConfig>("MWSignDayAttr");
var jsonData = LitJson.JsonMapper.ToObject(funcConfig.Numerical1);
@@ -101,82 +95,9 @@
return treasureSouls;
}
- public bool TryGetLockAchievement(int _id,out int achievementId)
- {
- achievementId = 0;
- List<int> list;
- if (soulAchievements.TryGetValue(_id, out list))
- {
- for (int i = 0; i < list.Count; i++)
- {
- var config = Config.Instance.Get<SuccessConfig>(list[i]);
- if (config != null && config.Type == 1)
- {
- achievementId = list[i];
- return true;
- }
- }
- }
- return false;
- }
-
- public bool TryGetAchievements(int _id,out List<int> list)
- {
- return soulAchievements.TryGetValue(_id, out list);
- }
-
- public bool IsCompleteLockAchievement(int _id)
- {
- TreasureSpecialData special;
- if (TryGetTreasureSoul(_id, out special))
- {
- if (special.active)
- {
- return true;
- }
- int achievementId;
- if (TryGetLockAchievement(_id, out achievementId))
- {
- Achievement achievement;
- return achievementModel.TryGetAchievement(achievementId, out achievement) && achievement.completed;
- }
- }
- return true;
- }
-
- public bool IsCompleteAllAchievement(int _id)
- {
- if (soulAchievements.ContainsKey(_id))
- {
- var list = soulAchievements[_id];
- bool allCompleted = true;
- for (int i = 0; i < list.Count; i++)
- {
- Achievement achievement;
- achievementModel.TryGetAchievement(list[i], out achievement);
- if (achievement == null || (!achievement.completed && !Achievement.IsReach(achievement.id, achievement.progress)))
- {
- allCompleted = false;
- }
- }
- return allCompleted;
- }
- return false;
- }
-
public bool TryGetTreasureSoul(int _id, out TreasureSpecialData special)
{
return treasureSoulDict.TryGetValue(_id, out special);
- }
-
- public void ActiveTreasureSoul(int _id)
- {
- if (IsCompleteAllAchievement(_id))
- {
- CA512_tagCMActiveMWSoul pak = new CA512_tagCMActiveMWSoul();
- pak.ID = (byte)_id;
- GameNetSystem.Instance.SendInfo(pak);
- }
}
public int GetTreasureSoulValue(int _soulId)
@@ -222,17 +143,6 @@
}
}
- private void AchievementUpdate(int _id)
- {
- foreach (var soulId in soulAchievements.Keys)
- {
- if (soulAchievements[soulId].Contains(_id))
- {
- UpdateAchievementRedpoint(soulId);
- }
- }
- }
-
public void UpdateTreasureSoulStrenthen()
{
UpdateRedpoint((int)TreasurePrivilege.StrengthenAdd);
@@ -254,19 +164,18 @@
}
bool beforeActived = special.active;
special.active = _data.State == 1;
- if (!beforeActived && special.active && serverInited && WindowCenter.Instance.CheckOpen<TreasureSoulWin>()
- && !WindowCenter.Instance.CheckOpen<TreasureSoulActiveWin>() && !NewBieCenter.Instance.inGuiding)
- {
- TreasureSoulActiveWin.treasureSoulId = (int)_data.PriID;
- WindowCenter.Instance.Open<TreasureSoulActiveWin>();
- }
+ //if (!beforeActived && special.active && serverInited && WindowCenter.Instance.CheckOpen<TreasureSoulWin>()
+ // && !WindowCenter.Instance.CheckOpen<TreasureSoulActiveWin>() && !NewBieCenter.Instance.inGuiding)
+ //{
+ // TreasureSoulActiveWin.treasureSoulId = (int)_data.PriID;
+ // WindowCenter.Instance.Open<TreasureSoulActiveWin>();
+ //}
if ((TreasurePrivilege)_data.PriID == TreasurePrivilege.StrengthenAdd)
{
if (treasureSoulEvent != null)
{
treasureSoulEvent((int)_data.PriID);
}
- UpdateAchievementRedpoint((int)_data.PriID);
UpdateRedpoint((int)_data.PriID);
continue;
}
@@ -277,14 +186,12 @@
special.presentGetCount = (int)_data.CurValue;
special.itemGet = _data.ItemAwardState == 1;
UpdateRedpoint((int)_data.PriID);
- UpdateAchievementRedpoint((int)_data.PriID);
if (treasureSoulEvent != null)
{
treasureSoulEvent((int)_data.PriID);
}
if (beforeFinishCount < special.presentFinishCount && serverInited && special.active
- && !WindowCenter.Instance.CheckOpen<TreasureSoulActiveWin>()
&& WindowCenter.Instance.CheckOpen<TreasureSoulWin>()
&& !WindowCenter.Instance.CheckOpen<RealmPropertyUpWin>()
&& !NewBieCenter.Instance.inGuiding)
@@ -308,7 +215,6 @@
_specialData.presentFinishCount = (int)_data.Cnt;
UpdateRedpoint((int)TreasurePrivilege.StrengthenAdd);
if (beforeFinishCount < _specialData.presentFinishCount && serverInited && _specialData.active
- && !WindowCenter.Instance.CheckOpen<TreasureSoulActiveWin>()
&& WindowCenter.Instance.CheckOpen<TreasureSoulWin>()
&& !WindowCenter.Instance.CheckOpen<RealmPropertyUpWin>())
{
@@ -358,37 +264,11 @@
}
}
- private void UpdateAchievementRedpoint(int _id)
- {
- if (treasureSoulDict.ContainsKey(_id) && soulAchievements.ContainsKey(_id))
- {
- var special = treasureSoulDict[_id];
- special.activeRedpoint.state = RedPointState.None;
- if (!FuncOpen.Instance.IsFuncOpen(126) || !IsOpenTreasureSoul(_id) || special.active)
- {
- return;
- }
- var list = soulAchievements[_id];
- bool allCompleted = true;
- for (int i = 0; i < list.Count; i++)
- {
- Achievement achievement;
- achievementModel.TryGetAchievement(list[i], out achievement);
- if (achievement == null || (!achievement.completed && !Achievement.IsReach(achievement.id, achievement.progress)))
- {
- allCompleted = false;
- }
- }
- special.activeRedpoint.state = allCompleted ? RedPointState.Simple : RedPointState.None;
- }
- }
-
private void UpdateRedpoints()
{
foreach (var special in treasureSoulDict.Keys)
{
UpdateRedpoint(special);
- UpdateAchievementRedpoint(special);
}
}
}
@@ -403,7 +283,6 @@
public Dictionary<int, int> propertyDict { get; private set; }
public Redpoint redpoint { get; private set; }
public Redpoint privilegeRedpoint { get; private set; }
- public Redpoint activeRedpoint { get; private set; }
public int treasureId { get; set; }
public bool active { get; set; }
@@ -485,7 +364,6 @@
}
redpoint = new Redpoint(TreasureModel.TREASURE_SOUL_ID, TreasureModel.TREASURE_SOUL_ID * 100 + (int)type);
- activeRedpoint = new Redpoint(redpoint.id, redpoint.id * 100 + 1);
switch (_type)
{
case TreasurePrivilege.DemonJarAtk:
--
Gitblit v1.8.0