-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
On the Japanese version, secret rewards were still being included in normal item randomization because we weren't testing the version in every scenario. Made a subclass for this case to avoid duplicating the check everywhere.
- Loading branch information
Showing
4 changed files
with
29 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Newtonsoft.Json; | ||
using TREnvironmentEditor; | ||
using TRLevelControl.Model; | ||
|
||
namespace TRRandomizerCore.Secrets; | ||
|
||
public class TR3SecretMapping : TRSecretMapping<TR3Entity> | ||
{ | ||
public static TR3SecretMapping Get(string packPath, bool japaneseVersion) | ||
{ | ||
if (!File.Exists(packPath)) | ||
{ | ||
return null; | ||
} | ||
|
||
TR3SecretMapping mapping = JsonConvert.DeserializeObject<TR3SecretMapping>(File.ReadAllText(packPath), EMEditorMapping.Converter); | ||
if (japaneseVersion && mapping.JPRewardEntities != null) | ||
{ | ||
mapping.RewardEntities = mapping.JPRewardEntities; | ||
} | ||
return mapping; | ||
} | ||
} |