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:
38
Content.Server/Clothing/Systems/SkatesSystem.cs
Normal file
38
Content.Server/Clothing/Systems/SkatesSystem.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -53,4 +53,15 @@ public sealed class DamageOnHighSpeedImpactSystem : EntitySystem
|
|||||||
_audio.PlayPvs(component.SoundHit, uid, AudioParams.Default.WithVariation(0.125f).WithVolume(-0.125f));
|
_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));
|
_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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
9
Content.Shared/Clothing/Components/SkatesComponent.cs
Normal file
9
Content.Shared/Clothing/Components/SkatesComponent.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
using Robust.Shared.GameStates;
|
||||||
|
|
||||||
|
namespace Content.Shared.Clothing;
|
||||||
|
|
||||||
|
[RegisterComponent]
|
||||||
|
[NetworkedComponent]
|
||||||
|
public sealed partial class SkatesComponent : Component
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -2,3 +2,4 @@
|
|||||||
"skub" is licensed under CC0.
|
"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_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
|
"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).
|
||||||
|
|||||||
BIN
Resources/Audio/Items/Toys/skates.ogg
Normal file
BIN
Resources/Audio/Items/Toys/skates.ogg
Normal file
Binary file not shown.
@@ -270,6 +270,7 @@
|
|||||||
- id: ClothingShoesClownLarge
|
- id: ClothingShoesClownLarge
|
||||||
- id: ClothingHeadHatMagician
|
- id: ClothingHeadHatMagician
|
||||||
- id: BeachBall
|
- id: BeachBall
|
||||||
|
- id: ClothingShoesSkates
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: CrateFunBikeHornImplants
|
id: CrateFunBikeHornImplants
|
||||||
|
|||||||
@@ -116,6 +116,8 @@
|
|||||||
prob: 0.2
|
prob: 0.2
|
||||||
- id: PlushieSnake
|
- id: PlushieSnake
|
||||||
prob: 0.2
|
prob: 0.2
|
||||||
|
- id: ClothingShoesSkates
|
||||||
|
prob: 0.1
|
||||||
- id: ClothingHandsGlovesColorYellow
|
- id: ClothingHandsGlovesColorYellow
|
||||||
prob: 0.05
|
prob: 0.05
|
||||||
- id: ClothingHandsGlovesFingerlessInsulated
|
- id: ClothingHandsGlovesFingerlessInsulated
|
||||||
|
|||||||
@@ -186,3 +186,28 @@
|
|||||||
- type: ClothingSpeedModifier
|
- type: ClothingSpeedModifier
|
||||||
walkModifier: 0.85
|
walkModifier: 0.85
|
||||||
sprintModifier: 0.8
|
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
|
||||||
|
|||||||
@@ -72,6 +72,11 @@
|
|||||||
- /Audio/Effects/Footsteps/jesterstep1.ogg
|
- /Audio/Effects/Footsteps/jesterstep1.ogg
|
||||||
- /Audio/Effects/Footsteps/jesterstep2.ogg
|
- /Audio/Effects/Footsteps/jesterstep2.ogg
|
||||||
|
|
||||||
|
- type: soundCollection
|
||||||
|
id: FootstepSkates
|
||||||
|
files:
|
||||||
|
- /Audio/Items/Toys/skates.ogg
|
||||||
|
|
||||||
- type: soundCollection
|
- type: soundCollection
|
||||||
id: FootstepDuck
|
id: FootstepDuck
|
||||||
files:
|
files:
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
BIN
Resources/Textures/Clothing/Shoes/Specific/skates.rsi/icon.png
Normal file
BIN
Resources/Textures/Clothing/Shoes/Specific/skates.rsi/icon.png
Normal file
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 |
@@ -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
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user