Skip to content

Commit

Permalink
ADD: Adrenal Implanter (#2579)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReeZer2 authored Feb 23, 2025
1 parent a6b43c1 commit 6324512
Show file tree
Hide file tree
Showing 12 changed files with 171 additions and 4 deletions.
32 changes: 31 additions & 1 deletion Content.Server/Implants/SubdermalImplantSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<PhysicsComponent> _physicsQuery;
private HashSet<Entity<MapGridComponent>> _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();
Expand All @@ -74,6 +80,7 @@ public override void Initialize()
SubscribeLocalEvent<SubdermalImplantComponent, ActivateImplantEvent>(OnActivateImplantEvent);
SubscribeLocalEvent<SubdermalImplantComponent, UseScramImplantEvent>(OnScramImplant);
SubscribeLocalEvent<SubdermalImplantComponent, UseDnaScramblerImplantEvent>(OnDnaScramblerImplant);
SubscribeLocalEvent<SubdermalImplantComponent, UseAdrenalImplantEvent>(OnAdrenalImplant); //ss220 add adrenal implant

SubscribeLocalEvent<SubdermalImplantComponent, UseDnaCopyImplantEvent>(OnDnaCopyImplant); //ss220 dna copy implant add
}
Expand Down Expand Up @@ -285,7 +292,7 @@ private void OnDnaScramblerImplant(EntityUid uid, SubdermalImplantComponent comp
}
RemComp<DetailExaminableComponent>(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;
Expand Down Expand Up @@ -348,4 +355,27 @@ private void OnDnaCopyImplant(Entity<SubdermalImplantComponent> ent, ref UseDnaC
QueueDel(ent);
}
//ss220 dna copy implant add end

//ss220 add adrenal implant start
private void OnAdrenalImplant(Entity<SubdermalImplantComponent> ent, ref UseAdrenalImplantEvent args)
{
if (!TryComp<SolutionContainerManagerComponent>(ent.Owner, out var solutionImplantComp))
return;

if (!TryComp<SolutionContainerManagerComponent>(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
}
7 changes: 7 additions & 0 deletions Content.Shared/Actions/BaseActionComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ public EntityUid? EntityIcon
/// If not null, this sound will be played when performing this action.
/// </summary>
[DataField("sound")] public SoundSpecifier? Sound;

//ss220 add time between charges start
[DataField]
public TimeSpan? TimeBetweenCharges = null;
//ss220 add time between charges end
}

[Serializable, NetSerializable]
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
}
}
10 changes: 9 additions & 1 deletion Content.Shared/Actions/SharedActionsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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 = Термальные очки
Expand All @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Actions/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
14 changes: 14 additions & 0 deletions Resources/Prototypes/SS220/Catalog/uplink_catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@
components:
- type: Implanter
implant: DnaCopyImplant

- type: entity
id: AdrenalImplanter
parent: BaseImplantOnlyImplanterSyndi
components:
- type: Implanter
implant: AdrenalImplant
Original file line number Diff line number Diff line change
Expand Up @@ -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

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from Paradise station, repo https://github.com/ss220-space/Paradise",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "adrenal"
}
]
}

0 comments on commit 6324512

Please sign in to comment.