From 3287961b5e4ab3ecf547161d721aa75e5b83ebb1 Mon Sep 17 00:00:00 2001 From: Babaev Date: Tue, 30 Jul 2024 16:44:17 +0600 Subject: [PATCH 1/2] init --- .../EntitySystems/RevenantSystem.Abilities.cs | 26 ++++++++++++++++++ .../Revenant/Components/RevenantComponent.cs | 4 +++ Content.Shared/Revenant/SharedRevenant.cs | 5 ++++ .../_sunrise/prototypes/actions/revenant.ftl | 2 ++ .../ru-RU/_sunrise/store/revenant-catalog.ftl | 2 ++ .../Prototypes/_Sunrise/Actions/revenant.yml | 9 ++++++ .../_Sunrise/Catalog/revenant_catalog.yml | 12 ++++++++ .../_Sunrise/Interface/Actions/lock.png | Bin 0 -> 885 bytes .../_Sunrise/Interface/Actions/meta.json | 14 ++++++++++ 9 files changed, 74 insertions(+) create mode 100644 Resources/Locale/ru-RU/_sunrise/prototypes/actions/revenant.ftl create mode 100644 Resources/Locale/ru-RU/_sunrise/store/revenant-catalog.ftl create mode 100644 Resources/Prototypes/_Sunrise/Actions/revenant.yml create mode 100644 Resources/Prototypes/_Sunrise/Catalog/revenant_catalog.yml create mode 100644 Resources/Textures/_Sunrise/Interface/Actions/lock.png create mode 100644 Resources/Textures/_Sunrise/Interface/Actions/meta.json 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..f0f1fade3cc --- /dev/null +++ b/Resources/Prototypes/_Sunrise/Actions/revenant.yml @@ -0,0 +1,9 @@ +- type: entity + id: ActionRevenantLock + name: Lock Airlock + descreption: 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 0000000000000000000000000000000000000000..f2481a75e7bb3c21730b580855843bee269707d6 GIT binary patch literal 885 zcmV-*1B(2KP)Px&FG)l}R9J=WmO)4yXBdW`vC5WV0=iZOp@(fU;F^pWTyVVOsZcPdkc%On zb5Ka3Sr(xOZ%r;G#A87cdPq?yZ0QIMWS6W59hwO&xag7)HM1>b84!`_L1xz7`FFBw z6A08724>&+zW;sy@0`Lk#Ft587GGtr$+bX^bRdnQ&^R$SY*TQ>kOXGs#) zk@)prBx!bb)}`@Up^#-+$O~IgkMgsVi8h0#49rAH2UQ|-6zkzkUq9(| z+D#-90Oa#|CT|_fc@WfUss*hekw}ow=do=Y&qx@A6(|}VC`uQ@-`4V*%e_=8l|ZZq zMd)x>> zsqfLD6L$LGh- zb8mwu-sqDQR=_k(G)=>@EXw6_s6Zx@Y4|J}jfRTD2k^K26sPzX Date: Tue, 30 Jul 2024 17:02:34 +0600 Subject: [PATCH 2/2] =?UTF-8?q?=D0=BE=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Resources/Prototypes/_Sunrise/Actions/revenant.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Prototypes/_Sunrise/Actions/revenant.yml b/Resources/Prototypes/_Sunrise/Actions/revenant.yml index f0f1fade3cc..3381b7a58ee 100644 --- a/Resources/Prototypes/_Sunrise/Actions/revenant.yml +++ b/Resources/Prototypes/_Sunrise/Actions/revenant.yml @@ -1,7 +1,7 @@ - type: entity id: ActionRevenantLock name: Lock Airlock - descreption: Costs 60 Essence. + description: Costs 60 Essence. components: - type: InstantAction icon: _Sunrise/Interface/Actions/lock.png