Files
crystall-punk-14/Content.Shared/_CP14/MagicSpell/Events/CP14DelayedActionEvents.cs
Ed 36d02fdf6e Magic spells code expansion (#692)
* split manacost in separate component

* stamina spells

* toggleable actions

* swap activeCasting on ActiveDoAfter

* remove dublication

* Update CP14SharedMagicSystem.ToggleableActions.cs

* EntityWoldTarget

* mana glove done

* fix spell scrolls interrupting

* fix cooldown problem

* clean up, edit stamina system
2025-01-04 21:35:59 +03:00

139 lines
3.4 KiB
C#

using Content.Shared.Actions;
using Content.Shared.DoAfter;
using Robust.Shared.Map;
using Robust.Shared.Serialization;
namespace Content.Shared._CP14.MagicSpell.Events;
public interface ICP14DelayedMagicEffect
{
public float Cooldown { get; }
public float CastDelay { get; }
public bool BreakOnMove { get; }
public bool BreakOnDamage { get; }
public bool Hidden{ get; }
public float EntityDistance { get; }
}
public sealed partial class CP14DelayedEntityWorldTargetActionEvent : EntityWorldTargetActionEvent,
ICP14DelayedMagicEffect
{
[DataField]
public float Cooldown { get; private set; } = 1f;
[DataField]
public float CastDelay { get; private set; } = 1f;
[DataField]
public bool BreakOnMove { get; private set; } = true;
[DataField]
public bool BreakOnDamage { get; private set; } = true;
[DataField]
public bool Hidden { get; private set; } = false;
[DataField]
public float EntityDistance { get; private set; } = 100f;
}
//Entity Target
public sealed partial class CP14DelayedEntityTargetActionEvent : EntityTargetActionEvent,
ICP14DelayedMagicEffect
{
[DataField]
public float Cooldown { get; private set; } = 1f;
[DataField]
public float CastDelay { get; private set; } = 1f;
[DataField]
public bool BreakOnMove { get; private set; } = true;
[DataField]
public bool BreakOnDamage { get; private set; } = true;
[DataField]
public bool Hidden { get; private set; } = false;
[DataField]
public float EntityDistance { get; private set; } = 100f;
}
public sealed partial class CP14DelayedInstantActionEvent : InstantActionEvent, ICP14DelayedMagicEffect
{
[DataField]
public float Cooldown { get; private set; } = 3f;
[DataField]
public float CastDelay { get; private set; } = 1f;
[DataField]
public bool BreakOnMove { get; private set; } = true;
[DataField]
public bool BreakOnDamage { get; private set; } = true;
[DataField]
public bool Hidden { get; private set; } = false;
[DataField]
public float EntityDistance { get; private set; } = 100f;
}
[Serializable, NetSerializable]
public sealed partial class CP14DelayedEntityWorldTargetActionDoAfterEvent : DoAfterEvent
{
[DataField]
public NetCoordinates? TargetPosition;
[DataField]
public NetEntity? TargetEntity;
[DataField]
public float? Cooldown;
public CP14DelayedEntityWorldTargetActionDoAfterEvent(NetCoordinates? targetPos, NetEntity? targetEntity, float cooldown)
{
TargetPosition = targetPos;
TargetEntity = targetEntity;
Cooldown = cooldown;
}
public override DoAfterEvent Clone() => this;
}
[Serializable, NetSerializable]
public sealed partial class CP14DelayedEntityTargetActionDoAfterEvent : DoAfterEvent
{
[DataField]
public NetEntity? TargetEntity;
[DataField]
public float? Cooldown;
public CP14DelayedEntityTargetActionDoAfterEvent(NetEntity? targetEntity, float cooldown)
{
TargetEntity = targetEntity;
Cooldown = cooldown;
}
public override DoAfterEvent Clone() => this;
}
[Serializable, NetSerializable]
public sealed partial class CP14DelayedInstantActionDoAfterEvent : DoAfterEvent
{
[DataField]
public float? Cooldown;
public CP14DelayedInstantActionDoAfterEvent(float cooldown)
{
Cooldown = cooldown;
}
public override DoAfterEvent Clone() => this;
}