Attack Boon Changes
This commit is contained in:
@@ -15,13 +15,14 @@ namespace ProjectM.Simulation
|
||||
static class KnockbackUtil
|
||||
{
|
||||
public static void Stamp(ref ComponentLookup<KnockbackState> lookup, in ComponentLookup<BossState> bossLookup,
|
||||
Entity target, float3 sourcePos, float3 targetPos, float2 faceFallback, float speed, uint untilTick)
|
||||
Entity target, float3 sourcePos, float3 targetPos, float2 faceFallback, float speed, uint untilTick, bool pull = false)
|
||||
{
|
||||
if (!lookup.HasComponent(target) || bossLookup.HasComponent(target))
|
||||
return;
|
||||
|
||||
float3 delta = targetPos - sourcePos;
|
||||
float2 dir = math.lengthsq(delta.xz) > 1e-6f ? math.normalize(delta.xz) : faceFallback;
|
||||
if (pull) dir = -dir; // Phase 1.7 Gravity Pull: drag the target TOWARD the attacker
|
||||
lookup[target] = new KnockbackState { Dir = dir, Speed = speed, UntilTick = untilTick };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user