diff --git a/Content.Server/_NF/Bank/StationATMSystem.cs b/Content.Server/_NF/Bank/StationATMSystem.cs index 0f5e2944c41..8a980d2702b 100644 --- a/Content.Server/_NF/Bank/StationATMSystem.cs +++ b/Content.Server/_NF/Bank/StationATMSystem.cs @@ -66,7 +66,7 @@ private void OnWithdraw(EntityUid uid, StationBankATMComponent component, Statio } // check for sufficient funds - if (stationBank.Balance < args.Amount) + if (stationBank.Balance < args.Amount || args.Amount < 0) { ConsolePopup(args.Session, Loc.GetString("bank-insufficient-funds")); PlayDenySound(uid, component); diff --git a/Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs b/Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs index 4b43b3c48bf..a0d0b3c6120 100644 --- a/Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs +++ b/Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs @@ -1,3 +1,4 @@ +using System.Linq; using System.Net.Http; using System.Text; using System.Text.Json; @@ -55,7 +56,10 @@ public override void Initialize() private void OnRoundEndTextEvent(RoundEndTextAppendEvent ev) { var profitText = Loc.GetString($"adventure-mode-profit-text"); + var lossText = Loc.GetString($"adventure-mode-loss-text"); ev.AddLine(Loc.GetString("adventure-list-start")); + var allScore = new List>(); + foreach (var player in _players) { if (!TryComp(player.Item1, out var bank) || !TryComp(player.Item1, out var meta)) @@ -63,9 +67,32 @@ private void OnRoundEndTextEvent(RoundEndTextAppendEvent ev) var profit = bank.Balance - player.Item2; ev.AddLine($"- {meta.EntityName} {profitText} {profit} Spesos"); + allScore.Add(new Tuple(meta.EntityName, profit)); } - ReportRound(ev.Text); + if (!(allScore.Count >= 1)) + return; + + var relayText = Loc.GetString("adventure-list-high"); + relayText += '\n'; + var highScore = allScore.OrderByDescending(h => h.Item2).ToList(); + + for (var i = 0; i < 10 && i < highScore.Count; i++) + { + relayText += $"{highScore.First().Item1} {profitText} {highScore.First().Item2.ToString()} Spesos"; + relayText += '\n'; + highScore.Remove(highScore.First()); + } + relayText += Loc.GetString("adventure-list-low"); + relayText += '\n'; + highScore.Reverse(); + for (var i = 0; i < 10 && i < highScore.Count; i++) + { + relayText += $"{highScore.First().Item1} {lossText} {highScore.First().Item2.ToString()} Spesos"; + relayText += '\n'; + highScore.Remove(highScore.First()); + } + ReportRound(relayText); } private void OnPlayerSpawningEvent(PlayerSpawnCompleteEvent ev) @@ -98,7 +125,7 @@ private void OnStartup(RoundStartingEvent ev) ; if (_map.TryLoad(mapId, tinnia, out var depotUid2s, new MapLoadOptions { - Offset = -depotOffset + Offset = _random.NextVector2(975f, 1375f) })) { var meta = EnsureComp(depotUid2s[0]); diff --git a/Resources/Locale/en-US/_NF/adventure/adventure.ftl b/Resources/Locale/en-US/_NF/adventure/adventure.ftl index 44c6cd1ea7c..640467e28ba 100644 --- a/Resources/Locale/en-US/_NF/adventure/adventure.ftl +++ b/Resources/Locale/en-US/_NF/adventure/adventure.ftl @@ -2,6 +2,9 @@ playtime-deny-reason-not-whitelisted = You need to be whitelisted. adventure-list-start = NT Galactic Bank adventure-mode-profit-text = made a total profit of: {" "} +adventure-mode-loss-text = lost a total of: {" "} +adventure-list-high = Today's Top Earners: +adventure-list-low = Today's Biggest Spenders: adventure-title = New Frontier Adventure Mode adventure-description = Join a ship crew or buy your own and explore, research, salvage, or haul your way to riches! currency = Spesos @@ -13,11 +16,11 @@ guide-entry-adventure = New Frontiers Program guide-entry-bank = NT Galactic Bank guide-entry-shipyard = Frontier Shipyards -shipyard-rules-default1 = +shipyard-rules-default1 = Thank you for your interest in Nanotrasen Security Forces. By purchasing a Security vessel, you agree to enforce Space Law as found at https://wiki.nyanotrasen.moe/view/Space_Law. shipyard-rules-default2 = - Any actions performed by you or you crew that violate Space Law + Any actions performed by you or you crew that violate Space Law can and will result in administrative action. - Thank you for choosing Nanotrasen Security Forces. \ No newline at end of file + Thank you for choosing Nanotrasen Security Forces.