diff --git a/ProjectNLD/Assets/Code/Scripts/Gameplay/Buff/Impl/BuffChangeProp.cs b/ProjectNLD/Assets/Code/Scripts/Gameplay/Buff/Impl/BuffChangeProp.cs index de7889cd4b8..2db813034e1 100644 --- a/ProjectNLD/Assets/Code/Scripts/Gameplay/Buff/Impl/BuffChangeProp.cs +++ b/ProjectNLD/Assets/Code/Scripts/Gameplay/Buff/Impl/BuffChangeProp.cs @@ -34,7 +34,6 @@ namespace Gameplay.Buff { DebugUtil.Log("原始射击间隔:{0},射速加成:{1}", owner.fightData.baseShootCd, owner.fightData.p_shootCdScale); owner.fightData.shootCd = owner.fightData.baseShootCd * (1 + (1 / (1 + owner.fightData.p_shootCdScale) - 1)); - owner.fightData.firstShootTime = owner.fightData.p_firstShootTime * (1 + (1 / (1 + owner.fightData.p_shootCdScale) - 1)); DebugUtil.Log("新射击间隔:{0}", owner.fightData.shootCd); } diff --git a/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/Data/CharacterConfigData.cs b/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/Data/CharacterConfigData.cs index dcdff6a89a6..2266fca8bd3 100644 --- a/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/Data/CharacterConfigData.cs +++ b/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/Data/CharacterConfigData.cs @@ -20,9 +20,13 @@ namespace Gameplay.Character /// public float shootCD; /// - /// 首次攻击时间 + /// 首次攻击时间,百分比 /// - public float firstShootTime; + public float fireTimeProgress + { + get; + set; + } /// /// 最大子弹数量 /// diff --git a/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/Data/CharacterRuntimeData.cs b/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/Data/CharacterRuntimeData.cs index 34c822a0650..a879c31fca0 100644 --- a/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/Data/CharacterRuntimeData.cs +++ b/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/Data/CharacterRuntimeData.cs @@ -124,8 +124,7 @@ namespace Gameplay.Character owner.fightData.perShootBulletCount = configData.perShootCount; owner.fightData.criticalRate = configData.criticalRate; owner.fightData.criticalScale = configData.criticalScale; - owner.fightData.firstShootTime = configData.firstShootTime; - owner.fightData.p_firstShootTime = configData.firstShootTime; + owner.fightData.fireTimeProgress = configData.fireTimeProgress; owner.fightData.moraleAttack = configData.moraleAttack; owner.fightData.reloadTime = configData.reloadTime; owner.fightData.baseReloadTime = configData.reloadTime; diff --git a/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/State/DownState/DownStateMove.cs b/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/State/DownState/DownStateMove.cs index a2625d1e7d5..91dbbb0acfb 100644 --- a/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/State/DownState/DownStateMove.cs +++ b/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/State/DownState/DownStateMove.cs @@ -393,7 +393,7 @@ namespace Gameplay.Character owner.Log($"无有效路径: from:{from} to:{to}"); // isFinished = true; // nextState = EDownState.Idle; - + _DrawDebugLine(from, to); _HandleForNoWay(); } @@ -411,6 +411,15 @@ namespace Gameplay.Character } } + private void _DrawDebugLine(int from, int to) + { + #if UNITY_EDITOR + var fromPos = _map.TGSCellIndex2WorldPosition(from); + var toPos = _map.TGSCellIndex2WorldPosition(to); + Debug.DrawLine(fromPos, toPos, Color.red, 0.1f); + #endif + } + private bool _stopOnNoWay = true; private void _HandleForNoWay() diff --git a/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/State/UpState/UpStateLowShoot.cs b/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/State/UpState/UpStateLowShoot.cs index fb425987f76..3d44ca6df4c 100644 --- a/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/State/UpState/UpStateLowShoot.cs +++ b/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/State/UpState/UpStateLowShoot.cs @@ -19,7 +19,7 @@ namespace Gameplay.Character _shootCd = owner.fightData.shootCd; - _remainShootTime = owner.fightData.firstShootTime; + _remainShootTime = owner.fightData.fireTimeProgress * _shootCd; if (_remainShootTime > _shootCd) { DebugUtil.LogWarning("配置的开枪时间短于开枪CD,已自动重置,请检查配表"); diff --git a/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/State/UpState/UpStateNormalShoot.cs b/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/State/UpState/UpStateNormalShoot.cs index 9f9508c44ad..8cf3c95fb8e 100644 --- a/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/State/UpState/UpStateNormalShoot.cs +++ b/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/State/UpState/UpStateNormalShoot.cs @@ -18,7 +18,7 @@ namespace Gameplay.Character { base._OnEnter(exitState, param); _shootCd = owner.fightData.shootCd; - _remainShootTime = owner.fightData.firstShootTime; + _remainShootTime = owner.fightData.fireTimeProgress * _shootCd; if (_remainShootTime > _shootCd) { diff --git a/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/Utils/CharacterDataHelper.cs b/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/Utils/CharacterDataHelper.cs index e791d4529bd..41dcb5b45e6 100644 --- a/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/Utils/CharacterDataHelper.cs +++ b/ProjectNLD/Assets/Code/Scripts/Gameplay/Character/Utils/CharacterDataHelper.cs @@ -50,7 +50,7 @@ namespace Gameplay.Character.Utils configData.attack = Mathf.CeilToInt(monsterTConfig.Attack * monsterConfig.AttackFix * monsterLevelConfig.AttackLevelUpTemplate); var shootCd = 1f / monsterTConfig.ShootSpeed; configData.shootCD = shootCd; - configData.firstShootTime = monsterTConfig.FirstShootTime; + configData.fireTimeProgress = monsterTConfig.FirstShootTime; configData.maxBulletCount = monsterTConfig.ManagazinContain; configData.reloadTime = monsterTConfig.ChangeBulletTime; configData.defense = Mathf.CeilToInt(monsterTConfig.Defence * monsterConfig.DefenceFix * monsterLevelConfig.DefenceLevelUpTemplate); @@ -137,7 +137,7 @@ namespace Gameplay.Character.Utils configData.attack = levelAttack; var shootCd = 1f / characterData.ShootSpeed; configData.shootCD = shootCd; - configData.firstShootTime = characterData.FirstShootTime; + configData.fireTimeProgress = characterData.FirstShootTime; configData.maxBulletCount = characterData.ManagazinContain; configData.reloadTime = characterData.ChangeBulletTime; configData.defense = levelDefence; diff --git a/ProjectNLD/Assets/Code/Scripts/Gameplay/Unit/Data/UnitFightData.cs b/ProjectNLD/Assets/Code/Scripts/Gameplay/Unit/Data/UnitFightData.cs index 7ba3c5c49f9..c436bd35217 100644 --- a/ProjectNLD/Assets/Code/Scripts/Gameplay/Unit/Data/UnitFightData.cs +++ b/ProjectNLD/Assets/Code/Scripts/Gameplay/Unit/Data/UnitFightData.cs @@ -158,10 +158,9 @@ namespace Gameplay.Unit.Data public ObscuredInt moraleAttack; /// - /// 第一次开枪时间 + /// 开枪时间百分比 /// - public ObscuredFloat firstShootTime; - public ObscuredFloat p_firstShootTime; + public ObscuredFloat fireTimeProgress; /// /// 士气恢复缩放 @@ -307,8 +306,7 @@ namespace Gameplay.Unit.Data to.criticalRate = criticalRate; to.criticalScale = criticalScale; to.moraleAttack = moraleAttack; - to.firstShootTime = firstShootTime; - to.p_firstShootTime = p_firstShootTime; + to.fireTimeProgress = fireTimeProgress; to.moraleRecoverScale = moraleRecoverScale; to.reloadTime = reloadTime; to.baseReloadTime = baseReloadTime; diff --git a/ProjectNLD/Assets/Code/Scripts/Gameplay/Vehicle/Battery/BatteryStateShoot.cs b/ProjectNLD/Assets/Code/Scripts/Gameplay/Vehicle/Battery/BatteryStateShoot.cs index d6e284fc9dd..8b2d2f9fd0e 100644 --- a/ProjectNLD/Assets/Code/Scripts/Gameplay/Vehicle/Battery/BatteryStateShoot.cs +++ b/ProjectNLD/Assets/Code/Scripts/Gameplay/Vehicle/Battery/BatteryStateShoot.cs @@ -24,7 +24,7 @@ namespace Gameplay.Vehicle base._OnEnter(exitState, param); owner.remainShootTime = owner.owner.fightData.shootCd; - _shootTime = owner.owner.fightData.firstShootTime; + _shootTime = owner.owner.fightData.fireTimeProgress * owner.owner.fightData.shootCd; if (owner.rawAnim != null) { diff --git a/ProjectNLD/Assets/Code/Scripts/Gameplay/Vehicle/Data/VehicleRuntimeData.cs b/ProjectNLD/Assets/Code/Scripts/Gameplay/Vehicle/Data/VehicleRuntimeData.cs index 1e2c963cbf4..33cd7469dd6 100644 --- a/ProjectNLD/Assets/Code/Scripts/Gameplay/Vehicle/Data/VehicleRuntimeData.cs +++ b/ProjectNLD/Assets/Code/Scripts/Gameplay/Vehicle/Data/VehicleRuntimeData.cs @@ -33,8 +33,7 @@ namespace Gameplay.Vehicle.Data owner.fightData.perShootBulletCount = configData.perShootCount; owner.fightData.criticalRate = configData.criticalRate; owner.fightData.criticalScale = configData.criticalDamageScale; - owner.fightData.firstShootTime = configData.firstShootTime; - owner.fightData.p_firstShootTime = configData.firstShootTime; + owner.fightData.fireTimeProgress = configData.firstShootTime; owner.fightData.moraleAttack = configData.moraleAttack; owner.fightData.reloadTime = configData.reloadTime; owner.fightData.baseReloadTime = configData.reloadTime;