fix(fifa17): carry observed rareflag so special cards render as specials

shape_item hardcoded rareflag=1, so all 1949 cards shaped as basic rare gold
regardless of type; informs/specials lost their card art. The dev fixture is
base-only, so this was invisible until the real profile (10 distinct rareflag
values) exposed it on .105.

rareflag is definition-level FIFA identity metadata OBSERVED from the profile
(the raw wire integer, never a guessed marketing label), so it lives in the
FIFA catalog like asset_id/version, not in generic Core:
- ObservedDefinition.rareflag + emitted into the production catalog entry.
- Fifa17CardCatalog RawCard/Fifa17CardIdentity gain rareflag (default 1 when a
  base-only catalog omits it, preserving prior wire behaviour).
- Fifa17Identity.rareflag; host resolver populates it from the catalog.
- shape_item emits id.rareflag instead of a hardcoded 1.

Verified on the real staged /club: wire rareflag distribution == source exactly
(0 per-item mismatches across 1949; e.g. rareflag 3 x591, 24 x302, 21 x256).
adapter 111 + host 24 + importer 25 tests green; clippy -D clean. rareflag lives
in the host catalog, not Core, so no re-import was needed.
This commit is contained in:
funman300
2026-08-12 21:13:51 +00:00
parent 44fcf24d92
commit 626c972232
7 changed files with 43 additions and 4 deletions
+7 -2
View File
@@ -280,6 +280,10 @@ pub struct ObservedDefinition {
/// pace, shooting, passing, dribbling, defending, physical (index 0..=5).
pub attrs: [i64; 6],
pub rarity: &'static str,
/// Observed FIFA wire `rareflag` (the card's rare/special TYPE, e.g. 3=inform,
/// 21..=24 = special programmes). Carried verbatim from the profile — the raw
/// integer, never a guessed marketing label — so specials render as specials.
pub rareflag: i64,
/// Wire ids of the owned copies of this exact resourceId (preserved).
pub wire_ids: Vec<i64>,
}
@@ -508,6 +512,7 @@ pub fn plan_definitions(
team_id,
attrs: attrs6.unwrap(),
rarity: tier(rating),
rareflag: f.rareflag.unwrap_or(1),
wire_ids,
});
}
@@ -899,12 +904,12 @@ pub fn emit_content(
let content_pack = content_dir.join("fifa17-production-cards.json");
write_json_pretty(&content_pack, &defs)?;
// ---- PUBLIC: host identity catalog {card_id: {asset_id, version}} ----
// ---- PUBLIC: host identity catalog {card_id: {asset_id, version, rareflag}} ----
let mut cards = serde_json::Map::new();
for d in &report.definitions.supported {
cards.insert(
d.card_id.clone(),
serde_json::json!({ "asset_id": d.asset_id, "version": d.version }),
serde_json::json!({ "asset_id": d.asset_id, "version": d.version, "rareflag": d.rareflag }),
);
}
let catalog = serde_json::json!({