Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xenowears #519

Merged
merged 54 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
d75250d
Xenowears
FoxxoTrystan Jul 6, 2024
e80c764
Oops
FoxxoTrystan Jul 6, 2024
cc5414f
Update mantles.yml
FoxxoTrystan Jul 6, 2024
a8524d7
Tailwag
FoxxoTrystan Jul 9, 2024
8ab671c
Merge branch 'master' into Xenowear
FoxxoTrystan Jul 9, 2024
28e345b
oops
FoxxoTrystan Jul 9, 2024
a603b30
Merge branch 'master' into Xenowear
FoxxoTrystan Jul 9, 2024
1371b09
Merge branch 'master' into Xenowear
FoxxoTrystan Jul 9, 2024
fc018e5
Merge branch 'master' into Xenowear
FoxxoTrystan Jul 9, 2024
cd0bf23
Merge branch 'master' into Xenowear
FoxxoTrystan Jul 10, 2024
6784da1
Merge branch 'master' into Xenowear
FoxxoTrystan Jul 13, 2024
8c03e4b
Merge branch 'Simple-Station:master' into Xenowear
FoxxoTrystan Jul 15, 2024
719bb42
Update neck.yml
FoxxoTrystan Jul 19, 2024
55403e7
Merge branch 'master' into Xenowear
FoxxoTrystan Jul 19, 2024
fde7559
Merge branch 'master' into Xenowear
FoxxoTrystan Jul 20, 2024
706ba96
Requested Changes
FoxxoTrystan Jul 20, 2024
bbe1ae7
Update EmitsSoundOnMoveSystem.cs
FoxxoTrystan Jul 20, 2024
019d300
Merge branch 'master' into Xenowear
FoxxoTrystan Jul 21, 2024
37a3022
Merge branch 'Simple-Station:master' into Xenowear
FoxxoTrystan Jul 24, 2024
bc27467
Merge branch 'master' into Xenowear
FoxxoTrystan Jul 30, 2024
042bb45
Merge branch 'master' into Xenowear
FoxxoTrystan Aug 1, 2024
7e2b6dd
Removed TailWagging
FoxxoTrystan Aug 1, 2024
bd8e17f
Update WaggingSystem.cs
FoxxoTrystan Aug 1, 2024
00136a8
Update WaggingSystem.cs
FoxxoTrystan Aug 1, 2024
61c52b6
Update vulpkanin.yml
FoxxoTrystan Aug 1, 2024
fe2e4c1
Apply suggestions from code review
FoxxoTrystan Aug 1, 2024
991a5f4
Update meta.json
FoxxoTrystan Aug 1, 2024
50aba46
Update meta.json
FoxxoTrystan Aug 1, 2024
657ef43
format
FoxxoTrystan Aug 1, 2024
de92a82
Merge branch 'Xenowear' of https://github.com/FoxxoTrystan/Einstein-E…
FoxxoTrystan Aug 1, 2024
5e1ceb2
Update vulpkanin.ftl
FoxxoTrystan Aug 1, 2024
2909755
Apply suggestions from code review
FoxxoTrystan Aug 1, 2024
8e25fb2
Update neck.yml
FoxxoTrystan Aug 1, 2024
674d92e
Update misc.yml
FoxxoTrystan Aug 1, 2024
6789498
Update clothwarps.yml
FoxxoTrystan Aug 1, 2024
c83e991
ye
FoxxoTrystan Aug 1, 2024
830a142
Merge branch 'Xenowear' of https://github.com/FoxxoTrystan/Einstein-E…
FoxxoTrystan Aug 1, 2024
cb629b8
Update clothwarps.yml
FoxxoTrystan Aug 1, 2024
c9d15d9
Merge branch 'master' into Xenowear
FoxxoTrystan Aug 1, 2024
a6dffca
Merge branch 'master' into Xenowear
VMSolidus Aug 1, 2024
5113905
Merge remote-tracking branch 'upstream/master' into Xenowear
FoxxoTrystan Aug 6, 2024
a2d944f
fixes?
FoxxoTrystan Aug 6, 2024
adb58d8
pain
FoxxoTrystan Aug 6, 2024
5df91d5
stap!
FoxxoTrystan Aug 6, 2024
dd5aabe
Merge branch 'master' into Xenowear
VMSolidus Aug 6, 2024
f9431e1
Merge branch 'master' into Xenowear
FoxxoTrystan Aug 11, 2024
18617ff
Update vulpkanin.yml
FoxxoTrystan Aug 12, 2024
41067af
Update interaction-popup-component.ftl
FoxxoTrystan Aug 12, 2024
4b95e1f
Merge branch 'master' into Xenowear
FoxxoTrystan Aug 12, 2024
0cce9cd
Update meta.json
FoxxoTrystan Aug 13, 2024
dea0aaf
Update meta.json
FoxxoTrystan Aug 13, 2024
7e62550
Update meta.json
FoxxoTrystan Aug 13, 2024
34c5e0f
Update meta.json
FoxxoTrystan Aug 13, 2024
5e35d63
Merge branch 'master' into Xenowear
FoxxoTrystan Aug 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions Content.Shared/Clothing/Components/EmitsSoundOnMoveComponent.cs
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
FoxxoTrystan marked this conversation as resolved.
Show resolved Hide resolved
{
[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 Content.Shared/Clothing/EntitySystems/EmitsSoundOnMoveSystem.cs
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
FoxxoTrystan marked this conversation as resolved.
Show resolved Hide resolved
{
[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);
}
}
2 changes: 1 addition & 1 deletion Resources/Prototypes/Actions/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -375,4 +375,4 @@
useDelay: 40
event:
!type:FabricateActionEvent
fabrication: FoodGumball
fabrication: FoodGumball
FoxxoTrystan marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion Resources/Prototypes/Catalog/Cargo/cargo_vending.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
sprite: Objects/Specific/Service/vending_machine_restock.rsi
state: base
product: CrateVendingMachineRestockAutoDrobeFilled
cost: 1700
cost: 1730
category: cargoproduct-category-name-service
group: market

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
ClothingEyesGlasses: 6
ClothingHandsGlovesColorBlack: 4
ClothingEyesGlassesCheapSunglasses: 2
ClothingClothWrap: 4
contrabandInventory:
ClothingMaskNeckGaiter: 2
ClothingUniformJumpsuitTacticool: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
ClothingShoesBootsCowboyBlack: 1
ClothingShoesBootsCowboyWhite: 1
ClothingMaskNeckGaiterRed: 2
ClothingNeckBellCollar: 2
ClothingOuterUnathiRobe: 1
emaggedInventory:
ClothingShoesBling: 1
ClothingShoesBootsCowboyFancy: 1
Expand Down
22 changes: 22 additions & 0 deletions Resources/Prototypes/Entities/Clothing/Neck/mantles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,25 @@
sprite: Clothing/Neck/mantles/qmmantle.rsi
- type: Clothing
sprite: Clothing/Neck/mantles/qmmantle.rsi

- type: entity
parent: ClothingNeckBase
id: ClothingNeckOldMantle
name: old wrap
description: A tattered fabric wrap, faded over the years. Smells faintly of cigars.
components:
- type: Sprite
sprite: Clothing/Neck/mantles/oldmantle.rsi
- type: Clothing
sprite: Clothing/Neck/mantles/oldmantle.rsi

- type: entity
parent: ClothingNeckBase
id: ClothingNeckUnathiMantle
name: hide mantle
description: A rather grisly selection of cured hides and skin, sewn together to form a ragged mantle.
components:
- type: Sprite
sprite: Clothing/Neck/mantles/unathimantle.rsi
- type: Clothing
sprite: Clothing/Neck/mantles/unathimantle.rsi
14 changes: 14 additions & 0 deletions Resources/Prototypes/Entities/Clothing/Neck/misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,17 @@
event: !type:StethoscopeActionEvent
checkCanInteract: false
priority: -1

- type: entity
parent: ClothingNeckBase
id: ClothingNeckBellCollar
name: bell collar
description: A way to inform others about your presence, or just to annoy everyone around you!
components:
- type: Sprite
sprite: Clothing/Neck/Misc/bellcollar.rsi
- type: Clothing
sprite: Clothing/Neck/Misc/bellcollar.rsi
- type: EmitsSoundOnMove
soundCollection:
collection: FootstepJester
11 changes: 11 additions & 0 deletions Resources/Prototypes/Entities/Clothing/OuterClothing/misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -377,3 +377,14 @@
sprite: Clothing/OuterClothing/Misc/red_racoon.rsi
- type: Clothing
sprite: Clothing/OuterClothing/Misc/red_racoon.rsi

- type: entity
parent: ClothingOuterBase
id: ClothingOuterUnathiRobe
name: roughspun robes
description: A traditional Unathi garment.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have Unathi on EE (yet?), we have Lizardpeople.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are the same.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am aware, change the name of the clothing or change the name of the species.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am aware, change the name of the clothing or change the name of the species.

components:
- type: Sprite
sprite: Clothing/OuterClothing/Misc/unathirobe.rsi
- type: Clothing
sprite: Clothing/OuterClothing/Misc/unathirobe.rsi
38 changes: 38 additions & 0 deletions Resources/Prototypes/Entities/Clothing/clothwarps.yml
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.
DEATHB4DEFEAT marked this conversation as resolved.
Show resolved Hide resolved
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
25 changes: 24 additions & 1 deletion Resources/Prototypes/Loadouts/neck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,30 @@
items:
- ClothingNeckHeadphones

- type: loadout
id: LoadoutNeckBellCollar
category: Neck
cost: 2
exclusive: true
items:
- ClothingNeckBellCollar

- type: loadout
id: LoadoutNeckOldMantle
category: Neck
cost: 1
exclusive: true
items:
- ClothingNeckOldMantle

- type: loadout
id: LoadoutNeckUnathiMantle
category: Neck
cost: 1
exclusive: true
items:
- ClothingNeckUnathiMantle

# Scarves
- type: loadout
id: LoadoutNeckScarfStripedRed
Expand Down Expand Up @@ -120,7 +144,6 @@
items:
- ClothingNeckTieGreen


#Pride Accessories
- type: loadout
id: LoadoutItemsPrideLGBTPin
Expand Down
9 changes: 8 additions & 1 deletion Resources/Prototypes/Loadouts/shoes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@
items:
- ClothingUnderSocksCoder

# Socks
- type: loadout
id: LoadoutShoesUnderSocksBee
category: Shoes
Expand All @@ -355,3 +354,11 @@
- Harpy
items:
- ClothingUnderSocksBee

- type: loadout
id: LoadoutShoesClothWrap
category: Shoes
cost: 1
exclusive: true
items:
- ClothingClothWrap
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
11 changes: 11 additions & 0 deletions Resources/Prototypes/Recipes/Construction/clothing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,14 @@
description: Comfy, yet haunted by the ghosts of ducks you fed bread to as a child.
icon: { sprite: Clothing/Shoes/Misc/duck-slippers.rsi, state: icon }
objectType: Item

- type: construction
name: cloth wraps
id: ClothingClothWrap
graph: ClothingClothWrap
startNode: start
targetNode: shoes
category: construction-category-clothing
description: A roll of treated canvas used for wrapping claws or paws.
icon: { sprite: Clothing/Shoes/Misc/clothWrap.rsi, state: icon }
objectType: Item
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.
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 Resources/Textures/Clothing/Neck/Misc/bellcollar.rsi/meta.json
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
}
]
}
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 Resources/Textures/Clothing/Neck/mantles/oldmantle.rsi/meta.json
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
}
]
}
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
Loading