diff --git a/fifa17-recon/tools/fut_store.py b/fifa17-recon/tools/fut_store.py index 455d48e..d05cc0d 100644 --- a/fifa17-recon/tools/fut_store.py +++ b/fifa17-recon/tools/fut_store.py @@ -44,16 +44,35 @@ STARTER_PLAYERS = [ ITEM_ID_BASE = 100000000 -def _item(item_id, asset, rating, pos, nation, league, team, attrs, version=0x00): +# cardsubtypeid 219 is Player Fitness. FUN_1801bfac0 case 5 (consumable category 5) +# takes the SQUAD-fitness branch when `(subtype == 0xdc) || FUN_1801a88c0(rec)`, and +# FUN_1801a88c0 is exactly `*(int *)(rec + 0x58) == 1` -- rec+0x58 being the rareflag +# atom 0x271. So a Player Fitness card sent with rareflag 1 silently RENDERS as a +# Squad Fitness card (name FUT_CONSUMABLE_NAME_SQUADTRAINING, artwork 5000011 instead +# of 5000010) and has its single-target count at param_5+0x1bc forced to 0. +# +# rec+0x58 is read TWICE in that 42,813-char render function: unconditionally near the +# top into param_5+0x1f0 (the rare/backing flag, every cardtype), and via FUN_1801a88c0 +# in category 5 only. So this guard changes two things for subtype 219 -- the card also +# stops being drawn as rare -- and that is intended: a Player Fitness card must not be +# rare, because rare IS the squad-fitness selector. +# +# Players are untouched: every existing caller passes 8 positional arguments, so +# cardsubtypeid defaults to 0, 0 != 219, and the dict is byte-identical to before. +_SQUAD_FITNESS_TRAP = 219 + + +def _item(item_id, asset, rating, pos, nation, league, team, attrs, version=0x00, + cardsubtypeid=0, rareflag=1): return { "id": item_id, "resourceId": (version << 24) | asset, "assetId": asset, "cardassetid": asset, "definitionId": (version << 24) | asset, - "cardsubtypeid": 0, + "cardsubtypeid": cardsubtypeid, "itemType": "player", - "rareflag": 1, + "rareflag": 0 if cardsubtypeid == _SQUAD_FITNESS_TRAP else rareflag, "rating": rating, "preferredPosition": pos, "nation": nation,