引入属性、伤害管线

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;
}