引入属性、伤害管线

This commit is contained in:
2026-09-18 21:43:22 +08:00
parent 92e1ea0d55
commit ba25ec1926
108 changed files with 2920 additions and 720 deletions
@@ -1,3 +1,4 @@
using SepCore.Battle;
using SepCore.Components;
using SepCore.Debugger;
using SepCore.CustomUtility;
@@ -143,16 +144,22 @@ namespace SepCore.Simulation
return false;
}
damage = AIUtility.CalcDamageHP(sourceImpact.AttackBase, sourceImpact.AttackStat,
targetImpact.DefenseStat,
targetImpact.DodgeStat);
shouldDispatchPresentation = true;
if (damage <= 0)
DamageContext context = new DamageContext
{
return true;
}
BaseDamage = sourceImpact.AttackBase,
DamageScalingStat = sourceImpact.DamageType.ToScalingStat(),
ScalingRatio = sourceImpact.ScalingRatio,
BaseCritChance = sourceImpact.BaseCritChance,
CritMultiplier = sourceImpact.CritMultiplier,
AttackerPipeline = sourceImpact.AttributeProvider,
DefenderPipeline = targetImpact.AttributeProvider
};
target.ApplyDamage(attacker ?? sourceEntity ?? ownerEntity, damage);
DamageResult result = DamagePipeline.Calculate(in context);
damage = result.Damage;
shouldDispatchPresentation = true;
target.ApplyDamage(attacker ?? sourceEntity ?? ownerEntity, in result, hitPosition);
return true;
}
@@ -18,6 +18,7 @@ namespace SepCore.Simulation
[SerializeField]
private bool _projectileHitMarkerEnabled = true;
#pragma warning disable CS0414
[Tooltip("命中标记尺寸。")][SerializeField] private float _projectileHitMarkerSize = 0.2f;
[Tooltip("命中标记在目标上的高度偏移。")]
@@ -27,6 +28,7 @@ namespace SepCore.Simulation
[Tooltip("命中标记持续时间。")]
[SerializeField]
private float _projectileHitMarkerDuration = 0.15f;
#pragma warning restore CS0414
[Tooltip("命中标记颜色。")][SerializeField] private Color _projectileHitMarkerColor = new(1f, 0f, 0f, 0.95f);