From 467dd23bf0cea1b871c9673a0779c93272f360e2 Mon Sep 17 00:00:00 2001 From: Aviu00 Date: Sun, 28 Jan 2024 08:05:01 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE?= =?UTF-8?q?=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D0=B8=D1=81=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=81?= =?UTF-8?q?=D0=BD=D0=B0=D1=80=D1=8F=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BA?= =?UTF-8?q?=D1=83=D0=BB=D1=8C=D1=82=D0=B8=D1=81=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_White/Cult/HolyWater/DeconvertCultist.cs | 15 ++++++++++ .../Cult/Components/CultItemComponent.cs | 6 ++++ .../_White/Cult/Systems/CultItemSystem.cs | 29 +++++++++++++++++++ Resources/Locale/ru-RU/cult/cult-item.ftl | 1 + .../VendingMachines/Inventories/chapel.yml | 4 +-- .../Entities/Clothing/Head/helmets.yml | 1 + .../Entities/Clothing/OuterClothing/armor.yml | 1 + .../Entities/Objects/Weapons/Melee/cult.yml | 3 ++ .../NonPeacefulRoundItems.yml | 3 +- .../Entities/Cult/Altars/cult_altars.yml | 3 +- .../Entities/Cult/Items/forge_craft.yml | 9 ++++++ .../_White/Entities/Cult/Items/tome_craft.yml | 5 ++++ .../_White/Entities/Cult/constructs.yml | 3 +- .../Prototypes/_White/Object/wetstone.yml | 1 + 14 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 Content.Shared/_White/Cult/Components/CultItemComponent.cs create mode 100644 Content.Shared/_White/Cult/Systems/CultItemSystem.cs create mode 100644 Resources/Locale/ru-RU/cult/cult-item.ftl diff --git a/Content.Server/_White/Cult/HolyWater/DeconvertCultist.cs b/Content.Server/_White/Cult/HolyWater/DeconvertCultist.cs index 4e55a12d52..2c02c7f77e 100644 --- a/Content.Server/_White/Cult/HolyWater/DeconvertCultist.cs +++ b/Content.Server/_White/Cult/HolyWater/DeconvertCultist.cs @@ -3,7 +3,9 @@ using Content.Server.Popups; using Content.Server.Stunnable; using Content.Shared.Chemistry.Reagent; using Content.Shared.IdentityManagement; +using Content.Shared.Inventory; using Content.Shared.White.Cult; +using Content.Shared.White.Cult.Components; using JetBrains.Annotations; using Robust.Shared.Prototypes; using Timer = Robust.Shared.Timing.Timer; @@ -50,5 +52,18 @@ public sealed partial class DeconvertCultist : ReagentEffect cultist.HolyConvertToken = null; entityManager.RemoveComponent(uid); entityManager.RemoveComponent(uid); + + var inventory = entityManager.System(); + if (!inventory.TryGetContainerSlotEnumerator(uid, out var enumerator)) + return; + + while (enumerator.MoveNext(out var container)) + { + if (container.ContainedEntity != null && + entityManager.HasComponent(container.ContainedEntity.Value)) + { + container.Remove(container.ContainedEntity.Value, entityManager, force: true); + } + } } } diff --git a/Content.Shared/_White/Cult/Components/CultItemComponent.cs b/Content.Shared/_White/Cult/Components/CultItemComponent.cs new file mode 100644 index 0000000000..a4a605fefd --- /dev/null +++ b/Content.Shared/_White/Cult/Components/CultItemComponent.cs @@ -0,0 +1,6 @@ +namespace Content.Shared.White.Cult.Components; + +[RegisterComponent] +public sealed partial class CultItemComponent : Component +{ +} diff --git a/Content.Shared/_White/Cult/Systems/CultItemSystem.cs b/Content.Shared/_White/Cult/Systems/CultItemSystem.cs new file mode 100644 index 0000000000..d39813dabb --- /dev/null +++ b/Content.Shared/_White/Cult/Systems/CultItemSystem.cs @@ -0,0 +1,29 @@ +using Content.Shared.Ghost; +using Content.Shared.Item; +using Content.Shared.Popups; +using Content.Shared.White.Cult.Components; + +namespace Content.Shared.White.Cult.Systems; + +public sealed class CultItemSystem : EntitySystem +{ + [Dependency] private readonly SharedPopupSystem _popupSystem = default!; + [Dependency] private readonly SharedTransformSystem _transform = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnHandPickUp); + } + + private void OnHandPickUp(EntityUid uid, CultItemComponent component, GettingPickedUpAttemptEvent args) + { + if (HasComp(args.User) || HasComp(args.User)) + return; + + args.Cancel(); + _transform.AttachToGridOrMap(uid); + _popupSystem.PopupClient(Loc.GetString("cult-item-component-not-cultist", ("name", Name(uid))), uid, args.User); + } +} diff --git a/Resources/Locale/ru-RU/cult/cult-item.ftl b/Resources/Locale/ru-RU/cult/cult-item.ftl new file mode 100644 index 0000000000..f24f5e8dbd --- /dev/null +++ b/Resources/Locale/ru-RU/cult/cult-item.ftl @@ -0,0 +1 @@ +cult-item-component-not-cultist = Вы не можете подобрать {$name} diff --git a/Resources/Prototypes/Catalog/VendingMachines/Inventories/chapel.yml b/Resources/Prototypes/Catalog/VendingMachines/Inventories/chapel.yml index 33a13dab0a..22762e6159 100644 --- a/Resources/Prototypes/Catalog/VendingMachines/Inventories/chapel.yml +++ b/Resources/Prototypes/Catalog/VendingMachines/Inventories/chapel.yml @@ -21,8 +21,8 @@ BoxCandleSmall: 2 Urn: 5 emaggedInventory: - ClothingOuterArmorCult: 1 - ClothingHeadHelmetCult: 1 + #ClothingOuterArmorCult: 1 + #ClothingHeadHelmetCult: 1 ClothingOuterRobesCult: 3 ClothingHeadHatHoodCulthood: 3 ClothingShoesCult: 4 diff --git a/Resources/Prototypes/Entities/Clothing/Head/helmets.yml b/Resources/Prototypes/Entities/Clothing/Head/helmets.yml index 48aa43fa55..e38cb3af71 100644 --- a/Resources/Prototypes/Entities/Clothing/Head/helmets.yml +++ b/Resources/Prototypes/Entities/Clothing/Head/helmets.yml @@ -146,6 +146,7 @@ Slash: 0.8 Piercing: 0.9 Heat: 0.9 + - type: CultItem #SCAF Helmet - type: entity diff --git a/Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml b/Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml index f74f2e6001..2bc864e88e 100644 --- a/Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml +++ b/Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml @@ -128,6 +128,7 @@ Piercing: 0.6 Heat: 0.5 - type: GroupExamine + - type: CultItem - type: entity parent: ClothingOuterBaseLarge diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Melee/cult.yml b/Resources/Prototypes/Entities/Objects/Weapons/Melee/cult.yml index da704a9d74..64926cc94f 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Melee/cult.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Melee/cult.yml @@ -40,6 +40,7 @@ - type: Tool qualities: - Dagger + - type: CultItem - type: entity name: eldritch blade @@ -66,6 +67,7 @@ slots: - back - type: DisarmMalus + - type: CultItem - type: entity name: unholy halberd @@ -104,3 +106,4 @@ - back - type: UseDelay delay: 1 + - type: CultItem diff --git a/Resources/Prototypes/White/NonPeacefulRound/NonPeacefulRoundItems.yml b/Resources/Prototypes/White/NonPeacefulRound/NonPeacefulRoundItems.yml index 7cd5d434d9..04218e2489 100644 --- a/Resources/Prototypes/White/NonPeacefulRound/NonPeacefulRoundItems.yml +++ b/Resources/Prototypes/White/NonPeacefulRound/NonPeacefulRoundItems.yml @@ -44,6 +44,7 @@ id: nonPeacefulRoundEndMelee items: - FireAxeFlaming + - FireAxe - CaptainSabre - Katana - Machete @@ -61,8 +62,6 @@ - EnergySwordDouble - EnergyCutlass - Cutlass - - UnholyHalberd - - EldritchBlade - BaseBallBat - BloodSuckerDagger - Truncheon diff --git a/Resources/Prototypes/_White/Entities/Cult/Altars/cult_altars.yml b/Resources/Prototypes/_White/Entities/Cult/Altars/cult_altars.yml index d8a2b84b60..60a52685fd 100644 --- a/Resources/Prototypes/_White/Entities/Cult/Altars/cult_altars.yml +++ b/Resources/Prototypes/_White/Entities/Cult/Altars/cult_altars.yml @@ -1,4 +1,4 @@ -- type: entity +- type: entity id: CultPylon parent: BaseStructure name: pylon @@ -236,6 +236,7 @@ products: - FactoryEldritchBlade - FactoryArmorCult + - FactoryUnholyHalberd - FactoryCultRobeModify - FactoryCultMirrorShield - type: UserInterface diff --git a/Resources/Prototypes/_White/Entities/Cult/Items/forge_craft.yml b/Resources/Prototypes/_White/Entities/Cult/Items/forge_craft.yml index 90ea4b74a1..ec78d99194 100644 --- a/Resources/Prototypes/_White/Entities/Cult/Items/forge_craft.yml +++ b/Resources/Prototypes/_White/Entities/Cult/Items/forge_craft.yml @@ -5,6 +5,7 @@ description: Some religious clothes. components: - type: CultRobeModifier + - type: CultItem - type: entity id: CultMirrorShield @@ -32,8 +33,16 @@ reflects: - Energy - type: ReturnItemOnThrow + - type: CultItem +- type: cultistFactoryProduction + id: FactoryUnholyHalberd + name: Нечестивая секира + icon: "/Textures/Objects/Weapons/Melee/cult_halberd.rsi/icon.png" + item: + - UnholyHalberd + - type: entity id: CultOuterArmor parent: ClothingOuterArmorCult diff --git a/Resources/Prototypes/_White/Entities/Cult/Items/tome_craft.yml b/Resources/Prototypes/_White/Entities/Cult/Items/tome_craft.yml index 1f5acb76b8..9dfc5551b7 100644 --- a/Resources/Prototypes/_White/Entities/Cult/Items/tome_craft.yml +++ b/Resources/Prototypes/_White/Entities/Cult/Items/tome_craft.yml @@ -22,6 +22,7 @@ - type: PointLight color: red range: 2 + - type: CultItem - type: entity parent: ClothingEyesBase @@ -35,6 +36,7 @@ sprite: Clothing/Eyes/Misc/blindfold.rsi - type: FlashImmunity - type: EyeProtection + - type: CultItem - type: ClothingGrantComponent component: - type: NightVision @@ -74,6 +76,7 @@ color: red range: 2 - type: VoidTeleport + - type: CultItem - type: entity name: void torch @@ -108,6 +111,7 @@ interfaces: - key: enum.CultTeleporterUiKey.Key type: TorchWindowBUI + - type: CultItem - type: cultistFactoryProduction id: FactoryCultShuttleCurse @@ -166,6 +170,7 @@ type: StructureCraftBoundUserInterface - type: Item size: Normal + - type: CultItem - type: entity parent: CultRunicMetal diff --git a/Resources/Prototypes/_White/Entities/Cult/constructs.yml b/Resources/Prototypes/_White/Entities/Cult/constructs.yml index d573d437bc..c06ef38716 100644 --- a/Resources/Prototypes/_White/Entities/Cult/constructs.yml +++ b/Resources/Prototypes/_White/Entities/Cult/constructs.yml @@ -1,4 +1,4 @@ -- type: entity +- type: entity id: BaseConstruct abstract: true noSpawn: true @@ -202,3 +202,4 @@ - type: ContainerContainer containers: Shard: !type:ContainerSlot + - type: CultItem diff --git a/Resources/Prototypes/_White/Object/wetstone.yml b/Resources/Prototypes/_White/Object/wetstone.yml index a5cec9df6b..f4018ab133 100644 --- a/Resources/Prototypes/_White/Object/wetstone.yml +++ b/Resources/Prototypes/_White/Object/wetstone.yml @@ -26,3 +26,4 @@ sprite: White/Items/Misc/wetstone.rsi size: 1 state: cult_sharpener + - type: CultItem