Skip to content

Commit

Permalink
Worlds Part II (#81)
Browse files Browse the repository at this point in the history
* chore(deps): bump test-dependencies

* chore(game): add new game version and expedition

* fix(Microsoft): adapt to changes in double save identifier

* docs: updated changelog

* chore(game): adding and updating enums

* chore(game): take new difficulty settings into account

* chore(game): add new hashed technology

* docs(changelog): add difficulty settings and packaged technology

* regression: add new Microsoft property to ContainerExtra in ExecuteCanCreate

* test(Playstation): adapt expected result
  • Loading branch information
cengelha authored Feb 9, 2025
1 parent a1b7f33 commit 5ef9c63
Show file tree
Hide file tree
Showing 24 changed files with 263 additions and 150 deletions.
1 change: 1 addition & 0 deletions .exclusion.dic
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ Reisende
Lehave
Yamak
Innerhalb
Starborn
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ since 1.0.0.
* Read action to read a (save) file and write the plaintext JSON to stdout
* Write action to take plaintext JSON from stdin and write it to a (save) file
* Parameter for `Transfer` to ignore incomplete user identification
* Support for game version **Worlds Part II 5.50**
* Detection for new packaged technology
* Difficulty setting for NPC population is taken into account
* Titan Expedition
### Changed
* Files in backups are now only prefixed with `data`/`meta` and no longer completely renamed to make manual backups a little easier
* The static class `libNOM.io.Global.Common` is no longer public accessible
Expand All @@ -30,6 +34,8 @@ since 1.0.0.
* Missing `IsVersion525TheCursedWithCrossSave` in `IContainer`
* Use `IContainer` to implement `IComparable` and `IEquatable` of `IContainer` instead of `Container`
* Packaged technology disappears due to the hashes no being UTF-8 conform ([#122 in the NomNom repository](/~https://github.com/zencq/NomNom/issues/122))
* Crash caused by changes in the Microsoft platform ([#232 in the NomNom repository](/~https://github.com/zencq/NomNom/issues/232))
* Difficulty setting for fishing added in **Aquarius 5.10** was not taken into account
### Security

## 0.13.0 (2024-12-02)
Expand Down Expand Up @@ -122,7 +128,7 @@ since 1.0.0.

### Added
* `GetString` extension for `JToken` that is now used by the one for `JObject`
* Support for game version **Worlds 5.00**
* Support for game version **Worlds Part I 5.00**
* Liquidators Expedition

### Changed
Expand Down
4 changes: 4 additions & 0 deletions libNOM.io/Container/Container_Property_IsVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,8 @@ public partial class Container : IContainer
public bool IsVersion520TheCursed => IsVersion(GameVersionEnum.TheCursed); // { get; }

public bool IsVersion525TheCursedWithCrossSave => IsVersion(GameVersionEnum.TheCursedWithCrossSave); // { get; }

public bool IsVersion529TheCursedWithStarbornPhoenix => IsVersion(GameVersionEnum.TheCursedWithStarbornPhoenix); // { get; }

public bool IsVersion550WorldsPartII => IsVersion(GameVersionEnum.WorldsPartII); // { get; }
}
148 changes: 82 additions & 66 deletions libNOM.io/Enums/DifficultyEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,55 @@ internal enum ActiveSurvivalBarsDifficultyEnum : uint
All,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcHazardDrainDifficultyOption.cs#L7
internal enum HazardDrainDifficultyEnum : uint
// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcBreakTechOnDamageDifficultyOption.cs#L7
internal enum BreakTechOnDamageProbabilityEnum : uint
{
Slow,
None,
Low,
High,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcChargingRequirementsDifficultyOption.cs#L7
internal enum ChargingRequirementsDifficultyEnum : uint
{
None,
Low,
Normal,
Fast,
High,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcEnergyDrainDifficultyOption.cs#L7
internal enum EnergyDrainDifficultyEnum : uint
// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcCombatTimerDifficultyOption.cs#L7
internal enum CombatTimerDifficultyOptionEnum : uint
{
Off,
Slow,
Normal,
Fast,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcSubstanceCollectionDifficultyOption.cs#L7
internal enum SubstanceCollectionDifficultyEnum : uint
// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcCreatureHostilityDifficultyOption.cs#L7
internal enum CreatureHostilityDifficultyEnum : uint
{
High,
Normal,
Low,
NeverAttack,
AttackIfProvoked,
FullEcosystem,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcSprintingCostDifficultyOption.cs#L7
internal enum SprintingCostDifficultyEnum : uint
// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcCurrencyCostDifficultyOption.cs#L7
internal enum CurrencyCostDifficultyEnum : uint
{
Free,
Low,
Full,
Cheap,
Normal,
Expensive,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcScannerRechargeDifficultyOption.cs#L7
internal enum ScannerRechargeDifficultyEnum : uint
// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcDamageGivenDifficultyOption.cs#L7
internal enum DamageGivenDifficultyEnum : uint
{
VeryFast,
Fast,
High,
Normal,
Slow,
Low,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcDamageReceivedDifficultyOption.cs#L7
Expand All @@ -61,14 +71,6 @@ internal enum DamageReceivedDifficultyEnum : uint
High,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcBreakTechOnDamageDifficultyOption.cs#L7
internal enum BreakTechOnDamageProbabilityEnum : uint
{
None,
Low,
High,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcDeathConsequencesDifficultyOption.cs#L7
internal enum DeathConsequencesDifficultyEnum : uint
{
Expand All @@ -78,48 +80,38 @@ internal enum DeathConsequencesDifficultyEnum : uint
DestroySave,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcChargingRequirementsDifficultyOption.cs#L7
internal enum ChargingRequirementsDifficultyEnum : uint
{
None,
Low,
Normal,
High,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcFuelUseDifficultyOption.cs#L7
internal enum FuelUseDifficultyEnum : uint
// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcEnergyDrainDifficultyOption.cs#L7
internal enum EnergyDrainDifficultyEnum : uint
{
Free,
Cheap,
Slow,
Normal,
Expensive,
Fast,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcLaunchFuelCostDifficultyOption.cs#L7
internal enum LaunchFuelCostDifficultyEnum : uint
// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcFishingDifficultyOption.cs#L7
public enum FishingDifficultyEnum : uint // added in Aquarius 5.10
{
Free,
Low,
Normal,
High,
AutoCatch,
LongCatchWindow,
NormalCatchWindow,
ShortCatchWindow,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcCurrencyCostDifficultyOption.cs#L7
internal enum CurrencyCostDifficultyEnum : uint
// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcFuelUseDifficultyOption.cs#L7
internal enum FuelUseDifficultyEnum : uint
{
Free,
Cheap,
Normal,
Expensive,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcItemShopAvailabilityDifficultyOption.cs#L7
internal enum ItemShopAvailabilityDifficultyEnum : uint
// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcHazardDrainDifficultyOption.cs#L7
internal enum HazardDrainDifficultyEnum : uint
{
High,
Slow,
Normal,
Low,
Fast,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcInventoryStackLimitsDifficultyOption.cs#L7
Expand All @@ -130,29 +122,28 @@ internal enum InventoryStackLimitsDifficultyEnum : uint
Low,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcDamageGivenDifficultyOption.cs#L7
internal enum DamageGivenDifficultyEnum : uint
// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcItemShopAvailabilityDifficultyOption.cs#L7
internal enum ItemShopAvailabilityDifficultyEnum : uint
{
High,
Normal,
Low,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcCombatTimerDifficultyOption.cs#L7
internal enum CombatTimerDifficultyOptionEnum : uint
// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcLaunchFuelCostDifficultyOption.cs#L7
internal enum LaunchFuelCostDifficultyEnum : uint
{
Off,
Slow,
Free,
Low,
Normal,
Fast,
High,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcCreatureHostilityDifficultyOption.cs#L7
internal enum CreatureHostilityDifficultyEnum : uint
// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcNPCPopulationDifficultyOption.cs#L7
internal enum NPCPopulationDifficultyEnum : uint // added in Worlds Part II 5.50
{
NeverAttack,
AttackIfProvoked,
FullEcosystem,
Full,
Abandoned,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcReputationGainDifficultyOption.cs#L7
Expand All @@ -163,3 +154,28 @@ internal enum ReputationGainDifficultyEnum : uint
Normal,
Slow,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcScannerRechargeDifficultyOption.cs#L7
internal enum ScannerRechargeDifficultyEnum : uint
{
VeryFast,
Fast,
Normal,
Slow,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcSprintingCostDifficultyOption.cs#L7
internal enum SprintingCostDifficultyEnum : uint
{
Free,
Low,
Full,
}

// /~https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcSubstanceCollectionDifficultyOption.cs#L7
internal enum SubstanceCollectionDifficultyEnum : uint
{
High,
Normal,
Low,
}
3 changes: 3 additions & 0 deletions libNOM.io/Enums/GameVersionEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,7 @@ public enum GameVersionEnum
TheCursed = 520,
[Description(nameof(TheCursed))]
TheCursedWithCrossSave = 525,
[Description(nameof(TheCursed))]
TheCursedWithStarbornPhoenix = 529,
WorldsPartII = 550,
}
2 changes: 2 additions & 0 deletions libNOM.io/Enums/PersistentBaseTypesEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ internal enum PersistentBaseTypesEnum : uint
SpaceBase,
GeneratedPlanetBase,
GeneratedPlanetBaseEdits,
PlayerShipBase,
FriendsShipBase,
}
1 change: 1 addition & 0 deletions libNOM.io/Enums/SeasonEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ public enum SeasonEnum
LiquidatorsRedux,
AquariusRedux,
CursedRedux,
Titan, // 17th
Future,
}
3 changes: 3 additions & 0 deletions libNOM.io/Extensions/Newtonsoft.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ internal static IEnumerable<T> SelectTokensWithIntersection<T>(this JObject self
var result = default(T);
var type = typeof(T);

if (type.IsNullable())
type = type.GenericTypeArguments[0];

if (type.IsSubclassOf(typeof(JToken)) || type == typeof(JToken))
{
// integer
Expand Down
15 changes: 15 additions & 0 deletions libNOM.io/Extensions/Type.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace libNOM.io.Extensions;


internal static class TypeExtensions
{
/// <summary>
/// Checks whether this <see cref="Type"> is <see cref="Nullable"> or not.
/// </summary>
/// <param name="self"></param>
/// <returns></returns>
internal static bool IsNullable(this Type self)
{
return !self.IsGenericTypeDefinition && self.IsGenericType && self.GetGenericTypeDefinition() == typeof(Nullable<>);
}
}
Loading

0 comments on commit 5ef9c63

Please sign in to comment.