[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)
{
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>
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)
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;
+ }
+ }
}
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"
+
\ No newline at end of file
mode: SnapgridCenter
components:
- type: Clickable
- - type: FootstepModifier
- footstepSoundCollection:
- collection: FootstepWater
- params:
- volume: 6
- type: Slippery
launchForwardsMultiplier: 2.0
- type: Transform
amount: 0.1
- !type:PlantAdjustHealth
amount: -0.1
+ footstepSound:
+ collection: FootstepSticky
+ params:
+ volume: 6
- type: reagent
id: BaseAlcohol
amount: 0.25
- !type:PlantAdjustWater
amount: 0.7
+
+- type: reagent
+ id: BaseJuice
+ parent: BaseDrink
+ abstract: true
+ flavor: sweet
+ footstepSound:
+ collection: FootstepSticky
+ params:
+ volume: 6
\ No newline at end of file
metamorphicSprite:
sprite: Objects/Consumable/Drinks/grenadineglass.rsi
state: icon
+ footstepSound:
+ collection: FootstepSticky
+ params:
+ volume: 6
- type: reagent
id: IcedCoffee
- type: reagent
id: JuiceBerryPoison
+ parent: BaseJuice
name: reagent-name-juice-berry-poison
group: Drinks
desc: reagent-desc-juice-berry-poison
- type: reagent
id: Lemonade
+ parent: BaseJuice
name: reagent-name-lemonade
group: Drinks
desc: reagent-desc-lemonade
- type: reagent
id: NuclearCola
+ parent: BaseSoda
name: reagent-name-nuclear-cola
group: Drinks
desc: reagent-desc-nuclear-cola
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
plantMetabolism:
- !type:PlantAdjustWater
amount: 0.5
+ footstepSound:
+ collection: FootstepBlood
+ params:
+ volume: 6
- type: reagent
parent: Blood
effects:
- !type:SatiateHunger
factor: 1.5
+ footstepSound:
+ collection: FootstepBlood
+ params:
+ volume: 6
- type: reagent
parent: Blood
plantMetabolism:
- !type:PlantAdjustWater
amount: 0.5
+ footstepSound:
+ collection: FootstepBlood
+ params:
+ volume: 6
- type: reagent
id: Fat
color: "#d8d8b0"
physicalDesc: reagent-physical-desc-exotic-smelling
slippery: false
+ footstepSound:
+ collection: FootstepBlood
+ params:
+ volume: 6
- type: reagent
id: Vomit
- !type:AdjustReagent
reagent: Nutriment
amount: 0.1
+ footstepSound:
+ collection: FootstepBlood
+ params:
+ volume: 6
\ No newline at end of file
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
\ No newline at end of file
isSubfloor: false
canCrowbar: true
footstepSounds:
- collection: BarestepCarpet
+ collection: FootstepBlood
itemDrop: FloorTileItemFlesh
friction: 0.05 #slippy
heatCapacity: 10000