mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
* this is definitely one of the commits * 1 * new facehuggers * suffix * Burst egg * some fix * Update Content.Server/_White/Xenomorphs/Queen/XenomorphQueenSystem.cs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update Content.Server/_White/Xenomorphs/Queen/XenomorphQueenSystem.cs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update Resources/Locale/en-US/_white/objectives/conditions/steal-target-groups.ftl Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update Content.Server/_White/Xenomorphs/FaceHugger/FaceHuggerSystem.cs * Update Content.Server/_White/Xenomorphs/FaceHugger/FaceHuggerSystem.cs * Update Resources/Locale/ru-RU/_white/prototypes/entities/mobs/player/pets.ftl * Update Resources/Locale/ru-RU/WWDP_TRANSLATION/_white/prototypes/entities/structures/storage/glass_box.ftl * Update Resources/Locale/ru-RU/_white/objectives/conditions/steal-target-groups.ftl * Update Content.Server/_White/Xenomorphs/FaceHugger/FaceHuggerSystem.cs * some fix * SelfUnBuckleDelay * Neurotoxin now stun * PlasmaAmmoProvider * some fix * fix * some number --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
30 lines
1.1 KiB
C#
30 lines
1.1 KiB
C#
using Content.Shared._White.Xenomorphs;
|
|
using Content.Shared._White.Xenomorphs.Plasma;
|
|
using Content.Shared.Actions;
|
|
using Content.Shared.Actions.Events;
|
|
|
|
namespace Content.Shared._White.Actions;
|
|
|
|
public sealed class PlasmaCostActionSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly SharedActionsSystem _actions = default!;
|
|
[Dependency] private readonly SharedPlasmaSystem _plasma = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
SubscribeLocalEvent<PlasmaCostActionComponent, ActionRelayedEvent<PlasmaAmountChangeEvent>>(OnPlasmaAmountChange);
|
|
SubscribeLocalEvent<PlasmaCostActionComponent, ActionPerformedEvent>(OnActionPerformed);
|
|
}
|
|
|
|
private void OnPlasmaAmountChange(EntityUid uid, PlasmaCostActionComponent component, ActionRelayedEvent<PlasmaAmountChangeEvent> args)
|
|
{
|
|
_actions.SetEnabled(uid, component.PlasmaCost <= args.Args.Amount);
|
|
}
|
|
|
|
private void OnActionPerformed(EntityUid uid, PlasmaCostActionComponent component, ActionPerformedEvent args)
|
|
{
|
|
if (component.ShouldChangePlasma)
|
|
_plasma.ChangePlasmaAmount(args.Performer, -component.PlasmaCost);
|
|
}
|
|
}
|