Skip to content

Commit

Permalink
фыф
Browse files Browse the repository at this point in the history
  • Loading branch information
pofitlo-Git committed Nov 21, 2024
1 parent c71ec36 commit 5d6a8bb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
11 changes: 11 additions & 0 deletions Content.Server/Chat/ChatComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Content.Server.Chat;

/// <summary>
/// Modifaer for entity to expand whisper radius
/// </summary>
[RegisterComponent]
public sealed partial class ChatComponent : Component
{
[DataField("whisperPersonalRange")]
public int WhisperPersonalRange = 2;
}
5 changes: 4 additions & 1 deletion Content.Server/Chat/Systems/ChatSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,13 @@ private void SendEntityWhisper(
continue;
listener = session.AttachedEntity.Value;

var listenerComp = CompOrNull<ChatComponent>(listener); //Corvax-Next-Resomi modifaer for whisper range

if (MessageRangeCheck(session, data, range) != MessageRangeCheckResult.Full)
continue; // Won't get logged to chat, and ghosts are too far away to see the pop-up, so we just won't send it to them.

if (data.Range <= WhisperClearRange)
if ((listenerComp != null && data.Range <= listenerComp.WhisperPersonalRange)
|| (listenerComp == null && data.Range <= WhisperClearRange)) //Corvax-Next-Resomi modifaer for whisper range
_chatManager.ChatMessageToOne(ChatChannel.Whisper, message, wrappedMessage, source, false, session.Channel);
//If listener is too far, they only hear fragments of the message
else if (_examineSystem.InRangeUnOccluded(source, listener, WhisperMuffledRange))
Expand Down

This file was deleted.

2 changes: 2 additions & 0 deletions Resources/Prototypes/_CorvaxNext/Entities/Species/resomi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
components:
- type: WeaponsUseInability
- type: AgillitySkill
- type: Chat
whisperPersonalRange: 4
- type: ResomiAccent
- type: DamageVisuals
thresholds: [ 10, 30, 50, 70]
Expand Down

0 comments on commit 5d6a8bb

Please sign in to comment.