Skip to content

Commit

Permalink
Merge branch 'new-frontiers-14:master' into SBI-Crown
Browse files Browse the repository at this point in the history
  • Loading branch information
UncaughtEx authored May 2, 2024
2 parents 27cad9c + 337b0ff commit 44bbb4a
Show file tree
Hide file tree
Showing 308 changed files with 99,357 additions and 26,323 deletions.
5 changes: 5 additions & 0 deletions Content.Client/Shuttles/UI/NavScreen.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
HorizontalExpand="True"
Margin="3"
Name="ReadonlyDisplay">
<controls:Label Text="{controls:Loc 'shuttle-console-designation'}"/>
<controls:Label Name="ShuttleDesignation"
Text="{controls:Loc 'shuttle-console-designation-unknown'}"
HorizontalExpand="True"
Align="Right"/>
<controls:Label Text="{controls:Loc 'shuttle-console-position'}"/>
<controls:Label Name="GridPosition"
Text="0.0, 0.0"
Expand Down
16 changes: 16 additions & 0 deletions Content.Client/Shuttles/UI/NavScreen.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Physics.Components;

Expand Down Expand Up @@ -52,6 +53,21 @@ private void OnIffSearchChanged(string text)
public void SetShuttle(EntityUid? shuttle)
{
_shuttleEntity = shuttle;

// Frontier - PR #1284 Add Shuttle Designation
if (_entManager.TryGetComponent<MetaDataComponent>(shuttle, out var metadata))
{
var shipNameParts = metadata.EntityName.Split(' ');
var designation = shipNameParts[^1];
if (designation[2] == '-')
{
NavDisplayLabel.Text = string.Join(' ', shipNameParts[..^1]);
ShuttleDesignation.Text = designation;
}
else
NavDisplayLabel.Text = metadata.EntityName;
}
// End Frontier - PR #1284
}

private void OnIFFTogglePressed(BaseButton.ButtonEventArgs args)
Expand Down
38 changes: 25 additions & 13 deletions Content.Client/_NF/Latejoin/VesselListControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,43 @@ protected override void Dispose(bool disposing)

private int DefaultComparison(NetEntity x, NetEntity y)
{
var xContainsHop = _gameTicker.JobsAvailable[x].ContainsKey("HeadOfPersonnel");
var yContainsHop = _gameTicker.JobsAvailable[y].ContainsKey("HeadOfPersonnel");
var xContainsSR = _gameTicker.JobsAvailable[x].ContainsKey("StationRepresentative");
var yContainsSR = _gameTicker.JobsAvailable[y].ContainsKey("StationRepresentative");

var xContainsHos = _gameTicker.JobsAvailable[x].ContainsKey("HeadOfSecurity");
var yContainsHos = _gameTicker.JobsAvailable[y].ContainsKey("HeadOfSecurity");
var xContainsSheriff = _gameTicker.JobsAvailable[x].ContainsKey("Sheriff");
var yContainsSheriff = _gameTicker.JobsAvailable[y].ContainsKey("Sheriff");

// Prioritize "HeadOfPersonnel"
switch (xContainsHop)
var xContainsPirateCaptain = _gameTicker.JobsAvailable[x].ContainsKey("PirateCaptain");
var yContainsPirateCaptain = _gameTicker.JobsAvailable[y].ContainsKey("PirateCaptain");

// Prioritize "StationRepresentative"
switch (xContainsSR)
{
case true when !yContainsSR:
return -1;
case false when yContainsSR:
return 1;
}

// If both or neither contain "StationRepresentative", prioritize "Sheriff"
switch (xContainsSheriff)
{
case true when !yContainsHop:
case true when !yContainsSheriff:
return -1;
case false when yContainsHop:
case false when yContainsSheriff:
return 1;
}

// If both or neither contain "HeadOfPersonnel", prioritize "HeadOfSecurity"
switch (xContainsHos)
// If both or neither contain "StationRepresentative", "Sheriff" prioritize "PirateCaptain"
switch (xContainsPirateCaptain)
{
case true when !yContainsHos:
case true when !yContainsPirateCaptain:
return -1;
case false when yContainsHos:
case false when yContainsPirateCaptain:
return 1;
}

// If both or neither contain "HeadOfPersonnel" and "HeadOfSecurity", sort by jobCountComparison
// If both or neither contain "StationRepresentative" and "Sheriff", sort by jobCountComparison
var jobCountComparison = -(int) (_gameTicker.JobsAvailable[x].Values.Sum(a => a ?? 0) -
_gameTicker.JobsAvailable[y].Values.Sum(b => b ?? 0));
var nameComparison = string.Compare(_gameTicker.StationNames[x], _gameTicker.StationNames[y], StringComparison.Ordinal);
Expand Down
81 changes: 55 additions & 26 deletions Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Content.Server.Atmos.Components;
using Content.Shared.Administration;
using Content.Shared.Atmos;
using Content.Shared.Atmos.Components;
using Robust.Shared.Console;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
Expand Down Expand Up @@ -104,44 +105,72 @@ private void FixGridAtmosCommand(IConsoleShell shell, string argstr, string[] ar
continue;
}

var transform = Transform(euid.Value);
// Force Invalidate & update air on all tiles
Entity<GridAtmosphereComponent, GasTileOverlayComponent, MapGridComponent, TransformComponent> grid =
new(euid.Value, gridAtmosphere, Comp<GasTileOverlayComponent>(euid.Value), gridComp, Transform(euid.Value));

foreach (var (indices, tileMain) in gridAtmosphere.Tiles)
{
var tile = tileMain.Air;
if (tile == null)
continue;
RebuildGridTiles(grid);

if (!_mapSystem.TryGetTile(gridComp, indices, out var gTile) || gTile.IsEmpty)
{
gridAtmosphere.Tiles.Remove(indices);
var query = GetEntityQuery<AtmosFixMarkerComponent>();
foreach (var (indices, tile) in gridAtmosphere.Tiles.ToArray())
{
if (tile.Air is not {Immutable: false} air)
continue;
}

if (tile.Immutable && !IsTileSpace(euid, transform.MapUid, indices))
{
tile = new GasMixture(tile.Volume) { Temperature = tile.Temperature };
tileMain.Air = tile;
}

tile.Clear();
air.Clear();
var mixtureId = 0;
foreach (var entUid in gridComp.GetAnchoredEntities(indices))
var enumerator = _mapSystem.GetAnchoredEntitiesEnumerator(grid, grid, indices);
while (enumerator.MoveNext(out var entUid))
{
if (!TryComp(entUid, out AtmosFixMarkerComponent? afm))
continue;
mixtureId = afm.Mode;
break;
if (query.TryComp(entUid, out var marker))
mixtureId = marker.Mode;
}
var mixture = mixtures[mixtureId];
Merge(tile, mixture);
tile.Temperature = mixture.Temperature;

gridAtmosphere.InvalidatedCoords.Add(indices);
var mixture = mixtures[mixtureId];
Merge(air, mixture);
air.Temperature = mixture.Temperature;
}
}
}

/// <summary>
/// Clears & re-creates all references to <see cref="TileAtmosphere"/>s stored on a grid.
/// </summary>
private void RebuildGridTiles(
Entity<GridAtmosphereComponent, GasTileOverlayComponent, MapGridComponent, TransformComponent> ent)
{
foreach (var indices in ent.Comp1.Tiles.Keys)
{
InvalidateVisuals((ent, ent), indices);
}

var atmos = ent.Comp1;
atmos.MapTiles.Clear();
atmos.ActiveTiles.Clear();
atmos.ExcitedGroups.Clear();
atmos.HotspotTiles.Clear();
atmos.SuperconductivityTiles.Clear();
atmos.HighPressureDelta.Clear();
atmos.CurrentRunTiles.Clear();
atmos.CurrentRunExcitedGroups.Clear();
atmos.InvalidatedCoords.Clear();
atmos.CurrentRunInvalidatedTiles.Clear();
atmos.PossiblyDisconnectedTiles.Clear();
atmos.Tiles.Clear();

var volume = GetVolumeForTiles(ent);
TryComp(ent.Comp4.MapUid, out MapAtmosphereComponent? mapAtmos);

var enumerator = _map.GetAllTilesEnumerator(ent, ent);
while (enumerator.MoveNext(out var tileRef))
{
var tile = GetOrNewTile(ent, ent, tileRef.Value.GridIndices);
UpdateTileData(ent, mapAtmos, tile);
UpdateAdjacentTiles(ent, tile, activate: true);
UpdateTileAir(ent, tile, volume);
}
}

private CompletionResult FixGridAtmosCommandCompletions(IConsoleShell shell, string[] args)
{
MapId? playerMap = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ public sealed partial class AtmosphereSystem
private int _currentRunAtmosphereIndex;
private bool _simulationPaused;

private TileAtmosphere GetOrNewTile(EntityUid owner, GridAtmosphereComponent atmosphere, Vector2i index)
private TileAtmosphere GetOrNewTile(EntityUid owner, GridAtmosphereComponent atmosphere, Vector2i index, bool invalidateNew = true)
{
var tile = atmosphere.Tiles.GetOrNew(index, out var existing);
if (existing)
return tile;

atmosphere.InvalidatedCoords.Add(index);
if (invalidateNew)
atmosphere.InvalidatedCoords.Add(index);

tile.GridIndex = owner;
tile.GridIndices = index;
return tile;
Expand Down Expand Up @@ -68,7 +70,7 @@ private bool ProcessRevalidate(Entity<GridAtmosphereComponent, GasTileOverlayCom
atmosphere.CurrentRunInvalidatedTiles.EnsureCapacity(atmosphere.InvalidatedCoords.Count);
foreach (var indices in atmosphere.InvalidatedCoords)
{
var tile = GetOrNewTile(uid, atmosphere, indices);
var tile = GetOrNewTile(uid, atmosphere, indices, invalidateNew: false);
atmosphere.CurrentRunInvalidatedTiles.Enqueue(tile);

// Update tile.IsSpace and tile.MapAtmosphere, and tile.AirtightData.
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Chat/Systems/ChatSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public void TrySendInGameICMessage(
}

bool shouldCapitalize = (desiredType != InGameICChatType.Emote);
bool shouldPunctuate = _configurationManager.GetCVar(CCVars.ChatPunctuation) && (desiredType != InGameICChatType.Emote);
bool shouldPunctuate = _configurationManager.GetCVar(CCVars.ChatPunctuation);
// Capitalizing the word I only happens in English, so we check language here
bool shouldCapitalizeTheWordI = (!CultureInfo.CurrentCulture.IsNeutralCulture && CultureInfo.CurrentCulture.Parent.Name == "en")
|| (CultureInfo.CurrentCulture.IsNeutralCulture && CultureInfo.CurrentCulture.Name == "en");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Content.Server.Mail.Components
{
[RegisterComponent]
public sealed partial class MailDisabledComponent : Component
{}
}
7 changes: 7 additions & 0 deletions Content.Server/Nyanotrasen/Mail/MailSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public sealed class MailSystem : EntitySystem
[Dependency] private readonly ItemSystem _itemSystem = default!;
[Dependency] private readonly MindSystem _mindSystem = default!;
[Dependency] private readonly MetaDataSystem _metaDataSystem = default!;
[Dependency] private readonly IEntityManager _entManager = default!; // Frontier

private ISawmill _sawmill = default!;

Expand Down Expand Up @@ -579,6 +580,12 @@ public bool TryGetMailRecipientForReceiver(MailReceiverComponent receiver, [NotN
return false;
}

if (_entManager.TryGetComponent<MailDisabledComponent>(receiver.Owner, out var antag))
{
recipient = null;
return false;
}

var accessTags = access.Tags;

var mayReceivePriorityMail = !(_mindSystem.GetMind(receiver.Owner) == null);
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Salvage/SalvageSystem.Expeditions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public sealed partial class SalvageSystem
* Handles setup / teardown of salvage expeditions.
*/

private const int MissionLimit = 4;
private const int MissionLimit = 5;
[Dependency] private readonly StationSystem _stationSystem = default!;

private readonly JobQueue _salvageQueue = new();
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Shuttles/Components/ThrusterComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public sealed partial class ThrusterComponent : Component
public string MachinePartThrust = "Capacitor";

[DataField("partRatingThrustMultiplier")]
public float PartRatingThrustMultiplier = 1.5f;
public float PartRatingThrustMultiplier = 1.15f; // Frontier - PR #1292 1.5f<1.15f

[DataField("thrusterIgnoreEmp")]
public bool ThrusterIgnoreEmp = false;
Expand Down
7 changes: 7 additions & 0 deletions Content.Server/Speech/Components/GoblinAccentComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Content.Server.Speech.EntitySystems;

namespace Content.Server.Speech.Components;

[RegisterComponent]
[Access(typeof(GoblinAccentSystem))]
public sealed partial class GoblinAccentComponent : Component {}
31 changes: 31 additions & 0 deletions Content.Server/Speech/EntitySystems/GoblinAccentSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Content.Server.Speech.Components;
using Robust.Shared.Random;
using System.Text.RegularExpressions;

namespace Content.Server.Speech.EntitySystems;

public sealed class GoblinAccentSystem : EntitySystem
{
[Dependency] private readonly ReplacementAccentSystem _replacement = default!;

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

SubscribeLocalEvent<GoblinAccentComponent, AccentGetEvent>(OnAccentGet);
}

// converts left word when typed into the right word. For example typing you becomes ye.
public string Accentuate(string message, GoblinAccentComponent component)
{
var msg = message;

msg = _replacement.ApplyReplacements(msg, "goblin");
return msg;
}

private void OnAccentGet(EntityUid uid, GoblinAccentComponent component, AccentGetEvent args)
{
args.Message = Accentuate(args.Message, component);
}
}
14 changes: 9 additions & 5 deletions Content.Server/StationEvents/Events/IonStormRule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,19 @@ protected override void Started(EntityUid uid, IonStormRuleComponent comp, GameR
{
base.Started(uid, comp, gameRule, args);

if (!TryGetRandomStation(out var chosenStation))
return;
// Frontier - Affect all silicon beings in the sector, not just on-station.
// if (!TryGetRandomStation(out var chosenStation))
// return;
// End Frontier

var query = EntityQueryEnumerator<SiliconLawBoundComponent, TransformComponent, IonStormTargetComponent>();
while (query.MoveNext(out var ent, out var lawBound, out var xform, out var target))
{
// only affect law holders on the station
if (CompOrNull<StationMemberComponent>(xform.GridUid)?.Station != chosenStation)
continue;
// Frontier - Affect all silicon beings in the sector, not just on-station.
// // only affect law holders on the station
// if (CompOrNull<StationMemberComponent>(xform.GridUid)?.Station != chosenStation)
// continue;
// End Frontier

if (!RobustRandom.Prob(target.Chance))
continue;
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/_NF/Contraband/Systems/ContrabandSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private bool CanSell(EntityUid uid, TransformComponent xform)
{
if (_mobQuery.HasComponent(uid))
{
if (_mobQuery.GetComponent(uid).CurrentState == MobState.Alive)
if (_mobQuery.GetComponent(uid).CurrentState == MobState.Dead) // Allow selling alive prisoners
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ private void OnStartup(RoundStartingEvent ev)

if (_map.TryLoad(mapId, cove, out var depotUid6s, new MapLoadOptions
{
Offset = _random.NextVector2(4650f, 6800f)
Offset = _random.NextVector2(10000f, 15000f)
}))
{
if (_prototypeManager.TryIndex<GameMapPrototype>("Cove", out var stationProto))
Expand Down
7 changes: 7 additions & 0 deletions Content.Server/_NF/Goblin/Components/GoblinComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Content.Server._NF.Goblin.Components;

[RegisterComponent]
public sealed partial class GoblinComponent : Component
{

}
8 changes: 7 additions & 1 deletion Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using Content.Shared._NF.LoggingExtensions;
using Content.Shared.ActionBlocker;
using Content.Shared.Administration.Logs;
using Content.Shared.Database;
Expand Down Expand Up @@ -237,7 +238,12 @@ private void Insert(EntityUid uid, ItemSlot slot, EntityUid item, EntityUid? use

// Logging
if (inserted != null && inserted.Value && user != null)
_adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user.Value)} inserted {ToPrettyString(item)} into {slot.ContainerSlot?.ID + " slot of "}{ToPrettyString(uid)}");
{
// Frontier modification: adds extra things to the log
var extraLogs = LoggingExtensions.GetExtraLogs(EntityManager, item);

_adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user.Value)} inserted {ToPrettyString(item)}{extraLogs} into {slot.ContainerSlot?.ID + " slot of "}{ToPrettyString(uid)}");
}

_audioSystem.PlayPredicted(slot.InsertSound, uid, excludeUserAudio ? user : null);
}
Expand Down
Loading

0 comments on commit 44bbb4a

Please sign in to comment.