droppers behave more like syringes (#12518)
This commit is contained in:
@@ -25,6 +25,16 @@ namespace Content.Server.Chemistry.Components
|
||||
[DataField("injectOnly")]
|
||||
public bool InjectOnly;
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not the injector is able to draw from or inject from mobs
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// for example: droppers would ignore mobs
|
||||
/// </remarks>
|
||||
[ViewVariables]
|
||||
[DataField("ignoreMobs")]
|
||||
public bool IgnoreMobs = false;
|
||||
|
||||
/// <summary>
|
||||
/// The minimum amount of solution that can be transferred at once from this solution.
|
||||
/// </summary>
|
||||
@@ -72,6 +82,7 @@ namespace Content.Server.Chemistry.Components
|
||||
/// only ever be set to Inject
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("toggleState")]
|
||||
public InjectorToggleMode ToggleState
|
||||
{
|
||||
get => _toggleState;
|
||||
|
||||
@@ -27,7 +27,7 @@ public sealed partial class ChemistrySystem
|
||||
/// <summary>
|
||||
/// Default transfer amounts for the set-transfer verb.
|
||||
/// </summary>
|
||||
public static readonly List<int> TransferAmounts = new() { 5, 10, 15};
|
||||
public static readonly List<int> TransferAmounts = new() {1, 5, 10, 15};
|
||||
private void InitializeInjector()
|
||||
{
|
||||
SubscribeLocalEvent<InjectorComponent, GetVerbsEvent<AlternativeVerb>>(AddSetTransferVerbs);
|
||||
@@ -173,6 +173,10 @@ public sealed partial class ChemistrySystem
|
||||
if (HasComp<MobStateComponent>(target) ||
|
||||
HasComp<BloodstreamComponent>(target))
|
||||
{
|
||||
// Are use using an injector capible of targeting a mob?
|
||||
if (component.IgnoreMobs)
|
||||
return;
|
||||
|
||||
InjectDoAfter(component, args.User, target);
|
||||
args.Handled = true;
|
||||
return;
|
||||
|
||||
@@ -186,25 +186,23 @@
|
||||
visible: false
|
||||
- type: SolutionContainerManager
|
||||
solutions:
|
||||
dropper:
|
||||
injector:
|
||||
maxVol: 5
|
||||
- type: RefillableSolution
|
||||
solution: dropper
|
||||
- type: DrainableSolution
|
||||
solution: dropper
|
||||
- type: Injector
|
||||
injectOnly: false
|
||||
ignoreMobs: true
|
||||
minTransferAmount: 1
|
||||
maxTransferAmount: 5
|
||||
transferAmount: 1
|
||||
toggleState: 1 # draw
|
||||
- type: ExaminableSolution
|
||||
solution: dropper
|
||||
- type: SolutionTransfer
|
||||
minTransferAmount: 1
|
||||
transferAmount: 1
|
||||
maxTransferAmount: 5
|
||||
canChangeTransferAmount: true
|
||||
- type: UserInterface
|
||||
interfaces:
|
||||
- key: enum.TransferAmountUiKey.Key
|
||||
type: TransferAmountBoundUserInterface
|
||||
- type: Spillable
|
||||
solution: dropper
|
||||
solution: injector
|
||||
- type: Item
|
||||
sprite: Objects/Specific/Chemistry/dropper.rsi
|
||||
- type: Appearance
|
||||
|
||||
Reference in New Issue
Block a user