引入属性、伤害管线
This commit is contained in:
+15
-8
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user