This repository has been archived by the owner on Sep 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Plushie' of https://github.com/AtaraxiaSpaceFoundation/…
…ataraxia-station-14 into Plushie
- Loading branch information
Showing
29 changed files
with
346 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
Content.Shared/Clothing/Components/EmitsSoundOnMoveComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using Robust.Shared.Audio; | ||
using Robust.Shared.GameStates; | ||
using Robust.Shared.Map; | ||
|
||
namespace Content.Shared.Clothing.Components; | ||
|
||
/// <summary> | ||
/// Indicates that the clothing entity emits sound when it moves. | ||
/// </summary> | ||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] | ||
public sealed partial class EmitsSoundOnMoveComponent : Component | ||
{ | ||
[ViewVariables(VVAccess.ReadWrite)] | ||
[DataField(required: true), AutoNetworkedField] | ||
public SoundSpecifier SoundCollection = default!; | ||
|
||
[ViewVariables(VVAccess.ReadWrite)] | ||
[DataField("requiresGravity"), AutoNetworkedField] | ||
public bool RequiresGravity = true; | ||
|
||
[ViewVariables(VVAccess.ReadOnly)] | ||
public EntityCoordinates LastPosition = EntityCoordinates.Invalid; | ||
|
||
/// <summary> | ||
/// The distance moved since the played sound. | ||
/// </summary> | ||
[ViewVariables(VVAccess.ReadOnly)] | ||
public float SoundDistance = 0f; | ||
|
||
/// <summary> | ||
/// Whether this item is equipped in a inventory item slot. | ||
/// </summary> | ||
[ViewVariables(VVAccess.ReadOnly)] | ||
public bool IsSlotValid = true; | ||
} |
96 changes: 96 additions & 0 deletions
96
Content.Shared/Clothing/EntitySystems/EmitsSoundOnMoveSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
using System.Numerics; | ||
using Content.Shared.Clothing.Components; | ||
using Content.Shared.Gravity; | ||
using Content.Shared.Inventory; | ||
using Content.Shared.Inventory.Events; | ||
using Content.Shared.Mobs.Components; | ||
using Content.Shared.Movement.Components; | ||
using Robust.Shared.Audio.Systems; | ||
using Robust.Shared.Physics.Components; | ||
using Robust.Shared.Timing; | ||
|
||
namespace Content.Shared.Clothing.Systems; | ||
|
||
public sealed class EmitsSoundOnMoveSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly SharedAudioSystem _audio = default!; | ||
[Dependency] private readonly SharedMapSystem _grid = default!; | ||
[Dependency] private readonly SharedGravitySystem _gravity = default!; | ||
[Dependency] private readonly IGameTiming _timing = default!; | ||
|
||
private EntityQuery<InputMoverComponent> _moverQuery; | ||
private EntityQuery<PhysicsComponent> _physicsQuery; | ||
private EntityQuery<ClothingComponent> _clothingQuery; | ||
|
||
public override void Initialize() | ||
{ | ||
_moverQuery = GetEntityQuery<InputMoverComponent>(); | ||
_physicsQuery = GetEntityQuery<PhysicsComponent>(); | ||
_clothingQuery = GetEntityQuery<ClothingComponent>(); | ||
|
||
SubscribeLocalEvent<EmitsSoundOnMoveComponent, GotEquippedEvent>(OnEquipped); | ||
SubscribeLocalEvent<EmitsSoundOnMoveComponent, GotUnequippedEvent>(OnUnequipped); | ||
} | ||
|
||
private void OnEquipped(EntityUid uid, EmitsSoundOnMoveComponent component, GotEquippedEvent args) | ||
{ | ||
component.IsSlotValid = !args.SlotFlags.HasFlag(SlotFlags.POCKET); | ||
} | ||
|
||
private void OnUnequipped(EntityUid uid, EmitsSoundOnMoveComponent component, GotUnequippedEvent args) | ||
{ | ||
component.IsSlotValid = true; | ||
} | ||
|
||
public override void Update(float frameTime) | ||
{ | ||
var query = EntityQueryEnumerator<EmitsSoundOnMoveComponent>(); | ||
while (query.MoveNext(out var uid, out var comp)) | ||
{ | ||
UpdateSound(uid, comp); | ||
} | ||
query.Dispose(); | ||
} | ||
|
||
private void UpdateSound(EntityUid uid, EmitsSoundOnMoveComponent component) | ||
{ | ||
if (!_physicsQuery.TryGetComponent(uid, out var physics)) | ||
return; | ||
|
||
// Space does not transmit sound | ||
if (Transform(uid).GridUid == null) | ||
return; | ||
|
||
if (component.RequiresGravity && _gravity.IsWeightless(uid, physics, Transform(uid))) | ||
return; | ||
|
||
var parent = Transform(uid).ParentUid; | ||
|
||
var isWorn = parent is { Valid: true } && | ||
_clothingQuery.TryGetComponent(uid, out var clothing) | ||
&& clothing.InSlot != null | ||
&& component.IsSlotValid; | ||
// 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 | ||
|
||
if (!coordinates.TryDistance(EntityManager, component.LastPosition, out var distance) || distance > distanceNeeded) | ||
component.SoundDistance = distanceNeeded; | ||
else | ||
component.SoundDistance += distance; | ||
|
||
component.LastPosition = coordinates; | ||
if (component.SoundDistance < distanceNeeded) | ||
return; | ||
component.SoundDistance -= distanceNeeded; | ||
|
||
var sound = component.SoundCollection; | ||
var audioParams = sound.Params | ||
.WithVolume(sound.Params.Volume) | ||
.WithVariation(sound.Params.Variation ?? 0f); | ||
|
||
_audio.PlayPredicted(sound, uid, uid, audioParams); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
- type: entity | ||
parent: Clothing | ||
id: ClothingClothWrap | ||
name: cloth wraps | ||
description: A roll of treated canvas used for wrapping claws or paws. | ||
components: | ||
- type: Item | ||
size: Small | ||
storedRotation: -90 | ||
- type: Sprite | ||
state: icon | ||
sprite: Clothing/Shoes/Misc/clothWrap.rsi | ||
- type: Clothing | ||
slots: | ||
- gloves | ||
- FEET | ||
sprite: Clothing/Shoes/Misc/clothWrap.rsi | ||
- type: Construction | ||
graph: ClothingClothWrap | ||
node: shoes | ||
- type: Butcherable | ||
butcheringType: Knife | ||
spawned: | ||
- id: MaterialCloth1 | ||
amount: 1 | ||
- type: Food | ||
requiresSpecialDigestion: true | ||
- type: SolutionContainerManager | ||
solutions: | ||
food: | ||
maxVol: 10 | ||
reagents: | ||
- ReagentId: Fiber | ||
Quantity: 10 | ||
- type: Tag | ||
tags: | ||
- ClothMade | ||
- WhitelistChameleon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,5 @@ | |
- VendingMachineSoda | ||
- VendingMachineStarkist | ||
- VendingMachineSpaceUp | ||
- PrizeCounter # Ataraxia | ||
chance: 1 |
13 changes: 13 additions & 0 deletions
13
Resources/Prototypes/Recipes/Construction/Graphs/clothing/clothwarp.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
- type: constructionGraph | ||
id: ClothingClothWrap | ||
start: start | ||
graph: | ||
- node: start | ||
edges: | ||
- to: shoes | ||
steps: | ||
- material: Cloth | ||
amount: 2 | ||
doAfter: 1 | ||
- node: shoes | ||
entity: ClothingClothWrap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+4.58 KB
Resources/Textures/Clothing/Neck/Misc/bellcollar.rsi/equipped-NECK.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.05 KB
Resources/Textures/Clothing/Neck/Misc/bellcollar.rsi/inhand-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions
26
Resources/Textures/Clothing/Neck/Misc/bellcollar.rsi/meta.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"version": 1, | ||
"license": "CC-BY-SA-3.0", | ||
"copyright": "Made by mnemotechnician (GitHub)", | ||
"size": { | ||
"x": 32, | ||
"y": 32 | ||
}, | ||
"states": [ | ||
{ | ||
"name": "icon" | ||
}, | ||
{ | ||
"name": "equipped-NECK", | ||
"directions": 4 | ||
}, | ||
{ | ||
"name": "inhand-left", | ||
"directions": 4 | ||
}, | ||
{ | ||
"name": "inhand-right", | ||
"directions": 4 | ||
} | ||
] | ||
} |
Binary file added
BIN
+568 Bytes
Resources/Textures/Clothing/Neck/mantles/oldmantle.rsi/equipped-NECK.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions
18
Resources/Textures/Clothing/Neck/mantles/oldmantle.rsi/meta.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"version": 1, | ||
"license": "CC-BY-SA-3.0", | ||
"copyright": "Taken from https://github.com/ParadiseSS13/Paradise/blob/master/icons/mob/clothing/suit.dmi", | ||
"size": { | ||
"x": 32, | ||
"y": 32 | ||
}, | ||
"states": [ | ||
{ | ||
"name": "icon" | ||
}, | ||
{ | ||
"name": "equipped-NECK", | ||
"directions": 4 | ||
} | ||
] | ||
} |
Binary file added
BIN
+1.05 KB
Resources/Textures/Clothing/Neck/mantles/unathimantle.rsi/equipped-NECK.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions
18
Resources/Textures/Clothing/Neck/mantles/unathimantle.rsi/meta.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"version": 1, | ||
"license": "CC-BY-SA-3.0", | ||
"copyright": "Taken from https://github.com/ParadiseSS13/Paradise/blob/master/icons/mob/clothing/suit.dmi", | ||
"size": { | ||
"x": 32, | ||
"y": 32 | ||
}, | ||
"states": [ | ||
{ | ||
"name": "icon" | ||
}, | ||
{ | ||
"name": "equipped-NECK", | ||
"directions": 4 | ||
} | ||
] | ||
} |
Binary file added
BIN
+1.37 KB
.../Textures/Clothing/OuterClothing/Misc/unathirobe.rsi/equipped-OUTERCLOTHING.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+582 Bytes
Resources/Textures/Clothing/OuterClothing/Misc/unathirobe.rsi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions
18
Resources/Textures/Clothing/OuterClothing/Misc/unathirobe.rsi/meta.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"version": 1, | ||
"license": "CC-BY-SA-3.0", | ||
"copyright": "Taken from https://github.com/ParadiseSS13/Paradise/blob/master/icons/mob/clothing/suit.dmi", | ||
"size": { | ||
"x": 32, | ||
"y": 32 | ||
}, | ||
"states": [ | ||
{ | ||
"name": "icon" | ||
}, | ||
{ | ||
"name": "equipped-OUTERCLOTHING", | ||
"directions": 4 | ||
} | ||
] | ||
} |
Binary file added
BIN
+315 Bytes
Resources/Textures/Clothing/Shoes/Misc/clothWrap.rsi/equipped-FEET.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+469 Bytes
Resources/Textures/Clothing/Shoes/Misc/clothWrap.rsi/equipped-HAND.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
Resources/Textures/Clothing/Shoes/Misc/clothWrap.rsi/meta.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"version": 1, | ||
"license": "CC-BY-SA-3.0", | ||
"copyright": "Taken from https://github.com/ParadiseSS13/Paradise/blob/master/icons/mob/clothing/feet.dmi / https://github.com/ParadiseSS13/Paradise/blob/master/icons/mob/clothing/hands.dmi", | ||
"size": { | ||
"x": 32, | ||
"y": 32 | ||
}, | ||
"states": [ | ||
{ | ||
"name": "icon" | ||
}, | ||
{ | ||
"name": "equipped-FEET", | ||
"directions": 4 | ||
}, | ||
{ | ||
"name": "equipped-HAND", | ||
"directions": 4 | ||
} | ||
] | ||
} |