Skip to content

Commit

Permalink
Merge pull request #497 from FoxxoTrystan/hypno-visor
Browse files Browse the repository at this point in the history
Hypno Visor
  • Loading branch information
FoxxoTrystan authored Jan 26, 2025
2 parents 80f7ad5 + 83f2fba commit 96bd0a1
Show file tree
Hide file tree
Showing 10 changed files with 116 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using Content.Shared.Mobs.Components;
using Content.Shared.Psionics;
using Content.Server.Consent;
using Content.Shared.Mind.Components;


namespace Content.Server.Abilities.Psionics
Expand Down Expand Up @@ -176,15 +175,12 @@ private void OnDoAfter(EntityUid uid, PsionicHypnoComponent component, PsionicHy
{
_popups.PopupEntity(Loc.GetString("hypno-success", ("target", uid)), uid, uid, PopupType.LargeCaution);

Hypnotize(uid, args.Target.Value, component);
Hypnotize(uid, args.Target.Value);
}
}

public void Hypnotize(EntityUid uid, EntityUid target, PsionicHypnoComponent? component = null)
public void Hypnotize(EntityUid uid, EntityUid target)
{
if (!Resolve(uid, ref component))
return;

EnsureComp<HypnotizedComponent>(target, out var hypnotized);
hypnotized.Master = uid;

Expand Down
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 Content.Server/FloofStation/HypnoClothing/HypnoClothingSystem.cs
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;
}
}
4 changes: 4 additions & 0 deletions Resources/Locale/en-US/Floof/hypno.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ trait-name-HypnoticGaze = Hypnotic Gaze
trait-description-HypnoticGaze =
Within your eyes lies the ability to place others under your control. You are capable of placing others in a trance, regardless of
whether or not you possess any other notable psychic powers.
# Hypno Visor
hypno-link = Set Mind Link
hypno-link-master = Master: {CAPITALIZE($entity)}
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
- ClothingHeadHatWelding
- ShockCollar # FloofStation
- LeashBasic # FloofStation
- ClothingEyesHypnoVisor # FloofStation
- StationAnchorCircuitboard
- type: EmagLatheRecipes
emagStaticRecipes:
Expand Down
2 changes: 2 additions & 0 deletions Resources/Prototypes/Floof/Catalog/Fills/Crates/lewd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@
- !type:EntSelector
id: LeashBasic
amount: !type:ConstantNumberSelector { value: 2 }
- !type:EntSelector
id: ClothingEyesHypnoVisor
2 changes: 2 additions & 0 deletions Resources/Prototypes/Floof/CharacterItemGroups/funGroup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
id: LoadoutItemLeashBasic
- type: loadout
id: LoadoutItemLeashShort
- type: loadout
id: LoadoutItemHypnoVisor

# If you are ever going to add more: open regex101; in list mode, find "id: (.+)", replace with "- type: loadout\n id: $1\n", paste the result here
- type: characterItemGroup
Expand Down
11 changes: 11 additions & 0 deletions Resources/Prototypes/Floof/Entities/Clothing/Eyes/specific.yml
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
11 changes: 11 additions & 0 deletions Resources/Prototypes/Floof/Loadouts/items.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,14 @@
requirements:
- !type:CharacterItemGroupRequirement
group: LoadoutFun

- type: loadout
id: LoadoutItemHypnoVisor
category: Items
cost: 2
exclusive: true
items:
- ClothingEyesHypnoVisor
requirements:
- !type:CharacterItemGroupRequirement
group: LoadoutFun
8 changes: 8 additions & 0 deletions Resources/Prototypes/Floof/Recipes/Lathes/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@
Cloth: 50
Plastic: 500
Steel: 75

- type: latheRecipe
id: ClothingEyesHypnoVisor
result: ClothingEyesHypnoVisor
completetime: 3.5
materials:
Glass: 100
Steel: 75

0 comments on commit 96bd0a1

Please sign in to comment.