Skip to content

Commit

Permalink
New component NoShowFov для маски Хроноса
Browse files Browse the repository at this point in the history
  • Loading branch information
Schrodinger71 committed Sep 5, 2024
1 parent ea62d5c commit d71df94
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 21 deletions.
6 changes: 6 additions & 0 deletions Content.Shared/ADT/NoShowFov/NoShowFovComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using Robust.Shared.GameStates;

namespace Content.Shared.ADT.NoShowFov;

[RegisterComponent, NetworkedComponent]
public sealed partial class NoShowFovComponent : Component { }
36 changes: 36 additions & 0 deletions Content.Shared/ADT/NoShowFov/NoShowFovSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Content.Shared.Inventory.Events;
using Content.Shared.ADT.NoShowFov;

namespace Content.Client.ADT.NoShowFov;

public sealed class NoShowFovSystem : EntitySystem
{
[Dependency] private readonly SharedEyeSystem _eye = default!;
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<NoShowFovComponent, GotEquippedEvent>(OnEquipped);
SubscribeLocalEvent<NoShowFovComponent, GotUnequippedEvent>(OnUnequipped);
}

private void OnEquipped(EntityUid uid, NoShowFovComponent component, ref GotEquippedEvent args)
{
ToggleFov(args.Equipee, false);
}

private void OnUnequipped(EntityUid uid, NoShowFovComponent component, ref GotUnequippedEvent args)
{
ToggleFov(args.Equipee, true);
}

private void ToggleFov(EntityUid entity, bool drawFov)
{
if (TryComp<EyeComponent>(entity, out var _))
{
_eye.SetDrawFov(entity, drawFov);
}
}
}


4 changes: 1 addition & 3 deletions Resources/Prototypes/ADT/Entities/Clothing/Masks/mask.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,10 @@
- type: Clothing
sprite: ADT/Clothing/Mask/chronosvisor.rsi
- type: BreathMask
- type: ShowSecurityIcons
- type: NoShowFov # Отключает Fov при надевании
- type: FlashImmunity
- type: EyeProtection
protectionTime: 5
- type: Eye
drawFov: false

# #противогаз СССП

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@
id: ADTClothingUniformNewMekka
name: New Mekka jumpsuit
description: New Mekka jumpsuit
suffix: New Mekka
components:
- type: Sprite
sprite: ADT/Clothing/Uniforms/Jumpsuit/newmekkauniform.rsi
Expand Down Expand Up @@ -596,21 +597,3 @@
sprite: ADT/Clothing/Uniforms/Jumpsuit/investigator_suit.rsi
- type: Clothing
sprite: ADT/Clothing/Uniforms/Jumpsuit/investigator_suit.rsi

- type: entity
parent: ClothingUniformBase
id: ADTClothingUniformNewMekka
name: New Mekka jumpsuit
description: New Mekka jumpsuit
suffix: New Mekka
components:
- type: Sprite
sprite: ADT/Clothing/Uniforms/Jumpsuit/newmekkauniform.rsi
- type: Clothing
sprite: ADT/Clothing/Uniforms/Jumpsuit/newmekkauniform.rsi
- type: Armor
modifiers:
coefficients:
Blunt: 0.8
Piercing: 0.8
Heat: 0.9

0 comments on commit d71df94

Please sign in to comment.