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

Upstream Merge 2024-08-31 #161

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
eb9c206
Fix supermatter.ftl (#790)
FoxxoTrystan Aug 24, 2024
dcfd0fb
Automatic Changelog Update (#790)
SimpleStation14 Aug 24, 2024
8f32e42
Fix Door Access (#798)
Fansana Aug 25, 2024
ec11eed
Automatic Changelog Update (#798)
SimpleStation14 Aug 25, 2024
5118c60
Cherry-Pick PR #27113 (#803)
VMSolidus Aug 26, 2024
6d53996
Automatic Changelog Update (#803)
SimpleStation14 Aug 26, 2024
e70d218
Improve README/Legal Files (#782)
DEATHB4DEFEAT Aug 26, 2024
662d33d
Return Of The Pibble (#789)
VMSolidus Aug 27, 2024
958103e
Automatic Changelog Update (#789)
SimpleStation14 Aug 27, 2024
2b4464a
Chat it's real
Mnemotechnician Aug 28, 2024
e77b58c
Make IPC Sounds Great Again (#811)
BasedUser Aug 29, 2024
834be84
Automatic Changelog Update (#811)
SimpleStation14 Aug 29, 2024
ffeef51
Add IPC's Missing Components (#793)
VMSolidus Aug 29, 2024
e98235f
Automatic Changelog Update (#793)
SimpleStation14 Aug 29, 2024
70885ac
Temporarily Disable Telegnosis (#795)
VMSolidus Aug 30, 2024
c7a1163
Automatic Changelog Update (#795)
SimpleStation14 Aug 30, 2024
386d9ca
IPC Missing Deathgasp (#800)
VMSolidus Aug 30, 2024
7a8ab49
Automatic Changelog Update (#800)
SimpleStation14 Aug 30, 2024
2d02d90
Update README.md (#817)
Pspritechologist Aug 30, 2024
8a21d3e
Make Shoving and Stamina Great Again (#809)
Mnemotechnician Aug 30, 2024
8049231
Automatic Changelog Update (#809)
SimpleStation14 Aug 30, 2024
ef2d1c3
Thieves Outside of Traitor (#799)
ShatteredSwords Aug 30, 2024
ba34b6e
Automatic Changelog Update (#799)
SimpleStation14 Aug 30, 2024
9c85b3c
Telepathy (Minor)Refactor (#819)
VMSolidus Aug 30, 2024
a56956a
Automatic Changelog Update (#819)
SimpleStation14 Aug 30, 2024
bdaba63
Psionic Insulation Trait (#820)
VMSolidus Aug 30, 2024
fa29a94
Automatic Changelog Update (#820)
SimpleStation14 Aug 30, 2024
5fa2591
New Interaction System (#733)
Mnemotechnician Aug 30, 2024
e5bf05d
Automatic Changelog Update (#733)
SimpleStation14 Aug 30, 2024
e428c0b
Rebalance Radiation Shielding (#791)
VMSolidus Aug 30, 2024
0feb56e
Automatic Changelog Update (#791)
SimpleStation14 Aug 30, 2024
71a54b7
Glacier Real (#1169) (#728)
VMSolidus Aug 30, 2024
636c5e8
Automatic Changelog Update (#728)
SimpleStation14 Aug 30, 2024
9a0f5fa
Rebase Saltern (#804)
VMSolidus Aug 30, 2024
eda06f3
Automatic Changelog Update (#804)
SimpleStation14 Aug 30, 2024
77f4ad9
Core Supermatter (#792)
VMSolidus Aug 30, 2024
47c0610
Automatic Changelog Update (#792)
SimpleStation14 Aug 30, 2024
6202056
Fix InnatePsionicPowers For Mapped Entities (#824)
VMSolidus Aug 31, 2024
c00300b
Automatic Changelog Update (#824)
SimpleStation14 Aug 31, 2024
a242a28
Merge remote-tracking branch 'refs/remotes/real-ee/master' into feat/…
Mnemotechnician Aug 31, 2024
6cf44a0
Revert "Merge pull request #125 from FoxxoTrystan/returnofthehug"
Mnemotechnician Aug 31, 2024
7f26690
Merge branch 'refs/heads/tweak/language-fonts-in-popups' into feat/fl…
Mnemotechnician Aug 31, 2024
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
8 changes: 8 additions & 0 deletions Content.Client/InteractionVerbs/InteractionVerbsSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Content.Shared.InteractionVerbs;

namespace Content.Client.InteractionVerbs;

// Just here because the shared system is abstract.
public sealed class InteractionVerbsSystem : SharedInteractionVerbsSystem
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System.Linq;
using Content.Client.Guidebook;
using Content.Server.Verbs;
using Content.Shared.InteractionVerbs;
using Content.Shared.Verbs;
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;

namespace Content.IntegrationTests.Tests.InteractionVerbs;

[TestFixture]
[FixtureLifeCycle(LifeCycle.SingleInstance)]
[TestOf(typeof(InteractionVerbPrototype))]
public sealed class InteractionPrototypesTest
{
public const string TestMobProto = "MobHuman";

[Test]
public async Task ValidatePrototypeContents()
{
await using var pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true });
var server = pair.Server;
await server.WaitIdleAsync();

var entMan = server.ResolveDependency<IEntityManager>();
var protoMan = server.ResolveDependency<IPrototypeManager>();

// TODO probably should test if an entity receives an abstract verb, but Iunno how
foreach (var proto in protoMan.EnumeratePrototypes<InteractionVerbPrototype>())
{
Assert.That(proto.Abstract || proto.Action is not null, $"Non-abstract prototype {proto.ID} lacks an action!");
}


await pair.CleanReturnAsync();
}
}
3 changes: 3 additions & 0 deletions Content.IntegrationTests/Tests/PostMapInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,15 @@ public sealed class PostMapInitTest
"CentComm",
"MeteorArena",
"NukieOutpost",
"Core",
"Pebble", //DeltaV
"Edge", //DeltaV
"Saltern",
"Shoukou", //DeltaV
"Tortuga", //DeltaV
"Arena", //DeltaV
"Asterisk", //DeltaV
"Glacier", //DeltaV
"TheHive", //DeltaV
"Hammurabi", //DeltaV
"Lighthouse", //DeltaV
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Abilities/Psionics/PsionicAbilitiesSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ public sealed class PsionicAbilitiesSystem : EntitySystem
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<InnatePsionicPowersComponent, ComponentStartup>(InnatePowerStartup);
SubscribeLocalEvent<InnatePsionicPowersComponent, MapInitEvent>(InnatePowerStartup);
SubscribeLocalEvent<PsionicComponent, ComponentShutdown>(OnPsionicShutdown);
}

/// <summary>
/// Special use-case for a InnatePsionicPowers, which allows an entity to start with any number of Psionic Powers.
/// </summary>
private void InnatePowerStartup(EntityUid uid, InnatePsionicPowersComponent comp, ComponentStartup args)
private void InnatePowerStartup(EntityUid uid, InnatePsionicPowersComponent comp, MapInitEvent args)
{
// Any entity with InnatePowers should also be psionic, but in case they aren't already...
EnsureComp<PsionicComponent>(uid, out var psionic);
Expand Down
5 changes: 4 additions & 1 deletion Content.Server/Carrying/CarryingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ private void OnMoveInput(EntityUid uid, BeingCarriedComponent component, ref Mov
// Check if the victim is in any way incapacitated, and if not make an escape attempt.
// Escape time scales with the inverse of a mass contest. Being lighter makes escape harder.
if (_actionBlockerSystem.CanInteract(uid, component.Carrier))
_escapeInventorySystem.AttemptEscape(uid, component.Carrier, escape, _contests.MassContest(uid, component.Carrier, false, 2f));
{
var disadvantage = _contests.MassContest(component.Carrier, uid, false, 2f);
_escapeInventorySystem.AttemptEscape(uid, component.Carrier, escape, disadvantage);
}
}

private void OnMoveAttempt(EntityUid uid, BeingCarriedComponent component, UpdateCanMoveEvent args)
Expand Down
165 changes: 82 additions & 83 deletions Content.Server/Chat/TelepathicChatSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,113 +16,112 @@
using System.Linq;
using System.Text;

namespace Content.Server.Chat
namespace Content.Server.Chat;

/// <summary>
/// Extensions for Telepathic chat stuff
/// </summary>
public sealed class TelepathicChatSystem : EntitySystem
{
/// <summary>
/// Extensions for Telepathic chat stuff
/// </summary>
[Dependency] private readonly IAdminManager _adminManager = default!;
[Dependency] private readonly IChatManager _chatManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly GlimmerSystem _glimmerSystem = default!;
[Dependency] private readonly ChatSystem _chatSystem = default!;
private IEnumerable<INetChannel> GetPsionicChatClients()
{
return Filter.Empty()
.AddWhereAttachedEntity(IsEligibleForTelepathy)
.Recipients
.Select(p => p.ConnectedClient);
}

public sealed class TelepathicChatSystem : EntitySystem
private IEnumerable<INetChannel> GetAdminClients()
{
[Dependency] private readonly IAdminManager _adminManager = default!;
[Dependency] private readonly IChatManager _chatManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly GlimmerSystem _glimmerSystem = default!;
[Dependency] private readonly ChatSystem _chatSystem = default!;
private IEnumerable<INetChannel> GetPsionicChatClients()
{
return Filter.Empty()
.AddWhereAttachedEntity(IsEligibleForTelepathy)
.Recipients
.Select(p => p.ConnectedClient);
}
return _adminManager.ActiveAdmins
.Select(p => p.ConnectedClient);
}

private IEnumerable<INetChannel> GetAdminClients()
{
return _adminManager.ActiveAdmins
.Select(p => p.ConnectedClient);
}
private List<INetChannel> GetDreamers(IEnumerable<INetChannel> removeList)
{
var filtered = Filter.Empty()
.AddWhereAttachedEntity(entity =>
HasComp<PsionicComponent>(entity) && !HasComp<TelepathyComponent>(entity)
|| HasComp<SleepingComponent>(entity)
|| HasComp<SeeingRainbowsComponent>(entity) && !HasComp<PsionicsDisabledComponent>(entity) && !HasComp<PsionicInsulationComponent>(entity))
.Recipients
.Select(p => p.ConnectedClient);

private List<INetChannel> GetDreamers(IEnumerable<INetChannel> removeList)
{
var filtered = Filter.Empty()
.AddWhereAttachedEntity(entity => HasComp<SleepingComponent>(entity) || HasComp<SeeingRainbowsComponent>(entity) && !HasComp<PsionicsDisabledComponent>(entity) && !HasComp<PsionicInsulationComponent>(entity))
.Recipients
.Select(p => p.ConnectedClient);
var filteredList = filtered.ToList();

var filteredList = filtered.ToList();
foreach (var entity in removeList)
filteredList.Remove(entity);

foreach (var entity in removeList)
filteredList.Remove(entity);
return filteredList;
}

return filteredList;
}
private bool IsEligibleForTelepathy(EntityUid entity)
{
return HasComp<TelepathyComponent>(entity)
&& !HasComp<PsionicsDisabledComponent>(entity)
&& !HasComp<PsionicInsulationComponent>(entity)
&& (!TryComp<MobStateComponent>(entity, out var mobstate) || mobstate.CurrentState == MobState.Alive);
}

private bool IsEligibleForTelepathy(EntityUid entity)
{
return HasComp<PsionicComponent>(entity)
&& !HasComp<PsionicsDisabledComponent>(entity)
&& !HasComp<PsionicInsulationComponent>(entity)
&& (!TryComp<MobStateComponent>(entity, out var mobstate) || mobstate.CurrentState == MobState.Alive);
}
public void SendTelepathicChat(EntityUid source, string message, bool hideChat)
{
if (!IsEligibleForTelepathy(source))
return;

public void SendTelepathicChat(EntityUid source, string message, bool hideChat)
{
if (!IsEligibleForTelepathy(source))
return;
var clients = GetPsionicChatClients();
var admins = GetAdminClients();
string messageWrap;
string adminMessageWrap;

var clients = GetPsionicChatClients();
var admins = GetAdminClients();
string messageWrap;
string adminMessageWrap;
messageWrap = Loc.GetString("chat-manager-send-telepathic-chat-wrap-message",
("telepathicChannelName", Loc.GetString("chat-manager-telepathic-channel-name")), ("message", message));

messageWrap = Loc.GetString("chat-manager-send-telepathic-chat-wrap-message",
("telepathicChannelName", Loc.GetString("chat-manager-telepathic-channel-name")), ("message", message));
adminMessageWrap = Loc.GetString("chat-manager-send-telepathic-chat-wrap-message-admin",
("source", source), ("message", message));

adminMessageWrap = Loc.GetString("chat-manager-send-telepathic-chat-wrap-message-admin",
("source", source), ("message", message));
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Telepathic chat from {ToPrettyString(source):Player}: {message}");

_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Telepathic chat from {ToPrettyString(source):Player}: {message}");
_chatManager.ChatMessageToMany(ChatChannel.Telepathic, message, messageWrap, source, hideChat, true, clients.ToList(), Color.PaleVioletRed);

_chatManager.ChatMessageToMany(ChatChannel.Telepathic, message, messageWrap, source, hideChat, true, clients.ToList(), Color.PaleVioletRed);
_chatManager.ChatMessageToMany(ChatChannel.Telepathic, message, adminMessageWrap, source, hideChat, true, admins, Color.PaleVioletRed);

_chatManager.ChatMessageToMany(ChatChannel.Telepathic, message, adminMessageWrap, source, hideChat, true, admins, Color.PaleVioletRed);
if (_random.Prob(0.1f))
_glimmerSystem.Glimmer++;

if (_random.Prob(0.1f))
_glimmerSystem.Glimmer++;
if (_random.Prob(Math.Min(0.33f + ((float) _glimmerSystem.Glimmer / 1500), 1)))
{
float obfuscation = (0.25f + (float) _glimmerSystem.Glimmer / 2000);
var obfuscated = ObfuscateMessageReadability(message, obfuscation);
_chatManager.ChatMessageToMany(ChatChannel.Telepathic, obfuscated, messageWrap, source, hideChat, false, GetDreamers(clients), Color.PaleVioletRed);
}

if (_random.Prob(Math.Min(0.33f + ((float) _glimmerSystem.Glimmer / 1500), 1)))
{
float obfuscation = (0.25f + (float) _glimmerSystem.Glimmer / 2000);
var obfuscated = ObfuscateMessageReadability(message, obfuscation);
_chatManager.ChatMessageToMany(ChatChannel.Telepathic, obfuscated, messageWrap, source, hideChat, false, GetDreamers(clients), Color.PaleVioletRed);
}
foreach (var repeater in EntityQuery<TelepathicRepeaterComponent>())
_chatSystem.TrySendInGameICMessage(repeater.Owner, message, InGameICChatType.Speak, false);
}

foreach (var repeater in EntityQuery<TelepathicRepeaterComponent>())
{
_chatSystem.TrySendInGameICMessage(repeater.Owner, message, InGameICChatType.Speak, false);
}
}
private string ObfuscateMessageReadability(string message, float chance)
{
var modifiedMessage = new StringBuilder(message);

private string ObfuscateMessageReadability(string message, float chance)
for (var i = 0; i < message.Length; i++)
{
var modifiedMessage = new StringBuilder(message);

for (var i = 0; i < message.Length; i++)
if (char.IsWhiteSpace((modifiedMessage[i])))
{
if (char.IsWhiteSpace((modifiedMessage[i])))
{
continue;
}

if (_random.Prob(1 - chance))
{
modifiedMessage[i] = '~';
}
continue;
}

return modifiedMessage.ToString();
if (_random.Prob(1 - chance))
{
modifiedMessage[i] = '~';
}
}

return modifiedMessage.ToString();
}
}
17 changes: 7 additions & 10 deletions Content.Server/Chat/TelepathicRepeaterComponent.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
namespace Content.Server.Chat
{
/// <summary>
/// Repeats whatever is happening in telepathic chat.
/// </summary>
[RegisterComponent]
public sealed partial class TelepathicRepeaterComponent : Component
{
namespace Content.Server.Chat;

/// <summary>
/// Repeats whatever is happening in telepathic chat.
/// </summary>
[RegisterComponent]
public sealed partial class TelepathicRepeaterComponent : Component { }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Content.Server.Station.Systems;
using Robust.Shared.Utility;

namespace Content.Server.Station.Components;

/// <summary>
/// Loads a surface map on mapinit.
/// </summary>
[RegisterComponent, Access(typeof(StationSurfaceSystem))]
public sealed partial class StationSurfaceComponent : Component
{
/// <summary>
/// Path to the map to load.
/// </summary>
[DataField(required: true)]
public ResPath? MapPath;

/// <summary>
/// The map that was loaded.
/// </summary>
[DataField]
public EntityUid? Map;
}
41 changes: 41 additions & 0 deletions Content.Server/DeltaV/Station/Systems/StationSurfaceSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Content.Server.Parallax;
using Content.Server.Station.Components;
using Robust.Server.GameObjects;

namespace Content.Server.Station.Systems;

public sealed class StationSurfaceSystem : EntitySystem
{
[Dependency] private readonly BiomeSystem _biome = default!;
[Dependency] private readonly MapSystem _map = default!;
[Dependency] private readonly MapLoaderSystem _mapLoader = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<StationSurfaceComponent, MapInitEvent>(OnMapInit);
}

private void OnMapInit(Entity<StationSurfaceComponent> ent, ref MapInitEvent args)
{
if (ent.Comp.MapPath is not {} path)
return;

var map = _map.CreateMap(out var mapId);
if (!_mapLoader.TryLoad(mapId, path.ToString(), out _))
{
Log.Error($"Failed to load surface map {ent.Comp.MapPath}!");
Del(map);
return;
}

// loading replaced the map entity with a new one so get the latest id
map = _map.GetMap(mapId);
_map.SetPaused(map, false);

// Needs a cherrypick, but this system is unused entirely for now
//_biome.SetEnabled(map); // generate the terrain after the grids loaded to prevent it getting hidden under it
ent.Comp.Map = map;
}
}
Loading
Loading