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