Adds security and clown outfits, and SoundEmitters (#253)

* ports clown and sec outfits

* bikehorn and soundemitters

* very smol bike horn

* working fine sounds

* Oh wow i can do it through github

Co-Authored-By: Pieter-Jan Briers <pieterjan.briers@gmail.com>

* fixes for review

* fixes prototype

* fixing entrypoint
This commit is contained in:
Injazz
2019-06-03 23:16:47 +05:00
committed by Pieter-Jan Briers
parent 1cfdfa12a0
commit c156af34c4
70 changed files with 353 additions and 32 deletions

View File

@@ -178,6 +178,9 @@ namespace Content.Server
factory.Register<CatwalkComponent>(); factory.Register<CatwalkComponent>();
factory.Register<FootstepModifierComponent>();
factory.Register<EmitSoundOnUseComponent>();
IoCManager.Register<ISharedNotifyManager, ServerNotifyManager>(); IoCManager.Register<ISharedNotifyManager, ServerNotifyManager>();
IoCManager.Register<IServerNotifyManager, ServerNotifyManager>(); IoCManager.Register<IServerNotifyManager, ServerNotifyManager>();
IoCManager.Register<IGameTicker, GameTicker>(); IoCManager.Register<IGameTicker, GameTicker>();

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using Robust.Shared.GameObjects;
using Robust.Shared.Log;
using Robust.Shared.Utility;
using YamlDotNet.RepresentationModel;
using Content.Server.Interfaces;
using Content.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
using Content.Server.GameObjects.EntitySystems;
using Robust.Server.GameObjects.EntitySystems;
using Content.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.IoC;
using Robust.Shared.Audio;
namespace Content.Server.GameObjects.Components.Sound
{
/// <summary>
/// Simple sound emitter that emits sound on use in hand
/// </summary>
public class EmitSoundOnUseComponent : Component, IUse
{
/// <inheritdoc />
///
public override string Name => "EmitSoundOnUse";
public string _soundName;
public override void ExposeData(ObjectSerializer serializer)
{
base.ExposeData(serializer);
serializer.DataField(ref _soundName, "sound", "");
}
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
{
if (!string.IsNullOrWhiteSpace(_soundName))
{
Owner.GetComponent<SoundComponent>().Play(_soundName, AudioParams.Default.WithVolume(-2f));
return true;
}
return false;
}
}
}

View File

@@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using Robust.Shared.GameObjects;
using Robust.Shared.Log;
using Robust.Shared.Utility;
using YamlDotNet.RepresentationModel;
using Content.Server.Interfaces;
using Content.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
using Content.Server.GameObjects.EntitySystems;
using Robust.Server.GameObjects.EntitySystems;
using Content.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Audio;
namespace Content.Server.GameObjects.Components.Sound
{
/// <summary>
/// Changes footstep sound
/// </summary>
public class FootstepModifierComponent : Component
{
#pragma warning disable 649
[Dependency] private readonly IPrototypeManager _prototypeManager;
#pragma warning restore 649
/// <inheritdoc />
///
private Random _footstepRandom;
public override string Name => "FootstepModifier";
public string _soundCollectionName;
public override void ExposeData(ObjectSerializer serializer)
{
base.ExposeData(serializer);
serializer.DataField(ref _soundCollectionName, "footstepSoundCollection", "");
}
public override void Initialize()
{
base.Initialize();
_footstepRandom = new Random(Owner.Uid.GetHashCode() ^ DateTime.Now.GetHashCode());
}
public void PlayFootstep()
{
if (!string.IsNullOrWhiteSpace(_soundCollectionName))
{
var soundCollection = _prototypeManager.Index<SoundCollectionPrototype>(_soundCollectionName);
var file = _footstepRandom.Pick(soundCollection.PickFiles);
Owner.GetComponent<SoundComponent>().Play(file, AudioParams.Default.WithVolume(-2f));
}
}
}
}

View File

@@ -21,6 +21,8 @@ using Robust.Shared.Map;
using Robust.Shared.Maths; using Robust.Shared.Maths;
using Robust.Shared.Players; using Robust.Shared.Players;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Content.Server.GameObjects.Components.Sound;
using Content.Shared.GameObjects.Components.Inventory;
namespace Content.Server.GameObjects.EntitySystems namespace Content.Server.GameObjects.EntitySystems
{ {
@@ -149,7 +151,16 @@ namespace Content.Server.GameObjects.EntitySystems
if (mover.StepSoundDistance > distanceNeeded) if (mover.StepSoundDistance > distanceNeeded)
{ {
mover.StepSoundDistance = 0; mover.StepSoundDistance = 0;
PlayFootstepSound(transform.GridPosition); if (mover.Owner.TryGetComponent<InventoryComponent>(out var inventory)
&& inventory.TryGetSlotItem<ItemComponent>(EquipmentSlotDefines.Slots.SHOES, out var item)
&& item.Owner.TryGetComponent<FootstepModifierComponent>(out var modifier))
{
modifier.PlayFootstep();
}
else
{
PlayFootstepSound(transform.GridPosition);
}
} }
} }
} }

Binary file not shown.

Binary file not shown.

View File

@@ -1 +1,4 @@
Sounds in this folder taken from here: https://github.com/discordia-space/CEV-Eris/tree/04f9e57ecf8a1c89ae2cba0f6803b6c5e9887c15/sound/effects/footstep Sounds in this folder taken from here:
https://github.com/discordia-space/CEV-Eris/tree/04f9e57ecf8a1c89ae2cba0f6803b6c5e9887c15/sound/effects/footstep
https://github.com/tgstation/tgstation/tree/f8ee37afc00bce1ad421615eaa0e4cbddd5eea90/sound/effects
https://github.com/vgstation-coders/vgstation13/tree/fbe7abec4cbadf2ad01369838828704fd7ca81ea/sound/effects

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -17,3 +17,37 @@
sprite: Clothing/backpack.rsi sprite: Clothing/backpack.rsi
- type: Storage - type: Storage
Capacity: 100 Capacity: 100
- type: entity
parent: BackpackClothing
id: ClownPack
name: Giggles Von Honkerton
description: It's a backpack made by Honk! Co.
components:
- type: Sprite
sprite: Clothing/backpack_clown.rsi
state: icon
- type: Icon
sprite: Clothing/backpack_clown.rsi
state: icon
- type: Clothing
sprite: Clothing/backpack_clown.rsi
- type: entity
parent: BackpackClothing
id: SecPack
name: Security Backpack
description: It's a very robust backpack.
components:
- type: Sprite
sprite: Clothing/backpack_sec.rsi
state: icon
- type: Icon
sprite: Clothing/backpack_sec.rsi
state: icon
- type: Clothing
sprite: Clothing/backpack_sec.rsi

View File

@@ -37,3 +37,18 @@
state: sunglasses state: sunglasses
- type: Clothing - type: Clothing
sprite: Clothing/sunglasses.rsi sprite: Clothing/sunglasses.rsi
- type: entity
parent: GlassesBase
id: SecGlasses
name: Security Sunglasses
description: Strangely ancient technology used to help provide rudimentary eye cover. Enhanced shielding blocks many flashes. Often worn by budget security officers.
components:
- type: Sprite
sprite: Clothing/sunglasses_sec.rsi
state: icon
- type: Icon
sprite: Clothing/sunglasses_sec.rsi
state: icon
- type: Clothing
sprite: Clothing/sunglasses_sec.rsi

View File

@@ -1,18 +1,33 @@
- type: entity - type: entity
parent: Clothing parent: Clothing
id: HelmetSecurity id: BaseHelmet
name: Security Helmet name: Helmet
description: "A slick logo covers the ear: \"Concussions are better than holes!\"" description: "A slick logo covers the ear: \"Concussions are better than holes!\""
components: components:
- type: Sprite - type: Sprite
sprite: Clothing/helmet_sec.rsi sprite: Clothing/helmet_combat.rsi
state: helmet state: helmet
- type: Icon - type: Icon
sprite: Clothing/helmet_sec.rsi sprite: Clothing/helmet_combat.rsi
state: helmet state: helmet
- type: Clothing - type: Clothing
Slots: Slots:
- head - head
sprite: Clothing/helmet_combat.rsi
- type: entity
parent: BaseHelmet
id: HelmetSecurity
name: Tactical Helmet
description: Standard Security gear. Protects the head from impacts. Can be attached with a flashlight.
components:
- type: Sprite
sprite: Clothing/helmet_sec.rsi
state: icon
- type: Icon
sprite: Clothing/helmet_sec.rsi
state: icon
- type: Clothing
sprite: Clothing/helmet_sec.rsi sprite: Clothing/helmet_sec.rsi
- type: entity - type: entity

View File

@@ -33,3 +33,18 @@
state: breath state: breath
- type: Clothing - type: Clothing
sprite: Clothing/mask_breath.rsi sprite: Clothing/mask_breath.rsi
- type: entity
parent: MasksBase
id: MaskClown
name: Clown Wig and Mask
description: A true prankster's facial attire. A clown is incomplete without his wig and mask.
components:
- type: Sprite
sprite: Clothing/mask_clown.rsi
state: icon
- type: Icon
sprite: Clothing/mask_clown.rsi
state: icon
- type: Clothing
sprite: Clothing/mask_clown.rsi

View File

@@ -41,3 +41,45 @@
- type: Clothing - type: Clothing
sprite: Clothing/shoes_white.rsi sprite: Clothing/shoes_white.rsi
- type: entity
parent: ShoesBase
id: ClownShoes
name: Clown Shoes
description: The prankster's standard-issue clowning shoes. Damn they're huge!
components:
- type: Sprite
sprite: Clothing/shoes_clown.rsi
state: icon
- type: Icon
sprite: Clothing/shoes_clown.rsi
state: icon
- type: Clothing
sprite: Clothing/shoes_clown.rsi
- type: Sound
- type: FootstepModifier
footstepSoundCollection: footstep_clown
- type: entity
parent: ShoesBase
id: JackbootShoes
name: Jackboots
description: Nanotrasen-issue Security combat boots for combat scenarios or combat situations. All combat, all the time.
components:
- type: Sprite
sprite: Clothing/shoes_jackboots.rsi
state: icon
- type: Icon
sprite: Clothing/shoes_jackboots.rsi
state: icon
- type: Clothing
sprite: Clothing/shoes_jackboots.rsi
- type: Sound
- type: FootstepModifier
footstepSoundCollection: footstep_heavy

View File

@@ -74,3 +74,37 @@
- type: Clothing - type: Clothing
sprite: Clothing/uniform_assistant.rsi sprite: Clothing/uniform_assistant.rsi
- type: entity
parent: UniformBase
id: UniformClown
name: Clown Suit
description: HONK!
components:
- type: Sprite
sprite: Clothing/uniform_clown.rsi
state: icon
- type: Icon
sprite: Clothing/uniform_clown.rsi
state: icon
- type: Clothing
sprite: Clothing/uniform_clown.rsi
- type: entity
parent: UniformBase
id: UniformSec
name: Security Jumpsuit
description: A jumpsuit made of strong material, providing robust protection.
components:
- type: Sprite
sprite: Clothing/uniform_sec.rsi
state: icon
- type: Icon
sprite: Clothing/uniform_sec.rsi
state: icon
- type: Clothing
sprite: Clothing/uniform_sec.rsi

View File

@@ -114,3 +114,25 @@
state: lantern_off state: lantern_off
- type: PointLight - type: PointLight
state: Off state: Off
- type: entity
name: Bike Horn
parent: BaseItem
id: BikeHorn
description: A horn off of a bicycle.
components:
- type: Sprite
sprite: Objects/bikehorn.rsi
state: icon
- type: Icon
sprite: Objects/bikehorn.rsi
state: icon
- type: Item
Size: 5
sprite: Objects/bikehorn.rsi
- type: Sound
- type: EmitSoundOnUse
sound: /Audio/items/bikehorn.ogg

View File

@@ -25,3 +25,14 @@
- /Audio/effects/footsteps/plating4.ogg - /Audio/effects/footsteps/plating4.ogg
- /Audio/effects/footsteps/plating5.ogg - /Audio/effects/footsteps/plating5.ogg
- type: sound_collection
id: footstep_clown
files:
- /Audio/effects/footsteps/clownstep1.ogg
- /Audio/effects/footsteps/clownstep2.ogg
- type: sound_collection
id: footstep_heavy
files:
- /Audio/effects/footsteps/suitstep1.ogg
- /Audio/effects/footsteps/suitstep2.ogg

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

View File

@@ -0,0 +1 @@
{"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA-3.0", "copyright": "Taken from https://github.com/vgstation-coders/vgstation13 at commit 125c975f1b3bf9826b37029e9ab5a5f89e975a7e", "states": [{"name": "equipped-BACKPACK", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "icon", "directions": 1, "delays": [[1.0]]}, {"name": "inhand-left", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "inhand-right", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}]}

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

View File

@@ -0,0 +1 @@
{"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA-3.0", "copyright": "Taken from https://github.com/vgstation-coders/vgstation13 at commit 125c975f1b3bf9826b37029e9ab5a5f89e975a7e", "states": [{"name": "equipped-BACKPACK", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "icon", "directions": 1, "delays": [[1.0]]}, {"name": "inhand-left", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "inhand-right", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}]}

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

View File

Before

Width:  |  Height:  |  Size: 378 B

After

Width:  |  Height:  |  Size: 378 B

View File

@@ -0,0 +1,26 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-3.0",
"copyright": "Taken from https://github.com/discordia-space/CEV-Eris at commit 9a3a3a180344460263e8df7ea2565128e07b86b5",
"states": [
{
"name": "equipped-HELMET",
"directions": 4,
"delays": [
[ 1.0 ],
[ 1.0 ],
[ 1.0 ],
[ 1.0 ]
]
},
{
"name": "helmet",
"directions": 1,
"delays": [ [ 1.0 ] ]
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 644 B

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

View File

@@ -1,26 +1 @@
{ {"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA-3.0", "copyright": "Taken from https://github.com/vgstation-coders/vgstation13 at commit 125c975f1b3bf9826b37029e9ab5a5f89e975a7e", "states": [{"name": "equipped-HELMET", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "icon", "directions": 1, "delays": [[1.0]]}, {"name": "inhand-left", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "inhand-right", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}]}
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-3.0",
"copyright": "Taken from https://github.com/discordia-space/CEV-Eris at commit 9a3a3a180344460263e8df7ea2565128e07b86b5",
"states": [
{
"name": "equipped-HELMET",
"directions": 4,
"delays": [
[ 1.0 ],
[ 1.0 ],
[ 1.0 ],
[ 1.0 ]
]
},
{
"name": "helmet",
"directions": 1,
"delays": [ [ 1.0 ] ]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

View File

@@ -0,0 +1 @@
{"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA-3.0", "copyright": "Taken from https://github.com/vgstation-coders/vgstation13 at commit 125c975f1b3bf9826b37029e9ab5a5f89e975a7e", "states": [{"name": "equipped-MASK", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "icon", "directions": 1, "delays": [[1.0]]}, {"name": "inhand-left", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "inhand-right", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}]}

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

View File

@@ -0,0 +1 @@
{"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA-3.0", "copyright": "Taken from https://github.com/vgstation-coders/vgstation13 at commit 125c975f1b3bf9826b37029e9ab5a5f89e975a7e", "states": [{"name": "equipped-FEET", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "icon", "directions": 1, "delays": [[1.0]]}, {"name": "inhand-left", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "inhand-right", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}]}

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

View File

@@ -0,0 +1 @@
{"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA-3.0", "copyright": "Taken from https://github.com/vgstation-coders/vgstation13 at commit 125c975f1b3bf9826b37029e9ab5a5f89e975a7e", "states": [{"name": "equipped-FEET", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "icon", "directions": 1, "delays": [[1.0]]}, {"name": "inhand-left", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "inhand-right", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}]}

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

View File

@@ -0,0 +1 @@
{"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA-3.0", "copyright": "Taken from https://github.com/vgstation-coders/vgstation13 at commit 125c975f1b3bf9826b37029e9ab5a5f89e975a7e", "states": [{"name": "equipped-EYES", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "icon", "directions": 1, "delays": [[1.0]]}, {"name": "inhand-left", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "inhand-right", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}]}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

View File

@@ -0,0 +1 @@
{"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA-3.0", "copyright": "Taken from https://github.com/vgstation-coders/vgstation13 at commit 125c975f1b3bf9826b37029e9ab5a5f89e975a7e", "states": [{"name": "equipped-INNERCLOTHING", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "icon", "directions": 1, "delays": [[1.0]]}, {"name": "inhand-left", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "inhand-right", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}]}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

View File

@@ -0,0 +1 @@
{"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA-3.0", "copyright": "Taken from https://github.com/vgstation-coders/vgstation13 at commit 125c975f1b3bf9826b37029e9ab5a5f89e975a7e", "states": [{"name": "equipped-INNERCLOTHING", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "icon", "directions": 1, "delays": [[1.0]]}, {"name": "inhand-left", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "inhand-right", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}]}

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

View File

@@ -0,0 +1 @@
{"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA-3.0", "copyright": "Taken from https://github.com/vgstation-coders/vgstation13 at commit 125c975f1b3bf9826b37029e9ab5a5f89e975a7e", "states": [{"name": "icon", "directions": 1, "delays": [[1.0]]}, {"name": "inhand-left", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}, {"name": "inhand-right", "directions": 4, "delays": [[1.0], [1.0], [1.0], [1.0]]}]}