Add "reveal for" option to enter reveal volumes (#446)

Can now choose whether the player, scout, or both can trigger the enter
reveal volume.

I have not tested this yet.
This commit is contained in:
Will Corby 2022-11-15 20:11:32 -08:00 committed by GitHub
commit 0ed5ae20f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 51 additions and 0 deletions

View File

@ -76,6 +76,23 @@ namespace NewHorizons.Builder.ShipLog
{
var factRevealVolume = go.AddComponent<ShipLogFactListTriggerVolume>();
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:
// if you want both player and probe to able to trigger the thing you have to set both player and probe to false. setting both to true will make nothing trigger it
factRevealVolume._player = false;
factRevealVolume._probe = false;
break;
}
}
if (!string.IsNullOrEmpty(info.achievementID))

View File

@ -109,6 +109,16 @@ namespace NewHorizons.External.Modules
[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>
/// The max view angle (in degrees) the player can see the volume with to unlock the fact (`observe` only)
/// </summary>
@ -124,6 +134,11 @@ namespace NewHorizons.External.Modules
/// </summary>
[DefaultValue("enter")] public RevealVolumeType revealOn = RevealVolumeType.Enter;
/// <summary>
/// What can enter the volume to unlock the facts (`enter` only)
/// </summary>
[DefaultValue("both")] public EnterType revealFor = EnterType.Both;
/// <summary>
/// A list of facts to reveal
/// </summary>

View File

@ -2838,6 +2838,11 @@
"default": "enter",
"$ref": "#/definitions/RevealVolumeType"
},
"revealFor": {
"description": "What can enter the volume to unlock the facts (`enter` only)",
"default": "both",
"$ref": "#/definitions/EnterType"
},
"reveals": {
"type": "array",
"description": "A list of facts to reveal",
@ -2865,6 +2870,20 @@
"snapshot"
]
},
"EnterType": {
"type": "string",
"description": "",
"x-enumNames": [
"Both",
"Player",
"Probe"
],
"enum": [
"both",
"player",
"probe"
]
},
"PriorityVolumeInfo": {
"type": "object",
"additionalProperties": false,