OBT/1.2.0(Spring Update)

Sync with Upstream
This commit is contained in:
NotAlwaysTrue
2026-04-25 13:25:41 +08:00
committed by GitHub
parent 5207b381b7
commit 59bc21973a
421 changed files with 24090 additions and 11391 deletions
@@ -0,0 +1,18 @@
#nullable enable
namespace Barotrauma;
/// <summary>
/// Defines a mission where the success and failure are determined solely by its state.
/// Intended to be used alongside <see cref="MissionStateAction"/>.
/// </summary>
internal sealed partial class CustomMission(MissionPrefab prefab, Location[] locations, Submarine sub) : Mission(prefab, locations, sub)
{
public readonly int SuccessState = prefab.ConfigElement.GetAttributeInt(nameof(SuccessState), +1);
public readonly int FailureState = prefab.ConfigElement.GetAttributeInt(nameof(FailureState), -1);
public bool RequireDestinationReached = prefab.ConfigElement.GetAttributeBool(nameof(RequireDestinationReached), false);
protected override bool DetermineCompleted(CampaignMode.TransitionType transitionType) =>
State == SuccessState &&
(!RequireDestinationReached || transitionType is CampaignMode.TransitionType.ProgressToNextLocation or CampaignMode.TransitionType.ProgressToNextEmptyLocation);
}