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

@@ -179,12 +179,6 @@ public sealed partial class GunComponent : Component
[DataField]
public bool ResetOnHandSelected = true;
/// <summary>
/// For flamehider module | WD EDIT
/// </summary>
[DataField, AutoNetworkedField]
public bool canUseEffect;
/// <summary>
/// The base value for how fast the projectile moves.
/// </summary>
@@ -237,7 +231,7 @@ public sealed partial class GunComponent : Component
// WD START
public EntityUid? Target;
[DataField("forceThrowingAngle")]
[ViewVariables(VVAccess.ReadWrite)]
public bool ForceThrowingAngle;

View File

@@ -476,9 +476,7 @@ public abstract partial class SharedGunSystem : EntitySystem
protected void MuzzleFlash(EntityUid gun, AmmoComponent component, EntityUid? user = null)
{
TryComp<GunComponent>(gun, out var gunComponent); // WD EDIT
var attemptEv = new GunMuzzleFlashAttemptEvent(gunComponent!.canUseEffect); // WD EDIT
var attemptEv = new GunMuzzleFlashAttemptEvent();
RaiseLocalEvent(gun, ref attemptEv);
if (attemptEv.Cancelled)
return;
@@ -560,14 +558,6 @@ public abstract partial class SharedGunSystem : EntitySystem
RefreshModifiers(weapon);
}
public void setUseEffect(EntityUid weapon, bool state)
{
TryComp<GunComponent>(weapon, out var gunComponent);
gunComponent!.canUseEffect = state;
RefreshModifiers(weapon);
}
// WD EDIT END
protected abstract void CreateEffect(EntityUid uid, MuzzleFlashEvent message, EntityUid? user = null);
/// <summary>