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

Commit

Permalink
Merge pull request #63 from Corvax-Frontier/Zekins3366-patch-1
Browse files Browse the repository at this point in the history
Реворк экспедиций
  • Loading branch information
Vonsant authored Apr 24, 2024
2 parents dc634e8 + c333bc7 commit 29aecfe
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
28 changes: 23 additions & 5 deletions Content.Server/Salvage/SalvageSystem.ExpeditionConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,32 @@ private void OnSalvageClaimMessage(EntityUid uid, SalvageExpeditionConsoleCompon
{
var station = _station.GetOwningStation(uid);

// Corvax-Frontier Start
var activeExpeditionCount = 0;
var expeditionQuery = EntityManager.AllEntityQueryEnumerator<SalvageExpeditionDataComponent, MetaDataComponent>();
while (expeditionQuery.MoveNext(out var expeditionUid, out _, out _))
{
if (TryComp<SalvageExpeditionDataComponent>(expeditionUid, out var expeditionData) && expeditionData.Claimed)
{
activeExpeditionCount++;
}
}

if (activeExpeditionCount >= 2)
{
PlayDenySound(uid, component);
_popupSystem.PopupEntity(Loc.GetString("ftl-channel-blocked"), uid, PopupType.MediumCaution);
return;
}
// Corvax-Frontier End

if (!TryComp<SalvageExpeditionDataComponent>(station, out var data) || data.Claimed)
return;

if (!data.Missions.TryGetValue(args.Index, out var missionparams))
return;

// On Frontier, FTL travel is currently restricted to expeditions and such, and so we need to put this here
// until FTL changes for us in some way.
// Существующие проверки и логика
if (!TryComp<StationDataComponent>(station, out var stationData))
return;
if (_station.GetLargestGrid(stationData) is not {Valid : true} grid)
Expand All @@ -57,17 +75,16 @@ private void OnSalvageClaimMessage(EntityUid uid, SalvageExpeditionConsoleCompon
UpdateConsoles(data);
return;
}
// end of Frontier proximity check

// Frontier change - disable coordinate disks for expedition missions
// Frontier change - disable coordinate disks for expedition missions
//var cdUid = Spawn(CoordinatesDisk, Transform(uid).Coordinates);
SpawnMission(missionparams, station.Value, null);

data.ActiveMission = args.Index;
var mission = GetMission(missionparams.MissionType, missionparams.Difficulty, missionparams.Seed);
data.NextOffer = _timing.CurTime + mission.Duration + TimeSpan.FromSeconds(1);

// Frontier change - disable coordinate disks for expedition missions
// Frontier change - disable coordinate disks for expedition missions
//_labelSystem.Label(cdUid, GetFTLName(_prototypeManager.Index<DatasetPrototype>("names_borer"), missionparams.Seed));
//_audio.PlayPvs(component.PrintSound, uid);

Expand Down Expand Up @@ -116,6 +133,7 @@ private void UpdateConsole(Entity<SalvageExpeditionConsoleComponent> component)

_ui.TrySetUiState(component, SalvageConsoleUiKey.Expedition, state);
}

private void PlayDenySound(EntityUid uid, SalvageExpeditionConsoleComponent component)
{
_audio.PlayPvs(_audio.GetSound(component.ErrorSound), uid);
Expand Down
1 change: 1 addition & 0 deletions Resources/Locale/ru-RU/_NF/adventure/adventure.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ shipyard-rules-default2 =
Корпоративный Закон приведут к административным мерам.
Спасибо, что выбрали Службу Безопасности NT.
shuttle-ftl-proximity = Близлежащие объекты слишком массивны для FTL прыжка!
ftl-channel-blocked = FTL канал перегружен, попробуйте позже.
changelog-tab-title-Upstream = Журнал изменений
public-transit-departure = Направляемся в { $destination }. Ориентировочное время в пути: { $flytime } секунд.
public-transit-arrival = Спасибо за выбор общественного транспорта NT. Следующий шаттл до { $destination } отправляется через { $waittime } секунд.

0 comments on commit 29aecfe

Please sign in to comment.