From af99df5ae015f21725995db8da9925bdc58bacae Mon Sep 17 00:00:00 2001 From: Aviu00 <93730715+Aviu00@users.noreply.github.com> Date: Wed, 12 Jun 2024 16:00:45 +0000 Subject: [PATCH] Cult stuff (#348) * - add: Cult buff protects against spacing. * - add: Predict RunicDoor. * - add: Loc. * - fix: Missing includes. * - add: Revive rune popups. * - tweak: Buff rune. * - fix: Buff rune. --- .../Atmos/EntitySystems/BarotraumaSystem.cs | 5 +++-- .../Items/Systems/BloodBoilProjectileSystem.cs | 2 +- Content.Server/_White/Cult/Pylon/PylonSystem.cs | 1 + .../Systems/CultSystem.ConstructsAbilities.cs | 1 + .../_White/Cult/Runes/Systems/CultSystem.Rune.cs | 12 +++++++++--- Content.Server/_White/Keyhole/KeyholeSystem.cs | 4 ++-- Content.Shared/Doors/Systems/SharedDoorSystem.cs | 8 ++++++++ .../_White/Cult/Components}/ConstructComponent.cs | 2 +- .../_White/Cult/Components/CultBuffComponent.cs | 10 ++++++++-- .../_White/Cult/Structures/RunicDoorComponent.cs | 2 +- .../_White/Cult/Structures/RunicDoorSystem.cs | 15 ++++++++------- Resources/Locale/ru-RU/_white/cult/cult.ftl | 3 ++- Resources/Locale/ru-RU/_white/cult/entities.ftl | 2 +- Resources/Locale/ru-RU/alerts/alerts.ftl | 2 +- .../_White/Entities/Cult/Altars/cult_altars.yml | 5 ----- 15 files changed, 47 insertions(+), 27 deletions(-) rename {Content.Server/_White/Cult => Content.Shared/_White/Cult/Components}/ConstructComponent.cs (84%) rename {Content.Server => Content.Shared}/_White/Cult/Structures/RunicDoorComponent.cs (61%) rename {Content.Server => Content.Shared}/_White/Cult/Structures/RunicDoorSystem.cs (90%) diff --git a/Content.Server/Atmos/EntitySystems/BarotraumaSystem.cs b/Content.Server/Atmos/EntitySystems/BarotraumaSystem.cs index 9f73be86a8..d9af71f001 100644 --- a/Content.Server/Atmos/EntitySystems/BarotraumaSystem.cs +++ b/Content.Server/Atmos/EntitySystems/BarotraumaSystem.cs @@ -1,6 +1,7 @@ using System.Diagnostics.CodeAnalysis; using Content.Server.Administration.Logs; using Content.Server.Atmos.Components; +using Content.Shared._White.Cult.Components; using Content.Shared.Alert; using Content.Shared.Atmos; using Content.Shared.Damage; @@ -262,7 +263,7 @@ public sealed class BarotraumaSystem : EntitySystem voidAdaptation.ChemMultiplier = 0.75f; ActNormalPressure(uid, barotrauma, pressure); break; - case <= Atmospherics.HazardLowPressure: + case <= Atmospherics.HazardLowPressure when !HasComp(uid): // WD EDIT ActLowPressure(uid, barotrauma); break; case >= Atmospherics.HazardHighPressure: @@ -333,4 +334,4 @@ public sealed class BarotraumaSystem : EntitySystem break; } } -} \ No newline at end of file +} diff --git a/Content.Server/_White/Cult/Items/Systems/BloodBoilProjectileSystem.cs b/Content.Server/_White/Cult/Items/Systems/BloodBoilProjectileSystem.cs index f67c35f928..2de9f2b3c6 100644 --- a/Content.Server/_White/Cult/Items/Systems/BloodBoilProjectileSystem.cs +++ b/Content.Server/_White/Cult/Items/Systems/BloodBoilProjectileSystem.cs @@ -1,6 +1,6 @@ using Content.Server._White.Cult.Items.Components; using Content.Server._White.Cult.TimedProduction; -using Content.Shared._White.Cult; +using Content.Shared._White.Cult.Components; using Content.Shared._White.Cult.Pylon; using Robust.Shared.Physics.Events; using CultistComponent = Content.Shared._White.Cult.Components.CultistComponent; diff --git a/Content.Server/_White/Cult/Pylon/PylonSystem.cs b/Content.Server/_White/Cult/Pylon/PylonSystem.cs index 8c658b8d62..1673a4ca90 100644 --- a/Content.Server/_White/Cult/Pylon/PylonSystem.cs +++ b/Content.Server/_White/Cult/Pylon/PylonSystem.cs @@ -3,6 +3,7 @@ using System.Numerics; using Content.Server.Atmos.Piping.Other.Components; using Content.Server.Body.Components; using Content.Server.Body.Systems; +using Content.Shared._White.Cult.Components; using Content.Shared.Damage; using Content.Shared.Doors.Components; using Content.Shared.Interaction; diff --git a/Content.Server/_White/Cult/Runes/Systems/CultSystem.ConstructsAbilities.cs b/Content.Server/_White/Cult/Runes/Systems/CultSystem.ConstructsAbilities.cs index 58bb189935..ec080f7f28 100644 --- a/Content.Server/_White/Cult/Runes/Systems/CultSystem.ConstructsAbilities.cs +++ b/Content.Server/_White/Cult/Runes/Systems/CultSystem.ConstructsAbilities.cs @@ -11,6 +11,7 @@ using Content.Shared.Mobs.Components; using Content.Shared.Physics; using Content.Shared.StatusEffect; using Content.Shared._White.Cult; +using Content.Shared._White.Cult.Components; namespace Content.Server._White.Cult.Runes.Systems; diff --git a/Content.Server/_White/Cult/Runes/Systems/CultSystem.Rune.cs b/Content.Server/_White/Cult/Runes/Systems/CultSystem.Rune.cs index 0aecf9b99c..919974f7d5 100644 --- a/Content.Server/_White/Cult/Runes/Systems/CultSystem.Rune.cs +++ b/Content.Server/_White/Cult/Runes/Systems/CultSystem.Rune.cs @@ -37,7 +37,6 @@ using Content.Shared._White.Cult.Components; using Content.Shared._White.Cult.Runes; using Content.Shared._White.Cult.UI; using Content.Shared.Cuffs; -using Content.Shared.FixedPoint; using Content.Shared.GameTicking; using Content.Shared.Mindshield.Components; using Content.Shared.Mobs.Systems; @@ -597,13 +596,14 @@ public sealed partial class CultSystem : EntitySystem private bool AddCultistBuff(EntityUid target, EntityUid user) { - if (HasComp(target)) + if (TryComp(target, out var buff) && buff.BuffTime > buff.BuffLimit) { _popupSystem.PopupEntity(Loc.GetString("cult-buff-already-buffed"), user, user); return false; } - EnsureComp(target); + buff = EnsureComp(target); + buff.BuffTime = buff.StartingBuffTime; return true; } @@ -876,7 +876,10 @@ public sealed partial class CultSystem : EntitySystem return false; if (!_mobState.IsDead(target, mobState)) + { + _popupSystem.PopupEntity(Loc.GetString("cult-revive-rune-already-alive"), user, user); return false; + } var airlossGroup = _prototypeManager.Index("Airloss"); @@ -886,7 +889,10 @@ public sealed partial class CultSystem : EntitySystem { var afterHeal = damageable.TotalDamage - toHeal; if (deadThreshold <= afterHeal) + { + _popupSystem.PopupEntity(Loc.GetString("cult-revive-rune-too-damaged"), user, user); return false; + } var asphyxType = _prototypeManager.Index("Asphyxiation"); var bloodlossType = _prototypeManager.Index("Bloodloss"); diff --git a/Content.Server/_White/Keyhole/KeyholeSystem.cs b/Content.Server/_White/Keyhole/KeyholeSystem.cs index db632f0d93..af580f2185 100644 --- a/Content.Server/_White/Keyhole/KeyholeSystem.cs +++ b/Content.Server/_White/Keyhole/KeyholeSystem.cs @@ -1,5 +1,5 @@ using System.Diagnostics; -using Content.Server._White.Cult.Structures; +using Content.Shared._White.Cult.Structures; using Content.Shared._White.Keyhole.Components; using Content.Shared._White.Keyhole; using Content.Shared.DoAfter; @@ -120,4 +120,4 @@ public sealed class KeyholeSystem : EntitySystem _popupSystem.PopupEntity(Loc.GetString("key-pressed-in-keyform-message", ("user", user), ("key", uid)), uid); } } -} \ No newline at end of file +} diff --git a/Content.Shared/Doors/Systems/SharedDoorSystem.cs b/Content.Shared/Doors/Systems/SharedDoorSystem.cs index 4dfeef61c9..6aa3ff48eb 100644 --- a/Content.Shared/Doors/Systems/SharedDoorSystem.cs +++ b/Content.Shared/Doors/Systems/SharedDoorSystem.cs @@ -1,4 +1,5 @@ using System.Linq; +using Content.Shared._White.Cult.Structures; using Content.Shared._White.Keyhole.Components; using Content.Shared.Access.Components; using Content.Shared.Access.Systems; @@ -41,6 +42,7 @@ public abstract partial class SharedDoorSystem : EntitySystem [Dependency] private readonly AccessReaderSystem _accessReaderSystem = default!; [Dependency] private readonly PryingSystem _pryingSystem = default!; [Dependency] protected readonly SharedPopupSystem Popup = default!; + [Dependency] private readonly RunicDoorSystem _runicDoor = default!; // WD [ValidatePrototypeId] public const string DoorBumpTag = "DoorBumpOpener"; @@ -649,6 +651,9 @@ public abstract partial class SharedDoorSystem : EntitySystem var otherUid = args.OtherEntity; + if (!_runicDoor.CanBumpOpen(uid, otherUid)) // WD + return; + if (Tags.HasTag(otherUid, DoorBumpTag)) TryOpen(uid, door, otherUid, quiet: door.State == DoorState.Denying); } @@ -762,6 +767,9 @@ public abstract partial class SharedDoorSystem : EntitySystem { foreach (var other in PhysicsSystem.GetContactingEntities(uid, physics, approximate: true)) { + if (!_runicDoor.CanBumpOpen(uid, other)) // WD + continue; + if (Tags.HasTag(other, DoorBumpTag) && TryOpen(uid, door, other, quiet: true)) break; } diff --git a/Content.Server/_White/Cult/ConstructComponent.cs b/Content.Shared/_White/Cult/Components/ConstructComponent.cs similarity index 84% rename from Content.Server/_White/Cult/ConstructComponent.cs rename to Content.Shared/_White/Cult/Components/ConstructComponent.cs index fff47d46aa..35cce31684 100644 --- a/Content.Server/_White/Cult/ConstructComponent.cs +++ b/Content.Shared/_White/Cult/Components/ConstructComponent.cs @@ -1,6 +1,6 @@ using Robust.Shared.Prototypes; -namespace Content.Server._White.Cult; +namespace Content.Shared._White.Cult.Components; [RegisterComponent] public sealed partial class ConstructComponent : Component diff --git a/Content.Shared/_White/Cult/Components/CultBuffComponent.cs b/Content.Shared/_White/Cult/Components/CultBuffComponent.cs index f39e33b6b7..914721de99 100644 --- a/Content.Shared/_White/Cult/Components/CultBuffComponent.cs +++ b/Content.Shared/_White/Cult/Components/CultBuffComponent.cs @@ -3,10 +3,16 @@ namespace Content.Shared._White.Cult.Components; [RegisterComponent] public sealed partial class CultBuffComponent : Component { - [ViewVariables(VVAccess.ReadOnly), DataField("buffTime")] + [ViewVariables(VVAccess.ReadOnly), DataField] public TimeSpan BuffTime = TimeSpan.FromSeconds(60); + [ViewVariables(VVAccess.ReadOnly), DataField] + public TimeSpan StartingBuffTime = TimeSpan.FromSeconds(60); + + [ViewVariables(VVAccess.ReadOnly), DataField] + public TimeSpan BuffLimit = TimeSpan.FromSeconds(55); + public static float NearbyTilesBuffRadius = 1f; - public static readonly TimeSpan CultTileBuffTime = TimeSpan.FromSeconds(5); + public static readonly TimeSpan CultTileBuffTime = TimeSpan.FromSeconds(1); } diff --git a/Content.Server/_White/Cult/Structures/RunicDoorComponent.cs b/Content.Shared/_White/Cult/Structures/RunicDoorComponent.cs similarity index 61% rename from Content.Server/_White/Cult/Structures/RunicDoorComponent.cs rename to Content.Shared/_White/Cult/Structures/RunicDoorComponent.cs index 4cb1d31141..e1e61da1a3 100644 --- a/Content.Server/_White/Cult/Structures/RunicDoorComponent.cs +++ b/Content.Shared/_White/Cult/Structures/RunicDoorComponent.cs @@ -1,4 +1,4 @@ -namespace Content.Server._White.Cult.Structures; +namespace Content.Shared._White.Cult.Structures; [RegisterComponent] public sealed partial class RunicDoorComponent : Component diff --git a/Content.Server/_White/Cult/Structures/RunicDoorSystem.cs b/Content.Shared/_White/Cult/Structures/RunicDoorSystem.cs similarity index 90% rename from Content.Server/_White/Cult/Structures/RunicDoorSystem.cs rename to Content.Shared/_White/Cult/Structures/RunicDoorSystem.cs index 388af6b294..216d02f567 100644 --- a/Content.Server/_White/Cult/Structures/RunicDoorSystem.cs +++ b/Content.Shared/_White/Cult/Structures/RunicDoorSystem.cs @@ -1,13 +1,13 @@ -using Content.Server.Cuffs; -using Content.Server.Doors.Systems; -using Content.Shared._White.Chaplain; +using Content.Shared._White.Chaplain; using Content.Shared.Doors; using Content.Shared.Humanoid; using Content.Shared.Stunnable; using Content.Shared._White.Cult.Components; using Content.Shared._White.Cult.Systems; +using Content.Shared.Cuffs; using Content.Shared.Cuffs.Components; using Content.Shared.Doors.Components; +using Content.Shared.Doors.Systems; using Content.Shared.Mobs.Systems; using Content.Shared.Prying.Components; using Content.Shared.Weapons.Melee.Components; @@ -18,17 +18,18 @@ using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Systems; using CultistComponent = Content.Shared._White.Cult.Components.CultistComponent; -namespace Content.Server._White.Cult.Structures; +namespace Content.Shared._White.Cult.Structures; public sealed class RunicDoorSystem : EntitySystem { - [Dependency] private readonly DoorSystem _doorSystem = default!; + [Dependency] private readonly SharedDoorSystem _doorSystem = default!; + [Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly SharedPhysicsSystem _physics = default!; [Dependency] private readonly SharedStunSystem _stunSystem = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly OccluderSystem _occluder = default!; [Dependency] private readonly MobStateSystem _mobState = default!; - [Dependency] private readonly CuffableSystem _cuffable = default!; + [Dependency] private readonly SharedCuffableSystem _cuffable = default!; [Dependency] private readonly HolyWeaponSystem _holyWeapon = default!; public override void Initialize() @@ -125,7 +126,7 @@ public sealed class RunicDoorSystem : EntitySystem TryComp(airlock, out ConcealableComponent? concealable) && concealable.Concealed) return false; - var direction = Transform(user).MapPosition.Position - Transform(airlock).MapPosition.Position; + var direction = _transform.GetMapCoordinates(user).Position - _transform.GetMapCoordinates(airlock).Position; var impulseVector = direction * 2000; _physics.ApplyLinearImpulse(user, impulseVector); diff --git a/Resources/Locale/ru-RU/_white/cult/cult.ftl b/Resources/Locale/ru-RU/_white/cult/cult.ftl index c7ad06153d..ff9eb49c64 100644 --- a/Resources/Locale/ru-RU/_white/cult/cult.ftl +++ b/Resources/Locale/ru-RU/_white/cult/cult.ftl @@ -1,4 +1,4 @@ -soul-shard-name = Душа { $soul } +soul-shard-name = Душа { $soul } soul-shard-description = В этом камне заключена душа { $soul } cult-too-much-empowers = Слишком много способностей @@ -25,6 +25,7 @@ cult-ritual-prevented = Кто-то прервал ритуал. cult-narsie-summoned = НАР'СИ ВОССТАЛ! cult-revive-rune-already-alive = Он уже живой. cult-revive-rune-no-charges = У рун воскрешения кончились заряды. +cult-revive-rune-too-damaged = Его ранения несовместимы с жизнью. cult-summon-rune-need-minimum-cultists = Необходимо минимум 2 культиста. cult-cultists-not-found = Культисты не обнаружены. cult-blood-boil-rune-need-minimum = Необходимо минимум 3 культиста. diff --git a/Resources/Locale/ru-RU/_white/cult/entities.ftl b/Resources/Locale/ru-RU/_white/cult/entities.ftl index 978a589469..81c08d879e 100644 --- a/Resources/Locale/ru-RU/_white/cult/entities.ftl +++ b/Resources/Locale/ru-RU/_white/cult/entities.ftl @@ -45,7 +45,7 @@ ent-OfferingRune = руна предпонесения .desc = Мгновенно превращает обычного члена экипажа в культиста, для чего требуется 2 культиста вокруг руны. Члена экипажа с имплантом защиты разума нельзя перевоплотить, можно только принести в жертву, для чего нужно 3 культиста, которые встанут вокруг руны. Если цель мертва, то она будет принесена в жертву, для чего требуется 1 культист. ent-BuffRune = руна усиления - .desc = При активации усиливает вас, уменьшая затраты и ускоряя процесс подготовки заклинаний крови и черчения рун. + .desc = При активации усиливает вас, уменьшая затраты и ускоряя процесс подготовки заклинаний крови и черчения рун. Усиление также даёт иммунитет к низкому давлению. ent-EmpoweringRune = руна могущества .desc = Позволяет культистам приготовить до 5 заклинаний крови. diff --git a/Resources/Locale/ru-RU/alerts/alerts.ftl b/Resources/Locale/ru-RU/alerts/alerts.ftl index 41abeef2e8..274bc07519 100644 --- a/Resources/Locale/ru-RU/alerts/alerts.ftl +++ b/Resources/Locale/ru-RU/alerts/alerts.ftl @@ -112,4 +112,4 @@ alerts-changeling-chemicals-name = Химикаты alerts-changeling-chemicals-desc = Наши химикаты. alerts-cult-buff-name = Усиление -alerts-cult-buff-desc = Подготовка заклинаний крови занимает гораздо меньше времени, и вы не теряете столько крови при этом. +alerts-cult-buff-desc = Подготовка заклинаний крови занимает гораздо меньше времени, и вы не теряете столько крови при этом. Также вы неуязвимы к низкому давлению. diff --git a/Resources/Prototypes/_White/Entities/Cult/Altars/cult_altars.yml b/Resources/Prototypes/_White/Entities/Cult/Altars/cult_altars.yml index 09f56449dc..21bd42b022 100644 --- a/Resources/Prototypes/_White/Entities/Cult/Altars/cult_altars.yml +++ b/Resources/Prototypes/_White/Entities/Cult/Altars/cult_altars.yml @@ -69,11 +69,6 @@ graph: CultPylon node: pylon - type: Concealable - - type: AtmosDevice - - type: GasMiner - maxExternalPressure: 100 - spawnAmount: 10 - spawnGas: Oxygen - type: entity id: AltarTome