Add reagent specific footstep sounds (#24406)
* Add sticky footsteps * Update Resources/Audio/Effects/Footsteps/attributions.yml Co-authored-by: ike709 <ike709@users.noreply.github.com> --------- Co-authored-by: ike709 <ike709@users.noreply.github.com>
This commit is contained in:
@@ -123,9 +123,8 @@ namespace Content.Shared.Chemistry.Reagent
|
||||
[DataField]
|
||||
public float PricePerUnit;
|
||||
|
||||
// TODO: Pick the highest reagent for sounds and add sticky to cola, juice, etc.
|
||||
[DataField]
|
||||
public SoundSpecifier FootstepSound = new SoundCollectionSpecifier("FootstepWater");
|
||||
public SoundSpecifier FootstepSound = new SoundCollectionSpecifier("FootstepWater", AudioParams.Default.WithVolume(6));
|
||||
|
||||
public FixedPoint2 ReactionTile(TileRef tile, FixedPoint2 reactVolume)
|
||||
{
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.EntitySystems;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.DragDrop;
|
||||
using Content.Shared.Fluids.Components;
|
||||
using Content.Shared.Movement.Events;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Fluids;
|
||||
|
||||
public abstract class SharedPuddleSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The lowest threshold to be considered for puddle sprite states as well as slipperiness of a puddle.
|
||||
/// </summary>
|
||||
@@ -19,6 +27,7 @@ public abstract class SharedPuddleSystem : EntitySystem
|
||||
SubscribeLocalEvent<DumpableSolutionComponent, CanDropTargetEvent>(OnDumpCanDropTarget);
|
||||
SubscribeLocalEvent<DrainableSolutionComponent, CanDropTargetEvent>(OnDrainCanDropTarget);
|
||||
SubscribeLocalEvent<RefillableSolutionComponent, CanDropDraggedEvent>(OnRefillableCanDropDragged);
|
||||
SubscribeLocalEvent<PuddleComponent, GetFootstepSoundEvent>(OnGetFootstepSound);
|
||||
}
|
||||
|
||||
private void OnRefillableCanDrag(Entity<RefillableSolutionComponent> entity, ref CanDragEvent args)
|
||||
@@ -52,4 +61,18 @@ public abstract class SharedPuddleSystem : EntitySystem
|
||||
args.CanDrop = true;
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
private void OnGetFootstepSound(Entity<PuddleComponent> entity, ref GetFootstepSoundEvent args)
|
||||
{
|
||||
if (!_solutionContainerSystem.ResolveSolution(entity.Owner, entity.Comp.SolutionName, ref entity.Comp.Solution,
|
||||
out var solution))
|
||||
return;
|
||||
|
||||
var reagentId = solution.GetPrimaryReagentId();
|
||||
if (!string.IsNullOrWhiteSpace(reagentId?.Prototype)
|
||||
&& _prototypeManager.TryIndex(reagentId.Value.Prototype, out ReagentPrototype? proto))
|
||||
{
|
||||
args.Sound = proto.FootstepSound;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,3 +56,11 @@
|
||||
license: "CC-BY-SA-4.0"
|
||||
copyright: "Taken and modified from el1n freesound.org"
|
||||
source: "https://freesound.org/people/el1n/sounds/442746/"
|
||||
|
||||
- files:
|
||||
- gib_step.ogg
|
||||
- meatslap.ogg
|
||||
license: "CC-BY-SA-3.0"
|
||||
copyright: "Taken from https://github.com/tgstation/tgstation"
|
||||
source: "https://github.com/tgstation/tgstation/blob/34d5ab2e46e3fb4dd9d7475f587d33441df9651c/sound/effects"
|
||||
|
||||
BIN
Resources/Audio/Effects/Footsteps/gib_step.ogg
Normal file
BIN
Resources/Audio/Effects/Footsteps/gib_step.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Effects/Footsteps/meatslap.ogg
Normal file
BIN
Resources/Audio/Effects/Footsteps/meatslap.ogg
Normal file
Binary file not shown.
@@ -112,11 +112,6 @@
|
||||
mode: SnapgridCenter
|
||||
components:
|
||||
- type: Clickable
|
||||
- type: FootstepModifier
|
||||
footstepSoundCollection:
|
||||
collection: FootstepWater
|
||||
params:
|
||||
volume: 6
|
||||
- type: Slippery
|
||||
launchForwardsMultiplier: 2.0
|
||||
- type: Transform
|
||||
|
||||
@@ -36,6 +36,10 @@
|
||||
amount: 0.1
|
||||
- !type:PlantAdjustHealth
|
||||
amount: -0.1
|
||||
footstepSound:
|
||||
collection: FootstepSticky
|
||||
params:
|
||||
volume: 6
|
||||
|
||||
- type: reagent
|
||||
id: BaseAlcohol
|
||||
@@ -62,3 +66,13 @@
|
||||
amount: 0.25
|
||||
- !type:PlantAdjustWater
|
||||
amount: 0.7
|
||||
|
||||
- type: reagent
|
||||
id: BaseJuice
|
||||
parent: BaseDrink
|
||||
abstract: true
|
||||
flavor: sweet
|
||||
footstepSound:
|
||||
collection: FootstepSticky
|
||||
params:
|
||||
volume: 6
|
||||
@@ -83,6 +83,10 @@
|
||||
metamorphicSprite:
|
||||
sprite: Objects/Consumable/Drinks/grenadineglass.rsi
|
||||
state: icon
|
||||
footstepSound:
|
||||
collection: FootstepSticky
|
||||
params:
|
||||
volume: 6
|
||||
|
||||
- type: reagent
|
||||
id: IcedCoffee
|
||||
@@ -130,6 +134,7 @@
|
||||
|
||||
- type: reagent
|
||||
id: JuiceBerryPoison
|
||||
parent: BaseJuice
|
||||
name: reagent-name-juice-berry-poison
|
||||
group: Drinks
|
||||
desc: reagent-desc-juice-berry-poison
|
||||
@@ -149,6 +154,7 @@
|
||||
|
||||
- type: reagent
|
||||
id: Lemonade
|
||||
parent: BaseJuice
|
||||
name: reagent-name-lemonade
|
||||
group: Drinks
|
||||
desc: reagent-desc-lemonade
|
||||
@@ -246,6 +252,7 @@
|
||||
|
||||
- type: reagent
|
||||
id: NuclearCola
|
||||
parent: BaseSoda
|
||||
name: reagent-name-nuclear-cola
|
||||
group: Drinks
|
||||
desc: reagent-desc-nuclear-cola
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
- type: reagent
|
||||
id: JuiceApple
|
||||
name: reagent-name-juice-apple
|
||||
parent: BaseDrink
|
||||
parent: BaseJuice
|
||||
desc: reagent-desc-juice-apple
|
||||
physicalDesc: reagent-physical-desc-crisp
|
||||
flavor: apple
|
||||
@@ -11,7 +11,7 @@
|
||||
- type: reagent
|
||||
id: JuiceBanana
|
||||
name: reagent-name-juice-banana
|
||||
parent: BaseDrink
|
||||
parent: BaseJuice
|
||||
desc: reagent-desc-juice-banana
|
||||
physicalDesc: reagent-physical-desc-crisp
|
||||
flavor: banana
|
||||
@@ -20,7 +20,7 @@
|
||||
- type: reagent
|
||||
id: JuiceBerry
|
||||
name: reagent-name-juice-berry
|
||||
parent: BaseDrink
|
||||
parent: BaseJuice
|
||||
desc: reagent-desc-juice-berry
|
||||
physicalDesc: reagent-physical-desc-sweet
|
||||
flavor: berry
|
||||
@@ -29,7 +29,7 @@
|
||||
- type: reagent
|
||||
id: JuiceCarrot
|
||||
name: reagent-name-juice-carrot
|
||||
parent: BaseDrink
|
||||
parent: BaseJuice
|
||||
desc: reagent-desc-juice-carrot
|
||||
physicalDesc: reagent-physical-desc-crisp
|
||||
flavor: carrot
|
||||
@@ -49,7 +49,7 @@
|
||||
- type: reagent
|
||||
id: JuiceGrape
|
||||
name: reagent-name-juice-grape
|
||||
parent: BaseDrink
|
||||
parent: BaseJuice
|
||||
desc: reagent-desc-juice-grape
|
||||
physicalDesc: reagent-physical-desc-crisp
|
||||
flavor: juice
|
||||
@@ -58,7 +58,7 @@
|
||||
- type: reagent
|
||||
id: JuiceLemon
|
||||
name: reagent-name-juice-lemon
|
||||
parent: BaseDrink
|
||||
parent: BaseJuice
|
||||
desc: reagent-desc-juice-lemon
|
||||
physicalDesc: reagent-physical-desc-citric
|
||||
flavor: sour
|
||||
@@ -67,7 +67,7 @@
|
||||
- type: reagent
|
||||
id: JuiceLime
|
||||
name: reagent-name-juice-lime
|
||||
parent: BaseDrink
|
||||
parent: BaseJuice
|
||||
desc: reagent-desc-juice-lime
|
||||
physicalDesc: reagent-physical-desc-citric
|
||||
flavor: sour
|
||||
@@ -84,7 +84,7 @@
|
||||
- type: reagent
|
||||
id: JuiceOrange
|
||||
name: reagent-name-juice-orange
|
||||
parent: BaseDrink
|
||||
parent: BaseJuice
|
||||
desc: reagent-desc-juice-orange
|
||||
physicalDesc: reagent-physical-desc-citric
|
||||
flavor: orange
|
||||
@@ -93,7 +93,7 @@
|
||||
- type: reagent
|
||||
id: JuicePineapple
|
||||
name: reagent-name-juice-pineapple
|
||||
parent: BaseDrink
|
||||
parent: BaseJuice
|
||||
desc: reagent-desc-juice-pineapple
|
||||
physicalDesc: reagent-physical-desc-tropical
|
||||
flavor: pineapple
|
||||
@@ -102,7 +102,7 @@
|
||||
- type: reagent
|
||||
id: JuicePotato
|
||||
name: reagent-name-juice-potato
|
||||
parent: BaseDrink
|
||||
parent: BaseJuice
|
||||
desc: reagent-desc-juice-potato
|
||||
physicalDesc: reagent-physical-desc-starchy
|
||||
flavor: potatoes
|
||||
@@ -111,7 +111,7 @@
|
||||
- type: reagent
|
||||
id: JuiceTomato
|
||||
name: reagent-name-juice-tomato
|
||||
parent: BaseDrink
|
||||
parent: BaseJuice
|
||||
desc: reagent-desc-juice-tomato
|
||||
physicalDesc: reagent-physical-desc-saucey
|
||||
flavor: tomato
|
||||
@@ -120,7 +120,7 @@
|
||||
- type: reagent
|
||||
id: JuiceWatermelon
|
||||
name: reagent-name-juice-watermelon
|
||||
parent: BaseDrink
|
||||
parent: BaseJuice
|
||||
desc: reagent-desc-juice-watermelon
|
||||
physicalDesc: reagent-physical-desc-sweet
|
||||
flavor: watermelon
|
||||
|
||||
@@ -38,6 +38,10 @@
|
||||
plantMetabolism:
|
||||
- !type:PlantAdjustWater
|
||||
amount: 0.5
|
||||
footstepSound:
|
||||
collection: FootstepBlood
|
||||
params:
|
||||
volume: 6
|
||||
|
||||
- type: reagent
|
||||
parent: Blood
|
||||
@@ -70,6 +74,10 @@
|
||||
effects:
|
||||
- !type:SatiateHunger
|
||||
factor: 1.5
|
||||
footstepSound:
|
||||
collection: FootstepBlood
|
||||
params:
|
||||
volume: 6
|
||||
|
||||
- type: reagent
|
||||
parent: Blood
|
||||
@@ -136,6 +144,10 @@
|
||||
plantMetabolism:
|
||||
- !type:PlantAdjustWater
|
||||
amount: 0.5
|
||||
footstepSound:
|
||||
collection: FootstepBlood
|
||||
params:
|
||||
volume: 6
|
||||
|
||||
- type: reagent
|
||||
id: Fat
|
||||
@@ -146,6 +158,10 @@
|
||||
color: "#d8d8b0"
|
||||
physicalDesc: reagent-physical-desc-exotic-smelling
|
||||
slippery: false
|
||||
footstepSound:
|
||||
collection: FootstepBlood
|
||||
params:
|
||||
volume: 6
|
||||
|
||||
- type: reagent
|
||||
id: Vomit
|
||||
@@ -164,3 +180,7 @@
|
||||
- !type:AdjustReagent
|
||||
reagent: Nutriment
|
||||
amount: 0.1
|
||||
footstepSound:
|
||||
collection: FootstepBlood
|
||||
params:
|
||||
volume: 6
|
||||
@@ -184,3 +184,13 @@
|
||||
id: FootstepSlip
|
||||
files:
|
||||
- /Audio/Effects/slip.ogg
|
||||
|
||||
- type: soundCollection
|
||||
id: FootstepBlood
|
||||
files:
|
||||
- /Audio/Effects/Footsteps/gib_step.ogg
|
||||
|
||||
- type: soundCollection
|
||||
id: FootstepSticky
|
||||
files:
|
||||
- /Audio/Effects/Footsteps/meatslap.ogg
|
||||
@@ -1620,7 +1620,7 @@
|
||||
isSubfloor: false
|
||||
canCrowbar: true
|
||||
footstepSounds:
|
||||
collection: BarestepCarpet
|
||||
collection: FootstepBlood
|
||||
itemDrop: FloorTileItemFlesh
|
||||
friction: 0.05 #slippy
|
||||
heatCapacity: 10000
|
||||
|
||||
Reference in New Issue
Block a user