少年修仙传客户端代码仓库
client_Hale
2018-08-21 3d0f6c0d5faa3a07ced3382e1151f2b79ea5a9e6
update 角色被拉
7个文件已修改
86 ■■■■■ 已修改文件
Core/NetworkPackage/DTCFile/ServerPack/H06_PlayerVsNPC/DTC0614_tagUseSkillPos.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB401_tagMCSkillHurtList.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Actor/Skill/AttackHandler.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Actor/Skill/SoBodyControl.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Actor/State/SMB/SMB_Base.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GActorFight.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Utility/MathUtility.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/H06_PlayerVsNPC/DTC0614_tagUseSkillPos.cs
@@ -282,7 +282,7 @@
                                if (AttackHandler.CheckPull(_attacker, _cTarget, 0))
                                {
                                    _cTarget.StartBeatBack(0, MathUtility.ForwardXZ(_cTarget.Pos, _attacker.Pos));
                                    _cTarget.StartBeatBack(_attacker.ServerInstID, 0, MathUtility.ForwardXZ(_cTarget.Pos, _attacker.Pos));
                                }
                            }
@@ -622,7 +622,7 @@
                    if (AttackHandler.CheckPull(_attacker, _cTarget, 0))
                    {
                        _cTarget.StartBeatBack(0, MathUtility.ForwardXZ(_cTarget.Pos, _attacker.Pos));
                        _cTarget.StartBeatBack(_attacker.ServerInstID, 0, MathUtility.ForwardXZ(_cTarget.Pos, _attacker.Pos));
                    }
                    if (_sTarget.HurtHP != 0)
Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB401_tagMCSkillHurtList.cs
@@ -217,7 +217,7 @@
                    if (AttackHandler.CheckPull(_attacker, _cTarget, 0))
                    {
                        _cTarget.StartBeatBack(0, MathUtility.ForwardXZ(_cTarget.Pos, _attacker.Pos));
                        _cTarget.StartBeatBack(_attacker.ServerInstID, 0, MathUtility.ForwardXZ(_cTarget.Pos, _attacker.Pos));
                    }
                    if (_sTarget.HurtHP != 0)
Fight/Actor/Skill/AttackHandler.cs
@@ -122,7 +122,7 @@
            if (CheckPull(attacker, target, soConfig.bodyControlId))
            {
                target.StartBeatBack(soConfig.bodyControlId, MathUtility.ForwardXZ(target.Pos, attacker.Pos));
                target.StartBeatBack(attacker.ServerInstID, soConfig.bodyControlId, MathUtility.ForwardXZ(target.Pos, attacker.Pos));
            }
        }
Fight/Actor/Skill/SoBodyControl.cs
@@ -10,4 +10,11 @@
    [Tooltip("是否对玩家类型生效")]
    public bool useForPlayer = false;
    [Tooltip("是推还是拉, 打钩是推,不打钩是拉")]
    public bool pushOrPull = true;
    [Tooltip(@"限制位置, 以释放者为中心的偏移
               可以为负值")]
    public float limitDistance = 100;
}
Fight/Actor/State/SMB/SMB_Base.cs
@@ -104,10 +104,20 @@
        SoBodyControl _bodyControl = ScriptableObjectLoader.LoadSoBodyControl(bodyControlId);
        if (!_bodyControl.pushOrPull)
        {
            direction = -direction;
        }
        float _distance = _bodyControl.curve.keys[_bodyControl.curve.length - 1].time;
        Vector3 _checkPos = target.Pos;
        Vector3 _pullPosition = _checkPos + direction * _distance;
        if (!_bodyControl.pushOrPull)
        {
            _pullPosition = attacker.Pos + MathUtility.ForwardXZ(target.Pos, attacker.Pos) * 0.5f;
        }
        _checkPos.y = 0;
        _pullPosition.y = 0;
@@ -126,7 +136,7 @@
                //Debug.Log("--------------------------- 8");
                if (_player.MovingState != E_MovingState.Ride)
                {
                   // Debug.LogFormat("{0} attack {1} ==================== 9", attacker.GetType().ToString(), target.GetType().ToString());
                    // Debug.LogFormat("{0} attack {1} ==================== 9", attacker.GetType().ToString(), target.GetType().ToString());
                    CB402_tagCMNPCBeatBack _beatBack = new CB402_tagCMNPCBeatBack();
                    _beatBack.ObjType = (byte)GameObjType.gotPlayer;
                    _beatBack.Count = 1;
Fight/GameActor/GActorFight.cs
@@ -181,14 +181,26 @@
    private float m_BeatStartTime;
    protected bool m_Beating;
    private Vector3 m_BeatDirection;
    private bool m_PushOrPull;
    private uint m_AttackerSID;
    private float m_LimitDistance;
    public void StartBeatBack(int configID, Vector3 direction)
    public void StartBeatBack(uint attacker, int configID, Vector3 direction)
    {
        SoBodyControl _config = ScriptableObjectLoader.LoadSoBodyControl(configID);
        if (_config == null || _config.curve == null)
        {
            return;
        }
        m_AttackerSID = attacker;
        m_LimitDistance = _config.limitDistance;
        m_PushOrPull = _config.pushOrPull;
        if (!m_PushOrPull)
        {
            direction = -direction;
        }
        m_BeatDirection = direction;
@@ -237,6 +249,36 @@
        Vector3 _pos = m_StartBeatPos + _h + _v;
        Vector3 _end = _pos;
        GActor _attacker = GAMgr.Instance.GetBySID(m_AttackerSID);
        float _dis = MathUtility.DistanceSqrtXZ(_attacker.Pos, _end);
        if (m_PushOrPull)
        {
            if (MathUtility.DistanceSqrtXZ(_attacker.Pos, _end) > m_LimitDistance * m_LimitDistance)
            {
                _end = _attacker.Pos + m_BeatDirection * m_LimitDistance;
            }
        }
        else
        {
            Vector3 _limPos = _attacker.Pos;
            _limPos.y = 0;
            _limPos = _limPos - m_BeatDirection * m_LimitDistance;
            Vector3 _dir2 = (_end - _limPos).normalized;
            bool _isOp = MathUtility.OppositeDir(-m_BeatDirection, _dir2);
            bool _isLimDis = MathUtility.DistanceSqrtXZ(_attacker.Pos, _end) < m_LimitDistance * m_LimitDistance;
            if (_isOp
             || _isLimDis)
            {
                _end = _attacker.Pos - m_BeatDirection * m_LimitDistance;
                needSyncGroundHeight = true;
                m_Beating = false;
            }
        }
        Vector3 _position = m_StartBeatPos;
        _position.y = 0;
        _end.y = 0;
Utility/MathUtility.cs
@@ -154,6 +154,21 @@
        return (target - self).normalized;
    }
    public static bool IsSameDir(Vector3 vec1, Vector3 vec2)
    {
        vec1.y = 0;
        vec2.y = 0;
        return Vector3.Dot(vec1, vec2) > 0;
    }
    public static bool OppositeDir(Vector3 vec1, Vector3 vec2)
    {
        vec1.y = 0;
        vec2.y = 0;
        return Vector3.Dot(vec1, vec2) < 0;
    }
    public static int Power(int a, int e)
    {
        int value = 1;