change components, remake system

This commit is contained in:
CaYpeN1
2024-03-22 16:27:51 +05:00
parent 2b8d88d707
commit 4b79f1e2e0
14 changed files with 239 additions and 161 deletions

View File

@@ -0,0 +1,17 @@
using Content.Shared.Weapons.Ranged.Events;
namespace Content.Shared._White.WeaponModules;
public abstract class SharedWeaponModulesSystem : EntitySystem
{
public override void Initialize()
{
SubscribeLocalEvent<WeaponModulesComponent, GunMuzzleFlashAttemptEvent>(OnMuzzleFlashEvent);
}
private void OnMuzzleFlashEvent(EntityUid weapon, WeaponModulesComponent component, ref GunMuzzleFlashAttemptEvent args)
{
args.Cancelled = component.UseEffect;
}
}

View File

@@ -0,0 +1,29 @@
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared._White.WeaponModules;
/// <summary>
/// Base Module Component
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public partial class WeaponModulesComponent : Component
{
[ViewVariables(VVAccess.ReadWrite), DataField]
public List<EntityUid> Modules = new();
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
public bool UseEffect;
}
[Serializable, NetSerializable]
public enum ModuleVisualState : byte
{
Module
}
[Serializable, NetSerializable]
public enum Modules : byte
{
Light
}

View File

@@ -1,23 +0,0 @@
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Client._White.WeaponsModules;
/// <inheritdoc/>
[RegisterComponent]
public sealed partial class WeaponModulesVisualsComponent : Component
{
[DataField] public string? state;
}
[Serializable, NetSerializable]
public enum ModuleVisualState : byte
{
Module
}
[Serializable, NetSerializable]
public enum Modules : byte
{
Light
}