From 962456ef324a22535e7da17c324956cd55b61734 Mon Sep 17 00:00:00 2001 From: Jabak <163307958+Jabaks@users.noreply.github.com> Date: Fri, 23 Aug 2024 02:09:40 +0300 Subject: [PATCH] New Aspect --- .../Aspects/DeleteVendingMachineAspect.cs | 18 ++++++++++++++++++ .../Aspects/DeleteVendingMachineComponent.cs | 7 +++++++ .../Prototypes/_White/Aspects/Aspects.yml | 12 ++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 Content.Server/_Honk/Aspects/DeleteVendingMachineAspect.cs create mode 100644 Content.Server/_Honk/Aspects/DeleteVendingMachineComponent.cs diff --git a/Content.Server/_Honk/Aspects/DeleteVendingMachineAspect.cs b/Content.Server/_Honk/Aspects/DeleteVendingMachineAspect.cs new file mode 100644 index 0000000000..851016a0ee --- /dev/null +++ b/Content.Server/_Honk/Aspects/DeleteVendingMachineAspect.cs @@ -0,0 +1,18 @@ +using Content.Server._White.AspectsSystem.Base; +using Content.Server.GameTicking.Rules.Components; +using Content.Shared.VendingMachines; + +namespace Content.Server._Honk.Aspects; + +public sealed class DeleteVendingMachineAspect : AspectSystem +{ + [Dependency] private readonly EntityManager _entityManager = default!; + + protected override void Started(EntityUid uid, DeleteVendingMachineComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args) + { + foreach (var entity in _entityManager.EntityQuery()) + { + _entityManager.DeleteEntity(entity.Owner); + } + } +} diff --git a/Content.Server/_Honk/Aspects/DeleteVendingMachineComponent.cs b/Content.Server/_Honk/Aspects/DeleteVendingMachineComponent.cs new file mode 100644 index 0000000000..7b3366361b --- /dev/null +++ b/Content.Server/_Honk/Aspects/DeleteVendingMachineComponent.cs @@ -0,0 +1,7 @@ +namespace Content.Server._Honk.Aspects; + +[RegisterComponent] +public sealed partial class DeleteVendingMachineComponent : Component +{ + +} diff --git a/Resources/Prototypes/_White/Aspects/Aspects.yml b/Resources/Prototypes/_White/Aspects/Aspects.yml index 13037e37de..153bb9e0c4 100644 --- a/Resources/Prototypes/_White/Aspects/Aspects.yml +++ b/Resources/Prototypes/_White/Aspects/Aspects.yml @@ -364,3 +364,15 @@ # startAudio: # path: /Audio/White/Aspects/accent.ogg # - type: SkeletonAspect + +#Honk Start +- type: entity + id: DeleteVendingMachineAspect + parent: BaseGameRule + noSpawn: false + components: + - type: Aspect + name: "DeleteVendingMachineAspect" + description: "Некий Жабак украл все торговые автоматы!" + weight: 3 + - type: DeleteVendingMachine