Merge branch 'master' into HazyRegion_1
| | |
| | | |
| | | if (_npcConfig.NPCType == (int)E_NpcType.PersonalEnemy) |
| | | { |
| | | PersonalEnemy.Cache(vNetData); |
| | | PersonalEnemy.Bind(vNetData); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | public class PersonalEnemy |
| | | { |
| | | public struct BindInfo |
| | | { |
| | | public uint npcID; |
| | | public Vector3 pos; |
| | | public E_ActorGroup g; |
| | | } |
| | | |
| | | public H0408_tagPlayerSummonNPCAppear data; |
| | | public uint bindClientNpcSID = 0; |
| | | |
| | |
| | | public static Dictionary<uint, uint> m_SBindCDict = new Dictionary<uint, uint>(); |
| | | |
| | | private static List<PersonalEnemy> m_UnUsed = new List<PersonalEnemy>(); |
| | | |
| | | private static Dictionary<uint, List<BindInfo>> BindInfoDict = new Dictionary<uint, List<BindInfo>>(); |
| | | |
| | | public static void UnInit() |
| | | { |
| | |
| | | return 0; |
| | | } |
| | | |
| | | public static PersonalEnemy Cache(H0408_tagPlayerSummonNPCAppear h0406) |
| | | public static void Create(uint npcID, E_ActorGroup group, Vector3 position) |
| | | { |
| | | var _pm = new PersonalEnemy(); |
| | | _pm.data = h0406; |
| | | m_Map[h0406.ObjID] = _pm; |
| | | m_UnUsed.Add(_pm); |
| | | return _pm; |
| | | } |
| | | var _bindInfo = new BindInfo |
| | | { |
| | | npcID = npcID, |
| | | g = group, |
| | | pos = position |
| | | }; |
| | | |
| | | public static void Bind(GA_NpcClientFightNorm npc) |
| | | { |
| | | if (!BindInfoDict.ContainsKey(npcID)) |
| | | { |
| | | BindInfoDict.Add(npcID, new List<BindInfo>()); |
| | | } |
| | | |
| | | BindInfoDict[npcID].Add(_bindInfo); |
| | | |
| | | var _package = new CB40C_tagCMSummonPriWoodPile(); |
| | | _package.NPCID = (uint)npc.NpcConfig.NPCID; |
| | | _package.NPCID = npcID; |
| | | _package.Count = 1; |
| | | GameNetSystem.Instance.SendInfo(_package); |
| | | |
| | | SnxxzGame.Instance.StartCoroutine(_Bind(npc)); |
| | | } |
| | | |
| | | private static IEnumerator _Bind(GA_NpcClientFightNorm npc) |
| | | public static void Bind(H0408_tagPlayerSummonNPCAppear h0408) |
| | | { |
| | | #if UNITY_EDITOR |
| | | Debug.LogFormat("开始执行客户端召唤怪: {0}", npc.ServerInstID); |
| | | #endif |
| | | PersonalEnemy _pm = null; |
| | | while (true) |
| | | if (!BindInfoDict.ContainsKey(h0408.NPCID)) |
| | | { |
| | | for (int i = 0; i < m_UnUsed.Count; ++i) |
| | | { |
| | | if (m_UnUsed[i].data.NPCID == npc.NpcConfig.NPCID) |
| | | { |
| | | _pm = m_UnUsed[i]; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (_pm != null) |
| | | { |
| | | m_UnUsed.Remove(_pm); |
| | | _pm.bindClientNpcSID = npc.ServerInstID; |
| | | m_CBinSdDict[npc.ServerInstID] = _pm.data.ObjID; |
| | | m_SBindCDict[_pm.data.ObjID] = npc.ServerInstID; |
| | | npc.ActorInfo.LV = _pm.data.LV; |
| | | npc.RequestName(); |
| | | npc.ActorInfo.ResetHp((int)_pm.data.HP, (short)_pm.data.HPEx, (int)_pm.data.MaxHP, (short)_pm.data.MaxHPEx); |
| | | #if UNITY_EDITOR |
| | | Debug.LogFormat("找到了可绑定的专属敌人: {0}", _pm.data.ObjID); |
| | | #endif |
| | | yield break; |
| | | } |
| | | |
| | | yield return null; |
| | | return; |
| | | } |
| | | |
| | | if (BindInfoDict[h0408.NPCID].Count == 0) |
| | | { |
| | | BindInfoDict.Remove(h0408.NPCID); |
| | | return; |
| | | } |
| | | |
| | | var _bindInfo = BindInfoDict[h0408.NPCID][0]; |
| | | var _config = NPCConfig.Get((int)h0408.NPCID); |
| | | GActorNpcFight _npc = null; |
| | | if (_config.IsBoss != (int)E_MonsterType.Normal |
| | | && _config.IsBoss != (int)E_MonsterType.Elite) |
| | | { |
| | | _npc = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightBoss>(_bindInfo.npcID, _bindInfo.g); |
| | | } |
| | | else |
| | | { |
| | | _npc = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightNorm>(_bindInfo.npcID, _bindInfo.g); |
| | | } |
| | | |
| | | if (_npc != null) |
| | | { |
| | | var _vaildPos = _bindInfo.pos; |
| | | GActor.TryGetValidPos(_bindInfo.pos, ref _vaildPos); |
| | | _npc.BornPos = _npc.Pos = _vaildPos; |
| | | m_CBinSdDict[_npc.ServerInstID] = h0408.ObjID; |
| | | m_SBindCDict[h0408.ObjID] = _npc.ServerInstID; |
| | | } |
| | | |
| | | BindInfoDict[h0408.NPCID].RemoveAt(0); |
| | | } |
| | | |
| | | } |
| | |
| | | onEnd = onComplete; |
| | | isSkiped = false; |
| | | |
| | | var uiroot = WindowCenter.Instance.uiRoot; |
| | | uiroot.EnableCanvas(false, uiroot.baseCanvas, |
| | | uiroot.lifeBarCanvas, |
| | | uiroot.nameCanvas, |
| | | uiroot.normalCanvas, |
| | | uiroot.modalCanvas, |
| | | uiroot.tipsCanvas, |
| | | uiroot.systemCanvas, |
| | | uiroot.recycleBin, |
| | | uiroot.fightCanvasGroup.damageNumGroups[0].parent); |
| | | if (Application.isEditor) |
| | | { |
| | | var uiroot = WindowCenter.Instance.uiRoot; |
| | | uiroot.EnableCanvas(false, uiroot.baseCanvas, |
| | | uiroot.lifeBarCanvas, |
| | | uiroot.nameCanvas, |
| | | uiroot.normalCanvas, |
| | | uiroot.modalCanvas, |
| | | uiroot.tipsCanvas, |
| | | uiroot.systemCanvas, |
| | | uiroot.recycleBin, |
| | | uiroot.fightCanvasGroup.damageNumGroups[0].parent); |
| | | |
| | | WindowCenter.Instance.Open<CreateRoleMovieSkipWin>(); |
| | | WindowCenter.Instance.Open<CreateRoleMovieSkipWin>(); |
| | | } |
| | | else |
| | | { |
| | | CameraManager.uiCamera.enabled = false; |
| | | } |
| | | |
| | | PlayMovie(); |
| | | } |
| | | |
| | |
| | | |
| | | static void OnStop() |
| | | { |
| | | var uiroot = WindowCenter.Instance.uiRoot; |
| | | uiroot.EnableCanvas(true, uiroot.baseCanvas, |
| | | uiroot.lifeBarCanvas, |
| | | uiroot.nameCanvas, |
| | | uiroot.normalCanvas, |
| | | uiroot.modalCanvas, |
| | | uiroot.tipsCanvas, |
| | | uiroot.systemCanvas, |
| | | uiroot.recycleBin, |
| | | uiroot.fightCanvasGroup.damageNumGroups[0].parent); |
| | | if (Application.isEditor) |
| | | { |
| | | var uiroot = WindowCenter.Instance.uiRoot; |
| | | uiroot.EnableCanvas(true, uiroot.baseCanvas, |
| | | uiroot.lifeBarCanvas, |
| | | uiroot.nameCanvas, |
| | | uiroot.normalCanvas, |
| | | uiroot.modalCanvas, |
| | | uiroot.tipsCanvas, |
| | | uiroot.systemCanvas, |
| | | uiroot.recycleBin, |
| | | uiroot.fightCanvasGroup.damageNumGroups[0].parent); |
| | | |
| | | WindowCenter.Instance.Close<CreateRoleMovieSkipWin>(); |
| | | WindowCenter.Instance.Close<CreateRoleMovieSkipWin>(); |
| | | } |
| | | else |
| | | { |
| | | CameraManager.uiCamera.enabled = false; |
| | | } |
| | | |
| | | var sendInfo = new CA108_tagCMRefreshMainServerRole(); |
| | | GameNetSystem.Instance.SendInfo(sendInfo); |
| | | if (onEnd != null) |
| | |
| | | public const int DEMONJAR_MAPID = 52010;
|
| | | public const int DEMONJAR_REDPOINTID = 77001;
|
| | |
|
| | | public Redpoint redpoint = new Redpoint(FindPreciousModel.LOOTPRECIOUs_REDPOINTID, DEMONJAR_REDPOINTID);
|
| | | public Redpoint redpoint = new Redpoint(FindPreciousModel.FINDPRECIOUS_REDPOINTID, DEMONJAR_REDPOINTID);
|
| | |
|
| | | public bool oldDouble = false;
|
| | |
|
| | |
| | |
|
| | | public class ExpertSkillActiveRemindWin : Window
|
| | | {
|
| | | [SerializeField] Text m_Reiki;
|
| | | [SerializeField] Text m_Remind;
|
| | | [SerializeField] Button m_GotoReiki;
|
| | | [SerializeField] Button m_Confirm;
|
| | | [SerializeField] Button m_Cancel;
|
| | | [SerializeField] Button m_GetPath;
|
| | | [SerializeField] Button m_Close;
|
| | |
|
| | | public static int skillId = 0;
|
| | |
| | | protected override void AddListeners()
|
| | | {
|
| | | m_GotoReiki.AddListener(GotoReiki);
|
| | | m_Confirm.AddListener(Confirm);
|
| | | m_Cancel.AddListener(CloseClick);
|
| | | m_GetPath.AddListener(GetPath);
|
| | | m_Close.AddListener(CloseClick);
|
| | | }
|
| | |
|
| | |
| | | var requireProperty = skillConfig.RequireProperty();
|
| | | var requireValue = skillConfig.RequirePropertyValue();
|
| | | var propertyConfig = PlayerPropertyConfig.Get(requireProperty);
|
| | | m_Remind.text = Language.Get("ExpertSkillActiveRemind", propertyConfig.Name, requireValue);
|
| | |
|
| | | var point = requireValue - reikiRootModel.GetReikiRootPoint(requireProperty);
|
| | | if (reikiRootModel.freePoint >= point)
|
| | | if (reikiRootModel.freePoint + reikiRootModel.GetReikiRootPoint(requireProperty) >= requireValue)
|
| | | {
|
| | | m_Reiki.text = StringUtility.Contact(propertyConfig.Name, ":", requireValue);
|
| | | m_Reiki.color = UIHelper.GetUIColor(TextColType.Green, true);
|
| | | m_GotoReiki.gameObject.SetActive(false);
|
| | | m_Confirm.gameObject.SetActive(true);
|
| | | m_Cancel.gameObject.SetActive(true);
|
| | | m_Remind.gameObject.SetActive(true);
|
| | | m_GotoReiki.gameObject.SetActive(true);
|
| | | m_GetPath.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Reiki.text = StringUtility.Contact(propertyConfig.Name, ":", requireValue
|
| | | , Language.Get("ExpertSkillActiveRemind", point));
|
| | | m_Reiki.color = UIHelper.GetUIColor(TextColType.Red, true);
|
| | | m_GotoReiki.gameObject.SetActive(true);
|
| | | m_Confirm.gameObject.SetActive(false);
|
| | | m_Cancel.gameObject.SetActive(false);
|
| | | m_Remind.gameObject.SetActive(false);
|
| | | m_GotoReiki.gameObject.SetActive(false);
|
| | | m_GetPath.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void Confirm()
|
| | | private void GetPath()
|
| | | {
|
| | | TreasurePotential expert;
|
| | | if (model.TryGetPotential(skillId, out expert))
|
| | | {
|
| | | var level = 0;
|
| | | model.TryGetExpertActiveLevel(skillId, out level);
|
| | | var skillConfig = SkillConfig.Get(skillId + level);
|
| | | var requireProperty = skillConfig.RequireProperty();
|
| | | var requireValue = skillConfig.RequirePropertyValue();
|
| | | var propertyConfig = PlayerPropertyConfig.Get(requireProperty);
|
| | | var point = requireValue - reikiRootModel.GetReikiRootPoint(requireProperty);
|
| | |
|
| | | if (reikiRootModel.freePoint >= point)
|
| | | {
|
| | | model.autoActiveSkillId = skillId;
|
| | | reikiRootModel.SendAddPoint(new byte[1] { (byte)requireProperty }, new ushort[1] { (ushort)point });
|
| | | }
|
| | | }
|
| | |
|
| | | CloseImmediately();
|
| | | RealmRecommandEquipGetWayWin.equipGetWays.Clear();
|
| | | RealmRecommandEquipGetWayWin.equipGetWays.AddRange(reikiRootModel.reikiRootGetWays);
|
| | | WindowCenter.Instance.Open<RealmRecommandEquipGetWayWin>();
|
| | | }
|
| | |
|
| | | private void GotoReiki()
|
| | |
| | | bool m_OpenDetail = false;
|
| | |
|
| | | int m_SelectExpert = 0;
|
| | | public int selectExpert
|
| | | int selectExpert
|
| | | {
|
| | | get { return m_SelectExpert; }
|
| | | set
|
| | |
| | |
|
| | | public bool selectActivePriority { get; set; }
|
| | |
|
| | | public int autoActiveSkillId { get; set; }
|
| | |
|
| | | public readonly Redpoint redpoint = new Redpoint(103, 10304);
|
| | | public const int REDPOINTID_BASE = 10304000;
|
| | | public static int redpointIndex = 100;
|
| | |
| | | m_ExpertSkills.Clear();
|
| | | m_ExpertActiveLevels.Clear();
|
| | | serverInited = false;
|
| | | autoActiveSkillId = 0;
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (serverInited)
|
| | | {
|
| | | var error = 0;
|
| | | if (WindowCenter.Instance.IsOpen<ExpertSkillSelectWin>())
|
| | | {
|
| | | var window = WindowCenter.Instance.Get<ExpertSkillSelectWin>();
|
| | | if (window.selectExpert == autoActiveSkillId
|
| | | && SatisfyActiveExpert(autoActiveSkillId, out error))
|
| | | {
|
| | | var pak = new CA516_tagCMSelectSkillElement();
|
| | | pak.SkillTypeID = (uint)autoActiveSkillId;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | autoActiveSkillId = 0;
|
| | | }
|
| | | else if (dataType == PlayerDataType.LV)
|
| | | {
|
| | |
| | | _triggerID = EditorGUILayout.IntField("NPCID", _triggerID);
|
| | | if (GUILayout.Button("创建PVP敌方"))
|
| | | {
|
| | | var _npc = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightBoss>((uint)_triggerID, E_ActorGroup.Enemy);
|
| | | _npc.BornPos = _npc.Pos = PlayerDatas.Instance.hero.Pos;
|
| | | PersonalEnemy.Bind(_npc);
|
| | | PersonalEnemy.Create((uint)_triggerID, E_ActorGroup.Enemy, PlayerDatas.Instance.hero.Pos);
|
| | |
|
| | | // BossShowModel.Instance.Start(PlayerDatas.Instance.baseData.MapID, 10103001);
|
| | | // ClientDropItemUtility.Instance.Drop(PlayerDatas.Instance.hero.Pos,
|