From e856e3de2fc8f76f3a4861f460bbbc0285e0d06a Mon Sep 17 00:00:00 2001 From: Aviu00 <93730715+Aviu00@users.noreply.github.com> Date: Tue, 27 Feb 2024 21:00:02 +0900 Subject: [PATCH] - add: Runes can't be examined by crew. (#129) * - add: Runes can't be examined by crew. * - add: No rune pointing. --- .../Pointing/EntitySystems/PointingSystem.cs | 13 ++++++++++- .../Cult/Components/CultRuneComponent.cs | 6 +++++ .../_White/Cult/Systems/CultRuneSystem.cs | 23 +++++++++++++++++++ .../_White/Entities/Cult/Runes/cult_runes.yml | 8 +++++++ 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 Content.Shared/_White/Cult/Components/CultRuneComponent.cs create mode 100644 Content.Shared/_White/Cult/Systems/CultRuneSystem.cs diff --git a/Content.Server/Pointing/EntitySystems/PointingSystem.cs b/Content.Server/Pointing/EntitySystems/PointingSystem.cs index 05e05b60ee..f66fd924d2 100644 --- a/Content.Server/Pointing/EntitySystems/PointingSystem.cs +++ b/Content.Server/Pointing/EntitySystems/PointingSystem.cs @@ -1,4 +1,5 @@ using System.Linq; +using Content.Server._White.Cult; using Content.Server.Administration.Logs; using Content.Server.Pointing.Components; using Content.Shared.Database; @@ -12,6 +13,7 @@ using Content.Shared.Mind; using Content.Shared.Pointing; using Content.Shared.Popups; using Content.Shared._White.Administration; +using Content.Shared._White.Cult.Components; using JetBrains.Annotations; using Robust.Server.GameObjects; using Robust.Server.Player; @@ -126,11 +128,20 @@ namespace Content.Server.Pointing.EntitySystems return false; } - if (TryComp(pointed, out InvisibilityComponent? invisibility) && invisibility.Invisible) // WD + // WD START + if (TryComp(pointed, out InvisibilityComponent? invisibility) && invisibility.Invisible) { return false; } + if (HasComp(pointed) && !(HasComp(player) || + HasComp(player) || + HasComp(player))) + { + return false; + } + // WD END + if (HasComp(pointed)) { // this is a pointing arrow. no pointing here... diff --git a/Content.Shared/_White/Cult/Components/CultRuneComponent.cs b/Content.Shared/_White/Cult/Components/CultRuneComponent.cs new file mode 100644 index 0000000000..84ef3fe1e3 --- /dev/null +++ b/Content.Shared/_White/Cult/Components/CultRuneComponent.cs @@ -0,0 +1,6 @@ +namespace Content.Shared._White.Cult.Components; + +[RegisterComponent] +public sealed partial class CultRuneComponent : Component +{ +} diff --git a/Content.Shared/_White/Cult/Systems/CultRuneSystem.cs b/Content.Shared/_White/Cult/Systems/CultRuneSystem.cs new file mode 100644 index 0000000000..85708ad2da --- /dev/null +++ b/Content.Shared/_White/Cult/Systems/CultRuneSystem.cs @@ -0,0 +1,23 @@ +using Content.Shared._White.Cult.Components; +using Content.Shared.Examine; +using Content.Shared.Ghost; + +namespace Content.Shared._White.Cult.Systems; + +public sealed class CultRuneSystem : EntitySystem +{ + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnExamine); + } + + private void OnExamine(Entity ent, ref ExamineAttemptEvent args) + { + if (HasComp(args.Examiner) || HasComp(args.Examiner)) + return; + + args.Cancel(); + } +} diff --git a/Resources/Prototypes/_White/Entities/Cult/Runes/cult_runes.yml b/Resources/Prototypes/_White/Entities/Cult/Runes/cult_runes.yml index c84684b97e..587fad5cab 100644 --- a/Resources/Prototypes/_White/Entities/Cult/Runes/cult_runes.yml +++ b/Resources/Prototypes/_White/Entities/Cult/Runes/cult_runes.yml @@ -13,6 +13,7 @@ - type: CultRuneBase invokePhrase: "Mah'weyh pleggh at e'ntrath!" - type: CultRuneOffering + - type: CultRune - type: entity parent: CollideRune @@ -29,6 +30,7 @@ - type: CultRuneBase invokePhrase: "Qu'laris ver'don, thal'sorin mik'thar!" - type: CultRuneBuff + - type: CultRune - type: entity parent: CollideRune @@ -49,6 +51,7 @@ interfaces: - key: enum.CultEmpowerUiKey.Key type: SpellSelectorBUI + - type: CultRune - type: entity parent: CollideRune @@ -67,6 +70,7 @@ gatherInvokers: false - type: CultRuneTeleport label: "безымянная метка" + - type: CultRune - type: entity parent: CollideRune @@ -84,6 +88,7 @@ invokePhrase: "N'ath reth sh'yro eth d'rekkathnor!" gatherInvokers: true - type: CultRuneSummoning + - type: CultRune - type: entity parent: CollideRune @@ -100,6 +105,7 @@ - type: CultRuneBase invokePhrase: "Pasnar val'keriam usinar. Savrae ines amutan. Yam'toth remium il'tarat!" - type: CultRuneRevive + - type: CultRune - type: entity parent: CollideRune @@ -116,6 +122,7 @@ - type: CultRuneBase invokePhrase: "Khari'd! Eske'te tannin!" - type: CultRuneBarrier + - type: CultRune - type: entity parent: CollideRune @@ -133,6 +140,7 @@ invokePhrase: "Dedo ol'btoh!" - type: CultRuneBloodBoil projectilePrototype: ProjectileCult + - type: CultRune - type: entity parent: BaseRune