[Sponsor] Glassio koitorra fluff (#282)
* sprites, prototype and base components done * loadout
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
using Content.Shared.Actions.ActionTypes;
|
||||
|
||||
namespace Content.Server.White.Fluff.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class ClothingMidiComponent : Component
|
||||
{
|
||||
[DataField("midiAction", required: true, serverOnly: true)] // server only, as it uses a server-BUI event !type
|
||||
public InstantAction? MidiAction;
|
||||
}
|
||||
57
Content.Server/White/Fluff/Systems/ClothingMidiSystem.cs
Normal file
57
Content.Server/White/Fluff/Systems/ClothingMidiSystem.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using System.Linq;
|
||||
using Content.Server.White.Fluff.Components;
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Inventory.Events;
|
||||
using Robust.Server.GameObjects;
|
||||
|
||||
namespace Content.Server.White.Fluff.Systems;
|
||||
|
||||
public sealed class ClothingMidiSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<ClothingMidiComponent, GotEquippedEvent>(OnEquip);
|
||||
SubscribeLocalEvent<ClothingMidiComponent, GotUnequippedEvent>(OnUnequip);
|
||||
|
||||
}
|
||||
|
||||
private void OnEquip(EntityUid uid, ClothingMidiComponent component, GotEquippedEvent args)
|
||||
{
|
||||
if (component.MidiAction != null)
|
||||
{
|
||||
if (!TryComp<ServerUserInterfaceComponent>(args.Equipment, out var ui) || ui.Interfaces.Count == 0)
|
||||
return;
|
||||
var comp = EnsureComp<ServerUserInterfaceComponent>(args.Equipee);
|
||||
comp.Interfaces.Add(ui.Interfaces.First().Key, ui.Interfaces.First().Value);
|
||||
|
||||
_actionsSystem.AddAction(args.Equipee, component.MidiAction, null);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnUnequip(EntityUid uid, ClothingMidiComponent component, GotUnequippedEvent args)
|
||||
{
|
||||
if (component.MidiAction != null)
|
||||
{
|
||||
_actionsSystem.RemoveAction(args.Equipee, component.MidiAction);
|
||||
|
||||
if (!TryComp<ServerUserInterfaceComponent>(args.Equipment, out var ui) || ui.Interfaces.Count == 0)
|
||||
return;
|
||||
|
||||
if (!TryComp<ServerUserInterfaceComponent>(args.Equipee, out var personUi))
|
||||
return;
|
||||
|
||||
if (personUi.Interfaces.Count is 0 or 1)
|
||||
{
|
||||
RemComp<ServerUserInterfaceComponent>(args.Equipee);
|
||||
return;
|
||||
}
|
||||
|
||||
personUi.Interfaces.Remove(ui.Interfaces.First().Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -382,3 +382,36 @@
|
||||
- type: TemperatureProtection
|
||||
coefficient: 0.005
|
||||
|
||||
#koitorra
|
||||
- type: entity
|
||||
parent: ClothingMaskGas
|
||||
id: ClothingMaskGasKoitorra
|
||||
name: бионическая нейрочелюсть
|
||||
description: "Жесткая и темная. По центру шеи расположен светодиод, обрамлённый металлическими вставками, что плавно двигаются вниз. На краю шеи есть еле видное обозначение модели: 'JawV-02, Роджер Фенелон'."
|
||||
components:
|
||||
- type: Sprite
|
||||
sprite: White/Fluff/koitorra/koitorra_mask.rsi
|
||||
- type: Item
|
||||
sprite: White/Fluff/koitorra/koitorra_mask.rsi
|
||||
- type: Clothing
|
||||
sprite:
|
||||
- type: VoiceMasker
|
||||
default: ClothingMaskGas
|
||||
- type: UserInterface
|
||||
interfaces:
|
||||
- key: enum.InstrumentUiKey.Key
|
||||
type: InstrumentBoundUserInterface
|
||||
- type: ClothingMidi
|
||||
midiAction:
|
||||
name: MIDI
|
||||
checkCanInteract: false
|
||||
icon: White/Fluff/koitorra/koitorra_mask.rsi/icon.png
|
||||
description: Проиграть MIDI.
|
||||
event: !type:OpenUiActionEvent
|
||||
key: enum.InstrumentUiKey.Key
|
||||
- type: Instrument
|
||||
allowPercussion: false
|
||||
handheld: false
|
||||
bank: 1
|
||||
program: 2
|
||||
|
||||
|
||||
@@ -137,3 +137,9 @@
|
||||
id: derderiotSynthesizerLoadout
|
||||
entity: SuperSynthesizerInstrumentDerderiot
|
||||
sponsorOnly: true
|
||||
|
||||
# koitorra
|
||||
- type: loadout
|
||||
id: koitorraMaskLoadout
|
||||
entity: ClothingMaskGasKoitorra
|
||||
sponsorOnly: true
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 350 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 546 B |
Binary file not shown.
|
After Width: | Height: | Size: 504 B |
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"version": 1,
|
||||
"license": "CC-BY-SA-3.0",
|
||||
"copyright": "Copyright @koitorra",
|
||||
"size": {
|
||||
"x": 32,
|
||||
"y": 32
|
||||
},
|
||||
"states": [
|
||||
{
|
||||
"name": "icon"
|
||||
},
|
||||
{
|
||||
"name": "equipped-MASK",
|
||||
"directions": 4
|
||||
},
|
||||
{
|
||||
"name": "inhand-left",
|
||||
"directions": 4
|
||||
},
|
||||
{
|
||||
"name": "inhand-right",
|
||||
"directions": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user