-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add: snatcherprod * fix * Update StunbatonSystem.cs
- Loading branch information
Showing
24 changed files
with
380 additions
and
78 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
4 changes: 4 additions & 0 deletions
4
Content.Server/_White/Melee/Snatch/SnatchOnMeleeHitComponent.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,4 @@ | ||
namespace Content.Server._White.Melee.Snatch; | ||
|
||
[RegisterComponent] | ||
public sealed partial class SnatchOnMeleeHitComponent : Component; |
40 changes: 40 additions & 0 deletions
40
Content.Server/_White/Melee/Snatch/SnatchOnMeleeHitSystem.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,40 @@ | ||
using System.Linq; | ||
using Content.Server.Hands.Systems; | ||
using Content.Server.Item; | ||
using Content.Shared.Hands.Components; | ||
using Content.Shared.Weapons.Melee.Events; | ||
|
||
namespace Content.Server._White.Melee.Snatch; | ||
|
||
public sealed class SnatchOnMeleeHitSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly HandsSystem _hands = default!; | ||
[Dependency] private readonly ItemToggleSystem _itemToggle = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<SnatchOnMeleeHitComponent, MeleeHitEvent>(OnHit); | ||
} | ||
|
||
private void OnHit(EntityUid uid, SnatchOnMeleeHitComponent component, MeleeHitEvent args) | ||
{ | ||
if (!_itemToggle.IsActivated(uid) || args.HitEntities.Count == 0) | ||
return; | ||
|
||
var entity = args.HitEntities.First(); | ||
|
||
if (entity == uid || !TryComp(entity, out HandsComponent? hands)) | ||
return; | ||
|
||
foreach (var heldEntity in _hands.EnumerateHeld(entity, hands)) | ||
{ | ||
if (!_hands.TryDrop(entity, heldEntity, null, false, false, hands)) | ||
continue; | ||
|
||
_hands.PickupOrDrop(args.User, heldEntity, false); | ||
break; | ||
} | ||
} | ||
} |
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
31 changes: 0 additions & 31 deletions
31
Resources/Prototypes/Recipes/Crafting/Graphs/improvised/makeshiftstunprod.yml
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
33 changes: 33 additions & 0 deletions
33
Resources/Prototypes/_White/Entities/Objects/Weapons/Melee/snatcherprod.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,33 @@ | ||
- type: entity | ||
parent: StunprodBase | ||
id: Snatcherprod | ||
name: snatcher prod | ||
description: It sparkles with a thirst for theft and treachery. | ||
components: | ||
- type: Sprite | ||
sprite: _White/Objects/Weapons/Melee/snatcherprod.rsi | ||
layers: | ||
- state: snatcherprod | ||
- state: snatcherprod_on | ||
visible: false | ||
map: [ "enum.ToggleVisuals.Layer" ] | ||
- state: snatcherprod_cell | ||
visible: false | ||
map: [ "enum.PowerDeviceVisualLayers.Powered" ] | ||
- type: Item | ||
sprite: _White/Objects/Weapons/Melee/snatcherprod.rsi | ||
- type: GenericVisualizer | ||
visuals: | ||
enum.ToggleVisuals.Toggled: | ||
enum.ToggleVisuals.Layer: | ||
True: {visible: true} | ||
False: {visible: false} | ||
enum.PowerCellSlotVisuals.Enabled: | ||
enum.PowerDeviceVisualLayers.Powered: | ||
True: {visible: true} | ||
False: {visible: false} | ||
- type: SnatchOnMeleeHit | ||
- type: Construction | ||
deconstructionTarget: cuffs | ||
graph: StunprodGraph | ||
node: snatcherprod |
Oops, something went wrong.