Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STC Radio #536

Merged
merged 8 commits into from
Nov 5, 2023
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Content.Server/Shipyard/Systems/ShipyardSystem.Consoles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,11 @@ private void OnPurchaseMessage(EntityUid uid, ShipyardConsoleComponent component
var channel = _prototypeManager.Index<RadioChannelPrototype>(component.ShipyardChannel);
newDeed.ShuttleUid = shuttle.Owner;
newDeed.ShuttleName = name;
newDeed.ShuttleOwner = player;

if (ShipyardConsoleUiKey.Security != (ShipyardConsoleUiKey) args.UiKey)
_idSystem.TryChangeJobTitle(targetId, $"Captain", idCard, player);

_radio.SendRadioMessage(uid, Loc.GetString("shipyard-console-docking", ("vessel", name)), channel, uid);
_chat.TrySendInGameICMessage(uid, Loc.GetString("shipyard-console-docking", ("vessel", name)), InGameICChatType.Speak, true);

if (TryComp<StationRecordKeyStorageComponent>(targetId, out var keyStorage)
&& shuttleStation !=null
&& keyStorage.Key != null
Expand All @@ -201,6 +199,9 @@ private void OnPurchaseMessage(EntityUid uid, ShipyardConsoleComponent component
sellValue -= tax;
}

_radio.SendRadioMessage(uid, Loc.GetString("shipyard-console-docking", ("owner", player), ("vessel", name)), channel, uid);
_chat.TrySendInGameICMessage(uid, Loc.GetString("shipyard-console-docking", ("owner", player), ("vessel", name)), InGameICChatType.Speak, true);

PlayConfirmSound(uid, component);
_adminLogger.Add(LogType.ShipYardUsage, LogImpact.Low, $"{ToPrettyString(player):actor} purchased shuttle {ToPrettyString(shuttle.Owner)} for {vessel.Price} credits via {ToPrettyString(component.Owner)}");
RefreshState(uid, bank.Balance, true, name, sellValue, true, (ShipyardConsoleUiKey) args.UiKey);
Expand Down Expand Up @@ -262,6 +263,8 @@ public void OnSellMessage(EntityUid uid, ShipyardConsoleComponent component, Shi

var shuttleName = ToPrettyString(shuttleUid); // Grab the name before it gets 1984'd

var channel = _prototypeManager.Index<RadioChannelPrototype>(component.ShipyardChannel);

if (!TrySellShuttle(stationUid, shuttleUid, out var bill))
{
ConsolePopup(args.Session, Loc.GetString("shipyard-console-sale-reqs"));
Expand All @@ -286,6 +289,10 @@ public void OnSellMessage(EntityUid uid, ShipyardConsoleComponent component, Shi

_bank.TryBankDeposit(player, bill);
PlayConfirmSound(uid, component);

_radio.SendRadioMessage(uid, Loc.GetString("shipyard-console-leaving", ("owner", deed.ShuttleOwner!), ("vessel", deed.ShuttleName!), ("player", player)), channel, uid);
_chat.TrySendInGameICMessage(uid, Loc.GetString("shipyard-console-leaving", ("owner", deed.ShuttleOwner!), ("vessel", deed.ShuttleName!), ("player", player)), InGameICChatType.Speak, true);

_adminLogger.Add(LogType.ShipYardUsage, LogImpact.Low, $"{ToPrettyString(player):actor} sold {shuttleName} for {bill} credits via {ToPrettyString(component.Owner)}");
RefreshState(uid, bank.Balance, true, null, 0, true, (ShipyardConsoleUiKey) args.UiKey);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ public sealed partial class ShipyardConsoleComponent : Component
new SoundPathSpecifier("/Audio/Effects/Cargo/ping.ogg");

[DataField("shipyardChannel")]
public string ShipyardChannel = "Command";
public string ShipyardChannel = "Traffic";
}
7 changes: 5 additions & 2 deletions Content.Shared/Shipyard/Components/ShuttleDeedComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ namespace Content.Shared.Shipyard.Components;
[RegisterComponent, Access(typeof(SharedShipyardSystem))]
public sealed partial class ShuttleDeedComponent : Component
{
[DataField("shuttleuid")]
[DataField("shuttleUid")]
public EntityUid? ShuttleUid;

[DataField("shuttlename")]
[DataField("shuttleName")]
public string? ShuttleName;

[DataField("shuttleOwner")]
public EntityUid? ShuttleOwner;
}
1 change: 1 addition & 0 deletions Resources/Locale/en-US/_NF/headset/headset-component.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
chat-radio-traffic = Traffic
2 changes: 1 addition & 1 deletion Resources/Locale/en-US/headset/headset-component.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ examine-headset-default-channel = Use {$prefix} for the default channel ([color=

chat-radio-common = Common
chat-radio-centcom = CentCom
chat-radio-command = Traffic
chat-radio-command = Command
chat-radio-engineering = Engineering
chat-radio-medical = Medical
chat-radio-science = Science
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## UI
shipyard-console-invalid-vessel = Cannot purchase vessel:
shipyard-console-menu-title = Shipyard Menu
shipyard-console-docking = {$vessel} en route to the station, eta 60 seconds.
shipyard-console-docking = Captain {$owner} shuttle {$vessel} en route, eta 10 seconds.
shipyard-console-leaving = Captain {$owner} shuttle {$vessel} sold by {$player}.
shipyard-commands-purchase-desc = Spawns and FTL docks a specified shuttle from a grid file.
shipyard-console-no-idcard = No ID card present
shipyard-console-already-deeded = ID card already has a Deed
Expand Down
12 changes: 0 additions & 12 deletions Resources/Maps/Shuttles/anchor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4941,18 +4941,6 @@ entities:
- pos: -6.6491866,1.847079
parent: 1
type: Transform
- proto: EncryptionKeyCommand
entities:
- uid: 711
components:
- pos: -0.7042618,6.6897984
parent: 1
type: Transform
- uid: 712
components:
- pos: 1.5215468,7.4941516
parent: 1
type: Transform
- proto: ExtinguisherCabinet
entities:
- uid: 713
Expand Down
7 changes: 0 additions & 7 deletions Resources/Maps/Shuttles/chisel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1276,13 +1276,6 @@ entities:
- pos: 3.3084455,2.5795195
parent: 1
type: Transform
- proto: EncryptionKeyCommand
entities:
- uid: 146
components:
- pos: -5.4916778,4.0552964
parent: 1
type: Transform
- proto: ExtinguisherCabinetFilled
entities:
- uid: 271
Expand Down
7 changes: 0 additions & 7 deletions Resources/Maps/Shuttles/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3211,13 +3211,6 @@ entities:
- enabled: True
type: AmbientSound
- type: ActiveEmergencyLight
- proto: EncryptionKeyCommand
entities:
- uid: 982
components:
- pos: -4.7592955,5.4378777
parent: 1
type: Transform
- proto: ExtinguisherCabinetFilled
entities:
- uid: 15
Expand Down
12 changes: 0 additions & 12 deletions Resources/Maps/Shuttles/esquire.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1867,18 +1867,6 @@ entities:
- pos: -2.7296505,7.590156
parent: 1
type: Transform
- proto: EncryptionKeyCommand
entities:
- uid: 333
components:
- pos: -0.5524479,8.584573
parent: 1
type: Transform
- uid: 334
components:
- pos: 0.49755195,8.575198
parent: 1
type: Transform
- proto: ExtinguisherCabinetFilled
entities:
- uid: 612
Expand Down
7 changes: 0 additions & 7 deletions Resources/Maps/Shuttles/hospitaller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -475,13 +475,6 @@ entities:
- pos: 1.5,-1.5
parent: 1
type: Transform
- proto: EncryptionKeyCommand
entities:
- uid: 59
components:
- pos: 1.4846325,4.5628347
parent: 1
type: Transform
- proto: FaxMachineShip
entities:
- uid: 60
Expand Down
12 changes: 0 additions & 12 deletions Resources/Maps/Shuttles/marauder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4081,18 +4081,6 @@ entities:
pos: 4.5,18.5
parent: 1
type: Transform
- proto: EncryptionKeyCommand
entities:
- uid: 614
components:
- pos: -0.46291542,19.523981
parent: 1
type: Transform
- uid: 615
components:
- pos: 1.5214596,19.477106
parent: 1
type: Transform
- proto: EnergySword
entities:
- uid: 530
Expand Down
12 changes: 0 additions & 12 deletions Resources/Maps/Shuttles/metastable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4843,18 +4843,6 @@ entities:
- canCollide: False
type: Physics
- type: InsideEntityStorage
- proto: EncryptionKeyCommand
entities:
- uid: 1377
components:
- pos: 0.44179726,1.4648764
parent: 2
type: Transform
- uid: 1385
components:
- pos: -0.54257774,1.4492514
parent: 2
type: Transform
- proto: EpinephrineChemistryBottle
entities:
- uid: 1242
Expand Down
7 changes: 0 additions & 7 deletions Resources/Maps/Shuttles/pathfinder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1522,13 +1522,6 @@ entities:
- pos: 10.542477,-6.408145
parent: 1
type: Transform
- proto: EncryptionKeyCommand
entities:
- uid: 489
components:
- pos: -2.4641337,1.5246706
parent: 1
type: Transform
- proto: FaxMachineShip
entities:
- uid: 197
Expand Down
Loading
Loading