Hypo can inject solutions back into beakers (#19877)
* Inject to beakers * Stop fighting in my pr * Review
This commit is contained in:
@@ -19,5 +19,11 @@ namespace Content.Server.Chemistry.Components
|
|||||||
|
|
||||||
[DataField("injectSound")]
|
[DataField("injectSound")]
|
||||||
public SoundSpecifier InjectSound = new SoundPathSpecifier("/Audio/Items/hypospray.ogg");
|
public SoundSpecifier InjectSound = new SoundPathSpecifier("/Audio/Items/hypospray.ogg");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether or not the hypo is able to inject only into mobs. On false you can inject into beakers/jugs
|
||||||
|
/// </summary>
|
||||||
|
[DataField("onlyMobs")]
|
||||||
|
public bool OnlyMobs = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ namespace Content.Server.Chemistry.EntitySystems
|
|||||||
if (!Resolve(uid, ref component))
|
if (!Resolve(uid, ref component))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!EligibleEntity(target, _entMan))
|
if (!EligibleEntity(target, _entMan, component))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (TryComp(uid, out UseDelayComponent? delayComp) && _useDelay.ActiveDelay(uid, delayComp))
|
if (TryComp(uid, out UseDelayComponent? delayComp) && _useDelay.ActiveDelay(uid, delayComp))
|
||||||
@@ -84,7 +84,7 @@ namespace Content.Server.Chemistry.EntitySystems
|
|||||||
|
|
||||||
if (target == user)
|
if (target == user)
|
||||||
msgFormat = "hypospray-component-inject-self-message";
|
msgFormat = "hypospray-component-inject-self-message";
|
||||||
else if (EligibleEntity(user, _entMan) && _interaction.TryRollClumsy(user, component.ClumsyFailChance))
|
else if (EligibleEntity(user, _entMan, component) && _interaction.TryRollClumsy(user, component.ClumsyFailChance))
|
||||||
{
|
{
|
||||||
msgFormat = "hypospray-component-inject-self-clumsy-message";
|
msgFormat = "hypospray-component-inject-self-clumsy-message";
|
||||||
target = user;
|
target = user;
|
||||||
@@ -143,13 +143,15 @@ namespace Content.Server.Chemistry.EntitySystems
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool EligibleEntity([NotNullWhen(true)] EntityUid? entity, IEntityManager entMan)
|
static bool EligibleEntity([NotNullWhen(true)] EntityUid? entity, IEntityManager entMan, HyposprayComponent component)
|
||||||
{
|
{
|
||||||
// TODO: Does checking for BodyComponent make sense as a "can be hypospray'd" tag?
|
// TODO: Does checking for BodyComponent make sense as a "can be hypospray'd" tag?
|
||||||
// In SS13 the hypospray ONLY works on mobs, NOT beakers or anything else.
|
// In SS13 the hypospray ONLY works on mobs, NOT beakers or anything else.
|
||||||
|
// But this is 14, we dont do what SS13 does just because SS13 does it.
|
||||||
return entMan.HasComponent<SolutionContainerManagerComponent>(entity)
|
return component.OnlyMobs
|
||||||
&& entMan.HasComponent<MobStateComponent>(entity);
|
? entMan.HasComponent<SolutionContainerManagerComponent>(entity) &&
|
||||||
|
entMan.HasComponent<MobStateComponent>(entity)
|
||||||
|
: entMan.HasComponent<SolutionContainerManagerComponent>(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
- type: ExaminableSolution
|
- type: ExaminableSolution
|
||||||
solution: hypospray
|
solution: hypospray
|
||||||
- type: Hypospray
|
- type: Hypospray
|
||||||
|
onlyMobs: false
|
||||||
- type: UseDelay
|
- type: UseDelay
|
||||||
delay: 0.5
|
delay: 0.5
|
||||||
- type: StaticPrice
|
- type: StaticPrice
|
||||||
@@ -46,6 +47,7 @@
|
|||||||
- type: ExaminableSolution
|
- type: ExaminableSolution
|
||||||
solution: hypospray
|
solution: hypospray
|
||||||
- type: Hypospray
|
- type: Hypospray
|
||||||
|
onlyMobs: false
|
||||||
- type: UseDelay
|
- type: UseDelay
|
||||||
delay: 0.5
|
delay: 0.5
|
||||||
|
|
||||||
@@ -330,6 +332,7 @@
|
|||||||
- type: ExaminableSolution
|
- type: ExaminableSolution
|
||||||
solution: hypospray
|
solution: hypospray
|
||||||
- type: Hypospray
|
- type: Hypospray
|
||||||
|
onlyMobs: false
|
||||||
- type: UseDelay
|
- type: UseDelay
|
||||||
delay: 0.5
|
delay: 0.5
|
||||||
- type: StaticPrice # A new shitcurity meta
|
- type: StaticPrice # A new shitcurity meta
|
||||||
|
|||||||
Reference in New Issue
Block a user