diff --git a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs index c889d59f155..2463b1db1c4 100644 --- a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs +++ b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs @@ -7,6 +7,7 @@ using Content.Server.Light.Components; using Content.Server.Ghost; using Robust.Shared.Physics; +using Content.Shared.Doors.Components; // Sunrise-Edit using Content.Shared.Throwing; using Content.Server.Storage.EntitySystems; using Content.Shared.Interaction; @@ -29,6 +30,7 @@ using Robust.Shared.Utility; using Robust.Shared.Map.Components; using Content.Shared.Whitelist; +using Content.Server.Doors.Systems; // Sunrise-Edit namespace Content.Server.Revenant.EntitySystems; @@ -42,6 +44,7 @@ public sealed partial class RevenantSystem [Dependency] private readonly GhostSystem _ghost = default!; [Dependency] private readonly TileSystem _tile = default!; [Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!; + [Dependency] private readonly DoorSystem _doorSystem = default!; // Sunrise-Edit private void InitializeAbilities() { @@ -53,6 +56,7 @@ private void InitializeAbilities() SubscribeLocalEvent(OnOverloadLightsAction); SubscribeLocalEvent(OnBlightAction); SubscribeLocalEvent(OnMalfunctionAction); + SubscribeLocalEvent(OnLockAction); // Sunrise-Edit } private void OnInteract(EntityUid uid, RevenantComponent component, UserActivateInWorldEvent args) @@ -321,6 +325,28 @@ private void OnBlightAction(EntityUid uid, RevenantComponent component, Revenant // TODO: When disease refactor is in. } + // Sunrise-Start + private void OnLockAction(EntityUid uid, RevenantComponent component, RevenantLockActionEvent args) + { + if (args.Handled) + return; + + if (!TryUseAbility(uid, component, component.MalfunctionCost, component.LockDebuffs)) + + args.Handled = true; + + foreach (var ent in _lookup.GetEntitiesInRange(uid, component.MalfunctionRadius)) + { + if (TryComp(ent, out var doorComp) && TryComp(ent, out var boltsComp)) + { + if (!boltsComp.BoltWireCut) + + _doorSystem.SetBoltsDown((ent, boltsComp), true, uid); + } + } + } + // Sunrise-End + private void OnMalfunctionAction(EntityUid uid, RevenantComponent component, RevenantMalfunctionActionEvent args) { if (args.Handled) diff --git a/Content.Shared/Revenant/Components/RevenantComponent.cs b/Content.Shared/Revenant/Components/RevenantComponent.cs index d7fb28ef136..a98f173b8f2 100644 --- a/Content.Shared/Revenant/Components/RevenantComponent.cs +++ b/Content.Shared/Revenant/Components/RevenantComponent.cs @@ -201,6 +201,10 @@ public sealed partial class RevenantComponent : Component public EntityWhitelist? MalfunctionBlacklist; #endregion + // Sunrise-Start + [DataField("LockDebuffs")] + public Vector2 LockDebuffs = new(2, 8); + // Sunrise-End [DataField] public ProtoId EssenceAlert = "Essence"; diff --git a/Content.Shared/Revenant/SharedRevenant.cs b/Content.Shared/Revenant/SharedRevenant.cs index 485ad26dd2c..b03c1b099d1 100644 --- a/Content.Shared/Revenant/SharedRevenant.cs +++ b/Content.Shared/Revenant/SharedRevenant.cs @@ -62,6 +62,11 @@ public sealed partial class RevenantMalfunctionActionEvent : InstantActionEvent { } +// Sunrise-Start +public sealed partial class RevenantLockActionEvent : InstantActionEvent +{ +} +// Sunrise-End [NetSerializable, Serializable] public enum RevenantVisuals : byte diff --git a/Resources/Locale/ru-RU/_sunrise/prototypes/actions/revenant.ftl b/Resources/Locale/ru-RU/_sunrise/prototypes/actions/revenant.ftl new file mode 100644 index 00000000000..c69937069e8 --- /dev/null +++ b/Resources/Locale/ru-RU/_sunrise/prototypes/actions/revenant.ftl @@ -0,0 +1,2 @@ +ent-ActionRevenantLock = Перегрузка шлюзов + .desc = Цена 60 эссенций. diff --git a/Resources/Locale/ru-RU/_sunrise/store/revenant-catalog.ftl b/Resources/Locale/ru-RU/_sunrise/store/revenant-catalog.ftl new file mode 100644 index 00000000000..a5c28166018 --- /dev/null +++ b/Resources/Locale/ru-RU/_sunrise/store/revenant-catalog.ftl @@ -0,0 +1,2 @@ +revenant-lock-name = Перегрузка шлюзов +revenant-lock-desc = Перегружает находящиеся поблизости шлюзы, заставляя их переключиться в режим болтирования. При его использовании вы становитесь уязвимы к атакам на длительное время. diff --git a/Resources/Prototypes/_Sunrise/Actions/revenant.yml b/Resources/Prototypes/_Sunrise/Actions/revenant.yml new file mode 100644 index 00000000000..3381b7a58ee --- /dev/null +++ b/Resources/Prototypes/_Sunrise/Actions/revenant.yml @@ -0,0 +1,9 @@ +- type: entity + id: ActionRevenantLock + name: Lock Airlock + description: Costs 60 Essence. + components: + - type: InstantAction + icon: _Sunrise/Interface/Actions/lock.png + event: !type:RevenantLockActionEvent + useDelay: 25 diff --git a/Resources/Prototypes/_Sunrise/Catalog/revenant_catalog.yml b/Resources/Prototypes/_Sunrise/Catalog/revenant_catalog.yml new file mode 100644 index 00000000000..8b4689406f3 --- /dev/null +++ b/Resources/Prototypes/_Sunrise/Catalog/revenant_catalog.yml @@ -0,0 +1,12 @@ +- type: listing + id: RevenantLock + name: revenant-lock-name + description: revenant-lock-desc + productAction: ActionRevenantLock + cost: + StolenEssence: 125 + categories: + - RevenantAbilities + conditions: + - !type:ListingLimitedStockCondition + stock: 1 diff --git a/Resources/Textures/_Sunrise/Interface/Actions/lock.png b/Resources/Textures/_Sunrise/Interface/Actions/lock.png new file mode 100644 index 00000000000..f2481a75e7b Binary files /dev/null and b/Resources/Textures/_Sunrise/Interface/Actions/lock.png differ diff --git a/Resources/Textures/_Sunrise/Interface/Actions/meta.json b/Resources/Textures/_Sunrise/Interface/Actions/meta.json new file mode 100644 index 00000000000..aa4665cf81d --- /dev/null +++ b/Resources/Textures/_Sunrise/Interface/Actions/meta.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "size": { + "x": 32, + "y": 32 + }, + "license": "CLA", + "copyright": "SUNRISE", + "states": [ + { + "name": "lock" + } + ] +}