Fix: Prevent single-use hyposprays from getting the toggle draw verb (#26595)
Prevent single-use hyposprays from getting the toggle draw verb Co-authored-by: Plykiya <plykiya@protonmail.com> (cherry picked from commit 90a880a9bea64601db77d5bbb2b184d5371dc082)
This commit is contained in:
parent
ac273c0912
commit
3e38dc4de6
|
|
@ -30,4 +30,11 @@ public sealed partial class HyposprayComponent : Component
|
|||
[AutoNetworkedField]
|
||||
[DataField(required: true)]
|
||||
public bool OnlyAffectsMobs = false;
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not the hypospray is able to draw from containers or if it's a single use
|
||||
/// device that can only inject.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public bool InjectOnly = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public abstract class SharedHypospraySystem : EntitySystem
|
|||
// </summary>
|
||||
private void AddToggleModeVerb(Entity<HyposprayComponent> entity, ref GetVerbsEvent<AlternativeVerb> args)
|
||||
{
|
||||
if (!args.CanAccess || !args.CanInteract || args.Hands == null)
|
||||
if (!args.CanAccess || !args.CanInteract || args.Hands == null || entity.Comp.InjectOnly)
|
||||
return;
|
||||
|
||||
var (_, component) = entity;
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@
|
|||
solutionName: pen
|
||||
transferAmount: 15
|
||||
onlyAffectsMobs: false
|
||||
injectOnly: true
|
||||
- type: Appearance
|
||||
- type: SolutionContainerVisuals
|
||||
maxFillLevels: 1
|
||||
|
|
@ -205,6 +206,7 @@
|
|||
solutionName: pen
|
||||
transferAmount: 20
|
||||
onlyAffectsMobs: false
|
||||
injectOnly: true
|
||||
- type: SolutionContainerManager
|
||||
solutions:
|
||||
pen:
|
||||
|
|
@ -236,6 +238,7 @@
|
|||
solutionName: pen
|
||||
transferAmount: 20
|
||||
onlyAffectsMobs: false
|
||||
injectOnly: true
|
||||
- type: SolutionContainerManager
|
||||
solutions:
|
||||
pen:
|
||||
|
|
@ -267,6 +270,8 @@
|
|||
solutionName: pen
|
||||
transferAmount: 20
|
||||
onlyAffectsMobs: false
|
||||
injectOnly: true
|
||||
|
||||
- type: SolutionContainerManager
|
||||
solutions:
|
||||
pen:
|
||||
|
|
@ -299,6 +304,7 @@
|
|||
solutionName: pen
|
||||
transferAmount: 30
|
||||
onlyAffectsMobs: false
|
||||
injectOnly: true
|
||||
- type: SolutionContainerManager
|
||||
solutions:
|
||||
pen:
|
||||
|
|
@ -337,6 +343,7 @@
|
|||
solutionName: pen
|
||||
transferAmount: 30
|
||||
onlyAffectsMobs: false
|
||||
injectOnly: true
|
||||
- type: StaticPrice
|
||||
price: 500
|
||||
- type: Tag
|
||||
|
|
@ -397,6 +404,7 @@
|
|||
solutionName: pen
|
||||
transferAmount: 30
|
||||
onlyAffectsMobs: false
|
||||
injectOnly: true
|
||||
- type: StaticPrice
|
||||
price: 500
|
||||
- type: Tag
|
||||
|
|
|
|||
Loading…
Reference in New Issue