Skip to content

Commit

Permalink
Vulpkanin's Deuteranopia (#837)
Browse files Browse the repository at this point in the history
* Everyone loves dog vision

Updated to match the the harpy code

* change locale name
  • Loading branch information
FluffiestFloof committed Feb 15, 2024
1 parent de09172 commit a98b4eb
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 24 deletions.
19 changes: 2 additions & 17 deletions Content.Client/Nyanotrasen/Overlays/DogVisionSystem.cs
Original file line number Diff line number Diff line change
@@ -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!;
Expand All @@ -19,28 +16,16 @@ public override void Initialize()
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);
}
}
1 change: 1 addition & 0 deletions Content.Shared/DeltaV/Abilities/DefaultVisionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ public override void Initialize()
private void OnDefaultVisionInit(EntityUid uid, DefaultVisionComponent component, ComponentInit args)
{
RemComp<UltraVisionComponent>(uid);
RemComp<DogVisionComponent>(uid);
}
}
7 changes: 7 additions & 0 deletions Resources/Locale/en-US/deltav/traits/traits.ftl
Original file line number Diff line number Diff line change
@@ -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 red–green 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
Male: MaleVulpkanin
Female: FemaleVulpkanin
Unsexed: MaleVulpkanin
- type: DogVision

- type: entity
save: false
Expand Down
11 changes: 9 additions & 2 deletions Resources/Prototypes/DeltaV/Traits/altvision.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 0 additions & 5 deletions Resources/Prototypes/Nyanotrasen/Traits/disabilities.yml

This file was deleted.

0 comments on commit a98b4eb

Please sign in to comment.