-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #497 from FoxxoTrystan/hypno-visor
Hypno Visor
- Loading branch information
Showing
10 changed files
with
116 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Content.Server/FloofStation/HypnoClothing/HypnoClothingComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Robust.Shared.Audio; | ||
|
||
namespace Content.Server.FloofStation; | ||
|
||
[RegisterComponent] | ||
public sealed partial class HypnoClothingComponent : Component | ||
{ | ||
[DataField] | ||
public EntityUid? Master; | ||
|
||
[DataField] | ||
public SoundSpecifier LinkSound = new SoundPathSpecifier("/Audio/Machines/terminal_insert_disc.ogg"); | ||
} |
62 changes: 62 additions & 0 deletions
62
Content.Server/FloofStation/HypnoClothing/HypnoClothingSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using Content.Shared.Inventory.Events; | ||
using Content.Shared.Clothing.Components; | ||
using Content.Shared.Floofstation.Hypno; | ||
using Content.Shared.Verbs; | ||
using Robust.Shared.Utility; | ||
using Content.Server.Consent; | ||
using Content.Server.Labels; | ||
using Robust.Shared.Audio.Systems; | ||
using Content.Server.Abilities.Psionics; | ||
using Content.Shared.Labels.Components; | ||
|
||
|
||
namespace Content.Server.FloofStation; | ||
public sealed class HypnoClothingsystem : EntitySystem | ||
{ | ||
[Dependency] private readonly ConsentSystem _consent = default!; | ||
[Dependency] private readonly LabelSystem _labelSystem = default!; | ||
[Dependency] private readonly SharedAudioSystem _audio = default!; | ||
[Dependency] private readonly PsionicHypnoSystem _psionichypnosystem = default!; | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<HypnoClothingComponent, GotEquippedEvent>(OnEquipped); | ||
SubscribeLocalEvent<HypnoClothingComponent, GetVerbsEvent<Verb>>(HypnoLinkVerb); | ||
} | ||
|
||
private void HypnoLinkVerb(EntityUid uid, HypnoClothingComponent component, GetVerbsEvent<Verb> args) | ||
{ | ||
if (!args.CanAccess || !args.CanInteract) | ||
return; | ||
|
||
Verb verbHypnoLink = new() | ||
{ | ||
Act = () => HypnoLink(uid, component, args.User), | ||
Text = Loc.GetString("hypno-link"), | ||
Icon = new SpriteSpecifier.Texture(new ResPath("/Textures/Floof/Interface/Actions/hypno.png")), | ||
Priority = 1 | ||
}; | ||
args.Verbs.Add(verbHypnoLink); | ||
} | ||
|
||
private void OnEquipped(EntityUid uid, HypnoClothingComponent component, GotEquippedEvent args) | ||
{ | ||
if (!TryComp<ClothingComponent>(uid, out var clothing) | ||
|| !clothing.Slots.HasFlag(args.SlotFlags)) | ||
return; | ||
|
||
if (component.Master == null || !_consent.HasConsent(args.Equipee, "Hypno")) | ||
return; | ||
|
||
_psionichypnosystem.Hypnotize(component.Master.Value, args.Equipee); | ||
} | ||
|
||
public void HypnoLink(EntityUid uid, HypnoClothingComponent component, EntityUid master) | ||
{ | ||
EnsureComp<PsionicHypnoComponent>(master); | ||
_labelSystem.Label(uid, Loc.GetString("hypno-link-master", ("entity", master))); | ||
_audio.PlayPvs(component.LinkSound, uid); | ||
|
||
component.Master = master; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
Resources/Prototypes/Floof/Entities/Clothing/Eyes/specific.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
- type: entity | ||
parent: [ClothingEyesBase] | ||
id: ClothingEyesHypnoVisor | ||
name: Hypno Visor | ||
description: Pre-programmed with a variety of visual and auditory options, this visor will work to induce a trance in its wearer, no psionics or hypnotist training required. | ||
components: | ||
- type: Sprite | ||
sprite: Clothing/Eyes/Hud/syndagent.rsi | ||
- type: Clothing | ||
sprite: Clothing/Eyes/Hud/syndagent.rsi | ||
- type: HypnoClothing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters