Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Content.Server/Chemistry/EntitySystems/HypospraySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Content.Server.Body.Components;
using System.Linq;
using Robust.Server.Audio;
using Content.Shared._Goobstation.Chemistry.Hypospray; // Goobstation

namespace Content.Server.Chemistry.EntitySystems;

Expand Down Expand Up @@ -61,6 +62,9 @@ public void OnAfterInteract(Entity<HyposprayComponent> entity, ref AfterInteract

public void OnAttack(Entity<HyposprayComponent> entity, ref MeleeHitEvent args)
{
if (args.Handled) // Goobstation
return;

if (!args.HitEntities.Any())
return;

Expand Down Expand Up @@ -123,7 +127,7 @@ public bool TryDoInject(Entity<HyposprayComponent> entity, EntityUid target, Ent
if (!_solutionContainers.TryGetSolution(uid, component.SolutionName, out var hypoSpraySoln, out var hypoSpraySolution) || hypoSpraySolution.Volume == 0)
{
_popup.PopupEntity(Loc.GetString("hypospray-component-empty-message"), target, user);
return true;
return false; // Goobstation edit - why was it true?
}

if (!_solutionContainers.TryGetInjectableSolution(target, out var targetSoln, out var targetSolution))
Expand Down Expand Up @@ -168,6 +172,9 @@ public bool TryDoInject(Entity<HyposprayComponent> entity, EntityUid target, Ent
var ev = new TransferDnaEvent { Donor = target, Recipient = uid };
RaiseLocalEvent(target, ref ev);

var afterinjectev = new AfterHyposprayInjectsEvent { User = user, Target = target }; // Goobstation
RaiseLocalEvent(uid, ref afterinjectev); // Goobstation

// same LogType as syringes...
_adminLogger.Add(LogType.ForceFeed, $"{EntityManager.ToPrettyString(user):user} injected {EntityManager.ToPrettyString(target):target} with a solution {SharedSolutionContainerSystem.ToPrettyString(removedSolution):removedSolution} using a {EntityManager.ToPrettyString(uid):using}");

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// SPDX-FileCopyrightText: 2024 Aviu00 <[email protected]>
// SPDX-FileCopyrightText: 2025 Aiden <[email protected]>
// SPDX-FileCopyrightText: 2025 Misandry <[email protected]>
// SPDX-FileCopyrightText: 2025 gus <[email protected]>
//
// SPDX-License-Identifier: AGPL-3.0-or-later

using Content.Server.Chemistry.EntitySystems;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.Mobs.Components;
using Content.Shared.Weapons.Melee.Events;
using Content.Shared._Goobstation.Chemistry.HyposprayBlockNonMobInjection;

namespace Content.Server._Goobstation.Chemistry.HyposprayBlockNonMobInjection;

public sealed class HyposprayBlockNonMobInjectionSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<HyposprayBlockNonMobInjectionComponent, AfterInteractEvent>(OnAfterInteract, before: new []{typeof(HypospraySystem)});
SubscribeLocalEvent<HyposprayBlockNonMobInjectionComponent, MeleeHitEvent>(OnAttack, before: new []{typeof(HypospraySystem)});
SubscribeLocalEvent<HyposprayBlockNonMobInjectionComponent, UseInHandEvent>(OnUseInHand, before: new []{typeof(HypospraySystem)});
}

private void OnUseInHand(Entity<HyposprayBlockNonMobInjectionComponent> ent, ref UseInHandEvent args)
{
if (!IsMob(args.User))
args.Handled = true;
}

private void OnAttack(Entity<HyposprayBlockNonMobInjectionComponent> ent, ref MeleeHitEvent args)
{
if (args.HitEntities.Count == 0 || !IsMob(args.HitEntities[0]))
args.Handled = true;
}

private void OnAfterInteract(Entity<HyposprayBlockNonMobInjectionComponent> ent, ref AfterInteractEvent args)
{
if (args.Target == null || !IsMob(args.Target.Value))
args.Handled = true;
}

private bool IsMob(EntityUid uid)
{
return HasComp<MobStateComponent>(uid);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-FileCopyrightText: 2025 Aiden <[email protected]>
// SPDX-FileCopyrightText: 2025 Ted Lukin <[email protected]>
//
// SPDX-License-Identifier: AGPL-3.0-or-later

namespace Content.Shared._Goobstation.Chemistry.Hypospray;

/// <summary>
/// Raised on a hypospray when it successfully injects.
/// </summary>
[ByRefEvent]
public record struct AfterHyposprayInjectsEvent()
{
/// <summary>
/// Entity that used the hypospray.
/// </summary>
public EntityUid User;

/// <summary>
/// Entity that was injected.
/// </summary>
public EntityUid Target;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-FileCopyrightText: 2024 Aviu00 <[email protected]>
// SPDX-FileCopyrightText: 2025 Aiden <[email protected]>
// SPDX-FileCopyrightText: 2025 Misandry <[email protected]>
// SPDX-FileCopyrightText: 2025 Ted Lukin <[email protected]>
// SPDX-FileCopyrightText: 2025 gus <[email protected]>
//
// SPDX-License-Identifier: AGPL-3.0-or-later

using Content.Shared.Chemistry.Components;

namespace Content.Shared._Goobstation.Chemistry.Hypospray;

[RegisterComponent]
public sealed partial class SolutionCartridgeComponent : Component
{
[DataField, ViewVariables(VVAccess.ReadWrite)]
public string TargetSolution = "default";

[DataField(required: true)]
public Solution Solution;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// SPDX-FileCopyrightText: 2025 Aiden <[email protected]>
// SPDX-FileCopyrightText: 2025 Ted Lukin <[email protected]>
//
// SPDX-License-Identifier: AGPL-3.0-or-later

using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.EntitySystems;
using Robust.Shared.Containers;

namespace Content.Shared._Goobstation.Chemistry.Hypospray;

public sealed class SolutionCartridgeSystem : EntitySystem
{
[Dependency] private readonly SharedSolutionContainerSystem _solution = default!;
[Dependency] private readonly SharedContainerSystem _container = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<HyposprayComponent, EntInsertedIntoContainerMessage>(OnCartridgeInserted);
SubscribeLocalEvent<HyposprayComponent, EntRemovedFromContainerMessage>(OnCartridgeRemoved);
SubscribeLocalEvent<HyposprayComponent, AfterHyposprayInjectsEvent>(OnHyposprayInjected);
}

private void OnCartridgeInserted(Entity<HyposprayComponent> ent, ref EntInsertedIntoContainerMessage args)
{
if (!TryComp<SolutionCartridgeComponent>(args.Entity, out var cartridge)
|| !TryComp(ent, out SolutionContainerManagerComponent? manager)
|| !_solution.TryGetSolution((ent, manager), cartridge.TargetSolution, out var solutionEntity))
return;

_solution.TryAddSolution(solutionEntity.Value, cartridge.Solution);
}

private void OnCartridgeRemoved(Entity<HyposprayComponent> ent, ref EntRemovedFromContainerMessage args)
{
if (!TryComp<SolutionCartridgeComponent>(args.Entity, out var cartridge)
|| !TryComp(ent, out SolutionContainerManagerComponent? manager)
|| !_solution.TryGetSolution((ent, manager), cartridge.TargetSolution, out var solutionEntity))
return;

_solution.RemoveAllSolution(solutionEntity.Value);
}

private void OnHyposprayInjected(Entity<HyposprayComponent> ent, ref AfterHyposprayInjectsEvent args)
{
if (!_container.TryGetContainer(ent, "item", out var container))
return;

_container.CleanContainer(container);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SPDX-FileCopyrightText: 2024 Aviu00 <[email protected]>
// SPDX-FileCopyrightText: 2025 Aiden <[email protected]>
// SPDX-FileCopyrightText: 2025 Misandry <[email protected]>
// SPDX-FileCopyrightText: 2025 gus <[email protected]>
//
// SPDX-License-Identifier: AGPL-3.0-or-later

namespace Content.Shared._Goobstation.Chemistry.HyposprayBlockNonMobInjection;

/// <summary>
/// For some reason if you set HyposprayComponent onlyAffectsMobs to true it would be able to draw from containers
/// even if injectOnly is also true. I don't want to modify HypospraySystem, so I made this component.
/// </summary>
[RegisterComponent]
public sealed partial class HyposprayBlockNonMobInjectionComponent : Component
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ent-CartridgeSaline = airloss autoinjector cartridge
.desc = Contains 7u of saline and 3u of convermol, used in a cartridge autoinjector.
ent-CartridgeBicaridine = brute autoinjector cartridge
.desc = Contains 7u of bicaridine, 2u of salicylic acid and 1u of tranexamic acid, used in a cartridge autoinjector.
7 changes: 5 additions & 2 deletions Resources/Prototypes/Catalog/Fills/Items/belt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,11 @@
- id: Bloodpack
- id: Gauze
- id: Portafib # DeltaV - Add PortaFib to EMT belt
- id: EmergencyMedipen #You never know what people are going to latejoin into
amount: 3
#- id: EmergencyMedipen #You never know what people are going to latejoin into # Goobstation - start
# amount: 3
- id: ParamedHypo
- id: CartridgeSaline
- id: CartridgeBicaridine # Goobstation - end

- type: entity
id: ClothingBeltPlantFilled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@
Portafib: 1 # DeltaV - Add Portafibs, see Prototypes/_DV/Entities/Objects/Devices/Medical/portafib.yml
ClothingEyesHudMedical: 3 # DeltaV - was 2
ClothingEyesEyepatchHudMedical: 2
Tourniquet: 6 # Goobstation - start
ParamedHypo: 2
CartridgeSaline: 6
CartridgeBicaridine: 6
CartridgeDermaline: 6 # Goobstation - end
contrabandInventory:
FoodApple: 1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
ClothingOuterArmorReflective: 2 # DeltaV - added reflective vest to sectech
ClothingHeadHelmetBasic: 2 # DeltaV - added helmets to the SecTech. Another line of defense between the tide and your grey matter.
BreachingCharge: 8 # DeltaV - added breaching charges
SecHypo: 4 # Goobstation - start
CartridgeEpinephrine: 4
CartridgeSaline: 4
CartridgeBicaridine: 4
CartridgeDermaline: 4 # Goobstation - end
# security officers need to follow a diet regimen!
contrabandInventory:
WeaponMeleeNeedle: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
Bloodpack: 3
ChemistryBottleEpinephrine: 3
Syringe: 3
Tourniquet: 3 #Goobstation - ParamedHypo
contrabandInventory:
PowerCellSmall: 2
2 changes: 2 additions & 0 deletions Resources/Prototypes/Entities/Clothing/Belt/belts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@
- SurgeryTool
- Dropper
- Vial # DeltaV - vial gaming
- Tourniquet #Goobstation - ParamedHypo
- AutoinjectorCartridge #Goobstation - Autoinjectors
components:
- Defibrillator # DeltaV - Add PortaFib to EMT belt
- Hypospray
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@
components:
- type: Tag
tags:
- Tourniquet #Goobstation - ParamedHypo
- SecBeltEquip
- type: Sprite
state: tourniquet
Expand Down
2 changes: 2 additions & 0 deletions Resources/Prototypes/Entities/Structures/Machines/lathe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@
- PrisonerSoftsuits
- EVASuit
# End DeltaV Additions
- SecurityHypoStatic # Goobstation
dynamicPacks:
- SalvageSecurityBoards
- SalvageSecurityWeapons
Expand Down Expand Up @@ -518,6 +519,7 @@
- EVASuit
- PowerCellsStatic
# End DeltaV Additions
- ParamedHypoStatic # Goobstation - ParamedHypo
dynamicPacks:
- Chemistry
- CyberneticsMedical # Shitmed change
Expand Down
Loading
Loading