From a8f0eb9f1a09b01106775c09f2b7dde98d8773dd Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期四, 22 十一月 2018 16:43:09 +0800
Subject: [PATCH] 4747 【前端】【1.3】封魔坛新增自动进入功能(VIP特权),双倍挑战修改
---
System/FindPrecious/FindPreciousModel.cs | 89 +++++++++++++++++++++++++++++++++-----------
1 files changed, 67 insertions(+), 22 deletions(-)
diff --git a/System/FindPrecious/FindPreciousModel.cs b/System/FindPrecious/FindPreciousModel.cs
index 9a0e6b7..1d2e119 100644
--- a/System/FindPrecious/FindPreciousModel.cs
+++ b/System/FindPrecious/FindPreciousModel.cs
@@ -8,7 +8,7 @@
namespace Snxxz.UI
{
[XLua.LuaCallCSharp]
- public class FindPreciousModel : Model, IBeforePlayerDataInitialize, IAfterPlayerDataInitialize, IPlayerLoginOk, IMapInitOk, ISwitchAccount
+ public class FindPreciousModel : Model, IBeforePlayerDataInitialize, IAfterPlayerDataInitialize, IPlayerLoginOk, IMapInitOk, ISwitchAccount
{
public const int PREPOSE_SECONDS = 120;
public const int FINDPRECIOUS_REDPOINTID = 76000;
@@ -24,10 +24,10 @@
}
Dictionary<int, BossInfo> bossInfos = new Dictionary<int, BossInfo>();
- List<int> bossNotifies = new List<int>();
+ List<BossNotify> bossNotifies = new List<BossNotify>();
- int m_CurrentBossNotify = 0;
- public int currentBossNotify {
+ BossNotify m_CurrentBossNotify = default(BossNotify);
+ public BossNotify currentBossNotify {
get { return m_CurrentBossNotify; }
private set {
if (m_CurrentBossNotify != value)
@@ -88,7 +88,7 @@
public void OnSwitchAccount()
{
- m_CurrentBossNotify = 0;
+ m_CurrentBossNotify = default(BossNotify);
bossSubscribes.Clear();
bossNotifies.Clear();
FindPreciousTimer.Instance.Clear();
@@ -315,7 +315,7 @@
{
var sendInfo = new CA903_tagCGAttentionBoss();
sendInfo.BossID = (uint)_bossId;
- sendInfo.IsAdd = 0;
+ sendInfo.IsAdd = 9;
GameNetSystem.Instance.SendInfo(sendInfo);
bossSubscribes[_bossId] = new BossSubscribe(_bossId, 9);
@@ -337,37 +337,37 @@
}
}
- public void AddOneBossRebornNotify(int _bossId)
+ public void AddOneBossRebornNotify(int bossId)
{
- if (IsBossSubscribed(_bossId) && !bossNotifies.Contains(_bossId))
+ if (IsBossSubscribed(bossId) && !ExitBossNotify(bossId))
{
- var type = GetBossFindPreciousType(_bossId);
+ var type = GetBossFindPreciousType(bossId);
if (type == FindPreciousType.DemonJar && demonJarModel.GetSurplusTimes() <= 0)
{
}
else
{
- bossNotifies.Add(_bossId);
+ bossNotifies.Add(new BossNotify(bossId, demonJarModel.autoChallenge));
currentBossNotify = GetNextBossNotify();
}
}
}
- public void RemoveOneBossRebornNotify(int _bossId)
+ public void RemoveOneBossRebornNotify(int bossId )
{
- if (bossNotifies.Contains(_bossId))
+ if (ExitBossNotify(bossId))
{
- bossNotifies.Remove(_bossId);
+ RemoveBossRebornNotify(bossId);
currentBossNotify = GetNextBossNotify();
}
}
- public void ReportConfirmBossRebornNotify(int _bossId)
+ public void ReportConfirmBossRebornNotify(BossNotify _notify)
{
- if (bossNotifies.Contains(_bossId))
+ if (bossNotifies.Contains(_notify))
{
- bossNotifies.Remove(_bossId);
+ bossNotifies.Remove(_notify);
}
currentBossNotify = GetNextBossNotify();
@@ -377,10 +377,10 @@
{
for (int i = bossNotifies.Count - 1; i >= 0; i--)
{
- var bossId = bossNotifies[i];
- if (GetBossFindPreciousType(bossId) == _type)
+ var notify = bossNotifies[i];
+ if (GetBossFindPreciousType(notify.bossId) == _type)
{
- bossNotifies.Remove(bossId);
+ bossNotifies.Remove(notify);
}
}
@@ -441,7 +441,7 @@
return FindPreciousType.None;
}
- private int GetNextBossNotify()
+ private BossNotify GetNextBossNotify()
{
if (bossNotifies.Count > 0)
{
@@ -449,7 +449,29 @@
}
else
{
- return 0;
+ return default(BossNotify);
+ }
+ }
+
+ private bool ExitBossNotify(int bossId)
+ {
+ foreach (var notify in bossNotifies)
+ {
+ return notify.bossId == bossId;
+ }
+
+ return false;
+ }
+
+ private void RemoveBossRebornNotify(int bossId)
+ {
+ for (var i = bossNotifies.Count; i >= 0; i--)
+ {
+ var notify = bossNotifies[i];
+ if (notify.bossId == bossId)
+ {
+ bossNotifies.RemoveAt(i);
+ }
}
}
@@ -460,7 +482,7 @@
private void InitializeBossNotify()
{
- m_CurrentBossNotify = 0;
+ m_CurrentBossNotify = default(BossNotify);
bossNotifies.Clear();
foreach (var boss in bossInfos.Values)
{
@@ -714,6 +736,29 @@
}
+ public struct BossNotify
+ {
+ public int bossId;
+ public bool demonJarAuto;
+
+ public BossNotify(int bossId, bool demonJarAuto)
+ {
+ this.bossId = bossId;
+ this.demonJarAuto = demonJarAuto;
+ }
+
+ public static bool operator ==(BossNotify _lhs, BossNotify _rhs)
+ {
+ return _lhs.bossId == _rhs.bossId && _lhs.demonJarAuto == _rhs.demonJarAuto;
+ }
+
+ public static bool operator !=(BossNotify _lhs, BossNotify _rhs)
+ {
+ return _lhs.bossId != _rhs.bossId || _lhs.demonJarAuto != _rhs.demonJarAuto;
+ }
+
+ }
+
}
}
--
Gitblit v1.8.0