Фиксы светошумовых гранат (#470)

* add full headset to security lockers and vendors

* wd

* fix range

* - fix: Night vision.

* - fix: Fixes.

---------

Co-authored-by: Aviu00 <aviu00@protonmail.com>
This commit is contained in:
ThereDrD0
2024-07-20 18:28:44 +03:00
committed by GitHub
parent d556318b61
commit 89d1c95cbf
17 changed files with 60 additions and 37 deletions

View File

@@ -1,3 +1,4 @@
using Content.Shared._White.BuffedFlashGrenade;
using Content.Shared._White.Events; using Content.Shared._White.Events;
using Content.Shared._White.StaminaProtection; using Content.Shared._White.StaminaProtection;
using Content.Shared.Changeling; using Content.Shared.Changeling;
@@ -34,6 +35,7 @@ public partial class InventorySystem
SubscribeLocalEvent<InventoryComponent, ChemRegenModifyEvent>(RelayInventoryEvent); // WD SubscribeLocalEvent<InventoryComponent, ChemRegenModifyEvent>(RelayInventoryEvent); // WD
SubscribeLocalEvent<InventoryComponent, ChangelingRefundEvent>(RelayInventoryEvent); // WD SubscribeLocalEvent<InventoryComponent, ChangelingRefundEvent>(RelayInventoryEvent); // WD
SubscribeLocalEvent<InventoryComponent, EnergyDomeClothesTurnOffEvent>(RelayInventoryEvent); // WD SubscribeLocalEvent<InventoryComponent, EnergyDomeClothesTurnOffEvent>(RelayInventoryEvent); // WD
SubscribeLocalEvent<InventoryComponent, GetFlashbangedEvent>(RelayInventoryEvent); // WD
SubscribeLocalEvent<InventoryComponent, GetDefaultRadioChannelEvent>(RelayInventoryEvent); SubscribeLocalEvent<InventoryComponent, GetDefaultRadioChannelEvent>(RelayInventoryEvent);
// by-ref events // by-ref events

View File

@@ -1,4 +1,4 @@
using Content.Shared.Inventory.Events; using Content.Shared.Inventory;
using Content.Shared.Stunnable; using Content.Shared.Stunnable;
namespace Content.Shared._White.BuffedFlashGrenade; namespace Content.Shared._White.BuffedFlashGrenade;
@@ -7,11 +7,37 @@ public sealed class FlashSoundSuppressionSystem : EntitySystem
{ {
[Dependency] private readonly SharedStunSystem _stunSystem = default!; [Dependency] private readonly SharedStunSystem _stunSystem = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<FlashSoundSuppressionComponent, InventoryRelayedEvent<GetFlashbangedEvent>>(
OnGetFlashbanged);
}
private void OnGetFlashbanged(Entity<FlashSoundSuppressionComponent> ent,
ref InventoryRelayedEvent<GetFlashbangedEvent> args)
{
args.Args.Protected = true;
}
public void Stun(EntityUid target, float duration) public void Stun(EntityUid target, float duration)
{ {
if (HasComp<FlashSoundSuppressionComponent>(target)) if (HasComp<FlashSoundSuppressionComponent>(target))
return; return;
var ev = new GetFlashbangedEvent();
RaiseLocalEvent(target, ev);
if (ev.Protected)
return;
_stunSystem.TryParalyze(target, TimeSpan.FromSeconds(duration / 1000f), true); _stunSystem.TryParalyze(target, TimeSpan.FromSeconds(duration / 1000f), true);
} }
} }
public sealed class GetFlashbangedEvent : EntityEventArgs, IInventoryRelayEvent
{
public bool Protected;
public SlotFlags TargetSlots => SlotFlags.EARS | SlotFlags.HEAD;
}

View File

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

View File

@@ -56,7 +56,7 @@
- id: Flash - id: Flash
prob: 0.5 prob: 0.5
- id: ClothingEyesGlassesSecurity - id: ClothingEyesGlassesSecurity
- id: ClothingHeadsetSecurity - id: ClothingHeadsetAltSecurity # WD
- id: ClothingHandsGlovesColorBlack - id: ClothingHandsGlovesColorBlack
- id: ClothingShoesBootsJack - id: ClothingShoesBootsJack
- id: WeaponMeleeNeedle - id: WeaponMeleeNeedle

View File

@@ -7,7 +7,7 @@
ClothingHeadHatBeret: 4 ClothingHeadHatBeret: 4
ClothingHeadHatSecsoft: 4 ClothingHeadHatSecsoft: 4
ClothingHeadBandRed: 4 ClothingHeadBandRed: 4
ClothingHeadsetSecurity: 4 ClothingHeadsetAltSecurity: 4
ClothingEyesGlassesSecurity: 4 ClothingEyesGlassesSecurity: 4
ClothingOuterWinterSec: 4 ClothingOuterWinterSec: 4
ClothingUniformJumpsuitSec: 4 ClothingUniformJumpsuitSec: 4

View File

@@ -1,4 +1,4 @@
- type: entity - type: entity
abstract: true abstract: true
parent: ClothingHeadset parent: ClothingHeadset
id: ClothingHeadsetAlt id: ClothingHeadsetAlt
@@ -9,9 +9,7 @@
state: icon_alt state: icon_alt
- type: Clothing - type: Clothing
equippedPrefix: alt equippedPrefix: alt
- type: ClothingGrantComponent # WD - type: FlashSoundSuppression # WD
component:
- type: FlashSoundSuppression
- type: entity - type: entity
parent: ClothingHeadsetAlt parent: ClothingHeadsetAlt

View File

@@ -185,9 +185,7 @@
Piercing: 0.9 Piercing: 0.9
Heat: 0.9 Heat: 0.9
- type: FlashImmunity # WD edit - type: FlashImmunity # WD edit
- type: ClothingGrantComponent # WD - type: FlashSoundSuppression # WD edit
component:
- type: FlashSoundSuppression
#Brigmedic Hardsuit #Brigmedic Hardsuit
- type: entity - type: entity
@@ -215,9 +213,8 @@
- type: PressureProtection - type: PressureProtection
highPressureMultiplier: 0.6 highPressureMultiplier: 0.6
lowPressureMultiplier: 1000 lowPressureMultiplier: 1000
- type: ClothingGrantComponent # WD - type: FlashImmunity # WD edit
component: - type: FlashSoundSuppression # WD edit
- type: FlashSoundSuppression
#Warden's Hardsuit #Warden's Hardsuit
- type: entity - type: entity
@@ -244,9 +241,7 @@
Piercing: 0.9 Piercing: 0.9
Heat: 0.9 Heat: 0.9
- type: FlashImmunity # WD edit - type: FlashImmunity # WD edit
- type: ClothingGrantComponent # WD - type: FlashSoundSuppression # WD edit
component:
- type: FlashSoundSuppression
#Captain's Hardsuit #Captain's Hardsuit
- type: entity - type: entity
@@ -263,9 +258,8 @@
- type: PressureProtection - type: PressureProtection
highPressureMultiplier: 0.3 highPressureMultiplier: 0.3
lowPressureMultiplier: 1000 lowPressureMultiplier: 1000
- type: ClothingGrantComponent # WD - type: FlashImmunity # WD edit
component: - type: FlashSoundSuppression # WD edit
- type: FlashSoundSuppression
#Inspector's Hardsuit #Inspector's Hardsuit
- type: entity - type: entity
@@ -364,9 +358,7 @@
Piercing: 0.9 Piercing: 0.9
Heat: 0.9 Heat: 0.9
- type: FlashImmunity - type: FlashImmunity
- type: ClothingGrantComponent # WD - type: FlashSoundSuppression
component:
- type: FlashSoundSuppression
#Luxury Mining Hardsuit #Luxury Mining Hardsuit
- type: entity - type: entity

View File

@@ -84,7 +84,8 @@
path: /Audio/Effects/bite.ogg path: /Audio/Effects/bite.ogg
- type: Penetrated - type: Penetrated
- type: NightVision - type: NightVision
toggleSound: null activateSound: null
deactivateSound: null
color: "#404040" color: "#404040"
- type: Tool - type: Tool
speed: 2 speed: 2

View File

@@ -121,7 +121,8 @@
attributes: attributes:
gender: male gender: male
- type: NightVision - type: NightVision
toggleSound: null activateSound: null
deactivateSound: null
color: "#404040" color: "#404040"
- type: GlobalAntagonist - type: GlobalAntagonist
antagonistPrototype: globalAntagonistRats antagonistPrototype: globalAntagonistRats

View File

@@ -124,7 +124,8 @@
- type: Speech - type: Speech
speechVerb: LargeMob speechVerb: LargeMob
- type: NightVision - type: NightVision
toggleSound: null activateSound: null
deactivateSound: null
color: "#404040" color: "#404040"
- type: entity - type: entity

View File

@@ -131,7 +131,8 @@
- CannotSuicide - CannotSuicide
- DoorBumpOpener - DoorBumpOpener
- type: NightVision - type: NightVision
toggleSound: null activateSound: null
deactivateSound: null
color: "#404040" color: "#404040"
- type: Tool - type: Tool
speed: 3 speed: 3

View File

@@ -66,7 +66,7 @@
- type: Sprite - type: Sprite
sprite: Objects/Weapons/Grenades/flashbang.rsi sprite: Objects/Weapons/Grenades/flashbang.rsi
- type: FlashOnTrigger - type: FlashOnTrigger
range: 5 range: 7
forceStun: true # WD forceStun: true # WD
- type: SoundOnTrigger - type: SoundOnTrigger
sound: sound:

View File

@@ -1603,7 +1603,7 @@
loadouts: loadouts:
- SecurityCommandHeadset - SecurityCommandHeadset
- type: loadoutGroup - type: loadoutGroup # WD
id: CommonSecurityHeadsetFull id: CommonSecurityHeadsetFull
name: loadout-group-ears name: loadout-group-ears
loadouts: loadouts:

View File

@@ -52,7 +52,7 @@
itemIconStyle: BigAction itemIconStyle: BigAction
priority: -20 priority: -20
icon: icon:
sprite: Clothing/Eyes/Glasses/thermal.rsi sprite: White/Clothing/Eyes/Glasses/thermal.rsi
state: icon state: icon
event: !type:ToggleThermalVisionEvent event: !type:ToggleThermalVisionEvent

View File

@@ -108,7 +108,7 @@
name: uplink-night-vision-name name: uplink-night-vision-name
description: uplink-night-vision-desc description: uplink-night-vision-desc
productEntity: ClothingEyesNightVisionGogglesSyndie productEntity: ClothingEyesNightVisionGogglesSyndie
icon: { sprite: White/Clothing/Head/nightvision.rsi, state: icon } icon: { sprite: White/Clothing/Eyes/Glasses/nightvision.rsi, state: icon }
cost: cost:
Telecrystal: 3 Telecrystal: 3
categories: categories:
@@ -124,7 +124,7 @@
name: uplink-night-vision-name name: uplink-night-vision-name
description: uplink-night-vision-desc description: uplink-night-vision-desc
productEntity: ClothingEyesNightVisionGogglesNukie productEntity: ClothingEyesNightVisionGogglesNukie
icon: { sprite: White/Clothing/Head/nightvision.rsi, state: icon } icon: { sprite: White/Clothing/Eyes/Glasses/nightvision.rsi, state: icon }
cost: cost:
Telecrystal: 3 Telecrystal: 3
categories: categories:
@@ -140,7 +140,7 @@
name: uplink-thermal-vision-name name: uplink-thermal-vision-name
description: uplink-thermal-vision-desc description: uplink-thermal-vision-desc
productEntity: ClothingEyesGlassesThermalSyndie productEntity: ClothingEyesGlassesThermalSyndie
icon: { sprite: Clothing/Eyes/Glasses/thermal.rsi, state: icon } icon: { sprite: White/Clothing/Eyes/Glasses/thermal.rsi, state: icon }
cost: cost:
Telecrystal: 3 Telecrystal: 3
categories: categories:
@@ -156,7 +156,7 @@
name: uplink-thermal-vision-name name: uplink-thermal-vision-name
description: uplink-thermal-vision-desc description: uplink-thermal-vision-desc
productEntity: ClothingEyesGlassesThermalNukie productEntity: ClothingEyesGlassesThermalNukie
icon: { sprite: Clothing/Eyes/Glasses/thermal.rsi, state: icon } icon: { sprite: White/Clothing/Eyes/Glasses/thermal.rsi, state: icon }
cost: cost:
Telecrystal: 3 Telecrystal: 3
categories: categories:

View File

@@ -64,7 +64,8 @@
- type: ShowCultHud - type: ShowCultHud
- type: IsDeadIC - type: IsDeadIC
- type: NightVision - type: NightVision
toggleSound: null activateSound: null
deactivateSound: null
color: White color: White
- type: ShowHealthBars - type: ShowHealthBars
damageContainers: damageContainers:

View File

@@ -3,7 +3,7 @@
id: NightVisionTech id: NightVisionTech
name: research-technology-night-vision name: research-technology-night-vision
icon: icon:
sprite: White/Clothing/Head/nightvision.rsi sprite: White/Clothing/Eyes/Glasses/nightvision.rsi
state: icon state: icon
discipline: Experimental discipline: Experimental
tier: 2 tier: 2
@@ -15,7 +15,7 @@
id: ThermalVisionTech id: ThermalVisionTech
name: research-technology-thermal-vision name: research-technology-thermal-vision
icon: icon:
sprite: Clothing/Eyes/Glasses/thermal.rsi sprite: White/Clothing/Eyes/Glasses/thermal.rsi
state: icon state: icon
discipline: Experimental discipline: Experimental
tier: 2 tier: 2