forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Miasma improvements (space-wizards#9022)
- Loading branch information
1 parent
2b6c352
commit a1affcc
Showing
15 changed files
with
191 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Content.Shared.Atmos.Miasma; | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Client.Atmos.Miasma; | ||
|
||
[NetworkedComponent, RegisterComponent] | ||
public sealed class FliesComponent : SharedFliesComponent | ||
{ } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using Robust.Client.GameObjects; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Client.Atmos.Miasma; | ||
|
||
public sealed class FliesSystem : EntitySystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
SubscribeLocalEvent<FliesComponent, ComponentStartup>(FliesAdded); | ||
SubscribeLocalEvent<FliesComponent, ComponentShutdown>(FliesRemoved); | ||
} | ||
|
||
private void FliesRemoved(EntityUid uid, FliesComponent component, ComponentShutdown args) | ||
{ | ||
if (!TryComp<SpriteComponent>(uid, out var sprite)) | ||
return; | ||
|
||
if (!sprite.LayerMapTryGet(FliesKey.Key, out var layer)) | ||
return; | ||
|
||
sprite.RemoveLayer(layer); | ||
} | ||
|
||
private void FliesAdded(EntityUid uid, FliesComponent component, ComponentStartup args) | ||
{ | ||
if (!TryComp<SpriteComponent>(uid, out var sprite)) | ||
return; | ||
|
||
if (sprite.LayerMapTryGet(FliesKey.Key, out var _)) | ||
return; | ||
|
||
var layer = sprite.AddLayer(new SpriteSpecifier.Rsi(new ResourcePath("Objects/Misc/flies.rsi"), "flies")); | ||
sprite.LayerMapSet(FliesKey.Key, layer); | ||
} | ||
|
||
private enum FliesKey | ||
{ | ||
Key, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Content.Shared.Atmos.Miasma; | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Server.Atmos.Miasma; | ||
|
||
[NetworkedComponent, RegisterComponent] | ||
public sealed class FliesComponent : SharedFliesComponent | ||
{ | ||
/// Need something to hold the ambient sound, at least until that system becomes more robust | ||
public EntityUid VirtFlies; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace Content.Shared.Atmos.Miasma; | ||
public abstract class SharedFliesComponent : Component | ||
{ | ||
|
||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
flies.ogg taken from https://freesound.org/people/telezon/sounds/321870/ licensed under CC-0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- type: entity | ||
id: AmbientSoundSourceFlies | ||
noSpawn: true | ||
components: | ||
- type: AmbientSound | ||
volume: -5 | ||
range: 3 | ||
sound: | ||
path: /Audio/Ambience/Temporary/flies.ogg | ||
- type: Tag | ||
tags: | ||
- HideContextMenu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"version": 1, | ||
"license": "CC-BY-NC-SA-3.0", | ||
"copyright": "Created by github user @elijahrane", | ||
"size": { | ||
"x": 32, | ||
"y": 32 | ||
}, | ||
"states": [ | ||
{ | ||
"name": "flies", | ||
"directions": 1, | ||
"delays": [ | ||
[ | ||
0.2, | ||
0.2, | ||
0.2, | ||
0.2 | ||
] | ||
] | ||
} | ||
] | ||
} |