-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shock collar and soulbreaker research
- Loading branch information
1 parent
bbe2865
commit 99e8b53
Showing
7 changed files
with
86 additions
and
2 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
Content.Server/Nyanotrasen/Item/ShockCollar/ShockCollarComponent.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,6 @@ | ||
namespace Content.Server.ShockCollar; | ||
|
||
[RegisterComponent] | ||
public sealed partial class ShockCollarComponent : Component | ||
{} | ||
|
31 changes: 31 additions & 0 deletions
31
Content.Server/Nyanotrasen/Item/ShockCollar/ShockCollarSystem.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,31 @@ | ||
using Content.Shared.Mobs.Components; | ||
using Content.Server.Explosion.EntitySystems; // Why is trigger under explosions by the way? Even doors already use it. | ||
using Content.Server.Electrocution; | ||
using Robust.Shared.Containers; | ||
|
||
namespace Content.Server.ShockCollar; | ||
|
||
public sealed partial class ShockCollarSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly SharedContainerSystem _container = default!; | ||
[Dependency] private readonly ElectrocutionSystem _electrocutionSystem = default!; | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<ShockCollarComponent, TriggerEvent>(OnTrigger); | ||
} | ||
|
||
private void OnTrigger(EntityUid uid, ShockCollarComponent component, TriggerEvent args) | ||
{ | ||
if (!_container.TryGetContainingContainer(uid, out var container)) // Try to get the entity directly containing this | ||
return; | ||
|
||
var containerEnt = container.Owner; | ||
|
||
if (!HasComp<MobStateComponent>(containerEnt)) // If it's not a mob we don't care | ||
return; | ||
|
||
_electrocutionSystem.TryDoElectrocution(containerEnt, null, 5, TimeSpan.FromSeconds(2), true); | ||
} | ||
} | ||
|
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
20 changes: 20 additions & 0 deletions
20
Resources/Prototypes/Nyanotrasen/Entities/Objects/Devices/shock_collar.yml
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,20 @@ | ||
- type: entity | ||
parent: ClothingNeckBase | ||
id: ShockCollar | ||
name: shock collar | ||
description: Shocking. Placeholder sprite. | ||
components: | ||
- type: Sprite | ||
sprite: Nyanotrasen/Clothing/Neck/Misc/shock.rsi | ||
- type: Clothing | ||
sprite: Nyanotrasen/Clothing/Neck/Misc/shock.rsi | ||
- type: ShockCollar | ||
- type: TriggerOnSignal | ||
- type: DeviceNetwork | ||
deviceNetId: Wireless | ||
receiveFrequencyId: BasicDevice | ||
- type: WirelessNetworkConnection | ||
range: 200 | ||
- type: DeviceLinkSink | ||
ports: | ||
- Trigger |
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