Всякие твики (#467)

* tomato juice no longer slippery

* flashbang rework

* add starting gear support for flashbang rework

* flash size and charges tweak

* night and thermal vision tweaks

* night vision is turned off by default

* some size tweaks

* cleanup

* sunglasses and hardsuits tweak
This commit is contained in:
ThereDrD0
2024-07-20 05:08:01 +03:00
committed by GitHub
parent 2c4f3b2dde
commit 9c4126d3a2
52 changed files with 214 additions and 68 deletions

View File

@@ -10,4 +10,5 @@ public sealed partial class FlashOnTriggerComponent : Component
[DataField] public float Range = 1.0f;
[DataField] public float Duration = 8.0f;
[DataField] public float Probability = 1.0f;
[DataField] public bool ForceStun; // WD
}

View File

@@ -48,7 +48,11 @@ public abstract class SharedNightVisionSystem : EntitySystem
return;
component.IsActive = !component.IsActive;
_audio.PlayPredicted(component.ToggleSound, uid, uid);
if (component.IsActive && component.ActivateSound != null)
_audio.PlayPredicted(component.ActivateSound, uid, uid);
else if (component.DeactivateSound != null)
_audio.PlayPredicted(component.DeactivateSound, uid, uid);
args.Handled = true;

View File

@@ -48,7 +48,11 @@ public abstract class SharedThermalVisionSystem : EntitySystem
return;
component.IsActive = !component.IsActive;
_audio.PlayPredicted(component.ToggleSound, uid, uid);
if (component.IsActive && component.ActivateSound != null)
_audio.PlayPredicted(component.ActivateSound, uid, uid);
else if (component.DeactivateSound != null)
_audio.PlayPredicted(component.DeactivateSound, uid, uid);
args.Handled = true;

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;
namespace Content.Shared._White.BuffedFlashGrenade;
[RegisterComponent, NetworkedComponent]
public sealed partial class FlashSoundSuppressionComponent : Component
{
}

View File

@@ -0,0 +1,17 @@
using Content.Shared.Inventory.Events;
using Content.Shared.Stunnable;
namespace Content.Shared._White.BuffedFlashGrenade;
public sealed class FlashSoundSuppressionSystem : EntitySystem
{
[Dependency] private readonly SharedStunSystem _stunSystem = default!;
public void Stun(EntityUid target, float duration)
{
if (HasComp<FlashSoundSuppressionComponent>(target))
return;
_stunSystem.TryParalyze(target, TimeSpan.FromSeconds(duration / 1000f), true);
}
}

View File

@@ -28,9 +28,11 @@ public sealed class ClothingGrantingSystem : EntitySystem
if (_timing.ApplyingState)
return;
if (!TryComp<ClothingComponent>(uid, out var clothing)) return;
if (!TryComp<ClothingComponent>(uid, out var clothing))
return;
if (!clothing.Slots.HasFlag(args.SlotFlags)) return;
if (!clothing.Slots.HasFlag(args.SlotFlags))
return;
if (component.Components.Count > 8)
{
@@ -53,7 +55,7 @@ public sealed class ClothingGrantingSystem : EntitySystem
}
component.IsActive = true;
Dirty(component);
Dirty(uid, component);
}
private void OnCompUnequip(EntityUid uid, ClothingGrantComponentComponent component, GotUnequippedEvent args)
@@ -68,7 +70,7 @@ public sealed class ClothingGrantingSystem : EntitySystem
}
component.IsActive = false;
Dirty(component);
Dirty(uid, component);
}
private void OnTagEquip(EntityUid uid, ClothingGrantTagComponent component, GotEquippedEvent args)
@@ -81,7 +83,7 @@ public sealed class ClothingGrantingSystem : EntitySystem
_tagSystem.AddTag(args.Equipee, component.Tag);
component.IsActive = true;
Dirty(component);
Dirty(uid, component);
}
private void OnTagUnequip(EntityUid uid, ClothingGrantTagComponent component, GotUnequippedEvent args)
@@ -91,6 +93,6 @@ public sealed class ClothingGrantingSystem : EntitySystem
_tagSystem.RemoveTag(args.Equipee, component.Tag);
component.IsActive = false;
Dirty(component);
Dirty(uid, component);
}
}

View File

@@ -12,10 +12,13 @@ public sealed partial class NightVisionComponent : BaseNvOverlayComponent
public override Color Color { get; set; } = Color.FromHex("#98FB98");
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public bool IsActive = true;
public bool IsActive;
[DataField]
public SoundSpecifier? ToggleSound = new SoundPathSpecifier("/Audio/Items/flashlight_pda.ogg");
public SoundSpecifier? ActivateSound = new SoundPathSpecifier("/Audio/White/Items/Goggles/activate.ogg");
[DataField]
public SoundSpecifier? DeactivateSound = new SoundPathSpecifier("/Audio/White/Items/Goggles/deactivate.ogg");
[DataField]
public EntProtoId? ToggleAction = "ToggleNightVision";

View File

@@ -15,7 +15,10 @@ public sealed partial class ThermalVisionComponent : BaseNvOverlayComponent
public bool IsActive = true;
[DataField]
public SoundSpecifier? ToggleSound = new SoundPathSpecifier("/Audio/Items/flashlight_pda.ogg");
public SoundSpecifier? ActivateSound = new SoundPathSpecifier("/Audio/White/Items/Goggles/activate.ogg");
[DataField]
public SoundSpecifier? DeactivateSound = new SoundPathSpecifier("/Audio/White/Items/Goggles/deactivate.ogg");
[DataField]
public EntProtoId? ToggleAction = "ToggleThermalVision";