Files
Anvil/Anvil/RecipeData/Mechanics/BuffMechanicsEntry.cs
T
JonKazama-Hellion d7e8c42cc7 feat(recipedata): add hardcoded mechanics tables
Three game-mechanics tables for the simulator-relevant constants that the
Lumina sheets do not expose, plus the reverse name map the adapter uses
to walk the CraftAction + Action sheets.

- ActionMechanicsTable: 38 entries with Category, CP cost, durability,
  efficiency, IQ-stack bonus, charges, granted buff, and flags.
  Cross-checked against the spec mechanics table in 01-RecipeData.md
  §2.3.2 (verified there against Artisan's RawInformation/Character/
  Skills.cs). Combo-state CP costs (Standard/Advanced Touch) carry the
  base value; the simulator applies the discount. TrainedEye uses
  short.MaxValue as the sentinel for "fill Recipe.QualityMax in one
  step"; ByregotsBlessing carries base EfficiencyQuality=100 with the
  IQ multiplier added by the simulator.
- BuffMechanicsTable: 14 entries with StatusId, Icon, StackMax, Behavior,
  the three duration fields (Steps / Seconds / Actions populated per
  Behavior), Category, and LegacyStatusId for the older Innovation 259
  and Manipulation 258 ids. Cross-checked against ffxiv-datamining
  Status.csv (StatusId / Icon / StackMax) and Artisan's tooltip-derived
  step durations. Expedience uses the explicit StatusId 3812 - the other
  two "Expedience" rows (2712 / 3092) are non-crafting status effects
  that would otherwise produce an ambiguous name match.
- ConditionMechanicsTable: 11 entries with Quality / Progress / CP /
  Durability multipliers plus a BaseProbability slot. Robust mirrors
  Sturdy's durability discount and keeps Quality neutral (per the
  spec mechanics table - the enum doc comment in AnvilCondition.cs
  predates rev 5 and is noted as superseded in the table header).
  SplendorCosmic's Good=1.75 override lives in the simulator.
  BaseProbability stays 0.0; the static catalog has no useful per-recipe
  spawn distribution because FFXIV derives that from Recipe.IsExpert +
  RecipeLevelTable.Stars at runtime.
- ActionKindByName: reverse map from English action names to
  AnvilActionKind, plus the Action-sheet whitelist (seven step-counter
  buff actions + two Cosmic singletons) used to filter the Action sheet
  walk down to the crafting subset.
2026-05-27 20:25:52 +02:00

31 lines
1.4 KiB
C#

// Per-buff mechanics row. Carries the constants that the FFXIV Status sheet
// does not expose directly: the AnvilBuffBehavior class and the
// duration triple (steps / seconds / actions, populated according to
// Behavior). The Status sheet does deliver StatusId / Icon / StackMax;
// the table mirrors them so consumers and the adapter cross-checks share
// a single source.
//
// Step durations live in the table because FFXIV exposes them only in the
// Status tooltip text ("for the next four steps"). String-parsing the
// tooltip would be fragile across locales and patches.
namespace Anvil.RecipeData.Mechanics;
internal sealed record BuffMechanicsEntry
{
public required uint StatusId { get; init; }
public required uint IconId { get; init; }
public required byte StackMax { get; init; }
public required AnvilBuffBehavior Behavior { get; init; }
public required byte? DefaultDurationSteps { get; init; }
public required float? DefaultDurationSeconds { get; init; }
public required byte? DefaultDurationActions { get; init; }
public required AnvilBuffCategory Category { get; init; }
// Older Status-sheet RowIds that still resolve to the same Anvil buff
// (e.g. Innovation 259 -> 2189, Manipulation 258 -> 1164). Used by the
// adapter's reverse mapping so save-state restore from earlier patches
// still resolves correctly. Null when no legacy id exists.
public required uint? LegacyStatusId { get; init; }
}