1
+ using Content . Server . Actions ;
1
2
using Content . Server . Chemistry . Containers . EntitySystems ;
2
3
using Content . Server . Cuffs ;
3
4
using Content . Server . Forensics ;
16
17
using Content . Shared . Preferences ;
17
18
using Robust . Shared . Audio . Systems ;
18
19
using Robust . Shared . Map ;
19
- using Robust . Shared . Maths ;
20
20
using Robust . Shared . Physics ;
21
21
using Robust . Shared . Physics . Components ;
22
22
using Robust . Shared . Random ;
23
- using System . Numerics ;
24
- using Content . Shared . SS220 . ReagentImplanter ;
25
23
26
24
namespace Content . Server . Implants ;
27
25
@@ -38,7 +36,6 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem
38
36
[ Dependency ] private readonly SharedTransformSystem _xform = default ! ;
39
37
[ Dependency ] private readonly SolutionContainerSystem _solutionContainer = default ! ;
40
38
[ Dependency ] private readonly ForensicsSystem _forensicsSystem = default ! ;
41
-
42
39
private EntityQuery < PhysicsComponent > _physicsQuery ;
43
40
44
41
public override void Initialize ( )
@@ -47,7 +44,7 @@ public override void Initialize()
47
44
48
45
_physicsQuery = GetEntityQuery < PhysicsComponent > ( ) ;
49
46
50
- SubscribeLocalEvent < SubdermalImplantComponent , UseReagentCapsuleImplantEvent > ( OnReagentCapsuleImplant ) ;
47
+ SubscribeLocalEvent < SubdermalImplantComponent , UseChemicalImplantEvent > ( OnChemicaImplant ) ; // SS220 - chemical-implants start
51
48
SubscribeLocalEvent < SubdermalImplantComponent , UseFreedomImplantEvent > ( OnFreedomImplant ) ;
52
49
SubscribeLocalEvent < StoreComponent , ImplantRelayEvent < AfterInteractUsingEvent > > ( OnStoreRelay ) ;
53
50
SubscribeLocalEvent < SubdermalImplantComponent , ActivateImplantEvent > ( OnActivateImplantEvent ) ;
@@ -56,27 +53,29 @@ public override void Initialize()
56
53
57
54
}
58
55
59
- private void OnReagentCapsuleImplant ( EntityUid uid , SubdermalImplantComponent component , UseReagentCapsuleImplantEvent args )
56
+ // SS220 - chemical-implants start
57
+ private void OnChemicaImplant ( EntityUid uid , SubdermalImplantComponent component , UseChemicalImplantEvent args )
60
58
{
61
- if ( ! TryComp < SolutionContainerManagerComponent > ( args . Performer , out var ownerSolutionContainerComp )
62
- || ! TryComp < ReagentCapsuleComponent > ( uid , out var reagentCapsule )
63
- || ! TryComp < SolutionContainerManagerComponent > ( uid , out var capsuleContainer ) )
59
+ if ( component . ImplantedEntity is not { } ent )
64
60
return ;
65
-
66
- if ( args . Handled || reagentCapsule . IsUsed )
61
+ if ( ! TryComp < SolutionContainerManagerComponent > ( args . Performer , out var _performerSolutionComp )
62
+ || ! TryComp < SolutionContainerManagerComponent > ( uid , out var _implantSolutionComp ) )
67
63
return ;
68
64
69
- if ( ! _solutionContainer . TryGetSolution ( new ( args . Performer , ownerSolutionContainerComp ) , "chemicals" , out var chemicals ) )
65
+ if ( ! _solutionContainer . TryGetSolution ( new ( args . Performer , _performerSolutionComp ) , "chemicals" , out var chemicalSolution ) )
70
66
return ;
71
67
72
- if ( ! _solutionContainer . TryGetSolution ( new ( uid , capsuleContainer ) , "beaker" , out var beaker ) )
68
+ if ( ! _solutionContainer . TryGetSolution ( new ( uid , _implantSolutionComp ) , "beaker" , out var beakerSolution ) )
73
69
return ;
74
70
75
- _solutionContainer . TryTransferSolution ( chemicals . Value , beaker . Value . Comp . Solution , beaker . Value . Comp . Solution . Volume ) ;
76
- reagentCapsule . IsUsed = true ;
71
+ _solutionContainer . TryTransferSolution ( chemicalSolution . Value , beakerSolution . Value . Comp . Solution , beakerSolution . Value . Comp . Solution . Volume ) ;
72
+
77
73
args . Handled = true ;
78
74
75
+ QueueDel ( uid ) ;
76
+
79
77
}
78
+ // SS220 - chemical-implants end
80
79
81
80
private void OnStoreRelay ( EntityUid uid , StoreComponent store , ImplantRelayEvent < AfterInteractUsingEvent > implantRelay )
82
81
{
0 commit comments