Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | using System;
|
| | | using Snxxz.UI;
|
| | |
|
| | | //01 09 服务器准备就绪#tagServerPrepareOK
|
| | | //01 09 ������������#tagServerPrepareOK
|
| | |
|
| | |
|
| | |
|
| | | public class DTC0109_tagServerPrepareOK : DtcBasic
|
| | | {
|
| | | // 在登陆, 切图后, 服务端准备完成后触发
|
| | | public static UnityEngine.Events.UnityAction OnServerPrepareOk;
|
| | |
|
| | | LoginModel loginModel { get { return ModelCenter.Instance.GetModel<LoginModel>(); } }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | StageLoadTimeOutCatcher.RecordProtocol(vNetData.socketType, "0109", DateTime.Now);
|
| | | //修改技能快捷设置发包顺序
|
| | | //�ļ��ܿ�����÷���˳��
|
| | | PlayerDatas.Instance.skill.CheckQuickSet();
|
| | | StageLoad.Instance.UpdateServerFlag(vNetData.socketType, true);
|
| | |
|
| | | if (OnServerPrepareOk != null)
|
| | | {
|
| | | OnServerPrepareOk();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | bool _isMiss = false;
|
| | | bool _isCrit = false;
|
| | | bool _isZhongJi = false;
|
| | | bool _isLucky = false;
|
| | | bool _isZhuxianHit = false;
|
| | |
|
| | |
| | | _aFinalHurtPer = PlayerDatas.Instance.extersion.FunalHurtPer;
|
| | | _aDamagePVE = PlayerDatas.Instance.extersion.DamagePVE;
|
| | | _aRealmLv = PlayerDatas.Instance.baseData.realmLevel;
|
| | |
|
| | | if (attacker.ServerInstID == PlayerDatas.Instance.PlayerId)
|
| | | {
|
| | | _isZhongJi = IsZhongji(target);
|
| | | }
|
| | |
|
| | | }
|
| | | else if (attacker.ActorType == GameObjType.gotNPC)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | _isMiss = IsMiss(_hitRate, _missRate);
|
| | | _isCrit = IsCrit(_aSuperHitRate);
|
| | | _isLucky = IsLucky(_aLuckyHitRate);
|
| | | _isZhuxianHit = IsZhuXianHit(_aZhuXianHitRate);
|
| | |
|
| | | if (_isZhongJi)
|
| | | {
|
| | | _isCrit = true;
|
| | | }
|
| | | // 4014 必定触发 按位配置 1为必命中,2为必暴击,4为必会心一击
|
| | | if (skill.skillInfo.effectValue.TryGetValue(4014, out _effectValue))
|
| | | {
|
| | |
| | |
|
| | | _aLuckyHit = _isLucky ? _luckyHit : 0;
|
| | | _aSuperHit = _isCrit ? _superHit : 0;
|
| | |
|
| | | if (_isZhongJi)
|
| | | {
|
| | | _aSuperHit *= 2;
|
| | | #if UNITY_EDITOR
|
| | | Debug.LogFormat("技能: {0} 计算伤害的时候发生重击, 暴击伤害翻倍: {1}", skill.id, _aSuperHit);
|
| | | #endif
|
| | | }
|
| | |
|
| | | // 4051 当发生会心伤害时, 增加会心一击伤害
|
| | | if (_isLucky
|
| | |
| | | {
|
| | | attackType = (byte)HurtAttackType.ZhuXianAtk;
|
| | | }
|
| | | else if (_isLucky
|
| | | #if UNITY_EDITOR
|
| | | || RuntimeLogUtility.s_ForceLuckHit
|
| | | #endif
|
| | | )
|
| | | else if (_isZhongJi)
|
| | | {
|
| | | attackType = (byte)HurtAttackType.LuckyHit;
|
| | | attackType = (byte)HurtAttackType.ThumpHit;
|
| | | }
|
| | | else if (_isCrit
|
| | | #if UNITY_EDITOR
|
| | |
| | | )
|
| | | {
|
| | | attackType = (byte)HurtAttackType.SuperHit;
|
| | | }
|
| | | else if (_isLucky
|
| | | #if UNITY_EDITOR
|
| | | || RuntimeLogUtility.s_ForceLuckHit
|
| | | #endif
|
| | | )
|
| | | {
|
| | | attackType = (byte)HurtAttackType.LuckyHit;
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | return hit * 1f / (hit + miss) - Random.Range(0f, 1f) < 0;
|
| | | }
|
| | |
|
| | | private static bool IsZhongji(GActorFight target)
|
| | | {
|
| | | var _hero = PlayerDatas.Instance.hero;
|
| | | if (_hero == null
|
| | | || target == null)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | int _rate = 0;
|
| | | var _dict = StatusMgr.Instance.ZhongJiDict;
|
| | | foreach (var _info in _dict.Values)
|
| | | {
|
| | | if (_info.onlyFirstTarget)
|
| | | {
|
| | | if (_hero.SelectTarget.ServerInstID == target.ServerInstID)
|
| | | {
|
| | | _rate += _info.rate;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | _rate += _info.rate;
|
| | | }
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | var _random = Random.Range(0, 10000);
|
| | | var _result = _random < _rate;
|
| | | // Debug.LogFormat("攻击目标: {3}, 重击概率为: {0}, 随机为: {1}, 是否可以重击: {2}", _rate, _random, _result, target.ServerInstID);
|
| | | return _result;
|
| | | #else
|
| | | return Random.Range(0, 10000) < _rate;
|
| | | #endif
|
| | | }
|
| | |
|
| | | private static bool IsCrit(int superHitRate)
|
| | | {
|
| | | return Random.Range(0, 10000) < superHitRate;
|
| | |
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | using UnityEngine;
|
| | | using UnityEngine.Events;
|
| | |
| | | [XLua.LuaCallCSharp]
|
| | | public class StatusMgr : SingletonMonobehaviour<StatusMgr>
|
| | | {
|
| | | public struct ZhongJiInfo
|
| | | {
|
| | | public int rate;
|
| | | public bool onlyFirstTarget;
|
| | | }
|
| | |
|
| | | public static event UnityAction<int> OnGainStatus;
|
| | | public static event UnityAction<float> OnGainCantCastSkillStatus;
|
| | | public static event UnityAction OnReleaseCantCastSkillStatus;
|
| | | public static event UnityAction<int> onReceiveStatus;
|
| | |
|
| | | public Dictionary<int, ZhongJiInfo> ZhongJiDict = new Dictionary<int, ZhongJiInfo>();
|
| | |
|
| | | private Dictionary<uint, List<Status_Base>> m_StatusDict = null;
|
| | | private List<Status_Base> m_AllStatus = null;
|
| | |
| | | public int redNameBuffID;
|
| | | [HideInInspector]
|
| | | public int yellowNameBuffID;
|
| | | public int ZhongJiRate;
|
| | |
|
| | | public void Init()
|
| | | {
|
| | | DTC0109_tagServerPrepareOK.OnServerPrepareOk += OnServerPrepareOk;
|
| | |
|
| | | if (m_StatusDict == null)
|
| | | {
|
| | | m_StatusDict = new Dictionary<uint, List<Status_Base>>();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void OnServerPrepareOk()
|
| | | {
|
| | | ReleaseActor(PlayerDatas.Instance.baseData.PlayerID);
|
| | | ZhongJiDict.Clear();
|
| | | }
|
| | |
|
| | | public void Request(H0605_tagObjAddBuff h0605)
|
| | | {
|
| | | // 修改目标状态
|
| | |
| | | _actor.ActorInfo.status4012[(byte)_effectValue.value1] = _count;
|
| | | }
|
| | | }
|
| | |
|
| | | AddZjInfoIfExist(h0605.SkillID);
|
| | |
|
| | | Status_Base _status = Get(h0605.ObjID, h0605.SkillID);
|
| | |
|
| | |
| | | }
|
| | | _actor.ActorInfo.status4012[(byte)_effectValue.value1] = _count;
|
| | | }
|
| | | }
|
| | |
|
| | | if (ZhongJiDict.ContainsKey(h0606.SkillID))
|
| | | {
|
| | | ZhongJiDict.Remove(h0606.SkillID);
|
| | | }
|
| | |
|
| | | Status_Base _status = Get(h0606.ObjID, h0606.SkillID);
|
| | |
| | |
|
| | | private bool IsMockingBuff(int id)
|
| | | {
|
| | | SkillConfig _config = SkillConfig.Get(id);
|
| | | var _config = SkillConfig.Get(id);
|
| | |
|
| | | if (_config != null
|
| | | && ((_config.Effect1 == 4012 && _config.EffectValue11 == 6)
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | private void AddZjInfoIfExist(int id)
|
| | | {
|
| | | var _info = SkillHelper.Instance.Get(id);
|
| | | if (_info == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (_info.effectValue.ContainsKey(4526))
|
| | | {
|
| | | var _zjInfo = new ZhongJiInfo
|
| | | {
|
| | | rate = _info.effectValue[4526].value1,
|
| | | onlyFirstTarget = _info.effectValue[4526].value2 == 1
|
| | | };
|
| | |
|
| | | ZhongJiDict[id] = _zjInfo;
|
| | |
|
| | | // #if UNITY_EDITOR
|
| | | // Debug.LogFormat("收到一个增加重击概率的BUFF: {0}, 增加: {1}的概率", id, _zjInfo.rate);
|
| | | // #endif
|
| | | }
|
| | | }
|
| | |
|
| | | private bool IsPolymorch(int id)
|
| | | {
|
| | | SkillConfig _config = SkillConfig.Get(id);
|
| | |
| | | /** 终极斩杀 */
|
| | | FinalKill,
|
| | | /*致命一击*/
|
| | | DeadlyHit
|
| | | DeadlyHit,
|
| | | ThumpHit,// 重击
|
| | | }
|
| | |
|
| | | public enum DungeonTargetType
|
| | |
| | | private Vector2 _end;
|
| | | private Vector3 _start3;
|
| | | private Vector3 _end3;
|
| | | private int _triggerID = 8;
|
| | | private int _triggerID = 11204008;
|
| | | private int _clientNpcSID;
|
| | |
|
| | | public override void OnInspectorGUI()
|
| | | {
|
| | |
| | | {
|
| | | // ClientSceneManager.Instance.TriggerTest(_triggerID);
|
| | | // GA_NpcFunc.SetNpcFuncVisible(10104003, true);
|
| | | Vector3 ppp;
|
| | | if (ClientSceneManager.Instance.AAA(PlayerDatas.Instance.hero.Pos, new Vector3(6, 0, 39.5f), out ppp))
|
| | | {
|
| | | Debug.Log("最终....PPP: " + ppp);
|
| | | }
|
| | | }
|
| | | EditorGUILayout.EndHorizontal();
|
| | |
|
| | |
| | | {
|
| | | // Debug.Log(PathFinder.WalkAble(_start3, _end3));
|
| | | // MapTransferUtility.Instance.MoveToNPC(10904012);
|
| | | MapTransferUtility.Instance.MoveToLocalMapPosition(new Vector2(_end3.x, _end3.z));
|
| | | // MapTransferUtility.Instance.MoveToLocalMapPosition(new Vector2(_end3.x, _end3.z));
|
| | | MapTransferUtility.Instance.MoveToNPC(_triggerID);
|
| | | }
|
| | |
|
| | | EditorGUILayout.LabelField("Log存储路径", RuntimeLogUtility.s_LogPath);
|
| | |
| | | // AdventureStage.Instance.Exit();
|
| | | ClientSceneManager.Instance.ExitClientFightMode();
|
| | | }
|
| | | EditorGUILayout.BeginHorizontal();
|
| | | _clientNpcSID = EditorGUILayout.IntField("NPC SID", _clientNpcSID);
|
| | |
|
| | | if (GUILayout.Button("显示NPC信息"))
|
| | | {
|
| | | var _npc = GAMgr.Instance.GetBySID((uint)_clientNpcSID) as GActorNpcFight;
|
| | | if (_npc != null)
|
| | | {
|
| | | Debug.LogFormat("{0} => 血量: {1}/{2}, 攻击: {3}-{4}, 防御: {5}",
|
| | | _clientNpcSID,
|
| | | _npc.ActorInfo.RealHp,
|
| | | _npc.ActorInfo.RealMaxHp,
|
| | | _npc.NpcConfig.MinAtk,
|
| | | _npc.NpcConfig.MaxAtk,
|
| | | _npc.NpcConfig.Def);
|
| | | }
|
| | | }
|
| | | EditorGUILayout.EndHorizontal();
|
| | |
|
| | | _navChkPos = EditorGUILayout.Vector3Field("检测点", _navChkPos);
|
| | |
|