Skip to content

Commit

Permalink
Expedition Console: block mission selection if shuttle has FTL compon…
Browse files Browse the repository at this point in the history
…ent (new-frontiers-14#1845)

* Expedition: check for FTL component before mission

* Less text in salvage expedition console

* plural, "party supplies"->"party supply stash"

* in the area->inside the area

---------

Co-authored-by: Dvir <[email protected]>
  • Loading branch information
whatston3 and dvir001 authored Aug 12, 2024
1 parent 5b498af commit 24ca4c6
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 4 deletions.
28 changes: 28 additions & 0 deletions Content.Server/Salvage/SalvageSystem.ExpeditionConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ private void OnSalvageClaimMessage(EntityUid uid, SalvageExpeditionConsoleCompon
}
// end of Frontier proximity check

// Frontier: check for FTL component - if one exists, the station won't be taken into FTL.
if (HasComp<FTLComponent>(grid))
{
PlayDenySound(uid, component);
_popupSystem.PopupEntity(Loc.GetString("shuttle-ftl-recharge"), uid, PopupType.MediumCaution);
UpdateConsoles(data); // Sure, why not?
return;
}
// End Frontier

// Frontier change - disable coordinate disks for expedition missions
//var cdUid = Spawn(CoordinatesDisk, Transform(uid).Coordinates);
SpawnMission(missionparams, station.Value, null);
Expand Down Expand Up @@ -96,6 +106,15 @@ private void UpdateConsoles(SalvageExpeditionDataComponent component)
if (station != component.Owner)
continue;

// Frontier: if we have a lingering FTL component, we cannot start a new mission
if (!TryComp<StationDataComponent>(station, out var stationData) ||
_station.GetLargestGrid(stationData) is not {Valid : true} grid ||
HasComp<FTLComponent>(grid))
{
state.Cooldown = true; //Hack: disable buttons
}
// End Frontier

_ui.SetUiState((uid, uiComp), SalvageConsoleUiKey.Expedition, state);
}
}
Expand All @@ -114,6 +133,15 @@ private void UpdateConsole(Entity<SalvageExpeditionConsoleComponent> component)
state = new SalvageExpeditionConsoleState(TimeSpan.Zero, false, true, 0, new List<SalvageMissionParams>());
}

// Frontier: if we have a lingering FTL component, we cannot start a new mission
if (!TryComp<StationDataComponent>(station, out var stationData) ||
_station.GetLargestGrid(stationData) is not {Valid : true} grid ||
HasComp<FTLComponent>(grid))
{
state.Cooldown = true; //Hack: disable buttons
}
// End Frontier

_ui.SetUiState(component.Owner, SalvageConsoleUiKey.Expedition, state);
}
private void PlayDenySound(EntityUid uid, SalvageExpeditionConsoleComponent component)
Expand Down
3 changes: 2 additions & 1 deletion Content.Server/Salvage/SalvageSystem.Expeditions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ private void UpdateExpeditions()
continue;

comp.Cooldown = false;
comp.NextOffer += TimeSpan.FromSeconds(_cooldown);
//comp.NextOffer += TimeSpan.FromSeconds(_cooldown); // Frontier
comp.NextOffer = currentTime + TimeSpan.FromSeconds(_cooldown); // Frontier
GenerateMissions(comp);
UpdateConsoles(comp);
}
Expand Down
1 change: 1 addition & 0 deletions Resources/Locale/en-US/_NF/adventure/adventure.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ shipyard-rules-default2 =
Thank you for choosing Nanotrasen Security Forces.
shuttle-ftl-proximity = Nearby objects too massive for FTL!
shuttle-ftl-recharge = FTL drives still spooling down!
changelog-tab-title-Upstream = Upstream Changelog
multiauth-already-connected = Already connected to Frontier Official servers.
Expand Down
5 changes: 3 additions & 2 deletions Resources/Locale/en-US/procedural/expeditions.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ salvage-expedition-window-claim = Claim
salvage-expedition-window-next = Next offer
# Expedition descriptions
# Frontier: Expedition descriptions
salvage-expedition-desc-mining = Collect resources inside the area.
# You will be taxed {$tax}% of the resources collected.
salvage-expedition-desc-structure = {$count ->
[one] Destroy {$count} {$structure} inside the area.
*[other] Destroy {$count} {$structure}s inside the area.
*[other] Destroy {$count} {MAKEPLURAL($structure)} inside the area.
}
salvage-expedition-desc-elimination = Kill a large and dangerous creature inside the area.
# End Frontier

salvage-expedition-type-Mining = Mining
salvage-expedition-type-Destruction = Destruction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- type: entity
parent: CarpStatue
id: PunkPartySupplies
name: party supplies
name: party supply stash
description: The only thing that can hold a gang together.
components:
- type: Sprite
Expand Down

0 comments on commit 24ca4c6

Please sign in to comment.