Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into STC2
  • Loading branch information
dvir001 committed Nov 12, 2023
2 parents 09e9c5b + 07d631f commit d595e58
Show file tree
Hide file tree
Showing 39 changed files with 24,491 additions and 893 deletions.
49 changes: 38 additions & 11 deletions Content.Server/Shipyard/Systems/ShipyardSystem.Consoles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@
using Content.Server.UserInterface;
using Content.Shared.StationRecords;
using Content.Server.Chat.Systems;
using Content.Server.Forensics;
using Content.Server.Mind;
using Content.Server.Preferences.Managers;
using Content.Server.StationRecords;
using Content.Server.StationRecords.Systems;
using Content.Shared.Database;
using System.Xml.Linq;
using Content.Shared.Preferences;

namespace Content.Server.Shipyard.Systems;

Expand All @@ -37,6 +40,7 @@ public sealed partial class ShipyardSystem : SharedShipyardSystem
[Dependency] private readonly AccessReaderSystem _access = default!;
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!;
[Dependency] private readonly IServerPreferencesManager _prefManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly RadioSystem _radio = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
Expand Down Expand Up @@ -147,14 +151,13 @@ private void OnPurchaseMessage(EntityUid uid, ShipyardConsoleComponent component
{
R = 10,
G = 50,
B = 175,
A = 155
B = 100,
A = 100
});
}

if (TryComp<AccessComponent>(targetId, out var newCap))
{
//later we will make a custom pilot job, for now they get the captain treatment
var newAccess = newCap.Tags.ToList();
newAccess.Add($"Captain");

Expand All @@ -179,16 +182,40 @@ private void OnPurchaseMessage(EntityUid uid, ShipyardConsoleComponent component
else
channel = component.SecurityShipyardChannel;

// The following block of code is entirely to do with trying to sanely handle moving records from station to station.
// it is ass.
// This probably shouldnt be messed with further until station records themselves become more robust
// and not entirely dependent upon linking ID card entity to station records key lookups
// its just bad

var stationList = EntityQueryEnumerator<StationRecordsComponent>();

if (TryComp<StationRecordKeyStorageComponent>(targetId, out var keyStorage)
&& shuttleStation !=null
&& keyStorage.Key != null
&& _records.TryGetRecord<GeneralStationRecord>(station, keyStorage.Key.Value, out var record))
&& shuttleStation != null
&& keyStorage.Key != null)
{
_records.RemoveRecord(station, keyStorage.Key.Value);
_records.CreateGeneralRecord((EntityUid) shuttleStation, targetId, record.Name, record.Age, record.Species, record.Gender, $"Captain", record.Fingerprint, record.DNA);
_records.Synchronize((EntityUid) shuttleStation);
_records.Synchronize(station);
bool recSuccess = false;
while (stationList.MoveNext(out var stationUid, out var stationRecComp))
{
if (!_records.TryGetRecord<GeneralStationRecord>(stationUid, keyStorage.Key.Value, out var record))
continue;

_records.RemoveRecord(stationUid, keyStorage.Key.Value);
_records.CreateGeneralRecord((EntityUid) shuttleStation, targetId, record.Name, record.Age, record.Species, record.Gender, $"Captain", record.Fingerprint, record.DNA);
recSuccess = true;
break;
}

if (!recSuccess
&& _prefManager.GetPreferences(args.Session.UserId).SelectedCharacter is HumanoidCharacterProfile profile)
{
TryComp<FingerprintComponent>(player, out var fingerprintComponent);
TryComp<DnaComponent>(player, out var dnaComponent);
_records.CreateGeneralRecord((EntityUid) shuttleStation, targetId, profile.Name, profile.Age, profile.Species, profile.Gender, $"Captain", fingerprintComponent!.Fingerprint, dnaComponent!.DNA);
}
}
_records.Synchronize(shuttleStation!.Value);
_records.Synchronize(station);

//if (ShipyardConsoleUiKey.Security == (ShipyardConsoleUiKey) args.UiKey) Enable in the case we force this on every security ship
// EnsureComp<StationEmpImmuneComponent>(shuttle.Owner); Enable in the case we force this on every security ship
Expand Down
43 changes: 43 additions & 0 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1710,3 +1710,46 @@ Entries:
message: Added tiny fans on airlocks for the SLI Gourd
id: 4604
time: '2023-11-08T02:10:03.0000000+00:00'
- author: Cheackraze
changes:
- type: Fix
message: Fixed Record Consoles sometimes not showing player records.
id: 4605
time: '2023-11-09T03:18:44.0000000+00:00'
- author: Bing Guss
changes:
- type: Add
message: Added new lobby art.
id: 4606
time: '2023-11-09T22:55:16.0000000+00:00'
- author: Lokey82
changes:
- type: Add
message: >-
CentCom has become tired of supplying Esquires with mass-media consoles,
so they have contracted the help of a new ship engineer. Please welcome
the NT14-WaveShot, A new ship for reporters!
id: 4607
time: '2023-11-12T20:53:03.0000000+00:00'
- author: cynical24
changes:
- type: Add
message: >-
Due to a lack of Detective-based ships, the NSF Inquisitor has been
added to Security's shipyard!
id: 4608
time: '2023-11-12T21:02:02.0000000+00:00'
- author: CharcoalShipyard
changes:
- type: Add
message: 'Kosmologistika note was added on the shuttle console. '
- type: Tweak
message: Price was changed
- type: Fix
message: Powergrid was changed for the better.
id: 4609
time: '2023-11-12T21:30:19.0000000+00:00'
- author: ErhardSteinhauer
changes: []
id: 4610
time: '2023-11-12T21:31:01.0000000+00:00'
Loading

0 comments on commit d595e58

Please sign in to comment.