Skip to content

Commit

Permalink
Merge branch 'master' into holopadfix
Browse files Browse the repository at this point in the history
  • Loading branch information
dootythefrooty committed Feb 1, 2025
2 parents 53f44b2 + b7b7d1c commit befcf9d
Show file tree
Hide file tree
Showing 11 changed files with 161 additions and 21 deletions.
18 changes: 18 additions & 0 deletions Content.Shared/Clothing/Components/EmitsSoundOnMoveComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,22 @@ public sealed partial class EmitsSoundOnMoveComponent : Component
/// </summary>
[ViewVariables(VVAccess.ReadOnly)]
public bool IsSlotValid = true;

/// <summary>
/// If worn, how far the wearer has to walk in order to make a sound.
/// </summary>
[DataField]
public float DistanceWalking = 1.5f;

/// <summary>
/// If worn, how far the wearer has to sprint in order to make a sound.
/// </summary>
[DataField]
public float DistanceSprinting = 2f;

/// <summary>
/// Whether or not this item must be worn in order to make sounds.
/// </summary>
[DataField]
public bool RequiresWorn;
}
11 changes: 8 additions & 3 deletions Content.Shared/Clothing/EntitySystems/EmitsSoundOnMoveSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public override void Update(float frameTime)

private void UpdateSound(EntityUid uid, EmitsSoundOnMoveComponent component)
{
if (!_physicsQuery.TryGetComponent(uid, out var physics))
if (!_physicsQuery.TryGetComponent(uid, out var physics)
|| !_timing.IsFirstTimePredicted)
return;

// Space does not transmit sound
Expand All @@ -70,11 +71,15 @@ private void UpdateSound(EntityUid uid, EmitsSoundOnMoveComponent component)
_clothingQuery.TryGetComponent(uid, out var clothing)
&& clothing.InSlot != null
&& component.IsSlotValid;

if (component.RequiresWorn && !isWorn)
return;

// If this entity is worn by another entity, use that entity's coordinates
var coordinates = isWorn ? Transform(parent).Coordinates : Transform(uid).Coordinates;
var distanceNeeded = (isWorn && _moverQuery.TryGetComponent(parent, out var mover) && mover.Sprinting)
? 1.5f // The parent is a mob that is currently sprinting
: 2f; // The parent is not a mob or is not sprinting
? component.DistanceWalking // The parent is a mob that is currently sprinting
: component.DistanceSprinting; // The parent is not a mob or is not sprinting

if (!coordinates.TryDistance(EntityManager, component.LastPosition, out var distance) || distance > distanceNeeded)
component.SoundDistance = distanceNeeded;
Expand Down
8 changes: 8 additions & 0 deletions Resources/Audio/Effects/Footsteps/attributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,11 @@
license: "CC0-1.0"
copyright: "Made by philRacoIndie freesound.org, modified by Skubman"
source: "https://freesound.org/people/nhaudio/sounds/179203/"

- files:
- tacsuit_step_00.ogg
- tacsuit_step_01.ogg
- tacsuit_step_02.ogg
license: "CC-BY-SA-3.0"
copyright: "Made by majormoth(Discord)"
source: "https://discord.com/channels/1301753657024319488/1332696230572331048/1335279751866351759"
Binary file not shown.
Binary file not shown.
Binary file not shown.
20 changes: 20 additions & 0 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11006,3 +11006,23 @@ Entries:
id: 6785
time: '2025-01-31T23:42:34.0000000+00:00'
url: https://github.com/Simple-Station/Einstein-Engines/pull/1694
- author: VMSolidus and MajorMoth
changes:
- type: Add
message: Hardsuits now have sounds made when the wearer moves!
- type: Fix
message: >-
Fixed several bugs with EmitSoundOnMove. It no longer plays the same
sound 7 times in a row for the client. It can now differentiate between
items that must be worn to make sounds and otherwise. It can also have
variable distance needed to travel to make a sound.
- type: Add
message: >-
Hardsuits and Tacsuits are now separated into Light, Medium, and Heavy
categories, with each category having its own sound effects, mass,
throwing statistics, and don/doff time. Most hardsuits are Light. Most
Tacsuits are Medium. Some suits like Warden, Juggernaut, Nukie
Commander, and Mysta Bombsuit are heavy.
id: 6786
time: '2025-02-01T17:46:07.0000000+00:00'
url: https://github.com/Simple-Station/Einstein-Engines/pull/1698
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Standard Combat Hardsuits
- type: entity
parent: ClothingOuterHardsuitBase
parent: ClothingOuterHardsuitBaseMedium
id: ClothingOuterHardsuitCombatStandard
name: combat hardsuit
description: A purpose-built combat suit designed to protect its user against all manner of enemy combatants in low pressure environments.
Expand Down Expand Up @@ -44,7 +44,7 @@

# Medical Combat Hardsuits
- type: entity
parent: ClothingOuterHardsuitBase
parent: ClothingOuterHardsuitBaseMedium
id: ClothingOuterHardsuitCombatMedical
name: medical combat hardsuit
description: A purpose-built combat suit designed to allow its user greater mobility for superior support of friendly units in active combat zones.
Expand Down Expand Up @@ -88,7 +88,7 @@

# Riot Combat Hardsuits
- type: entity
parent: ClothingOuterHardsuitBase
parent: ClothingOuterHardsuitBaseHeavy
id: ClothingOuterHardsuitCombatRiot
name: riot combat hardsuit
description: A purpose-built combat suit designed for crowd control against armed combatants in low pressure environments.
Expand Down Expand Up @@ -132,7 +132,7 @@

# Advanced Combat Hardsuits
- type: entity
parent: ClothingOuterHardsuitBase
parent: ClothingOuterHardsuitBaseHeavy
id: ClothingOuterHardsuitCombatAdvanced
name: advanced combat hardsuit
description: A purpose-built combat suit of second-generation design, providing unparalleled protection against all manner of kinetic forces in low pressure environments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,80 @@
- ItemMask
restitution: 0.3
friction: 0.2
- type: EmitsSoundOnMove
soundCollection:
collection: FootstepHardsuitLight
requiresWorn: true
distanceWalking: 2
distanceSprinting: 3

- type: entity
abstract: true
parent: ClothingOuterHardsuitBase
id: ClothingOuterHardsuitBaseMedium
name: base hardsuit
components:
- type: EmitsSoundOnMove
soundCollection:
collection: FootstepHardsuitMedium
requiresWorn: true
distanceWalking: 2
distanceSprinting: 3
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeAabb
bounds: "-0.25,-0.25,0.25,0.25"
density: 600
mask:
- ItemMask
restitution: 0.3
friction: 0.2
- type: DamageOtherOnHit
damage:
types:
Blunt: 30
staminaCost: 60
soundHit:
collection: MetalThud
- type: Clothing
equipDelay: 4 # For stuff like standard Tacsuits and Heavy Hardsuits.
unequipDelay: 4

- type: entity
abstract: true
parent: ClothingOuterHardsuitBase
id: ClothingOuterHardsuitBaseHeavy
name: base hardsuit
components:
- type: EmitsSoundOnMove
soundCollection:
collection: FootstepHardsuitHeavy
requiresWorn: true
distanceWalking: 2
distanceSprinting: 3
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeAabb
bounds: "-0.25,-0.25,0.25,0.25"
density: 800
mask:
- ItemMask
restitution: 0.3
friction: 0.2
- type: DamageOtherOnHit
damage:
types:
Blunt: 45
staminaCost: 110
soundHit:
collection: MetalThud
- type: Clothing
equipDelay: 5 # For stuff like "Heavy" Tacsuits.
unequipDelay: 5

- type: entity
abstract: true
Expand Down
28 changes: 14 additions & 14 deletions Resources/Prototypes/Entities/Clothing/OuterClothing/hardsuits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@


- type: entity
parent: ClothingOuterHardsuitBase
parent: ClothingOuterHardsuitBaseMedium
id: ClothingOuterHardsuitMaxim
name: salvager maxim hardsuit
description: Fire. Heat. These things forge great weapons, they also forge great salvagers.
Expand Down Expand Up @@ -258,7 +258,7 @@

#Security Hardsuit
- type: entity
parent: ClothingOuterHardsuitBase
parent: ClothingOuterHardsuitBaseMedium
id: ClothingOuterHardsuitSecurity
name: security hardsuit
description: A special suit that protects against hazardous, low pressure environments. Has an additional layer of armor.
Expand Down Expand Up @@ -290,7 +290,7 @@

#Brigmedic Hardsuit
- type: entity
parent: ClothingOuterHardsuitBase
parent: ClothingOuterHardsuitBaseMedium
id: ClothingOuterHardsuitBrigmedic
name: corpsman hardsuit # DeltaV - rename brigmedic to corpsman
description: Special hardsuit of the guardian angel of the brig. It is the medical version of the security hardsuit. # I will fix the rest of this entry later when I resprite sec suits
Expand Down Expand Up @@ -319,7 +319,7 @@

#Warden's Hardsuit
- type: entity
parent: ClothingOuterHardsuitBase
parent: ClothingOuterHardsuitBaseHeavy
id: ClothingOuterHardsuitWarden
name: warden's hardsuit
description: A specialized riot suit geared to combat low pressure environments.
Expand Down Expand Up @@ -351,7 +351,7 @@

#Captain's Hardsuit
- type: entity
parent: ClothingOuterHardsuitBase
parent: ClothingOuterHardsuitBaseMedium
id: ClothingOuterHardsuitCap
name: captain's armored spacesuit
description: A formal armored spacesuit, made for the station's captain.
Expand Down Expand Up @@ -387,7 +387,7 @@

#Chief Engineer's Hardsuit
- type: entity
parent: ClothingOuterHardsuitBase
parent: ClothingOuterHardsuitBaseMedium
id: ClothingOuterHardsuitEngineeringWhite
name: chief engineer's hardsuit
description: A special hardsuit that protects against hazardous, low pressure environments, made for the chief engineer of the station.
Expand Down Expand Up @@ -457,7 +457,7 @@

#Research Director's Hardsuit
- type: entity
parent: ClothingOuterHardsuitBase
parent: ClothingOuterHardsuitBaseHeavy
id: ClothingOuterHardsuitRd
name: experimental research hardsuit
description: A special suit that protects against hazardous, low pressure environments. Has an additional layer of armor.
Expand Down Expand Up @@ -590,13 +590,13 @@
clothingPrototype: ClothingHeadHelmetHardsuitShanlinUnpainted

- type: entity
parent: ClothingOuterHardsuitBase
parent: ClothingOuterHardsuitBaseMedium
id: ClothingOuterHardsuitSyndie
name: blood-red hardsuit
description: A heavily armored hardsuit designed for work in special operations. Property of Gorlex Marauders.
components:
- type: Sprite
sprite: Clothing/OuterClothing/Hardsuits/syndicate-base.rsi
sprite: Clothing/OuterClothing/Hardsuits/syndicate.rsi
- type: Item
size: Huge
- type: Clothing
Expand Down Expand Up @@ -653,7 +653,7 @@

#Syndicate Elite Hardsuit
- type: entity
parent: ClothingOuterHardsuitSyndie
parent: ClothingOuterHardsuitSyndieElite
id: ClothingOuterHardsuitShiweiUnpainted
name: Cybersun tacsuit
description: A special suit that protects against hazardous, low pressure environments. Has radiation shielding.
Expand Down Expand Up @@ -711,7 +711,7 @@

#Syndicate Commander Hardsuit
- type: entity
parent: ClothingOuterHardsuitBase
parent: ClothingOuterHardsuitBaseHeavy
id: ClothingOuterHardsuitSyndieCommander
name: syndicate commander hardsuit
description: A bulked up version of the blood-red hardsuit, purpose-built for the commander of a syndicate operative squad. Has significantly improved armor for those deadly front-lines firefights.
Expand Down Expand Up @@ -745,7 +745,7 @@

#Cybersun Juggernaut Hardsuit
- type: entity
parent: ClothingOuterHardsuitBase
parent: ClothingOuterHardsuitBaseHeavy
id: ClothingOuterHardsuitJuggernaut
name: cybersun juggernaut suit
description: A suit made by the cutting edge R&D department at cybersun to be hyper resilient.
Expand Down Expand Up @@ -1015,7 +1015,7 @@

#Deathsquad
- type: entity
parent: ClothingOuterHardsuitBase
parent: ClothingOuterHardsuitBaseHeavy
id: ClothingOuterHardsuitDeathsquad
name: death squad hardsuit
description: An advanced hardsuit favored by commandos for use in special operations.
Expand Down Expand Up @@ -1051,7 +1051,7 @@

#CBURN Hardsuit
- type: entity
parent: ClothingOuterHardsuitBase
parent: ClothingOuterHardsuitBaseMedium
id: ClothingOuterHardsuitCBURN
name: CBURN exosuit
description: A lightweight yet strong exosuit used for special cleanup operations.
Expand Down
15 changes: 15 additions & 0 deletions Resources/Prototypes/SoundCollections/footsteps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,18 @@
- /Audio/Effects/Footsteps/highheels3.ogg
- /Audio/Effects/Footsteps/highheels4.ogg
- /Audio/Effects/Footsteps/highheels5.ogg

- type: soundCollection
id: FootstepHardsuitLight
files:
- /Audio/Effects/Footsteps/tacsuit_step_01.ogg

- type: soundCollection
id: FootstepHardsuitMedium
files:
- /Audio/Effects/Footsteps/tacsuit_step_02.ogg

- type: soundCollection
id: FootstepHardsuitHeavy
files:
- /Audio/Effects/Footsteps/tacsuit_step_00.ogg

0 comments on commit befcf9d

Please sign in to comment.