- add: Changeling antagonist (#2)

* Changeling WIP

* UI

* Pointers fix

* Moved out abilities

* Regenerate ability

* Fixed Regenerate ability
Prevent ghosting while regenerating

* Cleanup

* Base lesser form

* Finished Lesser Form && Transform

* Transform Sting

* Blind Sting

* Mute Sting
Added OnExamine on absorbed human

* Hallucination Sting
Changeling Absorb and transfer absorbed entities to absorber

* Cryogenic Sting

* Adrenaline Sacs

* Transform now uses Polymorph

* Armblade, Shield, Armor

* Tentacle Arm ability
Tentacle Gun system

* WIP with bugs

* WiP bugs

* fix implant transfer

* Fixed bugs with shop transfer and actions transfer

* Just in case

* Vi sitter i ventrilo och spelar DotA

* Fixes and proper LesserForm tracking

* !!!!!

* Fixed empty buttons

* WIP Gamerule
Ready - shop

* nerf stun time cause its sucks

* cleaning

* just in case

* Absorb DNA Objective.

* Partial objectives with bugs

* fix

* fix pointer

* Changeling objectives

* Changeling objectives №2

* Admin verb, game rule

* Fixed empty list check
Icons for objectives

* Changeling chat, changeling names etc.

* fix some merge errors

* - fix: Fixed all bugs with changeling

---------

Co-authored-by: Y-Parvus <yevhen.parvus@gmail.com>
Co-authored-by: Y-Parvus <61109031+Y-Parvus@users.noreply.github.com>
Co-authored-by: HitPanda <104197232+EnefFlow@users.noreply.github.com>
Co-authored-by: EnefFlow <regeto90@mail.ru>
This commit is contained in:
rhailrake
2024-01-31 14:01:35 +00:00
committed by GitHub
parent 7872502bf8
commit aa8e31fa7e
127 changed files with 3747 additions and 33 deletions

View File

@@ -1,8 +1,8 @@
using Content.Client.Administration.Managers;
using Content.Client.Ghost;
using Content.Shared.Administration;
using Content.Shared.Changeling;
using Content.Shared.Chat;
using Content.Shared._White.Cult;
using Robust.Client.Console;
using Robust.Client.Player;
using Robust.Shared.Utility;
@@ -15,7 +15,7 @@ namespace Content.Client.Chat.Managers
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
[Dependency] private readonly IClientAdminManager _adminMgr = default!;
[Dependency] private readonly IEntitySystemManager _systems = default!;
[Dependency] private readonly IEntityManager _entities = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IPlayerManager _player = default!;
@@ -29,7 +29,6 @@ namespace Content.Client.Chat.Managers
public void SendMessage(string text, ChatSelectChannel channel)
{
var str = text.ToString();
switch (channel)
{
case ChatSelectChannel.Console:
@@ -38,25 +37,25 @@ namespace Content.Client.Chat.Managers
break;
case ChatSelectChannel.LOOC:
_consoleHost.ExecuteCommand($"looc \"{CommandParsing.Escape(str)}\"");
_consoleHost.ExecuteCommand($"looc \"{CommandParsing.Escape(text)}\"");
break;
case ChatSelectChannel.OOC:
_consoleHost.ExecuteCommand($"ooc \"{CommandParsing.Escape(str)}\"");
_consoleHost.ExecuteCommand($"ooc \"{CommandParsing.Escape(text)}\"");
break;
case ChatSelectChannel.Admin:
_consoleHost.ExecuteCommand($"asay \"{CommandParsing.Escape(str)}\"");
_consoleHost.ExecuteCommand($"asay \"{CommandParsing.Escape(text)}\"");
break;
case ChatSelectChannel.Emotes:
_consoleHost.ExecuteCommand($"me \"{CommandParsing.Escape(str)}\"");
_consoleHost.ExecuteCommand($"me \"{CommandParsing.Escape(text)}\"");
break;
case ChatSelectChannel.Cult:
var localEnt = _player.LocalPlayer != null ? _player.LocalPlayer.ControlledEntity : null;
if (_entities.TryGetComponent(localEnt, out CultistComponent? comp))
_consoleHost.ExecuteCommand($"csay \"{CommandParsing.Escape(str)}\"");
if (_entityManager.TryGetComponent(localEnt, out CultistComponent? comp))
_consoleHost.ExecuteCommand($"csay \"{CommandParsing.Escape(text)}\"");
break;
case ChatSelectChannel.Dead:
@@ -64,7 +63,7 @@ namespace Content.Client.Chat.Managers
goto case ChatSelectChannel.Local;
if (_adminMgr.HasFlag(AdminFlags.Admin))
_consoleHost.ExecuteCommand($"dsay \"{CommandParsing.Escape(str)}\"");
_consoleHost.ExecuteCommand($"dsay \"{CommandParsing.Escape(text)}\"");
else
_sawmill.Warning("Tried to speak on deadchat without being ghost or admin.");
break;
@@ -72,13 +71,20 @@ namespace Content.Client.Chat.Managers
// TODO sepearate radio and say into separate commands.
case ChatSelectChannel.Radio:
case ChatSelectChannel.Local:
_consoleHost.ExecuteCommand($"say \"{CommandParsing.Escape(str)}\"");
_consoleHost.ExecuteCommand($"say \"{CommandParsing.Escape(text)}\"");
break;
case ChatSelectChannel.Whisper:
_consoleHost.ExecuteCommand($"whisper \"{CommandParsing.Escape(str)}\"");
_consoleHost.ExecuteCommand($"whisper \"{CommandParsing.Escape(text)}\"");
break;
case ChatSelectChannel.Changeling:
var localEntity = _player.LocalPlayer != null ? _player.LocalPlayer.ControlledEntity : null;
if (_entityManager.HasComponent<ChangelingComponent>(localEntity))
_consoleHost.ExecuteCommand($"gsay \"{CommandParsing.Escape(text)}\"");
break;
default:
throw new ArgumentOutOfRangeException(nameof(channel), channel, null);
}

View File

@@ -0,0 +1,8 @@
using Content.Shared.Changeling;
namespace Content.Client.Miracle.Changeling;
public sealed class TentacleGun : SharedTentacleGun
{
}

View File

@@ -0,0 +1,9 @@
<DefaultWindow xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Changeling UI"
MinWidth="350"
MinHeight="400">
<ScrollContainer HorizontalExpand="True" VerticalExpand="True">
<BoxContainer Name="ItemsContainer" Orientation="Vertical"></BoxContainer>
</ScrollContainer>
</DefaultWindow>

View File

@@ -0,0 +1,33 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.Miracle.Changeling.UI.ListViewSelector;
[GenerateTypedNameReferences]
public sealed partial class ListViewChangelingSelectorWindow : DefaultWindow
{
public Action<string>? ItemSelected;
public ListViewChangelingSelectorWindow()
{
RobustXamlLoader.Load(this);
}
public void PopulateList(Dictionary<string, string> items)
{
ItemsContainer.RemoveAllChildren();
foreach (var item in items)
{
var button = new Button();
button.Text = item.Value;
button.OnPressed += _ => ItemSelected?.Invoke(item.Key);
ItemsContainer.AddChild(button);
}
}
}

View File

@@ -0,0 +1,51 @@
using Content.Shared.Miracle.UI;
namespace Content.Client.Miracle.Changeling.UI.ListViewSelector;
public sealed class ListViewSelectorBui : BoundUserInterface
{
private ListViewChangelingSelectorWindow? _window;
public ListViewSelectorBui(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
IoCManager.InjectDependencies(this);
}
protected override void Open()
{
base.Open();
_window = new ListViewChangelingSelectorWindow();
_window.OpenCentered();
_window.OnClose += Close;
_window.ItemSelected += item =>
{
var msg = new ListViewItemSelectedMessage(item);
SendMessage(msg);
};
if(State != null)
UpdateState(State);
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is ListViewBuiState newState)
{
_window?.PopulateList(newState.Items);
}
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;
_window?.Close();
}
}

View File

@@ -0,0 +1,9 @@
<DefaultWindow xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Changeling UI"
MinWidth="350"
MinHeight="400">
<ScrollContainer HorizontalExpand="True" VerticalExpand="True">
<BoxContainer Name="ItemsContainer" Orientation="Vertical"></BoxContainer>
</ScrollContainer>
</DefaultWindow>

View File

@@ -0,0 +1,33 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.Miracle.Changeling.UI.TransformStingUI;
[GenerateTypedNameReferences]
public sealed partial class TransformStingSelectorWindow : DefaultWindow
{
public Action<string, NetEntity>? ItemSelected;
public TransformStingSelectorWindow()
{
RobustXamlLoader.Load(this);
}
public void PopulateList(Dictionary<string, string> items, NetEntity target)
{
ItemsContainer.RemoveAllChildren();
foreach (var item in items)
{
var button = new Button();
button.Text = item.Value;
button.OnPressed += _ => ItemSelected?.Invoke(item.Key, target);
ItemsContainer.AddChild(button);
}
}
}

View File

@@ -0,0 +1,51 @@
using Content.Shared.Miracle.UI;
namespace Content.Client.Miracle.Changeling.UI.TransformStingUI;
public sealed class TransformStingSelectorBui : BoundUserInterface
{
private TransformStingSelectorWindow? _window;
public TransformStingSelectorBui(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
IoCManager.InjectDependencies(this);
}
protected override void Open()
{
base.Open();
_window = new TransformStingSelectorWindow();
_window.OpenCentered();
_window.OnClose += Close;
_window.ItemSelected += (item, target) =>
{
var msg = new TransformStingItemSelectedMessage(item, target);
SendMessage(msg);
};
if(State != null)
UpdateState(State);
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is TransformStingBuiState newState)
{
_window?.PopulateList(newState.Items, newState.Target);
}
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;
_window?.Close();
}
}

View File

@@ -13,6 +13,7 @@ using Content.Client.UserInterface.Systems.Chat.Widgets;
using Content.Client.UserInterface.Systems.Gameplay;
using Content.Shared.Administration;
using Content.Shared.CCVar;
using Content.Shared.Changeling;
using Content.Shared.Chat;
using Content.Shared.Damage.ForceSay;
using Content.Shared.Examine;
@@ -75,7 +76,8 @@ public sealed class ChatUIController : UIController
{SharedChatSystem.AdminPrefix, ChatSelectChannel.Admin},
{SharedChatSystem.RadioCommonPrefix, ChatSelectChannel.Radio},
{SharedChatSystem.DeadPrefix, ChatSelectChannel.Dead},
{SharedChatSystem.CultPrefix, ChatSelectChannel.Cult}, //WD EDIT
{SharedChatSystem.CultPrefix, ChatSelectChannel.Cult},
{SharedChatSystem.ChangelingPrefix, ChatSelectChannel.Changeling}
};
public static readonly Dictionary<ChatSelectChannel, char> ChannelPrefixes = new()
@@ -89,7 +91,8 @@ public sealed class ChatUIController : UIController
{ChatSelectChannel.Admin, SharedChatSystem.AdminPrefix},
{ChatSelectChannel.Radio, SharedChatSystem.RadioCommonPrefix},
{ChatSelectChannel.Dead, SharedChatSystem.DeadPrefix},
{ChatSelectChannel.Cult, SharedChatSystem.CultPrefix} // WD EDIT
{ChatSelectChannel.Cult, SharedChatSystem.CultPrefix},
{ChatSelectChannel.Changeling, SharedChatSystem.ChangelingPrefix}
};
@@ -203,6 +206,9 @@ public sealed class ChatUIController : UIController
_input.SetInputCommand(ContentKeyFunctions.FocusAdminChat,
InputCmdHandler.FromDelegate(_ => FocusChannel(ChatSelectChannel.Admin)));
_input.SetInputCommand(ContentKeyFunctions.FocusChangelingChat,
InputCmdHandler.FromDelegate(_ => FocusChannel(ChatSelectChannel.Changeling)));
_input.SetInputCommand(ContentKeyFunctions.FocusCultChat,
InputCmdHandler.FromDelegate(_ => FocusChannel(ChatSelectChannel.Cult)));
@@ -221,6 +227,7 @@ public sealed class ChatUIController : UIController
_input.SetInputCommand(ContentKeyFunctions.CycleChatChannelBackward,
InputCmdHandler.FromDelegate(_ => CycleChatChannel(false)));
SubscribeLocalEvent<ChangelingUserStart>(OnUpdateChangelingChat);
// WD EDIT
SubscribeLocalEvent<EventCultistComponentState>(OnUpdateCultState);
// WD EDIT END
@@ -230,6 +237,11 @@ public sealed class ChatUIController : UIController
gameplayStateLoad.OnScreenUnload += OnScreenUnload;
}
private void OnUpdateChangelingChat(ChangelingUserStart ev)
{
UpdateChannelPermissions();
}
// WD EDIT
private void OnUpdateCultState(EventCultistComponentState ev)
{

View File

@@ -23,6 +23,7 @@ public sealed partial class ChannelFilterPopup : Popup
ChatChannel.AdminAlert,
ChatChannel.AdminChat,
ChatChannel.Server,
ChatChannel.Changeling,
ChatChannel.Cult // WD EDIT
};

View File

@@ -64,6 +64,7 @@ public sealed class ChannelSelectorButton : ChatPopupButton<ChannelSelectorPopup
ChatSelectChannel.OOC => Color.LightSkyBlue,
ChatSelectChannel.Dead => Color.MediumPurple,
ChatSelectChannel.Admin => Color.HotPink,
ChatSelectChannel.Changeling => Color.Purple,
ChatSelectChannel.Cult => Color.DarkRed,
_ => Color.DarkGray
};

View File

@@ -17,6 +17,7 @@ public sealed class ChannelSelectorPopup : Popup
ChatSelectChannel.OOC,
ChatSelectChannel.Dead,
ChatSelectChannel.Admin,
ChatSelectChannel.Changeling,
ChatSelectChannel.Cult // WD EDIT
// NOTE: Console is not in there and it can never be permanently selected.
// You can, however, still submit commands as console by prefixing with /.