From 6324512029655024d40a4c68925f04bbd0dc532a Mon Sep 17 00:00:00 2001 From: ReeZer2 <63300653+ReeZer2@users.noreply.github.com> Date: Sun, 23 Feb 2025 20:11:55 +0200 Subject: [PATCH] ADD: Adrenal Implanter (#2579) --- .../Implants/SubdermalImplantSystem.cs | 32 ++++++++++- Content.Shared/Actions/BaseActionComponent.cs | 7 +++ Content.Shared/Actions/SharedActionsSystem.cs | 10 +++- .../Components/SubdermalImplantComponent.cs | 7 +++ .../hidden-description/hiddenDescription.ftl | 16 ++++++ Resources/Prototypes/Actions/types.yml | 4 +- .../SS220/Catalog/uplink_catalog.yml | 14 +++++ .../AdrenalImplant/adrenalimplant.yml | 14 +++++ .../Entities/Objects/Misc/implanters.yml | 7 +++ .../Objects/Misc/subdermal_implants.yml | 50 ++++++++++++++++++ .../Medical/implant-adrenal.rsi/adrenal.png | Bin 0 -> 599 bytes .../Medical/implant-adrenal.rsi/meta.json | 14 +++++ 12 files changed, 171 insertions(+), 4 deletions(-) create mode 100644 Resources/Prototypes/SS220/Entities/AdrenalImplant/adrenalimplant.yml create mode 100644 Resources/Textures/SS220/Objects/Specific/Medical/implant-adrenal.rsi/adrenal.png create mode 100644 Resources/Textures/SS220/Objects/Specific/Medical/implant-adrenal.rsi/meta.json diff --git a/Content.Server/Implants/SubdermalImplantSystem.cs b/Content.Server/Implants/SubdermalImplantSystem.cs index db445771a3b4..1ab5d880f813 100644 --- a/Content.Server/Implants/SubdermalImplantSystem.cs +++ b/Content.Server/Implants/SubdermalImplantSystem.cs @@ -30,12 +30,14 @@ using Content.Server.DetailExaminable; using Content.Server.Polymorph.Systems; using Content.Server.SS220.PenScrambler; +using Content.Shared.Actions; using Content.Shared.Store.Components; using Robust.Shared.Collections; using Robust.Shared.Map.Components; using Content.Shared.DoAfter; using Content.Shared.Polymorph; using Content.Shared.SS220.PenScrambler; +using Content.Shared.FixedPoint; using Content.Shared.SS220.Store; namespace Content.Server.Implants; @@ -58,10 +60,14 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem [Dependency] private readonly IdentitySystem _identity = default!; [Dependency] private readonly SharedDoAfterSystem _doAfter = default!; //SS220-insert-currency-doafter [Dependency] private readonly PolymorphSystem _polymorph = default!; //ss220 add dna copy implant + [Dependency] private readonly SharedActionsSystem _actions = default!; //ss220 add adrenal implant private EntityQuery _physicsQuery; private HashSet> _targetGrids = []; + private const string BeakerSolution = "beaker"; //ss220 add adrenal implant + private const string ChemicalSolution = "chemicals"; //ss220 add adrenal implant + public override void Initialize() { base.Initialize(); @@ -74,6 +80,7 @@ public override void Initialize() SubscribeLocalEvent(OnActivateImplantEvent); SubscribeLocalEvent(OnScramImplant); SubscribeLocalEvent(OnDnaScramblerImplant); + SubscribeLocalEvent(OnAdrenalImplant); //ss220 add adrenal implant SubscribeLocalEvent(OnDnaCopyImplant); //ss220 dna copy implant add } @@ -285,7 +292,7 @@ private void OnDnaScramblerImplant(EntityUid uid, SubdermalImplantComponent comp } RemComp(ent); // remove MRP+ custom description if one exists _identity.QueueIdentityUpdate(ent); // manually queue identity update since we don't raise the event - _popup.PopupEntity(Loc.GetString("scramble-implant-activated-popup"), ent, ent); + _popup.PopupEntity(Loc.GetString("scramble-implant-activated-popup", ("identity", newProfile.Name)), ent, ent); //ss220 fix locale } args.Handled = true; @@ -348,4 +355,27 @@ private void OnDnaCopyImplant(Entity ent, ref UseDnaC QueueDel(ent); } //ss220 dna copy implant add end + + //ss220 add adrenal implant start + private void OnAdrenalImplant(Entity ent, ref UseAdrenalImplantEvent args) + { + if (!TryComp(ent.Owner, out var solutionImplantComp)) + return; + + if (!TryComp(args.Performer, out var solutionUserComp)) + return; + + if (!_solutionContainer.TryGetSolution((ent.Owner, solutionImplantComp), BeakerSolution, out var solutionImplant)) + return; + + if (!_solutionContainer.TryGetSolution((args.Performer, solutionUserComp), ChemicalSolution, out var solutionUser)) + return; + + _solutionContainer.TryTransferSolution(solutionUser.Value, + solutionImplant.Value.Comp.Solution, + solutionImplant.Value.Comp.Solution.Volume / FixedPoint2.New(args.Action.Comp.Charges!.Value)); + + args.Handled = true; + } + //ss220 add adrenal implant end } diff --git a/Content.Shared/Actions/BaseActionComponent.cs b/Content.Shared/Actions/BaseActionComponent.cs index 25b36df2afe9..c4f4c771474c 100644 --- a/Content.Shared/Actions/BaseActionComponent.cs +++ b/Content.Shared/Actions/BaseActionComponent.cs @@ -194,6 +194,11 @@ public EntityUid? EntityIcon /// If not null, this sound will be played when performing this action. /// [DataField("sound")] public SoundSpecifier? Sound; + + //ss220 add time between charges start + [DataField] + public TimeSpan? TimeBetweenCharges = null; + //ss220 add time between charges end } [Serializable, NetSerializable] @@ -225,6 +230,7 @@ public abstract class BaseActionComponentState : ComponentState public bool Temporary; public ItemActionIconStyle ItemIconStyle; public SoundSpecifier? Sound; + public TimeSpan? TimeBetweenCharges; //ss220 add time between charges protected BaseActionComponentState(BaseActionComponent component, IEntityManager entManager) { @@ -254,5 +260,6 @@ protected BaseActionComponentState(BaseActionComponent component, IEntityManager Temporary = component.Temporary; ItemIconStyle = component.ItemIconStyle; Sound = component.Sound; + TimeBetweenCharges = component.TimeBetweenCharges; //ss220 add time between charges } } diff --git a/Content.Shared/Actions/SharedActionsSystem.cs b/Content.Shared/Actions/SharedActionsSystem.cs index 69ced9d718d6..944d74490866 100644 --- a/Content.Shared/Actions/SharedActionsSystem.cs +++ b/Content.Shared/Actions/SharedActionsSystem.cs @@ -711,11 +711,19 @@ public void PerformAction(EntityUid performer, ActionsComponent? component, Enti } action.Cooldown = null; - if (action is { UseDelay: not null, Charges: null or < 1 }) + + //ss220 add time between charges start + if (action is { TimeBetweenCharges: not null, Charges: > 0 }) + { + dirty = true; + action.Cooldown = (curTime, curTime + action.TimeBetweenCharges.Value); + } + else if (action is { UseDelay: not null, Charges: null or < 1 }) { dirty = true; action.Cooldown = (curTime, curTime + action.UseDelay.Value); } + //ss220 add time between charges end if (dirty) { diff --git a/Content.Shared/Implants/Components/SubdermalImplantComponent.cs b/Content.Shared/Implants/Components/SubdermalImplantComponent.cs index 5dd9cff76dfe..29d4f99f3b2b 100644 --- a/Content.Shared/Implants/Components/SubdermalImplantComponent.cs +++ b/Content.Shared/Implants/Components/SubdermalImplantComponent.cs @@ -106,3 +106,10 @@ public sealed partial class UseDnaCopyImplantEvent : InstantActionEvent } //ss220 add dna copy implant end + +//ss220 add adrenal implant start +public sealed partial class UseAdrenalImplantEvent : InstantActionEvent +{ + +} +//ss220 add adrenal implant end diff --git a/Resources/Locale/ru-RU/ss220/hidden-description/hiddenDescription.ftl b/Resources/Locale/ru-RU/ss220/hidden-description/hiddenDescription.ftl index 9bcb41f08b0e..ad1708d95c7d 100644 --- a/Resources/Locale/ru-RU/ss220/hidden-description/hiddenDescription.ftl +++ b/Resources/Locale/ru-RU/ss220/hidden-description/hiddenDescription.ftl @@ -17,6 +17,10 @@ hidden-desc-DnaCopyImplant-medical = [color=#52B4E9]Этот имплант со hidden-desc-DnaCopyImplant-research = [color=#D381C9]Имплант, позволяющий копировать и изменять ДНК, что дает возможность смены личности.[/color] hidden-desc-DnaCopyImplant-syndicate = [color=#E31735]Имплант с функцией клонирования ДНК, позволяющий носителю принять новую личность.[/color] +hidden-desc-AdrenalImplant-medical = [color=#52B4E9]Этот имплант содержит медицинские препараты, способствующие восстановлению организма.[/color] +hidden-desc-AdrenalImplant-research = [color=#D381C9]Имплант с запасом лечебных растворов, предназначенных для поддержки жизненных функций.[/color] +hidden-desc-AdrenalImplant-syndicate = [color=#E31735]Имплант с инъекционным механизмом, содержащий жидкости для ускоренного восстановления организма.[/color] + # Regular decriptions below ent-ThermalVisorImplanter = { ent-Implanter } @@ -39,6 +43,15 @@ ent-BoxDnaCopyImplant = { ent-BoxCardboard } ent-PaperDnaCopyImplanter = { ent-Paper } .desc = { ent-Paper.desc } +ent-AdrenalImplanter = { ent-Implanter } + .desc = { ent-Implanter.desc } + .suffix = Адреналин + +ent-AdrenalImplant = имплант Адреналина + .desc = Микрочип, который вживляют под кожу. + +ent-ActionActivateAdrenalImplant = Ввести жидкость + .desc = Вводит небольшую дозу разных лечащих веществ, эффект держится около 45 секунд. Можно ввести в предсмертном состоянии # Uplink locale uplink-thermal-glasses-name = Термальные очки @@ -50,6 +63,9 @@ uplink-thermal-visor-implanter-desc = Новейшая разработка си uplink-dna-copy-implanter-name = Имплант копирования ДНК uplink-dna-copy-implanter-desc = Новейшая разработка синдиката, имплант позволяет скопировать внешность другого человека. +uplink-adrenal-implanter-name = Имплант Адреналина +uplink-adrenal-implanter-desc = Внутри импланта содержится жидкость, которая ускоренно восстанавливает организм. Впрыскивается по малейшему импульсу даже в предсмертном состоянии + # silent shoes hidden-desc-SilentShoes-syndicate = [color=#e31735]Разработанные специально для шпионских миссий Синдиката, эти ботинки совершенно бесшумны на любых поверхностях[/color] hidden-desc-SilentShoes-research = [color=#D381C9]Вы можете различить скрытый слой поглощающего материала, полностью глушащий любые звуки шагов[/color] diff --git a/Resources/Prototypes/Actions/types.yml b/Resources/Prototypes/Actions/types.yml index 1d34e119cc7e..ee7cd2fe8fc0 100644 --- a/Resources/Prototypes/Actions/types.yml +++ b/Resources/Prototypes/Actions/types.yml @@ -124,7 +124,7 @@ - type: InstantAction checkCanInteract: false charges: 5 #SS220-underused-uplinks-stuff begin - useDelay: 5 + timeBetweenCharges: 5 #ss220 add time between charges itemIconStyle: BigAction priority: -20 icon: @@ -143,7 +143,7 @@ - type: InstantAction checkCanInteract: false charges: 12 #SS220 changed - useDelay: 5 + timeBetweenCharges: 5 #ss220 add time between charges itemIconStyle: BigAction priority: -20 icon: diff --git a/Resources/Prototypes/SS220/Catalog/uplink_catalog.yml b/Resources/Prototypes/SS220/Catalog/uplink_catalog.yml index 89f3933f7f77..bf19ddc3bbdc 100644 --- a/Resources/Prototypes/SS220/Catalog/uplink_catalog.yml +++ b/Resources/Prototypes/SS220/Catalog/uplink_catalog.yml @@ -187,6 +187,20 @@ categories: - UplinkImplants +- type: listing + id: AdrenalImplanter + name: uplink-adrenal-implanter-name + description: uplink-adrenal-implanter-desc + icon: {sprite: /Textures/SS220/Objects/Specific/Medical/implant-adrenal.rsi, state: adrenal} + productEntity: AdrenalImplanter + discountCategory: rareDiscounts + discountDownTo: + Telecrystal: 4 + cost: + Telecrystal: 7 + categories: + - UplinkImplants + - type: listing id: ClothingHeadHelmetSwatSyndicate name: uplink-helmet-swat-syndicate-name diff --git a/Resources/Prototypes/SS220/Entities/AdrenalImplant/adrenalimplant.yml b/Resources/Prototypes/SS220/Entities/AdrenalImplant/adrenalimplant.yml new file mode 100644 index 000000000000..7166fd7cbb33 --- /dev/null +++ b/Resources/Prototypes/SS220/Entities/AdrenalImplant/adrenalimplant.yml @@ -0,0 +1,14 @@ +- type: entity + id: ActionActivateAdrenalImplant + components: + - type: InstantAction + charges: 3 + timeBetweenCharges: 30 #30 seconds delay + checkCanInteract: false + checkConsciousness: false + itemIconStyle: BigAction + priority: -20 + icon: + sprite: /Textures/SS220/Objects/Specific/Medical/implant-adrenal.rsi + state: adrenal + event: !type:UseAdrenalImplantEvent diff --git a/Resources/Prototypes/SS220/Entities/Objects/Misc/implanters.yml b/Resources/Prototypes/SS220/Entities/Objects/Misc/implanters.yml index d7909e7bf74b..3c6728570c19 100644 --- a/Resources/Prototypes/SS220/Entities/Objects/Misc/implanters.yml +++ b/Resources/Prototypes/SS220/Entities/Objects/Misc/implanters.yml @@ -25,3 +25,10 @@ components: - type: Implanter implant: DnaCopyImplant + +- type: entity + id: AdrenalImplanter + parent: BaseImplantOnlyImplanterSyndi + components: + - type: Implanter + implant: AdrenalImplant diff --git a/Resources/Prototypes/SS220/Entities/Objects/Misc/subdermal_implants.yml b/Resources/Prototypes/SS220/Entities/Objects/Misc/subdermal_implants.yml index 7ce6187a0fd5..3054bbf4ed9b 100644 --- a/Resources/Prototypes/SS220/Entities/Objects/Misc/subdermal_implants.yml +++ b/Resources/Prototypes/SS220/Entities/Objects/Misc/subdermal_implants.yml @@ -108,3 +108,53 @@ mindRoles: - TraitorRole - NukeOperative + +- type: entity + parent: BaseSubdermalImplant + id: AdrenalImplant + categories: [ HideSpawnMenu ] + components: + - type: SubdermalImplant + implantAction: ActionActivateAdrenalImplant + - type: SolutionContainerManager + solutions: + beaker: + maxVol: 90 + canReact: false + reagents: + - ReagentId: Rororium + Quantity: 3 + - ReagentId: Ephedrine + Quantity: 3 + - ReagentId: TranexamicAcid + Quantity: 15 + - ReagentId: Dylovene + Quantity: 15 + - ReagentId: Bicaridine + Quantity: 24 + - ReagentId: Pyrazine + Quantity: 15 + - ReagentId: Epinephrine + Quantity: 15 + - type: TriggerImplantAction + - type: HiddenDescription + entries: + - label: hidden-desc-AdrenalImplant-medical + jobRequired: + - Paramedic + - MedicalDoctor + - SeniorPhysician + - ChiefMedicalOfficer + - Brigmedic + - label: hidden-desc-AdrenalImplant-research + jobRequired: + - ResearchAssistant + - ResearchDirector + - Scientist + - Borg + - label: hidden-desc-AdrenalImplant-syndicate + whitelistMind: + mindRoles: + - TraitorRole + - NukeOperative + diff --git a/Resources/Textures/SS220/Objects/Specific/Medical/implant-adrenal.rsi/adrenal.png b/Resources/Textures/SS220/Objects/Specific/Medical/implant-adrenal.rsi/adrenal.png new file mode 100644 index 0000000000000000000000000000000000000000..c3fc7b50d7d3f59344e037382233b23c9d764cf1 GIT binary patch literal 599 zcmV-d0;v6oP)Px%5lKWrR9J=WRxxSN%?d)=c z;3Xu5N3amwVhU53LW0PokiX83v$Nx>gn$p0U74Bx-k&%BJHQqH1&n#(5^-;A$&3Ax zRs>_7xRkh%;OYHE$ZvUU(d~#uw{sa0DyjUNF;Bd?W%1^g#b@?WE5b(9fdv$tF;8Th z1A)Np0-o}cLvrWdGx=0TGHCTk?1kM8o0~mu6`P`qO*e?P8 ze!dznB0vqUPNrTb%Q3qq5;5=}SA-56$AVOXl zjxbqo6Ghwhg*($==)1cokHdJAN0sdk@U&3}091w}k+dU50l+SMozE&J>n+B}1K8Oz zS#N<%QgllTWS`YBd1of;ZTR#uORK|Z+yTx5r^+D4n|z|kUS@f)HgOS-C`0K;I(RD z)@nl{Yfcei6d-p#ss!DEQ$?HwayzBlPu$gu#^Y{AXBQMFAPu=yCjsbl~E002ovPDHLkV1iyT34Q