From fd6aed066553e222acfb6b7f68cf61377ef28b9a Mon Sep 17 00:00:00 2001 From: HitPanda <104197232+EnefFlow@users.noreply.github.com> Date: Tue, 8 Aug 2023 17:47:12 +0300 Subject: [PATCH] [Sponsor] Glassio koitorra fluff (#282) * sprites, prototype and base components done * loadout --- .../Fluff/Components/ClothingMidiComponent.cs | 10 +++ .../White/Fluff/Systems/ClothingMidiSystem.cs | 57 ++++++++++++++++++ Resources/Prototypes/White/Fluff/fluff.yml | 33 ++++++++++ Resources/Prototypes/White/Fluff/sponsor.yml | 6 ++ .../koitorra_mask.rsi/equipped-MASK.png | Bin 0 -> 350 bytes .../Fluff/koitorra/koitorra_mask.rsi/icon.png | Bin 0 -> 1448 bytes .../koitorra_mask.rsi/inhand-left.png | Bin 0 -> 546 bytes .../koitorra_mask.rsi/inhand-right.png | Bin 0 -> 504 bytes .../koitorra/koitorra_mask.rsi/meta.json | 26 ++++++++ 9 files changed, 132 insertions(+) create mode 100644 Content.Server/White/Fluff/Components/ClothingMidiComponent.cs create mode 100644 Content.Server/White/Fluff/Systems/ClothingMidiSystem.cs create mode 100644 Resources/Textures/White/Fluff/koitorra/koitorra_mask.rsi/equipped-MASK.png create mode 100644 Resources/Textures/White/Fluff/koitorra/koitorra_mask.rsi/icon.png create mode 100644 Resources/Textures/White/Fluff/koitorra/koitorra_mask.rsi/inhand-left.png create mode 100644 Resources/Textures/White/Fluff/koitorra/koitorra_mask.rsi/inhand-right.png create mode 100644 Resources/Textures/White/Fluff/koitorra/koitorra_mask.rsi/meta.json diff --git a/Content.Server/White/Fluff/Components/ClothingMidiComponent.cs b/Content.Server/White/Fluff/Components/ClothingMidiComponent.cs new file mode 100644 index 0000000000..e4e04526a7 --- /dev/null +++ b/Content.Server/White/Fluff/Components/ClothingMidiComponent.cs @@ -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; +} diff --git a/Content.Server/White/Fluff/Systems/ClothingMidiSystem.cs b/Content.Server/White/Fluff/Systems/ClothingMidiSystem.cs new file mode 100644 index 0000000000..a3505f2158 --- /dev/null +++ b/Content.Server/White/Fluff/Systems/ClothingMidiSystem.cs @@ -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(OnEquip); + SubscribeLocalEvent(OnUnequip); + + } + + private void OnEquip(EntityUid uid, ClothingMidiComponent component, GotEquippedEvent args) + { + if (component.MidiAction != null) + { + if (!TryComp(args.Equipment, out var ui) || ui.Interfaces.Count == 0) + return; + var comp = EnsureComp(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(args.Equipment, out var ui) || ui.Interfaces.Count == 0) + return; + + if (!TryComp(args.Equipee, out var personUi)) + return; + + if (personUi.Interfaces.Count is 0 or 1) + { + RemComp(args.Equipee); + return; + } + + personUi.Interfaces.Remove(ui.Interfaces.First().Key); + } + } +} diff --git a/Resources/Prototypes/White/Fluff/fluff.yml b/Resources/Prototypes/White/Fluff/fluff.yml index 32108e5784..c9fd6d7c7a 100644 --- a/Resources/Prototypes/White/Fluff/fluff.yml +++ b/Resources/Prototypes/White/Fluff/fluff.yml @@ -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 + diff --git a/Resources/Prototypes/White/Fluff/sponsor.yml b/Resources/Prototypes/White/Fluff/sponsor.yml index 16f888ae68..155da7cf6d 100644 --- a/Resources/Prototypes/White/Fluff/sponsor.yml +++ b/Resources/Prototypes/White/Fluff/sponsor.yml @@ -137,3 +137,9 @@ id: derderiotSynthesizerLoadout entity: SuperSynthesizerInstrumentDerderiot sponsorOnly: true + +# koitorra +- type: loadout + id: koitorraMaskLoadout + entity: ClothingMaskGasKoitorra + sponsorOnly: true diff --git a/Resources/Textures/White/Fluff/koitorra/koitorra_mask.rsi/equipped-MASK.png b/Resources/Textures/White/Fluff/koitorra/koitorra_mask.rsi/equipped-MASK.png new file mode 100644 index 0000000000000000000000000000000000000000..554d7f47b154f222550ba0decdb69b645f391f46 GIT binary patch literal 350 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=oCO|{#S9F5M?jcysy3fAQ1F|l zi(^Q|oVU01*Bx>YIQ}tyqr{cA<&mf5n=^!YR4V!c{`(!|+`;I6pn&bdo~WAHT0UPF zburA#&|J!UzyD53d79D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>~6@vd$@?2>=ds;;#Sz literal 0 HcmV?d00001 diff --git a/Resources/Textures/White/Fluff/koitorra/koitorra_mask.rsi/inhand-right.png b/Resources/Textures/White/Fluff/koitorra/koitorra_mask.rsi/inhand-right.png new file mode 100644 index 0000000000000000000000000000000000000000..73eccff0ddb551c1fd2bd06e14bb1c93486298fc GIT binary patch literal 504 zcmVPx$vPnciRCt{2+ObN*P!tB>Un!Ju5ECee-r1~GN1s5XxHuGtZk>G!pFnUEd;~WU zcNcfpc2+_m6}d>K>kw0IO{8j+T>QVK$)&yg=ia0lP5>ezA|fIpA|fJ)7^fP$_hYKD z6EUvrH+Axr{Efu{)!22r`-mdN+1aTR5m;-{?+=is39ha#U6Kq}ezSm|P>o#}u3aRx3LWf^{^TLE-lb zcT&W-jd1%;G%+0Cm3f7cHBA zwQK@wE!w7o?V}U4O$XN6sx$toJbw^0KFwdc03reac)GrrJNHGNH^2A4m0!fT&8-7( z9)F9L$zOT}WD^KR!&~omKj(XXA|fIpA|fIpA|j$XE9%SF-KUL_uTYI$uXl)ke^A(% ztgFfv0C;<^plv$vrJYu3yIVDOS@9u8!y7N!>4k5Ie3!Kr5BGOfPU#ob*zF!)deu#? u^gjRq9xl%RZ#UM*$6%%Yb@4<*K6(M5Ym%P5RkgPO0000