Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Jabak
2024-06-17 00:04:36 +03:00
20 changed files with 299 additions and 115 deletions

View File

@@ -18,7 +18,9 @@ public sealed partial class SalvageSystem
* Handles setup / teardown of salvage expeditions.
*/
private const int MissionLimit = 3;
private const int MissionLimit = 5;
private static readonly string[] Difficulties = {"Minimal", "Minor", "Moderate", "Hazardous", "Extreme"};
private readonly JobQueue _salvageQueue = new();
private readonly List<(SpawnSalvageMissionJob Job, CancellationTokenSource CancelToken)> _salvageJobs = new();
@@ -136,7 +138,7 @@ public sealed partial class SalvageSystem
{
Index = component.NextIndex,
Seed = _random.Next(),
Difficulty = "Moderate",
Difficulty = Difficulties[i],
};
component.Missions[component.NextIndex++] = mission;

View File

@@ -3,6 +3,7 @@ using System.Linq;
using System.Numerics;
using System.Threading;
using System.Threading.Tasks;
using Content.Server._White.Other;
using Content.Server.Atmos;
using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
@@ -118,7 +119,7 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
// Setup mission configs
// As we go through the config the rating will deplete so we'll go for most important to least important.
var difficultyId = "Moderate";
var difficultyId = _missionParams.Difficulty;
var difficultyProto = _prototypeManager.Index<SalvageDifficultyPrototype>(difficultyId);
var mission = _entManager.System<SharedSalvageSystem>()
@@ -304,6 +305,8 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
}
var uid = _entManager.SpawnAtPosition(entry.Proto, grid.GridTileToLocal(tile));
if (_entManager.HasComponent<ExpeditionGhostRoleComponent>(uid))
return;
_entManager.RemoveComponent<GhostRoleComponent>(uid);
_entManager.RemoveComponent<GhostTakeoverAvailableComponent>(uid);
return;