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 17 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
2 changes: 2 additions & 0 deletions Content.Server/Wagging/WaggingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public bool TryToggleWagging(EntityUid uid, WaggingComponent? wagging = null, Hu

wagging.Wagging = !wagging.Wagging;

_actions.SetToggled(wagging.ActionEntity, wagging.Wagging);
FoxxoTrystan marked this conversation as resolved.
Show resolved Hide resolved

for (var idx = 0; idx < markings.Count; idx++) // Animate all possible tails
{
var currentMarkingId = markings[idx].MarkingId;
Expand Down
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);
}
}
32 changes: 5 additions & 27 deletions Resources/Locale/en-US/deltav/markings/vulpkanin.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,6 @@ marking-VulpTailTip-vulp = Vulpkanin tail (base)
marking-VulpTailTip-vulp-tip = Vulpkanin tail (tip)
marking-VulpTailTip = Vulpkanin (tip)

marking-VulpTailWag-vulp_wag = Vulpkanin tail (base)
Copy link
Contributor

Choose a reason for hiding this comment

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

This removes a lot of existing markings, but does not provide a db migration. This can lead to unexpected errors at runtime.

Copy link
Member

Choose a reason for hiding this comment

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

It shouldn't

marking-VulpTailWag-vulp_wag-fade = Vulpkanin tail (fade)
marking-VulpTailWag = Vulpkanin (wag)

marking-VulpTailWagTip-vulp_wag = Vulpkanin tail (base)
marking-VulpTailWagTip-vulp_wag-tip = Vulpkanin tail (tip)
marking-VulpTailWagTip = Vulpkanin (wag, tip)

marking-VulpTailAlt-vulp_alt = Vulpkanin tail (base)
marking-VulpTailAlt-vulp_alt-fade = Vulpkanin tail (fade)
marking-VulpTailAlt = Vulpkanin (alt)
Expand All @@ -130,29 +122,12 @@ marking-VulpTailFoxTip-fox = Fox tail (base)
marking-VulpTailFoxTip-fox-tip = Fox tail (fade)
marking-VulpTailFoxTip = Vulpkanin Fox (tip)

marking-VulpTailFoxWag-fox_wag = Fox tail (base)
marking-VulpTailFoxWag-fox_wag-fade = Fox tail (fade)
marking-VulpTailFoxWag = Vulpkanin Fox (wag)

marking-VulpTailFoxWagTip-fox_wag = Fox tail (base)
marking-VulpTailFoxWagTip-fox_wag-tip = Fox tail (tip)
marking-VulpTailFoxWagTip = Vulpkanin Fox (wag, tip)

marking-VulpTailBushy-bushfluff = Bush tail
marking-VulpTailBushy = Vulpkanin Bush

marking-VulpTailBushyWag-bushfluff_wag = Bush tail
marking-VulpTailBushyWag = Vulpkanin Bush (wag)

marking-VulpTailCoyote-coyote = Coyote tail
marking-VulpTailCoyote = Vulpkanin Coyote

marking-VulpTailCoyoteWag-coyote_wag = Coyote tail
marking-VulpTailCoyoteWag = Vulpkanin Coyote (wag)

marking-VulpTailCorgiWag-corgi_wag = Crogi tail
marking-VulpTailCorgiWag = Vulpkanin Corgi (wag)

marking-VulpTailHusky-husky-inner = Husky tail (inner)
marking-VulpTailHusky-husky-outer = Husky tail (outer)
marking-VulpTailHusky = Vulpkanin Husky
Expand All @@ -176,8 +151,11 @@ marking-VulpTailOtie = Vulpkanin Otie
marking-VulpTailFluffy-fluffy = Fluffy tail
marking-VulpTailFluffy = Vulpkanin Fluffy

marking-VulpTailDalmatianWag-dalmatian_wag = Dalmatian tail
marking-VulpTailDalmatianWag = Vulpkanin Dalmatian (wag)
marking-VulpTailCorgi-corgi = Crogi tail
marking-VulpTailCorgi = Vulpkanin Corgi

marking-VulpTailDalmatian-dalmatian = Dalmatian tail
marking-VulpTailDalmatian = Vulpkanin Dalmatian


marking-VulpBellyCrest-belly_crest = Belly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

petting-success-generic = You pet {THE($target)} on {POSS-ADJ($target)} head.
petting-success-soft-floofy = You pet {THE($target)} on {POSS-ADJ($target)} soft floofy head.
petting-success-generic-others = { CAPITALIZE(THE($user)) } pets {THE($target)}.
FoxxoTrystan marked this conversation as resolved.
Show resolved Hide resolved

petting-success-bingus = You pet {THE($target)} on {POSS-ADJ($target)} wrinkly little head.
petting-success-bird = You pet {THE($target)} on {POSS-ADJ($target)} cute feathery head.
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Actions/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@
noSpawn: true
components:
- type: InstantAction
icon: { sprite: Mobs/Customization/reptilian_parts.rsi, state: tail_smooth_behind }
iconOn: { sprite: Mobs/Customization/reptilian_parts.rsi, state: tail_smooth_behind }
icon: { sprite: Interface/Actions/wagging.rsi, state: icon }
iconOn: { sprite: Interface/Actions/wagging.rsi, state: icon-on }
itemIconStyle: NoItem
useDelay: 1 # emote spam
event: !type:ToggleActionEvent
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
ClothingShoesColorOrange: 2
ClothingShoesColorRed: 2
ClothingShoesColorPurple: 2
ClothingsClothwarp: 4
FoxxoTrystan marked this conversation as resolved.
Show resolved Hide resolved
ClothingHeadHatGreysoft: 8
ClothingHeadHatMimesoft: 3
ClothingHeadHatBluesoft: 2
Expand Down Expand Up @@ -111,6 +112,8 @@
ClothingHandsGlovesColorOrange: 2
ClothingHandsGlovesColorPurple: 2
ClothingEyesGlassesCheapSunglasses: 3
ClothingNeckOldMantle: 2
ClothingNeckUnathiMantle: 2
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
Original file line number Diff line number Diff line change
Expand Up @@ -280,32 +280,32 @@
state: vulp-fade

- type: marking
Copy link
Contributor

Choose a reason for hiding this comment

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

As above, tail changes go into a separate PR

id: VulpTailTip
id: VulpTailAnimated
bodyPart: Tail
markingCategory: Tail
speciesRestriction: [Vulpkanin]
speciesRestriction: []
sprites:
- sprite: DeltaV/Mobs/Customization/Vulpkanin/tail_markings.rsi
state: vulp
state: vulp_wag
- sprite: DeltaV/Mobs/Customization/Vulpkanin/tail_markings.rsi
state: vulp-tip
state: vulp_wag-tip #fade

- type: marking
id: VulpTailWag
id: VulpTailTip
bodyPart: Tail
markingCategory: Tail
speciesRestriction: [Vulpkanin]
sprites:
- sprite: DeltaV/Mobs/Customization/Vulpkanin/tail_markings.rsi
state: vulp_wag
state: vulp
- sprite: DeltaV/Mobs/Customization/Vulpkanin/tail_markings.rsi
state: vulp_wag-tip #fade
state: vulp-tip

- type: marking
id: VulpTailWagTip
id: VulpTailTipAnimated
bodyPart: Tail
markingCategory: Tail
speciesRestriction: [Vulpkanin]
speciesRestriction: []
sprites:
- sprite: DeltaV/Mobs/Customization/Vulpkanin/tail_markings.rsi
state: vulp_wag
Expand Down Expand Up @@ -357,32 +357,32 @@
state: fox-fade

- type: marking
id: VulpTailFoxTip
id: VulpTailFoxAnimated
bodyPart: Tail
markingCategory: Tail
speciesRestriction: [Vulpkanin]
speciesRestriction: []
sprites:
- sprite: DeltaV/Mobs/Customization/Vulpkanin/tail_markings.rsi
state: fox
state: fox_wag
- sprite: DeltaV/Mobs/Customization/Vulpkanin/tail_markings.rsi
state: fox-tip
state: fox_wag-fade

- type: marking
id: VulpTailFoxWag
id: VulpTailFoxTip
bodyPart: Tail
markingCategory: Tail
speciesRestriction: [Vulpkanin]
sprites:
- sprite: DeltaV/Mobs/Customization/Vulpkanin/tail_markings.rsi
state: fox_wag
state: fox
- sprite: DeltaV/Mobs/Customization/Vulpkanin/tail_markings.rsi
state: fox_wag-fade
state: fox-tip

- type: marking
id: VulpTailFoxWagTip
id: VulpTailFoxTipAnimated
bodyPart: Tail
markingCategory: Tail
speciesRestriction: [Vulpkanin]
speciesRestriction: []
sprites:
- sprite: DeltaV/Mobs/Customization/Vulpkanin/tail_markings.rsi
state: fox_wag
Expand All @@ -399,10 +399,10 @@
state: bushfluff

- type: marking
id: VulpTailBushyWag
id: VulpTailBushyAnimated
bodyPart: Tail
markingCategory: Tail
speciesRestriction: [Vulpkanin]
speciesRestriction: []
sprites:
- sprite: DeltaV/Mobs/Customization/Vulpkanin/tail_markings.rsi
state: bushfluff_wag
Expand All @@ -417,19 +417,28 @@
state: coyote

- type: marking
id: VulpTailCoyoteWag
id: VulpTailCoyoteAnimated
bodyPart: Tail
markingCategory: Tail
speciesRestriction: [Vulpkanin]
speciesRestriction: []
sprites:
- sprite: DeltaV/Mobs/Customization/Vulpkanin/tail_markings.rsi
state: coyote_wag

- type: marking
id: VulpTailCorgiWag
id: VulpTailCorgi
bodyPart: Tail
markingCategory: Tail
speciesRestriction: [Vulpkanin]
sprites:
- sprite: DeltaV/Mobs/Customization/Vulpkanin/tail_markings.rsi
state: corgi

- type: marking
id: VulpTailCorgiAnimated
bodyPart: Tail
markingCategory: Tail
speciesRestriction: []
sprites:
- sprite: DeltaV/Mobs/Customization/Vulpkanin/tail_markings.rsi
state: corgi_wag
Expand Down Expand Up @@ -502,10 +511,19 @@
state: fluffy

- type: marking
id: VulpTailDalmatianWag
id: VulpTailDalmatian
bodyPart: Tail
markingCategory: Tail
speciesRestriction: [Vulpkanin]
sprites:
- sprite: DeltaV/Mobs/Customization/Vulpkanin/tail_markings.rsi
state: dalmatian

- type: marking
id: VulpTailDalmatianAnimated
bodyPart: Tail
markingCategory: Tail
speciesRestriction: []
sprites:
- sprite: DeltaV/Mobs/Customization/Vulpkanin/tail_markings.rsi
state: dalmatian_wag
Expand Down
Loading
Loading