Merge branch 'master' into ClientPreciousDungeon
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Wednesday, May 15, 2019 |
| | | // [ Date ]: Friday, May 17, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | |
| | | public readonly string equips;
|
| | | public readonly string items;
|
| | | public readonly string sideTasks;
|
| | | public readonly string reikiRoot;
|
| | | public readonly int[] succGuide;
|
| | | public readonly int[] failGuide;
|
| | | public readonly string remind; |
| | | public readonly int jump;
|
| | | public readonly int[] failFuncs;
|
| | | public readonly string[] remind; |
| | | |
| | | public TaskFeedbackConfig() |
| | | { |
| | |
| | |
|
| | | sideTasks = tables[5];
|
| | |
|
| | | string[] succGuideStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | reikiRoot = tables[6];
|
| | |
|
| | | string[] succGuideStringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | succGuide = new int[succGuideStringArray.Length]; |
| | | for (int i=0;i<succGuideStringArray.Length;i++) |
| | | { |
| | | int.TryParse(succGuideStringArray[i],out succGuide[i]); |
| | | }
|
| | |
|
| | | string[] failGuideStringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | failGuide = new int[failGuideStringArray.Length]; |
| | | for (int i=0;i<failGuideStringArray.Length;i++) |
| | | int.TryParse(tables[8],out jump); |
| | |
|
| | | string[] failFuncsStringArray = tables[9].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | failFuncs = new int[failFuncsStringArray.Length]; |
| | | for (int i=0;i<failFuncsStringArray.Length;i++) |
| | | { |
| | | int.TryParse(failGuideStringArray[i],out failGuide[i]); |
| | | int.TryParse(failFuncsStringArray[i],out failFuncs[i]); |
| | | }
|
| | |
|
| | | remind = tables[8]; |
| | | remind = tables[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b80a883f246077d46ab59d6938182ec9 |
| | | timeCreated: 1557911827 |
| | | timeCreated: 1558059182 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Thursday, May 16, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public partial class TaskFeedbackFuncConfig |
| | | { |
| | | |
| | | public readonly int id;
|
| | | public readonly string name;
|
| | | public readonly int jump;
|
| | | public readonly int guide; |
| | | |
| | | public TaskFeedbackFuncConfig() |
| | | { |
| | | } |
| | | |
| | | public TaskFeedbackFuncConfig(string input) |
| | | { |
| | | try |
| | | { |
| | | var tables = input.Split('\t'); |
| | | |
| | | int.TryParse(tables[0],out id); |
| | |
|
| | | name = tables[1];
|
| | |
|
| | | int.TryParse(tables[2],out jump); |
| | |
|
| | | int.TryParse(tables[3],out guide); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | | static Dictionary<string, TaskFeedbackFuncConfig> configs = new Dictionary<string, TaskFeedbackFuncConfig>(); |
| | | public static TaskFeedbackFuncConfig Get(string id) |
| | | { |
| | | if (!inited) |
| | | { |
| | | Debug.Log("TaskFeedbackFuncConfig 还未完成初始化。"); |
| | | return null; |
| | | } |
| | | |
| | | if (configs.ContainsKey(id)) |
| | | { |
| | | return configs[id]; |
| | | } |
| | | |
| | | TaskFeedbackFuncConfig config = null; |
| | | if (rawDatas.ContainsKey(id)) |
| | | { |
| | | config = configs[id] = new TaskFeedbackFuncConfig(rawDatas[id]); |
| | | rawDatas.Remove(id); |
| | | } |
| | | |
| | | return config; |
| | | } |
| | | |
| | | public static TaskFeedbackFuncConfig 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<TaskFeedbackFuncConfig> GetValues() |
| | | { |
| | | var values = new List<TaskFeedbackFuncConfig>(); |
| | | 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 +"/TaskFeedbackFunc.txt"; |
| | | } |
| | | else |
| | | { |
| | | path = AssetVersionUtility.GetAssetFilePath("config/TaskFeedbackFunc.txt"); |
| | | } |
| | | |
| | | var tempConfig = new TaskFeedbackFuncConfig(); |
| | | 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 TaskFeedbackFuncConfig(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 TaskFeedbackFuncConfig(line); |
| | | configs[id] = config; |
| | | (config as IConfigPostProcess).OnConfigParseCompleted(); |
| | | } |
| | | else |
| | | { |
| | | rawDatas[id] = line; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | Debug.LogError(ex); |
| | | } |
| | | } |
| | | |
| | | inited = true; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b2d416872ed7b3048a5b2d4696c3541f |
| | | timeCreated: 1557994779 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B4 0C 召唤私有专属木桩怪 #tagCMSummonPriWoodPile |
| | | |
| | | public class CB40C_tagCMSummonPriWoodPile : GameNetPackBasic |
| | | { |
| | | public uint NPCID; |
| | | public byte Count; //默认1个,最多5个 |
| | | |
| | | public CB40C_tagCMSummonPriWoodPile() |
| | | { |
| | | combineCmd = (ushort)0x03FE; |
| | | _cmd = (ushort)0xB40C; |
| | | } |
| | | |
| | | public override void WriteToBytes() |
| | | { |
| | | WriteBytes(NPCID, NetDataType.DWORD); |
| | | WriteBytes(Count, NetDataType.BYTE); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 28a5da463ffd3984088422a1da4229b3 |
| | | timeCreated: 1557989070 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | case E_NpcType.Fight:
|
| | | case E_NpcType.FMBoss:
|
| | | case E_NpcType.MonsterTime:
|
| | | case E_NpcType.PersonalEnemy:
|
| | |
|
| | | if (_npcConfig.Country == 1)
|
| | | {
|
| | |
| | | GAMgr.Instance.RequestPlayer<GA_NpcFightSgzcZZ>(vNetData.ObjID, E_ActorGroup.Player, vNetData);
|
| | |
|
| | | break;
|
| | | case E_NpcType.PersonalEnemy:
|
| | |
|
| | | break;
|
| | | }
|
| | |
|
| | | if (StageLoad.Instance.isLoadingScene)
|
| | |
| | | |
| | | public class DTC0408_tagPlayerSummonNPCAppear : DtcBasic |
| | | { |
| | | |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | |
| | | return; |
| | | } |
| | | |
| | | if (_npcConfig.NPCType == (int)E_NpcType.PersonalEnemy) |
| | | { |
| | | PersonalEnemy.Cache(vNetData); |
| | | return; |
| | | } |
| | | |
| | | if (_npcConfig.NPCType == (int)E_NpcType.Collect) |
| | | { |
| | | _actor = GAMgr.Instance.RequestNpcNoFight<GA_NpcSummonFunc>(vNetData.ObjID, |
| | |
| | | // RuntimeLogUtility.AddLog_Blue(_content, _sTarget.ObjID);
|
| | | //#endif
|
| | |
|
| | | _cTarget = GAMgr.Instance.GetBySID(_sTarget.ObjID) as GActorFight;
|
| | | if (PersonalEnemy.m_SBindCDict.ContainsKey(_sTarget.ObjID))
|
| | | {
|
| | | _cTarget = GAMgr.Instance.GetBySID(PersonalEnemy.m_SBindCDict[_sTarget.ObjID]) as GActorFight;
|
| | | }
|
| | | else
|
| | | {
|
| | | _cTarget = GAMgr.Instance.GetBySID(_sTarget.ObjID) as GActorFight;
|
| | | }
|
| | |
|
| | |
|
| | | if (_cTarget == null)
|
| | | {
|
| | |
| | | _cHurtObj = new AttackHandler.HurtObjs
|
| | | {
|
| | | ObjID = _sTarget.ObjID,
|
| | | clientInstID = GAMgr.Instance.GetCIDBySID(_sTarget.ObjID),
|
| | | clientInstID = GAMgr.Instance.GetCIDBySID(_cTarget.ServerInstID),
|
| | | ObjType = _sTarget.ObjType,
|
| | | HurtHP = _sTarget.HurtHP,
|
| | | CurHP = _sTarget.CurHP,
|
| | |
| | | for (int i = 0; i < vNetData.HurtCount; ++i)
|
| | | {
|
| | | _sTarget = vNetData.HurtList[i];
|
| | | _cTarget = GAMgr.Instance.GetBySID(_sTarget.ObjID) as GActorFight;
|
| | |
|
| | | if (PersonalEnemy.m_SBindCDict.ContainsKey(_sTarget.ObjID))
|
| | | {
|
| | | _cTarget = GAMgr.Instance.GetBySID(PersonalEnemy.m_SBindCDict[_sTarget.ObjID]) as GActorFight;
|
| | | }
|
| | | else
|
| | | {
|
| | | _cTarget = GAMgr.Instance.GetBySID(_sTarget.ObjID) as GActorFight;
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | string _content = string.Format("1 DTC0614_tagUseSkillPos => {0} 使用技能:{1} 攻击了 {2}, 伤害为: {3}, 剩余血量: {4}, 是否可以死亡: {5}",
|
| | |
| | | _cHurtObj = new AttackHandler.HurtObjs
|
| | | {
|
| | | ObjID = _sTarget.ObjID,
|
| | | clientInstID = GAMgr.Instance.GetCIDBySID(_sTarget.ObjID),
|
| | | clientInstID = GAMgr.Instance.GetCIDBySID(_cTarget.ServerInstID),
|
| | | ObjType = _sTarget.ObjType,
|
| | | HurtHP = _sTarget.HurtHP,
|
| | | CurHP = _sTarget.CurHP,
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | // 判断范围内的目标是否可以接入可攻击列表中
|
| | | List<GActor> _actorList = GAMgr.Instance.GetAll();
|
| | | _actorList.Sort((GActor a1, GActor a2) =>
|
| | |
| | |
|
| | | for (int i = 0; i < _actorList.Count && skill.hitTargetList.Count + skill.hitClientBattleTargetList.Count < _hitTestLimit; ++i)
|
| | | {
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | if (RuntimeLogUtility.s_ForceOneEnemy && i > 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | #endif
|
| | | if (_actorList[i] is GA_NpcClientFightNorm
|
| | | || _actorList[i] is GA_NpcFightSgzcZZ)
|
| | |
|
| | | if (_actorList[i] is GA_NpcClientFightNorm)
|
| | | {
|
| | | if (CheckCanAttackTarget(_actorList[i] as GActorFight, skill, _soSkill, skill.targetPosition))
|
| | | {
|
| | | var _sid = _actorList[i].ServerInstID;
|
| | | if (PersonalEnemy.GetPersionEnemySID(_sid) != 0)
|
| | | {
|
| | | AddToHitTargetList(skill, _actorList[i]);
|
| | | }
|
| | | else
|
| | | {
|
| | | AddToHitClientBattleTargetList(skill, _actorList[i]);
|
| | | }
|
| | | }
|
| | | }
|
| | | else if (_actorList[i] is GA_NpcFightSgzcZZ)
|
| | | {
|
| | | if (CheckCanAttackTarget(_actorList[i] as GActorFight, skill, _soSkill, skill.targetPosition))
|
| | | {
|
| | |
| | | _serverHurtList.Clear();
|
| | |
|
| | | // Debug.LogFormat("释放了技能: {0},当前位置: {1} 目标位置: {2}", _b405.SkillID, new Vector2(_b405.PosX, _b405.PosY), new Vector2(_b405.TagPosX, _b405.TagPosY));
|
| | |
|
| | | uint _bindID = 0;
|
| | | // 创建出攻击客户端攻击对象和服务端攻击对象
|
| | | for (int i = 0; i < skill.hitTargetList.Count; ++i)
|
| | | {
|
| | |
| | | Debug.LogFormat("<color=red>找到的目标对象: C:{0} 为空....</color>", skill.hitTargetList[i]);
|
| | | continue;
|
| | | }
|
| | | _bindID = 0;
|
| | | if (_target is GA_NpcClientFightNorm)
|
| | | {
|
| | | _bindID = PersonalEnemy.GetPersionEnemySID(_target.ServerInstID);
|
| | | if (_bindID == 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | }
|
| | |
|
| | | // 选中对象都要生成服务端对象
|
| | | CB405_tagCMSuperAtk.tagSkillPosHurtObj _hurtObj = new CB405_tagCMSuperAtk.tagSkillPosHurtObj();
|
| | | _hurtObj.ObjID = (uint)_target.ServerInstID;
|
| | | _hurtObj.ObjID = _bindID == 0 ? _target.ServerInstID : _bindID;
|
| | |
|
| | | if (_target is GA_PlayerXMZZ)
|
| | | {
|
| | |
| | | {
|
| | | continue;
|
| | | }
|
| | | }
|
| | |
|
| | | if (_bindID != 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | // 计算此次伤害
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | skill.hitTargetList.Add(target.ClientInstID);
|
| | | }
|
| | |
|
| | |
| | | |
| | | protected virtual void InitAI() |
| | | { |
| | | if (NpcConfig.AIType == 1) |
| | | if (NpcConfig.AIType == 1 |
| | | || NpcConfig.AIType == 202) |
| | | { |
| | | m_AIHandler = new AI_Npc_200(this, BornPos); |
| | | } |
| | |
| | |
|
| | | if (NavMesh.CalculatePath(_curPos, position, NavMesh.AllAreas, m_Path))
|
| | | {
|
| | | if (this is GA_Hero)
|
| | | {
|
| | | Debug.LogFormat("调用了 {0} 的寻路, 目标点: {1}", ServerInstID, position);
|
| | | }
|
| | | m_CornerIndex = 0;
|
| | | m_KeepDist = keepDist;
|
| | | PathFindStatus = E_PathFindStatus.Moving;
|
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class PersonalEnemy |
| | | { |
| | | public H0408_tagPlayerSummonNPCAppear data; |
| | | public uint bindClientNpcSID = 0; |
| | | |
| | | private static Dictionary<uint, PersonalEnemy> m_Map = new Dictionary<uint, PersonalEnemy>(); |
| | | public static Dictionary<uint, uint> m_CBinSdDict = new Dictionary<uint, uint>(); |
| | | public static Dictionary<uint, uint> m_SBindCDict = new Dictionary<uint, uint>(); |
| | | |
| | | private static List<PersonalEnemy> m_UnUsed = new List<PersonalEnemy>(); |
| | | |
| | | public static void UnInit() |
| | | { |
| | | m_Map.Clear(); |
| | | m_CBinSdDict.Clear(); |
| | | m_SBindCDict.Clear(); |
| | | m_UnUsed.Clear(); |
| | | } |
| | | |
| | | public static uint GetPersionEnemySID(uint sid) |
| | | { |
| | | uint _objID = 0; |
| | | if (m_CBinSdDict.TryGetValue(sid, out _objID)) |
| | | { |
| | | return _objID; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | public static PersonalEnemy Cache(H0408_tagPlayerSummonNPCAppear h0406) |
| | | { |
| | | var _pm = new PersonalEnemy(); |
| | | _pm.data = h0406; |
| | | m_Map[h0406.ObjID] = _pm; |
| | | m_UnUsed.Add(_pm); |
| | | return _pm; |
| | | } |
| | | |
| | | public static void Bind(GA_NpcClientFightNorm npc) |
| | | { |
| | | var _package = new CB40C_tagCMSummonPriWoodPile(); |
| | | _package.NPCID = (uint)npc.NpcConfig.NPCID; |
| | | _package.Count = 1; |
| | | GameNetSystem.Instance.SendInfo(_package); |
| | | |
| | | SnxxzGame.Instance.StartCoroutine(_Bind(npc)); |
| | | } |
| | | |
| | | private static IEnumerator _Bind(GA_NpcClientFightNorm npc) |
| | | { |
| | | #if UNITY_EDITOR |
| | | Debug.LogFormat("开始执行客户端召唤怪: {0}", npc.ServerInstID); |
| | | #endif |
| | | PersonalEnemy _pm = null; |
| | | while (true) |
| | | { |
| | | for (int i = 0; i < m_UnUsed.Count; ++i) |
| | | { |
| | | if (m_UnUsed[i].data.NPCID == npc.NpcConfig.NPCID) |
| | | { |
| | | _pm = m_UnUsed[i]; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (_pm != null) |
| | | { |
| | | m_UnUsed.Remove(_pm); |
| | | _pm.bindClientNpcSID = npc.ServerInstID; |
| | | m_CBinSdDict[npc.ServerInstID] = _pm.data.ObjID; |
| | | m_SBindCDict[_pm.data.ObjID] = npc.ServerInstID; |
| | | npc.ActorInfo.LV = _pm.data.LV; |
| | | npc.RequestName(); |
| | | npc.ActorInfo.ResetHp((int)_pm.data.HP, (short)_pm.data.HPEx, (int)_pm.data.MaxHP, (short)_pm.data.MaxHPEx); |
| | | #if UNITY_EDITOR |
| | | Debug.LogFormat("找到了可绑定的专属敌人: {0}", _pm.data.ObjID); |
| | | #endif |
| | | yield break; |
| | | } |
| | | |
| | | yield return null; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 33f231c6df5f27048878a3b7b12e445c |
| | | timeCreated: 1557978317 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | |
|
| | | StopAllCoroutines();
|
| | | s_MapTransferDict.Clear();
|
| | |
|
| | | if (s_MapAreaDict != null)
|
| | | {
|
| | | foreach (var _list in s_MapAreaDict.Values)
|
| | |
| | | ClientDropItemUtility.Instance.ReleaseAll();
|
| | | SFXPlayUtility.Instance.Unitialize();
|
| | | FakeDungeonUtility.Instance.Reset();
|
| | | PersonalEnemy.UnInit();
|
| | | }
|
| | |
|
| | | protected override void OnUpdate()
|
| | |
| | | float defaultFov; |
| | | |
| | | SkyTowerModel model { get { return ModelCenter.Instance.GetModel<SkyTowerModel>(); } } |
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } } |
| | | |
| | | public override void Initialize() |
| | | { |
| | |
| | | |
| | | public override void UnInitialize() |
| | | { |
| | | PopupWindowsProcessor.Instance.Add("TowerWin", 0); |
| | | var config = SkyTowerConfig.Get(model.currentFloor); |
| | | if (model.IsChallengable() && PlayerDatas.Instance.baseData.FightPoint >= config.fightPower) |
| | | { |
| | | PopupWindowsProcessor.Instance.Add("TowerWin", 0); |
| | | } |
| | | |
| | | CameraController.Instance.CameraObject.enabled = true; |
| | | CameraManager.uiCamera.enabled = true; |
| | | StopAllCoroutines(); |
| | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "items", _g_get_items); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "sideTasks", _g_get_sideTasks); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "succGuide", _g_get_succGuide); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "failGuide", _g_get_failGuide); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "remind", _g_get_remind); |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_failGuide(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | TaskFeedbackConfig gen_to_be_invoked = (TaskFeedbackConfig)translator.FastGetCSObj(L, 1); |
| | | translator.Push(L, gen_to_be_invoked.failGuide); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_remind(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | TaskFeedbackConfig gen_to_be_invoked = (TaskFeedbackConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.lua_pushstring(L, gen_to_be_invoked.remind); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | {
|
| | | var config = AlchemyConfig.Get(alchemyId);
|
| | | var startTime = TimeUtility.GetTime(tick);
|
| | | var seconds = (int)(config.NeedTime - (float)(TimeUtility.ServerNow - startTime).TotalSeconds);
|
| | | var seconds = config.NeedTime - (float)(TimeUtility.ServerNow - startTime).TotalSeconds;
|
| | | return seconds > 0 ? 1 : 2;
|
| | | }
|
| | | return 0;
|
| | |
| | |
|
| | | [SerializeField] Transform m_ContainerAlcheming;
|
| | | [SerializeField] Text m_AlchemyTime;
|
| | | [SerializeField] Slider m_TimeSlider;
|
| | | [SerializeField] Transform m_ContainerComplete;
|
| | | [SerializeField] Transform m_ContainerNormal;
|
| | | [SerializeField] Text m_StoveLevel;
|
| | |
| | | timer = 0f;
|
| | | PerSecond();
|
| | | }
|
| | |
|
| | | if (state == 1)
|
| | | {
|
| | | uint tick = 0;
|
| | | if (model.TryGetAlchemyStartTime(model.selectAlchemy, out tick))
|
| | | {
|
| | | var config = AlchemyConfig.Get(model.selectAlchemy);
|
| | | var startTime = TimeUtility.GetTime(tick);
|
| | | var seconds = config.NeedTime - (float)(TimeUtility.ServerNow - startTime).TotalSeconds;
|
| | | m_TimeSlider.value = Mathf.Clamp01(1 - seconds / config.NeedTime);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void PerSecond()
|
| | |
| | | {
|
| | | m_AlchemyTypeSort.Display();
|
| | | m_AlchemyQualitySort.Display();
|
| | |
|
| | | Display();
|
| | |
|
| | | AlchemySortBehaviour.onSortRefresh += OnSortRefresh;
|
| | | model.alchemyDrugUseRefresh += AlchemyDrugUseRefresh;
|
| | | packModel.refreshItemCountEvent += RefreshItemCountEvent;
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | Display();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | {
|
| | | m_Controller.JumpIndex(index);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Controller.JumpIndex(0);
|
| | | }
|
| | |
|
| | | model.jumpAlchemy = 0;
|
| | | }
|
| | |
| | | public PreciousItem currentShowItem { get; private set; }
|
| | | public event Action showItemRefreshEvent;
|
| | | public bool isGetNewItem { get;set; }
|
| | |
|
| | | bool isServerPrepare { get; set; }
|
| | | public override void Init()
|
| | | {
|
| | | ItemLogicUtility.Instance.GetPreciousItemEvent += OnGetPreciousItem;
|
| | | playerPack.refrechPackEvent += OnPackageRefresh;
|
| | | playerPack.refreshItemCountEvent += OnPackageItemRefresh;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | ItemLogicUtility.Instance.GetPreciousItemEvent -= OnGetPreciousItem;
|
| | | playerPack.refrechPackEvent -= OnPackageRefresh;
|
| | | playerPack.refreshItemCountEvent -= OnPackageItemRefresh;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | isGetNewItem = false;
|
| | | isServerPrepare = false;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= RefreshRealm;
|
| | | CrossServerOneVsOnePlayerInfo.Instance.UpdateMatchNumEvent -= UpdateCrossOneVsOneMatchNum;
|
| | | }
|
| | |
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | isServerPrepare = true;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += RefreshRealm;
|
| | | CrossServerOneVsOnePlayerInfo.Instance.UpdateMatchNumEvent += UpdateCrossOneVsOneMatchNum;
|
| | | }
|
| | |
| | | OnPackageRefresh(_type);
|
| | | }
|
| | |
|
| | | private void OnFuncStateChangeEvent(int id)
|
| | | {
|
| | | if (id == (int)FuncOpenEnum.BlastFurnace && FuncOpen.Instance.IsFuncOpen(id))
|
| | | {
|
| | | if (isServerPrepare)
|
| | | {
|
| | | RecommandAlchemyDrugs();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private bool FindLatestItem(out PreciousItem _item)
|
| | | {
|
| | | if (itemGuids.Count == 0)
|
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | private void RecommandAlchemyDrugs()
|
| | | {
|
| | | var items = playerPack.GetItems(PackType.Item, new SinglePack.FilterParams());
|
| | | if (items != null)
|
| | | {
|
| | | foreach (var item in items)
|
| | | {
|
| | | var config = AttrFruitConfig.Get(item.itemId);
|
| | | if (config != null && config.FuncID == 2)
|
| | | {
|
| | | ItemLogicUtility.Instance.RecommendItem(item);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void Trim()
|
| | | {
|
| | | for (int i = itemGuids.Count - 1; i >= 0; i--)
|
| | |
| | | {
|
| | | strengthLevel = EquipStrengthDic[serverPlace].StrengthLevel;
|
| | | }
|
| | | var stage = strengthLevel / 20;
|
| | | var stage = strengthLevel / 10;
|
| | |
|
| | | if (minStage > stage)
|
| | | {
|
| | |
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | if (IsInDungeon)
|
| | | if (IsInDemonKingDungeon(PlayerDatas.Instance.baseData.MapID))
|
| | | {
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | | ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
|
| | |
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | if (IsInDungeon)
|
| | | if (IsInGrassDungeon(PlayerDatas.Instance.baseData.MapID))
|
| | | {
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | | ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
|
| | |
| | | {
|
| | | var lhs_config = HazyRegionConfig.Get(lhs);
|
| | | var rhs_config = HazyRegionConfig.Get(rhs);
|
| | | if (lhs_config.incidentType != rhs_config.incidentType)
|
| | | var lhs_index = model.incidentTypesSort.IndexOf((HazyRegionIncidentType)lhs_config.incidentType);
|
| | | var rhs_index = model.incidentTypesSort.IndexOf((HazyRegionIncidentType)rhs_config.incidentType);
|
| | | if (lhs_index != rhs_index)
|
| | | {
|
| | | return lhs_config.incidentType.CompareTo(rhs_config.incidentType);
|
| | | return lhs_index.CompareTo(rhs_index);
|
| | | }
|
| | | if (lhs_config.incidentType == rhs_config.incidentType)
|
| | | {
|
| | |
| | | Dictionary<int, Incident> m_Incidents = new Dictionary<int, Incident>();
|
| | | Dictionary<int, AdventureInfo> m_AdventureInfos = new Dictionary<int, AdventureInfo>();
|
| | |
|
| | | public List<HazyRegionIncidentType> incidentTypesSort = new List<HazyRegionIncidentType>()
|
| | | {
|
| | | HazyRegionIncidentType.Adventure,
|
| | | HazyRegionIncidentType.Precious,
|
| | | HazyRegionIncidentType.FairyGrass,
|
| | | HazyRegionIncidentType.ReikiGrass,
|
| | | HazyRegionIncidentType.DemonKing,
|
| | | };
|
| | |
|
| | | public int limitPoint { get; private set; }
|
| | | public int point { get; private set; }
|
| | | public int processingIncidentId { get; private set; }
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Thursday, May 16, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class TaskFeedbackFuncWin : Window
|
| | | {
|
| | | [SerializeField] TaskFeedbackFunc[] m_Funcs;
|
| | |
|
| | | TaskFeedbackModel model { get { return ModelCenter.Instance.GetModel<TaskFeedbackModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | for (int i = 0; i < m_Funcs.Length; i++)
|
| | | {
|
| | | var index = i;
|
| | | m_Funcs[i].button.AddListener(() =>
|
| | | {
|
| | | OnFunc(index);
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | Display();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | void Display()
|
| | | {
|
| | | for (int i = 0; i < m_Funcs.Length; i++)
|
| | | {
|
| | | m_Funcs[i].button.gameObject.SetActive(i < model.taskFeedbackFuncs.Count);
|
| | | if (i < model.taskFeedbackFuncs.Count)
|
| | | {
|
| | | var config = TaskFeedbackFuncConfig.Get(model.taskFeedbackFuncs[i]);
|
| | | if (config != null)
|
| | | {
|
| | | m_Funcs[i].label.text = config.name;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnFunc(int index)
|
| | | {
|
| | | CloseImmediately();
|
| | | if (index < model.taskFeedbackFuncs.Count)
|
| | | {
|
| | | var config = TaskFeedbackFuncConfig.Get(model.taskFeedbackFuncs[index]);
|
| | | if (config != null)
|
| | | {
|
| | | if (config.jump != 0)
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)config.jump);
|
| | | }
|
| | | else if (config.guide != 0)
|
| | | {
|
| | | var guideConfig = GuideConfig.Get(config.guide);
|
| | | if (guideConfig == null)
|
| | | {
|
| | | DebugEx.LogFormat("引导<color=#ff0000>{0}</color>未添加", config.guide);
|
| | | return;
|
| | | }
|
| | | switch ((GuideType)guideConfig.Type)
|
| | | {
|
| | | case GuideType.Functional:
|
| | | FunctionalGuideCenter.Instance.StartGuide(config.guide);
|
| | | break;
|
| | | default:
|
| | | NewBieCenter.Instance.StartNewBieGuide(config.guide);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | [Serializable]
|
| | | public struct TaskFeedbackFunc
|
| | | {
|
| | | public Button button;
|
| | | public Text label;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4c045d6076e0f1f4abf90ccee2848dc9 |
| | | timeCreated: 1557989419 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | {
|
| | | Dictionary<int, TaskFeedback> m_TaskFeedbacks = new Dictionary<int, TaskFeedback>();
|
| | |
|
| | | public readonly List<int> taskFeedbackFuncs = new List<int>();
|
| | |
|
| | | ReikiRootModel reikiRootModel { get { return ModelCenter.Instance.GetModel<ReikiRootModel>(); } }
|
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | | TaskModel taskModel { get { return ModelCenter.Instance.GetModel<TaskModel>(); } }
|
| | |
| | | }
|
| | | }
|
| | | break;
|
| | | case TaskFeedbackType.ReikiPoint:
|
| | | {
|
| | | if (!string.IsNullOrEmpty(config.reikiRoot))
|
| | | {
|
| | | var json = LitJson.JsonMapper.ToObject(config.reikiRoot);
|
| | | feedback.reikiRoots = new Dictionary<int, List<int[]>>();
|
| | | foreach (var jobKey in json.Keys)
|
| | | {
|
| | | var job = int.Parse(jobKey);
|
| | | var intArray = LitJson.JsonMapper.ToObject<int[][]>(json[jobKey].ToJson());
|
| | | feedback.reikiRoots.Add(job, new List<int[]>());
|
| | | for (int i = 0; i < intArray.Length; i++)
|
| | | {
|
| | | feedback.reikiRoots[job].Add(intArray[i]);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | |
|
| | | m_TaskFeedbacks.Add(config.taskId, feedback);
|
| | |
| | |
|
| | | public void ExecuteTaskFeedback(int taskId)
|
| | | {
|
| | | if (NewBieCenter.Instance.inGuiding || FunctionalGuideCenter.Instance.ExistAnyUnderwayGuide())
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | TaskFeedback feedback;
|
| | | if (TryGetTaskFeedback(taskId, out feedback))
|
| | | {
|
| | |
| | | case TaskFeedbackType.Guide:
|
| | | case TaskFeedbackType.Equip:
|
| | | case TaskFeedbackType.ItemCount:
|
| | | case TaskFeedbackType.SkyTowerFightPoint:
|
| | | {
|
| | | int condition = 0;
|
| | | if (IsSatisfyCondition(feedback, out condition))
|
| | | {
|
| | | if (config.succGuide != null
|
| | | && config.succGuide.Length > 0)
|
| | | var guide = config.succGuide != null
|
| | | && config.succGuide.Length > 0 ? config.succGuide[0] : 0;
|
| | | if (config.jump != 0 && (guide == 0 || NewBieCenter.Instance.IsGuideCompleted(guide)))
|
| | | {
|
| | | ExecuteGuide(config.succGuide[0]);
|
| | | WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)config.jump);
|
| | | }
|
| | | else
|
| | | {
|
| | | ExecuteGuide(guide);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!string.IsNullOrEmpty(config.remind))
|
| | | if (config.remind != null && config.remind.Length > 0)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip(config.remind);
|
| | | var index = Mathf.Min(condition, config.remind.Length - 1);
|
| | | SysNotifyMgr.Instance.ShowTip(config.remind[index]);
|
| | | }
|
| | | if (config.failGuide != null
|
| | | && config.failGuide.Length > 0)
|
| | | if (config.failFuncs != null && config.failFuncs.Length > 0)
|
| | | {
|
| | | ExecuteGuide(config.failGuide[0]);
|
| | | taskFeedbackFuncs.Clear();
|
| | | taskFeedbackFuncs.AddRange(config.failFuncs);
|
| | | WindowCenter.Instance.Open<TaskFeedbackFuncWin>();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | int condition = 0;
|
| | | if (IsSatisfyCondition(feedback, out condition))
|
| | | {
|
| | | if (config.succGuide != null
|
| | | && config.succGuide.Length > 0)
|
| | | var guide = config.succGuide != null
|
| | | && config.succGuide.Length > 0 ? config.succGuide[0] : 0;
|
| | | if (config.jump != 0 && (guide == 0 || NewBieCenter.Instance.IsGuideCompleted(guide)))
|
| | | {
|
| | | ExecuteGuide(config.succGuide[0]);
|
| | | WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)config.jump);
|
| | | }
|
| | | else
|
| | | {
|
| | | ExecuteGuide(guide);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!string.IsNullOrEmpty(config.remind))
|
| | | if (config.remind != null && config.remind.Length > 0)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip(config.remind);
|
| | | var taskIndex = feedback.IndexOfSideTasks(condition);
|
| | | var index = Mathf.Min(taskIndex, config.remind.Length - 1);
|
| | | SysNotifyMgr.Instance.ShowTip(config.remind[index]);
|
| | | }
|
| | | var index = feedback.IndexOfSideTasks(condition);
|
| | | if (config.failGuide != null
|
| | | && index >= 0 && index < config.failGuide.Length)
|
| | | if (config.failFuncs != null && config.failFuncs.Length > 0)
|
| | | {
|
| | | ExecuteGuide(config.failGuide[index]);
|
| | | taskFeedbackFuncs.Clear();
|
| | | taskFeedbackFuncs.AddRange(config.failFuncs);
|
| | | WindowCenter.Instance.Open<TaskFeedbackFuncWin>();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | int condition = 0;
|
| | | if (IsSatisfyCondition(feedback, out condition))
|
| | | {
|
| | | if (config.succGuide != null
|
| | | && config.succGuide.Length > 0)
|
| | | var guide = config.succGuide != null
|
| | | && config.succGuide.Length > 0 ? config.succGuide[0] : 0;
|
| | | if (config.jump != 0 && (guide == 0 || NewBieCenter.Instance.IsGuideCompleted(guide)))
|
| | | {
|
| | | ExecuteGuide(config.succGuide[0]);
|
| | | WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)config.jump);
|
| | | }
|
| | | else
|
| | | {
|
| | | ExecuteGuide(guide);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!string.IsNullOrEmpty(config.remind))
|
| | | if (config.remind != null && config.remind.Length > 0)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip(config.remind);
|
| | | var taskIndex = feedback.IndexOfSideTasks(condition);
|
| | | var index = Mathf.Min(taskIndex, config.remind.Length - 1);
|
| | | SysNotifyMgr.Instance.ShowTip(config.remind[index]);
|
| | | }
|
| | | if (!IsSatisfySideTask(feedback.sideTasks, out condition))
|
| | | if (config.failFuncs != null && config.failFuncs.Length > 0)
|
| | | {
|
| | | var index = feedback.IndexOfSideTasks(condition);
|
| | | if (config.failGuide != null
|
| | | && index >= 0 && index < config.failGuide.Length)
|
| | | {
|
| | | ExecuteGuide(config.failGuide[index]);
|
| | | }
|
| | | taskFeedbackFuncs.Clear();
|
| | | taskFeedbackFuncs.AddRange(config.failFuncs);
|
| | | WindowCenter.Instance.Open<TaskFeedbackFuncWin>();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | case TaskFeedbackType.SideTask:
|
| | | return IsSatisfySideTask(feedback.sideTasks, out condition);
|
| | | case TaskFeedbackType.ReikiPoint:
|
| | | {
|
| | | if (feedback.reikiRoots != null)
|
| | | {
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | | var reikiRoots = feedback.reikiRoots[job];
|
| | | foreach (var reikiRoot in reikiRoots)
|
| | | {
|
| | | if (reikiRootModel.GetReikiRootPoint(reikiRoot[0]) < reikiRoot[1])
|
| | | {
|
| | | condition = 1;
|
| | | return false;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return reikiRootModel.GetReikiRootTotalPoint() >= config.condition;
|
| | | case TaskFeedbackType.Equip:
|
| | | {
|
| | |
| | | }
|
| | | return true;
|
| | | }
|
| | | case TaskFeedbackType.SkyTowerFightPoint:
|
| | | {
|
| | | var skyTowerConfig = SkyTowerConfig.Get(config.condition);
|
| | | if (skyTowerConfig != null)
|
| | | {
|
| | | return PlayerDatas.Instance.baseData.FightPoint >= skyTowerConfig.fightPower;
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
| | | public List<int[]> sideTasks;
|
| | | public int[] equipCondition;
|
| | | public List<Item> items;
|
| | | public Dictionary<int, List<int[]>> reikiRoots;
|
| | |
|
| | | public int IndexOfSideTasks(int taskId)
|
| | | {
|
| | |
| | | Guide = 6,
|
| | | FightPowerSideTask = 7,
|
| | | ItemCount = 8,
|
| | | SkyTowerFightPoint = 9,
|
| | | }
|
| | | } |
| | | |
| | |
| | | colorType = RichTextMgr.Inst.presentRichText.colorType == RichText.ColorType.Dark ? 0 : 1;
|
| | | }
|
| | | var fightPoint = PlayerDatas.Instance.baseData.FightPoint;
|
| | | var targetValue = int.Parse(dic["myfightpoint"]);
|
| | | var targetValue = 0;
|
| | | var infoArray = dic["myfightpoint"].Split('_');
|
| | | if (infoArray.Length > 1)
|
| | | {
|
| | | switch (infoArray[0])
|
| | | {
|
| | | case "skytower":
|
| | | var config = SkyTowerConfig.Get(infoArray[1]);
|
| | | if (config != null)
|
| | | {
|
| | | targetValue = config.fightPower;
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | int.TryParse(dic["myfightpoint"], out targetValue);
|
| | | }
|
| | |
|
| | | if (fightPoint < targetValue)
|
| | | {
|
| | | var label = dic.ContainsKey("replacelabel1") ? dic["replacelabel1"] : string.Empty;
|
| | |
| | | {
|
| | | colorType = RichTextMgr.Inst.presentRichText.colorType == RichText.ColorType.Dark ? 0 : 1;
|
| | | }
|
| | |
|
| | | var reikiRootModel = ModelCenter.Instance.GetModel<ReikiRootModel>();
|
| | | var point = reikiRootModel.GetReikiRootTotalPoint();
|
| | | var targetValue = int.Parse(dic["myreikiroot"]);
|
| | | if (point < targetValue)
|
| | |
|
| | | var satisfy = false;
|
| | | var targetValue = 0;
|
| | | var point = 0;
|
| | | var property = 0;
|
| | |
|
| | | if (int.TryParse(dic["myreikiroot"], out targetValue))
|
| | | {
|
| | | point = reikiRootModel.GetReikiRootTotalPoint();
|
| | | satisfy = point >= targetValue;
|
| | | }
|
| | | else
|
| | | {
|
| | | var jsonArray = LitJson.JsonMapper.ToObject<int[][]>(dic["myreikiroot"]);
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | | for (int i = 0; i < jsonArray.Length; i++)
|
| | | {
|
| | | if (i == job - 1)
|
| | | {
|
| | | property = jsonArray[i][0];
|
| | | point = reikiRootModel.GetReikiRootPoint(jsonArray[i][0]);
|
| | | targetValue = jsonArray[i][1];
|
| | | satisfy = point >= targetValue;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (!satisfy)
|
| | | {
|
| | | var label = dic.ContainsKey("replacelabel1") ? dic["replacelabel1"] : string.Empty;
|
| | | if (property != 0)
|
| | | {
|
| | | var propertyConfig = PlayerPropertyConfig.Get(property);
|
| | | label = StringUtility.Contact(propertyConfig.Name, ":");
|
| | | }
|
| | | return UIHelper.AppendColor(TextColType.Red, StringUtility.Contact(label, point, "/", targetValue), colorType == 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | var label = dic.ContainsKey("replacelabel2") ? dic["replacelabel2"] : string.Empty;
|
| | | return UIHelper.AppendColor(TextColType.Green, label, colorType == 1);
|
| | | return label;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using UnityEngine; |
| | | |
| | | public abstract class TRichAnalysis<T> where T:class,new() |
| | | { |
| | | private static T _inst = null; |
| | | |
| | | public static T Inst { |
| | | get { |
| | | if (_inst == null) { |
| | | _inst = new T(); |
| | | } |
| | | return _inst; |
| | | } |
| | | } |
| | | |
| | | protected static StringBuilder m_StringBuilder = new StringBuilder(); |
| | | |
| | | protected static Dictionary<string, string> displayDic = new Dictionary<string, string>(); |
| | | |
| | | public abstract string Analysis(string val,bool IsRich); |
| | | |
| | | public abstract string CalculateTextIndex(string val,int index); |
| | | |
| | | protected static readonly char SPLITEVENT = '|'; |
| | | protected static readonly char SPLITDATA = ' '; |
| | | protected static readonly char SPLITVALUE = '='; |
| | | |
| | | private static string[] poolStrs=new string[1]; |
| | | |
| | | protected string[] GetSplitEvent(string val) |
| | | { |
| | | return val.Split(SPLITEVENT); |
| | | } |
| | | |
| | | protected string[] GetSplitData(string val) |
| | | { |
| | | return val.Split(SPLITDATA); |
| | | } |
| | | |
| | | protected string[] GetSplitValue(string val) |
| | | { |
| | | if (WordAnalysis.Color_Start_Regex.IsMatch(val)) { |
| | | poolStrs[0] = val; |
| | | return poolStrs; |
| | | } |
| | | return val.Split(SPLITVALUE); |
| | | } |
| | | } |
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | | using UnityEngine;
|
| | |
|
| | | public abstract class TRichAnalysis<T> where T:class,new()
|
| | | {
|
| | | private static T _inst = null;
|
| | |
|
| | | public static T Inst {
|
| | | get {
|
| | | if (_inst == null) {
|
| | | _inst = new T();
|
| | | }
|
| | | return _inst;
|
| | | }
|
| | | }
|
| | |
|
| | | protected static StringBuilder m_StringBuilder = new StringBuilder();
|
| | |
|
| | | protected static Dictionary<string, string> displayDic = new Dictionary<string, string>();
|
| | |
|
| | | public abstract string Analysis(string val,bool IsRich);
|
| | |
|
| | | public abstract string CalculateTextIndex(string val,int index);
|
| | |
|
| | | protected static readonly char SPLITEVENT = '|';
|
| | | protected static readonly char SPLITDATA = ' ';
|
| | | protected static readonly char SPLITVALUE = '=';
|
| | |
|
| | | private static string[] poolStrs=new string[1];
|
| | |
|
| | | protected string[] GetSplitEvent(string val)
|
| | | {
|
| | | return val.Split(SPLITEVENT);
|
| | | }
|
| | |
|
| | | protected string[] GetSplitData(string val)
|
| | | {
|
| | | return val.Split(SPLITDATA);
|
| | | }
|
| | |
|
| | | protected string[] GetSplitValue(string val)
|
| | | {
|
| | | var newVal = val.Replace("=", "");
|
| | | var count = val.Length - newVal.Length;
|
| | | if (count == 1 && WordAnalysis.Color_Start_Regex.IsMatch(val))
|
| | | {
|
| | | poolStrs[0] = val;
|
| | | return poolStrs;
|
| | | }
|
| | | return val.Split(new char[] { SPLITVALUE }, 2);
|
| | | }
|
| | | }
|
| | |
| | | public List<int> ListEffectSkill = new List<int>(); |
| | | private int HorseDanExp = 0;//坐骑丹经验 |
| | | private int autoActiveHorseId = 0; |
| | | private bool hasSendAutoActive = false; |
| | | PackModel _playerPack; |
| | | PackModel playerPack { |
| | | get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); } |
| | |
| | | public void OnBeforePlayerDataInitialize() |
| | | { |
| | | IsOk = false; |
| | | hasSendAutoActive = false; |
| | | _HorseIDNow = string.Empty; |
| | | HorseIDNow = 0; |
| | | _DicHorse.Clear(); |
| | |
| | | } |
| | | MountChangeRedPoint(); |
| | | MountDanRed(); |
| | | |
| | | var config = HorseConfig.Get(autoActiveHorseId);
|
| | | if (config != null && id == config.UnlockItemID)
|
| | | {
|
| | | TryAutoActiveHorse();
|
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | {
|
| | | if (funcId == (int)FuncOpenEnum.Mounts)
|
| | | {
|
| | | if (IsOk && FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Mounts))
|
| | | {
|
| | | Clock.AlarmAfter(0.5f, () =>
|
| | | {
|
| | | TryAutoActiveHorse();
|
| | | });
|
| | | }
|
| | | TryAutoActiveHorse();
|
| | | }
|
| | | } |
| | | |
| | | private void TryAutoActiveHorse()
|
| | | {
|
| | | var horseConfig = HorseConfig.Get(autoActiveHorseId);
|
| | | if (horseConfig != null)
|
| | | if (IsOk && FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Mounts)
|
| | | && !_DicHorse.ContainsKey(autoActiveHorseId) && !hasSendAutoActive)
|
| | | {
|
| | | var itemCount = playerPack.GetItemCountByID(PackType.Item, horseConfig.UnlockItemID);
|
| | | if (itemCount >= horseConfig.UnlockItemCnt)
|
| | | var horseConfig = HorseConfig.Get(autoActiveHorseId);
|
| | | if (horseConfig != null)
|
| | | {
|
| | | var pak = new CA501_tagPlayerActivateHorse();
|
| | | pak.HorseID = (uint)autoActiveHorseId;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | var itemCount = playerPack.GetItemCountByID(PackType.Item, horseConfig.UnlockItemID);
|
| | | if (itemCount >= horseConfig.UnlockItemCnt)
|
| | | {
|
| | | hasSendAutoActive = true;
|
| | | var pak = new CA501_tagPlayerActivateHorse();
|
| | | pak.HorseID = (uint)autoActiveHorseId;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | |
| | | public int curPetId { get; set; }
|
| | | public int petUpgradeToolId { get; set; }
|
| | | public int autoActivePetId { get; private set; }
|
| | | public bool hasSendAutoActive { get; private set; }
|
| | |
|
| | | public event Action PlayerLoginOkData;
|
| | | private Dictionary<int, int> DicDefaultPet = new Dictionary<int, int>();
|
| | |
| | | {
|
| | | Wait = true;
|
| | | isServerPrepare = false;
|
| | | hasSendAutoActive = false;
|
| | | _TagPetItem.Clear();
|
| | | _DicPetBack.Clear();
|
| | | PetNow = 0;
|
| | |
| | | PetActivateRedPoint();
|
| | | GetCultivateRedPoint();
|
| | |
|
| | | var config = PetInfoConfig.Get(autoActivePetId);
|
| | | if (config != null && id == config.UnLockNeedItemID)
|
| | | {
|
| | | TryAutoActivePet();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | PetActivateRedPoint();
|
| | | GetCultivateRedPoint();
|
| | |
|
| | | if (isServerPrepare && FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Pet))
|
| | | {
|
| | | Clock.AlarmAfter(0.5f, () =>
|
| | | {
|
| | | TryAutoActivePet();
|
| | | });
|
| | | }
|
| | | TryAutoActivePet();
|
| | | }
|
| | | }
|
| | |
|
| | | private void TryAutoActivePet()
|
| | | {
|
| | | var petConfig = PetInfoConfig.Get(autoActivePetId);
|
| | | if (petConfig != null)
|
| | | if (isServerPrepare && FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Pet)
|
| | | && !_DicPetBack.ContainsKey(autoActivePetId) && !hasSendAutoActive)
|
| | | {
|
| | | var itemCount = playerPack.GetItemCountByID(PackType.Item, petConfig.UnLockNeedItemID);
|
| | | if (itemCount >= petConfig.UnLockNeedItemCnt)
|
| | | var petConfig = PetInfoConfig.Get(autoActivePetId);
|
| | | if (petConfig != null)
|
| | | {
|
| | | SendBreakPetLockQuest(autoActivePetId);
|
| | | var itemCount = playerPack.GetItemCountByID(PackType.Item, petConfig.UnLockNeedItemID);
|
| | | if (itemCount >= petConfig.UnLockNeedItemCnt)
|
| | | {
|
| | | hasSendAutoActive = true;
|
| | | SendBreakPetLockQuest(autoActivePetId);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | protected override void AddListeners()
|
| | | {
|
| | | base.AddListeners();
|
| | | SetFunctionListener(0, OpenPetWin);
|
| | | SetFunctionListener(1, OpenMountWin);
|
| | | SetFunctionListener(0, OpenMountWin);
|
| | | SetFunctionListener(1, OpenPetWin);
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | |
| | |
|
| | | public int selectReikiRoot { get; set; }
|
| | |
|
| | | public bool openFromTreasureSkill { get; set; }
|
| | |
|
| | | public readonly Redpoint redpoint = new Redpoint(101, 10103); |
| | |
|
| | | public event Action onCacheFreePointRefresh;
|
| | |
| | | [SerializeField] Text m_FreePoint;
|
| | | [SerializeField] Button m_Reset;
|
| | | [SerializeField] Text m_ResetLabel;
|
| | | [SerializeField] Button m_GetPath;
|
| | | [SerializeField] Button m_Confirm;
|
| | | [SerializeField] Button m_Rule;
|
| | |
|
| | |
| | | m_Reset.AddListener(OnReset);
|
| | | m_Confirm.AddListener(Confirm);
|
| | | m_Rule.AddListener(OnRule);
|
| | | m_GetPath.AddListener(GetPath);
|
| | |
|
| | | m_NumKeyboard.onValueChange.AddListener(OnPointValChange);
|
| | | m_NumKeyboard.onConfirm.AddListener((bool isOk) =>
|
| | |
| | | }
|
| | |
|
| | | treasureSkillModel.newSatisfyActiveExpertDirty = false;
|
| | | model.openFromTreasureSkill = false;
|
| | |
|
| | | StopAllCoroutines();
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (treasureSkillModel.newSatisfyActiveExpertDirty)
|
| | | if (treasureSkillModel.newSatisfyActiveExpertDirty && !model.openFromTreasureSkill)
|
| | | {
|
| | | if (!WindowCenter.Instance.IsOpen<ReikiRootQualityPromoteWin>())
|
| | | {
|
| | |
| | | WindowCenter.Instance.Open<ReikiRootRuleWin>();
|
| | | }
|
| | |
|
| | | private void GetPath()
|
| | | {
|
| | | RealmRecommandEquipGetWayWin.equipGetWays.Clear();
|
| | | RealmRecommandEquipGetWayWin.equipGetWays.AddRange(model.reikiRootGetWays);
|
| | | WindowCenter.Instance.Open<RealmRecommandEquipGetWayWin>();
|
| | | }
|
| | |
|
| | | private void OnFlyComplete()
|
| | | {
|
| | | StartCoroutine(Co_DisplayReikis());
|
| | |
| | |
|
| | | public class ExpertSkillActiveRemindWin : Window
|
| | | {
|
| | | [SerializeField] Text m_Reiki;
|
| | | [SerializeField] Text m_Remind;
|
| | | [SerializeField] Button m_GotoReiki;
|
| | | [SerializeField] Button m_GetPath;
|
| | | [SerializeField] Button m_Confirm;
|
| | | [SerializeField] Button m_Cancel;
|
| | | [SerializeField] Button m_Close;
|
| | |
|
| | | public static int skillId = 0;
|
| | |
| | | protected override void AddListeners()
|
| | | {
|
| | | m_GotoReiki.AddListener(GotoReiki);
|
| | | m_GetPath.AddListener(GetPath);
|
| | | m_Confirm.AddListener(Confirm);
|
| | | m_Cancel.AddListener(CloseClick);
|
| | | m_Close.AddListener(CloseClick);
|
| | | }
|
| | |
|
| | |
| | | var requireProperty = skillConfig.RequireProperty();
|
| | | var requireValue = skillConfig.RequirePropertyValue();
|
| | | var propertyConfig = PlayerPropertyConfig.Get(requireProperty);
|
| | | m_Remind.text = Language.Get("ExpertSkillActiveRemind", propertyConfig.Name, requireValue);
|
| | |
|
| | | if (reikiRootModel.freePoint + reikiRootModel.GetReikiRootPoint(requireProperty) >= requireValue)
|
| | | var point = requireValue - reikiRootModel.GetReikiRootPoint(requireProperty);
|
| | | if (reikiRootModel.freePoint >= point)
|
| | | {
|
| | | m_GotoReiki.gameObject.SetActive(true);
|
| | | m_GetPath.gameObject.SetActive(false);
|
| | | m_Reiki.text = StringUtility.Contact(propertyConfig.Name, ":", requireValue);
|
| | | m_Reiki.color = UIHelper.GetUIColor(TextColType.Green, true);
|
| | | m_GotoReiki.gameObject.SetActive(false);
|
| | | m_Confirm.gameObject.SetActive(true);
|
| | | m_Cancel.gameObject.SetActive(true);
|
| | | m_Remind.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_GotoReiki.gameObject.SetActive(false);
|
| | | m_GetPath.gameObject.SetActive(true);
|
| | | m_Reiki.text = StringUtility.Contact(propertyConfig.Name, ":", requireValue
|
| | | , Language.Get("ExpertSkillActiveRemind", point));
|
| | | m_Reiki.color = UIHelper.GetUIColor(TextColType.Red, true);
|
| | | m_GotoReiki.gameObject.SetActive(true);
|
| | | m_Confirm.gameObject.SetActive(false);
|
| | | m_Cancel.gameObject.SetActive(false);
|
| | | m_Remind.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void GetPath()
|
| | | private void Confirm()
|
| | | {
|
| | | TreasurePotential expert;
|
| | | if (model.TryGetPotential(skillId, out expert))
|
| | | {
|
| | | var level = 0;
|
| | | model.TryGetExpertActiveLevel(skillId, out level);
|
| | | var skillConfig = SkillConfig.Get(skillId + level);
|
| | | var requireProperty = skillConfig.RequireProperty();
|
| | | var requireValue = skillConfig.RequirePropertyValue();
|
| | | var propertyConfig = PlayerPropertyConfig.Get(requireProperty);
|
| | | var point = requireValue - reikiRootModel.GetReikiRootPoint(requireProperty);
|
| | |
|
| | | if (reikiRootModel.freePoint >= point)
|
| | | {
|
| | | reikiRootModel.SendAddPoint(new byte[1] { (byte)requireProperty }, new ushort[1] { (ushort)point });
|
| | | }
|
| | | }
|
| | |
|
| | | CloseImmediately();
|
| | | RealmRecommandEquipGetWayWin.equipGetWays.Clear();
|
| | | RealmRecommandEquipGetWayWin.equipGetWays.AddRange(reikiRootModel.reikiRootGetWays);
|
| | | WindowCenter.Instance.Open<RealmRecommandEquipGetWayWin>();
|
| | | }
|
| | |
|
| | | private void GotoReiki()
|
| | |
| | | WindowCenter.Instance.CloseImmediately("ExpertSkillSelectWin");
|
| | | var skillConfig = SkillConfig.Get(skillId);
|
| | | reikiRootModel.selectReikiRoot = skillConfig.RequireProperty();
|
| | | reikiRootModel.openFromTreasureSkill = true;
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.RolePoint);
|
| | | }
|
| | | }
|
| | |
| | | m_Select.gameObject.SetActive(activeLevel > 0 && !satisfyActive && !used);
|
| | | m_Active.gameObject.SetActive(satisfyActive || error == 3);
|
| | |
|
| | | m_Active.SetColorful(m_ActiveLabel, satisfyActive);
|
| | | //m_Active.SetColorful(m_ActiveLabel, satisfyActive);
|
| | |
|
| | | if (satisfyActive || error == 3)
|
| | | {
|
| | |
| | | SetJumpLogic<LootPreciousFrameWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.FairyAuction:
|
| | | case JumpUIType.FullServerAuction:
|
| | | SetJumpLogic<AuctionHouseWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.HazyRegion:
|
| | |
| | | Alchemy5 = 316,
|
| | | RealmEquip1 = 317,
|
| | | Alchemy6 = 318,
|
| | | FullServerAuction = 319,
|
| | |
|
| | | DhszTs = 1001,//定海神针功法提升界面
|
| | | HyqTs = 1002,//皓月枪功法提升界面
|
| | |
| | | normalTasks.Add(new ConfigInitTask("AlchemyCountConfig", () => { AlchemyCountConfig.Init(); }, () => { return AlchemyCountConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("CollectNpcConfig", () => { CollectNpcConfig.Init(); }, () => { return CollectNpcConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("TreasureChapterConfig", () => { TreasureChapterConfig.Init(); }, () => { return TreasureChapterConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("TaskFeedbackConfig", () => { TaskFeedbackConfig.Init(); }, () => { return TaskFeedbackConfig.inited; })); |
| | | normalTasks.Add(new ConfigInitTask("TaskFeedbackConfig", () => { TaskFeedbackConfig.Init(); }, () => { return TaskFeedbackConfig.inited; }));
|
| | | normalTasks.Add(new ConfigInitTask("TaskFeedbackFuncConfig", () => { TaskFeedbackFuncConfig.Init(); }, () => { return TaskFeedbackFuncConfig.inited; })); |
| | | } |
| | | |
| | | static List<ConfigInitTask> doingTasks = new List<ConfigInitTask>(); |
| | |
| | |
|
| | | public static string AppendColor(TextColType type, string msg, bool bright = false)
|
| | | {
|
| | | if (m_TextColorRegex.IsMatch(msg))
|
| | | if (m_TextColorRegex.IsMatch(msg) && msg.ToLower().StartsWith("<color=#")
|
| | | && msg.ToLower().EndsWith("</color>"))
|
| | | {
|
| | | Match match = m_TextColorRegex.Match(msg);
|
| | | msg = match.Groups[1].Value;
|