-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'DeltaV-Station:master' into Byoin-surgery-accommodation
- Loading branch information
Showing
31 changed files
with
262 additions
and
206 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
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
25 changes: 0 additions & 25 deletions
25
Content.Server/Nyanotrasen/Abilities/Borgs/FabricateCandyComponent.cs
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
Content.Server/Nyanotrasen/Abilities/Borgs/FabricateCandySystem.cs
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
Content.Shared/_DV/Silicons/Borgs/FabricateCandyComponent.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,46 @@ | ||
using Content.Shared.Actions; | ||
using Robust.Shared.Audio; | ||
using Robust.Shared.GameStates; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Shared._DV.Silicons.Borgs; | ||
|
||
/// <summary> | ||
/// Lets a medical borg spawn a number of candy items using actions. | ||
/// </summary> | ||
[RegisterComponent, NetworkedComponent] | ||
public sealed partial class FabricateCandyComponent : Component | ||
{ | ||
/// <summary> | ||
/// Actions to add to the entity. | ||
/// </summary> | ||
[DataField(required: true)] | ||
public List<EntProtoId> Actions = new(); | ||
|
||
/// <summary> | ||
/// The sound played when fabricating candy. | ||
/// </summary> | ||
[DataField] | ||
public SoundSpecifier FabricationSound = new SoundPathSpecifier("/Audio/Machines/machine_vend.ogg") | ||
{ | ||
Params = new AudioParams | ||
{ | ||
Volume = -2f | ||
} | ||
}; | ||
} | ||
|
||
/// <summary> | ||
/// Action event to use for candy fabrication actions. | ||
/// </summary> | ||
public sealed partial class FabricateCandyActionEvent : InstantActionEvent | ||
{ | ||
/// <summary> | ||
/// The item to spawn at the borg. | ||
/// </summary> | ||
/// <remarks> | ||
/// The client only sends a <see cref="RequestPerformActionEvent"/>, no exploits possible with this being in the event. | ||
/// </remarks> | ||
[DataField(required: true)] | ||
public EntProtoId Item; | ||
} |
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,45 @@ | ||
using Content.Shared.Actions; | ||
using Content.Shared.Administration.Logs; | ||
using Content.Shared.Database; | ||
using Robust.Shared.Audio.Systems; | ||
using Robust.Shared.Network; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Shared._DV.Silicons.Borgs; | ||
|
||
public sealed partial class FabricateCandySystem : EntitySystem | ||
{ | ||
[Dependency] private readonly INetManager _net = default!; | ||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!; | ||
[Dependency] private readonly SharedActionsSystem _actions = default!; | ||
[Dependency] private readonly SharedAudioSystem _audio = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<FabricateCandyComponent, MapInitEvent>(OnMapInit); | ||
SubscribeLocalEvent<FabricateCandyComponent, FabricateCandyActionEvent>(OnFabricate); | ||
} | ||
|
||
private void OnMapInit(Entity<FabricateCandyComponent> ent, ref MapInitEvent args) | ||
{ | ||
var (uid, comp) = ent; | ||
foreach (var id in comp.Actions) | ||
{ | ||
_actions.AddAction(uid, id); | ||
} | ||
} | ||
|
||
private void OnFabricate(Entity<FabricateCandyComponent> ent, ref FabricateCandyActionEvent args) | ||
{ | ||
_audio.PlayPredicted(ent.Comp.FabricationSound, ent, ent); | ||
args.Handled = true; | ||
|
||
if (_net.IsClient) | ||
return; | ||
|
||
var spawned = Spawn(args.Item, Transform(ent).Coordinates); | ||
_adminLogger.Add(LogType.EntitySpawn, LogImpact.Low, $"{ToPrettyString(ent):player} fabricated {ToPrettyString(spawned):item}"); | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.