forked from space-syndicate/space-station-14-next
-
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.
Дворфы больше не бесполезны. (space-syndicate#144)
* innate mineral scanner * Update Resources/Prototypes/Entities/Mobs/Species/dwarf.yml Co-authored-by: lzk <[email protected]> * Update Dwarf.xml --------- Co-authored-by: lzk <[email protected]>
- Loading branch information
Showing
5 changed files
with
75 additions
and
4 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
22 changes: 22 additions & 0 deletions
22
Content.Shared/_CorvaxNext/Mining/Components/InnateMiningScannerViewerComponent.cs
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,22 @@ | ||
using Robust.Shared.Audio; | ||
using Robust.Shared.GameStates; | ||
using Content.Shared.Mining; | ||
|
||
namespace Content.Shared._CorvaxNext.Mining.Components; | ||
|
||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(MiningScannerSystem))] | ||
public sealed partial class InnateMiningScannerViewerComponent : Component | ||
{ | ||
[DataField, ViewVariables(VVAccess.ReadOnly), AutoNetworkedField] | ||
public float ViewRange; | ||
|
||
[DataField, AutoNetworkedField] | ||
public float AnimationDuration = 1.5f; | ||
|
||
[DataField, AutoNetworkedField] | ||
public TimeSpan PingDelay = TimeSpan.FromSeconds(5); | ||
|
||
[DataField, AutoNetworkedField] | ||
public SoundSpecifier? PingSound = null; | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
Content.Shared/_CorvaxNext/Mining/MiningScannerSystem.Innate.cs
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,33 @@ | ||
using Content.Shared.Mining.Components; | ||
using Content.Shared._CorvaxNext.Mining.Components; | ||
|
||
namespace Content.Shared.Mining; | ||
|
||
public sealed partial class MiningScannerSystem : EntitySystem | ||
{ | ||
|
||
/// <inheritdoc/> | ||
public void CNInitialize() | ||
{ | ||
SubscribeLocalEvent<InnateMiningScannerViewerComponent, ComponentStartup>(OnStartup); | ||
} | ||
|
||
private void OnStartup(Entity<InnateMiningScannerViewerComponent> ent, ref ComponentStartup args) | ||
{ | ||
if (!HasComp<MiningScannerViewerComponent>(ent)) | ||
{ | ||
SetupInnateMiningViewerComponent(ent); | ||
} | ||
} | ||
|
||
private void SetupInnateMiningViewerComponent(Entity<InnateMiningScannerViewerComponent> ent) | ||
{ | ||
var comp = EnsureComp<MiningScannerViewerComponent>(ent); | ||
comp.ViewRange = ent.Comp.ViewRange; | ||
comp.PingDelay = ent.Comp.PingDelay; | ||
comp.PingSound = ent.Comp.PingSound; | ||
comp.QueueRemoval = false; | ||
comp.NextPingTime = _timing.CurTime + ent.Comp.PingDelay; | ||
Dirty(ent.Owner, comp); | ||
} | ||
} |
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