Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert #6 "Latest Experimental Psychics" #109

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ public override Control GetUIFragmentRoot()
public override void Setup(BoundUserInterface userInterface, EntityUid? fragmentOwner)
{
_fragment = new CrimeAssistUiFragment();

_fragment.OnSync += _ => SendSyncMessage(userInterface);
}

private void SendSyncMessage(BoundUserInterface userInterface)
{
var syncMessage = new CrimeAssistSyncMessageEvent();
var message = new CartridgeUiMessage(syncMessage);
userInterface.SendMessage(message);
}

public override void UpdateState(BoundUserInterfaceState state)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Content.Client.Message;
using Content.Shared.DeltaV.CartridgeLoader.Cartridges;
using Robust.Client.AutoGenerated;
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
Expand All @@ -12,7 +13,9 @@ namespace Content.Client.DeltaV.CartridgeLoader.Cartridges;
public sealed partial class CrimeAssistUiFragment : BoxContainer
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IResourceCache _resourceCache = default!;

public event Action<bool>? OnSync;
private CrimeAssistPage _currentPage;
private List<CrimeAssistPage>? _pages;

Expand Down

This file was deleted.

This file was deleted.

27 changes: 0 additions & 27 deletions Content.Client/DeltaV/CartridgeLoader/Cartridges/SecWatchUi.cs

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
using Content.Client.Psionics.UI;
using Content.Client.UserInterface.Fragments;
using Content.Shared.CartridgeLoader.Cartridges;
using Content.Shared.CartridgeLoader;

namespace Content.Client.Psionics.GlimmerMonitor;
namespace Content.Client.Nyanotrasen.CartridgeLoader.Cartridges;

public sealed partial class GlimmerMonitorUi : UIFragment
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<cartridges:GlimmerMonitorUiFragment xmlns:cartridges="clr-namespace:Content.Client.Psionics.GlimmerMonitor"
<cartridges:GlimmerMonitorUiFragment xmlns:cartridges="clr-namespace:Content.Client.Nyanotrasen.CartridgeLoader.Cartridges"
xmlns="https://spacestation14.io" Margin="1 0 2 0">
<PanelContainer StyleClasses="BackgroundDark"></PanelContainer>
<BoxContainer Name="SettingsBox" Orientation="Horizontal" HorizontalExpand="True" VerticalExpand="False">
<Label Text="{Loc 'glimmer-monitor-interval'}"/>
<Button Name="IntervalButton6s" Access="Public" Text="6s" StyleClasses="OpenRight"/>
<Button Name="IntervalButton1" Access="Public" Text="1m" StyleClasses="OpenRight"/>
<Button Name="IntervalButton5" Access="Public" Text="5m" StyleClasses="OpenBoth"/>
<Button Name="IntervalButton10" Access="Public" Text="10m" StyleClasses="OpenLeft"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System.Linq;
using System.Numerics;
using Content.Client.Psionics.UI;
using Content.Client.Nyanotrasen.UserInterface;
using Robust.Client.AutoGenerated;
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;

namespace Content.Client.Psionics.GlimmerMonitor;
namespace Content.Client.Nyanotrasen.CartridgeLoader.Cartridges;

[GenerateTypedNameReferences]
public sealed partial class GlimmerMonitorUiFragment : BoxContainer
Expand All @@ -26,14 +26,12 @@ public GlimmerMonitorUiFragment()
VerticalExpand = true;

var intervalGroup = new ButtonGroup();
IntervalButton6s.Group = intervalGroup;
IntervalButton1.Group = intervalGroup;
IntervalButton5.Group = intervalGroup;
IntervalButton10.Group = intervalGroup;

IntervalButton6s.Pressed = true;
IntervalButton1.Pressed = true;

IntervalButton6s.OnPressed += _ => UpdateState(_cachedValues);
IntervalButton1.OnPressed += _ => UpdateState(_cachedValues);
IntervalButton5.OnPressed += _ => UpdateState(_cachedValues);
IntervalButton10.OnPressed += _ => UpdateState(_cachedValues);
Expand Down Expand Up @@ -64,12 +62,14 @@ private List<int> FormatGlimmerValues(List<int> glimmerValues)
{
var returnList = glimmerValues;

if (IntervalButton1.Pressed)
returnList = GetAveragedList(glimmerValues, 10);
else if (IntervalButton5.Pressed)
returnList = GetAveragedList(glimmerValues, 50);
if (IntervalButton5.Pressed)
{
returnList = GetAveragedList(glimmerValues, 5);
}
else if (IntervalButton10.Pressed)
returnList = GetAveragedList(glimmerValues, 100);
{
returnList = GetAveragedList(glimmerValues, 10);
}

return ClipToFifteen(returnList);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Content.Shared.Psionics.Abilities;
using Content.Shared.Abilities.Psionics;
using Content.Client.Chat.Managers;
using Robust.Client.Player;

namespace Content.Client.Psionics.Chat
namespace Content.Client.Nyanotrasen.Chat
{
public sealed class PsionicChatUpdateSystem : EntitySystem
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;

namespace Content.Client.Psionics.UI;
namespace Content.Client.Nyanotrasen.UserInterface;

public sealed class GlimmerGraph : Control
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ void AddSelector(LoadoutPreferenceSelector selector, int points, string id)
selector.PreferenceChanged += preference =>
{
// Make sure they have enough loadout points
preference = preference ? CheckPoints(-points, preference) : CheckPoints(points, preference);
preference = preference ? CheckPoints(points, preference) : CheckPoints(-points, preference);

// Update Preferences
Profile = Profile?.WithLoadoutPreference(id, preference);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Content.Shared.Examine;
using Content.Shared.Input;
using Content.Shared.Radio;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Input;
using Robust.Client.Player;
Expand All @@ -37,7 +38,7 @@
using Robust.Shared.Replays;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Content.Client.Psionics.Chat;
using Content.Client.Nyanotrasen.Chat; //Nyano - Summary: chat namespace.

namespace Content.Client.UserInterface.Systems.Chat;

Expand All @@ -60,7 +61,7 @@ public sealed class ChatUIController : UIController
[UISystemDependency] private readonly GhostSystem? _ghost = default;
[UISystemDependency] private readonly TypingIndicatorSystem? _typingIndicator = default;
[UISystemDependency] private readonly ChatSystem? _chatSys = default;
[UISystemDependency] private readonly PsionicChatUpdateSystem? _psionic = default!; //EE - Summary: makes the psionic chat available.
[UISystemDependency] private readonly PsionicChatUpdateSystem? _psionic = default!; //Nyano - Summary: makes the psionic chat available.

[ValidatePrototypeId<ColorPalettePrototype>]
private const string ChatNamePalette = "ChatNames";
Expand All @@ -82,7 +83,7 @@ public sealed class ChatUIController : UIController
{SharedChatSystem.AdminPrefix, ChatSelectChannel.Admin},
{SharedChatSystem.RadioCommonPrefix, ChatSelectChannel.Radio},
{SharedChatSystem.DeadPrefix, ChatSelectChannel.Dead},
{SharedChatSystem.TelepathicPrefix, ChatSelectChannel.Telepathic} //EE - Summary: adds the telepathic prefix =.
{SharedChatSystem.TelepathicPrefix, ChatSelectChannel.Telepathic} //Nyano - Summary: adds the telepathic prefix =.
};

public static readonly Dictionary<ChatSelectChannel, char> ChannelPrefixes = new()
Expand All @@ -97,7 +98,7 @@ public sealed class ChatUIController : UIController
{ChatSelectChannel.Admin, SharedChatSystem.AdminPrefix},
{ChatSelectChannel.Radio, SharedChatSystem.RadioCommonPrefix},
{ChatSelectChannel.Dead, SharedChatSystem.DeadPrefix},
{ChatSelectChannel.Telepathic, SharedChatSystem.TelepathicPrefix } //EE - Summary: associates telepathic with =.
{ChatSelectChannel.Telepathic, SharedChatSystem.TelepathicPrefix } //Nyano - Summary: associates telepathic with =.
};

/// <summary>
Expand Down
12 changes: 0 additions & 12 deletions Content.Server/Abilities/Mime/MimePowersComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,5 @@ public sealed partial class MimePowersComponent : Component
/// </summary>
[DataField("vowCooldown")]
public TimeSpan VowCooldown = TimeSpan.FromMinutes(5);

/// <summary
/// Psionic Feedback for if a mime with their vow intact is scanned by a Mantis
/// </summary>
[DataField("mimeFeedback")]
public string MimeFeedback = "mime-feedback";

/// <summary
/// Psionic Feedback for if a mime with their vow intact is scanned by a Mantis
/// </summary>
[DataField("mimeBrokenFeedback")]
public string MimeBrokenFeedback = "mime-broken-feedback";
}
}
38 changes: 8 additions & 30 deletions Content.Server/Abilities/Mime/MimePowersSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Server.Popups;
using Content.Server.Speech.Muting;
using Content.Shared.Actions;
using Content.Shared.Actions.Events;
using Content.Shared.Alert;
Expand All @@ -9,7 +10,7 @@
using Robust.Shared.Containers;
using Robust.Shared.Map;
using Robust.Shared.Timing;
using Content.Shared.Psionics.Abilities;
using Content.Shared.Abilities.Psionics; //Nyano - Summary: Makes Mime psionic.
using Content.Shared.Speech.Muting;

namespace Content.Server.Abilities.Mime
Expand Down Expand Up @@ -57,21 +58,14 @@ private void OnComponentInit(EntityUid uid, MimePowersComponent component, Compo
EnsureComp<MutedComponent>(uid);
_alertsSystem.ShowAlert(uid, AlertType.VowOfSilence);
_actionsSystem.AddAction(uid, ref component.InvisibleWallActionEntity, component.InvisibleWallAction, uid);

// Mimes gain their power from a special Vow, but this vow extends to Telepathic speech.
if (EnsureComp<PsionicComponent>(uid, out var psionic))
{
psionic.TelepathicMute = true;
psionic.ActivePowers.Add(component);
psionic.PsychicFeedback.Add(component.MimeFeedback);
psionic.Dampening += 1f;
}
//Nyano - Summary: Add Psionic Ability to Mime.
if (TryComp<PsionicComponent>(uid, out var psionic) && psionic.PsionicAbility == null)
psionic.PsionicAbility = component.InvisibleWallActionEntity;
}

/// <summary>
/// Creates an invisible wall in a free space after some checks.
/// </summary>
// TODO: Consider separating this out from the Mime entirely, and make a standalone "Telekinetic Barricade" power.
private void OnInvisibleWall(EntityUid uid, MimePowersComponent component, InvisibleWallActionEvent args)
{
if (!component.Enabled)
Expand Down Expand Up @@ -104,9 +98,9 @@ private void OnInvisibleWall(EntityUid uid, MimePowersComponent component, Invis
return;
}
}
if (TryComp<PsionicComponent>(uid, out var psionic))
_psionics.LogPowerUsed(uid, "invisible wall", psionic, 4, 6);

// Begin Nyano-code: mime powers are psionic.
_psionics.LogPowerUsed(uid, "invisible wall");
// End Nyano-code.
_popupSystem.PopupEntity(Loc.GetString("mime-invisible-wall-popup", ("mime", uid)), uid);
// Make sure we set the invisible wall to despawn properly
Spawn(component.WallPrototype, _turf.GetTileCenter(tile.Value));
Expand All @@ -132,14 +126,6 @@ public void BreakVow(EntityUid uid, MimePowersComponent? mimePowers = null)
_alertsSystem.ClearAlert(uid, AlertType.VowOfSilence);
_alertsSystem.ShowAlert(uid, AlertType.VowBroken);
_actionsSystem.RemoveAction(uid, mimePowers.InvisibleWallActionEntity);
if (TryComp<PsionicComponent>(uid, out var psionic))
{
psionic.TelepathicMute = false;
psionic.ActivePowers.Remove(mimePowers);
psionic.PsychicFeedback.Remove(mimePowers.MimeFeedback);
psionic.PsychicFeedback.Add(mimePowers.MimeBrokenFeedback);
psionic.Dampening -= 1f;
}
}

/// <summary>
Expand All @@ -163,14 +149,6 @@ public void RetakeVow(EntityUid uid, MimePowersComponent? mimePowers = null)
_alertsSystem.ClearAlert(uid, AlertType.VowBroken);
_alertsSystem.ShowAlert(uid, AlertType.VowOfSilence);
_actionsSystem.AddAction(uid, ref mimePowers.InvisibleWallActionEntity, mimePowers.InvisibleWallAction, uid);
if (TryComp<PsionicComponent>(uid, out var psionic))
{
psionic.TelepathicMute = true;
psionic.ActivePowers.Add(mimePowers);
psionic.PsychicFeedback.Add(mimePowers.MimeFeedback);
psionic.PsychicFeedback.Remove(mimePowers.MimeBrokenFeedback);
psionic.Dampening += 1f;
}
}
}
}
2 changes: 1 addition & 1 deletion Content.Server/Anomaly/AnomalySystem.Psionics.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Server.Psionics.Abilities;
using Content.Server.Abilities.Psionics;
using Content.Shared.Anomaly;
using Content.Shared.Anomaly.Components;
using Robust.Shared.Random;
Expand Down
Loading
Loading