Skip to content

Commit

Permalink
Merge branch 'master-syndie' into augment-markings-new
Browse files Browse the repository at this point in the history
# Conflicts:
#	Resources/Locale/ru-RU/corvax/markings/cyberlibs.ftl
  • Loading branch information
Morb0 committed Oct 23, 2023
2 parents afaf727 + 7426f25 commit a4256df
Show file tree
Hide file tree
Showing 191 changed files with 314,407 additions and 576 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,16 @@ jobs:
submodules: 'recursive'

# Corvax-Secrets-Start
- name: Setup deploy key
uses: webfactory/[email protected]
env:
SSH_KEY: ${{ secrets.SECRETS_PRIVATE_KEY }}
if: ${{ env.SSH_KEY != '' }}
with:
ssh-private-key: ${{ env.SSH_KEY }}

- name: Setup secrets
env:
SSH_KEY: ${{ secrets.SECRETS_PRIVATE_KEY }}
if: ${{ env.SSH_KEY != '' }}
run: |
mkdir ~/.ssh
echo "${{ secrets.SECRETS_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo "HOST *" > ~/.ssh/config
echo "StrictHostKeyChecking no" >> ~/.ssh/config
git -c submodule.Secrets.update=checkout submodule update --init
cp -R Secrets/Resources/Prototypes Resources/Prototypes/CorvaxSecrets
cp -R Secrets/Resources/ServerPrototypes Resources/Prototypes/CorvaxSecretsServer
Expand Down
13 changes: 8 additions & 5 deletions Content.Client/Ghost/GhostSystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Content.Client.Movement.Systems;
using Content.Shared.Actions;
using Content.Shared.Ghost;
using Content.Shared.Popups;
using Robust.Client.Console;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
Expand Down Expand Up @@ -33,9 +32,10 @@ private bool GhostVisibility

_ghostVisibility = value;

foreach (var ghost in EntityQuery<GhostComponent, SpriteComponent>(true))
var query = AllEntityQuery<GhostComponent, SpriteComponent>();
while (query.MoveNext(out var uid, out _, out var sprite))
{
ghost.Item2.Visible = true;
sprite.Visible = value || uid == _playerManager.LocalPlayer?.ControlledEntity;
}
}
}
Expand Down Expand Up @@ -103,7 +103,10 @@ private void OnToggleGhosts(EntityUid uid, GhostComponent component, ToggleGhost
return;

Popup.PopupEntity(Loc.GetString("ghost-gui-toggle-ghost-visibility-popup"), args.Performer);
ToggleGhostVisibility();

if (uid == _playerManager.LocalPlayer?.ControlledEntity)
ToggleGhostVisibility();

args.Handled = true;
}

Expand Down Expand Up @@ -204,7 +207,7 @@ public void OpenGhostRoles()

public void ToggleGhostVisibility()
{
_console.RemoteExecuteCommand(null, "toggleghosts");
GhostVisibility = !GhostVisibility;
}
}
}
3 changes: 2 additions & 1 deletion Content.Client/Hands/Systems/HandsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ private void HandleComponentState(EntityUid uid, HandsComponent component, ref C
}
}

component.SortedHands = new(state.HandNames);
component.SortedHands.Clear();
component.SortedHands.AddRange(state.HandNames);
var sorted = addedHands.OrderBy(hand => component.SortedHands.IndexOf(hand.Name));

foreach (var hand in sorted)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ private bool TryFindFallbackSpawn(out EntityCoordinates coords)

Entity<MapGridComponent>? maxUid = null;
float? maxSize = null;
while (EntityQueryEnumerator<MapGridComponent>().MoveNext(out var uid, out var grid))
var gridQuery = EntityQueryEnumerator<MapGridComponent>();

while (gridQuery.MoveNext(out var uid, out var grid))
{
var size = grid.LocalAABB.Size.LengthSquared();
if (maxSize == null || size > maxSize)
Expand Down
1 change: 1 addition & 0 deletions Content.IntegrationTests/Tests/PostMapInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public sealed class PostMapInitTest
"CorvaxIshimura",
"CorvaxSpectrum",
"CorvaxGate",
"CorvaxGelta",
// Corvax-End
"Dev",
"TestTeg",
Expand Down
5 changes: 3 additions & 2 deletions Content.Server/Body/Systems/ThermalRegulatorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ private void ProcessThermalRegulation(EntityUid uid, ThermalRegulatorComponent c

// implicit heat regulation
var tempDiff = Math.Abs(temperatureComponent.CurrentTemperature - comp.NormalBodyTemperature);
var targetHeat = tempDiff * temperatureComponent.HeatCapacity;
var heatCapacity = _tempSys.GetHeatCapacity(uid, temperatureComponent);
var targetHeat = tempDiff * heatCapacity;
if (temperatureComponent.CurrentTemperature > comp.NormalBodyTemperature)
{
totalMetabolismTempChange -= Math.Min(targetHeat, comp.ImplicitHeatRegulation);
Expand All @@ -49,7 +50,7 @@ private void ProcessThermalRegulation(EntityUid uid, ThermalRegulatorComponent c

// recalc difference and target heat
tempDiff = Math.Abs(temperatureComponent.CurrentTemperature - comp.NormalBodyTemperature);
targetHeat = tempDiff * temperatureComponent.HeatCapacity;
targetHeat = tempDiff * heatCapacity;

// if body temperature is not within comfortable, thermal regulation
// processes starts
Expand Down
4 changes: 3 additions & 1 deletion Content.Server/Chat/Managers/ChatSanitizationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public sealed class ChatSanitizationManager : IChatSanitizationManager
{ "._.", "chatsan-surprised" },
{ ".-.", "chatsan-confused" },
{ "-_-", "chatsan-unimpressed" },
{ "smh", "chatsan-unimpressed" },
{ "o/", "chatsan-waves" },
{ "^^/", "chatsan-waves" },
{ ":/", "chatsan-uncertain" },
Expand All @@ -88,10 +89,11 @@ public sealed class ChatSanitizationManager : IChatSanitizationManager
{ "lel.", "chatsan-laughs" },
{ "kek", "chatsan-laughs" },
{ "kek.", "chatsan-laughs" },
{ "rofl", "chatsan-laughs" },
{ "o7", "chatsan-salutes" },
{ ";_;7", "chatsan-tearfully-salutes"},
{ "idk", "chatsan-shrugs" },
{ "idk.", "chatsan-shrugs" }
{ "idk.", "chatsan-shrugs" },
};

private bool _doSanitize;
Expand Down
20 changes: 19 additions & 1 deletion Content.Server/Chat/Systems/ChatSystem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.Globalization;
using System.Linq;
using System.Text;
using Content.Server.Speech.EntitySystems;
using Content.Server.Speech.Components;
using Content.Server.Administration.Logs;
using Content.Server.Administration.Managers;
using Content.Server.Chat.Managers;
Expand Down Expand Up @@ -54,6 +56,7 @@ public sealed partial class ChatSystem : SharedChatSystem
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
[Dependency] private readonly ReplacementAccentSystem _wordreplacement = default!;

public const int VoiceRange = 10; // how far voice goes in world units
public const int WhisperClearRange = 2; // how far whisper goes while still being understandable, in world units
Expand Down Expand Up @@ -700,7 +703,8 @@ private bool CanSendInGame(string message, IConsoleShell? shell = null, IPlayerS
private string SanitizeInGameICMessage(EntityUid source, string message, out string? emoteStr, bool capitalize = true, bool punctuate = false, bool capitalizeTheWordI = true)
{
var newMessage = message.Trim();
newMessage = ReplaceWords(newMessage); // Corvax-ChatSanitize
newMessage = SanitizeMessageReplaceWords(newMessage);

if (capitalize)
newMessage = SanitizeMessageCapital(newMessage);
if (capitalizeTheWordI)
Expand Down Expand Up @@ -748,6 +752,20 @@ private string SanitizeMessagePeriod(string message)
return message;
}

[ValidatePrototypeId<ReplacementAccentPrototype>]
public const string ChatSanitize_Accent = "chatsanitize";

public string SanitizeMessageReplaceWords(string message)
{
if (string.IsNullOrEmpty(message)) return message;

var msg = message;

msg = _wordreplacement.ApplyReplacements(msg, ChatSanitize_Accent);

return msg;
}

/// <summary>
/// Returns list of players and ranges for all players withing some range. Also returns observers with a range of -1.
/// </summary>
Expand Down
26 changes: 19 additions & 7 deletions Content.Server/Construction/ConstructionSystem.Interactions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,16 +380,28 @@ private HandleResult HandleInteraction(EntityUid uid, object ev, ConstructionGra
if (ev is not OnTemperatureChangeEvent)
break;

if (TryComp<TemperatureComponent>(uid, out var tempComp))
// prefer using InternalTemperature since that's more accurate for cooking.
float temp;
if (TryComp<InternalTemperatureComponent>(uid, out var internalTemp))
{
if ((!temperatureChangeStep.MinTemperature.HasValue || tempComp.CurrentTemperature >= temperatureChangeStep.MinTemperature.Value) &&
(!temperatureChangeStep.MaxTemperature.HasValue || tempComp.CurrentTemperature <= temperatureChangeStep.MaxTemperature.Value))
{
return HandleResult.True;
}
temp = internalTemp.Temperature;
}
else if (TryComp<TemperatureComponent>(uid, out var tempComp))
{
temp = tempComp.CurrentTemperature;
}
else
{
return HandleResult.False;
}
return HandleResult.False;

if ((!temperatureChangeStep.MinTemperature.HasValue || temp >= temperatureChangeStep.MinTemperature.Value) &&
(!temperatureChangeStep.MaxTemperature.HasValue || temp <= temperatureChangeStep.MaxTemperature.Value))
{
return HandleResult.True;
}

return HandleResult.False;
}

case PartAssemblyConstructionGraphStep partAssemblyStep:
Expand Down
154 changes: 0 additions & 154 deletions Content.Server/Corvax/ChatFilter/ChatSystem.cs

This file was deleted.

4 changes: 2 additions & 2 deletions Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ private void OnPlayerJobAssigned(RulePlayerJobsAssignedEvent ev)
{
_antagSelection.EligiblePlayers(comp.HeadRevPrototypeId, comp.MaxHeadRevs, comp.PlayersPerHeadRev, comp.HeadRevStartSound,
"head-rev-role-greeting", "#5e9cff", out var chosen);
if (!chosen.Any())
GiveHeadRev(chosen, comp.RevPrototypeId, comp);
if (chosen.Any())
GiveHeadRev(chosen, comp.HeadRevPrototypeId, comp);
else
{
_chatManager.SendAdminAnnouncement(Loc.GetString("rev-no-heads"));
Expand Down
Loading

0 comments on commit a4256df

Please sign in to comment.