diff --git a/Content.Server/Dragon/DragonSystem.cs b/Content.Server/Dragon/DragonSystem.cs index b1222b6538..3cf044f6db 100644 --- a/Content.Server/Dragon/DragonSystem.cs +++ b/Content.Server/Dragon/DragonSystem.cs @@ -49,18 +49,6 @@ public sealed partial class DragonSystem : EntitySystem private const int RiftsAllowed = 3; - public override void Initialize() - { - base.Initialize(); - - SubscribeLocalEvent(OnInit); - SubscribeLocalEvent(OnShutdown); - SubscribeLocalEvent(OnSpawnRift); - SubscribeLocalEvent(OnDragonMove); - SubscribeLocalEvent(OnMobStateChanged); - SubscribeLocalEvent(OnZombified); - } - public override void Update(float frameTime) { base.Update(frameTime); @@ -111,17 +99,20 @@ public sealed partial class DragonSystem : EntitySystem } } + [SubscribeLocalEvent] private void OnInit(EntityUid uid, DragonComponent component, MapInitEvent args) { Roar(uid, component); _actions.AddAction(uid, ref component.SpawnRiftActionEntity, component.SpawnRiftAction); } + [SubscribeLocalEvent] private void OnShutdown(EntityUid uid, DragonComponent component, ComponentShutdown args) { DeleteRifts(uid, false, component); } + [SubscribeLocalEvent] private void OnSpawnRift(EntityUid uid, DragonComponent component, DragonSpawnRiftActionEvent args) { if (component.Weakened) @@ -161,8 +152,10 @@ public sealed partial class DragonSystem : EntitySystem } } + var position = _transform.GetWorldPosition(xform); + // cant put a rift on solars - foreach (var tile in _map.GetTilesIntersecting(xform.GridUid.Value, grid, new Circle(_transform.GetWorldPosition(xform), RiftTileRadius), false)) + foreach (var tile in _map.GetTilesIntersecting(xform.GridUid.Value, grid, new Circle(position, RiftTileRadius), false)) { if (!_turf.IsSpace(tile)) continue; @@ -171,14 +164,14 @@ public sealed partial class DragonSystem : EntitySystem return; } - var (position, rotation) = _transform.GetWorldPositionRotation(xform); - var carpUid = Spawn(component.RiftPrototype, new MapCoordinates(position, xform.MapID), rotation: rotation); + var carpUid = Spawn(component.RiftPrototype, new MapCoordinates(position, xform.MapID), rotation: Transform(xform.GridUid.Value).LocalRotation); component.Rifts.Add(carpUid); Comp(carpUid).Dragon = uid; } // TODO: just make this a move speed modifier component??? + [SubscribeLocalEvent] private void OnDragonMove(EntityUid uid, DragonComponent component, RefreshMovementSpeedModifiersEvent args) { if (component.Weakened) @@ -187,6 +180,7 @@ public sealed partial class DragonSystem : EntitySystem } } + [SubscribeLocalEvent] private void OnMobStateChanged(EntityUid uid, DragonComponent component, MobStateChangedEvent args) { // Deletes all rifts after dying @@ -200,6 +194,7 @@ public sealed partial class DragonSystem : EntitySystem DeleteRifts(uid, false, component); } + [SubscribeLocalEvent] private void OnZombified(Entity ent, ref EntityZombifiedEvent args) { // prevent carp attacking zombie dragon diff --git a/Content.Shared/Holosign/HolosignSystem.cs b/Content.Shared/Holosign/HolosignSystem.cs index a40a0c0078..7660b331cc 100644 --- a/Content.Shared/Holosign/HolosignSystem.cs +++ b/Content.Shared/Holosign/HolosignSystem.cs @@ -11,14 +11,7 @@ public sealed partial class HolosignSystem : EntitySystem [Dependency] private INetManager _net = default!; [Dependency] private PowerCellSystem _powerCell = default!; - public override void Initialize() - { - base.Initialize(); - - SubscribeLocalEvent(OnBeforeInteract); - SubscribeLocalEvent(OnExamine); - } - + [SubscribeLocalEvent] private void OnExamine(Entity ent, ref ExaminedEvent args) { // TODO: This should probably be using an itemstatus @@ -37,6 +30,7 @@ public sealed partial class HolosignSystem : EntitySystem } } + [SubscribeLocalEvent] private void OnBeforeInteract(Entity ent, ref BeforeRangedInteractEvent args) { if (args.Handled @@ -48,10 +42,7 @@ public sealed partial class HolosignSystem : EntitySystem // overlapping of the same holo on one tile remains allowed to allow holofan refreshes if (ent.Comp.PredictedSpawn || _net.IsServer) - { - // TODO: make a proxy for this method. - EntityManager.PredictedSpawnAtPosition(ent.Comp.SignProto, args.ClickLocation, Angle.Zero); - } + PredictedSpawnAtPosition(ent.Comp.SignProto, args.ClickLocation); args.Handled = true; }