using Content.Shared.Actions;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Magic.Events;
public sealed class InstantSpawnSpellEvent : InstantActionEvent
{
///
/// What entity should be spawned.
///
[DataField("prototype", required: true, customTypeSerializer: typeof(PrototypeIdSerializer))]
public string Prototype = default!;
[ViewVariables, DataField("preventCollide")]
public bool PreventCollideWithCaster = true;
///
/// Gets the targeted spawn positons; may lead to multiple entities being spawned.
///
[DataField("posData")] public MagicSpawnData Pos = new TargetCasterPos();
}
[ImplicitDataDefinitionForInheritors]
public abstract class MagicSpawnData
{
}
///
/// Spawns 1 at the caster's feet.
///
public sealed class TargetCasterPos : MagicSpawnData {}
///
/// Targets the 3 tiles in front of the caster.
///
public sealed class TargetInFront : MagicSpawnData
{
[DataField("width")]
public int Width = 3;
}