Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Upstream may #133

Merged
merged 20 commits into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions Content.Client/PDA/PdaMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<pda:PdaNavigationButton Name="EjectIdButton" Access="Public" SetWidth="32"/>
<pda:PdaNavigationButton Name="EjectPaiButton" Access="Public" SetWidth="32"/>
</BoxContainer>
<!-- ShuttleTimeButton is A-13 PDA shift time -->
<BoxContainer Name="ViewContainer" HorizontalExpand="True" VerticalExpand="True" Access="Public">
<BoxContainer Orientation="Vertical"
VerticalExpand="True"
Expand All @@ -43,6 +44,9 @@
<ContainerButton Name="StationTimeButton">
<RichTextLabel Name="StationTimeLabel" Access="Public"/>
</ContainerButton>
<ContainerButton Name="ShuttleTimeButton">
<RichTextLabel Name="ShuttleTimeLabel" Access="Public"/>
</ContainerButton>
<ContainerButton Name="StationAlertLevelInstructionsButton">
<RichTextLabel Name="StationAlertLevelInstructions" Access="Public"/>
</ContainerButton>
Expand Down
57 changes: 54 additions & 3 deletions Content.Client/PDA/PdaMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ public sealed partial class PdaMenu : PdaWindow
private string _stationName = Loc.GetString("comp-pda-ui-unknown");
private string _alertLevel = Loc.GetString("comp-pda-ui-unknown");
private string _instructions = Loc.GetString("comp-pda-ui-unknown");


// A-13 PDA shift time start
private TimeSpan? _evacShuttleTime;
private EvacShuttleStatus _evacShuttleStatus;
// A-13 PDA shift time end


private int _currentView;

Expand Down Expand Up @@ -125,7 +130,7 @@ public PdaMenu()
_clipboard.SetText(_instructions);
};




HideAllViews();
Expand All @@ -136,6 +141,11 @@ public void UpdateState(PdaUpdateState state)
{
FlashLightToggleButton.IsActive = state.FlashlightEnabled;

// A-13 PDA shift time start
_evacShuttleTime = state.PdaOwnerInfo.EvacShuttleTime;
_evacShuttleStatus = state.PdaOwnerInfo.EvacShuttleStatus;
// A-13 PDA shift time end

if (state.PdaOwnerInfo.ActualOwnerName != null)
{
_pdaOwner = state.PdaOwnerInfo.ActualOwnerName;
Expand All @@ -160,13 +170,25 @@ public void UpdateState(PdaUpdateState state)
_stationName = state.StationName ?? Loc.GetString("comp-pda-ui-unknown");
StationNameLabel.SetMarkup(Loc.GetString("comp-pda-ui-station",
("station", _stationName)));


var stationTime = _gameTiming.CurTime.Subtract(_gameTicker.RoundStartTimeSpan);

StationTimeLabel.SetMarkup(Loc.GetString("comp-pda-ui-station-time",
("time", stationTime.ToString("hh\\:mm\\:ss"))));

// A-13 PDA shift time start
var remaining = TimeSpan.Zero;

if (state.PdaOwnerInfo.EvacShuttleTime != null)
remaining = TimeSpan.FromSeconds(Math.Max((state.PdaOwnerInfo.EvacShuttleTime.Value - _gameTiming.CurTime).TotalSeconds, 0));

var statusText = EvacShuttleTitle(_evacShuttleStatus);

ShuttleTimeLabel.SetMarkup(Loc.GetString(statusText,
("time", remaining.ToString("hh\\:mm\\:ss"))));
// A-13 PDA shift time start

var alertLevel = state.PdaOwnerInfo.StationAlertLevel;
var alertColor = state.PdaOwnerInfo.StationAlertColor;
var alertLevelKey = alertLevel != null ? $"alert-level-{alertLevel}" : "alert-level-unknown";
Expand Down Expand Up @@ -332,6 +354,23 @@ private void HideAllViews()
}
}

// A-13 PDA shift time start
private string EvacShuttleTitle(EvacShuttleStatus status)
{
switch (status)
{
case EvacShuttleStatus.WaitingToLaunch:
return "comp-pda-ui-shuttle-launch-time";
case EvacShuttleStatus.WaitingToArrival:
return "comp-pda-ui-shuttle-arrival-time";
case EvacShuttleStatus.WaitingToCall:
return "comp-pda-ui-shuttle-call-time";
default:
return "comp-pda-ui-shuttle-call-time";
}
}
// A-13 PDA shift time end

protected override void Draw(DrawingHandleScreen handle)
{
base.Draw(handle);
Expand All @@ -340,6 +379,18 @@ protected override void Draw(DrawingHandleScreen handle)

StationTimeLabel.SetMarkup(Loc.GetString("comp-pda-ui-station-time",
("time", stationTime.ToString("hh\\:mm\\:ss"))));

// A-13 PDA shift time start
var remaining = TimeSpan.Zero;

if (_evacShuttleTime != null)
remaining = TimeSpan.FromSeconds(Math.Max((_evacShuttleTime.Value - _gameTiming.CurTime).TotalSeconds, 0));

var statusText = EvacShuttleTitle(_evacShuttleStatus);

ShuttleTimeLabel.SetMarkup(Loc.GetString(statusText,
("time", remaining.ToString("hh\\:mm\\:ss"))));
// A-13 PDA shift time start
}
}
}
47 changes: 46 additions & 1 deletion Content.Server/PDA/PdaSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
using Robust.Shared.Containers;
using Robust.Shared.Player;
using Robust.Shared.Utility;
using Content.Server.RoundEnd; // A-13 PDA shift time
using Content.Server.Shuttles.Components; // A-13 PDA shift time
using Content.Server.Shuttles.Systems; // A-13 PDA shift time
using Robust.Shared.Configuration; // A-13 PDA shift time
using Content.Shared.CCVar; // A-13 PDA shift time
using Robust.Shared.Timing; // A-13 PDA shift time

namespace Content.Server.PDA
{
Expand All @@ -36,6 +42,9 @@ public sealed class PdaSystem : SharedPdaSystem
[Dependency] private readonly UserInterfaceSystem _ui = default!;
[Dependency] private readonly UnpoweredFlashlightSystem _unpoweredFlashlight = default!;
[Dependency] private readonly ContainerSystem _containerSystem = default!;
[Dependency] private readonly RoundEndSystem _roundEndSystem = default!; // A-13 PDA shift time
[Dependency] private readonly EmergencyShuttleSystem _emergencyShuttleSystem = default!; // A-13 PDA shift time
[Dependency] private readonly IGameTiming _gameTiming = default!; // A-13 PDA shift time

public override void Initialize()
{
Expand Down Expand Up @@ -67,6 +76,7 @@ protected override void OnComponentInit(EntityUid uid, PdaComponent pda, Compone

UpdateAlertLevel(uid, pda);
UpdateStationName(uid, pda);
UpdateEvacShuttle(uid, pda); // A-13 PDA shift time
}

protected override void OnItemInserted(EntityUid uid, PdaComponent pda, EntInsertedIntoContainerMessage args)
Expand Down Expand Up @@ -158,6 +168,7 @@ public void UpdatePdaUi(EntityUid uid, PdaComponent? pda = null)

UpdateStationName(uid, pda);
UpdateAlertLevel(uid, pda);
UpdateEvacShuttle(uid, pda); // A-13 PDA shift time
// TODO: Update the level and name of the station with each call to UpdatePdaUi is only needed for latejoin players.
// TODO: If someone can implement changing the level and name of the station when changing the PDA grid, this can be removed.

Expand All @@ -179,7 +190,9 @@ public void UpdatePdaUi(EntityUid uid, PdaComponent? pda = null)
IdOwner = id?.FullName,
JobTitle = id?.JobTitle,
StationAlertLevel = pda.StationAlertLevel,
StationAlertColor = pda.StationAlertColor
StationAlertColor = pda.StationAlertColor,
EvacShuttleStatus = pda.ShuttleStatus, // A-13 PDA shift time
EvacShuttleTime = pda.ShuttleTime // A-13 PDA shift time
},
pda.StationName,
showUplink,
Expand Down Expand Up @@ -266,6 +279,38 @@ private void UpdateStationName(EntityUid uid, PdaComponent pda)
pda.StationName = station is null ? null : Name(station.Value);
}

// A-13 PDA shift time start
private void UpdateEvacShuttle(EntityUid uid, PdaComponent pda)
{
TimeSpan? shuttleTime;
EvacShuttleStatus shuttleStatus;
if (_emergencyShuttleSystem.EmergencyShuttleArrived)
{
shuttleTime = _gameTiming.CurTime + TimeSpan.FromSeconds(_emergencyShuttleSystem.СonsoleAccumulator);
shuttleStatus = EvacShuttleStatus.WaitingToLaunch;
}
else
{
if (_roundEndSystem.ExpectedCountdownEnd != null)
{
shuttleTime = _roundEndSystem.ExpectedCountdownEnd;
shuttleStatus = EvacShuttleStatus.WaitingToArrival;
}
else
{
shuttleTime = _roundEndSystem.TimeToCallShuttle();
shuttleStatus = EvacShuttleStatus.WaitingToCall;
}
}
var station = _station.GetOwningStation(uid);
if (!TryComp<StationEmergencyShuttleComponent>(station, out var stationEmergencyShuttleComponent))
return;

pda.ShuttleStatus = shuttleStatus;
pda.ShuttleTime = shuttleTime;
}
// A-13 PDA shift time end

private void UpdateAlertLevel(EntityUid uid, PdaComponent pda)
{
var station = _station.GetOwningStation(uid);
Expand Down
10 changes: 10 additions & 0 deletions Content.Server/RoundEnd/RoundEndSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,16 @@ public override void Update(float frameTime)
SetAutoCallTime();
}
}

// A-13 PDA shift time start
public TimeSpan TimeToCallShuttle()
{
var autoCalledBefore = _autoCalledBefore
? _cfg.GetCVar(CCVars.EmergencyShuttleAutoCallExtensionTime)
: _cfg.GetCVar(CCVars.EmergencyShuttleAutoCallTime);
return AutoCallStartTime + TimeSpan.FromMinutes(autoCalledBefore);
}
// A-13 PDA shift time end
}

public sealed class RoundEndSystemChangedEvent : EntityEventArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ public sealed partial class EmergencyShuttleSystem
/// </summary>
private float _consoleAccumulator = float.MinValue;

// A-13 PDA shift time start
public float СonsoleAccumulator => _consoleAccumulator;
// A-13 PDA shift time end

/// <summary>
/// How long after the transit is over to end the round.
/// </summary>
Expand Down
13 changes: 13 additions & 0 deletions Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
using Robust.Shared.Random;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Content.Server.GameTicking; // A-13 PDA shift time

namespace Content.Server.Shuttles.Systems;

Expand Down Expand Up @@ -71,6 +72,8 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem

private const float ShuttleSpawnBuffer = 1f;

public TimeSpan? DockTime; // A-13 PDA shift time

private bool _emergencyShuttleEnabled;

[ValidatePrototypeId<TagPrototype>]
Expand All @@ -91,9 +94,17 @@ public override void Initialize()
SubscribeLocalEvent<EmergencyShuttleComponent, FTLStartedEvent>(OnEmergencyFTL);
SubscribeLocalEvent<EmergencyShuttleComponent, FTLCompletedEvent>(OnEmergencyFTLComplete);
SubscribeNetworkEvent<EmergencyShuttleRequestPositionMessage>(OnShuttleRequestPosition);
SubscribeLocalEvent<RoundEndTextAppendEvent>(OnRoundEnded); // A-13 PDA shift time
InitializeEmergencyConsole();
}

// SA-13 PDA shift time start
private void OnRoundEnded(RoundEndTextAppendEvent ev)
{
DockTime = null;
}
// A-13 PDA shift time end

private void OnRoundStart(RoundStartingEvent ev)
{
CleanupEmergencyConsole();
Expand Down Expand Up @@ -271,6 +282,8 @@ public void CallEmergencyShuttle(EntityUid stationUid, StationEmergencyShuttleCo

var targetGrid = _station.GetLargestGrid(Comp<StationDataComponent>(stationUid));

DockTime = _timing.CurTime; // A-13 PDA shift time

// UHH GOOD LUCK
if (targetGrid == null)
{
Expand Down
6 changes: 3 additions & 3 deletions Content.Shared/Inventory/SlotFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public enum SlotFlags
LEGS = 1 << 13,
FEET = 1 << 14,
SUITSTORAGE = 1 << 15,
UNDERWEART = 1 << 10, // Andromeda-Underwear
UNDERWEARB = 1 << 10, // Andromeda-Underwear
SOCKS = 1 << 10, // Andromeda-Underwear
UNDERWEART = 1 << 16, // Andromeda-Underwear
UNDERWEARB = 1 << 17, // Andromeda-Underwear
SOCKS = 1 << 18, // Andromeda-Underwear
All = ~NONE,

WITHOUT_POCKET = All & ~POCKET
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Nutrition/Components/HungerComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public sealed partial class HungerComponent : Component
/// The base amount at which <see cref="CurrentHunger"/> decays.
/// </summary>
[DataField("baseDecayRate"), ViewVariables(VVAccess.ReadWrite)]
public float BaseDecayRate = 0.01666666666f;
public float BaseDecayRate = 0.05f; // A-13 changed from 0.01666666666f

/// <summary>
/// The actual amount at which <see cref="CurrentHunger"/> decays.
Expand Down
2 changes: 2 additions & 0 deletions Content.Shared/PDA/PdaComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@ public sealed partial class PdaComponent : Component
[ViewVariables] public string? StationName;
[ViewVariables] public string? StationAlertLevel;
[ViewVariables] public Color StationAlertColor = Color.White;
[ViewVariables] public TimeSpan? ShuttleTime; // A-13 PDA shift time
[ViewVariables] public EvacShuttleStatus ShuttleStatus; // A-13 PDA shift time
}
}
11 changes: 11 additions & 0 deletions Content.Shared/PDA/PdaUpdateState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,16 @@ public struct PdaIdInfoText
public string? JobTitle;
public string? StationAlertLevel;
public Color StationAlertColor;
public TimeSpan? EvacShuttleTime; // A-13 PDA shift time
public EvacShuttleStatus EvacShuttleStatus; // A-13 PDA shift time
}

// A-13 PDA shift time start
public enum EvacShuttleStatus
{
WaitingToCall,
WaitingToArrival,
WaitingToLaunch
}
// A-13 PDA shift time end
}
Binary file added Resources/Audio/Andromeda/Misc/ducky.ogg
Binary file not shown.
2 changes: 0 additions & 2 deletions Resources/Locale/en-US/ss14-ru/prototypes/actions/borgs.ftl

This file was deleted.

6 changes: 0 additions & 6 deletions Resources/Locale/en-US/ss14-ru/prototypes/actions/crit.ftl

This file was deleted.

4 changes: 0 additions & 4 deletions Resources/Locale/en-US/ss14-ru/prototypes/actions/diona.ftl

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions Resources/Locale/en-US/ss14-ru/prototypes/actions/mech.ftl

This file was deleted.

12 changes: 0 additions & 12 deletions Resources/Locale/en-US/ss14-ru/prototypes/actions/ninja.ftl

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions Resources/Locale/en-US/ss14-ru/prototypes/actions/speech.ftl

This file was deleted.

4 changes: 0 additions & 4 deletions Resources/Locale/en-US/ss14-ru/prototypes/actions/spider.ftl

This file was deleted.

Loading
Loading