Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
4 文件已复制
2个文件已删除
2 文件已重命名
6个文件已添加
55个文件已修改
| | |
| | | public static void Init()
|
| | | {
|
| | | // 登记相应的数据体及对应的数据转逻辑类
|
| | | Register(typeof(HB216_tagMCStartCustomSceneResult), typeof(DTCB216_tagMCStartCustomSceneResult));
|
| | | Register(typeof(HA905_tagGCNotifyEquipDetailInfo), typeof(DTCA905_tagGCNotifyEquipDetailInfo));
|
| | | Register(typeof(HA719_tagSCPlayerEquipCacheResult) ,typeof(DTCA719_tagSCPlayerEquipCacheResult));
|
| | | Register(typeof(HB108_tagMCYinjiStartTime) ,typeof(DTCB108_tagMCYinjiStartTime));
|
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Monday, May 20, 2019 |
| | | // [ Date ]: Thursday, May 23, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | |
| | | public readonly int alchemyLevel;
|
| | | public readonly int[] reward;
|
| | | public readonly int[] rewardState;
|
| | | public readonly string PortraitID; |
| | | public readonly string PortraitID;
|
| | | public readonly int star; |
| | | |
| | | public HazyRegionConfig() |
| | | { |
| | |
| | | int.TryParse(rewardStateStringArray[i],out rewardState[i]); |
| | | }
|
| | |
|
| | | PortraitID = tables[11]; |
| | | PortraitID = tables[11];
|
| | |
|
| | | int.TryParse(tables[12],out star); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | path = AssetVersionUtility.GetAssetFilePath("config/HazyRegion.txt"); |
| | | } |
| | | |
| | | configs.Clear(); |
| | | var tempConfig = new HazyRegionConfig(); |
| | | var preParse = tempConfig is IConfigPostProcess; |
| | | |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 3404c0f308cb2174bb7b93e12c3110bd |
| | | timeCreated: 1558343195 |
| | | timeCreated: 1558577610 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Wednesday, May 15, 2019 |
| | | // [ Date ]: Thursday, May 23, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | |
| | | public partial class PersonalBossConfig |
| | | { |
| | | |
| | | public readonly int NPCID; |
| | | public readonly int ChanllengeLv; |
| | | public readonly int[] MustItemID; |
| | | public readonly int[] RareItemID; |
| | | public readonly int NPCID;
|
| | | public readonly int lineId;
|
| | | public readonly int[] MustItemID;
|
| | | public readonly int[] RareItemID;
|
| | | public readonly string PortraitID; |
| | | |
| | | public PersonalBossConfig() |
| | |
| | | { |
| | | var tables = input.Split('\t'); |
| | | |
| | | int.TryParse(tables[0],out NPCID); |
| | | |
| | | int.TryParse(tables[1],out ChanllengeLv); |
| | | |
| | | int.TryParse(tables[0],out NPCID); |
| | |
|
| | | int.TryParse(tables[1],out lineId); |
| | |
|
| | | string[] MustItemIDStringArray = tables[2].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | MustItemID = new int[MustItemIDStringArray.Length]; |
| | | for (int i=0;i<MustItemIDStringArray.Length;i++) |
| | | { |
| | | int.TryParse(MustItemIDStringArray[i],out MustItemID[i]); |
| | | } |
| | | |
| | | }
|
| | |
|
| | | string[] RareItemIDStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | RareItemID = new int[RareItemIDStringArray.Length]; |
| | | for (int i=0;i<RareItemIDStringArray.Length;i++) |
| | | { |
| | | int.TryParse(RareItemIDStringArray[i],out RareItemID[i]); |
| | | } |
| | | |
| | | }
|
| | |
|
| | | PortraitID = tables[4]; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f73cc9f99bc29204fb20c8eecff4b111 |
| | | timeCreated: 1557892554 |
| | | timeCreated: 1558594484 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | }
|
| | | }
|
| | |
|
| | | GA_Hero.recordServerPos = new Vector3(package.PosX, 0, package.PosY);
|
| | |
|
| | | PlayerDatas.Instance.InitPlayerData(package);
|
| | | PlayerDatas.Instance.RequestWorldTick();
|
| | |
|
| | | if (ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | PlayerDatas.Instance.baseData.MapID = ClientDungeonStageUtility.clientMapId;
|
| | | }
|
| | |
|
| | | if (package.socketType == ServerType.Main)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | PlayerDatas.Instance.baseData.MapID = ClientDungeonStageUtility.clientMapId;
|
| | | }
|
| | | else
|
| | | {
|
| | | var clientMapRecord = ClientDungeonStageUtility.GetClientDataMapSymbol();
|
| | | if (clientMapRecord.mapId != 0 &&
|
| | | (DateTime.Now - clientMapRecord.time).TotalMinutes < 3)
|
| | | {
|
| | | ClientDungeonStageUtility.SetClientDungeon(true, (ushort)clientMapRecord.mapId);
|
| | | ClientDungeonStageUtility.dungeonInfo = clientMapRecord.dungeon;
|
| | | PlayerDatas.Instance.baseData.MapID = (ushort)clientMapRecord.mapId;
|
| | | }
|
| | | }
|
| | |
|
| | | if (package.socketType == ServerType.Main)
|
| | | {
|
| | | SDKUtility.Instance.RoleLogin(package.PlayerID.ToString(),
|
| | |
| | | return; |
| | | } |
| | | |
| | | if (_npcConfig.NPCType == (int)E_NpcType.PersonalEnemy) |
| | | if (vNetData.PlayerID == PlayerDatas.Instance.PlayerId) |
| | | { |
| | | PersonalEnemy.Bind(vNetData); |
| | | return; |
| | | if (_npcConfig.NPCType == (int)E_NpcType.PersonalEnemy) |
| | | { |
| | | PersonalEnemy.Bind(vNetData); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | if (_npcConfig.NPCType == (int)E_NpcType.Collect) |
| | |
| | |
|
| | | if (ResetPlayerPosEvent != null)
|
| | | ResetPlayerPosEvent(vNetData);
|
| | |
|
| | | GA_Hero.recordServerPos = new Vector3(vNetData.PosX, 0, vNetData.PosY);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class DTCA112_tagMCDBPlayer : DtcBasic |
| | | { |
| | |
| | | { |
| | | base.Done(vNetPack); |
| | | var package = vNetPack as HA112_tagMCDBPlayer; |
| | | |
| | | GA_Hero.recordServerPos = new Vector3(package.PosX, 0, package.PosY); |
| | | |
| | | PlayerDatas.Instance.UpdatePlayerData(package); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | if (playerInitEvent != null)
|
| | | {
|
| | | playerInitEvent();
|
| | | if (playerInitEvent != null) |
| | | { |
| | | playerInitEvent(); |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Monday, May 20, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | public class DTCB216_tagMCStartCustomSceneResult : DtcBasic
|
| | | {
|
| | |
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | var package = vNetPack as HB216_tagMCStartCustomSceneResult;
|
| | | ClientDungeonStageUtility.ReceiveStartCustomDungeonResult(package);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
copy from System/Treasure/ClientTreasureDungeon.cs.meta
copy to Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB216_tagMCStartCustomSceneResult.cs.meta
| File was copied from System/Treasure/ClientTreasureDungeon.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 189ce34976654c34da06b3239c45076d |
| | | timeCreated: 1556000158 |
| | | guid: dfc6ece5f89c0914781de4b1c26967c6 |
| | | timeCreated: 1558352395 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | using System.Collections.Generic;
|
| | |
|
| | | public class DTCB40A_tagMCPYPlayerMove : DtcBasic
|
| | | { |
| | | private static List<GameObject> _free = new List<GameObject>(); |
| | | private static List<GameObject> _list = new List<GameObject>(); |
| | | private static bool finished = false; |
| | | |
| | | {
|
| | | private static List<GameObject> _free = new List<GameObject>();
|
| | | private static List<GameObject> _list = new List<GameObject>();
|
| | | private static bool finished = false;
|
| | |
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | |
| | | _dest = new Vector3(package.ClientPosX * Constants.F_BETA, _player.Pos.y, package.ClientPosY * Constants.F_BETA);
|
| | | }
|
| | |
|
| | | GA_Hero.recordServerPos = new Vector3(package.SeverPosX, 0, package.SeverPosY);
|
| | |
|
| | | _player.MoveToPosition(_dest, package.Dir, package.Speed, package.MoveType == 1);
|
| | |
|
| | | finished = package.MoveType == 0;
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // B2 16 开始自定义场景结果 #tagMCStartCustomSceneResult
|
| | |
|
| | | public class HB216_tagMCStartCustomSceneResult : GameNetPackBasic {
|
| | | public uint MapID;
|
| | | public ushort FuncLineID;
|
| | | public byte Result; //是否允许
|
| | |
|
| | | public HB216_tagMCStartCustomSceneResult () {
|
| | | _cmd = (ushort)0xB216;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out MapID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out FuncLineID, vBytes, NetDataType.WORD);
|
| | | TransBytes (out Result, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
copy from System/Treasure/ClientTreasureDungeon.cs.meta
copy to Core/NetworkPackage/ServerPack/HB2_ActionMap/HB216_tagMCStartCustomSceneResult.cs.meta
| File was copied from System/Treasure/ClientTreasureDungeon.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 189ce34976654c34da06b3239c45076d |
| | | timeCreated: 1556000158 |
| | | guid: 8eef1db0ddcd05b458ac4b0ef547f3fd |
| | | timeCreated: 1558352371 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | GActorFight _target = null;
|
| | |
|
| | | CB405_tagCMSuperAtk _b405 = null;
|
| | | if (!ClientDungeonStageUtility.isClientDungeon
|
| | | && !ClientSceneManager.Instance.IsClientFightMode
|
| | | if (!ClientSceneManager.Instance.IsClientFightMode
|
| | | && !AdventureStage.Instance.IsInAdventureStage
|
| | | #if UNITY_EDITOR
|
| | | && !RuntimeLogUtility.TEST_CLIENT_PVP
|
| | |
| | | if (_bindID == 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | else
|
| | | {
|
| | | _b405.PosX = (ushort)(GA_Hero.recordServerPos.x + GA_Hero.MapOffset.x);
|
| | | _b405.PosY = (ushort)(GA_Hero.recordServerPos.z + GA_Hero.MapOffset.z);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | _target = GAMgr.Instance.GetByCID(skill.hitClientBattleTargetList[i]) as GActorFight;
|
| | |
|
| | | if (PersonalEnemy.m_CBinSdDict.ContainsKey(_target.ServerInstID))
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | AttackHandler.HurtObjs _hurtObject = new AttackHandler.HurtObjs
|
| | | {
|
| | | ObjID = (uint)_target.ServerInstID,
|
| | |
| | | {
|
| | | // 处理封魔坛英雄伤害
|
| | | FakeDemonJarDungeonStage _dungeon = StageLoad.Instance.currentStage as FakeDemonJarDungeonStage;
|
| | | ClientHazyDemonKingStage _clientHazyDemonStage = StageLoad.Instance.currentStage as ClientHazyDemonKingStage;
|
| | | if (_dungeon != null)
|
| | | {
|
| | | if (attacker.ServerInstID == PlayerDatas.Instance.PlayerId)
|
| | |
| | | {
|
| | | _cnpc.StartCantAtkedRotate();
|
| | | }
|
| | | }
|
| | | else if (_clientHazyDemonStage != null)
|
| | | {
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | |
|
| | | if (_doReduceHp)
|
| | | {
|
| | | if (attacker is GA_NpcClientFightNorm || target is GA_NpcClientFightNorm)
|
| | | {
|
| | | target.ActorInfo.ReduceHp((uint)hurtValue);
|
| | | }
|
| | | else
|
| | | {
|
| | | target.ActorInfo.ReduceHp((uint)realHurtValue);
|
| | | }
|
| | | // if (attacker is GA_NpcClientFightNorm || target is GA_NpcClientFightNorm)
|
| | | // {
|
| | | // target.ActorInfo.ReduceHp((uint)hurtValue);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | target.ActorInfo.ReduceHp((uint)realHurtValue);
|
| | | // }
|
| | | }
|
| | |
|
| | | if (target.ServerInstID == PlayerDatas.Instance.baseData.PlayerID)
|
| | |
| | | }
|
| | | }
|
| | | if (canDie
|
| | | && target.ActorInfo.RealHp == 0
|
| | | && !(StageLoad.Instance.currentStage is ClientHazyDemonKingStage))
|
| | | && target.ActorInfo.RealHp == 0)
|
| | | {
|
| | | target.Die(attacker.ServerInstID, soConfig.deadFlyId, (byte)attackType);
|
| | | }
|
| | |
| | | continue;
|
| | | }
|
| | |
|
| | | if (_target.ActorInfo.serverDie && !(StageLoad.Instance.currentStage is ClientHazyDemonKingStage))
|
| | | if (_target.ActorInfo.serverDie)
|
| | | {
|
| | | _target.Die(owner.ServerInstID, 0, m_CacheSkill.hurtClientList[i].AttackType);
|
| | | }
|
| | |
| | | continue;
|
| | | }
|
| | |
|
| | | if (_target.ActorInfo.serverDie
|
| | | && !(StageLoad.Instance.currentStage is ClientHazyDemonKingStage))
|
| | | if (_target.ActorInfo.serverDie)
|
| | | {
|
| | | _target.Die(owner.ServerInstID, 0, m_CacheSkill.hurtClntFightNpcList[i].AttackType);
|
| | | }
|
| | |
| | | WorldTick = PlayerDatas.Instance.GetWorldTick()
|
| | | };
|
| | |
|
| | | GA_Hero.recordServerPos = new Vector3(_proto.DestX, 0, _proto.DestY);
|
| | |
|
| | | if (!CrossServerUtility.IsCrossServer())
|
| | | {
|
| | | GameNetSystem.Instance.SendInfo(_proto);
|
| | |
| | |
|
| | | public class GA_Hero : GActorPlayerBase, ICtrlGA
|
| | | {
|
| | | public static Vector3 recordServerPos;
|
| | | public static Vector3 MapOffset;
|
| | | public static bool s_MapSwitching = false;
|
| | | public static bool s_Flying = false;
|
| | |
| | | {
|
| | | if (PreFightMission.Instance.IsFinished())
|
| | | {
|
| | | // 发送冲锋包
|
| | | CB404_tagCMRush _b404 = new CB404_tagCMRush();
|
| | | // 防止乱冲
|
| | | if (SelectTarget != null)
|
| | | if (!ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | _b404.ObjID = (uint)SelectTarget.ServerInstID;
|
| | | }
|
| | | _b404.PosX = (ushort)(Pos.x * 2 + GA_Hero.MapOffset.x);
|
| | | _b404.PosY = (ushort)(Pos.z * 2 + GA_Hero.MapOffset.z);
|
| | | // 发送冲锋包
|
| | | CB404_tagCMRush _b404 = new CB404_tagCMRush();
|
| | | // 防止乱冲
|
| | | if (SelectTarget != null)
|
| | | {
|
| | | _b404.ObjID = (uint)SelectTarget.ServerInstID;
|
| | | }
|
| | | _b404.PosX = (ushort)(Pos.x * 2 + GA_Hero.MapOffset.x);
|
| | | _b404.PosY = (ushort)(Pos.z * 2 + GA_Hero.MapOffset.z);
|
| | |
|
| | | GA_Hero.recordServerPos = new Vector3(_b404.PosX, 0, _b404.PosY);
|
| | |
|
| | | if (!CrossServerUtility.IsCrossServer())
|
| | | {
|
| | | GameNetSystem.Instance.SendInfo(_b404);
|
| | | }
|
| | | else
|
| | | {
|
| | | GameNetSystem.Instance.SendToCrossServer(_b404);
|
| | | if (!CrossServerUtility.IsCrossServer())
|
| | | {
|
| | | GameNetSystem.Instance.SendInfo(_b404);
|
| | | }
|
| | | else
|
| | | {
|
| | | GameNetSystem.Instance.SendToCrossServer(_b404);
|
| | | }
|
| | | }
|
| | | }
|
| | | PrevPos = Pos;
|
| | |
| | | public E_ActorGroup g; |
| | | } |
| | | |
| | | 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>(); |
| | |
| | | _npc.BornPos = _npc.Pos = _vaildPos; |
| | | m_CBinSdDict[_npc.ServerInstID] = h0408.ObjID; |
| | | m_SBindCDict[h0408.ObjID] = _npc.ServerInstID; |
| | | _npc.ActorInfo.Hp = h0408.HP; |
| | | _npc.ActorInfo.HpEx = h0408.HPEx; |
| | | _npc.ActorInfo.MaxHp = h0408.MaxHP; |
| | | _npc.ActorInfo.MaxHpEx = h0408.MaxHPEx; |
| | | _npc.ActorInfo.moveSpeed = 500f / h0408.Speed; |
| | | if (OnNpcAppear != null) |
| | | { |
| | | OnNpcAppear(_npc); |
| | |
| | | |
| | | private Vector3 m_CacheHeroPos; |
| | | private GA_NpcClientFunc m_Npc; |
| | | private GA_NpcClientCollect m_Precious; |
| | | |
| | | private bool dungeonFightWinOpenRecord = false; |
| | | private SFXController m_SfxController; |
| | | |
| | | private bool dungeonFightWinOpenRecord = false;
|
| | |
|
| | | const int s_PreciousNpcId = 40208014; |
| | | |
| | | private uint preciousServerInstId = 0; |
| | | |
| | | public event Action onLoadAdventureStage; |
| | | public event Action onExitAdventureStage; |
| | |
| | | public void Enter() |
| | | { |
| | | IsInAdventureStage = true; |
| | | ClientDungeonStageUtility.RequestStartClientDungeon(0, 0); |
| | | m_CacheHeroPos = PlayerDatas.Instance.hero.Pos; |
| | | SnxxzGame.Instance.StartCoroutine(_Enter()); |
| | | } |
| | |
| | | } |
| | | BossShowModel.Instance.bossShowCompletedEvent -= BossShowCompletedEvent; |
| | | BossShowModel.Instance.bossShowCompletedEvent += BossShowCompletedEvent; |
| | | HazyRegionDialogueWin.onDialogueComplete -= OnDialogueComplete;
|
| | | HazyRegionDialogueWin.onDialogueComplete += OnDialogueComplete; |
| | | |
| | | if (onLoadAdventureStage != null) |
| | | { |
| | |
| | | private IEnumerator _Exit() |
| | | { |
| | | NPCInteractProcessor.s_NpcInteractEvent -= OnNpcTalkEvent; |
| | | BossShowModel.Instance.bossShowCompletedEvent -= BossShowCompletedEvent; |
| | | GAMgr.Instance.ServerDie(m_Npc.ServerInstID); |
| | | GAMgr.Instance.Release(m_Npc); |
| | | BossShowModel.Instance.bossShowCompletedEvent -= BossShowCompletedEvent;
|
| | | HazyRegionDialogueWin.onDialogueComplete -= OnDialogueComplete;
|
| | | ClientCollectUtility.OnCollectFinished -= OnCollectFinished; |
| | | |
| | | if (!m_Npc.ActorInfo.serverDie)
|
| | | {
|
| | | GAMgr.Instance.ServerDie(m_Npc.ServerInstID);
|
| | | GAMgr.Instance.Release(m_Npc);
|
| | | } |
| | | |
| | | |
| | | if (m_SfxController != null)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(m_SfxController);
|
| | | m_SfxController = null;
|
| | | } |
| | | |
| | | WindowCenter.Instance.Open<LoadingWin>(); |
| | | WindowCenter.Instance.Close<MainInterfaceWin>(); |
| | |
| | | { |
| | | onExitAdventureStage(); |
| | | } |
| | | } |
| | | }
|
| | |
|
| | | private void OnDialogueComplete()
|
| | | {
|
| | | m_SfxController = SFXPlayUtility.Instance.Play(20039, m_Npc.Pos, Vector3.forward);
|
| | |
|
| | | m_Precious = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientCollect>(s_PreciousNpcId, E_ActorGroup.Collect);
|
| | | m_Precious.Pos = m_Npc.Pos;
|
| | | m_Precious.Rotation = Quaternion.Euler(0f, 165f, 0f);
|
| | |
|
| | | ClientSceneManager.Instance.lastDeadPos = m_Precious.Pos;
|
| | | |
| | | preciousServerInstId = m_Precious.ServerInstID; |
| | | |
| | | PlayerDatas.Instance.hero.SelectTarget = m_Precious; |
| | |
|
| | | if (!m_Npc.ActorInfo.serverDie)
|
| | | {
|
| | | GAMgr.Instance.ServerDie(m_Npc.ServerInstID);
|
| | | GAMgr.Instance.Release(m_Npc);
|
| | | }
|
| | |
|
| | | ClientCollectUtility.OnCollectFinished -= OnCollectFinished;
|
| | | ClientCollectUtility.OnCollectFinished += OnCollectFinished;
|
| | | }
|
| | |
|
| | | private void OnCollectFinished(uint sid)
|
| | | {
|
| | | if (preciousServerInstId == sid)
|
| | | {
|
| | | hazyRegionModel.SendSwitchAdventureState(hazyRegionModel.processingIncidentId, 3);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnNpcTalkEvent(E_NpcType type, int npcid, uint sid) |
| | | { |
| | | if (E_NpcType.Func == type) |
| | |
| | | using System;
|
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | |
| | | { |
| | | |
| | | public static bool isClientDungeon { get; private set; } |
| | | public static ushort clientMapId { get; private set; } |
| | | public static ushort clientMapId { get; private set; }
|
| | | public static Dungeon dungeonInfo { get; set; } |
| | | |
| | | static bool exitClientDungeonSymbol = false; |
| | | |
| | | const string OFFLINEMAPRECORD = "OfflineMapRecord"; |
| | | |
| | | public static event Action<HB214_tagMCCuntomFBPrizeInfo> onReceiveCustomDropItme; |
| | | |
| | | static Action<Dungeon, bool> clientCustomDungeonResult; |
| | | |
| | | public static void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.switchAccountEvent += Reset; |
| | | } |
| | | |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish; |
| | | }
|
| | |
|
| | | public static void SetClientDungeon(bool value, ushort mapId) |
| | | { |
| | | isClientDungeon = value; |
| | | clientMapId = mapId; |
| | | } |
| | | |
| | | public static void RequestClientDropItem(int mapId, int lineId)//模拟的真实地图id以及线路id
|
| | | {
|
| | | var pak = new CB108_tagCMRefreshCustomFBPrize();
|
| | | pak.MapID = (uint)mapId;
|
| | | pak.FuncLineID = (ushort)lineId;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | GlobalTimeEvent.Instance.fiveSecondEvent -= FiveSecondEvent; |
| | | if (value)
|
| | | {
|
| | | if (IsRequireOfflineReconnect(mapId))
|
| | | {
|
| | | SetClientDataMapSymbol();
|
| | | GlobalTimeEvent.Instance.fiveSecondEvent += FiveSecondEvent; |
| | | }
|
| | | } |
| | | else
|
| | | {
|
| | | ClearClientDataMapSymbol();
|
| | | } |
| | | }
|
| | |
|
| | | public static void RequestSettleClientDungeon(int mapId, int lineId)
|
| | |
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | } |
| | | |
| | | public static void RequestStartClientDungeon(int mapId,int lineId)
|
| | | public static void RequestStartClientDungeon(int mapId, int lineId, Action<Dungeon, bool> callBack)
|
| | | {
|
| | | clientCustomDungeonResult = callBack;
|
| | |
|
| | | dungeonInfo = new Dungeon()
|
| | | {
|
| | | mapId = mapId,
|
| | | lineId = lineId,
|
| | | };
|
| | |
|
| | | var pak = new CA231_tagCMClientStartCustomScene();
|
| | | pak.MapID = (uint)mapId;
|
| | | pak.FuncLineID = (ushort)lineId;
|
| | |
| | | }
|
| | | } |
| | | |
| | | public static void ReceiveStartCustomDungeonResult(HB216_tagMCStartCustomSceneResult package)
|
| | | {
|
| | | if (package.MapID == dungeonInfo.mapId
|
| | | && package.FuncLineID == dungeonInfo.lineId)
|
| | | {
|
| | | if (clientCustomDungeonResult != null)
|
| | | {
|
| | | clientCustomDungeonResult(dungeonInfo, package.Result == 1);
|
| | | }
|
| | | }
|
| | | clientCustomDungeonResult = null;
|
| | | }
|
| | |
|
| | | public static void GotoNormalClientDungeon(int clientMapId, int mapId, int lineId)
|
| | | {
|
| | | RequestStartClientDungeon(mapId, lineId, (dungeonInfo, isOk) =>
|
| | | {
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | if (hero != null)
|
| | | {
|
| | | hero.StopAll();
|
| | | }
|
| | |
|
| | | MapTransferUtility.Instance.Clear();
|
| | |
|
| | | SetClientDungeon(true, (ushort)clientMapId);
|
| | | StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
|
| | | {
|
| | | toMapId = clientMapId,
|
| | | toLineId = 0,
|
| | | needEmpty = true,
|
| | | needLoadResource = true,
|
| | | serverType = ServerType.Main,
|
| | | isClientLoadMap = true
|
| | | });
|
| | |
|
| | | PlayerDatas.Instance.baseData.mainServerMapIdRecord = PlayerDatas.Instance.baseData.MapID;
|
| | | PlayerDatas.Instance.baseData.MapID = (ushort)clientMapId;
|
| | | var attackMode = new C030A_tagCChangeAttackMode();
|
| | | attackMode.Mode = (byte)E_AttackMode.Peace;
|
| | | GameNetSystem.Instance.PushPackage(attackMode, ServerType.Main);
|
| | | });
|
| | | }
|
| | |
|
| | | public static void ExitNormalClientDungeon()
|
| | | {
|
| | | SetClientDungeon(false, 0);
|
| | | PlayerDatas.Instance.extersion.pkState = 0;
|
| | | ModelCenter.Instance.GetModel<DungeonModel>().ResetBufData();
|
| | |
|
| | | exitClientDungeonSymbol = true;
|
| | |
|
| | | 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,
|
| | | refreshPlayerDatas = true
|
| | | });
|
| | | } |
| | | |
| | | private static void FiveSecondEvent()
|
| | | {
|
| | | SetClientDataMapSymbol();
|
| | | } |
| | | |
| | | public static void SetClientDataMapSymbol()
|
| | | {
|
| | | switch (clientMapId)
|
| | | {
|
| | | case HazyDemonKingModel.CLIENTDATAMAP:
|
| | | {
|
| | | if (!(StageLoad.Instance.currentStage is ClientHazyDemonKingStage))
|
| | | {
|
| | | return;
|
| | | }
|
| | | var stage = StageLoad.Instance.currentStage as ClientHazyDemonKingStage;
|
| | | if (stage.step > ClientHazyDemonKingStage.Step.Fight)
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | | break;
|
| | | case HazyGrassModel.FAIRY_CLIENTDATAMAP:
|
| | | case HazyGrassModel.REIKI_CLIENTDATAMAP:
|
| | | {
|
| | | if (!(StageLoad.Instance.currentStage is ClientHazyGrassStage))
|
| | | {
|
| | | return;
|
| | | }
|
| | | var stage = StageLoad.Instance.currentStage as ClientHazyGrassStage;
|
| | | if (stage.hasCompleted)
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | | break;
|
| | | case HazyRegionModel.PRECIOUS_CLIENTDATAMAP:
|
| | | {
|
| | | if (!(StageLoad.Instance.currentStage is ClientHazyPreciousDungeonStage))
|
| | | {
|
| | | return;
|
| | | }
|
| | | var stage = StageLoad.Instance.currentStage as ClientHazyPreciousDungeonStage;
|
| | | if (stage.step > ClientHazyPreciousDungeonStage.Step.Collect)
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | | break;
|
| | | case PersonalBossModel.PERSONALBOSS_MAPID:
|
| | | {
|
| | | if (!(StageLoad.Instance.currentStage is ClientPersonalBossDungeonStage))
|
| | | {
|
| | | return;
|
| | | }
|
| | | var stage = StageLoad.Instance.currentStage as ClientPersonalBossDungeonStage;
|
| | | if (stage.step > ClientPersonalBossDungeonStage.Step.Fight)
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | |
|
| | | var key = StringUtility.Contact(OFFLINEMAPRECORD, "_", PlayerDatas.Instance.baseData.PlayerID);
|
| | | var clientMapRecord = new ClientDataMapSymbol()
|
| | | {
|
| | | mapId = clientMapId,
|
| | | time = DateTime.Now,
|
| | | dungeon = dungeonInfo,
|
| | | };
|
| | | LocalSave.SetString(key, LitJson.JsonMapper.ToJson(clientMapRecord));
|
| | | } |
| | | |
| | | public static void ClearClientDataMapSymbol()
|
| | | {
|
| | | var key = StringUtility.Contact(OFFLINEMAPRECORD, "_", PlayerDatas.Instance.baseData.PlayerID);
|
| | | LocalSave.DeleteKey(key);
|
| | | } |
| | | |
| | | public static ClientDataMapSymbol GetClientDataMapSymbol()
|
| | | {
|
| | | var key = StringUtility.Contact(OFFLINEMAPRECORD, "_", PlayerDatas.Instance.baseData.PlayerID);
|
| | | if (LocalSave.HasKey(key))
|
| | | {
|
| | | var clientMapRecord = LitJson.JsonMapper.ToObject<ClientDataMapSymbol>(LocalSave.GetString(key));
|
| | | return clientMapRecord;
|
| | | }
|
| | | return default(ClientDataMapSymbol);
|
| | | } |
| | | |
| | | static bool IsRequireOfflineReconnect(int mapId)
|
| | | {
|
| | | switch (mapId)
|
| | | {
|
| | | case HazyDemonKingModel.CLIENTDATAMAP:
|
| | | case HazyGrassModel.REIKI_CLIENTDATAMAP:
|
| | | case HazyGrassModel.FAIRY_CLIENTDATAMAP:
|
| | | case HazyRegionModel.PRECIOUS_CLIENTDATAMAP:
|
| | | case PersonalBossModel.PERSONALBOSS_MAPID:
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | private static void OnPlayerLoginOk()
|
| | | {
|
| | | if (isClientDungeon)
|
| | | {
|
| | | RequestStartClientDungeon(dungeonInfo.mapId, dungeonInfo.lineId, null);
|
| | | }
|
| | | } |
| | | |
| | | private static void OnStageLoadFinish()
|
| | | {
|
| | | if (exitClientDungeonSymbol)
|
| | | {
|
| | | RequestExitClientDungeon();
|
| | | }
|
| | |
|
| | | exitClientDungeonSymbol = false;
|
| | | }
|
| | |
|
| | | private static void Reset() |
| | | { |
| | | isClientDungeon = false; |
| | | clientMapId = 0; |
| | | } |
| | | |
| | | public struct ClientDataMapSymbol
|
| | | {
|
| | | public int mapId;
|
| | | public DateTime time;
|
| | | public Dungeon dungeon;
|
| | | } |
| | | } |
| New file |
| | |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class ClientHazyPreciousDungeonStage : DungeonStage
|
| | | {
|
| | | readonly Vector3 s_PlayerPosition = new Vector3(17.609f, 5.469f, 2.233f);
|
| | | readonly Vector3 s_BossPosition = new Vector3(11.46125f, 5.810412f, 11.24522f);
|
| | | readonly Vector3 s_PreciousPosition = new Vector3(5.76f, 6.708447f, 23.48f);
|
| | | readonly Vector3 s_PreciousEffectPosition = new Vector3(5.8f, 6.708447f, 23.34f);
|
| | | readonly Vector3 s_IndicationPosition = new Vector3(12.1f, 6f, 11.95f);
|
| | | readonly Vector3 s_IndicationAngle = new Vector3(0, -30.74f, 0);
|
| | |
|
| | | readonly float s_BossAngle = 148.57f;
|
| | | readonly float s_PreciousAngle = -29.531f;
|
| | | readonly float s_PreciousEffectAngle = 77f;
|
| | |
|
| | | int m_LineId = 0;
|
| | |
|
| | | int[] stepTimes;
|
| | |
|
| | | int m_BossNpcId = 0;
|
| | | int m_PreciousNpcId = 0;
|
| | | int m_PreciousEffectNpcId = 0;
|
| | |
|
| | | uint m_PreciousSid = 0;
|
| | |
|
| | | SFXController m_Indication;
|
| | | SFXController m_PreciousEffect;
|
| | | Clock m_PrepareClock;
|
| | | Clock m_ExitClock;
|
| | |
|
| | | GA_NpcClientFightBoss clientBoss;
|
| | | GA_NpcClientCollect clientPrecious;
|
| | |
|
| | | Step m_Step = Step.None;
|
| | | public Step step
|
| | | {
|
| | | get { return m_Step; }
|
| | | set
|
| | | {
|
| | | if (m_Step != value)
|
| | | {
|
| | | switch (m_Step)
|
| | | {
|
| | | case Step.Prepare:
|
| | | break;
|
| | | case Step.Fight:
|
| | | OnExitFight();
|
| | | break;
|
| | | case Step.Collect:
|
| | | OnExitCollect();
|
| | | break;
|
| | | case Step.Over:
|
| | | break;
|
| | | }
|
| | |
|
| | | m_Step = value;
|
| | | switch (m_Step)
|
| | | {
|
| | | case Step.Prepare:
|
| | | OnEnterPrepare();
|
| | | break;
|
| | | case Step.Fight:
|
| | | OnEnterFight();
|
| | | break;
|
| | | case Step.Collect:
|
| | | OnEnterCollect();
|
| | | break;
|
| | | case Step.Over:
|
| | | OnEnterOver();
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | |
|
| | | public override void Initialize()
|
| | | {
|
| | | base.Initialize();
|
| | |
|
| | | step = Step.None;
|
| | |
|
| | | var incidentConfig = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | | var dungeonId = model.GetDungeonId(incidentConfig.dungeonId, incidentConfig.lineId);
|
| | | var config = DungeonConfig.Get(dungeonId);
|
| | | stepTimes = LitJson.JsonMapper.ToObject<int[]>(config.StepTime);
|
| | | var npcArray = LitJson.JsonMapper.ToObject<int[]>(config.RefreshNPC);
|
| | | m_BossNpcId = npcArray[0];
|
| | | m_PreciousNpcId = npcArray[1];
|
| | | m_PreciousEffectNpcId = npcArray[2];
|
| | | m_LineId = incidentConfig.lineId;
|
| | |
|
| | | UnloadAssets();
|
| | |
|
| | | BossShowModel.Instance.bossShowCompletedEvent += BossShowCompletedEvent;
|
| | | ClientCollectUtility.OnCollectFinished += OnCollectFinished;
|
| | | model.onDungeonResultEvent += OnDungeonResultEvent;
|
| | | PersonalEnemy.OnNpcAppear += OnNpcAppear;
|
| | | }
|
| | |
|
| | | protected override void OnUpdate()
|
| | | {
|
| | | base.OnUpdate();
|
| | |
|
| | | switch (step)
|
| | | {
|
| | | case Step.None:
|
| | | break;
|
| | | case Step.Prepare:
|
| | | break;
|
| | | case Step.Fight:
|
| | | if (clientBoss != null && clientBoss.ActorInfo.serverDie)
|
| | | {
|
| | | step = Step.Collect;
|
| | | }
|
| | | break;
|
| | | case Step.Collect:
|
| | | break;
|
| | | case Step.Over:
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnStageLoadFinish()
|
| | | {
|
| | | base.OnStageLoadFinish();
|
| | |
|
| | | StartCoroutine(Co_VerityExistBossShow());
|
| | |
|
| | | InitializePlayer();
|
| | | }
|
| | |
|
| | | private IEnumerator Co_VerityExistBossShow()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS500;
|
| | | if (!BossShowModel.Instance.BossShowing)
|
| | | {
|
| | | BossShowCompletedEvent();
|
| | | }
|
| | | }
|
| | |
|
| | | public override void UnInitialize()
|
| | | {
|
| | | base.UnInitialize();
|
| | |
|
| | | UnloadAssets();
|
| | |
|
| | | StopAllCoroutines();
|
| | |
|
| | | BossShowModel.Instance.bossShowCompletedEvent -= BossShowCompletedEvent;
|
| | | ClientCollectUtility.OnCollectFinished -= OnCollectFinished;
|
| | | model.onDungeonResultEvent -= OnDungeonResultEvent;
|
| | | PersonalEnemy.OnNpcAppear -= OnNpcAppear;
|
| | | }
|
| | |
|
| | | private void OnDungeonResultEvent()
|
| | | {
|
| | | step = Step.Over;
|
| | | }
|
| | |
|
| | | private void InitializePlayer()
|
| | | {
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | if (hero != null)
|
| | | {
|
| | | hero.Pos = s_PlayerPosition;
|
| | | }
|
| | | }
|
| | |
|
| | | private void InitializeNpc()
|
| | | {
|
| | | PersonalEnemy.Create((uint)m_BossNpcId, E_ActorGroup.Enemy, s_BossPosition);
|
| | |
|
| | | clientPrecious = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientCollect>((uint)m_PreciousNpcId, E_ActorGroup.FuncNpc);
|
| | | clientPrecious.Pos = s_PreciousPosition;
|
| | | clientPrecious.Rotation = Quaternion.Euler(0, s_PreciousAngle, 0);
|
| | |
|
| | | var npcConfig = NPCConfig.Get(m_PreciousNpcId);
|
| | | if (npcConfig.ModeProportion != 1)
|
| | | {
|
| | | clientPrecious.Root.localScale = Vector3.one * npcConfig.ModeProportion;
|
| | | }
|
| | | m_PreciousSid = clientPrecious.ServerInstID;
|
| | |
|
| | | npcConfig = NPCConfig.Get(m_PreciousEffectNpcId);
|
| | | m_PreciousEffect = SFXPlayUtility.Instance.PlayWithEulerAngle(npcConfig.NPCEffect, s_PreciousEffectPosition
|
| | | , new Vector3(0, s_PreciousEffectAngle, 0));
|
| | | var animator = m_PreciousEffect.GetComponentInChildren<Animator>(true);
|
| | | if (animator != null)
|
| | | {
|
| | | animator.Play(GAStaticDefine.State_IdleHash);
|
| | | }
|
| | | }
|
| | |
|
| | | void OnEnterPrepare()
|
| | | {
|
| | | var seconds = GetStepSeconds(Step.Prepare);
|
| | | model.UpdateCoolDown(DungeonCoolDownType.WaitStart, (uint)seconds * 1000);
|
| | | m_PrepareClock = Clock.AlarmAfter(seconds, () =>
|
| | | {
|
| | | step = Step.Fight;
|
| | | });
|
| | |
|
| | | UpdateMissionData();
|
| | | }
|
| | |
|
| | | void OnEnterFight()
|
| | | {
|
| | | InitializeNpc();
|
| | |
|
| | | var seconds = GetStepSeconds(Step.Fight);
|
| | | model.UpdateCoolDown(DungeonCoolDownType.FightStart, (uint)seconds * 1000);
|
| | |
|
| | | m_ExitClock = Clock.AlarmAfter(seconds, OnExitDungeon);
|
| | |
|
| | | UpdateMissionData();
|
| | | }
|
| | |
|
| | | void OnExitFight()
|
| | | {
|
| | | var animator = m_PreciousEffect.GetComponentInChildren<Animator>(true);
|
| | | if (animator != null)
|
| | | {
|
| | | animator.Play(GAStaticDefine.State_DeadHash);
|
| | | }
|
| | | }
|
| | |
|
| | | void OnEnterCollect()
|
| | | {
|
| | | m_Indication = SFXPlayUtility.Instance.PlayWithEulerAngle(1051, s_IndicationPosition, s_IndicationAngle);
|
| | |
|
| | | UpdateMissionData();
|
| | | }
|
| | |
|
| | | void OnExitCollect()
|
| | | {
|
| | | if (m_ExitClock != null)
|
| | | {
|
| | | Clock.Stop(m_ExitClock);
|
| | | m_ExitClock = null;
|
| | | }
|
| | | }
|
| | |
|
| | | void OnEnterOver()
|
| | | {
|
| | | var seconds = GetStepSeconds(Step.Over);
|
| | | model.UpdateCoolDown(DungeonCoolDownType.LeaveMap, (uint)seconds * 1000);
|
| | |
|
| | | m_ExitClock = Clock.AlarmAfter(seconds, OnExitDungeon);
|
| | |
|
| | | ClientDungeonStageUtility.ClearClientDataMapSymbol();
|
| | |
|
| | | UpdateMissionData();
|
| | | }
|
| | |
|
| | | int GetStepSeconds(Step step)
|
| | | {
|
| | | switch (step)
|
| | | {
|
| | | case Step.Prepare:
|
| | | return stepTimes != null && stepTimes.Length > 0 ? stepTimes[0] : 3;
|
| | | case Step.Fight:
|
| | | return stepTimes != null && stepTimes.Length > 1 ? stepTimes[1] : 480;
|
| | | case Step.Collect:
|
| | | return stepTimes != null && stepTimes.Length > 3 ? stepTimes[3] : 5;
|
| | | case Step.Over:
|
| | | return stepTimes != null && stepTimes.Length > 2 ? stepTimes[2] : 10;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | private void UpdateMissionData()
|
| | | {
|
| | | var npcTotal = 0;
|
| | | var missionData = new DungeonMissionData()
|
| | | {
|
| | | lineID = m_LineId,
|
| | | step = (int)step < (int)Step.Collect ? 1 : 2,
|
| | | npcTotal = npcTotal,
|
| | | };
|
| | | model.UpdateFakeDungeonMission(31190, missionData);
|
| | | }
|
| | |
|
| | | void UnloadAssets()
|
| | | {
|
| | | if (m_Indication != null)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(m_Indication);
|
| | | m_Indication = null;
|
| | | }
|
| | | if (m_PrepareClock != null)
|
| | | {
|
| | | Clock.Stop(m_PrepareClock);
|
| | | m_PrepareClock = null;
|
| | | }
|
| | |
|
| | | if (clientBoss != null)
|
| | | {
|
| | | clientBoss = null;
|
| | | }
|
| | |
|
| | | if (clientPrecious != null)
|
| | | {
|
| | | GAMgr.Instance.ServerDie(clientPrecious.ServerInstID);
|
| | | GAMgr.Instance.Release(clientPrecious);
|
| | | clientPrecious = null;
|
| | | }
|
| | |
|
| | | if (m_PreciousEffect != null)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(m_PreciousEffect);
|
| | | m_PreciousEffect = null;
|
| | | }
|
| | |
|
| | | if (m_ExitClock != null)
|
| | | {
|
| | | Clock.Stop(m_ExitClock);
|
| | | m_ExitClock = null;
|
| | | }
|
| | | }
|
| | |
|
| | | void OnExitDungeon()
|
| | | {
|
| | | ClientDungeonStageUtility.ExitNormalClientDungeon();
|
| | | }
|
| | |
|
| | | private void BossShowCompletedEvent()
|
| | | {
|
| | | step = Step.Prepare;
|
| | | }
|
| | |
|
| | | private void OnCollectFinished(uint sid)
|
| | | {
|
| | | if (sid == m_PreciousSid)
|
| | | {
|
| | | ClientSceneManager.Instance.lastDeadPos = s_PreciousPosition;
|
| | | var pak = new CA234_tagCMGetCustomSceneCollectAward();
|
| | | pak.NPCID = (uint)m_PreciousNpcId;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnNpcAppear(GA_NpcClientFightNorm _npc)
|
| | | {
|
| | | if (_npc != null && _npc is GA_NpcClientFightBoss)
|
| | | {
|
| | | clientBoss = _npc as GA_NpcClientFightBoss;
|
| | | }
|
| | | }
|
| | |
|
| | | public enum Step
|
| | | {
|
| | | None,
|
| | | Prepare,
|
| | | Fight,
|
| | | Collect,
|
| | | Over,
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | public class ClientPersonalBossDungeonStage : DungeonStage
|
| | | { |
| | | static readonly Vector3 s_PlayerPosition = new Vector3(16.19f, 0.825f, 7.62f); |
| | | static readonly Vector3 s_NpcPosition = new Vector3(11.9f, 0.825f, 9.64f); |
| | | |
| | | static readonly float s_PlayerAngle = -70.925f; |
| | | |
| | | static int[] s_StepTimes = null; |
| | | |
| | | static Clock s_StepClock = null; |
| | | |
| | | Step m_Step = Step.None; |
| | | public Step step
|
| | | {
|
| | | get { return m_Step; }
|
| | | set
|
| | | {
|
| | | if (m_Step != value)
|
| | | {
|
| | | switch (m_Step)
|
| | | {
|
| | | case Step.Prepare:
|
| | | OnExitPrepare();
|
| | | break;
|
| | | case Step.Fight:
|
| | | OnExitFight();
|
| | | break;
|
| | | }
|
| | |
|
| | | m_Step = value;
|
| | |
|
| | | switch (m_Step)
|
| | | {
|
| | | case Step.Prepare:
|
| | | OnEnterPrepare();
|
| | | break;
|
| | | case Step.Fight:
|
| | | OnEnterFight();
|
| | | break;
|
| | | case Step.Over:
|
| | | OnEnterOver();
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | static PersonalBossModel model { get { return ModelCenter.Instance.GetModel<PersonalBossModel>(); } } |
| | | static DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } } |
| | | |
| | | public override void Initialize()
|
| | | {
|
| | | base.Initialize();
|
| | |
|
| | | step = Step.None;
|
| | |
|
| | | var config = PersonalBossConfig.Get(model.clientBossNpcId);
|
| | | if (config != null)
|
| | | {
|
| | | var dungeonId = dungeonModel.GetDungeonId(PersonalBossModel.PERSONALBOSS_MAPID, config.lineId);
|
| | | var dungeonConfig = DungeonConfig.Get(dungeonId);
|
| | | if (dungeonConfig != null)
|
| | | {
|
| | | s_StepTimes = LitJson.JsonMapper.ToObject<int[]>(dungeonConfig.StepTime);
|
| | | }
|
| | | }
|
| | |
|
| | | dungeonModel.onDungeonResultEvent += OnDungeonResultEvent;
|
| | | } |
| | | |
| | | protected override void OnStageLoadFinish()
|
| | | {
|
| | | base.OnStageLoadFinish();
|
| | |
|
| | | InitializePlayer();
|
| | |
|
| | | step = Step.Prepare;
|
| | | } |
| | | |
| | | void InitializePlayer()
|
| | | {
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | if (hero != null)
|
| | | {
|
| | | hero.Pos = s_PlayerPosition;
|
| | | hero.Rotation = Quaternion.Euler(0, s_PlayerAngle, 0);
|
| | | }
|
| | | CameraController.Instance.Apply();
|
| | | } |
| | | |
| | | void OnEnterPrepare()
|
| | | {
|
| | | var seconds = s_StepTimes[0];
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.WaitStart, (uint)seconds * 1000);
|
| | |
|
| | | s_StepClock = Clock.AlarmAfter(seconds, () =>
|
| | | {
|
| | | step = Step.Fight;
|
| | | });
|
| | | } |
| | | |
| | | void OnExitPrepare()
|
| | | {
|
| | | if (s_StepClock != null)
|
| | | {
|
| | | Clock.Stop(s_StepClock);
|
| | | s_StepClock = null;
|
| | | }
|
| | | } |
| | | |
| | | void OnEnterFight()
|
| | | {
|
| | | InitializeNpc();
|
| | |
|
| | | var seconds = s_StepTimes[1];
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.FightStart, (uint)seconds * 1000);
|
| | |
|
| | | s_StepClock = Clock.AlarmAfter(seconds, () =>
|
| | | {
|
| | | ClientDungeonStageUtility.ExitNormalClientDungeon();
|
| | | });
|
| | | } |
| | | |
| | | private void OnExitFight()
|
| | | {
|
| | | if (s_StepClock != null)
|
| | | {
|
| | | Clock.Stop(s_StepClock);
|
| | | s_StepClock = null;
|
| | | }
|
| | | } |
| | | |
| | | private void OnEnterOver()
|
| | | {
|
| | | ClientDungeonStageUtility.ClearClientDataMapSymbol();
|
| | |
|
| | | var seconds = s_StepTimes[2];
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.LeaveMap, (uint)seconds * 1000);
|
| | | s_StepClock = Clock.AlarmAfter(seconds, () =>
|
| | | {
|
| | | ClientDungeonStageUtility.ExitNormalClientDungeon();
|
| | | });
|
| | | } |
| | | |
| | | void InitializeNpc()
|
| | | {
|
| | | PersonalEnemy.Create((uint)model.clientBossNpcId, E_ActorGroup.Enemy, s_NpcPosition);
|
| | | } |
| | | |
| | | private void OnDungeonResultEvent()
|
| | | {
|
| | | step = Step.Over;
|
| | | } |
| | | |
| | | public override void UnInitialize()
|
| | | {
|
| | | base.UnInitialize();
|
| | |
|
| | | dungeonModel.onDungeonResultEvent -= OnDungeonResultEvent;
|
| | |
|
| | | if (s_StepClock != null)
|
| | | {
|
| | | Clock.Stop(s_StepClock);
|
| | | s_StepClock = null;
|
| | | }
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | private void OnGUI()
|
| | | {
|
| | | if (GUILayout.Button("Exit"))
|
| | | {
|
| | | ClientDungeonStageUtility.ExitNormalClientDungeon();
|
| | | }
|
| | | }
|
| | | #endif |
| | | |
| | | public enum Step
|
| | | {
|
| | | None,
|
| | | Prepare,
|
| | | Fight,
|
| | | Over,
|
| | | } |
| | | } |
copy from System/Treasure/ClientTreasureDungeon.cs.meta
copy to Fight/Stage/Dungeon/ClientPersonalBossDungeonStage.cs.meta
| File was copied from System/Treasure/ClientTreasureDungeon.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 189ce34976654c34da06b3239c45076d |
| | | timeCreated: 1556000158 |
| | | guid: e0fe6b75e8e6ea3439251f799ba2d591 |
| | | timeCreated: 1558427783 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | WindowCenter.Instance.Open<ElderGodAngerWin>();
|
| | | }
|
| | | break;
|
| | | case ClientTreasureDungeon.Client_DataMap:
|
| | | case 4000:
|
| | | case TreasureModel.TREASURE_MAPID:
|
| | | WindowCenter.Instance.Open<TreasureDungeonMissionHintWin>();
|
| | | break;
|
| | | case DemonJarModel.DEMONJAR_MAPID:
|
| | | case 31140:
|
| | | case JadeDynastyBossModel.JADEDYNASTY_MAP:
|
| | | case HazyDemonKingModel.Client_MapID:
|
| | | case HazyDemonKingModel.CLIENTDATAMAP:
|
| | | case HazyDemonKingModel.DEMONKINGMAPID1:
|
| | | case HazyDemonKingModel.DEMONKINGMAPID2:
|
| | | WindowCenter.Instance.Open<DungeonPickUpItemCoolDownWin>();
|
| | |
| | | case RidingPetBossModel.RIDINGPETBOSS_MAP:
|
| | | WindowCenter.Instance.Open<RidingPetBossHintWin>();
|
| | | break;
|
| | | case HazyGrassModel.Client_ReikiGrassMapID:
|
| | | case HazyGrassModel.REIKI_CLIENTDATAMAP:
|
| | | case HazyGrassModel.FAIRY_CLIENTDATAMAP:
|
| | | case HazyGrassModel.FairyGrassMapId:
|
| | | case HazyGrassModel.ReikiGrassMapId:
|
| | | WindowCenter.Instance.Close<DungeonEndCoolDownWin>();
|
| | |
| | | stage = stageGameObject.AddComponent<FakeDemonJarDungeonStage>();
|
| | | break;
|
| | | case 31190:
|
| | | stage = stageGameObject.AddComponent<HazyPreciousDungeonStage>();
|
| | | stage = stageGameObject.AddComponent<ClientHazyPreciousDungeonStage>();
|
| | | break;
|
| | | case HazyDemonKingModel.Client_MapID:
|
| | | case HazyDemonKingModel.CLIENTDATAMAP:
|
| | | stage = stageGameObject.AddComponent<ClientHazyDemonKingStage>();
|
| | | break;
|
| | | case HazyGrassModel.Client_FairyGrassMapID:
|
| | | case HazyGrassModel.Client_ReikiGrassMapID:
|
| | | case HazyGrassModel.FAIRY_CLIENTDATAMAP:
|
| | | case HazyGrassModel.REIKI_CLIENTDATAMAP:
|
| | | stage = stageGameObject.AddComponent<ClientHazyGrassStage>();
|
| | | break;
|
| | | case ClientTreasureDungeon.Client_DataMap:
|
| | | case 4000:
|
| | | stage = stageGameObject.AddComponent<ClientTreasureDungeonStage>();
|
| | | break;
|
| | | case PersonalBossModel.PERSONALBOSS_MAPID:
|
| | | stage = stageGameObject.AddComponent<ClientPersonalBossDungeonStage>();
|
| | | break;
|
| | | default:
|
| | | stage = stageGameObject.AddComponent<DungeonStage>();
|
| | | break;
|
| | |
| | | |
| | | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "NPCID", _g_get_NPCID); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "ChanllengeLv", _g_get_ChanllengeLv); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "MustItemID", _g_get_MustItemID); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "RareItemID", _g_get_RareItemID); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "PortraitID", _g_get_PortraitID); |
| | |
| | | |
| | | PersonalBossConfig gen_to_be_invoked = (PersonalBossConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.NPCID); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_ChanllengeLv(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | PersonalBossConfig gen_to_be_invoked = (PersonalBossConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.ChanllengeLv); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "RequestExitDungeon", _m_RequestExitDungeon); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "ReceivePackage", _m_ReceivePackage); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "RequestEnterClientDungeon", _m_RequestEnterClientDungeon); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "RequestExitClientDungeon", _m_RequestExitClientDungeon); |
| | | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "onPlayerInfoRefresh", _e_onPlayerInfoRefresh); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "onPlayerCountRefresh", _e_onPlayerCountRefresh); |
| | |
| | | Utils.BeginClassRegister(type, L, __CreateInstance, 4, 0, 0); |
| | | |
| | | |
| | | Utils.RegisterObject(L, translator, Utils.CLS_IDX, "Client_MapID", Snxxz.UI.HazyDemonKingModel.Client_MapID); |
| | | Utils.RegisterObject(L, translator, Utils.CLS_IDX, "Client_MapID", Snxxz.UI.HazyDemonKingModel.CLIENTDATAMAP); |
| | | Utils.RegisterObject(L, translator, Utils.CLS_IDX, "DEMONKINGMAPID1", Snxxz.UI.HazyDemonKingModel.DEMONKINGMAPID1); |
| | | Utils.RegisterObject(L, translator, Utils.CLS_IDX, "DEMONKINGMAPID2", Snxxz.UI.HazyDemonKingModel.DEMONKINGMAPID2); |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_RequestExitClientDungeon(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.HazyDemonKingModel gen_to_be_invoked = (Snxxz.UI.HazyDemonKingModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | |
| | | gen_to_be_invoked.RequestExitClientDungeon( ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "IsInGrassDungeon", _m_IsInGrassDungeon); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetClientMapId", _m_GetClientMapId); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetGrassMapId", _m_GetGrassMapId); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetGrassNpcInfos", _m_GetGrassNpcInfos); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetMapNpcCount", _m_GetMapNpcCount); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "CanCollectClientNpc", _m_CanCollectClientNpc); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "DisplayCollectErrorTip", _m_DisplayCollectErrorTip); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "ReceivePackage", _m_ReceivePackage); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "RefreshMapNpcCount", _m_RefreshMapNpcCount); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "RequestEnterClientDungeon", _m_RequestEnterClientDungeon); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "RequestExitClientDungeon", _m_RequestExitClientDungeon); |
| | | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "onMapNpcCountRefresh", _e_onMapNpcCountRefresh); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "dugeonTargetStateRefresh", _e_dugeonTargetStateRefresh); |
| | | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "IsInDungeon", _g_get_IsInDungeon); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "IsDungeonTargetDone", _g_get_IsDungeonTargetDone); |
| | | |
| | | |
| | | |
| | | Utils.EndObjectRegister(type, L, translator, null, null, |
| | |
| | | |
| | | Utils.RegisterObject(L, translator, Utils.CLS_IDX, "ReikiGrassMapId", Snxxz.UI.HazyGrassModel.ReikiGrassMapId); |
| | | Utils.RegisterObject(L, translator, Utils.CLS_IDX, "FairyGrassMapId", Snxxz.UI.HazyGrassModel.FairyGrassMapId); |
| | | Utils.RegisterObject(L, translator, Utils.CLS_IDX, "Client_ReikiGrassMapID", Snxxz.UI.HazyGrassModel.Client_ReikiGrassMapID); |
| | | Utils.RegisterObject(L, translator, Utils.CLS_IDX, "Client_FairyGrassMapID", Snxxz.UI.HazyGrassModel.Client_FairyGrassMapID); |
| | | Utils.RegisterObject(L, translator, Utils.CLS_IDX, "Client_ReikiGrassMapID", Snxxz.UI.HazyGrassModel.REIKI_CLIENTDATAMAP); |
| | | Utils.RegisterObject(L, translator, Utils.CLS_IDX, "Client_FairyGrassMapID", Snxxz.UI.HazyGrassModel.FAIRY_CLIENTDATAMAP); |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_GetGrassNpcInfos(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.HazyGrassModel gen_to_be_invoked = (Snxxz.UI.HazyGrassModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | int _mapId = LuaAPI.xlua_tointeger(L, 2); |
| | | |
| | | System.Collections.Generic.List<Snxxz.UI.HazyGrassNpcInfo> gen_ret = gen_to_be_invoked.GetGrassNpcInfos( _mapId ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_GetMapNpcCount(RealStatePtr L) |
| | | { |
| | | try { |
| | |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_RequestExitClientDungeon(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | Snxxz.UI.HazyGrassModel gen_to_be_invoked = (Snxxz.UI.HazyGrassModel)translator.FastGetCSObj(L, 1); |
| | | |
| | | |
| | | |
| | | { |
| | | |
| | | gen_to_be_invoked.RequestExitClientDungeon( ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_IsInDungeon(RealStatePtr L) |
| | |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_IsDungeonTargetDone(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | Snxxz.UI.HazyGrassModel gen_to_be_invoked = (Snxxz.UI.HazyGrassModel)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.lua_pushboolean(L, gen_to_be_invoked.IsDungeonTargetDone); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _e_onMapNpcCountRefresh(RealStatePtr L) |
| | | { |
| | |
| | | LuaAPI.luaL_error(L, "invalid arguments to Snxxz.UI.HazyGrassModel.onMapNpcCountRefresh!"); |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _e_dugeonTargetStateRefresh(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | int gen_param_count = LuaAPI.lua_gettop(L); |
| | | Snxxz.UI.HazyGrassModel gen_to_be_invoked = (Snxxz.UI.HazyGrassModel)translator.FastGetCSObj(L, 1); |
| | | System.Action gen_delegate = translator.GetDelegate<System.Action>(L, 3); |
| | | if (gen_delegate == null) { |
| | | return LuaAPI.luaL_error(L, "#3 need System.Action!"); |
| | | } |
| | | |
| | | if (gen_param_count == 3) |
| | | { |
| | | |
| | | if (LuaAPI.xlua_is_eq_str(L, 2, "+")) { |
| | | gen_to_be_invoked.dugeonTargetStateRefresh += gen_delegate; |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | if (LuaAPI.xlua_is_eq_str(L, 2, "-")) { |
| | | gen_to_be_invoked.dugeonTargetStateRefresh -= gen_delegate; |
| | | return 0; |
| | | } |
| | | |
| | | } |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | LuaAPI.luaL_error(L, "invalid arguments to Snxxz.UI.HazyGrassModel.dugeonTargetStateRefresh!"); |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | [SerializeField] Button m_ChallengeNextLevel;
|
| | | [SerializeField] Text m_ChallengeNextTimer;
|
| | |
|
| | | bool satisfyChallengeNext = false;
|
| | |
|
| | | TreasureModel model
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<TreasureModel>(); }
|
| | |
| | |
|
| | | protected override void Display()
|
| | | {
|
| | | satisfyChallengeNext = SatisfyChallengeNext();
|
| | |
|
| | | m_ChallengeNextLevel.gameObject.SetActive(satisfyChallengeNext);
|
| | |
|
| | | m_ContainerPoivt.gameObject.SetActive(true);
|
| | |
|
| | | base.DrawPassTime();
|
| | | base.RequireDungeonExit();
|
| | |
|
| | | DisplayDemonTreasureProperty();
|
| | | }
|
| | |
|
| | | protected override void DrawExitTimer(int seconds)
|
| | | {
|
| | | m_ExitTimer.text = Language.Get("DemonDungeonExit");
|
| | | m_ChallengeNextTimer.text = Language.Get("RuneDungeonVictory_Btn_Next_1", Mathf.Clamp(seconds, 0, int.MaxValue));
|
| | | if (satisfyChallengeNext)
|
| | | {
|
| | | m_ChallengeNextTimer.text = Language.Get("RuneDungeonVictory_Btn_Next_1", Mathf.Clamp(seconds, 0, int.MaxValue));
|
| | | m_ExitTimer.text = Language.Get("DemonDungeonExit");
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ExitTimer.text = Language.Get("DungeonVictoryWin_Btn_Exit_1", Mathf.Clamp(seconds, 0, int.MaxValue));
|
| | | m_ChallengeNextTimer.text = Language.Get("DemonDungeonChallengeNext");
|
| | | }
|
| | | }
|
| | |
|
| | | private void DisplayDemonTreasureProperty()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void ChallengeNext()
|
| | | private bool SatisfyChallengeNext()
|
| | | {
|
| | | TreasureDungeon treasureDungeon;
|
| | | var result = dungeonModel.dungeonResult;
|
| | |
| | | {
|
| | | if (PlayerDatas.Instance.baseData.FightPoint >= dungeonInfo.fightPower)
|
| | | {
|
| | | model.DemonDungeonChallengeNext(result.lineID);
|
| | | return true;
|
| | | }
|
| | | else
|
| | | if (UIHelper.GetPropertyValue(PropertyType.DEF) >= dungeonInfo.defense)
|
| | | {
|
| | | ConfirmCancel.ShowRuneTowerPopConfirm(
|
| | | Language.Get("DemonLackPowerTitle"),
|
| | | Language.Get("DemonLackFightPower", dungeonInfo.fightPower),
|
| | | (bool ok) =>
|
| | | {
|
| | | if (ok)
|
| | | {
|
| | | model.DemonDungeonChallengeNext(result.lineID);
|
| | | }
|
| | | else
|
| | | {
|
| | | dungeonModel.ExitCurrentDungeon();
|
| | | }
|
| | | }
|
| | | );
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | private void ChallengeNext()
|
| | | {
|
| | | TreasureDungeon treasureDungeon;
|
| | | var result = dungeonModel.dungeonResult;
|
| | | if (model.TryGetTreasureDungeon(41110, result.lineID, out treasureDungeon))
|
| | | {
|
| | | var dungeonInfo = treasureDungeon.Get(result.wheel + 1);
|
| | | if (!dungeonInfo.Equals(default(TreasureDungeonInfo)))
|
| | | {
|
| | | model.DemonDungeonChallengeNext(result.lineID);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | var dataMapId = model.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
|
| | | m_ExitDungeon.gameObject.SetActive(dataMapId != DemonJarModel.DEMONJAR_MAPID
|
| | | && !CrossServerUtility.IsCrossServerOneVsOne()
|
| | | && !hazyDemonKingModel.IsInDungeon);
|
| | | && !hazyDemonKingModel.IsInDungeon
|
| | | && !hazyGrassModel.IsInDungeon);
|
| | | m_ContainerAncient.gameObject.SetActive(dataMapId == 31160);
|
| | | m_BossInfosContainer.gameObject.SetActive(
|
| | | dataMapId == ElderGodAreaModel.ELDERGODAREA_MAPID
|
| | |
| | | language = Language.Get(config.ExitDescription);
|
| | | }
|
| | |
|
| | | if (dataMapId == HazyGrassModel.FairyGrassMapId ||
|
| | | dataMapId == HazyGrassModel.ReikiGrassMapId
|
| | | || dataMapId == HazyGrassModel.Client_ReikiGrassMapID)
|
| | | {
|
| | | if (hazyGrassModel.IsDungeonTargetDone)
|
| | | {
|
| | | switch (dataMapId)
|
| | | {
|
| | | case HazyGrassModel.FairyGrassMapId:
|
| | | case HazyGrassModel.ReikiGrassMapId:
|
| | | var crossServerBossModel = ModelCenter.Instance.GetModel<CrossServerBossModel>();
|
| | | crossServerBossModel.RequestExit();
|
| | | break;
|
| | | case HazyGrassModel.Client_ReikiGrassMapID:
|
| | | ModelCenter.Instance.GetModel<HazyGrassModel>().RequestExitClientDungeon();
|
| | | break;
|
| | | }
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | ConfirmCancel.ShowPopConfirm(
|
| | | Language.Get("Mail101"),
|
| | | language,
|
| | |
| | | switch (dataMapId)
|
| | | {
|
| | | case CrossServerBossModel.DATA_MAPID:
|
| | | case HazyGrassModel.FairyGrassMapId:
|
| | | case HazyGrassModel.ReikiGrassMapId:
|
| | | case HazyDemonKingModel.DEMONKINGMAPID2:
|
| | | 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;
|
| | | case ClientTreasureDungeon.Client_DataMap:
|
| | | ClientTreasureDungeon.RequestExit();
|
| | | case 4000:
|
| | | case HazyRegionModel.PRECIOUS_CLIENTDATAMAP:
|
| | | case PersonalBossModel.PERSONALBOSS_MAPID:
|
| | | ClientDungeonStageUtility.ExitNormalClientDungeon();
|
| | | break;
|
| | | default:
|
| | | model.ExitCurrentDungeon();
|
| | |
| | | {
|
| | | switch (ClientDungeonStageUtility.clientMapId)
|
| | | {
|
| | | case ClientTreasureDungeon.Client_DataMap:
|
| | | ClientTreasureDungeon.RequestExit();
|
| | | case 4000:
|
| | | case HazyGrassModel.FAIRY_CLIENTDATAMAP:
|
| | | case HazyGrassModel.REIKI_CLIENTDATAMAP:
|
| | | case PersonalBossModel.PERSONALBOSS_MAPID:
|
| | | ClientDungeonStageUtility.ExitNormalClientDungeon();
|
| | | break;
|
| | | }
|
| | | return;
|
| | |
| | | if (treasureModel.TryGetTreasureDungeon(41110, model.dungeonResult.lineID, out treasureDungeon)
|
| | | && model.dungeonResult.isPass == 1)
|
| | | {
|
| | | if (!RuneTowerConfirmWin.waitConfirm)
|
| | | var dungeonInfo = treasureDungeon.Get(model.dungeonResult.wheel + 1);
|
| | | if (!dungeonInfo.Equals(default(TreasureDungeonInfo)))
|
| | | {
|
| | | var dungeonInfo = treasureDungeon.Get(model.dungeonResult.wheel + 1);
|
| | | if (!dungeonInfo.Equals(default(TreasureDungeonInfo)))
|
| | | if (PlayerDatas.Instance.baseData.FightPoint >= dungeonInfo.fightPower
|
| | | || UIHelper.GetPropertyValue(PropertyType.DEF) >= dungeonInfo.defense)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.FightPoint >= dungeonInfo.fightPower)
|
| | | {
|
| | | treasureModel.DemonDungeonChallengeNext(model.dungeonResult.lineID);
|
| | | }
|
| | | else
|
| | | {
|
| | | ConfirmCancel.ShowRuneTowerPopConfirm(
|
| | | Language.Get("DemonLackPowerTitle"),
|
| | | Language.Get("DemonLackFightPower", dungeonInfo.fightPower),
|
| | | (bool ok) =>
|
| | | {
|
| | | if (ok)
|
| | | {
|
| | | treasureModel.DemonDungeonChallengeNext(model.dungeonResult.lineID);
|
| | | }
|
| | | else
|
| | | {
|
| | | model.ExitCurrentDungeon();
|
| | | }
|
| | | }
|
| | | );
|
| | | }
|
| | | treasureModel.DemonDungeonChallengeNext(model.dungeonResult.lineID);
|
| | | }
|
| | | else
|
| | | {
|
| | | model.ExitCurrentDungeon();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | model.ExitCurrentDungeon();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | if (ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | ClientTreasureDungeon.RequestExit();
|
| | | ClientDungeonStageUtility.ExitNormalClientDungeon();
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | WindowCenter.Instance.Open<JadeDynastyDamageRankWin>();
|
| | | }
|
| | | break;
|
| | | case 31190:
|
| | | if (!WindowCenter.Instance.IsOpen<DungeonMissionDetailsWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<DungeonMissionDetailsWin>();
|
| | | }
|
| | | break;
|
| | | }
|
| | |
|
| | | if (updateMissionEvent != null)
|
| | |
| | | break;
|
| | | case 22030:
|
| | | case 32030:
|
| | | case HazyDemonKingModel.Client_MapID:
|
| | | case HazyDemonKingModel.CLIENTDATAMAP:
|
| | | WindowCenter.Instance.Open<HazyDemonKingVictoryWin>();
|
| | | break;
|
| | | default:
|
| | |
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | | ComposeWinModel composeModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } }
|
| | | PersonalBossModel personalBossModel { get { return ModelCenter.Instance.GetModel<PersonalBossModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | |
| | | switch (_lackType)
|
| | | {
|
| | | case LackType.PersonalBoss:
|
| | | personalBossModel.RequestGotoDungeon(personalBossModel.selectedBoss);
|
| | | break;
|
| | | case LackType.ElderGodArea:
|
| | | dungeonModel.SingleChallenge(GetDungeon(_lackType));
|
| | | break;
|
| | |
| | |
|
| | | protected virtual void ExitDungeon()
|
| | | {
|
| | | if (ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | switch (ClientDungeonStageUtility.clientMapId)
|
| | | {
|
| | | case HazyDemonKingModel.CLIENTDATAMAP:
|
| | | case HazyGrassModel.REIKI_CLIENTDATAMAP:
|
| | | case HazyGrassModel.FAIRY_CLIENTDATAMAP:
|
| | | case HazyRegionModel.PRECIOUS_CLIENTDATAMAP:
|
| | | case PersonalBossModel.PERSONALBOSS_MAPID:
|
| | | ClientDungeonStageUtility.ExitNormalClientDungeon();
|
| | | return;
|
| | | }
|
| | | }
|
| | | dungeonModel.ExitCurrentDungeon();
|
| | | }
|
| | |
|
| | |
| | | model.demonDungeonChallengeNext += ChallengeNextEvent;
|
| | |
|
| | | if (ClientDungeonStageUtility.isClientDungeon
|
| | | && ClientDungeonStageUtility.clientMapId == ClientTreasureDungeon.Client_DataMap)
|
| | | && ClientDungeonStageUtility.clientMapId == 4000)
|
| | | {
|
| | | treasureId = ClientTreasureDungeon.challengeTreasureId;
|
| | | treasureId = 101;
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | var dungeonId = 0;
|
| | | if (ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | dungeonId = dungeonModel.GetDungeonId(ClientTreasureDungeon.Client_DataMap, 0);
|
| | | dungeonId = dungeonModel.GetDungeonId(4000, 0);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public int clientBossNpcId
|
| | | {
|
| | | get
|
| | | {
|
| | | return LocalSave.GetInt("PersonalBossClient_" + PlayerDatas.Instance.PlayerId);
|
| | | }
|
| | | private set
|
| | | {
|
| | | LocalSave.SetInt("PersonalBossClient_" + PlayerDatas.Instance.PlayerId, value);
|
| | | }
|
| | | }
|
| | |
|
| | | public event Action<int> bossSelectedEvent;
|
| | | List<int> sortedBossIds = new List<int>();
|
| | | Dictionary<int, PersonalBossData> personalBosses = new Dictionary<int, PersonalBossData>();
|
| | |
| | | {
|
| | | var config = bossConfigs[i];
|
| | | var bossData = personalBosses[config.NPCID] = new PersonalBossData(config.NPCID);
|
| | | bossData.challengableLevel = config.ChanllengeLv;
|
| | | var dungeonId = dungeonModel.GetDungeonId(PERSONALBOSS_MAPID, config.lineId);
|
| | | var dungeonConfig = DungeonConfig.Get(dungeonId);
|
| | | if (dungeonConfig != null)
|
| | | {
|
| | | bossData.challengableLevel = dungeonConfig.LVLimitMin;
|
| | | }
|
| | | }
|
| | |
|
| | | sortedBossIds.AddRange(personalBosses.Keys);
|
| | |
| | | return PersonalBossData.ChallengableLevelCompare(data1, data2);
|
| | | });
|
| | |
|
| | | var dungeonId = dungeonModel.GetDungeonId(PERSONALBOSS_MAPID, 0);
|
| | | var dungeonConfig = DungeonConfig.Get(dungeonId);
|
| | | dungeonTicket = dungeonConfig == null ? 0 : dungeonConfig.TicketID;
|
| | | {
|
| | | var dungeonId = dungeonModel.GetDungeonId(PERSONALBOSS_MAPID, 0);
|
| | | var dungeonConfig = DungeonConfig.Get(dungeonId);
|
| | | dungeonTicket = dungeonConfig == null ? 0 : dungeonConfig.TicketID;
|
| | | }
|
| | | }
|
| | |
|
| | | public void RequestGotoDungeon(int _bossId)
|
| | | {
|
| | | var config = PersonalBossConfig.Get(_bossId);
|
| | | clientBossNpcId = _bossId;
|
| | | ClientDungeonStageUtility.GotoNormalClientDungeon(PERSONALBOSS_MAPID, PERSONALBOSS_MAPID, config.lineId);
|
| | | }
|
| | |
|
| | | public void OnMapInitOk()
|
| | | {
|
| | | var dungeonModel = ModelCenter.Instance.GetModel<DungeonModel>();
|
| | | var dataMapId = dungeonModel.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
|
| | |
|
| | | switch (dataMapId)
|
| | | {
|
| | | case PERSONALBOSS_MAPID:
|
| | | var sendInfo = new CA508_tagCMDoFBAction();
|
| | | sendInfo.ActionType = 0;
|
| | | sendInfo.ActionInfo = (uint)selectedBoss;
|
| | | GameNetSystem.Instance.SendInfo(sendInfo);
|
| | | MapTransferUtility.Instance.MoveToNPC(selectedBoss);
|
| | | break;
|
| | | }
|
| | | //var dungeonModel = ModelCenter.Instance.GetModel<DungeonModel>();
|
| | | //var dataMapId = dungeonModel.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
|
| | | //
|
| | | //switch (dataMapId)
|
| | | //{
|
| | | // case PERSONALBOSS_MAPID:
|
| | | // var sendInfo = new CA508_tagCMDoFBAction();
|
| | | // sendInfo.ActionType = 0;
|
| | | // sendInfo.ActionInfo = (uint)selectedBoss;
|
| | | // GameNetSystem.Instance.SendInfo(sendInfo);
|
| | | // MapTransferUtility.Instance.MoveToNPC(selectedBoss);
|
| | | // break;
|
| | | //}
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | break;
|
| | | case 3:
|
| | | var config = PersonalBossConfig.Get(model.selectedBoss);
|
| | | SysNotifyMgr.Instance.ShowTip("PersonalBoss_LevelLimit", config.ChanllengeLv);
|
| | | var dungeonId = dungeonModel.GetDungeonId(PersonalBossModel.PERSONALBOSS_MAPID, config.lineId);
|
| | | var dungeonConfig = DungeonConfig.Get(dungeonId);
|
| | | SysNotifyMgr.Instance.ShowTip("PersonalBoss_LevelLimit", dungeonConfig.LVLimitMin);
|
| | | break;
|
| | | case 4:
|
| | | SysNotifyMgr.Instance.ShowTip("DungeonNoGO");
|
| | |
| | | public static Dictionary<int, float> AtkTypeIncreasePushDis = new Dictionary<int, float>();
|
| | | public static Dictionary<int, CameraController.LookAtData> NpcDieSetCamera = new Dictionary<int, CameraController.LookAtData>();
|
| | | public static int BlueEquipJumpLevel { get; private set; }
|
| | | public static int[] defenseGetWays { get; private set; }
|
| | |
|
| | | public static void Init()
|
| | | {
|
| | |
| | | NpcDieSetCamera[(int)_child[0]] = _lookAtData;
|
| | | }
|
| | | }
|
| | |
|
| | | defenseGetWays = GetIntArray("DefenseGetWays", 1);
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | |
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | 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 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
|
| | | public Step step
|
| | | {
|
| | | get { return m_Step; }
|
| | | set
|
| | |
| | | {
|
| | | case Step.Fight:
|
| | | stepTimer = 0f;
|
| | | break;
|
| | | case Step.PickItem:
|
| | | stepTimer = 5f;
|
| | | break;
|
| | | case Step.Settle:
|
| | | stepTimer = 0f;
|
| | |
| | | {
|
| | | 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; |
| | | dungeonModel.onDungeonResultEvent += OnDungeonResultEvent;
|
| | | PersonalEnemy.OnNpcAppear += OnNpcAppear;
|
| | | }
|
| | |
|
| | | protected override void OnStageLoadFinish()
|
| | |
| | | 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;
|
| | | }
|
| | | PersonalEnemy.Create((uint)config.npcId, E_ActorGroup.Enemy, bossBornPosition);
|
| | | }
|
| | |
|
| | | private void OnDungeonResultEvent()
|
| | | {
|
| | | step = Step.Settle;
|
| | | ClientDungeonStageUtility.ClearClientDataMapSymbol();
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.LeaveMap, 10 * 1000);
|
| | | }
|
| | |
|
| | | private void OnNpcAppear(GA_NpcClientFightNorm _npc)
|
| | | {
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | | if (_npc.NpcConfig.NPCID == config.npcId)
|
| | | {
|
| | | clientFightBoss = _npc as GA_NpcClientFightBoss;
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnUpdate()
|
| | | {
|
| | | base.OnUpdate();
|
| | |
|
| | | if (timer < totalTime)
|
| | | if (clientFightBoss != null && clientFightBoss.ActorInfo.serverDie)
|
| | | {
|
| | | if ((DateTime.Now - playerAtkTime).TotalSeconds < 1f)
|
| | | {
|
| | | timer += Time.deltaTime;
|
| | | if (timer >= totalTime)
|
| | | {
|
| | | TargetBriefInfo.OnRefreshBossLifeBar(clientFightBoss.ServerInstID, clientFightBoss.NpcConfig.NPCID,
|
| | | 0, clientFightBoss.ActorInfo.RealMaxHp);
|
| | | OnBossDie();
|
| | | }
|
| | | }
|
| | | OnBossDie();
|
| | | }
|
| | |
|
| | | switch (step)
|
| | |
| | | if (stepTimer > 5f)
|
| | | {
|
| | | stepTimer = 0f;
|
| | | RequestDropItem();
|
| | | }
|
| | | }
|
| | | break;
|
| | | case Step.PickItem:
|
| | | if (pickAllDropItem)
|
| | | {
|
| | | stepTimer += Time.deltaTime;
|
| | | if (stepTimer >= 5f)
|
| | | {
|
| | | RequestSettle();
|
| | | stepTimer = 0f;
|
| | | }
|
| | | }
|
| | | break;
|
| | |
| | | if (stepTimer >= existTime)
|
| | | {
|
| | | step = Step.Exit;
|
| | | model.RequestExitClientDungeon();
|
| | | ClientDungeonStageUtility.ExitNormalClientDungeon();
|
| | | }
|
| | | break;
|
| | | }
|
| | |
| | | {
|
| | | 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()
|
| | |
| | |
|
| | | 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; |
| | | PersonalEnemy.OnNpcAppear -= OnNpcAppear;
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | |
| | | {
|
| | | if (GUILayout.Button("Exit"))
|
| | | {
|
| | | model.RequestExitClientDungeon();
|
| | | ClientDungeonStageUtility.ExitNormalClientDungeon();
|
| | | }
|
| | | }
|
| | | #endif
|
| | |
| | | {
|
| | | None,
|
| | | Fight,
|
| | | PickItem,
|
| | | Settle,
|
| | | Exit
|
| | | }
|
| | | } |
| | | }
|
| | |
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | |
|
| | |
|
| | | public class ClientHazyGrassStage : DungeonStage
|
| | | {
|
| | | static readonly Vector3 PlayerBornPosition1 = new Vector3(19.401f, 4.985f, 5.494f);
|
| | |
|
| | | 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 List<int> s_RandomIndexs = new List<int>();
|
| | |
|
| | | static readonly int s_EnemyNpcId = 40208005;
|
| | |
|
| | | bool hasInitializedNpc = false;
|
| | | public bool hasCompleted { get; private set; }
|
| | |
|
| | | static Dictionary<uint, GA_NpcClientCollect> s_CollectNpcs = new Dictionary<uint, GA_NpcClientCollect>();
|
| | | static Dictionary<uint, int> s_Sid2NpcIds = new Dictionary<uint, int>();
|
| | | //static List<GA_NpcClientFightNorm> s_ClientFightNpcs = new List<GA_NpcClientFightNorm>();
|
| | | static List<HazyGrassNpcInfo> s_NpcRefreshInfos = new List<HazyGrassNpcInfo>();
|
| | |
|
| | | static Dictionary<int, int> s_NpcRefreshTimes = new Dictionary<int, int>();
|
| | |
|
| | | bool mapLoadFinish = false;
|
| | | bool initedFightNpc = false;
|
| | | static Dictionary<uint, int> s_Sid2NpcIndexs = new Dictionary<uint, int>();
|
| | | static Dictionary<int, int> s_NpcCounts = new Dictionary<int, int>();
|
| | |
|
| | | HazyRegionIncidentType incidentType;
|
| | |
|
| | | HazyGrassModel model { get { return ModelCenter.Instance.GetModel<HazyGrassModel>(); } }
|
| | | HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
|
| | | public override void Initialize()
|
| | | {
|
| | | base.Initialize();
|
| | |
|
| | | s_NpcInfos.Clear();
|
| | | s_RandomIndexs.Clear();
|
| | | s_Sid2NpcIds.Clear();
|
| | | s_Sid2NpcPos.Clear();
|
| | | s_NpcRefreshTimes.Clear();
|
| | |
|
| | | mapLoadFinish = false;
|
| | | initedFightNpc = false;
|
| | |
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | | if (config != null)
|
| | | {
|
| | | incidentType = (HazyRegionIncidentType)config.incidentType;
|
| | | s_NpcRefreshInfos = model.GetGrassNpcInfos(config.dungeonId);
|
| | | foreach (var npcInfo in s_NpcRefreshInfos)
|
| | | {
|
| | | s_NpcRefreshTimes.Add(npcInfo.npcId, GetNpcRefreshCount(npcInfo));
|
| | | }
|
| | | }
|
| | | s_CollectNpcs.Clear();
|
| | | s_Sid2NpcIndexs.Clear();
|
| | | s_NpcCounts.Clear();
|
| | | localNpcJsons.Clear();
|
| | |
|
| | | UnloadAllNpc();
|
| | |
|
| | | hasInitializedNpc = false;
|
| | | hasCompleted = false;
|
| | |
|
| | | ClientCollectUtility.OnCollectFinished += OnCollectFinished;
|
| | | dungeonModel.onDungeonResultEvent += OnDungeonResultEvent;
|
| | | }
|
| | |
|
| | | protected override void OnStageLoadFinish()
|
| | | {
|
| | | base.OnStageLoadFinish();
|
| | |
|
| | | mapLoadFinish = true;
|
| | |
|
| | | InitialPlayer();
|
| | | InitializeNpc();
|
| | |
|
| | | initedFightNpc = true;
|
| | |
|
| | | model.dugeonTargetStateRefresh -= DugeonTargetStateRefresh;
|
| | | model.dugeonTargetStateRefresh += DugeonTargetStateRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnUpdate()
|
| | | {
|
| | | base.OnUpdate();
|
| | |
|
| | | if (mapLoadFinish)
|
| | | {
|
| | | foreach (var npcInfo in s_NpcRefreshInfos)
|
| | | {
|
| | | var _lastCount = s_NpcRefreshTimes[npcInfo.npcId];
|
| | | var count = GetNpcRefreshCount(npcInfo);
|
| | | if (_lastCount != count)
|
| | | {
|
| | | RebornCollectedNpc(npcInfo.npcId);
|
| | | s_NpcRefreshTimes[npcInfo.npcId] = count;
|
| | | }
|
| | | }
|
| | | }
|
| | | model.onMapNpcCountRefresh += OnMapNpcCountRefresh;
|
| | | }
|
| | |
|
| | | public override void UnInitialize()
|
| | |
| | | UnloadAllNpc();
|
| | |
|
| | | ClientCollectUtility.OnCollectFinished -= OnCollectFinished;
|
| | | model.dugeonTargetStateRefresh -= DugeonTargetStateRefresh;
|
| | | dungeonModel.onDungeonResultEvent -= OnDungeonResultEvent;
|
| | | model.onMapNpcCountRefresh -= OnMapNpcCountRefresh;
|
| | | }
|
| | |
|
| | | private void DugeonTargetStateRefresh()
|
| | | private void OnMapNpcCountRefresh()
|
| | | {
|
| | | if (model.IsDungeonTargetDone)
|
| | | if (!hasInitializedNpc)
|
| | | {
|
| | | if (!NewBieCenter.Instance.IsGuideCompleted(51))
|
| | | {
|
| | | NewBieCenter.Instance.StartNewBieGuide(51);
|
| | | }
|
| | | InitializeNpc();
|
| | | }
|
| | | }
|
| | |
|
| | | int GetNpcRefreshCount(HazyGrassNpcInfo npcInfo)
|
| | | private void OnDungeonResultEvent()
|
| | | {
|
| | | var used = TimeUtility.Minute * 60 + TimeUtility.Second;
|
| | | var refreshSeconds = npcInfo.refreshMinute * 60;
|
| | | return used / refreshSeconds;
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.LeaveMap, 10 * 1000);
|
| | |
|
| | | hasCompleted = true;
|
| | | ClientDungeonStageUtility.ClearClientDataMapSymbol();
|
| | | }
|
| | |
|
| | | private void OnCollectFinished(uint _sid)
|
| | |
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | |
|
| | | s_Sid2NpcIds.Remove(_sid);
|
| | | }
|
| | |
|
| | | if (s_Sid2NpcPos.ContainsKey(_sid))
|
| | | {
|
| | | var pos = s_Sid2NpcPos[_sid];
|
| | | if (s_CollectNpcs.ContainsKey(pos))
|
| | | if (s_Sid2NpcIndexs.ContainsKey(_sid))
|
| | | {
|
| | | s_CollectNpcs.Remove(pos);
|
| | | var index = s_Sid2NpcIndexs[_sid];
|
| | | localNpcJsons.RemoveAll((x) =>
|
| | | {
|
| | | return x.npcId == npcId && x.index == index;
|
| | | });
|
| | | s_Sid2NpcIndexs.Remove(_sid);
|
| | | SaveNpcData();
|
| | | }
|
| | |
|
| | | if (s_NpcCounts.ContainsKey(npcId))
|
| | | {
|
| | | s_NpcCounts[npcId] = Mathf.Max(0, s_NpcCounts[npcId] - 1);
|
| | | }
|
| | | }
|
| | |
|
| | | RefreshMapNpcCount();
|
| | | }
|
| | |
|
| | | void InitializeNpc()
|
| | | {
|
| | | s_NpcInfos.Clear();
|
| | |
|
| | | var config = ScriptableObjectLoader.LoadSoHazyMapNpc(ClientDungeonStageUtility.clientMapId);
|
| | | var npcInfos = config.GetAllNpcInfos();
|
| | | if (npcInfos != null)
|
| | | if (s_CollectNpcs.ContainsKey(_sid))
|
| | | {
|
| | | s_NpcInfos.AddRange(npcInfos);
|
| | | RebornCollectedNpc();
|
| | | s_CollectNpcs.Remove(_sid);
|
| | | }
|
| | | }
|
| | |
|
| | | void InitialPlayer()
|
| | | {
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | hero.Pos = PlayerBornPosition1;
|
| | | hero.Rotation = Quaternion.Euler(0, -9.537001f, 0);
|
| | | CameraController.Instance.Apply();
|
| | | if (hero != null)
|
| | | {
|
| | | hero.Pos = PlayerBornPosition1;
|
| | | hero.Rotation = Quaternion.Euler(0, -9.537001f, 0);
|
| | | CameraController.Instance.Apply();
|
| | | }
|
| | | }
|
| | |
|
| | | void RebornCollectedNpc(int npcId = 0)
|
| | | void InitializeNpc()
|
| | | {
|
| | | foreach (var npcInfo in s_NpcInfos)
|
| | | {
|
| | | if (npcId != 0 && npcInfo.npcId != npcId)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | 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;
|
| | | var config = ScriptableObjectLoader.LoadSoHazyMapNpc(ClientDungeonStageUtility.clientMapId);
|
| | | var positions = config.GetNpcPositions();
|
| | |
|
| | | s_Sid2NpcIds[_npc.ServerInstID] = npcInfo.npcId;
|
| | | s_Sid2NpcPos[_npc.ServerInstID] = npcInfo.position;
|
| | | }
|
| | | }
|
| | | break;
|
| | | case E_NpcType.Fight:
|
| | | //if (!initedFightNpc)
|
| | | //{
|
| | | // var fightNpc = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightNorm>((uint)npcInfo.npcId,
|
| | | // E_ActorGroup.Enemy);
|
| | | // if (fightNpc != null)
|
| | | // {
|
| | | // fightNpc.Pos = npcInfo.position;
|
| | | // fightNpc.OnAttacked -= OnAttackNpc;
|
| | | // fightNpc.OnAttacked += OnAttackNpc;
|
| | | // }
|
| | | // s_ClientFightNpcs.Add(fightNpc);
|
| | | //}
|
| | | break;
|
| | | }
|
| | | s_RandomIndexs.Clear();
|
| | | for (int i = 0; i < positions.Count; i++)
|
| | | {
|
| | | s_RandomIndexs.Add(i);
|
| | | }
|
| | |
|
| | | RefreshMapNpcCount();
|
| | | }
|
| | | var mapId = model.GetGrassMapId(hazyRegionModel.processingIncidentId);
|
| | | var npcInfos = model.GetGrassNpcInfos(mapId);
|
| | |
|
| | | void RefreshMapNpcCount()
|
| | | {
|
| | | foreach (var npcInfo in s_NpcRefreshInfos)
|
| | | var npcJsonDatas = GetLocalNpcData();
|
| | |
|
| | | if (npcJsonDatas != null && npcJsonDatas.Count > 0)
|
| | | {
|
| | | var count = 0;
|
| | | foreach (var npcId in s_Sid2NpcIds.Values)
|
| | | for (int i = 0; i < npcInfos.Count; i++)
|
| | | {
|
| | | if (npcId == npcInfo.npcId)
|
| | | var npcId = npcInfos[i];
|
| | | var count = model.GetMapNpcCount(npcId);
|
| | |
|
| | | if (count == 0)
|
| | | {
|
| | | count++;
|
| | | continue;
|
| | | }
|
| | |
|
| | | for (int j = 0; j < count; j++)
|
| | | {
|
| | | var index = -1;
|
| | | var jsonInfoIndex = npcJsonDatas.FindIndex((x) =>
|
| | | {
|
| | | return x.npcId == npcId;
|
| | | });
|
| | | if (jsonInfoIndex != -1)
|
| | | {
|
| | | index = npcJsonDatas[jsonInfoIndex].index;
|
| | | npcJsonDatas.RemoveAt(jsonInfoIndex);
|
| | | }
|
| | | if (index == -1)
|
| | | {
|
| | | break;
|
| | | }
|
| | | InitializeNpc(npcId, index);
|
| | |
|
| | | s_RandomIndexs.Remove(index);
|
| | | }
|
| | | }
|
| | | model.RefreshMapNpcCount(npcInfo.npcId, count);
|
| | | }
|
| | |
|
| | | for (int i = 0; i < npcInfos.Count; i++)
|
| | | {
|
| | | var npcId = npcInfos[i];
|
| | | var count = model.GetMapNpcCount(npcId) - (s_NpcCounts.ContainsKey(npcId) ? s_NpcCounts[npcId] : 0);
|
| | |
|
| | | for (int j = 0; j < count; j++)
|
| | | {
|
| | | var index = UnityEngine.Random.Range(0, s_RandomIndexs.Count);
|
| | | InitializeNpc(npcId, s_RandomIndexs[index]);
|
| | |
|
| | | s_RandomIndexs.RemoveAt(index);
|
| | | }
|
| | | }
|
| | |
|
| | | if (hasInitializedNpc)
|
| | | {
|
| | | var enemyPosition = positions[UnityEngine.Random.Range(0, positions.Count)];
|
| | |
|
| | | if (ClientDungeonStageUtility.clientMapId == HazyGrassModel.FAIRY_CLIENTDATAMAP)
|
| | | {
|
| | | PersonalEnemy.Create((uint)s_EnemyNpcId, E_ActorGroup.Enemy, enemyPosition);
|
| | | }
|
| | | }
|
| | |
|
| | | if (hasInitializedNpc)
|
| | | {
|
| | | SaveNpcData();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnAttackNpc()
|
| | | void InitializeNpc(int npcId, int index)
|
| | | {
|
| | | Debug.Log("攻击了宝箱怪");
|
| | | hasInitializedNpc = true;
|
| | |
|
| | | var config = ScriptableObjectLoader.LoadSoHazyMapNpc(ClientDungeonStageUtility.clientMapId);
|
| | | var positions = config.GetNpcPositions();
|
| | |
|
| | | var position = positions[index];
|
| | |
|
| | | GA_NpcClientCollect _npc = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientCollect>((uint)npcId,
|
| | | E_ActorGroup.FuncNpc);
|
| | | _npc.Pos = position;
|
| | |
|
| | | s_CollectNpcs[_npc.ServerInstID] = _npc;
|
| | | s_Sid2NpcIds[_npc.ServerInstID] = npcId;
|
| | | s_Sid2NpcIndexs[_npc.ServerInstID] = index;
|
| | |
|
| | | if (!s_NpcCounts.ContainsKey(npcId))
|
| | | {
|
| | | s_NpcCounts.Add(npcId, 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | s_NpcCounts[npcId] += 1;
|
| | | }
|
| | |
|
| | | localNpcJsons.Add(new NpcJsonInfo()
|
| | | {
|
| | | npcId = npcId,
|
| | | index = index,
|
| | | });
|
| | | }
|
| | |
|
| | | void UnloadAllNpc()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | //foreach (var _npc in s_ClientFightNpcs)
|
| | | //{
|
| | | // if (_npc != null)
|
| | | // {
|
| | | // _npc.OnAttacked -= OnAttackNpc;
|
| | | // _npc.ActorInfo.serverDie = true;
|
| | | // GAMgr.Instance.ServerDie(_npc.ServerInstID);
|
| | | // GAMgr.Instance.Release(_npc);
|
| | | // }
|
| | | //}
|
| | | //
|
| | | //s_ClientFightNpcs.Clear();
|
| | | s_CollectNpcs.Clear();
|
| | | }
|
| | |
|
| | | #region 本地Npc数据
|
| | | List<NpcJsonInfo> localNpcJsons = new List<NpcJsonInfo>();
|
| | | public struct NpcJsonInfo
|
| | | {
|
| | | public int npcId;
|
| | | public int index;
|
| | | }
|
| | |
|
| | | void SaveNpcData()
|
| | | {
|
| | | LocalSave.SetString(model.GetLocalSaveKey(ClientDungeonStageUtility.clientMapId), LitJson.JsonMapper.ToJson(localNpcJsons));
|
| | | }
|
| | |
|
| | | List<NpcJsonInfo> GetLocalNpcData()
|
| | | {
|
| | | var key = model.GetLocalSaveKey(ClientDungeonStageUtility.clientMapId);
|
| | | if (LocalSave.HasKey(key))
|
| | | {
|
| | | return LitJson.JsonMapper.ToObject<List<NpcJsonInfo>>(LocalSave.GetString(key));
|
| | | }
|
| | | return null;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | private void OnGUI()
|
| | | {
|
| | | if (GUILayout.Button("Exit"))
|
| | | {
|
| | | model.RequestExitClientDungeon();
|
| | | ClientDungeonStageUtility.ExitNormalClientDungeon();
|
| | | }
|
| | | }
|
| | | #endif
|
| | |
| | | [SerializeField] Button m_Exit;
|
| | | [SerializeField] Text m_ExitTimer;
|
| | |
|
| | | const float totalTime = 5f;
|
| | | const float totalTime = 8f;
|
| | | float timer = 0f;
|
| | | float clockTimer = 0f;
|
| | |
|
| | |
| | |
|
| | | IEnumerator Co_DelayDisplay()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS500;
|
| | | yield return WaitingForSecondConst.WaitMS3000;
|
| | | Display();
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public class HazyDemonKingDungeonWin : Window
|
| | | {
|
| | | [SerializeField] Transform m_ContainerDungeonInfo;
|
| | | [SerializeField] CyclicScroll m_CyclicScroll;
|
| | | [SerializeField] HazyDemonKingPlayerBehaviour m_BelongToPlayer;
|
| | | [SerializeField] RectTransform m_ContainerPlayerList;
|
| | |
| | |
|
| | | uint belongToPlayerId = 0;
|
| | |
|
| | | private int dungeonType
|
| | | {
|
| | | get
|
| | | {
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | | if (config != null)
|
| | | {
|
| | | return config.dungeonType;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | HazyDemonKingModel model { get { return ModelCenter.Instance.GetModel<HazyDemonKingModel>(); } }
|
| | | HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | |
| | |
|
| | | void Display()
|
| | | {
|
| | | m_ContainerDungeonInfo.gameObject.SetActive(dungeonType != 0);
|
| | |
|
| | | DisplayBelongTo();
|
| | | DisplayPlayers();
|
| | | DisplayMyTargetName();
|
| | |
| | |
|
| | | void DisplayPlayers()
|
| | | {
|
| | | if (dungeonType == 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | playerIds.Clear();
|
| | | clonePlayerIds.Clear();
|
| | |
|
| | |
| | |
|
| | | void DisplayBelongTo()
|
| | | {
|
| | | if (dungeonType == 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | belongToPlayerId = 0;
|
| | | foreach (var sid in model.GetPlayerIds())
|
| | | {
|
| | |
| | |
|
| | | void DisplayInvincibleBuff()
|
| | | {
|
| | | var actors = GAMgr.Instance.GetTypeList(E_ActorClassType.NpcFightBoss);
|
| | | bool existInvincibleBuff = false;
|
| | |
|
| | | Status_Base status_Base = null;
|
| | | uint serverInstId = 0;
|
| | |
|
| | | if (actors != null && actors.Count > 0)
|
| | | if (dungeonType != 0)
|
| | | {
|
| | | var serverInstId = (actors[0] as GA_NpcFightBoss).ServerInstID;
|
| | | existInvincibleBuff = StatusMgr.Instance.IsExist(serverInstId, model.invincibleBuffId);
|
| | |
|
| | | if (existInvincibleBuff)
|
| | | var actors = GAMgr.Instance.GetTypeList(E_ActorClassType.NpcFightBoss);
|
| | | if (actors != null && actors.Count > 0)
|
| | | {
|
| | | status_Base = StatusMgr.Instance.Get(serverInstId, model.invincibleBuffId);
|
| | | serverInstId = (actors[0] as GA_NpcFightBoss).ServerInstID;
|
| | | existInvincibleBuff = StatusMgr.Instance.IsExist(serverInstId, model.invincibleBuffId);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | serverInstId = ClientHazyDemonKingStage.GetClientBossSid();
|
| | | existInvincibleBuff = StatusMgr.Instance.IsExist(serverInstId, model.invincibleBuffId);
|
| | | }
|
| | |
|
| | |
|
| | | if (existInvincibleBuff)
|
| | | {
|
| | | status_Base = StatusMgr.Instance.Get(serverInstId, model.invincibleBuffId);
|
| | | }
|
| | |
|
| | | m_ContainerInvincibleBuff.gameObject.SetActive(existInvincibleBuff);
|
| | |
| | |
|
| | | private void PerSecond()
|
| | | {
|
| | | if (dungeonType == 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (clonePlayerIds.Count > 0)
|
| | | {
|
| | | clonePlayerIds.Sort(Compare);
|
| | |
| | |
|
| | | void DisplayMyTargetName()
|
| | | {
|
| | | if (dungeonType == 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | m_MyAtkTargetName.text = string.Empty;
|
| | |
|
| | | myAtkSid = model.GetPlayerAtkTarget(PlayerDatas.Instance.PlayerId);
|
| | |
| | |
|
| | | public bool IsInDungeon { get; private set; }
|
| | |
|
| | | bool requireExitClientDungeon = false;
|
| | |
|
| | | public int invincibleBuffId { get; private set; }
|
| | |
|
| | | public const int Client_MapID = 2000;
|
| | | public const int CLIENTDATAMAP = 2000;
|
| | |
|
| | | public const int DEMONKINGMAPID1 = 22030;
|
| | | public const int DEMONKINGMAPID2 = 32030;
|
| | |
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | if (IsInDemonKingDungeon(PlayerDatas.Instance.baseData.MapID))
|
| | | {
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | | ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
|
| | | }
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | GA_Hero.OnStopBeAttacked -= OnStopBeAttacked;
|
| | |
|
| | | m_AttackHeroPlayers.Clear();
|
| | |
|
| | | if (requireExitClientDungeon)
|
| | | {
|
| | | requireExitClientDungeon = false;
|
| | | ClientDungeonStageUtility.RequestExitClientDungeon();
|
| | | }
|
| | |
|
| | | IsInDungeon = false;
|
| | | if (IsInDemonKingDungeon(mapId))
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | if (mapId == Client_MapID)
|
| | | if (mapId == CLIENTDATAMAP)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
| | |
|
| | | public uint GetPlayerAtkTarget(uint sid)
|
| | | {
|
| | | if (ClientDungeonStageUtility.clientMapId == Client_MapID)
|
| | | if (ClientDungeonStageUtility.clientMapId == CLIENTDATAMAP)
|
| | | {
|
| | | return ClientHazyDemonKingStage.GetClientBossSid();
|
| | | }
|
| | |
| | | public bool IsExistBelongTo(uint playerId)
|
| | | {
|
| | | if (playerId == PlayerDatas.Instance.PlayerId
|
| | | && ClientDungeonStageUtility.clientMapId == Client_MapID)
|
| | | && ClientDungeonStageUtility.clientMapId == CLIENTDATAMAP)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
| | | public void RequestEnterClientDungeon()
|
| | | {
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | |
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | if (hero != null)
|
| | | {
|
| | | hero.StopAll();
|
| | | }
|
| | |
|
| | | MapTransferUtility.Instance.Clear();
|
| | | ClientDungeonStageUtility.SetClientDungeon(true, Client_MapID);
|
| | | ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
|
| | | 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.Contest;
|
| | | GameNetSystem.Instance.PushPackage(attackMode, ServerType.Main);
|
| | | }
|
| | |
|
| | | public void RequestExitClientDungeon()
|
| | | {
|
| | | requireExitClientDungeon = true;
|
| | |
|
| | | ClientDungeonStageUtility.SetClientDungeon(false, 0);
|
| | | 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,
|
| | | refreshPlayerDatas=true
|
| | | });
|
| | | ClientDungeonStageUtility.GotoNormalClientDungeon(CLIENTDATAMAP, config.dungeonId, config.lineId);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public class HazyDemonKingVictoryWin : Window
|
| | | {
|
| | | [SerializeField] Transform m_ContainerPoivt;
|
| | | [SerializeField] Transform m_ContainerBelongTo;
|
| | | [SerializeField] Text m_PlayerName;
|
| | | [SerializeField] ScrollRect m_RewardsScroll;
|
| | | [SerializeField] Text m_ExitTimer;
|
| | |
| | |
|
| | | float timer = 0f;
|
| | |
|
| | | private int dungeonType
|
| | | {
|
| | | get
|
| | | {
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | | if (config != null)
|
| | | {
|
| | | return config.dungeonType;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | |
| | | {
|
| | | timer = 0f;
|
| | | m_ContainerPoivt.gameObject.SetActive(false);
|
| | | m_ContainerBelongTo.gameObject.SetActive(dungeonType != 0);
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | |
| | |
|
| | | private void ExitDungeon()
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.MapID == HazyDemonKingModel.Client_MapID)
|
| | | if (PlayerDatas.Instance.baseData.MapID == HazyDemonKingModel.CLIENTDATAMAP)
|
| | | {
|
| | | ModelCenter.Instance.GetModel<HazyDemonKingModel>().RequestExitClientDungeon();
|
| | | ClientDungeonStageUtility.ExitNormalClientDungeon();
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | [SerializeField] HazyGrassCountBeha[] m_GrassCountBehas;
|
| | | [SerializeField] Text[] m_GrassTimes;
|
| | |
|
| | | float timer = 0f;
|
| | |
|
| | | DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | | HazyGrassModel hazyGrassModel { get { return ModelCenter.Instance.GetModel<HazyGrassModel>(); } }
|
| | |
| | | {
|
| | | Display();
|
| | |
|
| | | timer = 0f;
|
| | | //RequestGrassCount();
|
| | |
|
| | | GlobalTimeEvent.Instance.secondEvent += PerSecond;
|
| | | hazyGrassModel.onMapNpcCountRefresh += OnMapNpcCountRefresh;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent -= PerSecond;
|
| | | hazyGrassModel.onMapNpcCountRefresh -= OnMapNpcCountRefresh;
|
| | | }
|
| | |
|
| | |
| | | protected override void LateUpdate()
|
| | | {
|
| | | base.LateUpdate();
|
| | | timer += Time.deltaTime;
|
| | | if (timer >= 5f)
|
| | | {
|
| | | timer = 0f;
|
| | | //RequestGrassCount();
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | private void PerSecond()
|
| | | {
|
| | | DisplayGrassRefreshTime();
|
| | | }
|
| | |
|
| | | void Display()
|
| | | {
|
| | |
| | | if (npcInfos != null && i < npcInfos.Count)
|
| | | {
|
| | | m_GrassCountBehas[i].SetActive(true);
|
| | | m_GrassCountBehas[i].Display(npcInfos[i].npcId,
|
| | | hazyGrassModel.GetMapNpcCount(npcInfos[i].npcId));
|
| | | m_GrassCountBehas[i].Display(npcInfos[i], hazyGrassModel.GetMapNpcCount(npcInfos[i]));
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | |
|
| | | void DisplayGrassRefreshTime()
|
| | | {
|
| | | var mapId = 0;
|
| | | if (ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | mapId = hazyGrassModel.GetGrassMapId(hazyRegionModel.processingIncidentId);
|
| | | }
|
| | | else
|
| | | {
|
| | | mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | }
|
| | | var npcInfos = hazyGrassModel.GetGrassNpcInfos(mapId);
|
| | | for (int i = 0; i < m_GrassTimes.Length; i++)
|
| | | {
|
| | | if (npcInfos != null && i < npcInfos.Count)
|
| | | {
|
| | | m_GrassTimes[i].gameObject.SetActive(true);
|
| | | var used = 0;
|
| | | if (ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | used = TimeUtility.Minute * 60 + TimeUtility.Second;
|
| | | }
|
| | | else
|
| | | {
|
| | | used = TimeUtility.CrossServerNow.Minute * 60 + TimeUtility.CrossServerNow.Second;
|
| | | }
|
| | | var refreshSeconds = npcInfos[i].refreshMinute * 60;
|
| | | var seconds = refreshSeconds - used % refreshSeconds;
|
| | | var npcConfig = NPCConfig.Get(npcInfos[i].npcId);
|
| | | m_GrassTimes[i].text = Language.Get("HazyGrassRefresh", npcConfig.charName,
|
| | | TimeUtility.SecondsToMS(seconds));
|
| | | }
|
| | | else
|
| | | {
|
| | | m_GrassTimes[i].gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void RequestGrassCount()
|
| | | {
|
| | | if (!ClientDungeonStageUtility.isClientDungeon)
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var npcInfos = hazyGrassModel.GetGrassNpcInfos(mapId);
|
| | | if (npcInfos != null)
|
| | | {
|
| | | int[] npcs = new int[npcInfos.Count];
|
| | | for (int i = 0; i < npcInfos.Count; i++)
|
| | | {
|
| | | npcs[i] = npcInfos[i].npcId;
|
| | | }
|
| | | |
| | | var pak = new CA227_tagCMQueryNPCCntInfo();
|
| | | pak.MapID = (uint)mapId;
|
| | | pak.LineID = (ushort)PlayerDatas.Instance.baseData.dungeonLineId;
|
| | | pak.NPCIDList = LitJson.JsonMapper.ToJson(npcs);
|
| | | pak.NPCIDListLen = (byte)pak.NPCIDList.Length;
|
| | | GameNetSystem.Instance.SendToCrossServer(pak);
|
| | | }
|
| | | m_GrassTimes[i].gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | [XLua.LuaCallCSharp]
|
| | | public class HazyGrassModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | Dictionary<int, List<HazyGrassNpcInfo>> mapNpcs = new Dictionary<int, List<HazyGrassNpcInfo>>();
|
| | | Dictionary<int, List<int>> m_MapNpcs = new Dictionary<int, List<int>>();
|
| | | Dictionary<int, int> m_MapNpcCount = new Dictionary<int, int>();
|
| | |
|
| | | public const int ReikiGrassMapId = 32040;
|
| | | public const int FairyGrassMapId = 32050;
|
| | | public const int Client_ReikiGrassMapID = 3240;
|
| | | public const int Client_FairyGrassMapID = 3250;
|
| | | public const int REIKI_CLIENTDATAMAP = 3240;
|
| | | public const int FAIRY_CLIENTDATAMAP = 3250;
|
| | |
|
| | | public bool IsInDungeon { get; private set; }
|
| | |
|
| | | bool requireExitClientDungeon = false;
|
| | |
|
| | | bool m_IsDungeonTargetDone = false;
|
| | | public bool IsDungeonTargetDone
|
| | | {
|
| | | get { return m_IsDungeonTargetDone; }
|
| | | private set
|
| | | {
|
| | | if (m_IsDungeonTargetDone != value)
|
| | | {
|
| | | m_IsDungeonTargetDone = value;
|
| | | if (dugeonTargetStateRefresh != null)
|
| | | {
|
| | | dugeonTargetStateRefresh();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public event Action onMapNpcCountRefresh;
|
| | | public event Action dugeonTargetStateRefresh;
|
| | |
|
| | | HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
| | | ParseConfig();
|
| | |
|
| | | StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | GlobalTimeEvent.Instance.secondEvent += PerSecond;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | if (IsInGrassDungeon(PlayerDatas.Instance.baseData.MapID))
|
| | | {
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | | ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
|
| | | }
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | StageLoad.Instance.onStageLoadFinish -= OnStageLoadFinish;
|
| | | GlobalTimeEvent.Instance.secondEvent -= PerSecond;
|
| | | }
|
| | |
|
| | | private void PerSecond()
|
| | | {
|
| | | if (IsInDungeon)
|
| | | {
|
| | | IsDungeonTargetDone = GetDungeonTargetDone();
|
| | | }
|
| | | }
|
| | |
|
| | | void ParseConfig()
|
| | |
| | | if (config.MapID == ReikiGrassMapId
|
| | | || config.MapID == FairyGrassMapId)
|
| | | {
|
| | | List<HazyGrassNpcInfo> _npcs = null;
|
| | | if (!mapNpcs.TryGetValue(config.MapID, out _npcs))
|
| | | List<int> _npcs = null;
|
| | | if (!m_MapNpcs.TryGetValue(config.MapID, out _npcs))
|
| | | {
|
| | | _npcs = new List<HazyGrassNpcInfo>();
|
| | | mapNpcs.Add(config.MapID, _npcs);
|
| | | _npcs = new List<int>();
|
| | | m_MapNpcs.Add(config.MapID, _npcs);
|
| | | }
|
| | | for (int i = 0; i < config.NPCIDList.Length; i++)
|
| | | {
|
| | | _npcs.Add(new HazyGrassNpcInfo()
|
| | | {
|
| | | npcId = config.NPCIDList[i],
|
| | | refreshMinute = config.RefreshPerMinutes,
|
| | | });
|
| | | _npcs.Add(config.NPCIDList[i]);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | |
|
| | | m_MapNpcCount.Clear();
|
| | |
|
| | | if (requireExitClientDungeon)
|
| | | {
|
| | | requireExitClientDungeon = false;
|
| | | ClientDungeonStageUtility.RequestExitClientDungeon();
|
| | | }
|
| | |
|
| | | IsInDungeon = false;
|
| | | m_IsDungeonTargetDone = false;
|
| | | if (IsInGrassDungeon(mapId))
|
| | | {
|
| | | IsInDungeon = true;
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | if (mapId == Client_ReikiGrassMapID
|
| | | || mapId == Client_FairyGrassMapID)
|
| | | if (mapId == REIKI_CLIENTDATAMAP
|
| | | || mapId == FAIRY_CLIENTDATAMAP)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
| | | switch ((HazyRegionIncidentType)config.incidentType)
|
| | | {
|
| | | case HazyRegionIncidentType.FairyGrass:
|
| | | return Client_FairyGrassMapID;
|
| | | return FAIRY_CLIENTDATAMAP;
|
| | | case HazyRegionIncidentType.ReikiGrass:
|
| | | return Client_ReikiGrassMapID;
|
| | | return REIKI_CLIENTDATAMAP;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
| | | return 0;
|
| | | }
|
| | |
|
| | | public List<HazyGrassNpcInfo> GetGrassNpcInfos(int mapId)
|
| | | public List<int> GetGrassNpcInfos(int mapId)
|
| | | {
|
| | | if (mapNpcs.ContainsKey(mapId))
|
| | | if (m_MapNpcs.ContainsKey(mapId))
|
| | | {
|
| | | return mapNpcs[mapId];
|
| | | return m_MapNpcs[mapId];
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
| | | return 0;
|
| | | }
|
| | |
|
| | | public string GetLocalSaveKey(int mapId)
|
| | | {
|
| | | return StringUtility.Contact("HazyGrassMap", mapId, "_", PlayerDatas.Instance.PlayerId);
|
| | | }
|
| | |
|
| | | public void DeleteLocalSaveKey()
|
| | | {
|
| | | LocalSave.DeleteKey(GetLocalSaveKey(FAIRY_CLIENTDATAMAP));
|
| | | LocalSave.DeleteKey(GetLocalSaveKey(REIKI_CLIENTDATAMAP));
|
| | | }
|
| | |
|
| | | public bool CanCollectClientNpc(int npcId)
|
| | | {
|
| | | if (ClientDungeonStageUtility.isClientDungeon
|
| | | && ClientDungeonStageUtility.clientMapId == Client_ReikiGrassMapID)
|
| | | && (ClientDungeonStageUtility.clientMapId == REIKI_CLIENTDATAMAP
|
| | | || ClientDungeonStageUtility.clientMapId == FAIRY_CLIENTDATAMAP))
|
| | | {
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | | if (config != null)
|
| | |
| | | var collectCount = dungeonModel.GetDugneonNpcCollectCount(npcId);
|
| | | var hintId = dungeonModel.GetDungeonHintId(config.dungeonId, config.lineId); |
| | | var hintConfig = DungeonHintConfig.Get(hintId); |
| | | |
| | | if (hintConfig.NPC1ID.Length > 1
|
| | | && Array.IndexOf(hintConfig.NPC1ID, npcId) != -1)
|
| | | {
|
| | | collectCount = 0;
|
| | | for (int i = 0; i < hintConfig.NPC1ID.Length; i++)
|
| | | {
|
| | | collectCount += dungeonModel.GetDugneonNpcCollectCount(hintConfig.NPC1ID[i]);
|
| | | }
|
| | | return collectCount < hintConfig.targetValue1[0];
|
| | | } |
| | | |
| | | if (hintConfig.NPC1ID.Length > 0 && hintConfig.NPC1ID[0] == npcId)
|
| | | {
|
| | | return collectCount < hintConfig.targetValue1[0];
|
| | |
| | | public void RequestEnterClientDungeon()
|
| | | {
|
| | | var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
|
| | |
|
| | | var mapId = GetClientMapId(hazyRegionModel.processingIncidentId);
|
| | |
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | if (hero != null)
|
| | | {
|
| | | hero.StopAll();
|
| | | }
|
| | |
|
| | | MapTransferUtility.Instance.Clear();
|
| | | ClientDungeonStageUtility.SetClientDungeon(true, (ushort)mapId);
|
| | | ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
|
| | | 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);
|
| | | ClientDungeonStageUtility.GotoNormalClientDungeon(mapId, config.dungeonId, config.lineId);
|
| | | }
|
| | |
|
| | | public void RequestExitClientDungeon()
|
| | | {
|
| | | requireExitClientDungeon = true;
|
| | | ClientDungeonStageUtility.SetClientDungeon(false, 0);
|
| | | 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,
|
| | | refreshPlayerDatas=true
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | public struct HazyGrassNpcInfo
|
| | | {
|
| | | public int npcId;
|
| | | public int refreshMinute;
|
| | | }
|
| | | } |
| | | |
| | |
| | | #endif |
| | | public class HazyMapNpcScriptableObject : ScriptableObject
|
| | | { |
| | | [SerializeField] NpcInfo[] m_MapNpcInfos; |
| | | [SerializeField] List<Vector3> m_NpcPositions; |
| | | |
| | | public NpcInfo[] GetAllNpcInfos()
|
| | | public List<Vector3> GetNpcPositions()
|
| | | {
|
| | | return m_MapNpcInfos;
|
| | | return m_NpcPositions;
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | public void Save(int index, Vector3 position)
|
| | | {
|
| | | if (m_MapNpcInfos != null && index < m_MapNpcInfos.Length)
|
| | | if (m_NpcPositions != null && index < m_NpcPositions.Count)
|
| | | {
|
| | | m_MapNpcInfos[index] = new NpcInfo()
|
| | | {
|
| | | npcId = m_MapNpcInfos[index].npcId,
|
| | | npcType = m_MapNpcInfos[index].npcType,
|
| | | position = position,
|
| | | };
|
| | | m_NpcPositions[index] = position;
|
| | | }
|
| | | }
|
| | | #endif
|
| | |
|
| | | [Serializable]
|
| | | public struct NpcInfo
|
| | | {
|
| | | public int npcId;
|
| | | public E_NpcType npcType;
|
| | | public Vector3 position;
|
| | | }
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Monday, May 20, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI {
|
| | |
|
| | | public class HazyRegionCompleteWin : Window
|
| | | {
|
| | | [SerializeField] Button m_Confirm;
|
| | | [SerializeField] Text m_Label;
|
| | |
|
| | | const float closeSeconds = 3f;
|
| | |
|
| | | float timer = 0f;
|
| | |
|
| | | float checkTimer = 0f;
|
| | |
|
| | | HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Confirm.onClick.AddListener(CloseClick);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | timer = 0f;
|
| | | DisplayTimes();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | Confirm();
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | | {
|
| | | checkTimer += Time.deltaTime;
|
| | | if (checkTimer >= 0.5f)
|
| | | {
|
| | | checkTimer = 0f;
|
| | | DisplayTimes();
|
| | | }
|
| | |
|
| | | timer += Time.deltaTime;
|
| | | if (timer >= closeSeconds)
|
| | | {
|
| | | CloseImmediately();
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | void DisplayTimes()
|
| | | {
|
| | | var seconds = Mathf.CeilToInt(closeSeconds - timer);
|
| | | m_Label.text = StringUtility.Contact("确定", "(", seconds, "秒)");
|
| | | }
|
| | |
|
| | | private void Confirm()
|
| | | {
|
| | | model.SendBackHazyRegion();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
copy from System/Treasure/ClientTreasureDungeon.cs.meta
copy to System/HazyRegion/HazyRegionCompleteWin.cs.meta
| File was copied from System/Treasure/ClientTreasureDungeon.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 189ce34976654c34da06b3239c45076d |
| | | timeCreated: 1556000158 |
| | | guid: 5da9fe99e210d404c805d3485886e582 |
| | | timeCreated: 1558336399 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | |
|
| | | public static int adventureDialogueId = 0;
|
| | |
|
| | | public static event Action onDialogueComplete;
|
| | |
|
| | | HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
|
| | |
|
| | | #region Built-in
|
| | |
| | | private void OnSkip()
|
| | | {
|
| | | Close();
|
| | | model.SendSwitchAdventureState(model.processingIncidentId, 3);
|
| | | if (onDialogueComplete != null)
|
| | | {
|
| | | onDialogueComplete();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnClickEmpty()
|
| | |
| | | else
|
| | | {
|
| | | Close();
|
| | | model.SendSwitchAdventureState(model.processingIncidentId, 3);
|
| | | if (onDialogueComplete != null)
|
| | | {
|
| | | onDialogueComplete();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | [SerializeField] Transform m_RedpointSign;
|
| | |
|
| | | [SerializeField] Transform m_ContainerStar;
|
| | | [SerializeField] Transform[] m_Stars;
|
| | |
|
| | | [Header("Boss")]
|
| | | [SerializeField] Transform m_ContainerBoss;
|
| | | [SerializeField] Text m_BossName;
|
| | | [SerializeField] Transform m_BossAliveInfo;
|
| | | [SerializeField] Text m_PlayerCount;
|
| | | [SerializeField] Text m_RebornTime;
|
| | |
|
| | |
| | |
|
| | | DisplayBase();
|
| | | DisplayItems();
|
| | | DisplayStars();
|
| | | DisplayState();
|
| | | DisplaySelect();
|
| | | DisplayBoss();
|
| | |
| | | m_Icon.SetSprite(config.PortraitID);
|
| | | m_Icon.SetNativeSize();
|
| | | m_Icon.material = m_SmoothMask.imageMaterials[0];
|
| | | m_ContainerCrossServer.gameObject.SetActive(!model.InFakeHazyRegion && config.dungeonType == 2);
|
| | | m_ContainerCrossServer.gameObject.SetActive(config.dungeonType == 2);
|
| | | m_ContainerMustSign.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | void DisplayStars()
|
| | | {
|
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | m_ContainerStar.gameObject.SetActive(config.star > 0);
|
| | | if (config.star > 0)
|
| | | {
|
| | | for (int i = 0; i < m_Stars.Length; i++)
|
| | | {
|
| | | m_Stars[i].gameObject.SetActive(i < config.star);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayBoss()
|
| | | {
|
| | | m_ContainerBoss.gameObject.SetActive(incidentType == HazyRegionIncidentType.DemonKing);
|
| | |
| | | {
|
| | | if (incidentType == HazyRegionIncidentType.DemonKing)
|
| | | {
|
| | | if (model.InFakeHazyRegion)
|
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | if (config.dungeonType == 0)
|
| | | {
|
| | | var fighting = ClientDungeonStageUtility.isClientDungeon &&
|
| | | ClientDungeonStageUtility.clientMapId == HazyDemonKingModel.Client_MapID;
|
| | | m_PlayerCount.gameObject.SetActive(true);
|
| | | m_RebornTime.gameObject.SetActive(false);
|
| | | m_PlayerCount.text = Language.Get("HazyDemonKingPlayerCount", fighting ? 1 : 0);
|
| | | m_BossAliveInfo.gameObject.SetActive(false);
|
| | | //var fighting = ClientDungeonStageUtility.isClientDungeon &&
|
| | | // ClientDungeonStageUtility.clientMapId == HazyDemonKingModel.CLIENTDATAMAP;
|
| | | //m_PlayerCount.gameObject.SetActive(true);
|
| | | //m_RebornTime.gameObject.SetActive(false);
|
| | | //m_PlayerCount.text = Language.Get("HazyDemonKingPlayerCount", fighting ? 1 : 0);
|
| | | }
|
| | | else
|
| | | {
|
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | m_BossAliveInfo.gameObject.SetActive(true);
|
| | | m_PlayerCount.gameObject.SetActive(bossAlive);
|
| | | m_RebornTime.gameObject.SetActive(!bossAlive);
|
| | | m_Icon.material = bossAlive ? m_SmoothMask.imageMaterials[0] : m_SmoothMask.imageMaterials[1];
|
| | |
| | |
|
| | | private void OnPlayerCountRefresh()
|
| | | {
|
| | | var config = HazyRegionConfig.Get(incidentId);
|
| | | if (incidentType == HazyRegionIncidentType.DemonKing
|
| | | && !model.InFakeHazyRegion && bossAlive)
|
| | | && config.dungeonType != 0 && bossAlive)
|
| | | {
|
| | | DisplayPlayerCount();
|
| | | }
|
| | |
| | |
|
| | | private void Awake()
|
| | | {
|
| | | //m_Back.AddListener(OnBack);
|
| | | m_Back.AddListener(OnBack);
|
| | | m_Goto.AddListener(Goto);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | void DisplayBackButton()
|
| | | {
|
| | | m_Back.gameObject.SetActive(false);
|
| | | m_Back.gameObject.SetActive(!model.InFakeHazyRegion);
|
| | | }
|
| | |
|
| | | int Compare(int lhs, int rhs)
|
| | |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | | using UnityEngine; |
| | | using UnityEngine;
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | [XLua.LuaCallCSharp]
|
| | |
| | | IncidentState.Complete,
|
| | | };
|
| | |
|
| | | public const int PRECIOUS_CLIENTDATAMAP = 31190;
|
| | |
|
| | | public int limitPoint { get; private set; }
|
| | | public int point { get; private set; }
|
| | | public int processingIncidentId { get; private set; }
|
| | |
|
| | | public int processingIncidentId
|
| | | {
|
| | | get
|
| | | {
|
| | | return LocalSave.GetInt(StringUtility.Contact("HazyIncidentId", PlayerDatas.Instance.PlayerId));
|
| | | }
|
| | | private set
|
| | | {
|
| | | LocalSave.SetInt(StringUtility.Contact("HazyIncidentId", PlayerDatas.Instance.PlayerId), value);
|
| | | }
|
| | | }
|
| | |
|
| | | public int adventureDialogueId { get; private set; }
|
| | | public bool playing { get; private set; }
|
| | | public bool satisfyFakeOpen { get; private set; }
|
| | |
| | |
|
| | | if (AdventureStage.Instance.IsInAdventureStage)
|
| | | {
|
| | | ClientDungeonStageUtility.RequestStartClientDungeon(0, 0); |
| | | ClientDungeonStageUtility.RequestStartClientDungeon(0, 0, null);
|
| | | }
|
| | |
|
| | | UpdateRedpoint();
|
| | |
| | | switch ((HazyRegionIncidentType)config.incidentType)
|
| | | {
|
| | | case HazyRegionIncidentType.DemonKing:
|
| | | if (!InFakeHazyRegion && !findPreciousModel.IsBossAlive(config.npcId))
|
| | | if (config.dungeonType != 0 && !findPreciousModel.IsBossAlive(config.npcId))
|
| | | {
|
| | | error = 5;
|
| | | return false;
|
| | |
| | | {
|
| | | return false;
|
| | | }
|
| | | if (mapId == HazyDemonKingModel.Client_MapID
|
| | | || mapId == HazyGrassModel.Client_FairyGrassMapID
|
| | | || mapId == HazyGrassModel.Client_ReikiGrassMapID)
|
| | | if (mapId == HazyDemonKingModel.CLIENTDATAMAP
|
| | | || mapId == HazyGrassModel.FAIRY_CLIENTDATAMAP
|
| | | || mapId == HazyGrassModel.REIKI_CLIENTDATAMAP)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
| | | switch ((HazyRegionIncidentType)config.incidentType)
|
| | | {
|
| | | case HazyRegionIncidentType.Adventure:
|
| | | InitializeAdventure();
|
| | | ClientDungeonStageUtility.RequestStartClientDungeon(0, 0, (dungeonInfo, isOk) =>
|
| | | {
|
| | | InitializeAdventure();
|
| | |
|
| | | WindowJumpMgr.Instance.ClearJumpData();
|
| | | WindowCenter.Instance.CloseAll(WindowCenter.CloseAllIgnoreType.BaseAndCustom);
|
| | | WindowJumpMgr.Instance.ClearJumpData();
|
| | | WindowCenter.Instance.CloseAll(WindowCenter.CloseAllIgnoreType.BaseAndCustom);
|
| | |
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | if (hero != null)
|
| | | {
|
| | | hero.StopAll();
|
| | | }
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | if (hero != null)
|
| | | {
|
| | | hero.StopAll();
|
| | | }
|
| | |
|
| | | AdventureStage.Instance.Enter();
|
| | |
|
| | | Incident incident;
|
| | | if (TryGetIncident(id, out incident))
|
| | | {
|
| | | if (incident.state == IncidentState.UnStart)
|
| | | {
|
| | | SendSwitchAdventureState(id, 2);
|
| | | }
|
| | | }
|
| | | AdventureStage.Instance.Enter();
|
| | | Incident incident;
|
| | | if (TryGetIncident(id, out incident))
|
| | | {
|
| | | if (incident.state == IncidentState.UnStart)
|
| | | {
|
| | | SendSwitchAdventureState(id, 2);
|
| | | }
|
| | | }
|
| | | });
|
| | | break;
|
| | | case HazyRegionIncidentType.DemonKing:
|
| | | if (InFakeHazyRegion)
|
| | | if (config.dungeonType == 0)
|
| | | {
|
| | | hazyDemonKingModel.RequestEnterClientDungeon();
|
| | | }
|
| | |
| | | break;
|
| | | case HazyRegionIncidentType.FairyGrass:
|
| | | case HazyRegionIncidentType.ReikiGrass:
|
| | | if (InFakeHazyRegion)
|
| | | if (config.dungeonType == 0)
|
| | | {
|
| | | hazyGrassModel.RequestEnterClientDungeon();
|
| | | }
|
| | |
| | | }
|
| | | break;
|
| | | case HazyRegionIncidentType.Precious:
|
| | | SendGotoIncidentDungeon(config);
|
| | | BossShowModel.Instance.reqDungeonLineId = 0;
|
| | | ClientDungeonStageUtility.GotoNormalClientDungeon(config.dungeonId, config.dungeonId, config.lineId);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | void SendGotoIncidentDungeon(HazyRegionConfig config)
|
| | | {
|
| | | if (config.dungeonId == HazyGrassModel.FairyGrassMapId ||
|
| | | config.dungeonId == HazyGrassModel.ReikiGrassMapId ||
|
| | | config.dungeonId == HazyDemonKingModel.DEMONKINGMAPID2)
|
| | | if (config.dungeonType == 2)
|
| | | {
|
| | | var pak = new CC105_tagCMEnterCrossServer();
|
| | | pak.DataMapID = (uint)config.dungeonId;
|
| | |
| | | if (package.IsAll == 1)
|
| | | {
|
| | | m_Incidents.Clear();
|
| | | }
|
| | |
|
| | | if (package.State != 1)
|
| | | {
|
| | | hazyGrassModel.DeleteLocalSaveKey();
|
| | | }
|
| | |
|
| | | for (int i = 0; i < package.Count; i++)
|
| | |
| | | DemonKing,
|
| | | ReikiGrass,
|
| | | }
|
| | | } |
| | | |
| | | }
|
| | |
|
| | |
| | |
|
| | | if (allComplete)
|
| | | {
|
| | | model.SendBackHazyRegion();
|
| | | WindowCenter.Instance.Open<HazyRegionCompleteWin>();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | if (flyObject != null)
|
| | | {
|
| | | GameObject.Destroy(flyObject);
|
| | | GameObject.Destroy(flyObject.gameObject);
|
| | | flyObject = null;
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | if (flyObject != null)
|
| | | {
|
| | | GameObject.Destroy(flyObject);
|
| | | GameObject.Destroy(flyObject.gameObject);
|
| | | flyObject = null;
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | IsCompleteDialogue = true;
|
| | | var pak = new CA50E_tagCMOpenMagicWeapon();
|
| | | pak.MWID = (uint)ClientTreasureDungeon.challengeTreasureId;
|
| | | pak.MWID = (uint)101;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | if (!IsCompleteDialogue)
|
| | | {
|
| | | ClientTreasureDungeon.RequestExit();
|
| | | ClientDungeonStageUtility.ExitNormalClientDungeon();
|
| | | }
|
| | | }
|
| | |
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Thursday, May 23, 2019
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class DemonDungeonChallengeConfirmWin : Window
|
| | | {
|
| | | [SerializeField] Text m_Remind;
|
| | | [SerializeField] Button m_GetFightPower;
|
| | | [SerializeField] Button m_GetDefense;
|
| | | [SerializeField] Button m_Challenge;
|
| | | [SerializeField] Button m_Close;
|
| | |
|
| | | public static int treasureId = 0;
|
| | |
|
| | | TreasureModel model { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_GetFightPower.AddListener(GetFightPower);
|
| | | m_GetDefense.AddListener(GetDefense);
|
| | | m_Challenge.AddListener(Challenge);
|
| | | m_Close.AddListener(CloseClick);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | Display();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | void Display()
|
| | | {
|
| | | var fightPower = PlayerDatas.Instance.baseData.FightPoint;
|
| | | var defense = UIHelper.GetPropertyValue(PropertyType.DEF);
|
| | | var recommandPower = 0;
|
| | | var recommandDefense = 0;
|
| | |
|
| | | TreasureDungeon treasureDungeon;
|
| | | if (model.TryGetTreasureDungeon(treasureId, out treasureDungeon))
|
| | | {
|
| | | var dungeonInfo = treasureDungeon.Get(treasureDungeon.currentLevel + 1);
|
| | | if (!dungeonInfo.Equals(default(TreasureDungeonInfo)))
|
| | | {
|
| | | recommandPower = dungeonInfo.fightPower;
|
| | | recommandDefense = dungeonInfo.defense;
|
| | | }
|
| | | }
|
| | |
|
| | | m_GetFightPower.gameObject.SetActive(fightPower < recommandPower);
|
| | | m_GetDefense.gameObject.SetActive(defense < recommandDefense);
|
| | | m_Challenge.gameObject.SetActive(fightPower >= recommandPower
|
| | | || defense >= recommandDefense);
|
| | |
|
| | | if (fightPower < recommandPower && defense < recommandDefense)
|
| | | {
|
| | | m_Remind.text = Language.Get("DemonDungeonNextError_1");
|
| | | }
|
| | | else if (fightPower < recommandPower)
|
| | | {
|
| | | m_Remind.text = Language.Get("DemonDungeonNextError_2");
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Remind.text = Language.Get("DemonDungeonNextError_3");
|
| | | }
|
| | | }
|
| | |
|
| | | private void GetFightPower()
|
| | | {
|
| | | CloseImmediately();
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.RolePromote);
|
| | | }
|
| | |
|
| | | private void Challenge()
|
| | | {
|
| | | var config = TreasureConfig.Get(treasureId);
|
| | | ModelCenter.Instance.GetModel<DungeonModel>().SingleChallenge(TreasureModel.TREASURE_DATAMAPID, config.LineId);
|
| | | }
|
| | |
|
| | | private void GetDefense()
|
| | | {
|
| | | CloseImmediately();
|
| | | RealmRecommandEquipGetWayWin.equipGetWays.Clear();
|
| | | RealmRecommandEquipGetWayWin.equipGetWays.AddRange(GeneralDefine.defenseGetWays);
|
| | | WindowCenter.Instance.Open<RealmRecommandEquipGetWayWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| File was renamed from System/Treasure/ClientTreasureDungeon.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 189ce34976654c34da06b3239c45076d |
| | | timeCreated: 1556000158 |
| | | guid: 4517485b35c8cd84096a53b33739c393 |
| | | timeCreated: 1558591909 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (fightPower < recommandPower && defense < recommandDefense)
|
| | | if (fightPower < recommandPower || defense < recommandDefense)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("TreasureDungeonGotoError_1");
|
| | | DemonDungeonChallengeConfirmWin.treasureId = model.selectedTreasure;
|
| | | WindowCenter.Instance.Open<DemonDungeonChallengeConfirmWin>();
|
| | | return;
|
| | | }
|
| | |
|
| | | var config = TreasureConfig.Get(model.selectedTreasure);
|
| | | if (fightPower < recommandPower && model.selectedTreasure != 201)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("DemonLackPowerTitle"), Language.Get("DemonLackFightPower", recommandPower)
|
| | | , (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | model.collectingDemon = model.selectedTreasure;
|
| | | dungeonModel.SingleChallenge(TreasureModel.TREASURE_DATAMAPID, config.LineId);
|
| | | }
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | model.collectingDemon = model.selectedTreasure;
|
| | | dungeonModel.SingleChallenge(TreasureModel.TREASURE_DATAMAPID, config.LineId);
|
| | | }
|
| | | dungeonModel.SingleChallenge(TreasureModel.TREASURE_DATAMAPID, config.LineId);
|
| | | }
|
| | |
|
| | | private void Display()
|
| | |
| | | {
|
| | | if (model.selectedTreasure == 101)
|
| | | {
|
| | | ClientTreasureDungeon.RequestEnter(101);
|
| | | ClientDungeonStageUtility.GotoNormalClientDungeon(4000, 0, 0);
|
| | | return;
|
| | | }
|
| | | if (PlayerDatas.Instance.baseData.LV >= config.ChallengeLevel)
|
| | |
| | | } |
| | | else
|
| | | {
|
| | | treasureId = ClientTreasureDungeon.challengeTreasureId;
|
| | | treasureId = 101;
|
| | | }
|
| | |
|
| | | var config = TreasureConfig.Get(treasureId); |
| | |
| | | ModelCenter.Instance.GetModel<EquipModel>().SelectSet(equipLevel);
|
| | | SetJumpLogic<RealmEquipWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.RolePromote:
|
| | | SetJumpLogic<RolePromoteWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | default:
|
| | | DebugEx.Log("未添加此跳转界面:" + jumpType);
|
| | | IsJumpState = false;
|
| | |
| | | FullServerAuction = 319,
|
| | | AlchemyNormal = 320,
|
| | | AlchemyFairy = 321,
|
| | | RolePromote = 322,
|
| | |
|
| | | DhszTs = 1001,//定海神针功法提升界面
|
| | | HyqTs = 1002,//皓月枪功法提升界面
|
| | |
| | | SGZC_FightAssist = 21,// 上古战场助战
|
| | | MonsterTime = 22,// 按时间掉血
|
| | | PersonalEnemy = 23,// 专属敌人
|
| | | PersonalEnemyPVP = 24,// 专属敌人
|
| | | OpenWorldMap = 99,// 打开世界地图
|
| | | }
|
| | |
|
| | |
| | | /** 普通伤害 */
|
| | | Normal = 1,
|
| | | /** 恢复 */
|
| | | Recovery=2,
|
| | | Recovery = 2,
|
| | | /** 反弹伤害 */
|
| | | BounceHurt=3,
|
| | | BounceHurt = 3,
|
| | | /** 留血 */
|
| | | Bleed=4,
|
| | | Bleed = 4,
|
| | | /** 抵御 */
|
| | | Parry=5,
|
| | | Parry = 5,
|
| | | /** 连击 */
|
| | | DoubleHit=6,
|
| | | DoubleHit = 6,
|
| | | /** 暴击 */
|
| | | SuperHit=7,
|
| | | SuperHit = 7,
|
| | | /** 会心一击 */
|
| | | LuckyHit=8,
|
| | | LuckyHit = 8,
|
| | | /** 闪避 */
|
| | | Miss=9,
|
| | | Miss = 9,
|
| | | /** 免疫 */
|
| | | Immune=10,
|
| | | Immune = 10,
|
| | | /** 压制 */
|
| | | Suppress=11,
|
| | | Suppress = 11,
|
| | | /**斩杀**/
|
| | | ZhanSha=12,
|
| | | ZhanSha = 12,
|
| | | /** 诛仙一击 */
|
| | | ZhuXianAtk=13,
|
| | | ZhuXianAtk = 13,
|
| | | /** 终极斩杀 */
|
| | | FinalKill=14,
|
| | | FinalKill = 14,
|
| | | /*致命一击*/
|
| | | DeadlyHit=15,
|
| | | ThumpHit=16,// 重击
|
| | | DeadlyHit = 15,
|
| | | ThumpHit = 16,// 重击
|
| | | Yinji = 16,// 印记
|
| | | Burning = 17,// 灼烧
|
| | | }
|
| | |
| | | |
| | | { |
| | | public event Action secondEvent; |
| | | public event Action fiveSecondEvent; |
| | | public event Action minuteEvent; |
| | | public event Action fiveMinuteEvent; |
| | | public event Action tenMinuteEvent; |
| | |
| | | public event Action halfMinuteEvent;
|
| | |
|
| | | int secondBuf = -1;
|
| | | int fiveSecondBuf = -1;
|
| | | int minuteBuf = -1;
|
| | | int fiveMinuteBuf = -1;
|
| | | int tenMinuteBuf = -1;
|
| | |
| | | secondBuf = second;
|
| | | }
|
| | |
|
| | |
|
| | | var fiveSecond = second / 5;
|
| | | if (fiveSecondBuf != fiveSecond)
|
| | | {
|
| | | try
|
| | | {
|
| | | if (fiveSecondEvent != null)
|
| | | {
|
| | | fiveSecondEvent();
|
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | Debug.LogException(ex);
|
| | | }
|
| | | finally
|
| | | {
|
| | | fiveSecondBuf = fiveSecond;
|
| | | }
|
| | | }
|
| | |
|
| | | var minute = DateTime.Now.Minute;
|
| | | if (minuteBuf != minute)
|
| | | {
|