Adds sound to fire extinguisher safety (#4494)
This commit is contained in:
@@ -79,6 +79,9 @@ namespace Content.Server.Fluids.Components
|
||||
[DataField("spraySound", required: true)]
|
||||
public SoundSpecifier SpraySound { get; } = default!;
|
||||
|
||||
[DataField("safetySound")]
|
||||
public SoundSpecifier SafetySound { get; } = new SoundPathSpecifier("/Audio/Machines/button.ogg");
|
||||
|
||||
public ReagentUnit CurrentVolume => Owner.GetComponentOrNull<SolutionContainerComponent>()?.CurrentVolume ?? ReagentUnit.Zero;
|
||||
|
||||
protected override void Initialize()
|
||||
@@ -200,6 +203,7 @@ namespace Content.Server.Fluids.Components
|
||||
|
||||
private void ToggleSafety(IEntity user)
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(Owner), SafetySound.GetSound(), Owner, AudioHelpers.WithVariation(0.125f).WithVolume(-4f));
|
||||
SetSafety(user, !_safety);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,44 +4,45 @@
|
||||
id: FireExtinguisher
|
||||
description: It extinguishes fires.
|
||||
components:
|
||||
- type: Sprite
|
||||
sprite: Objects/Misc/fire_extinguisher.rsi
|
||||
layers:
|
||||
- state: fire_extinguisher_closed
|
||||
map: [ "enum.SprayVisualLayers.Base" ]
|
||||
- type: Item
|
||||
sprite: Objects/Misc/fire_extinguisher.rsi
|
||||
size: 10
|
||||
- type: SolutionContainer
|
||||
maxVol: 100
|
||||
caps: Refillable, Drainable
|
||||
contents:
|
||||
reagents:
|
||||
- ReagentId: Water
|
||||
Quantity: 100
|
||||
- type: ItemCooldown
|
||||
- type: Spray
|
||||
spraySound:
|
||||
path: /Audio/Effects/extinguish.ogg
|
||||
sprayedPrototype: ExtinguisherSpray
|
||||
hasSafety: true
|
||||
vaporAmount: 3
|
||||
vaporSpread: 90
|
||||
sprayVelocity: 2.0
|
||||
sprayTimeAlive: 1.5
|
||||
transferAmount: 5
|
||||
impulse: 50.0
|
||||
- type: FireExtinguisher
|
||||
- type: MeleeWeapon
|
||||
damage: 10
|
||||
damageType: Blunt
|
||||
hitSound:
|
||||
path: /Audio/Weapons/smash.ogg
|
||||
- type: Appearance
|
||||
visuals:
|
||||
- type: SprayVisualizer
|
||||
safety_on_state: fire_extinguisher_closed
|
||||
safety_off_state: fire_extinguisher_open
|
||||
- type: Sprite
|
||||
netsync: false
|
||||
sprite: Objects/Misc/fire_extinguisher.rsi
|
||||
layers:
|
||||
- state: fire_extinguisher_closed
|
||||
map: [ "enum.SprayVisualLayers.Base" ]
|
||||
- type: Item
|
||||
sprite: Objects/Misc/fire_extinguisher.rsi
|
||||
size: 10
|
||||
- type: SolutionContainer
|
||||
maxVol: 100
|
||||
caps: Refillable, Drainable
|
||||
contents:
|
||||
reagents:
|
||||
- ReagentId: Water
|
||||
Quantity: 100
|
||||
- type: ItemCooldown
|
||||
- type: Spray
|
||||
spraySound:
|
||||
path: /Audio/Effects/extinguish.ogg
|
||||
sprayedPrototype: ExtinguisherSpray
|
||||
hasSafety: true
|
||||
vaporAmount: 3
|
||||
vaporSpread: 90
|
||||
sprayVelocity: 2.0
|
||||
sprayTimeAlive: 1.5
|
||||
transferAmount: 5
|
||||
impulse: 50.0
|
||||
- type: FireExtinguisher
|
||||
- type: MeleeWeapon
|
||||
damage: 10
|
||||
damageType: Blunt
|
||||
hitSound:
|
||||
path: /Audio/Weapons/smash.ogg
|
||||
- type: Appearance
|
||||
visuals:
|
||||
- type: SprayVisualizer
|
||||
safety_on_state: fire_extinguisher_closed
|
||||
safety_off_state: fire_extinguisher_open
|
||||
|
||||
- type: entity
|
||||
name: extinguisher spray
|
||||
@@ -49,24 +50,24 @@
|
||||
parent: Vapor
|
||||
abstract: true
|
||||
components:
|
||||
- type: Sprite
|
||||
sprite: Effects/extinguisherSpray.rsi
|
||||
layers:
|
||||
- state: extinguish
|
||||
map: [ "enum.VaporVisualLayers.Base" ]
|
||||
- type: Physics
|
||||
bodyType: Dynamic
|
||||
fixtures:
|
||||
- shape:
|
||||
!type:PhysShapeAabb
|
||||
bounds: "-0.25,-0.25,0.25,0.25"
|
||||
hard: false
|
||||
mask:
|
||||
- Impassable
|
||||
- MobImpassable
|
||||
- SmallImpassable
|
||||
- type: Appearance
|
||||
visuals:
|
||||
- type: VaporVisualizer
|
||||
animation_delay: 0.8
|
||||
animation_state: extinguish
|
||||
- type: Sprite
|
||||
sprite: Effects/extinguisherSpray.rsi
|
||||
layers:
|
||||
- state: extinguish
|
||||
map: [ "enum.VaporVisualLayers.Base" ]
|
||||
- type: Physics
|
||||
bodyType: Dynamic
|
||||
fixtures:
|
||||
- shape:
|
||||
!type:PhysShapeAabb
|
||||
bounds: "-0.25,-0.25,0.25,0.25"
|
||||
hard: false
|
||||
mask:
|
||||
- Impassable
|
||||
- MobImpassable
|
||||
- SmallImpassable
|
||||
- type: Appearance
|
||||
visuals:
|
||||
- type: VaporVisualizer
|
||||
animation_delay: 0.8
|
||||
animation_state: extinguish
|
||||
|
||||
Reference in New Issue
Block a user