diff --git a/Anvil/RecipeData/AnvilRecipe.cs b/Anvil/RecipeData/AnvilRecipe.cs index eeffeae..9c44c85 100644 --- a/Anvil/RecipeData/AnvilRecipe.cs +++ b/Anvil/RecipeData/AnvilRecipe.cs @@ -16,6 +16,14 @@ public sealed record AnvilRecipe public required byte OutputAmount { get; init; } public required uint ClassJobId { get; init; } public required ushort RecipeLevel { get; init; } + + // Character-level equivalent of the recipe's difficulty (e.g. 90 for an + // Endwalker 3-star, 100 for a Dawntrail endgame recipe). Not the same as + // RecipeLevel above - that field is the RecipeLevelTable row id, this one + // is its ClassJobLevel column. Module 02 uses it for the mod-penalty + // branch in BaseProgress and BaseQuality. + public required byte RecipeLevelTableClassJobLevel { get; init; } + public required int Difficulty { get; init; } public required int QualityMax { get; init; } public required byte Durability { get; init; } diff --git a/Anvil/RecipeData/Internal/LuminaRecipeAdapter.cs b/Anvil/RecipeData/Internal/LuminaRecipeAdapter.cs index 181799e..aa74530 100644 --- a/Anvil/RecipeData/Internal/LuminaRecipeAdapter.cs +++ b/Anvil/RecipeData/Internal/LuminaRecipeAdapter.cs @@ -568,6 +568,7 @@ internal sealed class LuminaRecipeAdapter OutputAmount = recipe.AmountResult, ClassJobId = classJobId, RecipeLevel = (ushort)recipe.RecipeLevelTable.RowId, + RecipeLevelTableClassJobLevel = levelTable.ClassJobLevel, Difficulty = difficulty, QualityMax = qualityMax, Durability = durability, diff --git a/Anvil/SelfTest/RecipeDataAdapterLoadStep.cs b/Anvil/SelfTest/RecipeDataAdapterLoadStep.cs index e2603c6..2763263 100644 --- a/Anvil/SelfTest/RecipeDataAdapterLoadStep.cs +++ b/Anvil/SelfTest/RecipeDataAdapterLoadStep.cs @@ -144,7 +144,20 @@ internal sealed class RecipeDataAdapterLoadStep : ISelfTestStep } } - // #9: Cosmic-surface sanity. v0.1.0 ships with SH-15 option B (all + // #9: RecipeLevelTableClassJobLevel sanity. At least one recipe must + // resolve a positive value from RecipeLevelTable.ClassJobLevel - if + // every recipe shows zero the adapter never walked the second sheet, + // which would silently break the simulator's mod-penalty branch. + if (!_catalog.RecipesById.Values.Any(r => r.RecipeLevelTableClassJobLevel > 0)) + { + _logger.LogError( + "RecipeDataCatalog.RecipesById has no recipe with " + + "RecipeLevelTableClassJobLevel > 0; RecipeLevelTable walk failed." + ); + failures++; + } + + // #10: Cosmic-surface sanity. v0.1.0 ships with SH-15 option B (all // MissionHas* flags forced false), so the WARN is expected whenever // any Cosmic recipe is in the catalog. The step still returns Pass // because the catalog itself is not broken - the Cosmic sub-surface