made explosion forge compliant
This commit is contained in:
@@ -6,7 +6,7 @@ using Godot;
|
||||
|
||||
namespace Movementtests.forge.abilities;
|
||||
|
||||
public record SimpleHitEffectData(Vector3 SourceLocation, Vector3 TargetLocation);
|
||||
public record SimpleHitEffectData(Vector3 SourceLocation, Vector3 TargetLocation, float Magnitude = 1);
|
||||
|
||||
public class SimpleHitBehavior(ForgeEffectData? damage) : IAbilityBehavior
|
||||
{
|
||||
@@ -16,9 +16,10 @@ public class SimpleHitBehavior(ForgeEffectData? damage) : IAbilityBehavior
|
||||
|
||||
var sourceLocation = (context.Source as Node3D)?.GlobalPosition ?? Vector3.Zero;
|
||||
var targetLocation = (context.Target as Node3D)?.GlobalPosition ?? Vector3.Zero;
|
||||
|
||||
|
||||
var magnitude = context.Magnitude == 0 ? 1 : context.Magnitude;
|
||||
var effect = new Effect(damage.GetEffectData(), new EffectOwnership(context.Owner, context.Owner));
|
||||
context.Target.EffectsManager.ApplyEffect(effect, new SimpleHitEffectData(sourceLocation, targetLocation));
|
||||
context.Target.EffectsManager.ApplyEffect(effect, new SimpleHitEffectData(sourceLocation, targetLocation, magnitude));
|
||||
|
||||
// context.InstanceHandle.End();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user