Невозможность использования снаряжения культистов

This commit is contained in:
Aviu00
2024-01-28 08:05:01 +03:00
parent e81367d2d0
commit 467dd23bf0
14 changed files with 78 additions and 6 deletions

View File

@@ -3,7 +3,9 @@ using Content.Server.Popups;
using Content.Server.Stunnable; using Content.Server.Stunnable;
using Content.Shared.Chemistry.Reagent; using Content.Shared.Chemistry.Reagent;
using Content.Shared.IdentityManagement; using Content.Shared.IdentityManagement;
using Content.Shared.Inventory;
using Content.Shared.White.Cult; using Content.Shared.White.Cult;
using Content.Shared.White.Cult.Components;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Timer = Robust.Shared.Timing.Timer; using Timer = Robust.Shared.Timing.Timer;
@@ -50,5 +52,18 @@ public sealed partial class DeconvertCultist : ReagentEffect
cultist.HolyConvertToken = null; cultist.HolyConvertToken = null;
entityManager.RemoveComponent<CultistComponent>(uid); entityManager.RemoveComponent<CultistComponent>(uid);
entityManager.RemoveComponent<PentagramComponent>(uid); entityManager.RemoveComponent<PentagramComponent>(uid);
var inventory = entityManager.System<InventorySystem>();
if (!inventory.TryGetContainerSlotEnumerator(uid, out var enumerator))
return;
while (enumerator.MoveNext(out var container))
{
if (container.ContainedEntity != null &&
entityManager.HasComponent<CultItemComponent>(container.ContainedEntity.Value))
{
container.Remove(container.ContainedEntity.Value, entityManager, force: true);
}
}
} }
} }

View File

@@ -0,0 +1,6 @@
namespace Content.Shared.White.Cult.Components;
[RegisterComponent]
public sealed partial class CultItemComponent : Component
{
}

View File

@@ -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<CultItemComponent, GettingPickedUpAttemptEvent>(OnHandPickUp);
}
private void OnHandPickUp(EntityUid uid, CultItemComponent component, GettingPickedUpAttemptEvent args)
{
if (HasComp<CultistComponent>(args.User) || HasComp<GhostComponent>(args.User))
return;
args.Cancel();
_transform.AttachToGridOrMap(uid);
_popupSystem.PopupClient(Loc.GetString("cult-item-component-not-cultist", ("name", Name(uid))), uid, args.User);
}
}

View File

@@ -0,0 +1 @@
cult-item-component-not-cultist = Вы не можете подобрать {$name}

View File

@@ -21,8 +21,8 @@
BoxCandleSmall: 2 BoxCandleSmall: 2
Urn: 5 Urn: 5
emaggedInventory: emaggedInventory:
ClothingOuterArmorCult: 1 #ClothingOuterArmorCult: 1
ClothingHeadHelmetCult: 1 #ClothingHeadHelmetCult: 1
ClothingOuterRobesCult: 3 ClothingOuterRobesCult: 3
ClothingHeadHatHoodCulthood: 3 ClothingHeadHatHoodCulthood: 3
ClothingShoesCult: 4 ClothingShoesCult: 4

View File

@@ -146,6 +146,7 @@
Slash: 0.8 Slash: 0.8
Piercing: 0.9 Piercing: 0.9
Heat: 0.9 Heat: 0.9
- type: CultItem
#SCAF Helmet #SCAF Helmet
- type: entity - type: entity

View File

@@ -128,6 +128,7 @@
Piercing: 0.6 Piercing: 0.6
Heat: 0.5 Heat: 0.5
- type: GroupExamine - type: GroupExamine
- type: CultItem
- type: entity - type: entity
parent: ClothingOuterBaseLarge parent: ClothingOuterBaseLarge

View File

@@ -40,6 +40,7 @@
- type: Tool - type: Tool
qualities: qualities:
- Dagger - Dagger
- type: CultItem
- type: entity - type: entity
name: eldritch blade name: eldritch blade
@@ -66,6 +67,7 @@
slots: slots:
- back - back
- type: DisarmMalus - type: DisarmMalus
- type: CultItem
- type: entity - type: entity
name: unholy halberd name: unholy halberd
@@ -104,3 +106,4 @@
- back - back
- type: UseDelay - type: UseDelay
delay: 1 delay: 1
- type: CultItem

View File

@@ -44,6 +44,7 @@
id: nonPeacefulRoundEndMelee id: nonPeacefulRoundEndMelee
items: items:
- FireAxeFlaming - FireAxeFlaming
- FireAxe
- CaptainSabre - CaptainSabre
- Katana - Katana
- Machete - Machete
@@ -61,8 +62,6 @@
- EnergySwordDouble - EnergySwordDouble
- EnergyCutlass - EnergyCutlass
- Cutlass - Cutlass
- UnholyHalberd
- EldritchBlade
- BaseBallBat - BaseBallBat
- BloodSuckerDagger - BloodSuckerDagger
- Truncheon - Truncheon

View File

@@ -1,4 +1,4 @@
- type: entity - type: entity
id: CultPylon id: CultPylon
parent: BaseStructure parent: BaseStructure
name: pylon name: pylon
@@ -236,6 +236,7 @@
products: products:
- FactoryEldritchBlade - FactoryEldritchBlade
- FactoryArmorCult - FactoryArmorCult
- FactoryUnholyHalberd
- FactoryCultRobeModify - FactoryCultRobeModify
- FactoryCultMirrorShield - FactoryCultMirrorShield
- type: UserInterface - type: UserInterface

View File

@@ -5,6 +5,7 @@
description: Some religious clothes. description: Some religious clothes.
components: components:
- type: CultRobeModifier - type: CultRobeModifier
- type: CultItem
- type: entity - type: entity
id: CultMirrorShield id: CultMirrorShield
@@ -32,8 +33,16 @@
reflects: reflects:
- Energy - Energy
- type: ReturnItemOnThrow - type: ReturnItemOnThrow
- type: CultItem
- type: cultistFactoryProduction
id: FactoryUnholyHalberd
name: Нечестивая секира
icon: "/Textures/Objects/Weapons/Melee/cult_halberd.rsi/icon.png"
item:
- UnholyHalberd
- type: entity - type: entity
id: CultOuterArmor id: CultOuterArmor
parent: ClothingOuterArmorCult parent: ClothingOuterArmorCult

View File

@@ -22,6 +22,7 @@
- type: PointLight - type: PointLight
color: red color: red
range: 2 range: 2
- type: CultItem
- type: entity - type: entity
parent: ClothingEyesBase parent: ClothingEyesBase
@@ -35,6 +36,7 @@
sprite: Clothing/Eyes/Misc/blindfold.rsi sprite: Clothing/Eyes/Misc/blindfold.rsi
- type: FlashImmunity - type: FlashImmunity
- type: EyeProtection - type: EyeProtection
- type: CultItem
- type: ClothingGrantComponent - type: ClothingGrantComponent
component: component:
- type: NightVision - type: NightVision
@@ -74,6 +76,7 @@
color: red color: red
range: 2 range: 2
- type: VoidTeleport - type: VoidTeleport
- type: CultItem
- type: entity - type: entity
name: void torch name: void torch
@@ -108,6 +111,7 @@
interfaces: interfaces:
- key: enum.CultTeleporterUiKey.Key - key: enum.CultTeleporterUiKey.Key
type: TorchWindowBUI type: TorchWindowBUI
- type: CultItem
- type: cultistFactoryProduction - type: cultistFactoryProduction
id: FactoryCultShuttleCurse id: FactoryCultShuttleCurse
@@ -166,6 +170,7 @@
type: StructureCraftBoundUserInterface type: StructureCraftBoundUserInterface
- type: Item - type: Item
size: Normal size: Normal
- type: CultItem
- type: entity - type: entity
parent: CultRunicMetal parent: CultRunicMetal

View File

@@ -1,4 +1,4 @@
- type: entity - type: entity
id: BaseConstruct id: BaseConstruct
abstract: true abstract: true
noSpawn: true noSpawn: true
@@ -202,3 +202,4 @@
- type: ContainerContainer - type: ContainerContainer
containers: containers:
Shard: !type:ContainerSlot Shard: !type:ContainerSlot
- type: CultItem

View File

@@ -26,3 +26,4 @@
sprite: White/Items/Misc/wetstone.rsi sprite: White/Items/Misc/wetstone.rsi
size: 1 size: 1
state: cult_sharpener state: cult_sharpener
- type: CultItem