Northstar Gloves (#16021)

* Added Gloves of North Star, no sprite or talking yet...

* Added sprites for the gloves of the north star...

* Replaced more placeholder sprites for northstar gloves...

* Added gloves of the north star to uplink...

* Added speech on hit, not yet configureable

* Not functional yet, but a step in the right direction I hope...

* IT WORKS!!

* Licensing and cleanup

* Reduced attack speed, changed from chat to popup, added some admin logging. It was causing too much adminlog spam otherwise

* Reorganized some files, final build??

* Changed the adminlog type from Verb to new type ItemConfigure

* More cleanup, fix sprite reference maybe

* Keronshb's suggestions, fixed some stuff, made hit sound use the meaty punch sfx

* Adds support for hiding speak/whisper/emote from adminlogs, makes northstar speak again!

* Some file shuffling, some of Keronshb's requests. Might appear a bit funky in github because vscode kept duplicating files for some reason and I had to delete them

* Made it work with the latest changes on Master

* Final? cleanup, upped dmg to 8, made ui not activate on activateinhand, instead you need to right click

* Set value to 0 credits, that's all

* Well that was much easier than I made it out to be. Now you can only activate the gloves with right click, no more mispredicts.

* Update MeleeWeaponSystem.cs

Iunno why this got changed in the first place, but I'm changin it back

* emptycommit

* emptycommit

* The tiny fixening
This commit is contained in:
HerCoyote23
2023-05-23 11:12:30 -07:00
committed by GitHub
parent 7ea1906c27
commit e45dd96af9
28 changed files with 383 additions and 47 deletions

View File

@@ -100,14 +100,14 @@ public sealed partial class ChatSystem : SharedChatSystem
private void OnGameChange(GameRunLevelChangedEvent ev)
{
switch(ev.New)
switch (ev.New)
{
case GameRunLevel.InRound:
if(!_configurationManager.GetCVar(CCVars.OocEnableDuringRound))
if (!_configurationManager.GetCVar(CCVars.OocEnableDuringRound))
_configurationManager.SetCVar(CCVars.OocEnabled, false);
break;
case GameRunLevel.PostRound:
if(!_configurationManager.GetCVar(CCVars.OocEnableDuringRound))
if (!_configurationManager.GetCVar(CCVars.OocEnableDuringRound))
_configurationManager.SetCVar(CCVars.OocEnabled, true);
break;
}
@@ -120,13 +120,14 @@ public sealed partial class ChatSystem : SharedChatSystem
/// <param name="message">The message being spoken or emoted</param>
/// <param name="desiredType">The chat type</param>
/// <param name="hideChat">Whether or not this message should appear in the chat window</param>
/// <param name="hideLog">Whether or not this message should appear in the adminlog window</param>
/// <param name="shell"></param>
/// <param name="player">The player doing the speaking</param>
/// <param name="nameOverride">The name to use for the speaking entity. Usually this should just be modified via <see cref="TransformSpeakerNameEvent"/>. If this is set, the event will not get raised.</param>
public void TrySendInGameICMessage(EntityUid source, string message, InGameICChatType desiredType, bool hideChat,
public void TrySendInGameICMessage(EntityUid source, string message, InGameICChatType desiredType, bool hideChat, bool hideLog = false,
IConsoleShell? shell = null, IPlayerSession? player = null, string? nameOverride = null, bool checkRadioPrefix = true)
{
TrySendInGameICMessage(source, message, desiredType, hideChat ? ChatTransmitRange.HideChat : ChatTransmitRange.Normal, shell, player, nameOverride, checkRadioPrefix);
TrySendInGameICMessage(source, message, desiredType, hideChat ? ChatTransmitRange.HideChat : ChatTransmitRange.Normal, hideLog, shell, player, nameOverride, checkRadioPrefix);
}
/// <summary>
@@ -139,7 +140,7 @@ public sealed partial class ChatSystem : SharedChatSystem
/// <param name="shell"></param>
/// <param name="player">The player doing the speaking</param>
/// <param name="nameOverride">The name to use for the speaking entity. Usually this should just be modified via <see cref="TransformSpeakerNameEvent"/>. If this is set, the event will not get raised.</param>
public void TrySendInGameICMessage(EntityUid source, string message, InGameICChatType desiredType, ChatTransmitRange range,
public void TrySendInGameICMessage(EntityUid source, string message, InGameICChatType desiredType, ChatTransmitRange range, bool hideLog = false,
IConsoleShell? shell = null, IPlayerSession? player = null, string? nameOverride = null, bool checkRadioPrefix = true)
{
if (HasComp<GhostComponent>(source))
@@ -194,13 +195,13 @@ public sealed partial class ChatSystem : SharedChatSystem
switch (desiredType)
{
case InGameICChatType.Speak:
SendEntitySpeak(source, message, range, nameOverride);
SendEntitySpeak(source, message, range, nameOverride, hideLog);
break;
case InGameICChatType.Whisper:
SendEntityWhisper(source, message, range, null, nameOverride);
SendEntityWhisper(source, message, range, null, nameOverride, hideLog);
break;
case InGameICChatType.Emote:
SendEntityEmote(source, message, range, nameOverride);
SendEntityEmote(source, message, range, nameOverride, hideLog);
break;
}
}
@@ -294,7 +295,7 @@ public sealed partial class ChatSystem : SharedChatSystem
#region Private API
private void SendEntitySpeak(EntityUid source, string originalMessage, ChatTransmitRange range, string? nameOverride)
private void SendEntitySpeak(EntityUid source, string originalMessage, ChatTransmitRange range, string? nameOverride, bool hideLog = false)
{
if (!_actionBlocker.CanSpeak(source))
return;
@@ -326,7 +327,8 @@ public sealed partial class ChatSystem : SharedChatSystem
RaiseLocalEvent(source, ev, true);
// To avoid logging any messages sent by entities that are not players, like vendors, cloning, etc.
if (!HasComp<ActorComponent>(source))
// Also doesn't log if hideLog is true.
if (!HasComp<ActorComponent>(source) || hideLog == true)
return;
if (originalMessage == message)
@@ -347,7 +349,7 @@ public sealed partial class ChatSystem : SharedChatSystem
}
}
private void SendEntityWhisper(EntityUid source, string originalMessage, ChatTransmitRange range, RadioChannelPrototype? channel, string? nameOverride)
private void SendEntityWhisper(EntityUid source, string originalMessage, ChatTransmitRange range, RadioChannelPrototype? channel, string? nameOverride, bool hideLog = false)
{
if (!_actionBlocker.CanSpeak(source))
return;
@@ -399,26 +401,26 @@ public sealed partial class ChatSystem : SharedChatSystem
var ev = new EntitySpokeEvent(source, message, channel, obfuscatedMessage);
RaiseLocalEvent(source, ev, true);
if (originalMessage == message)
{
if (name != Name(source))
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Whisper from {ToPrettyString(source):user} as {name}: {originalMessage}.");
if (!hideLog)
if (originalMessage == message)
{
if (name != Name(source))
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Whisper from {ToPrettyString(source):user} as {name}: {originalMessage}.");
else
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Whisper from {ToPrettyString(source):user}: {originalMessage}.");
}
else
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Whisper from {ToPrettyString(source):user}: {originalMessage}.");
}
else
{
if (name != Name(source))
_adminLogger.Add(LogType.Chat, LogImpact.Low,
{
if (name != Name(source))
_adminLogger.Add(LogType.Chat, LogImpact.Low,
$"Whisper from {ToPrettyString(source):user} as {name}, original: {originalMessage}, transformed: {message}.");
else
_adminLogger.Add(LogType.Chat, LogImpact.Low,
else
_adminLogger.Add(LogType.Chat, LogImpact.Low,
$"Whisper from {ToPrettyString(source):user}, original: {originalMessage}, transformed: {message}.");
}
}
}
private void SendEntityEmote(EntityUid source, string action, ChatTransmitRange range, string? nameOverride, bool checkEmote = true)
private void SendEntityEmote(EntityUid source, string action, ChatTransmitRange range, string? nameOverride, bool hideLog = false, bool checkEmote = true)
{
if (!_actionBlocker.CanEmote(source)) return;
@@ -433,11 +435,11 @@ public sealed partial class ChatSystem : SharedChatSystem
if (checkEmote)
TryEmoteChatInput(source, action);
SendInVoiceRange(ChatChannel.Emotes, action, wrappedMessage, source, range);
if (name != Name(source))
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Emote from {ToPrettyString(source):user} as {name}: {action}");
else
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Emote from {ToPrettyString(source):user}: {action}");
if (!hideLog)
if (name != Name(source))
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Emote from {ToPrettyString(source):user} as {name}: {action}");
else
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Emote from {ToPrettyString(source):user}: {action}");
}
// ReSharper disable once InconsistentNaming
@@ -714,7 +716,7 @@ public sealed class TransformSpeakerNameEvent : EntityEventArgs
}
/// <summary>
/// Raised broadcast in order to transform speech.
/// Raised broadcast in order to transform speech.transmit
/// </summary>
public sealed class TransformSpeechEvent : EntityEventArgs
{