Vulpkanin's Deuteranopia (#837)

* Everyone loves dog vision

Updated to match the the harpy code

* change locale name
This commit is contained in:
Fluffiest Floofers
2024-02-15 18:27:23 +01:00
committed by GitHub
parent de0917200f
commit a98b4ebaaa
6 changed files with 20 additions and 24 deletions

View File

@@ -1,13 +1,10 @@
using Content.Shared.Abilities;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Player;
namespace Content.Client.Nyanotrasen.Overlays;
public sealed partial class DogVisionSystem : EntitySystem
{
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly IOverlayManager _overlayMan = default!;
private DogVisionOverlay _overlay = default!;
@@ -19,28 +16,16 @@ public sealed partial class DogVisionSystem : EntitySystem
SubscribeLocalEvent<DogVisionComponent, ComponentInit>(OnDogVisionInit);
SubscribeLocalEvent<DogVisionComponent, ComponentShutdown>(OnDogVisionShutdown);
_player.LocalPlayerAttached += OnAttachedChanged;
_player.LocalPlayerDetached += OnAttachedChanged;
_overlay = new();
}
private void OnAttachedChanged(EntityUid uid)
{
_overlayMan.AddOverlay(_overlay);
}
private void OnDogVisionInit(EntityUid uid, DogVisionComponent component, ComponentInit args)
{
if (_player.LocalPlayer?.ControlledEntity == uid)
_overlayMan.AddOverlay(_overlay);
_overlayMan.AddOverlay(_overlay);
}
private void OnDogVisionShutdown(EntityUid uid, DogVisionComponent component, ComponentShutdown args)
{
if (_player.LocalPlayer?.ControlledEntity == uid)
{
_overlayMan.RemoveOverlay(_overlay);
}
_overlayMan.RemoveOverlay(_overlay);
}
}

View File

@@ -15,5 +15,6 @@ public sealed partial class DefaultVisionSystem : EntitySystem
private void OnDefaultVisionInit(EntityUid uid, DefaultVisionComponent component, ComponentInit args)
{
RemComp<UltraVisionComponent>(uid);
RemComp<DogVisionComponent>(uid);
}
}

View File

@@ -1,8 +1,15 @@
trait-scottish-accent-name = Scottish Accent
trait-scottish-accent-desc = Fer tha folk who come frae Hielan clan.
trait-ultravision-name = Ultraviolet Vision
trait-ultravision-desc = Whether through custom bionic eyes, random mutation,
or being a Harpy, you perceive the world with ultraviolet light.
trait-deuteranopia-name = Deuteranopia
trait-deuteranopia-desc = Whether through custom bionic eyes, random mutation,
or being a Vulpkanin, you have redgreen colour blindness.
trait-defaultvision-name = Normal Vision
trait-defaultvision-desc = You lack any vision variation from the norm for a non-human species.
trait-uncloneable-name = Uncloneable

View File

@@ -96,6 +96,7 @@
Male: MaleVulpkanin
Female: FemaleVulpkanin
Unsexed: MaleVulpkanin
- type: DogVision
- type: entity
save: false

View File

@@ -1,13 +1,20 @@
- type: trait
id: UltraVision
name: Ultraviolet Vision
name: trait-ultravision-name
description: trait-ultravision-desc
components:
- type: UltraVision
- type: trait
id: DogVision
name: trait-deuteranopia-name
description: trait-deuteranopia-desc
components:
- type: DogVision
- type: trait
id: DefaultVision
name: Normal Vision
name: trait-defaultvision-name
description: trait-defaultvision-desc
components:
- type: DefaultVision

View File

@@ -1,5 +0,0 @@
- type: trait
id: Colorblindness
name: Colorblindness
components:
- type: DogVision