From 2f723e5320ef618985cc9ea8f71deafd3e4bec36 Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期二, 16 四月 2019 11:35:50 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
---
Core/GameEngine/Model/TelPartialConfig/PartialAdventureDialogueConfig.cs.meta | 12
Fight/Stage/Dungeon/AdventureStage.cs | 107 +
System/CrossServerOneVsOne/CrossServerWin.cs | 11
System/HazyRegion.meta | 4
Fight/Stage/StageLoadProcessor.cs | 7
System/HazyRegion/HazyRegionModel.cs | 524 +++++
Core/NetworkPackage/ServerPack/HA3_Function/HA307_tagMCFairyAdventuresInfo.cs.meta | 12
System/HazyRegion/HazyRegionDialogueWin.cs | 151 +
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA307_tagMCFairyAdventuresInfo.cs | 25
System/Dungeon/DungeonReturnBloodBehaviour.cs.meta | 12
System/HazyRegion/HazyDemonKingDungeonWin.cs | 223 ++
System/HazyRegion/ClientHazyGrassStage.cs | 166 +
Core/GameEngine/Model/TelPartialConfig/PartialAdventureDialogueConfig.cs | 23
Core/ResModule/ScriptableObjectLoader.cs | 30
System/DailyQuest/DailyQuestData.cs | 7
Fight/Actor/Status/Status_Base.cs | 5
System/HazyRegion/HazyRegionWin.cs.meta | 12
Core/NetworkPackage/ServerPack/HA3_Function/HA307_tagMCFairyAdventuresInfo.cs | 31
Core/NetworkPackage/ServerPack/HB2_ActionMap/HB214_tagMCCuntomFBPrizeInfo.cs.meta | 12
Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB214_tagMCCuntomFBPrizeInfo.cs | 25
Core/NetworkPackage/ServerPack/HA3_Function/HA306_tagMCFairyDomainInfo.cs | 35
Fight/MapTransferUtility.cs | 10
System/MainInterfacePanel/MainInterfaceWin.cs | 4
Fight/Actor/Status/StatusMgr.cs | 6
System/DailyQuest/DailyQuestWin.cs | 4
System/HazyRegion/DungeonAdventureVictoryWin.cs | 136 +
Fight/Actor/UserInputHandler.cs | 3
Utility/EnumHelper.cs | 4
Fight/Actor/Skill/AttackHandler.cs | 5
System/HazyRegion/ClientHazyDemonKingStage.cs.meta | 12
Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA233_tagCMClientExitCustomScene.cs | 16
System/HazyRegion/ClientHazyGrassStage.cs.meta | 12
System/HazyRegion/HazyRegionEntrancePanel.cs | 197 ++
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA525_tagCMBuyDailyActionCnt.cs.meta | 12
Fight/GameActor/GA_NpcClientFunc.cs | 4
System/HazyRegion/HazyDemonKingPlayerBehaviour.cs.meta | 12
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA525_tagCMBuyDailyActionCnt.cs | 20
System/Dungeon/DungeonTargetBehaviour.cs | 55
Core/GameEngine/Model/Config/HazyRegionConfig.cs | 242 ++
Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA233_tagCMClientExitCustomScene.cs.meta | 12
System/EquipStar/EquipStarWin.cs | 2
System/WindowBase/WindowCenter.cs | 3
System/HazyRegion/HazyRegionWin.cs | 220 ++
System/HazyRegion/HazyRegionIncidentBehaviour.cs | 149 +
Core/NetworkPackage/ClientPack/ClientToMapServer/CB1_ActionMap/CB108_tagCMRefreshCustomFBPrize.cs.meta | 12
Core/GameEngine/Model/Config/AdventureDialogueConfig.cs | 219 ++
Fight/Actor/Skill/Skill.cs | 1
Fight/Actor/State/SMB/SMB_Base.cs | 3
Fight/Stage/Dungeon/DungeonStage.cs | 12
System/HazyRegion/HazyGrassDungeonWin.cs.meta | 12
System/HazyRegion/HazyGrassModel.cs | 149 +
System/OpenServerActivity/RewardInformation.cs | 2
System/HazyRegion/HazyRegionIncidentBehaviour.cs.meta | 12
System/HazyRegion/HazyMapNpcScriptableObject.cs | 100 +
System/HazyRegion/HazyAdventureHintWin.cs.meta | 12
Core/NetworkPackage/ClientPack/ClientToMapServer/CB1_ActionMap/CB108_tagCMRefreshCustomFBPrize.cs | 20
Core/NetworkPackage/ServerPack/HA3_Function/HA315_tagMCDailyActionCnt.cs | 4
Fight/Actor/HeroBehaviour.cs | 1
System/HazyRegion/HazyMapNpcScriptableObject.cs.meta | 12
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA526_tagCMVisitFairyDomain.cs | 18
System/HazyRegion/HazyRegionIncidentPanel.cs.meta | 12
System/HazyRegion/HazyRegionCyclicScroll.cs | 77
System/HazyRegion/HazyRegionBuyTimesWin.cs.meta | 12
Core/GameEngine/DataToCtl/PackageRegedit.cs | 3
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA306_tagMCFairyDomainInfo.cs.meta | 12
Core/NetworkPackage/ClientPack/ClientToMapServer/CC1_CrossRealm/CC105_tagCMEnterCrossServer.cs | 2
Core/NetworkPackage/ClientPack/ClientToMapServer/CB1_ActionMap/CB109_tagCMGiveCustomFBPrize.cs.meta | 12
System/HazyRegion/HazyAdventureHintWin.cs | 84
System/HazyRegion/HazyDemonKingModel.cs.meta | 12
Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB214_tagMCCuntomFBPrizeInfo.cs.meta | 12
Utility/ConfigInitiator.cs | 4
Core/GameEngine/Model/Config/HazyRegionConfig.cs.meta | 12
System/HazyRegion/HazyDemonKingPlayerBehaviour.cs | 207 ++
System/HazyRegion/HazyDemonKingVictoryWin.cs.meta | 12
Core/NetworkPackage/ServerPack/HA3_Function/HA306_tagMCFairyDomainInfo.cs.meta | 12
Utility/ComponentExtersion.cs | 18
Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA231_tagCMClientStartCustomScene.cs | 8
Fight/Stage/Dungeon/AdventureStage.cs.meta | 12
System/Dungeon/DungeonReturnBloodBehaviour.cs | 24
System/HazyRegion/HazyRegionBuyTimesWin.cs | 222 ++
System/HazyRegion/HazyRegionEntrancePanel.cs.meta | 12
System/HazyRegion/HazyRegionIncidentPanel.cs | 179 +
Core/GameEngine/Model/Config/AdventureDialogueConfig.cs.meta | 12
System/HazyRegion/HazyGrassDungeonWin.cs | 95 +
System/HazyRegion/HazyRegionDialogueWin.cs.meta | 12
System/HazyRegion/HazyRegionModel.cs.meta | 12
Core/GameEngine/Model/Config/DailyQuestOpenTimeConfig.cs | 70
Fight/Actor/State/SMB/STM_BaseAttack.cs | 1
Fight/Stage/Dungeon/ClientDungeonStageUtility.cs | 43
System/Activity/ActivityModel.cs | 18
Core/GameEngine/Model/Config/DailyQuestOpenTimeConfig.cs.meta | 2
System/HazyRegion/HazyDemonKingVictoryWin.cs | 194 ++
System/Dungeon/DungeonModel.cs | 25
Core/NetworkPackage/ClientPack/ClientToMapServer/CB1_ActionMap/CB109_tagCMGiveCustomFBPrize.cs | 20
System/Dungeon/DungeonData.cs | 2
System/HazyRegion/ClientHazyDemonKingStage.cs | 315 +++
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA307_tagMCFairyAdventuresInfo.cs.meta | 12
Core/NetworkPackage/ServerPack/HB2_ActionMap/HB214_tagMCCuntomFBPrizeInfo.cs | 23
System/DailyQuest/DailyQuestModel.cs | 75
System/HazyRegion/HazyGrassModel.cs.meta | 12
System/HazyRegion/HazyDemonKingDungeonWin.cs.meta | 12
/dev/null | 9
System/HazyRegion/DungeonAdventureVictoryWin.cs.meta | 12
System/HazyRegion/HazyRegionCyclicScroll.cs.meta | 12
System/HazyRegion/HazyDemonKingModel.cs | 258 ++
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA526_tagCMVisitFairyDomain.cs.meta | 12
System/Dungeon/DungeonFightWin.cs | 22
System/WindowBase/ModelCenter.cs | 3
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA306_tagMCFairyDomainInfo.cs | 26
109 files changed, 5,340 insertions(+), 92 deletions(-)
diff --git a/Core/GameEngine/DataToCtl/PackageRegedit.cs b/Core/GameEngine/DataToCtl/PackageRegedit.cs
index 0affa68..0064894 100644
--- a/Core/GameEngine/DataToCtl/PackageRegedit.cs
+++ b/Core/GameEngine/DataToCtl/PackageRegedit.cs
@@ -25,6 +25,9 @@
public static void Init()
{
// 鐧昏鐩稿簲鐨勬暟鎹綋鍙婂搴旂殑鏁版嵁杞�昏緫绫�
+ Register(typeof(HB214_tagMCCuntomFBPrizeInfo), typeof(DTCB214_tagMCCuntomFBPrizeInfo));
+ Register(typeof(HA307_tagMCFairyAdventuresInfo), typeof(DTCA307_tagMCFairyAdventuresInfo));
+ Register(typeof(HA306_tagMCFairyDomainInfo), typeof(DTCA306_tagMCFairyDomainInfo));
Register(typeof(HB107_tagMCRolePointInfo), typeof(DTCB107_tagMCRolePointInfo));
Register(typeof(HA327_tagMCRealmExpInfo), typeof(DTCA327_tagMCRealmExpInfo));
Register(typeof(HA40C_tagGCAllFamilyBossInfo), typeof(DTCA40C_tagGCAllFamilyBossInfo));
diff --git a/Core/GameEngine/Model/Config/AdventureDialogueConfig.cs b/Core/GameEngine/Model/Config/AdventureDialogueConfig.cs
new file mode 100644
index 0000000..467955b
--- /dev/null
+++ b/Core/GameEngine/Model/Config/AdventureDialogueConfig.cs
@@ -0,0 +1,219 @@
+锘�//--------------------------------------------------------
+// [Author]: Fish
+// [ Date ]: Tuesday, April 09, 2019
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System.IO;
+using System.Threading;
+using System;
+using UnityEngine;
+
+[XLua.LuaCallCSharp]
+public partial class AdventureDialogueConfig
+{
+
+ public readonly int id;
+ public readonly int type;
+ public readonly int gear;
+ public readonly int npcId;
+ public readonly string[] dialogues;
+ public readonly int[] speakType;
+
+ public AdventureDialogueConfig()
+ {
+ }
+
+ public AdventureDialogueConfig(string input)
+ {
+ try
+ {
+ var tables = input.Split('\t');
+
+ int.TryParse(tables[0],out id);
+
+ int.TryParse(tables[1],out type);
+
+ int.TryParse(tables[2],out gear);
+
+ int.TryParse(tables[3],out npcId);
+
+ dialogues = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+
+ string[] speakTypeStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ speakType = new int[speakTypeStringArray.Length];
+ for (int i=0;i<speakTypeStringArray.Length;i++)
+ {
+ int.TryParse(speakTypeStringArray[i],out speakType[i]);
+ }
+ }
+ catch (Exception ex)
+ {
+ DebugEx.Log(ex);
+ }
+ }
+
+ static Dictionary<string, AdventureDialogueConfig> configs = new Dictionary<string, AdventureDialogueConfig>();
+ public static AdventureDialogueConfig Get(string id)
+ {
+ if (!inited)
+ {
+ Debug.Log("AdventureDialogueConfig 杩樻湭瀹屾垚鍒濆鍖栥��");
+ return null;
+ }
+
+ if (configs.ContainsKey(id))
+ {
+ return configs[id];
+ }
+
+ AdventureDialogueConfig config = null;
+ if (rawDatas.ContainsKey(id))
+ {
+ config = configs[id] = new AdventureDialogueConfig(rawDatas[id]);
+ rawDatas.Remove(id);
+ }
+
+ return config;
+ }
+
+ public static AdventureDialogueConfig Get(int id)
+ {
+ return Get(id.ToString());
+ }
+
+ public static List<string> GetKeys()
+ {
+ var keys = new List<string>();
+ keys.AddRange(configs.Keys);
+ keys.AddRange(rawDatas.Keys);
+ return keys;
+ }
+
+ public static List<AdventureDialogueConfig> GetValues()
+ {
+ var values = new List<AdventureDialogueConfig>();
+ values.AddRange(configs.Values);
+
+ var keys = new List<string>(rawDatas.Keys);
+ foreach (var key in keys)
+ {
+ values.Add(Get(key));
+ }
+
+ return values;
+ }
+
+ public static bool Has(string id)
+ {
+ return configs.ContainsKey(id) || rawDatas.ContainsKey(id);
+ }
+
+ public static bool Has(int id)
+ {
+ return Has(id.ToString());
+ }
+
+ public static bool inited { get; private set; }
+ protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>();
+ public static void Init(bool sync=false)
+ {
+ inited = false;
+ var path = string.Empty;
+ if (AssetSource.refdataFromEditor)
+ {
+ path = ResourcesPath.CONFIG_FODLER +"/AdventureDialogue.txt";
+ }
+ else
+ {
+ path = AssetVersionUtility.GetAssetFilePath("config/AdventureDialogue.txt");
+ }
+
+ var tempConfig = new AdventureDialogueConfig();
+ var preParse = tempConfig is IConfigPostProcess;
+
+ if (sync)
+ {
+ var lines = File.ReadAllLines(path);
+ if (!preParse)
+ {
+ rawDatas = new Dictionary<string, string>(lines.Length - 3);
+ }
+ for (int i = 3; i < lines.Length; i++)
+ {
+ try
+ {
+ var line = lines[i];
+ var index = line.IndexOf("\t");
+ if (index == -1)
+ {
+ continue;
+ }
+ var id = line.Substring(0, index);
+
+ if (preParse)
+ {
+ var config = new AdventureDialogueConfig(line);
+ configs[id] = config;
+ (config as IConfigPostProcess).OnConfigParseCompleted();
+ }
+ else
+ {
+ rawDatas[id] = line;
+ }
+ }
+ catch (System.Exception ex)
+ {
+ Debug.LogError(ex);
+ }
+ }
+ inited = true;
+ }
+ else
+ {
+ ThreadPool.QueueUserWorkItem((object _object) =>
+ {
+ var lines = File.ReadAllLines(path);
+ if (!preParse)
+ {
+ rawDatas = new Dictionary<string, string>(lines.Length - 3);
+ }
+ for (int i = 3; i < lines.Length; i++)
+ {
+ try
+ {
+ var line = lines[i];
+ var index = line.IndexOf("\t");
+ if (index == -1)
+ {
+ continue;
+ }
+ var id = line.Substring(0, index);
+
+ if (preParse)
+ {
+ var config = new AdventureDialogueConfig(line);
+ configs[id] = config;
+ (config as IConfigPostProcess).OnConfigParseCompleted();
+ }
+ else
+ {
+ rawDatas[id] = line;
+ }
+ }
+ catch (System.Exception ex)
+ {
+ Debug.LogError(ex);
+ }
+ }
+
+ inited = true;
+ });
+ }
+ }
+
+}
+
+
+
+
diff --git a/Core/GameEngine/Model/Config/AdventureDialogueConfig.cs.meta b/Core/GameEngine/Model/Config/AdventureDialogueConfig.cs.meta
new file mode 100644
index 0000000..1c3b017
--- /dev/null
+++ b/Core/GameEngine/Model/Config/AdventureDialogueConfig.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 4bb7f23bbb7b6ad42b314de10a7abc1b
+timeCreated: 1554788345
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/GameEngine/Model/Config/DailyQuestOpenTimeConfig.cs b/Core/GameEngine/Model/Config/DailyQuestOpenTimeConfig.cs
index 47cad80..483020b 100644
--- a/Core/GameEngine/Model/Config/DailyQuestOpenTimeConfig.cs
+++ b/Core/GameEngine/Model/Config/DailyQuestOpenTimeConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: Fish
-// [ Date ]: Thursday, February 14, 2019
+// [ Date ]: Monday, April 08, 2019
//--------------------------------------------------------
using System.Collections.Generic;
@@ -13,15 +13,19 @@
public partial class DailyQuestOpenTimeConfig
{
- public readonly int ID;
- public readonly string ActionName;
- public readonly int OpenServerDay;
- public readonly string OpenTime;
- public readonly int Duration;
- public readonly int DayTimes;
- public readonly int DayReKind;
- public readonly int WeekTimes;
- public readonly int WeekReKind;
+ public readonly int ID;
+ public readonly string ActionName;
+ public readonly int OpenServerDay;
+ public readonly string OpenTime;
+ public readonly int Duration;
+ public readonly int DayTimes;
+ public readonly int DayBuyTimes;
+ public readonly int BuyNeedMoney;
+ public readonly int DayItemAddTimes;
+ public readonly int DayItemID;
+ public readonly int DayReKind;
+ public readonly int WeekTimes;
+ public readonly int WeekReKind;
public readonly int OpenUI;
public DailyQuestOpenTimeConfig()
@@ -34,25 +38,33 @@
{
var tables = input.Split('\t');
- int.TryParse(tables[0],out ID);
-
- ActionName = tables[1];
-
- int.TryParse(tables[2],out OpenServerDay);
-
- OpenTime = tables[3];
-
- int.TryParse(tables[4],out Duration);
-
- int.TryParse(tables[5],out DayTimes);
-
- int.TryParse(tables[6],out DayReKind);
-
- int.TryParse(tables[7],out WeekTimes);
-
- int.TryParse(tables[8],out WeekReKind);
-
- int.TryParse(tables[9],out OpenUI);
+ int.TryParse(tables[0],out ID);
+
+ ActionName = tables[1];
+
+ int.TryParse(tables[2],out OpenServerDay);
+
+ OpenTime = tables[3];
+
+ int.TryParse(tables[4],out Duration);
+
+ int.TryParse(tables[5],out DayTimes);
+
+ int.TryParse(tables[6],out DayBuyTimes);
+
+ int.TryParse(tables[7],out BuyNeedMoney);
+
+ int.TryParse(tables[8],out DayItemAddTimes);
+
+ int.TryParse(tables[9],out DayItemID);
+
+ int.TryParse(tables[10],out DayReKind);
+
+ int.TryParse(tables[11],out WeekTimes);
+
+ int.TryParse(tables[12],out WeekReKind);
+
+ int.TryParse(tables[13],out OpenUI);
}
catch (Exception ex)
{
diff --git a/Core/GameEngine/Model/Config/DailyQuestOpenTimeConfig.cs.meta b/Core/GameEngine/Model/Config/DailyQuestOpenTimeConfig.cs.meta
index 551f257..37ed6fe 100644
--- a/Core/GameEngine/Model/Config/DailyQuestOpenTimeConfig.cs.meta
+++ b/Core/GameEngine/Model/Config/DailyQuestOpenTimeConfig.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: c6f0b6d546225e442839089494e039bc
-timeCreated: 1550121862
+timeCreated: 1554704148
licenseType: Pro
MonoImporter:
serializedVersion: 2
diff --git a/Core/GameEngine/Model/Config/HazyRegionConfig.cs b/Core/GameEngine/Model/Config/HazyRegionConfig.cs
new file mode 100644
index 0000000..ca3748e
--- /dev/null
+++ b/Core/GameEngine/Model/Config/HazyRegionConfig.cs
@@ -0,0 +1,242 @@
+锘�//--------------------------------------------------------
+// [Author]: Fish
+// [ Date ]: Monday, April 08, 2019
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System.IO;
+using System.Threading;
+using System;
+using UnityEngine;
+
+[XLua.LuaCallCSharp]
+public partial class HazyRegionConfig
+{
+
+ public readonly int id;
+ public readonly int incidentType;
+ public readonly string name;
+ public readonly int dungeonId;
+ public readonly int lineId;
+ public readonly int npcId;
+ public readonly int crossServer;
+ public readonly int point;
+ public readonly int alchemyLevel;
+ public readonly int[] reward;
+ public readonly int[] rewardState;
+ public readonly string PortraitID;
+
+ public HazyRegionConfig()
+ {
+ }
+
+ public HazyRegionConfig(string input)
+ {
+ try
+ {
+ var tables = input.Split('\t');
+
+ int.TryParse(tables[0],out id);
+
+ int.TryParse(tables[1],out incidentType);
+
+ name = tables[2];
+
+ int.TryParse(tables[3],out dungeonId);
+
+ int.TryParse(tables[4],out lineId);
+
+ int.TryParse(tables[5],out npcId);
+
+ int.TryParse(tables[6],out crossServer);
+
+ int.TryParse(tables[7],out point);
+
+ int.TryParse(tables[8],out alchemyLevel);
+
+ string[] rewardStringArray = tables[9].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ reward = new int[rewardStringArray.Length];
+ for (int i=0;i<rewardStringArray.Length;i++)
+ {
+ int.TryParse(rewardStringArray[i],out reward[i]);
+ }
+
+ string[] rewardStateStringArray = tables[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ rewardState = new int[rewardStateStringArray.Length];
+ for (int i=0;i<rewardStateStringArray.Length;i++)
+ {
+ int.TryParse(rewardStateStringArray[i],out rewardState[i]);
+ }
+
+ PortraitID = tables[11];
+ }
+ catch (Exception ex)
+ {
+ DebugEx.Log(ex);
+ }
+ }
+
+ static Dictionary<string, HazyRegionConfig> configs = new Dictionary<string, HazyRegionConfig>();
+ public static HazyRegionConfig Get(string id)
+ {
+ if (!inited)
+ {
+ Debug.Log("HazyRegionConfig 杩樻湭瀹屾垚鍒濆鍖栥��");
+ return null;
+ }
+
+ if (configs.ContainsKey(id))
+ {
+ return configs[id];
+ }
+
+ HazyRegionConfig config = null;
+ if (rawDatas.ContainsKey(id))
+ {
+ config = configs[id] = new HazyRegionConfig(rawDatas[id]);
+ rawDatas.Remove(id);
+ }
+
+ return config;
+ }
+
+ public static HazyRegionConfig Get(int id)
+ {
+ return Get(id.ToString());
+ }
+
+ public static List<string> GetKeys()
+ {
+ var keys = new List<string>();
+ keys.AddRange(configs.Keys);
+ keys.AddRange(rawDatas.Keys);
+ return keys;
+ }
+
+ public static List<HazyRegionConfig> GetValues()
+ {
+ var values = new List<HazyRegionConfig>();
+ values.AddRange(configs.Values);
+
+ var keys = new List<string>(rawDatas.Keys);
+ foreach (var key in keys)
+ {
+ values.Add(Get(key));
+ }
+
+ return values;
+ }
+
+ public static bool Has(string id)
+ {
+ return configs.ContainsKey(id) || rawDatas.ContainsKey(id);
+ }
+
+ public static bool Has(int id)
+ {
+ return Has(id.ToString());
+ }
+
+ public static bool inited { get; private set; }
+ protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>();
+ public static void Init(bool sync=false)
+ {
+ inited = false;
+ var path = string.Empty;
+ if (AssetSource.refdataFromEditor)
+ {
+ path = ResourcesPath.CONFIG_FODLER +"/HazyRegion.txt";
+ }
+ else
+ {
+ path = AssetVersionUtility.GetAssetFilePath("config/HazyRegion.txt");
+ }
+
+ var tempConfig = new HazyRegionConfig();
+ var preParse = tempConfig is IConfigPostProcess;
+
+ if (sync)
+ {
+ var lines = File.ReadAllLines(path);
+ if (!preParse)
+ {
+ rawDatas = new Dictionary<string, string>(lines.Length - 3);
+ }
+ for (int i = 3; i < lines.Length; i++)
+ {
+ try
+ {
+ var line = lines[i];
+ var index = line.IndexOf("\t");
+ if (index == -1)
+ {
+ continue;
+ }
+ var id = line.Substring(0, index);
+
+ if (preParse)
+ {
+ var config = new HazyRegionConfig(line);
+ configs[id] = config;
+ (config as IConfigPostProcess).OnConfigParseCompleted();
+ }
+ else
+ {
+ rawDatas[id] = line;
+ }
+ }
+ catch (System.Exception ex)
+ {
+ Debug.LogError(ex);
+ }
+ }
+ inited = true;
+ }
+ else
+ {
+ ThreadPool.QueueUserWorkItem((object _object) =>
+ {
+ var lines = File.ReadAllLines(path);
+ if (!preParse)
+ {
+ rawDatas = new Dictionary<string, string>(lines.Length - 3);
+ }
+ for (int i = 3; i < lines.Length; i++)
+ {
+ try
+ {
+ var line = lines[i];
+ var index = line.IndexOf("\t");
+ if (index == -1)
+ {
+ continue;
+ }
+ var id = line.Substring(0, index);
+
+ if (preParse)
+ {
+ var config = new HazyRegionConfig(line);
+ configs[id] = config;
+ (config as IConfigPostProcess).OnConfigParseCompleted();
+ }
+ else
+ {
+ rawDatas[id] = line;
+ }
+ }
+ catch (System.Exception ex)
+ {
+ Debug.LogError(ex);
+ }
+ }
+
+ inited = true;
+ });
+ }
+ }
+
+}
+
+
+
+
diff --git a/Core/GameEngine/Model/Config/HazyRegionConfig.cs.meta b/Core/GameEngine/Model/Config/HazyRegionConfig.cs.meta
new file mode 100644
index 0000000..34ed884
--- /dev/null
+++ b/Core/GameEngine/Model/Config/HazyRegionConfig.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 3404c0f308cb2174bb7b93e12c3110bd
+timeCreated: 1554713166
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/GameEngine/Model/TelPartialConfig/PartialAdventureDialogueConfig.cs b/Core/GameEngine/Model/TelPartialConfig/PartialAdventureDialogueConfig.cs
new file mode 100644
index 0000000..906be99
--- /dev/null
+++ b/Core/GameEngine/Model/TelPartialConfig/PartialAdventureDialogueConfig.cs
@@ -0,0 +1,23 @@
+锘縰sing System;
+using System.Collections.Generic;
+
+public partial class AdventureDialogueConfig : IConfigPostProcess
+{
+ static Dictionary<int, AdventureDialogueConfig> adventureDialogues = new Dictionary<int, AdventureDialogueConfig>();
+
+ public void OnConfigParseCompleted()
+ {
+ var key = type * 1000 + gear;
+ adventureDialogues.Add(key, this);
+ }
+
+ public static AdventureDialogueConfig Get(int type, int gear)
+ {
+ var key = type * 1000 + gear;
+ if (adventureDialogues.ContainsKey(key))
+ {
+ return adventureDialogues[key];
+ }
+ return null;
+ }
+}
diff --git a/Core/GameEngine/Model/TelPartialConfig/PartialAdventureDialogueConfig.cs.meta b/Core/GameEngine/Model/TelPartialConfig/PartialAdventureDialogueConfig.cs.meta
new file mode 100644
index 0000000..b7a5580
--- /dev/null
+++ b/Core/GameEngine/Model/TelPartialConfig/PartialAdventureDialogueConfig.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 2d9e840934f98914f8271a7229baad8b
+timeCreated: 1554789684
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA231_tagCMClientStartCustomScene.cs b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA231_tagCMClientStartCustomScene.cs
index 82f46b0..3eab4a0 100644
--- a/Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA231_tagCMClientStartCustomScene.cs
+++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA231_tagCMClientStartCustomScene.cs
@@ -5,6 +5,10 @@
public class CA231_tagCMClientStartCustomScene : GameNetPackBasic
{
+ public uint MapID;
+ public ushort FuncLineID;
+
+
public CA231_tagCMClientStartCustomScene()
{
@@ -13,7 +17,9 @@
}
public override void WriteToBytes()
- {
+ {
+ WriteBytes(MapID, NetDataType.DWORD);
+ WriteBytes(FuncLineID, NetDataType.WORD);
}
}
\ No newline at end of file
diff --git a/Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA233_tagCMClientExitCustomScene.cs b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA233_tagCMClientExitCustomScene.cs
new file mode 100644
index 0000000..d45474b
--- /dev/null
+++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA233_tagCMClientExitCustomScene.cs
@@ -0,0 +1,16 @@
+using UnityEngine;
+using System.Collections;
+
+// A2 33 前端退出自定义场景 #tagCMClientExitCustomScene
+
+public class CA233_tagCMClientExitCustomScene : GameNetPackBasic {
+
+ public CA233_tagCMClientExitCustomScene () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xA233;
+ }
+
+ public override void WriteToBytes () {
+ }
+
+}
diff --git a/Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA233_tagCMClientExitCustomScene.cs.meta b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA233_tagCMClientExitCustomScene.cs.meta
new file mode 100644
index 0000000..020b8f2
--- /dev/null
+++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA233_tagCMClientExitCustomScene.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: f040e374599a6384bacdea70b3860c14
+timeCreated: 1555060344
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA525_tagCMBuyDailyActionCnt.cs b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA525_tagCMBuyDailyActionCnt.cs
new file mode 100644
index 0000000..b860e39
--- /dev/null
+++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA525_tagCMBuyDailyActionCnt.cs
@@ -0,0 +1,20 @@
+using UnityEngine;
+using System.Collections;
+
+// A5 25 购买日常活动次数 #tagCMBuyDailyActionCnt
+
+public class CA525_tagCMBuyDailyActionCnt : GameNetPackBasic {
+ public uint ActionID; // ID
+ public byte AddType; // 0-花仙玉 1-用物品
+
+ public CA525_tagCMBuyDailyActionCnt () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xA525;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (ActionID, NetDataType.DWORD);
+ WriteBytes (AddType, NetDataType.BYTE);
+ }
+
+}
diff --git a/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA525_tagCMBuyDailyActionCnt.cs.meta b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA525_tagCMBuyDailyActionCnt.cs.meta
new file mode 100644
index 0000000..37c3cde
--- /dev/null
+++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA525_tagCMBuyDailyActionCnt.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 5abd0a346af49774db312d49c39a4004
+timeCreated: 1554708856
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA526_tagCMVisitFairyDomain.cs b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA526_tagCMVisitFairyDomain.cs
new file mode 100644
index 0000000..07a0ee3
--- /dev/null
+++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA526_tagCMVisitFairyDomain.cs
@@ -0,0 +1,18 @@
+using UnityEngine;
+using System.Collections;
+
+// A5 26 寻访仙域 #tagCMVisitFairyDomain
+
+public class CA526_tagCMVisitFairyDomain : GameNetPackBasic {
+ public byte Type; //0-开始寻访 1-结束寻访
+
+ public CA526_tagCMVisitFairyDomain () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xA526;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (Type, NetDataType.BYTE);
+ }
+
+}
diff --git a/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA526_tagCMVisitFairyDomain.cs.meta b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA526_tagCMVisitFairyDomain.cs.meta
new file mode 100644
index 0000000..e6cc935
--- /dev/null
+++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA526_tagCMVisitFairyDomain.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: f13a5e03498d69c448f40987085005ef
+timeCreated: 1554708856
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/ClientPack/ClientToMapServer/CB1_ActionMap/CB108_tagCMRefreshCustomFBPrize.cs b/Core/NetworkPackage/ClientPack/ClientToMapServer/CB1_ActionMap/CB108_tagCMRefreshCustomFBPrize.cs
new file mode 100644
index 0000000..c8db1e5
--- /dev/null
+++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CB1_ActionMap/CB108_tagCMRefreshCustomFBPrize.cs
@@ -0,0 +1,20 @@
+using UnityEngine;
+using System.Collections;
+
+// B1 08 刷新自定义副本奖励 #tagCMRefreshCustomFBPrize
+
+public class CB108_tagCMRefreshCustomFBPrize : GameNetPackBasic {
+ public uint MapID;
+ public ushort FuncLineID;
+
+ public CB108_tagCMRefreshCustomFBPrize () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xB108;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (MapID, NetDataType.DWORD);
+ WriteBytes (FuncLineID, NetDataType.WORD);
+ }
+
+}
diff --git a/Core/NetworkPackage/ClientPack/ClientToMapServer/CB1_ActionMap/CB108_tagCMRefreshCustomFBPrize.cs.meta b/Core/NetworkPackage/ClientPack/ClientToMapServer/CB1_ActionMap/CB108_tagCMRefreshCustomFBPrize.cs.meta
new file mode 100644
index 0000000..a481ad3
--- /dev/null
+++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CB1_ActionMap/CB108_tagCMRefreshCustomFBPrize.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 82b61f8b44b0c6f459ef79578d4357af
+timeCreated: 1555060380
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/ClientPack/ClientToMapServer/CB1_ActionMap/CB109_tagCMGiveCustomFBPrize.cs b/Core/NetworkPackage/ClientPack/ClientToMapServer/CB1_ActionMap/CB109_tagCMGiveCustomFBPrize.cs
new file mode 100644
index 0000000..5c8ed81
--- /dev/null
+++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CB1_ActionMap/CB109_tagCMGiveCustomFBPrize.cs
@@ -0,0 +1,20 @@
+using UnityEngine;
+using System.Collections;
+
+// B1 09 结算自定义副本奖励 #tagCMGiveCustomFBPrize
+
+public class CB109_tagCMGiveCustomFBPrize : GameNetPackBasic {
+ public uint MapID;
+ public ushort FuncLineID;
+
+ public CB109_tagCMGiveCustomFBPrize () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xB109;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (MapID, NetDataType.DWORD);
+ WriteBytes (FuncLineID, NetDataType.WORD);
+ }
+
+}
diff --git a/Core/NetworkPackage/ClientPack/ClientToMapServer/CB1_ActionMap/CB109_tagCMGiveCustomFBPrize.cs.meta b/Core/NetworkPackage/ClientPack/ClientToMapServer/CB1_ActionMap/CB109_tagCMGiveCustomFBPrize.cs.meta
new file mode 100644
index 0000000..0d2c468
--- /dev/null
+++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CB1_ActionMap/CB109_tagCMGiveCustomFBPrize.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: d4215fa17ed261e4a866238b783b4822
+timeCreated: 1555060380
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/ClientPack/ClientToMapServer/CC1_CrossRealm/CC105_tagCMEnterCrossServer.cs b/Core/NetworkPackage/ClientPack/ClientToMapServer/CC1_CrossRealm/CC105_tagCMEnterCrossServer.cs
index dbef5e2..0a7de27 100644
--- a/Core/NetworkPackage/ClientPack/ClientToMapServer/CC1_CrossRealm/CC105_tagCMEnterCrossServer.cs
+++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CC1_CrossRealm/CC105_tagCMEnterCrossServer.cs
@@ -6,6 +6,7 @@
public class CC105_tagCMEnterCrossServer : GameNetPackBasic
{
public uint DataMapID;
+ public ushort LineID;
public CC105_tagCMEnterCrossServer()
{
@@ -16,6 +17,7 @@
public override void WriteToBytes()
{
WriteBytes(DataMapID, NetDataType.DWORD);
+ WriteBytes(LineID, NetDataType.WORD);
}
}
\ No newline at end of file
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA306_tagMCFairyDomainInfo.cs b/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA306_tagMCFairyDomainInfo.cs
new file mode 100644
index 0000000..cd7a699
--- /dev/null
+++ b/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA306_tagMCFairyDomainInfo.cs
@@ -0,0 +1,26 @@
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Monday, April 08, 2019
+//--------------------------------------------------------
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using Snxxz.UI;
+public class DTCA306_tagMCFairyDomainInfo : DtcBasic
+{
+
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ var package = vNetPack as HA306_tagMCFairyDomainInfo;
+
+ ModelCenter.Instance.GetModel<HazyRegionModel>().ReceivePackage(package);
+
+ }
+
+}
+
+
+
+
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA306_tagMCFairyDomainInfo.cs.meta b/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA306_tagMCFairyDomainInfo.cs.meta
new file mode 100644
index 0000000..2922f19
--- /dev/null
+++ b/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA306_tagMCFairyDomainInfo.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: f2900c8af146e174eb09138dbb65c67d
+timeCreated: 1554708793
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA307_tagMCFairyAdventuresInfo.cs b/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA307_tagMCFairyAdventuresInfo.cs
new file mode 100644
index 0000000..5e1e391
--- /dev/null
+++ b/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA307_tagMCFairyAdventuresInfo.cs
@@ -0,0 +1,25 @@
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Tuesday, April 09, 2019
+//--------------------------------------------------------
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using Snxxz.UI;
+public class DTCA307_tagMCFairyAdventuresInfo : DtcBasic
+{
+
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ var package = vNetPack as HA307_tagMCFairyAdventuresInfo;
+
+ ModelCenter.Instance.GetModel<HazyRegionModel>().ReceivePackage(package);
+ }
+
+}
+
+
+
+
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA307_tagMCFairyAdventuresInfo.cs.meta b/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA307_tagMCFairyAdventuresInfo.cs.meta
new file mode 100644
index 0000000..04ae111
--- /dev/null
+++ b/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA307_tagMCFairyAdventuresInfo.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 26f2b0ac048588a4ca60fef985c49252
+timeCreated: 1554788566
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HAD_SaleActivity.meta b/Core/NetworkPackage/DTCFile/ServerPack/HAD_SaleActivity.meta
deleted file mode 100644
index 56e5988..0000000
--- a/Core/NetworkPackage/DTCFile/ServerPack/HAD_SaleActivity.meta
+++ /dev/null
@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: 3e05761d690b75440a6be79207d0fb01
-folderAsset: yes
-timeCreated: 1547643019
-licenseType: Pro
-DefaultImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HAE_Truck.meta b/Core/NetworkPackage/DTCFile/ServerPack/HAE_Truck.meta
deleted file mode 100644
index 1044caa..0000000
--- a/Core/NetworkPackage/DTCFile/ServerPack/HAE_Truck.meta
+++ /dev/null
@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: 1d70ccd06161e0443b7a802ad94292f8
-folderAsset: yes
-timeCreated: 1547643019
-licenseType: Pro
-DefaultImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event.meta b/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event.meta
deleted file mode 100644
index 6ed37c0..0000000
--- a/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event.meta
+++ /dev/null
@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: eed34091b0568664b9fb42f0634496c1
-folderAsset: yes
-timeCreated: 1547643019
-licenseType: Pro
-DefaultImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB214_tagMCCuntomFBPrizeInfo.cs b/Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB214_tagMCCuntomFBPrizeInfo.cs
new file mode 100644
index 0000000..9d9ab90
--- /dev/null
+++ b/Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB214_tagMCCuntomFBPrizeInfo.cs
@@ -0,0 +1,25 @@
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Friday, April 12, 2019
+//--------------------------------------------------------
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+public class DTCB214_tagMCCuntomFBPrizeInfo : DtcBasic
+{
+
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ var package = vNetPack as HB214_tagMCCuntomFBPrizeInfo;
+
+ ClientDungeonStageUtility.ReceiveCustomItems(package);
+ }
+
+}
+
+
+
+
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB214_tagMCCuntomFBPrizeInfo.cs.meta b/Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB214_tagMCCuntomFBPrizeInfo.cs.meta
new file mode 100644
index 0000000..923f6a6
--- /dev/null
+++ b/Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB214_tagMCCuntomFBPrizeInfo.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 2f01312eb80fad447b59dc1ffac96129
+timeCreated: 1555060570
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/ServerPack/HA3_Function/HA306_tagMCFairyDomainInfo.cs b/Core/NetworkPackage/ServerPack/HA3_Function/HA306_tagMCFairyDomainInfo.cs
new file mode 100644
index 0000000..0dd7479
--- /dev/null
+++ b/Core/NetworkPackage/ServerPack/HA3_Function/HA306_tagMCFairyDomainInfo.cs
@@ -0,0 +1,35 @@
+using UnityEngine;
+using System.Collections;
+
+// A3 06 缥缈仙域信息 #tagMCFairyDomainInfo
+
+public class HA306_tagMCFairyDomainInfo : GameNetPackBasic {
public byte IsAll; //是否全部
+ public byte State; //是否寻访中
+
+ public uint VisitCnt; //寻访次数
+ public ushort Energy; //体力
+ public byte Count; // 信息个数
+ public tagMCFairyDomainEvent[] InfoList; // 信息列表
+
+ public HA306_tagMCFairyDomainInfo () {
+ _cmd = (ushort)0xA306;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
TransBytes(out IsAll, vBytes, NetDataType.BYTE);
+ TransBytes (out State, vBytes, NetDataType.BYTE);
TransBytes(out VisitCnt, vBytes, NetDataType.DWORD);
+ TransBytes (out Energy, vBytes, NetDataType.WORD);
+ TransBytes (out Count, vBytes, NetDataType.BYTE);
+ InfoList = new tagMCFairyDomainEvent[Count];
+ for (int i = 0; i < Count; i ++) {
+ InfoList[i] = new tagMCFairyDomainEvent();
+ TransBytes (out InfoList[i].EventID, vBytes, NetDataType.WORD);
+ TransBytes (out InfoList[i].EventState, vBytes, NetDataType.BYTE);
+ }
+ }
+
+ public struct tagMCFairyDomainEvent {
+ public ushort EventID; //事件ID
+ public byte EventState; //事件状态 1-未拜访 2-拜访中 3-已拜访
+ }
+
+}
diff --git a/Core/NetworkPackage/ServerPack/HA3_Function/HA306_tagMCFairyDomainInfo.cs.meta b/Core/NetworkPackage/ServerPack/HA3_Function/HA306_tagMCFairyDomainInfo.cs.meta
new file mode 100644
index 0000000..d621396
--- /dev/null
+++ b/Core/NetworkPackage/ServerPack/HA3_Function/HA306_tagMCFairyDomainInfo.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: a1dec766a8bd13348b98571a82ce0ea2
+timeCreated: 1554708767
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/ServerPack/HA3_Function/HA307_tagMCFairyAdventuresInfo.cs b/Core/NetworkPackage/ServerPack/HA3_Function/HA307_tagMCFairyAdventuresInfo.cs
new file mode 100644
index 0000000..fc2535e
--- /dev/null
+++ b/Core/NetworkPackage/ServerPack/HA3_Function/HA307_tagMCFairyAdventuresInfo.cs
@@ -0,0 +1,31 @@
+using UnityEngine;
+using System.Collections;
+
+// A3 07 缥缈奇遇信息 #tagMCFairyAdventuresInfo
+
+public class HA307_tagMCFairyAdventuresInfo : GameNetPackBasic {
+ public byte Cnt;
+ public tagMCFairyAdventuresData[] InfoList; // 信息
+
+ public HA307_tagMCFairyAdventuresInfo () {
+ _cmd = (ushort)0xA307;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out Cnt, vBytes, NetDataType.BYTE);
+ InfoList = new tagMCFairyAdventuresData[Cnt];
+ for (int i = 0; i < Cnt; i ++) {
+ InfoList[i] = new tagMCFairyAdventuresData();
+ TransBytes (out InfoList[i].EventID, vBytes, NetDataType.BYTE);
+ TransBytes (out InfoList[i].Gear, vBytes, NetDataType.BYTE);
+ TransBytes (out InfoList[i].Condition, vBytes, NetDataType.DWORD);
+ }
+ }
+
+ public struct tagMCFairyAdventuresData {
+ public byte EventID;
+ public byte Gear; //第几档
+ public uint Condition; //条件
+ }
+
+}
diff --git a/Core/NetworkPackage/ServerPack/HA3_Function/HA307_tagMCFairyAdventuresInfo.cs.meta b/Core/NetworkPackage/ServerPack/HA3_Function/HA307_tagMCFairyAdventuresInfo.cs.meta
new file mode 100644
index 0000000..3173229
--- /dev/null
+++ b/Core/NetworkPackage/ServerPack/HA3_Function/HA307_tagMCFairyAdventuresInfo.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 299918965692bc94e99b397fd4d3c61c
+timeCreated: 1554788525
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/ServerPack/HA3_Function/HA315_tagMCDailyActionCnt.cs b/Core/NetworkPackage/ServerPack/HA3_Function/HA315_tagMCDailyActionCnt.cs
index 1e84e09..a96f638 100644
--- a/Core/NetworkPackage/ServerPack/HA3_Function/HA315_tagMCDailyActionCnt.cs
+++ b/Core/NetworkPackage/ServerPack/HA3_Function/HA315_tagMCDailyActionCnt.cs
@@ -22,6 +22,8 @@
ActionInfo[i] = new tagMCDailyActionInfo();
TransBytes(out ActionInfo[i].ActionID, vBytes, NetDataType.DWORD);
TransBytes(out ActionInfo[i].DayFinishCnt, vBytes, NetDataType.WORD);
+ TransBytes(out ActionInfo[i].DayBuyTimes, vBytes, NetDataType.BYTE);
+ TransBytes(out ActionInfo[i].DayItemTimes, vBytes, NetDataType.BYTE);
TransBytes(out ActionInfo[i].WeekFinishCnt, vBytes, NetDataType.DWORD);
}
}
@@ -30,6 +32,8 @@
{
public uint ActionID; // ID
public ushort DayFinishCnt; // 浠婃棩宸插畬鎴愭鏁�
+ public byte DayBuyTimes; //浠婃棩璐拱娆℃暟
+ public byte DayItemTimes; //浠婃棩鐗╁搧澧炲姞娆℃暟
public uint WeekFinishCnt; // 鏈懆宸插畬鎴愭鏁�
}
diff --git a/Core/NetworkPackage/ServerPack/HAD_SaleActivity.meta b/Core/NetworkPackage/ServerPack/HAD_SaleActivity.meta
deleted file mode 100644
index 418ee88..0000000
--- a/Core/NetworkPackage/ServerPack/HAD_SaleActivity.meta
+++ /dev/null
@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: 32ceb8b7faf99f84a8b73ce53c5e3e4d
-folderAsset: yes
-timeCreated: 1547643019
-licenseType: Pro
-DefaultImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Core/NetworkPackage/ServerPack/HAE_Truck.meta b/Core/NetworkPackage/ServerPack/HAE_Truck.meta
deleted file mode 100644
index ea614a3..0000000
--- a/Core/NetworkPackage/ServerPack/HAE_Truck.meta
+++ /dev/null
@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: 77f69c2b862d1704299a32d0d8eeb71e
-folderAsset: yes
-timeCreated: 1547643019
-licenseType: Pro
-DefaultImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Core/NetworkPackage/ServerPack/HAF_Merge.meta b/Core/NetworkPackage/ServerPack/HAF_Merge.meta
deleted file mode 100644
index 86e4eea..0000000
--- a/Core/NetworkPackage/ServerPack/HAF_Merge.meta
+++ /dev/null
@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: fa14960fa44b0d1439bab471a764e34f
-folderAsset: yes
-timeCreated: 1547643019
-licenseType: Pro
-DefaultImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Core/NetworkPackage/ServerPack/HB0_Event.meta b/Core/NetworkPackage/ServerPack/HB0_Event.meta
deleted file mode 100644
index 95487fc..0000000
--- a/Core/NetworkPackage/ServerPack/HB0_Event.meta
+++ /dev/null
@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: d914565b65f8e8145988734c4d915834
-folderAsset: yes
-timeCreated: 1547643019
-licenseType: Pro
-DefaultImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Core/NetworkPackage/ServerPack/HB2_ActionMap/HB214_tagMCCuntomFBPrizeInfo.cs b/Core/NetworkPackage/ServerPack/HB2_ActionMap/HB214_tagMCCuntomFBPrizeInfo.cs
new file mode 100644
index 0000000..6d1ce6f
--- /dev/null
+++ b/Core/NetworkPackage/ServerPack/HB2_ActionMap/HB214_tagMCCuntomFBPrizeInfo.cs
@@ -0,0 +1,23 @@
+using UnityEngine;
+using System.Collections;
+
+// B2 14 自定义副本奖励信息 #tagMCCuntomFBPrizeInfo
+
+public class HB214_tagMCCuntomFBPrizeInfo : GameNetPackBasic {
+ public uint MapID;
+ public ushort FuncLineID;
+ public byte PrizeItemCount;
+ public uint[] PrizeItemIDList;
+
+ public HB214_tagMCCuntomFBPrizeInfo () {
+ _cmd = (ushort)0xB214;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out MapID, vBytes, NetDataType.DWORD);
+ TransBytes (out FuncLineID, vBytes, NetDataType.WORD);
+ TransBytes (out PrizeItemCount, vBytes, NetDataType.BYTE);
+ TransBytes (out PrizeItemIDList, vBytes, NetDataType.DWORD, PrizeItemCount);
+ }
+
+}
diff --git a/Core/NetworkPackage/ServerPack/HB2_ActionMap/HB214_tagMCCuntomFBPrizeInfo.cs.meta b/Core/NetworkPackage/ServerPack/HB2_ActionMap/HB214_tagMCCuntomFBPrizeInfo.cs.meta
new file mode 100644
index 0000000..0b9c7e6
--- /dev/null
+++ b/Core/NetworkPackage/ServerPack/HB2_ActionMap/HB214_tagMCCuntomFBPrizeInfo.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 3c219ea0ad3685b4ea775c880d73e715
+timeCreated: 1555060501
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/ResModule/ScriptableObjectLoader.cs b/Core/ResModule/ScriptableObjectLoader.cs
index f33838c..ee49c5e 100644
--- a/Core/ResModule/ScriptableObjectLoader.cs
+++ b/Core/ResModule/ScriptableObjectLoader.cs
@@ -23,6 +23,7 @@
public const string SoTreasureMeridian_Suffix = "SoTreasureMeridian_";
public const string SoTreasure3D_Suffix = "SoTreasure3D_";
public const string SoDemonDungeon_Suffix = "SoDemonDungeon_";
+ public const string SoHazyMapNpc_Suffix = "SoHazyMapNpc_";
public static SoMap LoadSoMapObjectGenerate(int mapID)
{
@@ -457,4 +458,33 @@
return config;
}
+
+ public static HazyMapNpcScriptableObject LoadSoHazyMapNpc(int _mapId)
+ {
+ HazyMapNpcScriptableObject config = null;
+ if (AssetSource.refdataFromEditor)
+ {
+#if UNITY_EDITOR
+ var resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
+ "Refdata/ScriptableObject/SoHazyMapNpc/",
+ SoHazyMapNpc_Suffix,
+ _mapId,
+ ".asset");
+
+ config = AssetDatabase.LoadAssetAtPath<HazyMapNpcScriptableObject>(resourcePath);
+#endif
+ }
+ else
+ {
+ var assetName = StringUtility.Contact(SoHazyMapNpc_Suffix, _mapId);
+ var assetInfo = new AssetInfo(bundleName, assetName);
+ config = AssetBundleUtility.Instance.Sync_LoadAsset(assetInfo) as HazyMapNpcScriptableObject;
+ }
+
+ if (config == null)
+ {
+ }
+
+ return config;
+ }
}
\ No newline at end of file
diff --git a/Fight/Actor/HeroBehaviour.cs b/Fight/Actor/HeroBehaviour.cs
index 649804c..f11491e 100644
--- a/Fight/Actor/HeroBehaviour.cs
+++ b/Fight/Actor/HeroBehaviour.cs
@@ -708,6 +708,7 @@
CB405_tagCMSuperAtk _b405 = null;
if (!ClientDungeonStageUtility.isClientDungeon
&& !ClientSceneManager.Instance.IsClientFightMode
+ && !AdventureStage.Instance.IsInAdventureStage
#if UNITY_EDITOR
&& !RuntimeLogUtility.TEST_CLIENT_PVP
#endif
diff --git a/Fight/Actor/Skill/AttackHandler.cs b/Fight/Actor/Skill/AttackHandler.cs
index 66afd4e..826f7a1 100644
--- a/Fight/Actor/Skill/AttackHandler.cs
+++ b/Fight/Actor/Skill/AttackHandler.cs
@@ -181,6 +181,7 @@
{
// 澶勭悊灏侀瓟鍧涜嫳闆勪激瀹�
FakeDemonJarDungeonStage _dungeon = StageLoad.Instance.currentStage as FakeDemonJarDungeonStage;
+ ClientHazyDemonKingStage _clientHazyDemonStage = StageLoad.Instance.currentStage as ClientHazyDemonKingStage;
if (_dungeon != null)
{
if (attacker.ServerInstID == PlayerDatas.Instance.PlayerId)
@@ -188,6 +189,10 @@
_dungeon.AddHeroHurt(hurtValue);
}
}
+ else if (_clientHazyDemonStage != null)
+ {
+
+ }
else
{
if (attacker is GA_NpcClientFightNorm)
diff --git a/Fight/Actor/Skill/Skill.cs b/Fight/Actor/Skill/Skill.cs
index 34e6194..6b5ea84 100644
--- a/Fight/Actor/Skill/Skill.cs
+++ b/Fight/Actor/Skill/Skill.cs
@@ -170,6 +170,7 @@
|| userSID != PlayerDatas.Instance.PlayerId
|| ClientDungeonStageUtility.isClientDungeon
|| ClientSceneManager.Instance.IsClientFightMode
+ || AdventureStage.Instance.IsInAdventureStage
#if UNITY_EDITOR
|| RuntimeLogUtility.TEST_CLIENT_PVP
#endif
diff --git a/Fight/Actor/State/SMB/SMB_Base.cs b/Fight/Actor/State/SMB/SMB_Base.cs
index 7771337..5e08875 100644
--- a/Fight/Actor/State/SMB/SMB_Base.cs
+++ b/Fight/Actor/State/SMB/SMB_Base.cs
@@ -93,7 +93,8 @@
{
// Debug.LogFormat("{0} attack {1} ==================== 0", attacker.GetType().ToString(), target.GetType().ToString());
if (!PreFightMission.Instance.IsFinished()
- || ClientSceneManager.Instance.IsClientFightMode)
+ || ClientSceneManager.Instance.IsClientFightMode
+ || AdventureStage.Instance.IsInAdventureStage)
{
return;
}
diff --git a/Fight/Actor/State/SMB/STM_BaseAttack.cs b/Fight/Actor/State/SMB/STM_BaseAttack.cs
index a362f6c..038c056 100644
--- a/Fight/Actor/State/SMB/STM_BaseAttack.cs
+++ b/Fight/Actor/State/SMB/STM_BaseAttack.cs
@@ -734,6 +734,7 @@
{
if (!ClientDungeonStageUtility.isClientDungeon
&& !ClientSceneManager.Instance.IsClientFightMode
+ && !AdventureStage.Instance.IsInAdventureStage
#if UNITY_EDITOR
&& !RuntimeLogUtility.TEST_CLIENT_PVP
#endif
diff --git a/Fight/Actor/Status/StatusMgr.cs b/Fight/Actor/Status/StatusMgr.cs
index e27fb3f..02c1065 100644
--- a/Fight/Actor/Status/StatusMgr.cs
+++ b/Fight/Actor/Status/StatusMgr.cs
@@ -9,6 +9,7 @@
public static event UnityAction<int> OnGainStatus;
public static event UnityAction<float> OnGainCantCastSkillStatus;
public static event UnityAction OnReleaseCantCastSkillStatus;
+ public static event UnityAction<int> onReceiveStatus;
private Dictionary<uint, List<Status_Base>> m_StatusDict = null;
private List<Status_Base> m_AllStatus = null;
@@ -164,6 +165,11 @@
}
}
}
+
+ if (onReceiveStatus != null)
+ {
+ onReceiveStatus(h0605.SkillID);
+ }
}
public bool CanCastSkill(uint sid)
diff --git a/Fight/Actor/Status/Status_Base.cs b/Fight/Actor/Status/Status_Base.cs
index fa15e82..826dc2e 100644
--- a/Fight/Actor/Status/Status_Base.cs
+++ b/Fight/Actor/Status/Status_Base.cs
@@ -1,4 +1,5 @@
锘�
+using System;
using UnityEngine;
public abstract class Status_Base : IStatus
@@ -18,10 +19,14 @@
private SFXController m_Effect;
+ public DateTime receiveTime { get; private set; }
+
public virtual void Init(H0605_tagObjAddBuff data)
{
h0605 = data;
+ receiveTime = TimeUtility.ServerNow;
+
m_SkillConfig = SkillConfig.Get(data.SkillID);
if (m_SkillConfig == null)
diff --git a/Fight/Actor/UserInputHandler.cs b/Fight/Actor/UserInputHandler.cs
index 036c974..2144eb2 100644
--- a/Fight/Actor/UserInputHandler.cs
+++ b/Fight/Actor/UserInputHandler.cs
@@ -369,7 +369,8 @@
//s_LastStatus = moveOrStop;
- if (!PreFightMission.Instance.IsFinished())
+ if (!PreFightMission.Instance.IsFinished()
+ || AdventureStage.Instance.IsInAdventureStage)
{
return;
}
diff --git a/Fight/GameActor/GA_NpcClientFunc.cs b/Fight/GameActor/GA_NpcClientFunc.cs
index c413075..475b69d 100644
--- a/Fight/GameActor/GA_NpcClientFunc.cs
+++ b/Fight/GameActor/GA_NpcClientFunc.cs
@@ -96,6 +96,10 @@
}
}
}
+ else if (AdventureStage.Instance.IsInAdventureStage)
+ {
+ NPCInteractProcessor.InvokeEvent(E_NpcType.Func, NpcConfig.NPCID, ServerInstID);
+ }
}
}
diff --git a/Fight/MapTransferUtility.cs b/Fight/MapTransferUtility.cs
index a7f91b0..625da42 100644
--- a/Fight/MapTransferUtility.cs
+++ b/Fight/MapTransferUtility.cs
@@ -268,6 +268,16 @@
var _curStage = StageLoad.Instance.currentStage as DungeonStage;
+ if (AdventureStage.Instance.IsInAdventureStage)
+ {
+ GActor _actor = GAMgr.Instance.GetCloserNPC(_hero.Pos, NpcID);
+ if (_actor != null)
+ {
+ MoveToExistNpc(NpcID, _actor);
+ yield break;
+ }
+ }
+
// 鍒ゆ柇鏄惁鑳藉寰楀埌鍒拌揪鎸囧畾鐐�
// 鑾峰彇NPC浣嶇疆鏁版嵁
GAStaticDefine.NPCLocation _npcLocation;
diff --git a/Fight/Stage/Dungeon/AdventureStage.cs b/Fight/Stage/Dungeon/AdventureStage.cs
new file mode 100644
index 0000000..fd2e56f
--- /dev/null
+++ b/Fight/Stage/Dungeon/AdventureStage.cs
@@ -0,0 +1,107 @@
+using System.Collections;
+using Snxxz.UI;
+using UnityEngine.SceneManagement;
+using UnityEngine;
+using System;
+
+public class AdventureStage : Singleton<AdventureStage>
+{
+ public bool IsInAdventureStage { get; private set; }
+
+ private Vector3 m_CacheHeroPos;
+ private GA_NpcClientFunc m_Npc;
+
+ public event Action onLoadAdventureStage;
+ public event Action onExitAdventureStage;
+
+ HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
+
+ public void Enter()
+ {
+ IsInAdventureStage = true;
+ m_CacheHeroPos = PlayerDatas.Instance.hero.Pos;
+ SnxxzGame.Instance.StartCoroutine(_Enter());
+ }
+
+ public void Exit()
+ {
+ IsInAdventureStage = false;
+ SnxxzGame.Instance.StartCoroutine(_Exit());
+ }
+
+ private IEnumerator _Enter()
+ {
+ WindowCenter.Instance.Open<LoadingWin>();
+ if (!AssetSource.sceneFromEditor)
+ {
+ AssetBundleUtility.Instance.Sync_LoadAll("maps/map000_xsdt");
+ }
+ var _async = SceneManager.LoadSceneAsync("Map000_Xsdt", LoadSceneMode.Additive);
+ yield return _async;
+ var _hero = PlayerDatas.Instance.hero;
+ if (_hero != null)
+ {
+ _hero.Pos = new Vector3(188.49f, 62.512f, 23.85f);
+ }
+ CameraController.Instance.Apply();
+ yield return null;
+ WindowCenter.Instance.Close<LoadingWin>();
+ m_Npc = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientFunc>((uint)hazyRegionModel.GetAdventureNpcId(), E_ActorGroup.FuncNpc);
+ m_Npc.Pos = new Vector3(189.101f, 62.47324f, 26.147f);
+ NPCInteractProcessor.s_NpcInteractEvent -= OnNpcTalkEvent;
+ NPCInteractProcessor.s_NpcInteractEvent += OnNpcTalkEvent;
+
+ if (onLoadAdventureStage != null)
+ {
+ onLoadAdventureStage();
+ }
+ }
+
+ private IEnumerator _Exit()
+ {
+ NPCInteractProcessor.s_NpcInteractEvent -= OnNpcTalkEvent;
+ GAMgr.Instance.ServerDie(m_Npc.ServerInstID);
+ GAMgr.Instance.Release(m_Npc);
+
+ WindowCenter.Instance.Open<LoadingWin>();
+ WindowCenter.Instance.Close<MainInterfaceWin>();
+ var _async = SceneManager.UnloadSceneAsync("Map000_Xsdt");
+ yield return _async;
+ if (!AssetSource.sceneFromEditor)
+ {
+ AssetBundleUtility.Instance.UnloadAssetBundle("maps/map000_xsdt", true, false);
+ }
+ var _hero = PlayerDatas.Instance.hero;
+ if (_hero != null)
+ {
+ _hero.Pos = m_CacheHeroPos;
+ }
+ CameraController.Instance.Apply();
+ yield return null;
+ WindowCenter.Instance.Open<MainInterfaceWin>();
+ WindowCenter.Instance.Close<LoadingWin>();
+
+ if (onExitAdventureStage != null)
+ {
+ onExitAdventureStage();
+ }
+ }
+
+ private void OnNpcTalkEvent(E_NpcType type, int npcid, uint sid)
+ {
+ if (E_NpcType.Func == type)
+ {
+ if (m_Npc != null)
+ {
+ if (m_Npc.NpcConfig.NPCID == npcid
+ && m_Npc.ServerInstID == sid)
+ {
+ if (!WindowCenter.Instance.IsOpen<HazyRegionDialogueWin>())
+ {
+ hazyRegionModel.StartAdventureDialogue();
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Fight/Stage/Dungeon/AdventureStage.cs.meta b/Fight/Stage/Dungeon/AdventureStage.cs.meta
new file mode 100644
index 0000000..0746c6b
--- /dev/null
+++ b/Fight/Stage/Dungeon/AdventureStage.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 7fb6ffd2c7112ef42bc89374308b6762
+timeCreated: 1554777545
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Fight/Stage/Dungeon/ClientDungeonStageUtility.cs b/Fight/Stage/Dungeon/ClientDungeonStageUtility.cs
index d406afb..6662a9d 100644
--- a/Fight/Stage/Dungeon/ClientDungeonStageUtility.cs
+++ b/Fight/Stage/Dungeon/ClientDungeonStageUtility.cs
@@ -1,4 +1,5 @@
-锘縰sing System.Collections;
+锘縰sing System;
+using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@@ -7,6 +8,8 @@
public static bool isClientDungeon { get; private set; }
public static ushort clientMapId { get; private set; }
+
+ public static event Action<HB214_tagMCCuntomFBPrizeInfo> onReceiveCustomDropItme;
public static void Init()
{
@@ -19,6 +22,44 @@
clientMapId = mapId;
}
+ public static void RequestClientDropItem(int mapId, int lineId)//妯℃嫙鐨勭湡瀹炲湴鍥緄d浠ュ強绾胯矾id
+ {
+ var pak = new CB108_tagCMRefreshCustomFBPrize();
+ pak.MapID = (uint)mapId;
+ pak.FuncLineID = (ushort)lineId;
+ GameNetSystem.Instance.SendInfo(pak);
+ }
+
+ public static void RequestSettleClientDungeon(int mapId, int lineId)
+ {
+ var pak = new CB109_tagCMGiveCustomFBPrize();
+ pak.MapID = (uint)mapId;
+ pak.FuncLineID = (ushort)lineId;
+ GameNetSystem.Instance.SendInfo(pak);
+ }
+
+ public static void RequestStartClientDungeon(int mapId,int lineId)
+ {
+ var pak = new CA231_tagCMClientStartCustomScene();
+ pak.MapID = (uint)mapId;
+ pak.FuncLineID = (ushort)lineId;
+ GameNetSystem.Instance.SendInfo(pak);
+ }
+
+ public static void RequestExitClientDungeon()
+ {
+ var pak = new CA233_tagCMClientExitCustomScene();
+ GameNetSystem.Instance.SendInfo(pak);
+ }
+
+ public static void ReceiveCustomItems(HB214_tagMCCuntomFBPrizeInfo package)
+ {
+ if (onReceiveCustomDropItme != null)
+ {
+ onReceiveCustomDropItme(package);
+ }
+ }
+
private static void Reset()
{
isClientDungeon = false;
diff --git a/Fight/Stage/Dungeon/DungeonStage.cs b/Fight/Stage/Dungeon/DungeonStage.cs
index 0c8fdcc..7f0a8e2 100644
--- a/Fight/Stage/Dungeon/DungeonStage.cs
+++ b/Fight/Stage/Dungeon/DungeonStage.cs
@@ -227,6 +227,7 @@
case DemonJarModel.DEMONJAR_MAPID:
case 31140:
case JadeDynastyBossModel.JADEDYNASTY_MAP:
+ case HazyDemonKingModel.Client_MapID:
WindowCenter.Instance.Open<DungeonPickUpItemCoolDownWin>();
break;
case FairyLeagueModel.FAIRY_LEAGUE_DUNGEON:
@@ -248,6 +249,17 @@
WindowCenter.Instance.Open<DungeonStageTimeWin>();
break;
}
+
+ if (ModelCenter.Instance.GetModel<HazyDemonKingModel>().IsInDungeon)
+ {
+ WindowCenter.Instance.Open<HazyDemonKingDungeonWin>();
+ }
+
+ if (ModelCenter.Instance.GetModel<HazyGrassModel>().IsInDungeon)
+ {
+ WindowCenter.Instance.Open<HazyGrassDungeonWin>();
+ }
+
// 绛夊緟澶勭悊寮�鍚嚜鍔ㄦ垬鏂�
DungeonModel _dungeonModel = ModelCenter.Instance.GetModel<DungeonModel>();
if (PlayerDatas.Instance.baseData.MapID == 52020
diff --git a/Fight/Stage/StageLoadProcessor.cs b/Fight/Stage/StageLoadProcessor.cs
index 2057d32..7dde90e 100644
--- a/Fight/Stage/StageLoadProcessor.cs
+++ b/Fight/Stage/StageLoadProcessor.cs
@@ -401,6 +401,13 @@
break;
case DemonJarModel.DEMONJAR_SINGLEMAPID:
stage = stageGameObject.AddComponent<FakeDemonJarDungeonStage>();
+ break;
+ case HazyDemonKingModel.Client_MapID:
+ stage = stageGameObject.AddComponent<ClientHazyDemonKingStage>();
+ break;
+ case HazyGrassModel.Client_FairyGrassMapID:
+ case HazyGrassModel.Client_ReikiGrassMapID:
+ stage = stageGameObject.AddComponent<ClientHazyGrassStage>();
break;
default:
stage = stageGameObject.AddComponent<DungeonStage>();
diff --git a/System/Activity/ActivityModel.cs b/System/Activity/ActivityModel.cs
index d33b367..9174569 100644
--- a/System/Activity/ActivityModel.cs
+++ b/System/Activity/ActivityModel.cs
@@ -37,6 +37,7 @@
PlayerDatas.Instance.fairyData.OnRefreshFairyBoss += CheckActivity;
StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
NewBieCenter.Instance.guideCompletedEvent += GuideCompletedEvent;
+ AdventureStage.Instance.onLoadAdventureStage += OnLoadAdventureStageFinish;
var _funcCfg = FuncConfigConfig.Get("SpecialActivitys");
var _json = LitJson.JsonMapper.ToObject(_funcCfg.Numerical1);
@@ -59,6 +60,7 @@
fairyLeagueModel.onFairyLeagueBattleEvent -= CheckActivity;
fairyLeagueModel.OnRefreshFairyLeagueEvent -= CheckActivity;
PlayerDatas.Instance.fairyData.OnRefreshFairyBoss -= CheckActivity;
+ AdventureStage.Instance.onLoadAdventureStage -= OnLoadAdventureStageFinish;
}
IEnumerator Co_GuideComplete()
@@ -151,6 +153,19 @@
}
}
+ private void OnLoadAdventureStageFinish()
+ {
+ if (AdventureStage.Instance.IsInAdventureStage)
+ {
+ mainStage = false;
+ activityNotifies.Clear();
+ if (WindowCenter.Instance.IsOpen<ActivityNotifyWin>())
+ {
+ WindowCenter.Instance.Close<ActivityNotifyWin>();
+ }
+ }
+ }
+
IEnumerator Co_StageLoad()
{
yield return null;
@@ -160,7 +175,8 @@
private void CheckActivity()
{
- if (!mainStage || !(StageLoad.Instance.currentStage is DungeonStage))
+ if (!mainStage || !(StageLoad.Instance.currentStage is DungeonStage)
+ || AdventureStage.Instance.IsInAdventureStage)
{
return;
}
diff --git a/System/CrossServerOneVsOne/CrossServerWin.cs b/System/CrossServerOneVsOne/CrossServerWin.cs
index 350eb01..b9c8583 100644
--- a/System/CrossServerOneVsOne/CrossServerWin.cs
+++ b/System/CrossServerOneVsOne/CrossServerWin.cs
@@ -13,6 +13,7 @@
[SerializeField] Button closeBtn;
[SerializeField] FunctionButton arenaFunc;
[SerializeField] FunctionButton bossFunc;
+ [SerializeField] FunctionButton m_HazyRegion;
[SerializeField] FunctionButtonGroup funcGroup;
#region Built-in
protected override void BindController()
@@ -26,6 +27,7 @@
rightBtn.AddListener(ClickRight);
arenaFunc.AddListener(ClickArenaFunc);
bossFunc.AddListener(ClickBossFunc);
+ m_HazyRegion.AddListener(OpenHazyRegion);
}
protected override void OnPreOpen()
@@ -61,12 +63,21 @@
{
CloseSubWindows();
WindowCenter.Instance.Open<CrossServerBossWin>();
+ functionOrder = bossFunc.order;
}
private void ClickArenaFunc()
{
CloseSubWindows();
WindowCenter.Instance.Open<CrossServerOneVsOneWin>();
+ functionOrder = arenaFunc.order;
+ }
+
+ private void OpenHazyRegion()
+ {
+ CloseSubWindows();
+ WindowCenter.Instance.Open<HazyRegionWin>();
+ functionOrder = m_HazyRegion.order;
}
private void ClickRight()
diff --git a/System/DailyQuest/DailyQuestData.cs b/System/DailyQuest/DailyQuestData.cs
index fd70a40..dc95f65 100644
--- a/System/DailyQuest/DailyQuestData.cs
+++ b/System/DailyQuest/DailyQuestData.cs
@@ -49,6 +49,13 @@
}
}
+public struct DailyQuestTimes
+{
+ public int completeTimes;
+ public int dayBuyTimes;
+ public int dayUseItemTimes;
+}
+
public class DailyQuestOpenTime
{
public int id;
diff --git a/System/DailyQuest/DailyQuestModel.cs b/System/DailyQuest/DailyQuestModel.cs
index 37332d5..be931c8 100644
--- a/System/DailyQuest/DailyQuestModel.cs
+++ b/System/DailyQuest/DailyQuestModel.cs
@@ -64,7 +64,7 @@
Dictionary<int, int> dungeonToDailyQuestTable = new Dictionary<int, int>();
Dictionary<int, int> dailyActionToDailyQuestTable = new Dictionary<int, int>();
List<DailyQuestActiveValueReward> dailyQuestActiveValueRewards = new List<DailyQuestActiveValueReward>();
- Dictionary<int, int> dailyQuestCompletedTimes = new Dictionary<int, int>();//闄や簡鍓湰鐨勫叾浠栦换鍔℃斁鍦ㄨ繖閲�
+ Dictionary<int, DailyQuestTimes> dailyQuestTimes = new Dictionary<int, DailyQuestTimes>();//闄や簡鍓湰鐨勫叾浠栦换鍔℃斁鍦ㄨ繖閲�
Dictionary<int, DailyQuestOpenTime> dailyQuestOpenTimes = new Dictionary<int, DailyQuestOpenTime>();
Dictionary<int, Dictionary<int, List<int>>> questCalendar = new Dictionary<int, Dictionary<int, List<int>>>();
@@ -197,6 +197,20 @@
return false;
}
+ public bool TryGetDailyQuestTimes(int _id, out DailyQuestTimes _dailyQuestTime)
+ {
+ _dailyQuestTime = default(DailyQuestTimes);
+ var config = DailyQuestConfig.Get(_id);
+ if (config != null && config.RelatedType == 1)
+ {
+ return dailyQuestTimes.TryGetValue(config.RelatedID, out _dailyQuestTime);
+ }
+ else
+ {
+ return false;
+ }
+ }
+
public bool IsDailyQuestUnLock(int _dailyQuestId)
{
var config = DailyQuestConfig.Get(_dailyQuestId);
@@ -249,6 +263,16 @@
{
case 11:
return Math.Max(dailyQuestOpenTime.DayTimes, GetDailyQuestCompletedTimes(_dailyQuestId));
+ case 25:
+ if (dailyQuestTimes.ContainsKey(config.RelatedID))
+ {
+ return dailyQuestOpenTime.DayTimes + dailyQuestTimes[config.RelatedID].dayBuyTimes
+ + dailyQuestTimes[config.RelatedID].dayUseItemTimes;
+ }
+ else
+ {
+ return dailyQuestOpenTime.DayTimes;
+ }
default:
return dailyQuestOpenTime.DayReKind > 0 ? dailyQuestOpenTime.DayTimes : dailyQuestOpenTime.WeekTimes;
}
@@ -270,9 +294,9 @@
switch (config.RelatedType)
{
case 1:
- if (dailyQuestCompletedTimes.ContainsKey(config.RelatedID))
+ if (dailyQuestTimes.ContainsKey(config.RelatedID))
{
- return dailyQuestCompletedTimes[config.RelatedID];
+ return dailyQuestTimes[config.RelatedID].completeTimes;
}
else
{
@@ -295,9 +319,9 @@
public int GetDailyQuestCompletedNums(int relatedID)
{
- if (dailyQuestCompletedTimes.ContainsKey(relatedID))
+ if (dailyQuestTimes.ContainsKey(relatedID))
{
- return dailyQuestCompletedTimes[relatedID];
+ return dailyQuestTimes[relatedID].completeTimes;
}
else
{
@@ -337,11 +361,19 @@
var dailyAction = _serverInfo.ActionInfo[i];
if (dailyAction.DayFinishCnt > 0)
{
- dailyQuestCompletedTimes[(int)dailyAction.ActionID] = dailyAction.DayFinishCnt;
+ dailyQuestTimes[(int)dailyAction.ActionID] = new DailyQuestTimes()
+ {
+ completeTimes = dailyAction.DayFinishCnt,
+ dayBuyTimes = dailyAction.DayBuyTimes,
+ dayUseItemTimes = dailyAction.DayItemTimes,
+ };
}
else
{
- dailyQuestCompletedTimes[(int)dailyAction.ActionID] = (int)dailyAction.WeekFinishCnt;
+ dailyQuestTimes[(int)dailyAction.ActionID] = new DailyQuestTimes()
+ {
+ completeTimes = (int)dailyAction.WeekFinishCnt,
+ };
}
if (dailyActionToDailyQuestTable.ContainsKey((int)dailyAction.ActionID))
@@ -835,17 +867,32 @@
switch (config.RelatedID)
{
case 11:
- var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
- if (completedTimes >= dailyQuestOpenTime.DayTimes + GeneralDefine.runeTowerSweepBuyTimes)
{
- return DailyQuestState.Completed;
- }
- else
- {
- return DailyQuestState.CanBuyTimes;
+ var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
+ if (completedTimes >= dailyQuestOpenTime.DayTimes + GeneralDefine.runeTowerSweepBuyTimes)
+ {
+ return DailyQuestState.Completed;
+ }
+ else
+ {
+ return DailyQuestState.CanBuyTimes;
+ }
}
case 19:
return DailyQuestState.Normal;
+ case 25:
+ {
+ var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
+ if (completedTimes >= dailyQuestOpenTime.DayTimes +
+ dailyQuestOpenTime.DayBuyTimes + dailyQuestOpenTime.DayItemAddTimes)
+ {
+ return DailyQuestState.Completed;
+ }
+ else
+ {
+ return DailyQuestState.CanBuyTimes;
+ }
+ }
default:
return DailyQuestState.Completed;
}
diff --git a/System/DailyQuest/DailyQuestWin.cs b/System/DailyQuest/DailyQuestWin.cs
index e3ac3dd..d92eed3 100644
--- a/System/DailyQuest/DailyQuestWin.cs
+++ b/System/DailyQuest/DailyQuestWin.cs
@@ -323,6 +323,10 @@
WindowCenter.Instance.Close<DailyQuestWin>();
WindowCenter.Instance.Open<LootPreciousFrameWin>(false, 1);
break;
+ case DailyQuestType.HazyRegion:
+ WindowCenter.Instance.Close<DailyQuestWin>();
+ WindowCenter.Instance.Open<CrossServerWin>(false, 2);
+ break;
default:
CSharpCallLua.GotoLuaDailyQuest(_id);
break;
diff --git a/System/Dungeon/DungeonData.cs b/System/Dungeon/DungeonData.cs
index 4db9bbf..7d02319 100644
--- a/System/Dungeon/DungeonData.cs
+++ b/System/Dungeon/DungeonData.cs
@@ -64,6 +64,8 @@
public int wheel;
public Dictionary<string, AssistPlayer> helpPlayer;
public int memberCnt;
+ public uint ownerID;
+ public string ownerName;
public long totalExp
{
diff --git a/System/Dungeon/DungeonFightWin.cs b/System/Dungeon/DungeonFightWin.cs
index 16c2c38..748631e 100644
--- a/System/Dungeon/DungeonFightWin.cs
+++ b/System/Dungeon/DungeonFightWin.cs
@@ -261,14 +261,22 @@
{
if (_ok)
{
- if (dataMapId == CrossServerBossModel.DATA_MAPID)
+ switch (dataMapId)
{
- var crossServerBossModel = ModelCenter.Instance.GetModel<CrossServerBossModel>();
- crossServerBossModel.RequestExit();
- }
- else
- {
- model.ExitCurrentDungeon();
+ case CrossServerBossModel.DATA_MAPID:
+ var crossServerBossModel = ModelCenter.Instance.GetModel<CrossServerBossModel>();
+ crossServerBossModel.RequestExit();
+ break;
+ case HazyDemonKingModel.Client_MapID:
+ ModelCenter.Instance.GetModel<HazyDemonKingModel>().RequestExitClientDungeon();
+ break;
+ case HazyGrassModel.Client_FairyGrassMapID:
+ case HazyGrassModel.Client_ReikiGrassMapID:
+ ModelCenter.Instance.GetModel<HazyGrassModel>().RequestExitClientDungeon();
+ break;
+ default:
+ model.ExitCurrentDungeon();
+ break;
}
}
}
diff --git a/System/Dungeon/DungeonModel.cs b/System/Dungeon/DungeonModel.cs
index 037259b..d61cf99 100644
--- a/System/Dungeon/DungeonModel.cs
+++ b/System/Dungeon/DungeonModel.cs
@@ -27,6 +27,7 @@
public event Action<DungeonCoolDownType> dungeonCoolDownEvent;
public event Action dungeonBeginCoolDownEndEvent;
public event Action updateMissionEvent;
+ public event Action onDungeonResultEvent;
public event Action<int> dungeonStageChangeEvent;
public event Action getDungeonResultEvent;
public event Action dungeonEnterCoolDownUpdate;
@@ -858,6 +859,13 @@
WindowCenter.Instance.Open<GatherSoulDungeonHintWin>();
}
break;
+ case HazyGrassModel.ReikiGrassMapId:
+ case HazyGrassModel.FairyGrassMapId:
+ if (!WindowCenter.Instance.IsOpen<HazyGrassDungeonWin>())
+ {
+ WindowCenter.Instance.Open<HazyGrassDungeonWin>();
+ }
+ break;
default:
if (GetDungeonHintId(mapId, lineId) != 0)
{
@@ -914,7 +922,12 @@
public void ProcessResult(string _msg)
{
m_DungeonResult = LitJson.JsonMapper.ToObject<DungeonResult>(_msg);
- if (m_DungeonResult.isSweep == 1)
+
+ if (AdventureStage.Instance.IsInAdventureStage)
+ {
+ WindowCenter.Instance.Open<DungeonAdventureVictoryWin>();
+ }
+ else if (m_DungeonResult.isSweep == 1)
{
switch (m_DungeonResult.dataMapID)
{
@@ -1041,6 +1054,11 @@
case RidingPetBossModel.RIDINGPETBOSS_MAP:
WindowCenter.Instance.Open<RidingPetBossVictoryWin>();
break;
+ case 22030:
+ case 32030:
+ case HazyDemonKingModel.Client_MapID:
+ WindowCenter.Instance.Open<HazyDemonKingVictoryWin>();
+ break;
default:
WindowCenter.Instance.Open<DungeonVictoryWin>();
break;
@@ -1072,6 +1090,11 @@
}
}
}
+
+ if (onDungeonResultEvent != null)
+ {
+ onDungeonResultEvent();
+ }
}
public int GetDungeonHintId(int _dataMapId, int _lineId)
diff --git a/System/Dungeon/DungeonReturnBloodBehaviour.cs b/System/Dungeon/DungeonReturnBloodBehaviour.cs
new file mode 100644
index 0000000..6c742f7
--- /dev/null
+++ b/System/Dungeon/DungeonReturnBloodBehaviour.cs
@@ -0,0 +1,24 @@
+锘縰sing System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+ public class DungeonReturnBloodBehaviour : MonoBehaviour
+ {
+ [SerializeField] Button m_ReturnBlood;
+
+ private void Awake()
+ {
+ m_ReturnBlood.AddListener(OnReturnBlood);
+ }
+
+ private void OnReturnBlood()
+ {
+
+ }
+ }
+}
+
diff --git a/System/Dungeon/DungeonReturnBloodBehaviour.cs.meta b/System/Dungeon/DungeonReturnBloodBehaviour.cs.meta
new file mode 100644
index 0000000..7d89e64
--- /dev/null
+++ b/System/Dungeon/DungeonReturnBloodBehaviour.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 26e87c51a6c12d44ba94735d7e5bf5a1
+timeCreated: 1555038168
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/Dungeon/DungeonTargetBehaviour.cs b/System/Dungeon/DungeonTargetBehaviour.cs
index 47eadf0..068f23d 100644
--- a/System/Dungeon/DungeonTargetBehaviour.cs
+++ b/System/Dungeon/DungeonTargetBehaviour.cs
@@ -11,11 +11,13 @@
[SerializeField] Text descText;
[SerializeField] List<Text> m_TargetDescs;
[SerializeField] List<Text> m_TargetNums;
- private int currentDungeonId=0;
+ private int currentDungeonId = 0;
DungeonModel m_Model;
- DungeonModel model {
- get {
+ DungeonModel model
+ {
+ get
+ {
return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<DungeonModel>());
}
}
@@ -72,76 +74,91 @@
var weel = Mathf.Clamp(model.mission.wheel, 1, int.MaxValue) - 1;
descText.text = config.Info.Length > weel ? config.Info[weel] : config.Info[0];
break;
+ case HazyGrassModel.FairyGrassMapId:
+ case HazyGrassModel.ReikiGrassMapId:
+ break;
default:
descText.text = config.Info.Length > step ? config.Info[step] : config.Info[0];
break;
}
}
- private void GetTargetInfo(int _index,string desc,int _targetValue,int _targetStep,int _targetType,int npcId=0)
+ private void GetTargetInfo(int _index, string desc, int _targetValue, int _targetStep, int _targetType, int npcId = 0)
{
m_TargetDescs[_index].text = desc;
m_TargetNums[_index].text = string.Empty;
- switch ((DungeonTargetType)_targetType) {
+ switch ((DungeonTargetType)_targetType)
+ {
case DungeonTargetType.NPC:
int killCnt = 0;
- if (npcId != 0) {
+ if (npcId != 0)
+ {
var npcConfig = NPCConfig.Get(npcId);
desc = desc.Replace("@NPCName@", npcConfig.charName);
- if (model.mission.npc != null) {
- for (int i = 0; i < model.mission.npc.Length; i++) {
+ if (model.mission.npc != null)
+ {
+ for (int i = 0; i < model.mission.npc.Length; i++)
+ {
var npcInfo = model.mission.npc[i];
- if (npcInfo.NPCID == npcId) {
+ if (npcInfo.NPCID == npcId)
+ {
killCnt = npcInfo.killCnt;
break;
}
}
}
}
- if (_targetValue > 0) {
- m_TargetNums[_index].text= StringUtility.Contact(killCnt, "/", _targetValue);
+ if (_targetValue > 0)
+ {
+ m_TargetNums[_index].text = StringUtility.Contact(killCnt, "/", _targetValue);
break;
}
m_TargetNums[_index].text = killCnt.ToString();
break;
case DungeonTargetType.Exp:
- if (_targetValue > 0) {
- m_TargetNums[_index].text=StringUtility.Contact(UIHelper.ReplaceLargeNum((ulong)model.mission.totalExp), "/", UIHelper.ReplaceLargeNum((ulong)_targetValue));
+ if (_targetValue > 0)
+ {
+ m_TargetNums[_index].text = StringUtility.Contact(UIHelper.ReplaceLargeNum((ulong)model.mission.totalExp), "/", UIHelper.ReplaceLargeNum((ulong)_targetValue));
break;
}
m_TargetNums[_index].text = StringUtility.Contact(UIHelper.ReplaceLargeNum((ulong)model.mission.totalExp),
model.mission.isFullExp == 1 ? StringUtility.Contact(" ", Language.Get("FullExp")) : string.Empty);
break;
case DungeonTargetType.Score:
- if (_targetValue > 0) {
- m_TargetNums[_index].text= StringUtility.Contact(model.mission.score, "/", _targetValue);
+ if (_targetValue > 0)
+ {
+ m_TargetNums[_index].text = StringUtility.Contact(model.mission.score, "/", _targetValue);
break;
}
m_TargetNums[_index].text = model.mission.score.ToString();
break;
case DungeonTargetType.Money:
- if (_targetValue > 0) {
+ if (_targetValue > 0)
+ {
m_TargetNums[_index].text = StringUtility.Contact(model.mission.money, "/", _targetValue);
break;
}
m_TargetNums[_index].text = model.mission.money.ToString();
break;
case DungeonTargetType.Wave:
- if (_targetValue > 0) {
+ if (_targetValue > 0)
+ {
m_TargetNums[_index].text = StringUtility.Contact(model.mission.wheel, "/", _targetValue);
break;
}
m_TargetNums[_index].text = model.mission.wheel.ToString();
break;
case DungeonTargetType.NpcTotal:
- if (_targetValue > 0) {
+ if (_targetValue > 0)
+ {
m_TargetNums[_index].text = StringUtility.Contact(model.mission.npcTotal, "/", _targetValue);
break;
}
m_TargetNums[_index].text = model.mission.npcTotal.ToString();
break;
case DungeonTargetType.Stage:
- if (_targetValue > 0) {
+ if (_targetValue > 0)
+ {
m_TargetNums[_index].text = StringUtility.Contact(model.mission.step, "/", _targetValue);
break;
}
diff --git a/System/EquipStar/EquipStarWin.cs b/System/EquipStar/EquipStarWin.cs
index e6dec43..f8b041f 100644
--- a/System/EquipStar/EquipStarWin.cs
+++ b/System/EquipStar/EquipStarWin.cs
@@ -293,7 +293,7 @@
var property = levelUpProperties[star];
behaviour.gameObject.SetActive(true);
behaviour.text = string.Format("銆恵0}鏄熴�憑1}", star, PlayerPropertyConfig.GetFullDescription(property));
- behaviour.color = UIHelper.GetUIColor(nextStar >= star ? TextColType.Green : TextColType.Gray);
+ behaviour.color = UIHelper.GetUIColor(currentStar >= star ? TextColType.Green : TextColType.Gray);
}
else
{
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HAF_Merge.meta b/System/HazyRegion.meta
similarity index 66%
rename from Core/NetworkPackage/DTCFile/ServerPack/HAF_Merge.meta
rename to System/HazyRegion.meta
index 314efd1..47b33b3 100644
--- a/Core/NetworkPackage/DTCFile/ServerPack/HAF_Merge.meta
+++ b/System/HazyRegion.meta
@@ -1,7 +1,7 @@
fileFormatVersion: 2
-guid: 71e878ac60c49ad4f964dd2dbc725739
+guid: 3a97466d4874bbc4385441a3ac16b0df
folderAsset: yes
-timeCreated: 1547643019
+timeCreated: 1554358777
licenseType: Pro
DefaultImporter:
userData:
diff --git a/System/HazyRegion/ClientHazyDemonKingStage.cs b/System/HazyRegion/ClientHazyDemonKingStage.cs
new file mode 100644
index 0000000..c901b97
--- /dev/null
+++ b/System/HazyRegion/ClientHazyDemonKingStage.cs
@@ -0,0 +1,315 @@
+锘縰sing Snxxz.UI;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class ClientHazyDemonKingStage : DungeonStage
+{
+ static readonly Vector3 playerBornPosition = new Vector3(10, 6.38f, 6.67f);
+ static readonly Vector3 bossBornPosition = new Vector3(8.35f, 6.37f, 9.7f);
+
+ static GA_NpcClientFightBoss clientFightBoss = null;
+
+ float totalTime = 20f;
+ float timer = 0f;
+ DateTime playerAtkTime = DateTime.Now;
+ Clock pickItemClock = null;
+
+ float stepTimer = 0f;
+
+ float existTime = 10f;
+
+ bool pickAllDropItem = false;
+
+ int itemCount = 0;
+
+ Step m_Step = Step.Fight;
+ Step step
+ {
+ get { return m_Step; }
+ set
+ {
+ if (m_Step != value)
+ {
+ m_Step = value;
+ switch (m_Step)
+ {
+ case Step.Fight:
+ stepTimer = 0f;
+ break;
+ case Step.PickItem:
+ stepTimer = 5f;
+ break;
+ case Step.Settle:
+ stepTimer = 0f;
+ break;
+ case Step.Exit:
+ stepTimer = 0f;
+ break;
+ }
+ }
+ }
+ }
+
+ HazyDemonKingModel model { get { return ModelCenter.Instance.GetModel<HazyDemonKingModel>(); } }
+ HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
+ DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
+
+ public override void Initialize()
+ {
+ base.Initialize();
+
+ timer = 0f;
+ playerAtkTime = DateTime.MinValue;
+ m_Step = Step.None;
+ pickAllDropItem = false;
+ itemCount = 0;
+
+ DTC0403_tagPlayerLoginLoadOK.mapInitOkEvent += OnReconnected;
+ AttackHandler.OnAttackTarget += OnPlayerAttack;
+ ClientDungeonStageUtility.onReceiveCustomDropItme += OnReceiveCustomDropItme;
+ dungeonModel.onDungeonResultEvent += OnDungeonResultEvent;
+ ClientDropItemUtility.OnItemPickup += OnItemPickup;
+ }
+
+ protected override void OnStageLoadFinish()
+ {
+ base.OnStageLoadFinish();
+
+ InitializePlayer();
+ InitializeBoss();
+
+ step = Step.Fight;
+ }
+
+ public static uint GetClientBossSid()
+ {
+ if (clientFightBoss != null)
+ {
+ return clientFightBoss.ServerInstID;
+ }
+ return 0;
+ }
+
+ void InitializePlayer()
+ {
+ var hero = PlayerDatas.Instance.hero;
+ hero.Pos = playerBornPosition;
+ CameraController.Instance.Apply();
+ }
+
+ void InitializeBoss()
+ {
+ if (clientFightBoss != null)
+ {
+ clientFightBoss.ActorInfo.serverDie = true;
+ GAMgr.Instance.ServerDie(clientFightBoss.ServerInstID);
+ GAMgr.Instance.Release(clientFightBoss);
+ clientFightBoss = null;
+ }
+
+ var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
+ var npcId = NPCConfig.Get(config.npcId);
+
+ clientFightBoss = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightBoss>((uint)config.npcId, E_ActorGroup.Enemy);
+ clientFightBoss.Pos = bossBornPosition;
+ clientFightBoss.LockTargetSID = PlayerDatas.Instance.PlayerId;
+ }
+
+ private void OnPlayerAttack(uint _attackerId, uint _victimId, byte _type, uint _damage)
+ {
+ if (clientFightBoss == null)
+ {
+ return;
+ }
+
+ if (_victimId == clientFightBoss.ServerInstID)
+ {
+ var progress = Mathf.Clamp01(1 - timer / totalTime);
+ var hp = (ulong)(clientFightBoss.ActorInfo.RealMaxHp * progress);
+
+ TargetBriefInfo.OnRefreshBossLifeBar(_victimId, clientFightBoss.NpcConfig.NPCID,
+ hp, clientFightBoss.ActorInfo.RealMaxHp);
+
+ playerAtkTime = DateTime.Now;
+ }
+ }
+
+ private void OnReceiveCustomDropItme(HB214_tagMCCuntomFBPrizeInfo package)
+ {
+ step = Step.PickItem;
+ if (package.PrizeItemCount <= 0)
+ {
+ pickAllDropItem = true;
+ }
+ else
+ {
+ itemCount = package.PrizeItemCount;
+ int[] items = new int[itemCount];
+ for (int i = 0; i < itemCount; i++)
+ {
+ items[i] = (int)package.PrizeItemIDList[i];
+ }
+ ClientDropItemUtility.Instance.Drop(bossBornPosition, items);
+
+ dungeonModel.UpdateCoolDown(DungeonCoolDownType.PickUpTime, 30 * 1000);
+
+ if (pickItemClock != null)
+ {
+ Clock.Stop(pickItemClock);
+ pickItemClock = null;
+ }
+ pickItemClock = Clock.AlarmAfter(30, OnPickUpItemLimit);
+ }
+ }
+
+ void OnPickUpItemLimit()
+ {
+ pickAllDropItem = true;
+ }
+
+ private void OnItemPickup(int itemId)
+ {
+ itemCount--;
+ if (itemCount == 0)
+ {
+ pickAllDropItem = true;
+ }
+ }
+
+ private void OnDungeonResultEvent()
+ {
+ step = Step.Settle;
+ dungeonModel.UpdateCoolDown(DungeonCoolDownType.LeaveMap, 10 * 1000);
+ }
+
+ protected override void OnUpdate()
+ {
+ base.OnUpdate();
+
+ if (timer < totalTime)
+ {
+ if ((DateTime.Now - playerAtkTime).TotalSeconds < 1f)
+ {
+ timer += Time.deltaTime;
+ if (timer >= totalTime)
+ {
+ OnBossDie();
+ }
+ }
+ }
+
+ switch (step)
+ {
+ case Step.Fight:
+ if (clientFightBoss == null)
+ {
+ stepTimer += Time.deltaTime;
+ if (stepTimer > 5f)
+ {
+ stepTimer = 0f;
+ RequestDropItem();
+ }
+ }
+ break;
+ case Step.PickItem:
+ if (pickAllDropItem)
+ {
+ stepTimer += Time.deltaTime;
+ if (stepTimer >= 5f)
+ {
+ RequestSettle();
+ stepTimer = 0f;
+ }
+ }
+ break;
+ case Step.Settle:
+ stepTimer += Time.deltaTime;
+ if (stepTimer >= existTime)
+ {
+ step = Step.Exit;
+ model.RequestExitClientDungeon();
+ }
+ break;
+ }
+ }
+
+ void OnBossDie()
+ {
+ if (clientFightBoss != null)
+ {
+ clientFightBoss.ActorInfo.serverDie = true;
+ GAMgr.Instance.ServerDie(clientFightBoss.ServerInstID);
+ clientFightBoss.Die();
+ clientFightBoss = null;
+ }
+
+ RequestDropItem();
+ }
+
+ void RequestDropItem()
+ {
+ var incidentId = hazyRegionModel.processingIncidentId;
+ var config = HazyRegionConfig.Get(incidentId);
+ ClientDungeonStageUtility.RequestClientDropItem(config.dungeonId, config.lineId);
+ }
+
+ void RequestSettle()
+ {
+ var incidentId = hazyRegionModel.processingIncidentId;
+ var config = HazyRegionConfig.Get(incidentId);
+ ClientDungeonStageUtility.RequestSettleClientDungeon(config.dungeonId, config.lineId);
+ }
+
+ private void OnReconnected()
+ {
+ var incidentId = hazyRegionModel.processingIncidentId;
+ var config = HazyRegionConfig.Get(incidentId);
+ ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
+ }
+
+ public override void UnInitialize()
+ {
+ base.UnInitialize();
+
+ if (clientFightBoss != null)
+ {
+ clientFightBoss.ActorInfo.serverDie = true;
+ GAMgr.Instance.ServerDie(clientFightBoss.ServerInstID);
+ GAMgr.Instance.Release(clientFightBoss);
+ clientFightBoss = null;
+ }
+
+ if (pickItemClock != null)
+ {
+ Clock.Stop(pickItemClock);
+ pickItemClock = null;
+ }
+
+ DTC0403_tagPlayerLoginLoadOK.mapInitOkEvent -= OnReconnected;
+ AttackHandler.OnAttackTarget -= OnPlayerAttack;
+ ClientDungeonStageUtility.onReceiveCustomDropItme -= OnReceiveCustomDropItme;
+ dungeonModel.onDungeonResultEvent -= OnDungeonResultEvent;
+ ClientDropItemUtility.OnItemPickup -= OnItemPickup;
+ }
+
+#if UNITY_EDITOR
+ private void OnGUI()
+ {
+ if (GUILayout.Button("Exit"))
+ {
+ model.RequestExitClientDungeon();
+ }
+ }
+#endif
+
+ public enum Step
+ {
+ None,
+ Fight,
+ PickItem,
+ Settle,
+ Exit
+ }
+}
diff --git a/System/HazyRegion/ClientHazyDemonKingStage.cs.meta b/System/HazyRegion/ClientHazyDemonKingStage.cs.meta
new file mode 100644
index 0000000..611c367
--- /dev/null
+++ b/System/HazyRegion/ClientHazyDemonKingStage.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 6426fe00cafdfd84cbc249ce70caccc4
+timeCreated: 1554976847
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/ClientHazyGrassStage.cs b/System/HazyRegion/ClientHazyGrassStage.cs
new file mode 100644
index 0000000..1c56035
--- /dev/null
+++ b/System/HazyRegion/ClientHazyGrassStage.cs
@@ -0,0 +1,166 @@
+锘縰sing System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+namespace Snxxz.UI
+{
+ public class ClientHazyGrassStage : DungeonStage
+ {
+ static readonly Vector3 PlayerBornPosition = new Vector3(17.25f, 5.12f, 3.70f);
+
+ static List<HazyMapNpcScriptableObject.NpcInfo> s_NpcInfos = new List<HazyMapNpcScriptableObject.NpcInfo>();
+ static Dictionary<Vector3, GA_NpcClientCollect> s_CollectNpcs = new Dictionary<Vector3, GA_NpcClientCollect>();
+ static Dictionary<uint, Vector3> s_Sid2NpcPos = new Dictionary<uint, Vector3>();
+ static Dictionary<uint, int> s_Sid2NpcIds = new Dictionary<uint, int>();
+
+ static int grassRefreshCount = 0;
+
+ bool mapLoadFinish = false;
+
+ HazyGrassModel model { get { return ModelCenter.Instance.GetModel<HazyGrassModel>(); } }
+
+ public override void Initialize()
+ {
+ base.Initialize();
+
+ s_NpcInfos.Clear();
+ s_Sid2NpcIds.Clear();
+ s_Sid2NpcPos.Clear();
+
+ mapLoadFinish = false;
+
+ grassRefreshCount = 0;
+
+ UnloadAllNpc();
+
+ GA_NpcClientCollect.OnCollectFinished += OnCollectFinished;
+ }
+
+ protected override void OnStageLoadFinish()
+ {
+ base.OnStageLoadFinish();
+
+ mapLoadFinish = true;
+ model.RefreshGrassBornTime(TimeUtility.ServerNow);
+
+ InitialPlayer();
+ InitializeNpc();
+ }
+
+ protected override void OnUpdate()
+ {
+ base.OnUpdate();
+
+ if (mapLoadFinish)
+ {
+ var used = Mathf.Max(0, (int)(TimeUtility.ServerNow - model.grassBornTime).TotalSeconds);
+ var count = used / model.grassRefreshSeconds;
+ if (count != grassRefreshCount)
+ {
+ RebornCollectedNpc();
+ grassRefreshCount = count;
+ }
+ }
+ }
+
+ public override void UnInitialize()
+ {
+ base.UnInitialize();
+
+ UnloadAllNpc();
+
+ GA_NpcClientCollect.OnCollectFinished -= OnCollectFinished;
+ }
+
+ private void OnCollectFinished(uint _sid)
+ {
+ if (s_Sid2NpcIds.ContainsKey(_sid))
+ {
+ var npcId = s_Sid2NpcIds[_sid];
+ Debug.Log("閲囬泦浜哊pc:--" + npcId);
+ }
+
+ if (s_Sid2NpcPos.ContainsKey(_sid))
+ {
+ var pos = s_Sid2NpcPos[_sid];
+ if (s_CollectNpcs.ContainsKey(pos))
+ {
+ s_CollectNpcs.Remove(pos);
+ }
+ }
+ }
+
+ void InitializeNpc()
+ {
+ s_NpcInfos.Clear();
+
+ var config = ScriptableObjectLoader.LoadSoHazyMapNpc(ClientDungeonStageUtility.clientMapId);
+ var npcInfos = config.GetAllNpcInfos();
+ if (npcInfos != null)
+ {
+ s_NpcInfos.AddRange(npcInfos);
+ RebornCollectedNpc();
+ }
+ }
+
+ void InitialPlayer()
+ {
+ var hero = PlayerDatas.Instance.hero;
+ hero.Pos = PlayerBornPosition;
+ CameraController.Instance.Apply();
+ }
+
+ void RebornCollectedNpc()
+ {
+ foreach (var npcInfo in s_NpcInfos)
+ {
+ switch (npcInfo.npcType)
+ {
+ case E_NpcType.Collect:
+ GA_NpcClientCollect _npc = null;
+ if (!s_CollectNpcs.TryGetValue(npcInfo.position, out _npc)
+ || _npc == null || _npc.ActorInfo.serverDie)
+ {
+ _npc = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientCollect>((uint)npcInfo.npcId,
+ E_ActorGroup.FuncNpc);
+ if (_npc != null)
+ {
+ _npc.Pos = npcInfo.position;
+ s_CollectNpcs[npcInfo.position] = _npc;
+
+ s_Sid2NpcIds[_npc.ServerInstID] = npcInfo.npcId;
+ s_Sid2NpcPos[_npc.ServerInstID] = npcInfo.position;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ void UnloadAllNpc()
+ {
+ foreach (var _npc in s_CollectNpcs.Values)
+ {
+ if (_npc != null)
+ {
+ _npc.KillerServerInstID = PlayerDatas.Instance.PlayerId;
+ _npc.ActorInfo.serverDie = true;
+ GAMgr.Instance.ServerDie(_npc.ServerInstID);
+ GAMgr.Instance.Release(_npc);
+ }
+ }
+ s_CollectNpcs.Clear();
+ }
+
+#if UNITY_EDITOR
+ private void OnGUI()
+ {
+ if (GUILayout.Button("Exit"))
+ {
+ model.RequestExitClientDungeon();
+ }
+ }
+#endif
+ }
+}
+
diff --git a/System/HazyRegion/ClientHazyGrassStage.cs.meta b/System/HazyRegion/ClientHazyGrassStage.cs.meta
new file mode 100644
index 0000000..1dc3e6c
--- /dev/null
+++ b/System/HazyRegion/ClientHazyGrassStage.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 19b261054bba1d549bd299402cfb6d5a
+timeCreated: 1555038314
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/DungeonAdventureVictoryWin.cs b/System/HazyRegion/DungeonAdventureVictoryWin.cs
new file mode 100644
index 0000000..4597b29
--- /dev/null
+++ b/System/HazyRegion/DungeonAdventureVictoryWin.cs
@@ -0,0 +1,136 @@
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Tuesday, April 09, 2019
+//--------------------------------------------------------
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+
+ public class DungeonAdventureVictoryWin : Window
+ {
+ [SerializeField] Transform m_ContainerPoivt;
+ [SerializeField] DemonJarRewardBehaviour[] m_Items;
+ [SerializeField] Button m_Exit;
+ [SerializeField] Text m_ExitTimer;
+
+ const float totalTime = 5f;
+ float timer = 0f;
+ float clockTimer = 0f;
+
+ DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
+
+ #region Built-in
+ protected override void BindController()
+ {
+ }
+
+ protected override void AddListeners()
+ {
+ m_Exit.AddListener(ExitDungeon);
+ }
+
+ protected override void OnPreOpen()
+ {
+ m_ContainerPoivt.gameObject.SetActive(false);
+ timer = 0f;
+ clockTimer = 0f;
+ }
+
+ protected override void OnActived()
+ {
+ base.OnActived();
+ StartCoroutine(Co_DelayDisplay());
+ }
+
+ protected override void OnAfterOpen()
+ {
+ }
+
+ protected override void OnPreClose()
+ {
+ AdventureStage.Instance.Exit();
+ }
+
+ protected override void OnAfterClose()
+ {
+ }
+ #endregion
+
+ protected override void LateUpdate()
+ {
+ clockTimer += Time.deltaTime;
+ if (clockTimer >= 0.5f)
+ {
+ clockTimer = 0f;
+ var seconds = Mathf.CeilToInt(totalTime - timer);
+ DrawExitTimer(seconds);
+ }
+
+ timer += Time.deltaTime;
+ if (timer >= totalTime)
+ {
+ Close();
+ }
+ }
+
+ IEnumerator Co_DelayDisplay()
+ {
+ yield return WaitingForSecondConst.WaitMS500;
+ Display();
+ }
+
+ void Display()
+ {
+ m_ContainerPoivt.gameObject.SetActive(true);
+ DisplayExit();
+ DisplayItems();
+ }
+
+ void DisplayExit()
+ {
+ m_Exit.gameObject.SetActive(true);
+ var seconds = Mathf.CeilToInt(totalTime - timer);
+ DrawExitTimer(seconds);
+ }
+
+ void DrawExitTimer(int seconds)
+ {
+ m_ExitTimer.text = Language.Get("DungeonVictoryWin_Btn_Exit_1", Mathf.Clamp(seconds, 0, int.MaxValue));
+ }
+
+ void DisplayItems()
+ {
+ var result = dungeonModel.dungeonResult;
+ for (int i = 0; i < m_Items.Length; i++)
+ {
+ if (result.itemInfo != null && i < result.itemInfo.Length)
+ {
+ var serverItem = result.itemInfo[i];
+ m_Items[i].gameObject.SetActive(true);
+ m_Items[i].Display(new Item(serverItem.ItemID, serverItem.Count));
+ }
+ else
+ {
+ m_Items[i].gameObject.SetActive(false);
+ }
+ }
+ }
+
+ private void ExitDungeon()
+ {
+ Close();
+ }
+
+ }
+
+}
+
+
+
+
diff --git a/System/HazyRegion/DungeonAdventureVictoryWin.cs.meta b/System/HazyRegion/DungeonAdventureVictoryWin.cs.meta
new file mode 100644
index 0000000..06d88e3
--- /dev/null
+++ b/System/HazyRegion/DungeonAdventureVictoryWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 116e810bc1fe9954d815c4fd53536e7e
+timeCreated: 1554791976
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/HazyAdventureHintWin.cs b/System/HazyRegion/HazyAdventureHintWin.cs
new file mode 100644
index 0000000..917afef
--- /dev/null
+++ b/System/HazyRegion/HazyAdventureHintWin.cs
@@ -0,0 +1,84 @@
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Wednesday, April 10, 2019
+//--------------------------------------------------------
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+
+ public class HazyAdventureHintWin : Window
+ {
+ [SerializeField] Text m_AdventureName;
+ [SerializeField] Text m_Progress;
+
+ HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
+
+ #region Built-in
+ protected override void BindController()
+ {
+ }
+
+ protected override void AddListeners()
+ {
+ }
+
+ protected override void OnPreOpen()
+ {
+ model.onHazyRegionIncidentRefresh += OnHazyRegionIncidentRefresh;
+
+ Display();
+ }
+
+ protected override void OnAfterOpen()
+ {
+ }
+
+ protected override void OnPreClose()
+ {
+ model.onHazyRegionIncidentRefresh -= OnHazyRegionIncidentRefresh;
+ }
+
+ protected override void OnAfterClose()
+ {
+ }
+ #endregion
+
+ void Display()
+ {
+ var config = AdventureDialogueConfig.Get(model.adventureDialogueId);
+ if (config != null)
+ {
+ var npcConfig = NPCConfig.Get(config.npcId);
+ m_AdventureName.text = string.Format("涓巤0}瀵硅瘽锛�", npcConfig.charName);
+ }
+
+ HazyRegionModel.Incident incident;
+
+ var completed = false;
+
+ if (model.TryGetIncident(model.processingIncidentId, out incident))
+ {
+ completed = incident.state == HazyRegionModel.IncidentState.Complete;
+ }
+
+ m_Progress.text = StringUtility.Contact(completed ? 1 : 0, "/", 1);
+ }
+
+ private void OnHazyRegionIncidentRefresh()
+ {
+ Display();
+ }
+
+ }
+
+}
+
+
+
+
diff --git a/System/HazyRegion/HazyAdventureHintWin.cs.meta b/System/HazyRegion/HazyAdventureHintWin.cs.meta
new file mode 100644
index 0000000..95c4bca
--- /dev/null
+++ b/System/HazyRegion/HazyAdventureHintWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 1420ea56c96d7a142a0b5037cc30f7cb
+timeCreated: 1554878168
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/HazyDemonKingDungeonWin.cs b/System/HazyRegion/HazyDemonKingDungeonWin.cs
new file mode 100644
index 0000000..0d7b459
--- /dev/null
+++ b/System/HazyRegion/HazyDemonKingDungeonWin.cs
@@ -0,0 +1,223 @@
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Wednesday, April 10, 2019
+//--------------------------------------------------------
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+
+ public class HazyDemonKingDungeonWin : Window
+ {
+ [SerializeField] CyclicScroll m_CyclicScroll;
+ [SerializeField] Text m_MyAtkTargetName;
+
+ [SerializeField] Transform m_ContainerInvincibleBuff;
+ [SerializeField] SmoothSlider m_BuffSlider;
+
+
+ DateTime invincibleBuffEndTime = DateTime.Now;
+ uint invincibleLastTime = 0;
+
+ uint myAtkSid = 0;
+
+ List<uint> playerIds = new List<uint>();
+ List<uint> clonePlayerIds = new List<uint>();
+
+ HazyDemonKingModel model { get { return ModelCenter.Instance.GetModel<HazyDemonKingModel>(); } }
+ DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
+
+ #region Built-in
+ protected override void BindController()
+ {
+ }
+
+ protected override void AddListeners()
+ {
+ }
+
+ protected override void OnPreOpen()
+ {
+ Display();
+
+ model.onPlayerInfoRefresh += OnPlayerInfoRefresh;
+ StatusMgr.onReceiveStatus += OnReceiveStatus;
+ GlobalTimeEvent.Instance.secondEvent += PerSecond;
+ }
+
+ protected override void OnAfterOpen()
+ {
+ }
+
+ protected override void OnPreClose()
+ {
+ m_CyclicScroll.Dispose();
+ model.onPlayerInfoRefresh -= OnPlayerInfoRefresh;
+ StatusMgr.onReceiveStatus -= OnReceiveStatus;
+ GlobalTimeEvent.Instance.secondEvent -= PerSecond;
+ }
+
+ protected override void OnAfterClose()
+ {
+ }
+
+ protected override void LateUpdate()
+ {
+ if (TimeUtility.ServerNow < invincibleBuffEndTime)
+ {
+ m_BuffSlider.delay = 0.2f;
+ DisplayInvincibleProgress();
+ }
+ }
+ #endregion
+
+ void Display()
+ {
+ DisplayPlayers();
+ DisplayMyTargetName();
+ DisplayInvincibleBuff();
+ }
+
+ void DisplayPlayers()
+ {
+ playerIds.Clear();
+ clonePlayerIds.Clear();
+ playerIds.AddRange(model.GetPlayerIds());
+ playerIds.Sort(Compare);
+ clonePlayerIds.AddRange(playerIds);
+
+ m_CyclicScroll.Init(playerIds);
+ }
+
+ void DisplayInvincibleBuff()
+ {
+ var actors = GAMgr.Instance.GetTypeList(E_ActorClassType.NpcFightBoss);
+ bool existInvincibleBuff = false;
+
+ Status_Base status_Base = null;
+
+ if (actors != null && actors.Count > 0)
+ {
+ var serverInstId = (actors[0] as GA_NpcFightBoss).ServerInstID;
+ existInvincibleBuff = StatusMgr.Instance.IsExist(serverInstId, model.invincibleBuffId);
+
+ if (existInvincibleBuff)
+ {
+ status_Base = StatusMgr.Instance.Get(serverInstId, model.invincibleBuffId);
+ }
+ }
+
+ m_ContainerInvincibleBuff.gameObject.SetActive(existInvincibleBuff);
+
+ if (existInvincibleBuff && status_Base != null)
+ {
+ invincibleBuffEndTime = status_Base.receiveTime.AddTicks(status_Base.h0605.LastTime * TimeSpan.TicksPerMillisecond);
+ invincibleLastTime = status_Base.h0605.LastTime;
+ }
+ m_BuffSlider.delay = 0f;
+ DisplayInvincibleProgress();
+ }
+
+ void DisplayInvincibleProgress()
+ {
+ var milliSeconds = Mathf.CeilToInt((float)(invincibleBuffEndTime - TimeUtility.ServerNow).TotalMilliseconds);
+ if (invincibleLastTime == 0)
+ {
+ invincibleLastTime = (uint)milliSeconds;
+ }
+ var progress = Mathf.Clamp01(1 - (float)milliSeconds / invincibleLastTime);
+ m_BuffSlider.value = progress;
+ }
+
+ private void OnPlayerInfoRefresh()
+ {
+ DisplayPlayers();
+ }
+
+ private void OnReceiveStatus(int buffId)
+ {
+ if (buffId == model.invincibleBuffId)
+ {
+ DisplayInvincibleBuff();
+ }
+ }
+
+ private void PerSecond()
+ {
+ if (clonePlayerIds.Count > 0)
+ {
+ clonePlayerIds.Sort(Compare);
+ }
+
+ if (clonePlayerIds.Count == playerIds.Count)
+ {
+ for (int i = 0; i < clonePlayerIds.Count; i++)
+ {
+ if (clonePlayerIds[i] != playerIds[i])
+ {
+ DisplayPlayers();
+ return;
+ }
+ }
+ }
+
+ var _sid = model.GetPlayerAtkTarget(PlayerDatas.Instance.PlayerId);
+ if (_sid != myAtkSid)
+ {
+ DisplayMyTargetName();
+ }
+ }
+
+ void DisplayMyTargetName()
+ {
+ m_MyAtkTargetName.text = string.Empty;
+
+ myAtkSid = model.GetPlayerAtkTarget(PlayerDatas.Instance.PlayerId);
+ var actor = GAMgr.Instance.GetBySID(myAtkSid);
+
+ if (actor != null)
+ {
+ if (actor is GA_NpcClientFightBoss)
+ {
+ m_MyAtkTargetName.text = (actor as GA_NpcClientFightBoss).NpcConfig.charName;
+ }
+ else if (actor is GA_NpcFightBoss)
+ {
+ m_MyAtkTargetName.text = (actor as GA_NpcFightBoss).NpcConfig.charName;
+ }
+ else if (actor is GA_Player)
+ {
+ m_MyAtkTargetName.text = UIHelper.ServerStringTrim((actor as GA_Player).ActorInfo.PlayerName);
+ }
+ }
+ }
+
+ int Compare(uint lhs, uint rhs)
+ {
+ var lhs_bossBelong = model.IsExistBelongTo(lhs);
+ var rhs_bossBelong = model.IsExistBelongTo(rhs);
+ if (lhs_bossBelong != rhs_bossBelong)
+ {
+ return -lhs_bossBelong.CompareTo(rhs_bossBelong);
+ }
+ var playerId = PlayerDatas.Instance.baseData.PlayerID;
+ var lhs_atkself = model.GetPlayerAtkTarget(lhs) == playerId;
+ var rhs_atkself = model.GetPlayerAtkTarget(rhs) == playerId;
+ if (lhs_atkself != rhs_atkself)
+ {
+ return -lhs_atkself.CompareTo(rhs_atkself);
+ }
+ return 0;
+ }
+ }
+
+}
+
+
+
+
diff --git a/System/HazyRegion/HazyDemonKingDungeonWin.cs.meta b/System/HazyRegion/HazyDemonKingDungeonWin.cs.meta
new file mode 100644
index 0000000..b5236dd
--- /dev/null
+++ b/System/HazyRegion/HazyDemonKingDungeonWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: d8e0f4c916a141d4a85759d2fce71ed5
+timeCreated: 1554881621
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/HazyDemonKingModel.cs b/System/HazyRegion/HazyDemonKingModel.cs
new file mode 100644
index 0000000..9da9ceb
--- /dev/null
+++ b/System/HazyRegion/HazyDemonKingModel.cs
@@ -0,0 +1,258 @@
+锘縰sing System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+namespace Snxxz.UI
+{
+ public class HazyDemonKingModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
+ {
+ Dictionary<uint, HazyDemonKingPlayerInfo> m_PlayerInfos = new Dictionary<uint, HazyDemonKingPlayerInfo>();
+
+ public bool IsInDungeon { get; private set; }
+
+ public int invincibleBuffId { get; private set; }
+
+ public const int Client_MapID = 2000;
+
+ public event Action onPlayerInfoRefresh;
+
+ HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
+
+ public override void Init()
+ {
+ StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
+ GlobalTimeEvent.Instance.secondEvent += PerSecond;
+ }
+
+ public void OnBeforePlayerDataInitialize()
+ {
+ m_PlayerInfos.Clear();
+ }
+
+ public void OnPlayerLoginOk()
+ {
+
+ }
+
+ public override void UnInit()
+ {
+ StageLoad.Instance.onStageLoadFinish -= OnStageLoadFinish;
+ GlobalTimeEvent.Instance.secondEvent -= PerSecond;
+ }
+
+ private void OnStageLoadFinish()
+ {
+ var mapId = PlayerDatas.Instance.baseData.MapID;
+
+ IsInDungeon = false;
+ if (IsInDemonKingDungeon(mapId))
+ {
+ IsInDungeon = true;
+ RefreshAroundPlayer();
+ }
+ }
+
+ private void PerSecond()
+ {
+ if (IsInDungeon)
+ {
+ var requireRefreshPlayer = false;
+ var actors = GAMgr.Instance.GetGroupList(E_ActorGroup.Player);
+ if ((actors != null && actors.Count != m_PlayerInfos.Count)
+ || (actors == null && m_PlayerInfos.Count != 0))
+ {
+ requireRefreshPlayer = true;
+ }
+ else if (actors != null)
+ {
+ foreach (var actor in actors)
+ {
+ var player = actor as GA_Player;
+ if (!m_PlayerInfos.ContainsKey(player.ServerInstID))
+ {
+ requireRefreshPlayer = true;
+ }
+ }
+ }
+
+ var playerId = PlayerDatas.Instance.PlayerId;
+ if (IsExistBelongTo(playerId))
+ {
+ if (!m_PlayerInfos.ContainsKey(playerId))
+ {
+ requireRefreshPlayer = true;
+ }
+ }
+ else
+ {
+ if (m_PlayerInfos.ContainsKey(playerId))
+ {
+ requireRefreshPlayer = true;
+ }
+ }
+
+ if (requireRefreshPlayer)
+ {
+ RefreshAroundPlayer();
+ }
+ }
+ }
+
+ public void RefreshAroundPlayer()
+ {
+ m_PlayerInfos.Clear();
+ var actors = GAMgr.Instance.GetGroupList(E_ActorGroup.Player);
+ if (actors != null)
+ {
+ foreach (var actor in actors)
+ {
+ var player = actor as GA_Player;
+ if (!m_PlayerInfos.ContainsKey(player.ServerInstID))
+ {
+ m_PlayerInfos.Add(player.ServerInstID, new HazyDemonKingPlayerInfo()
+ {
+ job = player.ActorInfo.Job,
+ hp = player.ActorInfo.RealHp,
+ maxHp = player.ActorInfo.RealMaxHp,
+ playerName = UIHelper.ServerStringTrim(player.ActorInfo.PlayerName),
+ });
+ }
+ }
+ }
+
+ var playerId = PlayerDatas.Instance.PlayerId;
+ if (IsExistBelongTo(playerId))
+ {
+ if (!m_PlayerInfos.ContainsKey(playerId))
+ {
+ var hero = PlayerDatas.Instance.hero;
+ m_PlayerInfos.Add(playerId, new HazyDemonKingPlayerInfo()
+ {
+ job = PlayerDatas.Instance.baseData.Job,
+ hp = hero.ActorInfo.RealHp,
+ maxHp = hero.ActorInfo.RealMaxHp,
+ playerName = PlayerDatas.Instance.baseData.PlayerName,
+ });
+ }
+ }
+ else
+ {
+ if (m_PlayerInfos.ContainsKey(playerId))
+ {
+ m_PlayerInfos.Remove(playerId);
+ }
+ }
+
+ if (onPlayerInfoRefresh != null)
+ {
+ onPlayerInfoRefresh();
+ }
+ }
+
+ public bool IsInDemonKingDungeon(int mapId)
+ {
+ if (mapId == Client_MapID)
+ {
+ return true;
+ }
+
+ var configs = HazyRegionConfig.GetValues();
+ foreach (var config in configs)
+ {
+ if (config.incidentType == (int)HazyRegionIncidentType.Boss
+ && config.dungeonId == mapId)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public bool TryGetPlayerInfo(uint playerId, out HazyDemonKingPlayerInfo playerInfo)
+ {
+ return m_PlayerInfos.TryGetValue(playerId, out playerInfo);
+ }
+
+ public ICollection<uint> GetPlayerIds()
+ {
+ return m_PlayerInfos.Keys;
+ }
+
+ public void SendSelectAtkTarget(uint serverInstId)
+ {
+
+ }
+
+ public uint GetPlayerAtkTarget(uint serverInstId)
+ {
+ if (ClientDungeonStageUtility.clientMapId == Client_MapID)
+ {
+ return ClientHazyDemonKingStage.GetClientBossSid();
+ }
+ return 0;
+ }
+
+ public bool IsExistBelongTo(uint playerId)
+ {
+ if (playerId == PlayerDatas.Instance.PlayerId
+ && ClientDungeonStageUtility.clientMapId == Client_MapID)
+ {
+ return true;
+ }
+ return StatusMgr.Instance.IsExistBossBelong(playerId);
+ }
+
+ public void RequestEnterClientDungeon()
+ {
+ var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
+
+ MapTransferUtility.Instance.Clear();
+ ClientDungeonStageUtility.SetClientDungeon(true, Client_MapID);
+ ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
+ CrossServerLogin.Instance.SetWaitForLoginCrossServerState(false);
+ StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
+ {
+ toMapId = Client_MapID,
+ toLineId = 0,
+ needEmpty = true,
+ needLoadResource = true,
+ serverType = ServerType.Main,
+ isClientLoadMap = true
+ });
+
+ PlayerDatas.Instance.baseData.mainServerMapIdRecord = PlayerDatas.Instance.baseData.MapID;
+ PlayerDatas.Instance.baseData.MapID = Client_MapID;
+ var attackMode = new C030A_tagCChangeAttackMode();
+ attackMode.Mode = (byte)E_AttackMode.Peace;
+ GameNetSystem.Instance.PushPackage(attackMode, ServerType.Main);
+ }
+
+ public void RequestExitClientDungeon()
+ {
+ ClientDungeonStageUtility.SetClientDungeon(false, 0);
+ ClientDungeonStageUtility.RequestExitClientDungeon();
+ PlayerDatas.Instance.extersion.pkState = 0;
+ ModelCenter.Instance.GetModel<DungeonModel>().ResetBufData();
+
+ PlayerDatas.Instance.baseData.MapID = PlayerDatas.Instance.baseData.mainServerMapIdRecord;
+ StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
+ {
+ toMapId = PlayerDatas.Instance.baseData.MapID,
+ toLineId = 0,
+ needEmpty = true,
+ needLoadResource = true,
+ serverType = ServerType.Main,
+ isClientLoadMap = true
+ });
+ }
+ }
+
+ public struct HazyDemonKingPlayerInfo
+ {
+ public string playerName;
+ public int job;
+ public ulong hp;
+ public ulong maxHp;
+ }
+}
+
diff --git a/System/HazyRegion/HazyDemonKingModel.cs.meta b/System/HazyRegion/HazyDemonKingModel.cs.meta
new file mode 100644
index 0000000..1579856
--- /dev/null
+++ b/System/HazyRegion/HazyDemonKingModel.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 8122b2ce152c76143afa0f42beab82ae
+timeCreated: 1554860554
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/HazyDemonKingPlayerBehaviour.cs b/System/HazyRegion/HazyDemonKingPlayerBehaviour.cs
new file mode 100644
index 0000000..fb3825d
--- /dev/null
+++ b/System/HazyRegion/HazyDemonKingPlayerBehaviour.cs
@@ -0,0 +1,207 @@
+锘縰sing System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+ public class HazyDemonKingPlayerBehaviour : ScrollItem
+ {
+ [SerializeField] Transform m_ContainerOwn;
+ [SerializeField] ImageEx m_HeadIcon;
+ [SerializeField] Text m_PlayerName;
+ [SerializeField] SmoothSlider m_HpSlider;
+
+ [SerializeField] Transform m_ContainerFightState;
+ [SerializeField] Image m_FightSign;
+ [SerializeField] Text m_AtkState;
+ [SerializeField] Button m_SelectAtk;
+
+ bool dirty = false;
+
+ bool bossBelongTo = false;
+ int hpPer = 0;
+ int atkState = 0;
+
+ uint playerId = 0;
+
+ HazyDemonKingModel model { get { return ModelCenter.Instance.GetModel<HazyDemonKingModel>(); } }
+
+ public override void Display(object _data)
+ {
+ base.Display(_data);
+
+ playerId = (uint)_data;
+
+ dirty = false;
+
+ Initialized();
+
+ DisplayBase();
+ DisplayPlayerInfo();
+
+ GlobalTimeEvent.Instance.secondEvent -= PerSecond;
+ GlobalTimeEvent.Instance.secondEvent += PerSecond;
+
+ m_SelectAtk.SetListener(SelectAtk);
+ }
+
+ private void PerSecond()
+ {
+ if (dirty)
+ {
+ DisplayPlayerInfo();
+ dirty = false;
+ }
+ }
+
+ private void Initialized()
+ {
+ RefreshBossBelongTo();
+
+ hpPer = 0;
+ GActor actor = GAMgr.Instance.GetBySID(playerId);
+ if (actor != null)
+ {
+ var player = actor as GActorPlayerBase;
+ hpPer = Mathf.CeilToInt((float)player.ActorInfo.RealHp / player.ActorInfo.RealMaxHp * 100f);
+ }
+ else
+ {
+ HazyDemonKingPlayerInfo playerInfo;
+ if (model.TryGetPlayerInfo(playerId, out playerInfo))
+ {
+ hpPer = Mathf.CeilToInt((float)playerInfo.hp / playerInfo.maxHp * 100f);
+ }
+ }
+
+ RefreshAtkState();
+ }
+
+ void DisplayBase()
+ {
+ HazyDemonKingPlayerInfo playerInfo;
+ if (model.TryGetPlayerInfo(playerId, out playerInfo))
+ {
+ m_HeadIcon.SetSprite(GeneralDefine.GetOtherJobHeadPortrait(playerInfo.job, 0));
+ m_PlayerName.text = playerInfo.playerName;
+ }
+ }
+
+ void DisplayPlayerInfo()
+ {
+ m_ContainerOwn.gameObject.SetActive(bossBelongTo);
+ m_HeadIcon.gray = hpPer == 0;
+ m_HpSlider.value = hpPer / 100f;
+
+ m_ContainerFightState.gameObject.SetActive(playerId != PlayerDatas.Instance.PlayerId);
+
+ if (playerId != PlayerDatas.Instance.PlayerId)
+ {
+ switch (atkState)
+ {
+ case 0:
+ m_FightSign.SetSprite("HazyFightState_Red");
+ m_AtkState.text = "鎴樻枟涓�";
+ m_AtkState.color = UIHelper.GetUIColor(TextColType.Red, true);
+ break;
+ case 1:
+ m_FightSign.SetSprite("HazyFightState_White");
+ m_AtkState.text = "鍙嶅嚮";
+ m_AtkState.color = UIHelper.GetUIColor(TextColType.Red, true);
+ break;
+ case 2:
+ m_FightSign.SetSprite("HazyFightState_White");
+ m_AtkState.text = "鏀诲嚮";
+ m_AtkState.color = UIHelper.GetUIColor(TextColType.NavyBrown, true);
+ break;
+ }
+ }
+ }
+
+ private void SelectAtk()
+ {
+ model.SendSelectAtkTarget(playerId);
+ }
+
+ void LateUpdate()
+ {
+ if (RefreshBossBelongTo())
+ {
+ dirty = true;
+ }
+
+ if (RefreshHpPer())
+ {
+ dirty = true;
+ }
+
+ if (RefreshAtkState())
+ {
+ dirty = true;
+ }
+ }
+
+ bool RefreshBossBelongTo()
+ {
+ if (bossBelongTo != model.IsExistBelongTo(playerId))
+ {
+ bossBelongTo = model.IsExistBelongTo(playerId);
+ return true;
+ }
+ return false;
+ }
+
+ bool RefreshHpPer()
+ {
+ GActor actor = GAMgr.Instance.GetBySID(playerId);
+ if (actor != null)
+ {
+ var player = actor as GActorPlayerBase;
+ var per = Mathf.CeilToInt((float)player.ActorInfo.RealHp / player.ActorInfo.RealMaxHp * 100f);
+ if (hpPer != per)
+ {
+ hpPer = per;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ bool RefreshAtkState()
+ {
+ var _state = 0;
+ var myPlayerId = PlayerDatas.Instance.baseData.PlayerID;
+ var atkTargetId = model.GetPlayerAtkTarget(playerId);
+ var myAtkTargetId = model.GetPlayerAtkTarget(myPlayerId);
+ if (myAtkTargetId == playerId)
+ {
+ _state = 0;
+ }
+ else if (atkTargetId == myPlayerId)
+ {
+ _state = 1;
+ }
+ else
+ {
+ _state = 2;
+ }
+
+ if (_state != atkState)
+ {
+ atkState = _state;
+ return true;
+ }
+ return false;
+ }
+
+ public override void Dispose()
+ {
+ base.Dispose();
+
+ GlobalTimeEvent.Instance.secondEvent -= PerSecond;
+ }
+ }
+}
+
diff --git a/System/HazyRegion/HazyDemonKingPlayerBehaviour.cs.meta b/System/HazyRegion/HazyDemonKingPlayerBehaviour.cs.meta
new file mode 100644
index 0000000..18fe25e
--- /dev/null
+++ b/System/HazyRegion/HazyDemonKingPlayerBehaviour.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 6abbedbcf5140d04a986b79c4e3eb7d6
+timeCreated: 1554882000
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/HazyDemonKingVictoryWin.cs b/System/HazyRegion/HazyDemonKingVictoryWin.cs
new file mode 100644
index 0000000..093c3a2
--- /dev/null
+++ b/System/HazyRegion/HazyDemonKingVictoryWin.cs
@@ -0,0 +1,194 @@
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Friday, April 12, 2019
+//--------------------------------------------------------
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+
+ public class HazyDemonKingVictoryWin : Window
+ {
+ [SerializeField] Transform m_ContainerPoivt;
+ [SerializeField] Text m_PlayerName;
+ [SerializeField] ScrollRect m_RewardsScroll;
+ [SerializeField] Text m_ExitTimer;
+ [SerializeField] HorizontalLayoutGroup m_RewardLayout;
+ [SerializeField] ButtonEx m_Exit;
+
+ List<DemonJarRewardBehaviour> m_Items = new List<DemonJarRewardBehaviour>();
+
+ float timer = 0f;
+
+ DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
+
+ #region Built-in
+ protected override void BindController()
+ {
+ }
+
+ protected override void AddListeners()
+ {
+ m_Exit.AddListener(ExitDungeon);
+ }
+
+ protected override void OnPreOpen()
+ {
+ timer = 0f;
+ m_ContainerPoivt.gameObject.SetActive(false);
+ }
+
+ protected override void OnActived()
+ {
+ base.OnActived();
+ var config = DungeonOpenTimeConfig.Get(PlayerDatas.Instance.baseData.MapID);
+ StartCoroutine(Co_DelayDisplay(config.DelayTime * 0.001f));
+ }
+
+ protected override void OnAfterOpen()
+ {
+ }
+
+ protected override void OnPreClose()
+ {
+ }
+
+ protected override void OnAfterClose()
+ {
+ }
+
+ protected override void LateUpdate()
+ {
+ base.LateUpdate();
+
+ var endTime = model.GetCoolDownEndTime(DungeonCoolDownType.LeaveMap);
+ if (endTime > TimeUtility.ServerNow)
+ {
+ timer -= Time.deltaTime;
+ if (timer < 0f)
+ {
+ timer = 1f;
+ var seconds = (endTime - TimeUtility.ServerNow).TotalSeconds;
+ m_ExitTimer.text = Language.Get("DungeonVictoryWin_Btn_Exit_1", Mathf.Clamp((int)seconds, 0, int.MaxValue));
+ }
+
+ if (!m_ExitTimer.gameObject.activeInHierarchy)
+ {
+ m_ExitTimer.gameObject.SetActive(true);
+ }
+ }
+ else
+ {
+ if (m_ExitTimer.gameObject.activeInHierarchy)
+ {
+ m_ExitTimer.gameObject.SetActive(false);
+ }
+ }
+ }
+ #endregion
+
+ IEnumerator Co_DelayDisplay(float _delay)
+ {
+ yield return new WaitForSeconds(_delay);
+
+ var endTime = model.GetCoolDownEndTime(DungeonCoolDownType.LeaveMap);
+ var seconds = (endTime - TimeUtility.ServerNow).TotalSeconds;
+ timer = 0f;
+ m_ExitTimer.text = Language.Get("DungeonVictoryWin_Btn_Exit_1", Mathf.Clamp((int)seconds, 0, int.MaxValue));
+ m_ExitTimer.gameObject.SetActive(true);
+ m_ContainerPoivt.gameObject.SetActive(true);
+
+ DisplayRewards();
+ DisplayBelongTo();
+ }
+
+ private void DisplayRewards()
+ {
+ var serverItems = model.dungeonResult.itemInfo;
+ var items = new List<Item>();
+
+ var itemCount = 0;
+
+ if (serverItems != null)
+ {
+ for (int i = 0; i < serverItems.Length; i++)
+ {
+ items.Add(new Item(serverItems[i].ItemID, serverItems[i].Count));
+ }
+
+ itemCount = serverItems.Length;
+ }
+
+
+ GenerateRewardBehaviour(m_RewardsScroll.content, items.Count);
+
+ if (itemCount < 6)
+ {
+ m_RewardLayout.childAlignment = TextAnchor.MiddleCenter;
+ (m_RewardLayout.transform as RectTransform).pivot = new Vector2(0.5f, 0.5f);
+ }
+ else
+ {
+ m_RewardLayout.childAlignment = TextAnchor.MiddleLeft;
+ (m_RewardLayout.transform as RectTransform).pivot = new Vector2(0, 0.5f);
+ }
+
+ for (int i = 0; i < m_Items.Count; i++)
+ {
+ var behaviour = m_Items[i];
+ if (i < items.Count)
+ {
+ behaviour.gameObject.SetActive(true);
+ behaviour.Display(items[i]);
+ }
+ else
+ {
+ behaviour.gameObject.SetActive(false);
+ }
+ }
+ }
+
+ void DisplayBelongTo()
+ {
+ m_PlayerName.text = UIHelper.ServerStringTrim(model.dungeonResult.ownerName);
+ }
+
+ private void ExitDungeon()
+ {
+ if (PlayerDatas.Instance.baseData.MapID == HazyDemonKingModel.Client_MapID)
+ {
+ ModelCenter.Instance.GetModel<HazyDemonKingModel>().RequestExitClientDungeon();
+ }
+ else
+ {
+ model.ExitCurrentDungeon();
+ }
+ }
+
+ private void GenerateRewardBehaviour(RectTransform _parent, int _needCount)
+ {
+ var nowCount = m_Items.Count;
+ var dif = _needCount - nowCount;
+ if (dif > 0)
+ {
+ for (int i = 0; i < dif; i++)
+ {
+ var instance = UIUtility.CreateWidget("DemonJarRewardBehaviour", "DemonJarRewardBehaviour");
+ var behaviour = instance.GetComponent<DemonJarRewardBehaviour>();
+ m_Items.Add(behaviour);
+ instance.transform.SetParentEx(_parent, Vector3.zero, Vector3.zero, Vector3.one);
+ }
+ }
+ }
+ }
+
+}
+
+
+
+
diff --git a/System/HazyRegion/HazyDemonKingVictoryWin.cs.meta b/System/HazyRegion/HazyDemonKingVictoryWin.cs.meta
new file mode 100644
index 0000000..e1be2fb
--- /dev/null
+++ b/System/HazyRegion/HazyDemonKingVictoryWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 755ec5b8ac83ebe45884700b3ef99683
+timeCreated: 1555054379
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/HazyGrassDungeonWin.cs b/System/HazyRegion/HazyGrassDungeonWin.cs
new file mode 100644
index 0000000..f57fe7c
--- /dev/null
+++ b/System/HazyRegion/HazyGrassDungeonWin.cs
@@ -0,0 +1,95 @@
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Monday, April 15, 2019
+//--------------------------------------------------------
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+
+ public class HazyGrassDungeonWin : Window
+ {
+ [SerializeField] DungeonTargetBehaviour m_DungeonTarget;
+ [SerializeField] Text m_BasicGrassCount;
+ [SerializeField] Text m_FairyGrassCount;
+ [SerializeField] Text m_BasicGrassRefreshTime;
+ [SerializeField] Text m_FairyGrassRefreshTime;
+
+ DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
+ HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
+ HazyGrassModel hazyGrassModel { get { return ModelCenter.Instance.GetModel<HazyGrassModel>(); } }
+ #region Built-in
+ protected override void BindController()
+ {
+ }
+
+ protected override void AddListeners()
+ {
+ }
+
+ protected override void OnPreOpen()
+ {
+ Display();
+
+ GlobalTimeEvent.Instance.secondEvent += PerSecond;
+ }
+
+ protected override void OnAfterOpen()
+ {
+ }
+
+ protected override void OnPreClose()
+ {
+ GlobalTimeEvent.Instance.secondEvent -= PerSecond;
+ }
+
+ protected override void OnAfterClose()
+ {
+ }
+ #endregion
+
+ private void PerSecond()
+ {
+ DisplayGrassRefreshTime();
+ }
+
+ void Display()
+ {
+ if (ClientDungeonStageUtility.isClientDungeon)
+ {
+ var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
+ m_DungeonTarget.Init(config.dungeonId);
+ }
+ else
+ {
+ var mapId = PlayerDatas.Instance.baseData.MapID;
+ m_DungeonTarget.Init(mapId);
+ }
+
+ DisplayGrassRefreshTime();
+ }
+
+ void DisplayGrassCount()
+ {
+
+ }
+
+ void DisplayGrassRefreshTime()
+ {
+ var used = Mathf.Max(0, (int)(TimeUtility.ServerNow - hazyGrassModel.grassBornTime).TotalSeconds);
+ var refreshSeconds = hazyGrassModel.grassRefreshSeconds - used % hazyGrassModel.grassRefreshSeconds;
+ m_BasicGrassRefreshTime.text = string.Format("鍩虹鑽変笡{0}鍚庡埛鏂�", TimeUtility.SecondsToMS(refreshSeconds));
+ m_FairyGrassRefreshTime.text = string.Format("鐏佃崏涓泏0}鍚庡埛鏂�", TimeUtility.SecondsToMS(refreshSeconds));
+ }
+ }
+
+}
+
+
+
+
diff --git a/System/HazyRegion/HazyGrassDungeonWin.cs.meta b/System/HazyRegion/HazyGrassDungeonWin.cs.meta
new file mode 100644
index 0000000..1732fcd
--- /dev/null
+++ b/System/HazyRegion/HazyGrassDungeonWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: b4aee95f31119204f92589ee74cb04e5
+timeCreated: 1555293316
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/HazyGrassModel.cs b/System/HazyRegion/HazyGrassModel.cs
new file mode 100644
index 0000000..5f0f6be
--- /dev/null
+++ b/System/HazyRegion/HazyGrassModel.cs
@@ -0,0 +1,149 @@
+锘縰sing System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+namespace Snxxz.UI
+{
+ public class HazyGrassModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
+ {
+ public const int ReikiGrassMapId = 32040;
+ public const int FairyGrassMapId = 32050;
+ public const int Client_ReikiGrassMapID = 3240;
+ public const int Client_FairyGrassMapID = 3250;
+
+ public bool IsInDungeon { get; private set; }
+
+ public int grassRefreshSeconds { get; private set; }
+
+ public DateTime grassBornTime { get; private set; }
+
+ HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
+
+ public override void Init()
+ {
+ ParseConfig();
+
+ StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
+ }
+
+ public void OnBeforePlayerDataInitialize()
+ {
+ }
+
+ public void OnPlayerLoginOk()
+ {
+ }
+
+ public override void UnInit()
+ {
+ StageLoad.Instance.onStageLoadFinish -= OnStageLoadFinish;
+ }
+
+ void ParseConfig()
+ {
+ grassRefreshSeconds = 20;
+ }
+
+ private void OnStageLoadFinish()
+ {
+ var mapId = PlayerDatas.Instance.baseData.MapID;
+
+ IsInDungeon = false;
+ if (IsInGrassDungeon(mapId))
+ {
+ IsInDungeon = true;
+ }
+ }
+
+ public bool IsInGrassDungeon(int mapId)
+ {
+ if (mapId == Client_ReikiGrassMapID
+ || mapId == Client_FairyGrassMapID)
+ {
+ return true;
+ }
+
+ var configs = HazyRegionConfig.GetValues();
+ foreach (var config in configs)
+ {
+ if ((config.incidentType == (int)HazyRegionIncidentType.FairyGrass
+ || config.incidentType == (int)HazyRegionIncidentType.ReikiGrass)
+ && config.dungeonId == mapId)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public int GetClientMapId(int incidentId)
+ {
+ var config = HazyRegionConfig.Get(incidentId);
+ switch ((HazyRegionIncidentType)config.incidentType)
+ {
+ case HazyRegionIncidentType.FairyGrass:
+ return Client_FairyGrassMapID;
+ case HazyRegionIncidentType.ReikiGrass:
+ return Client_ReikiGrassMapID;
+ }
+ return 0;
+ }
+
+ public void RefreshGrassBornTime()
+ {
+
+ }
+
+ public void RefreshGrassBornTime(DateTime _time)
+ {
+ grassBornTime = _time;
+ }
+
+ public void RequestEnterClientDungeon()
+ {
+ var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
+
+ var mapId = GetClientMapId(hazyRegionModel.processingIncidentId);
+
+ MapTransferUtility.Instance.Clear();
+ ClientDungeonStageUtility.SetClientDungeon(true, (ushort)mapId);
+ ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
+ CrossServerLogin.Instance.SetWaitForLoginCrossServerState(false);
+ StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
+ {
+ toMapId = mapId,
+ toLineId = 0,
+ needEmpty = true,
+ needLoadResource = true,
+ serverType = ServerType.Main,
+ isClientLoadMap = true
+ });
+
+ PlayerDatas.Instance.baseData.mainServerMapIdRecord = PlayerDatas.Instance.baseData.MapID;
+ PlayerDatas.Instance.baseData.MapID = (ushort)mapId;
+ var attackMode = new C030A_tagCChangeAttackMode();
+ attackMode.Mode = (byte)E_AttackMode.Peace;
+ GameNetSystem.Instance.PushPackage(attackMode, ServerType.Main);
+ }
+
+ public void RequestExitClientDungeon()
+ {
+ ClientDungeonStageUtility.SetClientDungeon(false, 0);
+ ClientDungeonStageUtility.RequestExitClientDungeon();
+ PlayerDatas.Instance.extersion.pkState = 0;
+ ModelCenter.Instance.GetModel<DungeonModel>().ResetBufData();
+
+ PlayerDatas.Instance.baseData.MapID = PlayerDatas.Instance.baseData.mainServerMapIdRecord;
+ StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
+ {
+ toMapId = PlayerDatas.Instance.baseData.MapID,
+ toLineId = 0,
+ needEmpty = true,
+ needLoadResource = true,
+ serverType = ServerType.Main,
+ isClientLoadMap = true
+ });
+ }
+ }
+}
+
diff --git a/System/HazyRegion/HazyGrassModel.cs.meta b/System/HazyRegion/HazyGrassModel.cs.meta
new file mode 100644
index 0000000..89d2d2c
--- /dev/null
+++ b/System/HazyRegion/HazyGrassModel.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: c0449f2089c64ff4f9b5b0e23a535dd0
+timeCreated: 1555038542
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/HazyMapNpcScriptableObject.cs b/System/HazyRegion/HazyMapNpcScriptableObject.cs
new file mode 100644
index 0000000..7603e14
--- /dev/null
+++ b/System/HazyRegion/HazyMapNpcScriptableObject.cs
@@ -0,0 +1,100 @@
+锘縰sing System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using System;
+#if UNITY_EDITOR
+using UnityEditor;
+#endif
+public class HazyMapNpcScriptableObject : ScriptableObject
+{
+ [SerializeField] NpcInfo[] m_MapNpcInfos;
+
+ public NpcInfo[] GetAllNpcInfos()
+ {
+ return m_MapNpcInfos;
+ }
+
+#if UNITY_EDITOR
+ public void Save(int index, Vector3 position)
+ {
+ if (m_MapNpcInfos != null && index < m_MapNpcInfos.Length)
+ {
+ m_MapNpcInfos[index] = new NpcInfo()
+ {
+ npcId = m_MapNpcInfos[index].npcId,
+ npcType = m_MapNpcInfos[index].npcType,
+ position = position,
+ };
+ }
+ }
+#endif
+
+ [Serializable]
+ public struct NpcInfo
+ {
+ public int npcId;
+ public E_NpcType npcType;
+ public Vector3 position;
+ }
+}
+
+#if UNITY_EDITOR
+[CustomEditor(typeof(HazyMapNpcScriptableObject))]
+public class HazyMapNpcInspector : Editor
+{
+ [SerializeField] int index = 0;
+
+ public override void OnInspectorGUI()
+ {
+ var npcConfig = target as HazyMapNpcScriptableObject;
+
+ index = EditorGUILayout.IntField("Index", index);
+
+ var dropRect = GUILayoutUtility.GetRect(0f, 100f, GUILayout.ExpandWidth(true));
+ var style = new GUIStyle(GUI.skin.box);
+ style.normal.textColor = Color.white;
+ style.alignment = TextAnchor.MiddleCenter;
+ GUI.Box(dropRect, "鎷栧姩鐗╀綋鑷虫鍙祴鍊间綅缃�", style);
+
+ if (dropRect.Contains(Event.current.mousePosition))
+ {
+ switch (Event.current.type)
+ {
+ case EventType.DragUpdated:
+ DragAndDrop.activeControlID = GUIUtility.GetControlID(FocusType.Passive);
+ DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
+ break;
+ case EventType.DragPerform:
+ DragAndDrop.activeControlID = GUIUtility.GetControlID(FocusType.Passive);
+ DragAndDrop.AcceptDrag();
+ Event.current.Use();
+
+ if (DragAndDrop.objectReferences != null && DragAndDrop.objectReferences.Length > 0)
+ {
+ var obj = DragAndDrop.objectReferences[0];
+ if(obj is GameObject)
+ {
+ var go = obj as GameObject;
+ npcConfig.Save(index, go.transform.position);
+ }
+ }
+ break;
+ }
+ }
+
+ base.OnInspectorGUI();
+ }
+
+ [MenuItem("绛栧垝宸ュ叿/鐢熸垚缂ョ紙浠欏煙Npc閰嶇疆")]
+ static void Create()
+ {
+ var _config = CreateInstance<HazyMapNpcScriptableObject>();
+ string _path = StringUtility.Contact("Assets/ResourcesOut/Refdata/ScriptableObject/SoHazyMapNpc/",
+ "SoHazyMapNpc_",
+ ".asset");
+ AssetDatabase.CreateAsset(_config, _path);
+ AssetDatabase.Refresh();
+ ProjectWindowUtil.ShowCreatedAsset(_config);
+ }
+}
+#endif
\ No newline at end of file
diff --git a/System/HazyRegion/HazyMapNpcScriptableObject.cs.meta b/System/HazyRegion/HazyMapNpcScriptableObject.cs.meta
new file mode 100644
index 0000000..5746784
--- /dev/null
+++ b/System/HazyRegion/HazyMapNpcScriptableObject.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 35925d9830d8dd44a802f58110441d91
+timeCreated: 1555147634
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/HazyRegionBuyTimesWin.cs b/System/HazyRegion/HazyRegionBuyTimesWin.cs
new file mode 100644
index 0000000..8e63b3f
--- /dev/null
+++ b/System/HazyRegion/HazyRegionBuyTimesWin.cs
@@ -0,0 +1,222 @@
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Monday, April 08, 2019
+//--------------------------------------------------------
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+
+ public class HazyRegionBuyTimesWin : Window
+ {
+ [SerializeField] Text m_BuyTimes;
+ [SerializeField] Text m_Money;
+ [SerializeField] Button m_Buy;
+
+ [SerializeField] Transform m_ContainerUseItem;
+ [SerializeField] Text m_UseItemTimes;
+ [SerializeField] ItemBehaviour m_Item;
+ [SerializeField] Button m_Use;
+
+ [SerializeField] Button m_Close;
+
+ HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
+ PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
+ DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
+ #region Built-in
+ protected override void BindController()
+ {
+ }
+
+ protected override void AddListeners()
+ {
+ m_Close.AddListener(CloseClick);
+ m_Buy.AddListener(OnBuyTimes);
+ m_Use.AddListener(OnUseItem);
+ }
+
+ protected override void OnPreOpen()
+ {
+ dailyQuestModel.dailyQuestProgressUpdateEvent += DailyQuestProgressUpdateEvent;
+ packModel.refreshItemCountEvent += RefreshItemCountEvent;
+
+ Display();
+ }
+
+ protected override void OnAfterOpen()
+ {
+ }
+
+ protected override void OnPreClose()
+ {
+ dailyQuestModel.dailyQuestProgressUpdateEvent -= DailyQuestProgressUpdateEvent;
+ packModel.refreshItemCountEvent -= RefreshItemCountEvent;
+ }
+
+ protected override void OnAfterClose()
+ {
+ }
+ #endregion
+
+ void Display()
+ {
+ DisplayMoney();
+ DisplayTimes();
+ DisplayItem();
+ }
+
+ void DisplayMoney()
+ {
+ var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
+ var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
+ m_Money.text = Language.Get("HazyRegionBuyTimesCost", dailyQuestOpenTime.BuyNeedMoney);
+ }
+
+ void DisplayTimes()
+ {
+ DailyQuestTimes dailyQuestTimes;
+
+ var dayUseItemTimes = 0;
+ var dayBuyTimes = 0;
+
+ if (dailyQuestModel.TryGetDailyQuestTimes((int)DailyQuestType.HazyRegion, out dailyQuestTimes))
+ {
+ dayUseItemTimes = dailyQuestTimes.dayUseItemTimes;
+ dayBuyTimes = dailyQuestTimes.dayBuyTimes;
+ }
+
+ var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
+ var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
+
+ var times = Mathf.Clamp(dailyQuestOpenTime.DayBuyTimes - dayBuyTimes, 0, dailyQuestOpenTime.DayBuyTimes);
+ var label = UIHelper.AppendColor(times == 0 ? TextColType.Red : TextColType.Green, times.ToString(), true);
+ m_BuyTimes.text = StringUtility.Contact(label, "/", dailyQuestOpenTime.DayBuyTimes);
+
+ if (dailyQuestOpenTime.DayItemID != 0)
+ {
+ times = Mathf.Clamp(dailyQuestOpenTime.DayItemAddTimes - dayUseItemTimes, 0, dailyQuestOpenTime.DayItemAddTimes);
+ label = UIHelper.AppendColor(times == 0 ? TextColType.Red : TextColType.Green, times.ToString(), true);
+
+ m_UseItemTimes.text = StringUtility.Contact(label, "/", dailyQuestOpenTime.DayItemAddTimes);
+ }
+ }
+
+ void DisplayItem()
+ {
+ var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
+ var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
+
+ m_ContainerUseItem.gameObject.SetActive(dailyQuestOpenTime.DayItemID != 0);
+ if (dailyQuestOpenTime.DayItemID != 0)
+ {
+ m_Item.SetItem(dailyQuestOpenTime.DayItemID, 1);
+ }
+ }
+
+ private void DailyQuestProgressUpdateEvent(int id)
+ {
+ var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
+ if (config != null && id == config.RelatedID)
+ {
+ DisplayTimes();
+ }
+ }
+
+ private void RefreshItemCountEvent(PackType packType, int index, int itemId)
+ {
+ if (packType == PackType.Item)
+ {
+ var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
+ if (config != null)
+ {
+ var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
+ if (dailyQuestOpenTime != null && dailyQuestOpenTime.DayItemID == itemId)
+ {
+ DisplayItem();
+ }
+ }
+ }
+ }
+
+ private void OnUseItem()
+ {
+ DailyQuestTimes dailyQuestTimes;
+
+ var dayUseItemTimes = 0;
+
+ if (dailyQuestModel.TryGetDailyQuestTimes((int)DailyQuestType.HazyRegion, out dailyQuestTimes))
+ {
+ dayUseItemTimes = dailyQuestTimes.dayUseItemTimes;
+ }
+
+ var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
+ var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
+ if (dayUseItemTimes >= dailyQuestOpenTime.DayItemAddTimes)
+ {
+ return;
+ }
+
+ if (!model.TryAddTimes())
+ {
+ return;
+ }
+
+ var itemCount = packModel.GetItemCountByID(PackType.Item, dailyQuestOpenTime.DayItemID);
+ if (itemCount <= 0)
+ {
+ ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(dailyQuestOpenTime.DayItemID);
+ return;
+ }
+
+ var pak = new CA525_tagCMBuyDailyActionCnt();
+ pak.AddType = 1;
+ pak.ActionID = (uint)config.RelatedID;
+ GameNetSystem.Instance.SendInfo(pak);
+ }
+
+ private void OnBuyTimes()
+ {
+ DailyQuestTimes dailyQuestTimes;
+
+ var dayBuyTimes = 0;
+
+ if (dailyQuestModel.TryGetDailyQuestTimes((int)DailyQuestType.HazyRegion, out dailyQuestTimes))
+ {
+ dayBuyTimes = dailyQuestTimes.dayBuyTimes;
+ }
+
+ var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
+ var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
+ if (dayBuyTimes >= dailyQuestOpenTime.DayBuyTimes)
+ {
+ return;
+ }
+
+ if (!model.TryAddTimes())
+ {
+ return;
+ }
+
+ if (PlayerDatas.Instance.baseData.diamond < dailyQuestOpenTime.BuyNeedMoney)
+ {
+ WindowCenter.Instance.Open<RechargeTipWin>();
+ return;
+ }
+
+ var pak = new CA525_tagCMBuyDailyActionCnt();
+ pak.AddType = 0;
+ pak.ActionID = (uint)config.RelatedID;
+ GameNetSystem.Instance.SendInfo(pak);
+ }
+ }
+
+}
+
+
+
+
diff --git a/System/HazyRegion/HazyRegionBuyTimesWin.cs.meta b/System/HazyRegion/HazyRegionBuyTimesWin.cs.meta
new file mode 100644
index 0000000..2641c3c
--- /dev/null
+++ b/System/HazyRegion/HazyRegionBuyTimesWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 363f96dff81ee0342ad58f7d09951215
+timeCreated: 1554705839
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/HazyRegionCyclicScroll.cs b/System/HazyRegion/HazyRegionCyclicScroll.cs
new file mode 100644
index 0000000..c3fda91
--- /dev/null
+++ b/System/HazyRegion/HazyRegionCyclicScroll.cs
@@ -0,0 +1,77 @@
+锘縰sing System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+namespace Snxxz.UI
+{
+ public class HazyRegionCyclicScroll : CyclicScroll
+ {
+ [SerializeField] float m_FadeInTime = 0.2f;
+
+ bool m_IsPlaying = false;
+ public bool IsPlaying
+ {
+ get { return m_IsPlaying; }
+ private set
+ {
+ m_IsPlaying = value;
+ this.enabled = !m_IsPlaying;
+ }
+ }
+
+ Coroutine m_Coroutine = null;
+
+ public override void Init<T>(List<T> _datas, bool _stepByStep = false)
+ {
+ base.Init(_datas, _stepByStep);
+ IsPlaying = false;
+
+ if (m_Coroutine != null)
+ {
+ StopCoroutine(m_Coroutine);
+ m_Coroutine = null;
+ }
+ }
+
+ public void DisplayAnimation()
+ {
+ IsPlaying = true;
+
+ m_Coroutine = StartCoroutine(Co_DisplayAnimation());
+ }
+
+ IEnumerator Co_DisplayAnimation()
+ {
+ for (int i = 0; i < infiniteItems.Count; i++)
+ {
+ var behaviour = infiniteItems[i] as HazyRegionIncidentBehaviour;
+ behaviour.alphaTween.SetStartState();
+ }
+
+ var width = content.sizeDelta.x;
+
+ var time = 0f;
+
+ for (int i = 0; i < infiniteItems.Count; i++)
+ {
+ var behaviour = infiniteItems[i] as HazyRegionIncidentBehaviour;
+ behaviour.linerMove.duration = behaviour.alphaTween.duration;
+ var fromX = content.anchoredPosition.x + width / 2 + m_BoundOffset.left + cellSize.x;
+ behaviour.linerMove.from = content.anchoredPosition.SetX(fromX);
+ var toX = content.anchoredPosition.x - width / 2 + m_BoundOffset.left
+ + cellSize.x / 2 + i * (cellSize.x + spacing.x);
+ behaviour.linerMove.to = content.anchoredPosition.SetX(toX);
+ behaviour.alphaTween.Play();
+ behaviour.linerMove.Begin();
+ yield return WaitingForSecondConst.GetWaitForSeconds(m_FadeInTime);
+ time = behaviour.alphaTween.duration - m_FadeInTime;
+ }
+
+ time = Mathf.Max(0, time);
+
+ yield return WaitingForSecondConst.GetWaitForSeconds(time);
+
+ IsPlaying = false;
+ }
+ }
+}
+
diff --git a/System/HazyRegion/HazyRegionCyclicScroll.cs.meta b/System/HazyRegion/HazyRegionCyclicScroll.cs.meta
new file mode 100644
index 0000000..63b923a
--- /dev/null
+++ b/System/HazyRegion/HazyRegionCyclicScroll.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 30deeab42abedf7458bea9c513ed31b8
+timeCreated: 1554359458
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/HazyRegionDialogueWin.cs b/System/HazyRegion/HazyRegionDialogueWin.cs
new file mode 100644
index 0000000..13a3d4c
--- /dev/null
+++ b/System/HazyRegion/HazyRegionDialogueWin.cs
@@ -0,0 +1,151 @@
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Tuesday, April 09, 2019
+//--------------------------------------------------------
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+
+ public class HazyRegionDialogueWin : Window
+ {
+ [SerializeField] Button m_Skip;
+ [SerializeField] Button m_EmptyAccepter;
+
+ [SerializeField] Transform m_ContainerNpc;
+ [SerializeField] RawImage m_RawNpc;
+ [SerializeField] Text m_NpcName;
+ [SerializeField] Text m_NpcDialogue;
+
+ [SerializeField] Transform m_ContainerPlayer;
+ [SerializeField] RawImage m_RawPlayer;
+ [SerializeField] Text m_PlayerName;
+ [SerializeField] Text m_PlayerDialogue;
+
+ int dialogueIndex = 0;
+
+ public static int adventureDialogueId = 0;
+
+ HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
+
+ #region Built-in
+ protected override void BindController()
+ {
+ }
+
+ protected override void AddListeners()
+ {
+ m_EmptyAccepter.AddListener(OnClickEmpty);
+ m_Skip.AddListener(OnSkip);
+ }
+
+ protected override void OnPreOpen()
+ {
+ dialogueIndex = 0;
+ DisplayDialogue();
+ }
+
+ protected override void OnAfterOpen()
+ {
+
+ }
+ protected override void OnPreClose()
+ {
+ UI3DModelExhibition.Instance.StopShow();
+ }
+
+ protected override void OnAfterClose()
+ {
+ if (!WindowCenter.Instance.IsOpen<MainInterfaceWin>())
+ {
+ WindowCenter.Instance.Open<MainInterfaceWin>();
+ }
+ }
+
+ protected override void LateUpdate()
+ {
+ GA_Hero _hero = PlayerDatas.Instance.hero;
+ if (_hero == null)
+ {
+ return;
+ }
+
+ if (_hero.LockTarget == null)
+ {
+ return;
+ }
+
+ float _chkDistSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, _hero.LockTarget.Pos);
+ if (_chkDistSqrt > Mathf.Pow(GeneralDefine.FarawayNpcDist, 2))
+ {
+ _hero.LockTarget = null;
+ Close();
+ }
+ }
+
+ #endregion
+
+ private void DisplayDialogue()
+ {
+ var config = AdventureDialogueConfig.Get(adventureDialogueId);
+
+ var speakType = config.speakType[dialogueIndex];
+
+ m_ContainerNpc.gameObject.SetActive(speakType == 0);
+ m_ContainerPlayer.gameObject.SetActive(speakType == 1);
+
+ switch (speakType)
+ {
+ case 1:
+ var job = PlayerDatas.Instance.baseData.Job;
+ UI3DModelExhibition.Instance.ShowPlayer(m_RawPlayer, job, true);
+ m_PlayerName.text = PlayerDatas.Instance.baseData.PlayerName;
+ m_PlayerDialogue.text = Language.Get(config.dialogues[dialogueIndex]);
+ break;
+ case 0:
+ var npcId = config.npcId;
+ var npcConfig = NPCConfig.Get(npcId);
+ m_NpcName.text = npcConfig.charName;
+ m_NpcDialogue.text = Language.Get(config.dialogues[dialogueIndex]);
+ var data = new UI3DNPCExhibitionData()
+ {
+ npcId = npcId,
+ isDialogue = true,
+ };
+ UI3DModelExhibition.Instance.ShowNPC(m_RawNpc, data);
+ break;
+ }
+ }
+
+ private void OnSkip()
+ {
+ Close();
+ model.SendSwitchAdventureState(model.processingIncidentId, 3);
+ }
+
+ private void OnClickEmpty()
+ {
+ var config = AdventureDialogueConfig.Get(adventureDialogueId);
+
+ if (dialogueIndex < config.dialogues.Length - 1)
+ {
+ dialogueIndex += 1;
+ DisplayDialogue();
+ }
+ else
+ {
+ Close();
+ model.SendSwitchAdventureState(model.processingIncidentId, 3);
+ }
+ }
+ }
+}
+
+
+
+
diff --git a/System/HazyRegion/HazyRegionDialogueWin.cs.meta b/System/HazyRegion/HazyRegionDialogueWin.cs.meta
new file mode 100644
index 0000000..570f81a
--- /dev/null
+++ b/System/HazyRegion/HazyRegionDialogueWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: d898556f396977c41b6231935e4fd466
+timeCreated: 1554779979
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/HazyRegionEntrancePanel.cs b/System/HazyRegion/HazyRegionEntrancePanel.cs
new file mode 100644
index 0000000..9b51283
--- /dev/null
+++ b/System/HazyRegion/HazyRegionEntrancePanel.cs
@@ -0,0 +1,197 @@
+锘縰sing System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+ public class HazyRegionEntrancePanel : MonoBehaviour
+ {
+ [SerializeField] Text m_OpenTime;
+
+ [SerializeField] Transform m_ContainerTimes;
+ [SerializeField] Text m_Times;
+ [SerializeField] Button m_BuyTimes;
+
+ [SerializeField] Button m_Goto;
+ [SerializeField] Text m_GotoLabel;
+
+ HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
+ DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
+
+ private void Awake()
+ {
+ m_BuyTimes.AddListener(BuyTimes);
+ m_Goto.AddListener(Goto);
+ }
+
+ public void Display()
+ {
+ dailyQuestModel.dailyQuestProgressUpdateEvent += DailyQuestProgressUpdateEvent;
+ model.onHazyRegionIncidentRefresh += OnHazyRegionIncidentRefresh;
+
+ DisplayOpenTime();
+ DisplayTimes();
+ DisplayButtonState();
+ }
+
+ void DisplayTimes()
+ {
+ m_ContainerTimes.gameObject.SetActive(!model.InFakeHazyRegion);
+
+ if (!model.InFakeHazyRegion)
+ {
+ var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
+ var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
+ var limitTimes = dailyQuestOpenTime.DayTimes;
+
+ var totalTimes = dailyQuestModel.GetDailyQuestTotalTimes((int)DailyQuestType.HazyRegion);
+ var completedTimes = dailyQuestModel.GetDailyQuestCompletedTimes((int)DailyQuestType.HazyRegion);
+ var times = Mathf.Clamp(totalTimes - completedTimes, 0, limitTimes);
+ m_Times.text = StringUtility.Contact(times, "/", limitTimes);
+ }
+ }
+
+ void DisplayOpenTime()
+ {
+ m_OpenTime.gameObject.SetActive(!model.InFakeHazyRegion);
+ if (!model.InFakeHazyRegion)
+ {
+ DailyQuestOpenTime dailyQuestOpenTime;
+ if (dailyQuestModel.TryGetOpenTime((int)DailyQuestType.HazyRegion, out dailyQuestOpenTime))
+ {
+ HourMinute hourMinute;
+ if (dailyQuestOpenTime.TryGetNextOpenTime(out hourMinute))
+ {
+ var timeLabel = string.Format("{0}:{1}鈥斺�攞2}:{3}", hourMinute.hourBegin.ToString("D2"),
+ hourMinute.minuteBegin.ToString("D2"), hourMinute.hourEnd.ToString("D2"),
+ hourMinute.minuteEnd.ToString("D2"));
+ timeLabel = UIHelper.AppendColor(TextColType.Green, timeLabel);
+ m_OpenTime.text = string.Format("姣忔棩{0}鍙繘琛屽璁�", timeLabel);
+ }
+ }
+ }
+ }
+
+ void DisplayButtonState()
+ {
+ bool allowClick = !model.InFakeHazyRegion || model.satisfyFakeOpen;
+ m_Goto.SetColorful(m_GotoLabel, allowClick);
+ }
+
+ private void Goto()
+ {
+ var error = 0;
+ if (TryOpenHazyReion(out error))
+ {
+ model.SendOpenHazyRegion();
+ }
+ else
+ {
+ HandleErrorMessage(error);
+ }
+ }
+
+ private void BuyTimes()
+ {
+ var questState = dailyQuestModel.GetQuestState((int)DailyQuestType.HazyRegion);
+ if (questState == DailyQuestModel.DailyQuestState.OutTime)
+ {
+ return;
+ }
+
+ if (!model.TryAddTimes())
+ {
+ return;
+ }
+
+ WindowCenter.Instance.Open<HazyRegionBuyTimesWin>();
+ }
+
+ bool TryOpenHazyReion(out int error)
+ {
+ error = 0;
+ if (model.InFakeHazyRegion)
+ {
+ if (model.satisfyFakeOpen)
+ {
+ return true;
+ }
+ else
+ {
+ error = 4;
+ return false;
+ }
+ }
+ var questState = dailyQuestModel.GetQuestState((int)DailyQuestType.HazyRegion);
+ if (questState != DailyQuestModel.DailyQuestState.Normal)
+ {
+ switch (questState)
+ {
+ case DailyQuestModel.DailyQuestState.OutTime:
+ error = 1;
+ break;
+ case DailyQuestModel.DailyQuestState.CanBuyTimes:
+ error = 2;
+ break;
+ case DailyQuestModel.DailyQuestState.Completed:
+ error = 3;
+ break;
+ }
+ return false;
+ }
+ return true;
+ }
+
+ void HandleErrorMessage(int error)
+ {
+ switch (error)
+ {
+ case 1:
+ DailyQuestOpenTime dailyQuestOpenTime;
+ if (dailyQuestModel.TryGetOpenTime((int)DailyQuestType.HazyRegion, out dailyQuestOpenTime))
+ {
+ HourMinute hourMinute;
+ if (dailyQuestOpenTime.TryGetTodayNearestOpenTime(out hourMinute))
+ {
+ SysNotifyMgr.Instance.ShowTip("OpenHazyRegionError_1",
+ hourMinute.hourBegin.ToString("D2"),
+ hourMinute.hourEnd.ToString("D2"));
+ }
+ }
+ break;
+ case 2:
+ WindowCenter.Instance.Open<HazyRegionBuyTimesWin>();
+ break;
+ case 3:
+ SysNotifyMgr.Instance.ShowTip("OpenHazyRegionError_3");
+ break;
+ case 4:
+ SysNotifyMgr.Instance.ShowTip("OpenHazyRegionError_4");
+ break;
+ }
+ }
+
+ public void Dispose()
+ {
+ dailyQuestModel.dailyQuestProgressUpdateEvent -= DailyQuestProgressUpdateEvent;
+ model.onHazyRegionIncidentRefresh -= OnHazyRegionIncidentRefresh;
+ }
+
+ private void OnHazyRegionIncidentRefresh()
+ {
+ DisplayButtonState();
+ }
+
+ private void DailyQuestProgressUpdateEvent(int id)
+ {
+ var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
+ if (config != null && id == config.RelatedID)
+ {
+ DisplayTimes();
+ }
+ }
+ }
+}
+
diff --git a/System/HazyRegion/HazyRegionEntrancePanel.cs.meta b/System/HazyRegion/HazyRegionEntrancePanel.cs.meta
new file mode 100644
index 0000000..ce19439
--- /dev/null
+++ b/System/HazyRegion/HazyRegionEntrancePanel.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 26db086140cb95e499e2b42014fcb6f4
+timeCreated: 1554371363
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/HazyRegionIncidentBehaviour.cs b/System/HazyRegion/HazyRegionIncidentBehaviour.cs
new file mode 100644
index 0000000..f23c4d5
--- /dev/null
+++ b/System/HazyRegion/HazyRegionIncidentBehaviour.cs
@@ -0,0 +1,149 @@
+锘縰sing System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+ public class HazyRegionIncidentBehaviour : ScrollItem
+ {
+ [SerializeField] UIAlphaTween m_AlphaTween;
+ [SerializeField] UILinerMove m_LinerMove;
+ [SerializeField] Text m_IncidentTitle;
+ [SerializeField] Text m_DepletionPoint;
+ [SerializeField] Image m_Icon;
+
+ [SerializeField] Transform m_ContainerCrossServer;
+
+ [SerializeField] Transform m_ContainerItem;
+ [SerializeField] ItemBehaviour[] m_Items;
+ [SerializeField] Text[] m_ItemDescriptions;
+
+ [SerializeField] Transform m_ContainerProcessing;
+ [SerializeField] Transform m_ContainerCompleted;
+
+ [SerializeField] Transform m_ContainerSelect;
+ [SerializeField] Button m_Select;
+
+ [Header("Boss")]
+ [SerializeField] Transform m_ContainerBoss;
+ [SerializeField] Text m_BossName;
+ [SerializeField] Text m_PlayerCount;
+ [SerializeField] Text m_RebornTime;
+
+ public UIAlphaTween alphaTween { get { return m_AlphaTween; } }
+ public UILinerMove linerMove { get { return m_LinerMove; } }
+
+ HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
+
+ int incidentId = 0;
+
+ HazyRegionIncidentType incidentType = HazyRegionIncidentType.Adventure;
+
+ private void Awake()
+ {
+ m_Select.SetListener(OnSelect);
+ }
+
+ public override void Display(object _data)
+ {
+ base.Display(_data);
+
+ incidentId = (int)_data;
+ var config = HazyRegionConfig.Get(incidentId);
+ incidentType = (HazyRegionIncidentType)config.incidentType;
+
+ DisplayBase();
+ DisplayItems();
+ DisplayState();
+ DisplaySelect();
+ DisplayBoss();
+
+ model.selectIncidentRefresh -= SelectIncidentRefresh;
+ model.selectIncidentRefresh += SelectIncidentRefresh;
+ model.onHazyRegionIncidentRefresh -= OnHazyRegionIncidentRefresh;
+ model.onHazyRegionIncidentRefresh += OnHazyRegionIncidentRefresh;
+ }
+
+ void DisplayBase()
+ {
+ var config = HazyRegionConfig.Get(incidentId);
+ m_DepletionPoint.text = string.Format("娑堣�椾綋鍔涳細 ", config.point);
+ m_IncidentTitle.text = config.name;
+ m_Icon.SetSprite(config.PortraitID);
+ m_Icon.SetNativeSize();
+ m_ContainerCrossServer.gameObject.SetActive(config.crossServer == 1);
+ }
+
+ void DisplayItems()
+ {
+ var config = HazyRegionConfig.Get(incidentId);
+ for (int i = 0; i < m_Items.Length; i++)
+ {
+ if (config.reward != null && i < config.reward.Length)
+ {
+ m_Items[i].gameObject.SetActive(true);
+ m_Items[i].SetItem(config.reward[i], 1);
+ m_ItemDescriptions[i].gameObject.SetActive(true);
+ m_ItemDescriptions[i].text = config.rewardState[i] == 0 ? string.Empty :
+ Language.Get(StringUtility.Contact("HazyRegionItemState_", config.rewardState[i]));
+ }
+ else
+ {
+ m_Items[i].gameObject.SetActive(false);
+ m_ItemDescriptions[i].gameObject.SetActive(false);
+ }
+ }
+ }
+
+ void DisplayBoss()
+ {
+ m_ContainerBoss.gameObject.SetActive(incidentType == HazyRegionIncidentType.Boss);
+ var config = HazyRegionConfig.Get(incidentId);
+ if (incidentType == HazyRegionIncidentType.Boss)
+ {
+ var npcConfig = NPCConfig.Get(config.npcId);
+ m_BossName.text = npcConfig.charName;
+ }
+ }
+
+ void DisplayState()
+ {
+ HazyRegionModel.Incident incident;
+ if (model.TryGetIncident(incidentId, out incident))
+ {
+ m_ContainerCompleted.gameObject.SetActive(incident.state == HazyRegionModel.IncidentState.Complete);
+ m_ContainerProcessing.gameObject.SetActive(incident.state == HazyRegionModel.IncidentState.Processing);
+ }
+ }
+
+ void DisplaySelect()
+ {
+ m_ContainerSelect.gameObject.SetActive(incidentId == model.selectIncident);
+ }
+
+ private void SelectIncidentRefresh()
+ {
+ DisplaySelect();
+ }
+
+ private void OnHazyRegionIncidentRefresh()
+ {
+ DisplayState();
+ }
+
+ private void OnSelect()
+ {
+ model.selectIncident = incidentId;
+ }
+
+ public override void Dispose()
+ {
+ base.Dispose();
+ model.selectIncidentRefresh -= SelectIncidentRefresh;
+ model.onHazyRegionIncidentRefresh -= OnHazyRegionIncidentRefresh;
+ }
+ }
+}
+
diff --git a/System/HazyRegion/HazyRegionIncidentBehaviour.cs.meta b/System/HazyRegion/HazyRegionIncidentBehaviour.cs.meta
new file mode 100644
index 0000000..b05ba16
--- /dev/null
+++ b/System/HazyRegion/HazyRegionIncidentBehaviour.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: f157de73adafe7e40943853257e03a6d
+timeCreated: 1554360030
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/HazyRegionIncidentPanel.cs b/System/HazyRegion/HazyRegionIncidentPanel.cs
new file mode 100644
index 0000000..3762198
--- /dev/null
+++ b/System/HazyRegion/HazyRegionIncidentPanel.cs
@@ -0,0 +1,179 @@
+锘縰sing System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+ public class HazyRegionIncidentPanel : MonoBehaviour
+ {
+ [SerializeField] HazyRegionCyclicScroll m_CyclicScroll;
+ [SerializeField] Transform m_ContainerPoint;
+ [SerializeField] Slider m_Slider;
+ [SerializeField] Text m_Point;
+ [SerializeField] Button m_Back;
+ [SerializeField] Button m_Goto;
+
+ List<int> incidents = new List<int>();
+
+ HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
+
+ private void Awake()
+ {
+ m_Back.AddListener(OnBack);
+ m_Goto.AddListener(Goto);
+ }
+
+ public void Display()
+ {
+ DisplayPoint();
+ DisplayIncidents();
+ DisplayBackButton();
+ }
+
+ void DisplayIncidents()
+ {
+ incidents.Clear();
+ incidents.AddRange(model.GetAllIncidents());
+ incidents.Sort(Compare);
+
+ if (incidents.Count > 0)
+ {
+ model.selectIncident = incidents[0];
+ }
+
+ m_CyclicScroll.Init(incidents);
+
+ if (model.requireIncidentAnimation)
+ {
+ m_CyclicScroll.DisplayAnimation();
+ model.requireIncidentAnimation = false;
+ }
+ }
+
+ void DisplayPoint()
+ {
+ m_ContainerPoint.gameObject.SetActive(!model.InFakeHazyRegion);
+
+ if (!model.InFakeHazyRegion)
+ {
+ var point = Mathf.Min(model.point, model.limitPoint);
+ m_Point.text = StringUtility.Contact(point, "/", model.limitPoint);
+ m_Slider.value = Mathf.Clamp01((float)point / model.limitPoint);
+ }
+ }
+
+ void DisplayBackButton()
+ {
+ m_Back.gameObject.SetActive(!model.InFakeHazyRegion);
+ }
+
+ int Compare(int lhs, int rhs)
+ {
+ var lhs_config = HazyRegionConfig.Get(lhs);
+ var rhs_config = HazyRegionConfig.Get(rhs);
+ if (lhs_config.incidentType != rhs_config.incidentType)
+ {
+ return lhs_config.incidentType.CompareTo(rhs_config.incidentType);
+ }
+ return 0;
+ }
+
+ private void OnBack()
+ {
+ if (model.IsIncidentDungeon())
+ {
+
+ return;
+ }
+
+ var state = 0;
+
+ bool allComplete = true;
+ int minpoint = int.MaxValue;
+
+ foreach (var id in incidents)
+ {
+ HazyRegionModel.Incident incident;
+ if (model.TryGetIncident(id, out incident))
+ {
+ if (incident.state == HazyRegionModel.IncidentState.Processing)
+ {
+ state = 2;
+ allComplete = false;
+ break;
+ }
+ if(incident.state != HazyRegionModel.IncidentState.Complete)
+ {
+ allComplete = false;
+ }
+ var config = HazyRegionConfig.Get(id);
+ if (minpoint > config.point)
+ {
+ minpoint = config.point;
+ }
+ }
+ }
+
+ if (state == 0 && !allComplete && model.point >= minpoint)
+ {
+ state = 1;
+ }
+
+ switch (state)
+ {
+ case 1:
+ ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get(""), (bool isOk) =>
+ {
+ if (isOk)
+ {
+ model.SendBackHazyRegion();
+ }
+ });
+ break;
+ case 2:
+ ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get(""), (bool isOk) =>
+ {
+ if (isOk)
+ {
+ model.SendBackHazyRegion();
+ }
+ });
+ break;
+ default:
+ model.SendBackHazyRegion();
+ break;
+ }
+ }
+
+ private void Goto()
+ {
+ var error = 0;
+ if (!model.TryGotoIncident(model.selectIncident, out error))
+ {
+ model.DisplayErrorRemind(error);
+ }
+ else
+ {
+ model.SendGotoIncident(model.selectIncident);
+ }
+ }
+
+ public void Dispose()
+ {
+ m_CyclicScroll.Dispose();
+ }
+
+#if UNITY_EDITOR
+ void OnGUI()
+ {
+ if (GUILayout.Button("Back"))
+ {
+ OnBack();
+ }
+ }
+#endif
+ }
+}
+
diff --git a/System/HazyRegion/HazyRegionIncidentPanel.cs.meta b/System/HazyRegion/HazyRegionIncidentPanel.cs.meta
new file mode 100644
index 0000000..4d0c5be
--- /dev/null
+++ b/System/HazyRegion/HazyRegionIncidentPanel.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: cdcd39451a860ce4692d08aab3ae1afb
+timeCreated: 1554371897
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/HazyRegionModel.cs b/System/HazyRegion/HazyRegionModel.cs
new file mode 100644
index 0000000..4fa82fd
--- /dev/null
+++ b/System/HazyRegion/HazyRegionModel.cs
@@ -0,0 +1,524 @@
+锘縰sing System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+using UnityEngine;
+namespace Snxxz.UI
+{
+ public class HazyRegionModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
+ {
+ Dictionary<int, Incident> m_Incidents = new Dictionary<int, Incident>();
+ Dictionary<int, AdventureInfo> m_AdventureInfos = new Dictionary<int, AdventureInfo>();
+
+ public int limitPoint { get; private set; }
+ public int point { get; private set; }
+ public int processingIncidentId { get; private set; }
+ public int adventureDialogueId { get; private set; }
+ public bool playing { get; private set; }
+ public bool satisfyFakeOpen { get; private set; }
+ public int hazyRegionOpenTimes { get; private set; }
+ public int fakeOpenTimes { get; private set; }
+ public bool isServerPrepare { get; private set; }
+ public bool requireIncidentAnimation { get; set; }
+
+ int m_SelectIncident;
+ public int selectIncident
+ {
+ get { return m_SelectIncident; }
+ set
+ {
+ if (m_SelectIncident != value)
+ {
+ m_SelectIncident = value;
+ if (selectIncidentRefresh != null)
+ {
+ selectIncidentRefresh();
+ }
+ }
+ }
+ }
+
+ public bool InFakeHazyRegion
+ {
+ get { return hazyRegionOpenTimes <= fakeOpenTimes; }
+ }
+
+ int cacheMapId = 0;
+
+ public event Action selectIncidentRefresh;
+ public event Action<int> onHazyRegionStateRefresh; //0-缁撴潫鎷滆 1-寮�濮嬫嫓璁� 2-寮哄埗鍒锋柊
+ public event Action onHazyRegionIncidentRefresh;
+
+ DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
+ DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
+ HazyDemonKingModel hazyDemonKingModel { get { return ModelCenter.Instance.GetModel<HazyDemonKingModel>(); } }
+ HazyGrassModel hazyGrassModel { get { return ModelCenter.Instance.GetModel<HazyGrassModel>(); } }
+
+ public override void Init()
+ {
+ ParseConfig();
+
+ StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
+ AdventureStage.Instance.onLoadAdventureStage += OnLoadAdventureStage;
+ AdventureStage.Instance.onExitAdventureStage += OnExitAdventureStage;
+ }
+
+ public void OnBeforePlayerDataInitialize()
+ {
+ isServerPrepare = false;
+ point = 0;
+ playing = false;
+ hazyRegionOpenTimes = 0;
+ m_Incidents.Clear();
+ m_AdventureInfos.Clear();
+ }
+
+ public void OnPlayerLoginOk()
+ {
+ isServerPrepare = true;
+ }
+
+ public override void UnInit()
+ {
+ StageLoad.Instance.onStageLoadFinish -= OnStageLoadFinish;
+ AdventureStage.Instance.onExitAdventureStage -= OnExitAdventureStage;
+ AdventureStage.Instance.onLoadAdventureStage -= OnLoadAdventureStage;
+ }
+
+ private void OnLoadAdventureStage()
+ {
+ WindowCenter.Instance.Open<HazyAdventureHintWin>();
+ }
+
+ private void OnExitAdventureStage()
+ {
+ SnxxzGame.Instance.StartCoroutine(Co_TryOpenHazyRegionWin());
+ WindowCenter.Instance.Close<HazyAdventureHintWin>();
+ }
+
+ private void OnStageLoadFinish()
+ {
+ if (!(StageLoad.Instance.currentStage is DungeonStage))
+ {
+ cacheMapId = 0;
+ }
+ else
+ {
+ var mapId = PlayerDatas.Instance.baseData.MapID;
+ if (!MapUtility.IsDungeon(mapId))
+ {
+ if (IsIncidentDungeon(cacheMapId))
+ {
+ SnxxzGame.Instance.StartCoroutine(Co_TryOpenHazyRegionWin());
+ }
+ }
+ cacheMapId = mapId;
+ }
+ }
+
+ IEnumerator Co_TryOpenHazyRegionWin()
+ {
+ yield return WaitingForSecondConst.WaitMS1000;
+ if (NewBieCenter.Instance.inGuiding ||
+ ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing)
+ {
+ yield break;
+ }
+ if (WindowCenter.Instance.IsOpen<MainInterfaceWin>())
+ {
+ WindowCenter.Instance.Open<CrossServerWin>(false, 2);
+ }
+ }
+
+ void ParseConfig()
+ {
+ var funcConfig = FuncConfigConfig.Get("ImmortalDomainStrength");
+ limitPoint = int.Parse(funcConfig.Numerical1);
+
+ funcConfig = FuncConfigConfig.Get("FakeImmortalCount");
+ fakeOpenTimes = int.Parse(funcConfig.Numerical1);
+ }
+
+ public bool TryGetIncident(int id, out Incident incident)
+ {
+ return m_Incidents.TryGetValue(id, out incident);
+ }
+
+ public bool TryGotoIncident(int id, out int error)
+ {
+ error = 0;
+ var config = HazyRegionConfig.Get(id);
+ if (config == null)
+ {
+ return false;
+ }
+ if (!TryGotoDungeon(id, out error))
+ {
+ return false;
+ }
+ Incident incident;
+ if (TryGetIncident(id, out incident))
+ {
+ if (incident.state != IncidentState.Processing)
+ {
+ switch (incident.state)
+ {
+ case IncidentState.UnStart:
+ if (!InFakeHazyRegion && point < config.point)
+ {
+ error = 3;
+ return false;
+ }
+ break;
+ case IncidentState.Complete:
+ error = 4;
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ public bool TryGotoDungeon(int id, out int error)
+ {
+ error = 0;
+ if (CrossServerUtility.IsCrossServer())
+ {
+ error = 1;
+ return false;
+ }
+ var mapId = PlayerDatas.Instance.baseData.MapID;
+ if (MapUtility.IsDungeon(mapId))
+ {
+ error = 2;
+ return false;
+ }
+ if (AdventureStage.Instance.IsInAdventureStage)
+ {
+ error = 2;
+ return false;
+ }
+ return true;
+ }
+
+ public bool TryAddTimes()
+ {
+ var config = DailyQuestConfig.Get((int)DailyQuestType.HazyRegion);
+ var dailyQuestOpenTime = DailyQuestOpenTimeConfig.Get(config.RelatedID);
+ var limitTimes = dailyQuestOpenTime.DayTimes;
+
+ var totalTimes = dailyQuestModel.GetDailyQuestTotalTimes((int)DailyQuestType.HazyRegion);
+ var completedTimes = dailyQuestModel.GetDailyQuestCompletedTimes((int)DailyQuestType.HazyRegion);
+ var times = Mathf.Clamp(totalTimes - completedTimes, 0, limitTimes);
+
+ if (times >= limitTimes)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ public bool TryGetAdventureInfo(int id, out AdventureInfo adventureInfo)
+ {
+ return m_AdventureInfos.TryGetValue(id, out adventureInfo);
+ }
+
+ public ICollection<int> GetAllIncidents()
+ {
+ return m_Incidents.Keys;
+ }
+
+ public int GetIncidentId(int mapId, int lineId)
+ {
+ var configs = HazyRegionConfig.GetValues();
+ foreach (var config in configs)
+ {
+ if (config.dungeonId == mapId && config.lineId == lineId)
+ {
+ return config.id;
+ }
+ }
+ return 0;
+ }
+
+ public int GetAdventureNpcId()
+ {
+ var dialogueConfig = AdventureDialogueConfig.Get(adventureDialogueId);
+ if (dialogueConfig != null)
+ {
+ return dialogueConfig.npcId;
+ }
+ return 0;
+ }
+
+ public bool IsIncidentDungeon(int mapId)
+ {
+ if (mapId == 0)
+ {
+ return false;
+ }
+ if (mapId == HazyDemonKingModel.Client_MapID
+ || mapId == HazyGrassModel.Client_FairyGrassMapID
+ || mapId == HazyGrassModel.Client_ReikiGrassMapID)
+ {
+ return true;
+ }
+ var configs = HazyRegionConfig.GetValues();
+ foreach (var config in configs)
+ {
+ if (config.dungeonId == mapId)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public bool IsIncidentDungeon()
+ {
+ if (AdventureStage.Instance.IsInAdventureStage)
+ {
+ return true;
+ }
+ if (IsIncidentDungeon(PlayerDatas.Instance.baseData.MapID))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ public void DisplayErrorRemind(int error)
+ {
+ switch (error)
+ {
+ default:
+ break;
+ }
+ }
+
+ public void StartAdventureDialogue()
+ {
+ WindowCenter.Instance.Close<MainInterfaceWin>();
+ HazyRegionDialogueWin.adventureDialogueId = adventureDialogueId;
+ WindowCenter.Instance.Open<HazyRegionDialogueWin>();
+ }
+
+ void InitializeAdventure()
+ {
+ var config = HazyRegionConfig.Get(processingIncidentId);
+ if (config != null)
+ {
+ var gear = 0;
+ AdventureInfo adventureInfo;
+ if (TryGetAdventureInfo(processingIncidentId, out adventureInfo))
+ {
+ switch (config.lineId)
+ {
+ case 1:
+ gear = PlayerDatas.Instance.baseData.LV >= adventureInfo.condition ? adventureInfo.gear : 0;
+ break;
+ case 2:
+ gear = PlayerDatas.Instance.baseData.realmLevel >= adventureInfo.condition ? adventureInfo.gear : 0;
+ break;
+ case 3:
+ gear = PlayerDatas.Instance.baseData.FightPoint >= adventureInfo.condition ? adventureInfo.gear : 0;
+ break;
+ case 4:
+ gear = PlayerDatas.Instance.extersion.luckValue >= adventureInfo.condition ? adventureInfo.gear : 0;
+ break;
+ }
+ }
+ var dialogueConfig = AdventureDialogueConfig.Get(config.lineId, gear);
+ if (dialogueConfig != null)
+ {
+ adventureDialogueId = dialogueConfig.id;
+ }
+ }
+ }
+
+ public void SendGotoIncident(int id)
+ {
+ processingIncidentId = id;
+
+ var config = HazyRegionConfig.Get(id);
+ switch ((HazyRegionIncidentType)config.incidentType)
+ {
+ case HazyRegionIncidentType.Adventure:
+ InitializeAdventure();
+
+ WindowCenter.Instance.CloseAll(WindowCenter.CloseAllIgnoreType.BaseAndCustom);
+
+ AdventureStage.Instance.Enter();
+
+ Incident incident;
+ if(TryGetIncident(id,out incident))
+ {
+ if (incident.state == IncidentState.UnStart)
+ {
+ SendSwitchAdventureState(id, 2);
+ }
+ }
+ break;
+ case HazyRegionIncidentType.Boss:
+ if (InFakeHazyRegion)
+ {
+ hazyDemonKingModel.RequestEnterClientDungeon();
+ }
+ else
+ {
+ SendGotoIncidentDungeon(config);
+ }
+ break;
+ case HazyRegionIncidentType.FairyGrass:
+ case HazyRegionIncidentType.ReikiGrass:
+ if (InFakeHazyRegion)
+ {
+ hazyGrassModel.RequestEnterClientDungeon();
+ }
+ else
+ {
+ SendGotoIncidentDungeon(config);
+ }
+ break;
+ case HazyRegionIncidentType.Precious:
+ SendGotoIncidentDungeon(config);
+ break;
+ }
+ }
+
+ void SendGotoIncidentDungeon(HazyRegionConfig config)
+ {
+ if (config.crossServer == 1)
+ {
+ var pak = new CC105_tagCMEnterCrossServer();
+ pak.DataMapID = (uint)config.dungeonId;
+ pak.LineID = (ushort)config.lineId;
+ GameNetSystem.Instance.SendInfo(pak);
+ }
+ else
+ {
+ dungeonModel.SingleChallenge(config.dungeonId, config.lineId);
+ }
+ }
+
+ public void SendBackHazyRegion()
+ {
+ var pak = new CA526_tagCMVisitFairyDomain();
+ pak.Type = 1;
+ GameNetSystem.Instance.SendInfo(pak);
+ }
+
+ public void SendOpenHazyRegion()
+ {
+ var pak = new CA526_tagCMVisitFairyDomain();
+ pak.Type = 0;
+ GameNetSystem.Instance.SendInfo(pak);
+ }
+
+ public void SendSwitchAdventureState(int id, int state)
+ {
+ var pak = new CA504_tagCMPlayerGetReward();
+ pak.RewardType = (byte)GotServerRewardType.Def_RewardType_FairyAdventuresAward;
+ pak.DataEx = (uint)id;
+ pak.DataExStr = state.ToString();
+ pak.DataExStrLen = (byte)Encoding.UTF8.GetBytes(pak.DataExStr).Length;
+ GameNetSystem.Instance.SendInfo(pak);
+ }
+
+ public void ReceivePackage(HA306_tagMCFairyDomainInfo package)
+ {
+ var preplaying = playing;
+
+ playing = package.State == 1;
+
+ satisfyFakeOpen = package.State == 2;
+
+ hazyRegionOpenTimes = (int)package.VisitCnt;
+
+ point = package.Energy;
+
+ if (package.IsAll == 1)
+ {
+ m_Incidents.Clear();
+ }
+
+ for (int i = 0; i < package.Count; i++)
+ {
+ var data = package.InfoList[i];
+ m_Incidents[data.EventID] = new Incident()
+ {
+ id = data.EventID,
+ state = (IncidentState)data.EventState,
+ };
+ }
+
+ if (onHazyRegionIncidentRefresh != null)
+ {
+ onHazyRegionIncidentRefresh();
+ }
+
+ if (isServerPrepare)
+ {
+ if (preplaying != playing)
+ {
+ if (onHazyRegionStateRefresh != null)
+ {
+ onHazyRegionStateRefresh(playing ? 1 : 0);
+ }
+ }
+ }
+ else
+ {
+ if (onHazyRegionStateRefresh != null)
+ {
+ onHazyRegionStateRefresh(2);
+ }
+ }
+ }
+
+ public void ReceivePackage(HA307_tagMCFairyAdventuresInfo package)
+ {
+ m_AdventureInfos.Clear();
+ for (int i = 0; i < package.Cnt; i++)
+ {
+ var data = package.InfoList[i];
+
+ m_AdventureInfos[data.EventID] = new AdventureInfo()
+ {
+ gear = data.Gear,
+ condition = (int)data.Condition,
+ };
+ }
+ }
+
+ public enum IncidentState
+ {
+ UnStart = 1,
+ Processing = 2,
+ Complete = 3,
+ }
+
+ public struct Incident
+ {
+ public int id;
+ public IncidentState state;
+ }
+
+ public struct AdventureInfo
+ {
+ public int gear;
+ public int condition;
+ }
+ }
+
+ public enum HazyRegionIncidentType
+ {
+ Adventure,
+ Precious,
+ FairyGrass,
+ Boss,
+ ReikiGrass,
+ }
+}
+
diff --git a/System/HazyRegion/HazyRegionModel.cs.meta b/System/HazyRegion/HazyRegionModel.cs.meta
new file mode 100644
index 0000000..a57a0a1
--- /dev/null
+++ b/System/HazyRegion/HazyRegionModel.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 850cb668290bbf34fb0e2882c56defb9
+timeCreated: 1554358789
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/HazyRegion/HazyRegionWin.cs b/System/HazyRegion/HazyRegionWin.cs
new file mode 100644
index 0000000..0f6eb6f
--- /dev/null
+++ b/System/HazyRegion/HazyRegionWin.cs
@@ -0,0 +1,220 @@
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Thursday, April 04, 2019
+//--------------------------------------------------------
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+
+ public class HazyRegionWin : Window
+ {
+ [SerializeField] HazyRegionEntrancePanel m_EntrancePanel;
+ [SerializeField] HazyRegionIncidentPanel m_IncidentPanel;
+
+ [SerializeField] ScaleTween m_BottomScaleTween;
+ [SerializeField] UIAlphaTween m_AlphaTween;
+
+ HazyRegionStage m_Stage = HazyRegionStage.Entrance;
+ HazyRegionStage stage
+ {
+ get { return m_Stage; }
+ set
+ {
+ if (m_Stage != value)
+ {
+ switch (m_Stage)
+ {
+ case HazyRegionStage.Entrance:
+ //CloseHazyRegionEntrance();
+ break;
+ case HazyRegionStage.Playing:
+ CloseHazyRegionIncident();
+ break;
+ }
+
+ m_Stage = value;
+
+ switch (m_Stage)
+ {
+ case HazyRegionStage.Entrance:
+ OpenHazyRegionEntrance();
+ break;
+ case HazyRegionStage.Playing:
+ StartEntranceAnimation();
+ break;
+ }
+ }
+ }
+ }
+
+ HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
+
+ #region Built-in
+ protected override void BindController()
+ {
+ }
+
+ protected override void AddListeners()
+ {
+ }
+
+ protected override void OnPreOpen()
+ {
+ }
+
+ protected override void OnActived()
+ {
+ base.OnActived();
+
+ Display();
+
+ model.onHazyRegionStateRefresh += OnHazyRegionStateRefresh;
+ }
+
+ protected override void OnAfterOpen()
+ {
+ if (model.InFakeHazyRegion && stage == HazyRegionStage.Playing)
+ {
+ StartCoroutine(Co_VerifyCompleteAllIncidents());
+ }
+ }
+
+ protected override void OnPreClose()
+ {
+ m_EntrancePanel.Dispose();
+ m_IncidentPanel.Dispose();
+
+ StopAllCoroutines();
+
+ model.onHazyRegionStateRefresh -= OnHazyRegionStateRefresh;
+ }
+
+ protected override void OnAfterClose()
+ {
+ }
+ #endregion
+
+ void Display()
+ {
+ m_EntrancePanel.gameObject.SetActive(false);
+ m_IncidentPanel.gameObject.SetActive(false);
+
+ m_Stage = model.playing ? HazyRegionStage.Playing : HazyRegionStage.Entrance;
+
+ switch (stage)
+ {
+ case HazyRegionStage.Entrance:
+ OpenHazyRegionEntrance();
+ break;
+ case HazyRegionStage.Playing:
+ OpenHazyRegionIncident();
+ break;
+ }
+ }
+
+ void OpenHazyRegionEntrance()
+ {
+ m_EntrancePanel.gameObject.SetActive(true);
+ m_BottomScaleTween.Stop();
+ m_BottomScaleTween.SetStartState();
+ m_AlphaTween.SetStartState();
+ m_EntrancePanel.Dispose();
+ m_EntrancePanel.Display();
+ }
+
+ void OpenHazyRegionIncident()
+ {
+ m_IncidentPanel.gameObject.SetActive(true);
+ m_IncidentPanel.Dispose();
+ m_IncidentPanel.Display();
+ }
+
+ void CloseHazyRegionIncident()
+ {
+ m_IncidentPanel.Dispose();
+ m_IncidentPanel.gameObject.SetActive(false);
+ }
+
+ void CloseHazyRegionEntrance()
+ {
+ m_EntrancePanel.Dispose();
+ m_EntrancePanel.gameObject.SetActive(false);
+ }
+
+ void StartEntranceAnimation()
+ {
+ m_BottomScaleTween.Play();
+ m_AlphaTween.Play();
+ StartCoroutine(Co_EntranceAnimation());
+ }
+
+ IEnumerator Co_EntranceAnimation()
+ {
+ yield return WaitingForSecondConst.GetWaitForSeconds(m_AlphaTween.duration * 0.5f);
+ CloseHazyRegionEntrance();
+ yield return WaitingForSecondConst.GetWaitForSeconds(m_AlphaTween.duration * 0.2f);
+ model.requireIncidentAnimation = true;
+ OpenHazyRegionIncident();
+ }
+
+ private void OnHazyRegionStateRefresh(int state)
+ {
+ if (state == 2)
+ {
+ if ((model.playing && stage != HazyRegionStage.Playing)
+ || (!model.playing && stage != HazyRegionStage.Entrance))
+ {
+ Display();
+ }
+ }
+ else
+ {
+ stage = state == 0 ? HazyRegionStage.Entrance : HazyRegionStage.Playing;
+ }
+ }
+
+ IEnumerator Co_VerifyCompleteAllIncidents()
+ {
+ yield return WaitingForSecondConst.WaitMS500;
+
+ var allComplete = true;
+ var incidents = model.GetAllIncidents();
+ if (incidents != null)
+ {
+ foreach (var id in incidents)
+ {
+ HazyRegionModel.Incident incident;
+ if (model.TryGetIncident(id, out incident))
+ {
+ if (incident.state != HazyRegionModel.IncidentState.Complete)
+ {
+ allComplete = false;
+ }
+ }
+ }
+ }
+
+ if (allComplete)
+ {
+ model.SendBackHazyRegion();
+ }
+ }
+
+ enum HazyRegionStage
+ {
+ Entrance,
+ Playing,
+ }
+ }
+
+}
+
+
+
+
diff --git a/System/HazyRegion/HazyRegionWin.cs.meta b/System/HazyRegion/HazyRegionWin.cs.meta
new file mode 100644
index 0000000..f421b66
--- /dev/null
+++ b/System/HazyRegion/HazyRegionWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 9f6e51c1812470a46b101b0af440843d
+timeCreated: 1554360355
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/MainInterfacePanel/MainInterfaceWin.cs b/System/MainInterfacePanel/MainInterfaceWin.cs
index fa674cc..12c2979 100644
--- a/System/MainInterfacePanel/MainInterfaceWin.cs
+++ b/System/MainInterfacePanel/MainInterfaceWin.cs
@@ -612,6 +612,10 @@
private bool IsDungeon()
{
+ if (AdventureStage.Instance.IsInAdventureStage)
+ {
+ return true;
+ }
var mapId = PlayerDatas.Instance.baseData.MapID;
var mapConfig = MapConfig.Get(mapId);
return mapConfig != null && mapConfig.MapFBType != 0;
diff --git a/System/OpenServerActivity/RewardInformation.cs b/System/OpenServerActivity/RewardInformation.cs
index 97f3a0e..6ef63cd 100644
--- a/System/OpenServerActivity/RewardInformation.cs
+++ b/System/OpenServerActivity/RewardInformation.cs
@@ -53,7 +53,7 @@
itemCell.button.RemoveAllListeners();
itemCell.button.AddListener(() =>
{
- ItemAttrData attrData = new ItemAttrData(item.id, false, (ulong)item.count);
+ ItemAttrData attrData = new ItemAttrData(item.id, true, (ulong)item.count);
itemTipsModel.SetItemTipsModel(attrData);
});
}
diff --git a/System/WindowBase/ModelCenter.cs b/System/WindowBase/ModelCenter.cs
index c43bb0b..43c2bec 100644
--- a/System/WindowBase/ModelCenter.cs
+++ b/System/WindowBase/ModelCenter.cs
@@ -231,6 +231,9 @@
RegisterModel<ReikiRootModel>();
RegisterModel<AuctionNewGetShowModel>();
RegisterModel<DungeonNuwaModel>();
+ RegisterModel<HazyRegionModel>();
+ RegisterModel<HazyDemonKingModel>();
+ RegisterModel<HazyGrassModel>();
inited = true;
}
diff --git a/System/WindowBase/WindowCenter.cs b/System/WindowBase/WindowCenter.cs
index 39ada68..e5ece1b 100644
--- a/System/WindowBase/WindowCenter.cs
+++ b/System/WindowBase/WindowCenter.cs
@@ -600,7 +600,8 @@
&& !IsOpen("DefaultDialogueBoxWin")
&& !IsOpen("DialogueDuidanceWin")
&& !IsOpen("TaskBoxBGMWin")
- && !IsOpen("WelcomeWin");
+ && !IsOpen("WelcomeWin")
+ && !IsOpen("HazyRegionDialogueWin");
if (exceptOpen != IsOpen("MainInterfaceWin"))
{
diff --git a/Utility/ComponentExtersion.cs b/Utility/ComponentExtersion.cs
index e25ef13..d0932d0 100644
--- a/Utility/ComponentExtersion.cs
+++ b/Utility/ComponentExtersion.cs
@@ -212,6 +212,24 @@
}
[XLua.LuaCallCSharp]
+ public static void SetColorful(this Button _btn, Text _btnTxt, bool _colorful)
+ {
+ if (_btn != null)
+ {
+ var imageEx = _btn.image as ImageEx;
+ if (imageEx != null)
+ {
+ imageEx.gray = !_colorful;
+ }
+ }
+ if (_btnTxt != null)
+ {
+ _btnTxt.color = UIHelper.GetUIColor(_colorful ? TextColType.NavyBrown : TextColType.White);
+ _btnTxt.color = _btnTxt.color.SetA(_colorful ? 1 : 0.5f);
+ }
+ }
+
+ [XLua.LuaCallCSharp]
public static void SetInteractable(this Button _btn, Text _btnText, bool _interactable)
{
if (_btn != null)
diff --git a/Utility/ConfigInitiator.cs b/Utility/ConfigInitiator.cs
index 712282e..a8239f1 100644
--- a/Utility/ConfigInitiator.cs
+++ b/Utility/ConfigInitiator.cs
@@ -288,7 +288,9 @@
normalTasks.Add(new ConfigInitTask("LegendPropertyValueConfig", () => { LegendPropertyValueConfig.Init(); }, () => { return LegendPropertyValueConfig.inited; }));
normalTasks.Add(new ConfigInitTask("LegendPropertyConfig", () => { LegendPropertyConfig.Init(); }, () => { return LegendPropertyConfig.inited; }));
normalTasks.Add(new ConfigInitTask("EquipSuitNameConfig", () => { EquipSuitNameConfig.Init(); }, () => { return EquipSuitNameConfig.inited; }));
- normalTasks.Add(new ConfigInitTask("ReikiRootConfig", () => { ReikiRootConfig.Init(); }, () => { return ReikiRootConfig.inited; }));
+ normalTasks.Add(new ConfigInitTask("ReikiRootConfig", () => { ReikiRootConfig.Init(); }, () => { return ReikiRootConfig.inited; }));
+ normalTasks.Add(new ConfigInitTask("HazyRegionConfig", () => { HazyRegionConfig.Init(); }, () => { return HazyRegionConfig.inited; }));
+ normalTasks.Add(new ConfigInitTask("AdventureDialogueConfig", () => { AdventureDialogueConfig.Init(); }, () => { return AdventureDialogueConfig.inited; }));
}
static List<ConfigInitTask> doingTasks = new List<ConfigInitTask>();
diff --git a/Utility/EnumHelper.cs b/Utility/EnumHelper.cs
index d33854b..596b861 100644
--- a/Utility/EnumHelper.cs
+++ b/Utility/EnumHelper.cs
@@ -291,7 +291,8 @@
GatherSoulDungeon = 30,
CrossServerPk = 31,
AllianceBoss = 32,
- RidingPetActivity = 34
+ RidingPetActivity = 34,
+ HazyRegion = 35,
//JadeDynastyBoss = 32,--璇涗粰鍔熻兘鏆傛椂鍏抽棴
//JadeDynastyTower = 33,
}
@@ -1003,6 +1004,7 @@
Def_RewardType_NewFairyCParty = 24, // 鏂颁粰鐣岀洓鍏稿叏姘戞潵鍡�24
Def_RewardType_FeastWeekPartyAct = 25, //棰嗗彇鑺傛棩宸$ぜ娲诲姩濂栧姳25
Def_RewardType_FeastWeekPartyPoint = 26, //棰嗗彇鑺傛棩宸$ぜ绉垎濂栧姳26
+ Def_RewardType_FairyAdventuresAward = 27,//缂ョ紙濂囬亣
}
public enum MapType
--
Gitblit v1.8.0