Arsenal rules (deck record, editor, lobby check)
Decoded from the Store build 1.3.25854.2
executable (our reading of the machine code) and
checked against the layout of the user’s own
deck files; no game text or data here. The menu
screens are scripts (.ssb, a small
script VM); a script reaches the executable
through numbered natives that
take one argument block (arguments at +0, +8,
+0x10, +0x18). The arsenal editor’s native table
is at 0x1403f1d50 (146 entries); the numbers
below index it.
Deck record (0x64 bytes;
Esper-RE deck.h has the file
layout; M, the offsets are the
ones the code below reads):
| Offset | Type | Meaning |
|---|---|---|
| 0x14 | s16 × 30 | the cards: a skill id, or −1 = an aura card |
| 0x50 | u16 | school capacity of the arsenal (1..3): how many different schools it may hold |
| 0x52 | u16 | rule flags, recomputed from the cards (below) |
An arsenal is always 30 cards: there is no separate count. Taking a skill out writes −1 into its place, so every place that holds no skill is an aura card. No minimum or maximum number of aura cards is enforced anywhere; the only test is “holds at least one skill” (flag 0x4000).
The editor (state object at global 0x1404bec08, 0xb60 bytes, made at 0x14015e94b; the list on screen is the object at 0x1404c0140):
- Add / remove a card:
0x140159db0, run by the editor’s input
handler 0x140159310. Adding skill s:
- the list’s stock for s must be above 0, else result −1; the highlighted list row must be s, else −2;
- the copy limit: when the
limit switch (editor + 0xb4c) is not 0, the 30
cards are scanned and 3 or more copies
of s already present → result −3, nothing
added (H: the count
and the compare value 3 were read; it matches
the 404 pre-made decks under
com/deck, none of which has more than 3 of a skill); - the card goes into the place under the cursor; the per-school counters (editor + 0x50 + 4 × school, school = skill record 0x12) and a second counter set (editor + 0x68 + 4 × skill record 0x0E) are kept up to date. The input handler turns the result into a code at editor + 0xb38 that the script reads (native 17, 0x140216a60): 8 for −1 / −2, 10 for the copy limit, 5 / 7 on the leave path (unchanged / changed), 1..3 for moves.
- Limit switch: 1 when the editor is made (0x14015e996). Native 43 (0x1402170d0) sets it to (argument == 0): a debug toggle, no normal menu path writes it (M).
- Stock (0x140170e40): per skill, owned count minus the copies used in all saved arsenals (up to 16), as a byte per skill in the list object (+0x4a88). A skill can therefore sit in several arsenals only as often as it is owned. The owned count is capped at 99 where cards are granted (0x14015ab90).
- School capacity check: native 31 (0x140216cc0): counts the schools 1..5 whose counter is above 0 and returns 1 when that is more than the arsenal’s capacity (deck + 0x50). The script asks it when the player leaves the editor and shows its own message; the executable itself never refuses the card (M: the script side was not read). Native 127 (0x1402180c0) returns a deck’s capacity.
- Changed? native 30 (0x140216ca0 → 0x140159520): sorts a copy of the cards and of the saved cards (0x140159620) and compares them, so reordering alone is not a change.
- No per-skill limit field was found: the copy limit is the constant 3 for every skill and no skill-record field is read by the add routine besides 0x12 and 0x0E (M).
Rule flags (0x14015b830, written to deck + 0x52):
| Flag | Set when |
|---|---|
| 0x4000 | the arsenal holds at least one skill |
| 0x20 | all its skills are of one school |
| 0x40 | no skill appears twice |
| 0x80 | every skill costs ≤ 3 and none has button mode 2 (skill record 0x28 / 0x46) |
| 0x100 | every skill costs ≥ 3 and none has button mode 2 |
What each game rule asks of an arsenal (table 0x1402dbc78, u32 × 12, indexed by the versus game rule; check 0x14015b9e0 = (flags & required) == required):
| Game rule | Required flags |
|---|---|
| 0, 1, 3, 4, 5, 10, 11 | 0x4000 |
| 2 | none (the match uses pre-made decks, the own arsenal is not loaded) |
| 6 | 0x20 (one school) |
| 7 | 0x40 (no duplicates) |
| 8 | 0x80 (low cost) |
| 9 | 0x100 (high cost) |
Where it is checked (the only three users of 0x14015b9e0):
- 0x1401831f0 builds a mask (0x14051c93c): bit r is set when rule r needs nothing or at least one saved arsenal meets it. The create-game screen uses it to offer only rules the player can enter.
- Lobby arsenal pick (lobby native 0x1402152d0): recomputes the flags of the picked arsenal (index at 0x1403de844), stores them, tests them against the session’s game rule (0x1405277fc) and returns 1 when allowed.
- Editor native 122 (0x140217fc0): the same test from the editor.
The match start does not check the deck again (M: no other reader of the table or the flags; the online set-up 0x140187710 just loads the picked arsenal). The copy limit and the capacity are editor-side only; a deck that breaks them is played as it is. In netplay each side loads its own arsenal: the other side never sees the full deck before the match.
Aura factor and capacity: the match set-up takes the aura regeneration factor from deck + 0x50, i.e. from the arsenal’s capacity, not from the schools actually used (“Combat rules”, corrected there).
Not decoded: how the capacity of a new arsenal is chosen (the case the player owns; the buy / grant path 0x14012d820, 0x14015b7b0 was not followed); the editor’s script side (messages, which leave path asks native 31); the second counter set (+0x68, by skill record 0x0E) has no reader that we found.
Implementation notes for the rebuild
- Arsenal = exactly 30 places, each a skill id or an aura card; “remove” = set to aura.
- Builder refuses the 4th copy of a skill (limit 3, same for every skill). No aura-count rule. On leaving, refuse when the number of different schools (1..5) exceeds the arsenal’s capacity (1..3).
- The aura regeneration factor follows the capacity, so a one-school deck in a three-school arsenal regenerates at the three-school rate.
- Rule-restricted matches: compute the five flags from the cards and test them when the arsenal is picked in the lobby, not at match start. Rule 2 ignores the own arsenal.
- Netplay: nothing to verify remotely in the original; a rebuild may add its own check.