Add reveal for option to enter reveal volumes

This commit is contained in:
Noah Pilarski 2022-11-15 22:25:31 -05:00
parent 5f71b64943
commit 98cf27b003
2 changed files with 31 additions and 0 deletions

View File

@ -76,6 +76,22 @@ namespace NewHorizons.Builder.ShipLog
{ {
var factRevealVolume = go.AddComponent<ShipLogFactListTriggerVolume>(); var factRevealVolume = go.AddComponent<ShipLogFactListTriggerVolume>();
factRevealVolume._factIDs = info.reveals; factRevealVolume._factIDs = info.reveals;
switch (info.revealFor)
{
case VolumesModule.RevealVolumeInfo.EnterType.Player:
factRevealVolume._player = true;
factRevealVolume._probe = false;
break;
case VolumesModule.RevealVolumeInfo.EnterType.Probe:
factRevealVolume._player = false;
factRevealVolume._probe = true;
break;
case VolumesModule.RevealVolumeInfo.EnterType.Both:
default:
factRevealVolume._player = false;
factRevealVolume._probe = false;
break;
}
} }
if (!string.IsNullOrEmpty(info.achievementID)) if (!string.IsNullOrEmpty(info.achievementID))

View File

@ -109,6 +109,16 @@ namespace NewHorizons.External.Modules
[EnumMember(Value = @"snapshot")] Snapshot = 2 [EnumMember(Value = @"snapshot")] Snapshot = 2
} }
[JsonConverter(typeof(StringEnumConverter))]
public enum EnterType
{
[EnumMember(Value = @"both")] Both = 0,
[EnumMember(Value = @"player")] Player = 1,
[EnumMember(Value = @"probe")] Probe = 2
}
/// <summary> /// <summary>
/// The max view angle (in degrees) the player can see the volume with to unlock the fact (`observe` only) /// The max view angle (in degrees) the player can see the volume with to unlock the fact (`observe` only)
/// </summary> /// </summary>
@ -124,6 +134,11 @@ namespace NewHorizons.External.Modules
/// </summary> /// </summary>
[DefaultValue("enter")] public RevealVolumeType revealOn = RevealVolumeType.Enter; [DefaultValue("enter")] public RevealVolumeType revealOn = RevealVolumeType.Enter;
/// <summary>
/// What needs to be enter the volume to unlock the facts (`enter` only)
/// </summary>
[DefaultValue("both")] public EnterType revealFor = EnterType.Both;
/// <summary> /// <summary>
/// A list of facts to reveal /// A list of facts to reveal
/// </summary> /// </summary>