fix MeleeChemicalInjector exploits (#12305)

This commit is contained in:
Rane
2022-10-30 22:04:51 -04:00
committed by GitHub
parent 4616a9f7e7
commit 8f4bd8b83b
6 changed files with 14 additions and 17 deletions

View File

@@ -14,5 +14,12 @@ namespace Content.Server.Chemistry.Components
[DataField("transferEfficiency")]
private float _transferEfficiency = 1f;
/// <summary>
/// Solution to inject from.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("solution")]
public string Solution { get; set; } = "default";
}
}

View File

@@ -155,7 +155,7 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem
// If the user is using a long-range weapon, this probably shouldn't be happening? But I'll interpret melee as a
// somewhat messy scuffle. See also, heavy attacks.
_interaction.DoContactInteraction(user, ev.Target);
_interaction.DoContactInteraction(user, ev.Target);
// For stuff that cares about it being attacked.
RaiseLocalEvent(ev.Target.Value, new AttackedEvent(component.Owner, user, targetXform.Coordinates));
@@ -555,7 +555,7 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem
private void OnChemicalInjectorHit(EntityUid owner, MeleeChemicalInjectorComponent comp, MeleeHitEvent args)
{
if (!_solutions.TryGetInjectableSolution(owner, out var solutionContainer))
if (!_solutions.TryGetSolution(owner, comp.Solution, out var solutionContainer))
return;
var hitBloodstreams = new List<BloodstreamComponent>();

View File

@@ -60,19 +60,14 @@
damage:
groups:
Brute: 2
- type: MeleeChemicalInjector
- type: SolutionContainerManager
solutions:
melee:
reagents:
- ReagentId: Toxin
Quantity: 5
- type: RefillableSolution
- type: MeleeChemicalInjector
solution: melee
- type: InjectableSolution
solution: melee
- type: SolutionTransfer
maxTransferAmount: 5
- type: GhostTakeoverAvailable
prob: 0.33
makeSentient: true

View File

@@ -370,19 +370,14 @@
damage:
types:
Piercing: 5
- type: MeleeChemicalInjector
- type: SolutionContainerManager
solutions:
melee:
reagents:
- ReagentId: Toxin
Quantity: 50
- type: RefillableSolution
- type: MeleeChemicalInjector
solution: melee
- type: InjectableSolution
solution: melee
- type: SolutionTransfer
maxTransferAmount: 3
- type: Fixtures
fixtures:
- shape:

View File

@@ -132,10 +132,9 @@
seedId: nettle
- type: MeleeChemicalInjector
transferAmount: 6 #To OD someone you would need 2 nettles and about 6-7 hits, the DOT is likely to crit them if they are running away with almost no health
solution: food
- type: Extractable
grindableSolutionName: food
- type: InjectableSolution
solution: food
- type: entity
name: banana

View File

@@ -32,11 +32,12 @@
graph: Spear
node: spear
- type: ItemCooldown
- type: MeleeChemicalInjector
- type: SolutionContainerManager
solutions:
melee:
maxVol: 5
- type: MeleeChemicalInjector
solution: melee
- type: RefillableSolution
solution: melee
- type: InjectableSolution