Simple Magic Spellbook System (#7823)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
keronshb
2022-05-29 02:29:10 -04:00
committed by GitHub
parent fb29fd5ecb
commit 11f729d024
52 changed files with 1120 additions and 1 deletions

View File

@@ -2,6 +2,8 @@ using Content.Server.Administration.Logs;
using Content.Server.Explosion.Components;
using Content.Server.Flash;
using Content.Server.Flash.Components;
using Content.Server.Sticky.Events;
using Content.Shared.Actions;
using JetBrains.Annotations;
using Robust.Shared.Audio;
using Robust.Shared.Physics;
@@ -10,6 +12,7 @@ using Robust.Shared.Player;
using Content.Shared.Sound;
using Content.Shared.Trigger;
using Content.Shared.Database;
using Content.Shared.Interaction;
namespace Content.Server.Explosion.EntitySystems
{
@@ -44,8 +47,10 @@ namespace Content.Server.Explosion.EntitySystems
InitializeProximity();
InitializeOnUse();
InitializeSignal();
InitializeTimedCollide();
SubscribeLocalEvent<TriggerOnCollideComponent, StartCollideEvent>(OnTriggerCollide);
SubscribeLocalEvent<TriggerOnActivateComponent, ActivateInWorldEvent>(OnActivate);
SubscribeLocalEvent<DeleteOnTriggerComponent, TriggerEvent>(HandleDeleteTrigger);
SubscribeLocalEvent<ExplodeOnTriggerComponent, TriggerEvent>(HandleExplodeTrigger);
@@ -76,6 +81,10 @@ namespace Content.Server.Explosion.EntitySystems
Trigger(component.Owner);
}
private void OnActivate(EntityUid uid, TriggerOnActivateComponent component, ActivateInWorldEvent args)
{
Trigger(component.Owner, args.User);
}
public void Trigger(EntityUid trigger, EntityUid? user = null)
{
@@ -124,6 +133,7 @@ namespace Content.Server.Explosion.EntitySystems
UpdateProximity(frameTime);
UpdateTimer(frameTime);
UpdateTimedCollide(frameTime);
}
private void UpdateTimer(float frameTime)