Roller Skates (#20257)

* adds roller skates

* removed hascomp and changed addcomp to ensurecomp, modified to _random, _stun

* remove icon from type: sprite

* sorted dependencies

* skates no longer added skater component to user, movmeentspeedmodifier and damagehighspeedimpact had access removed.

* fixes

* fixes
This commit is contained in:
brainfood1183
2023-11-06 02:42:37 +00:00
committed by GitHub
parent 4cacb7b9e3
commit 40b36d1dc5
14 changed files with 118 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
using Content.Shared.Clothing;
using Content.Shared.Inventory.Events;
using Content.Shared.Movement.Systems;
using Content.Server.Damage.Systems;
namespace Content.Server.Clothing;
public sealed class SkatesSystem : EntitySystem
{
[Dependency] private readonly MovementSpeedModifierSystem _move = default!;
[Dependency] private readonly DamageOnHighSpeedImpactSystem _impact = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SkatesComponent, GotEquippedEvent>(OnGotEquipped);
SubscribeLocalEvent<SkatesComponent, GotUnequippedEvent>(OnGotUnequipped);
}
public void OnGotUnequipped(EntityUid uid, SkatesComponent component, GotUnequippedEvent args)
{
if (args.Slot == "shoes")
{
_move.ChangeFriction(args.Equipee, 20f, null, 20f);
_impact.ChangeCollide(args.Equipee, 20f, 1f, 2f);
}
}
private void OnGotEquipped(EntityUid uid, SkatesComponent component, GotEquippedEvent args)
{
if (args.Slot == "shoes")
{
_move.ChangeFriction(args.Equipee, 5f, 5f, 20f);
_impact.ChangeCollide(args.Equipee, 4f, 1f, 2f);
}
}
}

View File

@@ -53,4 +53,15 @@ public sealed class DamageOnHighSpeedImpactSystem : EntitySystem
_audio.PlayPvs(component.SoundHit, uid, AudioParams.Default.WithVariation(0.125f).WithVolume(-0.125f));
_color.RaiseEffect(Color.Red, new List<EntityUid>() { uid }, Filter.Pvs(uid, entityManager: EntityManager));
}
public void ChangeCollide(EntityUid uid, float minimumSpeed, float stunSeconds, float damageCooldown, DamageOnHighSpeedImpactComponent? collide = null)
{
if (!Resolve(uid, ref collide, false))
return;
collide.MinimumSpeed = minimumSpeed;
collide.StunSeconds = stunSeconds;
collide.DamageCooldown = damageCooldown;
Dirty(uid, collide);
}
}

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Clothing;
[RegisterComponent]
[NetworkedComponent]
public sealed partial class SkatesComponent : Component
{
}

View File

@@ -2,3 +2,4 @@
"skub" is licensed under CC0.
"sitcom_laugh" taken from Kinoton at https://freesound.org/people/Kinoton/sounds/371562/ under CC0 1.0, clipped by github Henri215, turned into mono by github lapatison
"sitcom_laugh2" taken from mrrap4food at https://freesound.org/people/mrrap4food/sounds/618972/ under CC0 1.0, clipped by Henri215
"skates" taken from PeteBarry at https://freesound.org/people/PeteBarry/sounds/464857/ under CC BY 4.0, shortened by Brainfood1183 (github).

Binary file not shown.

View File

@@ -270,6 +270,7 @@
- id: ClothingShoesClownLarge
- id: ClothingHeadHatMagician
- id: BeachBall
- id: ClothingShoesSkates
- type: entity
id: CrateFunBikeHornImplants

View File

@@ -116,6 +116,8 @@
prob: 0.2
- id: PlushieSnake
prob: 0.2
- id: ClothingShoesSkates
prob: 0.1
- id: ClothingHandsGlovesColorYellow
prob: 0.05
- id: ClothingHandsGlovesFingerlessInsulated

View File

@@ -186,3 +186,28 @@
- type: ClothingSpeedModifier
walkModifier: 0.85
sprintModifier: 0.8
- type: entity
parent: ClothingShoesBaseButcherable
id: ClothingShoesSkates
name: roller skates
description: "Get your skates on!"
components:
- type: Sprite
sprite: Clothing/Shoes/Specific/skates.rsi
- type: Clothing
sprite: Clothing/Shoes/Specific/skates.rsi
clothingVisuals:
shoes:
- state: equipped-FEET
offset: "0, -0.04"
- type: Item
size: 10
sprite: Clothing/Shoes/Specific/skates.rsi
- type: ClothingSpeedModifier
walkModifier: 1.3
sprintModifier: 1.3
- type: Skates
- type: FootstepModifier
footstepSoundCollection:
collection: FootstepSkates

View File

@@ -72,6 +72,11 @@
- /Audio/Effects/Footsteps/jesterstep1.ogg
- /Audio/Effects/Footsteps/jesterstep2.ogg
- type: soundCollection
id: FootstepSkates
files:
- /Audio/Items/Toys/skates.ogg
- type: soundCollection
id: FootstepDuck
files:

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -0,0 +1,26 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Made by brainfood1183 (github)",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "icon"
},
{
"name": "equipped-FEET",
"directions": 4
},
{
"name": "inhand-left",
"directions": 4
},
{
"name": "inhand-right",
"directions": 4
}
]
}