Commit Graph

116 Commits

Author SHA1 Message Date
bryanthaboi b9ba8b3ee4 addl api capabilities 2026-09-18 07:53:42 -04:00
DESKTOP-8SRFDDM\cam95 dd2a1f89ff engine: opts.items -- items on the link cable, for a mode that asks (RFC 0021)
A link battle runs under cable rules and LinkBattle keeps them: openItems
prints "Items can't be used in a link battle!" and the wire knows move,
struggle, locked, switch and RUN.  Right for the Cable Club, wrong for a
mode that is not the Cable Club -- a battle royale played over
LinkState.newFromSession fights with real, damaged parties, and the
potions and X items on the ground are its whole economy; against a bot
the bag works, against a person it says no.  The mode cannot fix it:
submit, resolveLockstep and the decoder are closures, and there is no
action that means "nothing" to spend the turn on.

opts.items = true on newHost/newGuest (off by default, set on both
machines like turnLimit): the bag is BattleState.openItems -- the vanilla
BagMenu against this battle, whose picker already offers the clamped
copies -- and the effect is ItemEffects.use as in any fight.  What
changes is what spending the turn means: itemUsed puts { kind = "item",
item, index, move } on the wire as the turn's action instead of running
the AI's reply.  Both machines and a spectator resolve it before switches
and moves: the user's side is already applied (the bag did it), the other
side applies the same effect to its own copies of that side through
src/link/LinkItems.lua -- ItemEffects.use behind a battle whose player is
the user's battler and a save whose party is the user's copies, nothing
consumed -- and prints "<name> used <ITEM>!" plus the effect's lines.
Every effect reachable in a battle is deterministic, so the per-turn
hash still agrees.  BagMenu hands itemUsed the item, target and move it
used; a local battle ignores them.  A ball on the cable is refused
(ItemEffects), the way the doll is in any trainer battle.

tests/engine/link_items.lua: cable rules by default; opted in, the host's
POTION heals the guest's copy before the moves, both print the lines,
one turn, hashes agree; a spectator fed the same two messages heals its
copy too.  docs/modding.md and docs/rfcs/0021-link-battle-items.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-15 08:19:06 -05:00
BountyHunterKanden 975dc40d41 Add input.key, input.gamepad, and input.wheel hooks (RFC 0020)
Kanto Companion's Edit Mode can't run during battle -- there's no way
to stop a D-pad press from also driving the battle menu, so the only
option today is pausing the game outright. This adds the same input
precedence a mod had before the sandbox changes: vanilla is the whole
existing callback body, and the hook fires before any of it runs.
input.wheel stays a plain observer like input.pointer, since nothing
depends on suppressing it.
2026-09-06 12:24:08 -05:00
bryanthaboi 2f9a920f4d Merge pull request #1825 from BountyHunterKanden/encounter-table-preview
Add API seam for mods to read/give information about altered encounter tables
2026-09-01 13:50:11 -04:00
DESKTOP-8SRFDDM\cam95 49a5408c2d engine: pokemon.level_visible, a level a mode can take off the screen (RFC 0019)
A Pokémon's level is printed on four Gen 1 surfaces -- both battle
healthboxes, the party rows, and both status pages -- and every one of them
prints it unconditionally. There is no seam, so a mode that wants the number
gone has two options today and both are bad: paint over the engine's own
pixels from render.hud (four rectangles, a background shade to match, and
the palette flashes and healthbox slide to survive), or monkey-patch the
render modules from inside the sandbox, which works and is exactly what
CONTRIBUTING-mods.md tells mods not to do.

The motivating case is a battle royale that scales every party to a shared
rung rising with its fog: the number is the same for everyone, it changes on
a clock, and it reads as a threat it is not -- a Lv37 opponent looks
dangerous to a player who has not worked out that their own team is Lv37
too. A randomizer keeping an encounter unreadable, a challenge run that
forbids level-checking and a blind Nuzlocke want the same switch.

New hook `pokemon.level_visible`, taking the shape the presentation
predicates on the battle screen already use -- battle.status_hud_visible,
battle.bottom_ui_visible, battle.caught_marker_visible: consulted behind
Runtime.wantsHook, default visible, only an explicit false suppresses. It is
not named battle.* because a level is not a battle-only readout, and it
carries the surface that asked (battle.enemy / battle.player / party /
summary) so a mode can hide an opponent's level and keep its own.

src/ui/LevelDisplay.lua holds the one definition of "visible", so the four
call sites are a one-line guard each rather than four copies of the same
five lines that can drift apart.

No layout moves. Each site keeps its own hand-rolled PrintLevel rule
(home/pokemon.asm:335-345), it just asks first. Two details are deliberate:
a status condition still replaces the level on a healthbox exactly as in the
cart, so hiding a level never hides PSN or BRN (the guard is an elseif on
the existing status branch); and on status page 2 the <to> arrow is hidden
with the level it points at, because an arrow with nothing after it is half
a sentence.

Gen 1 only. The Gen 2 screens and the Gen 1 PC box list -- where the level
is part of a row label rather than a drawn field -- keep their own readouts
and do not consult the hook. Both are stated as follow-ups in the RFC and
beside the hook in docs/modding.md, so a mod author reads the limit before
depending on it.

Verification: tests/modkit/cases/pokemon_level_visible.lua covers the
contract through the public mod API; gate_hooks picks the hook up on its own
because it walks the live catalog; gate_meta_coverage is satisfied by the
change that introduces the seam, so it never enters the DEBT ledger.
tests/run_modkit.lua 33/33, tests/run_engine.lua 327/331 -- the same four
audio/hostshell suites fail unchanged on dev without this branch.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-26 10:53:09 -05:00
BountyHunterKanden f38b99caa6 engine: encounter.table -- preview the effective wild-encounter distribution (RFC 0019)
Lets a mod ask what a map's wild-encounter odds look like right now,
composed with any live encounter.table wrapper, without rolling the RNG.
encounter.roll/encounter.species can only transform one draw; this is the
missing read side. Guarded query method (mod.world:effectiveEncounters),
no changes to the real roll path, docs and a public-API modkit case.
2026-08-25 21:41:30 -05:00
DESKTOP-8SRFDDM\cam95 2ca07cfd09 engine: battle.style and catch.nickname rule hooks (RFC 0015)
Two decisions the OPTION screen and the cart make for the player, made
hookable so a game mode can make them instead: whether a faint offers the
SHIFT free switch, and whether a catch asks for a nickname.  Guarded call
sites, file-local vanilla links, docs and a public-API modkit case.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N1DVpYXGabigHqMwviDoKV
2026-08-25 09:20:35 -05:00
bryanthaboi 9dd38e06a5 Merge pull request #1767 from MaxTomahawk/adaptive-trainers/dataset-view-api
feat(mod-api): expose imported dataset views
2026-08-25 08:26:51 -04:00
MaxTomahawk ef62962010 Merge upstream dev into dataset view API 2026-08-25 11:54:22 +00:00
DESKTOP-8SRFDDM\cam95 7d6566fa51 engine: catch.party_full custody for a full-party catch (RFC 0018)
A capture the party cannot hold silently falls through to the box; the
new partyFullDestination seam lets a mode claim custody at that moment
instead, and pokemon.caught reports destination "mod" so the mode can
find the mon again.  Guarded call site, file-local vanilla, docs and a
public-API modkit case.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N1DVpYXGabigHqMwviDoKV
2026-08-24 21:06:07 -05:00
bryanthaboi cd4ef14f13 Merge branch 'dev' into spidercar2 2026-08-24 08:48:24 -04:00
bryanthaboi d575a64287 Merge pull request #1734 from BoLayerDev/feature/mew-dock-occupancy-seam
Add composable map occupancy and active-block APIs
2026-08-24 08:37:27 -04:00
bryanthaboi ff826ce01e Merge pull request #1769 from MaxTomahawk/adaptive-trainers/mod-developer-mode
feat(mod-api): expose loader developer mode
2026-08-24 08:35:49 -04:00
bryanthaboi 0ab4ef2755 Merge pull request #1766 from MaxTomahawk/adaptive-trainers/field-residual-hook
feat(mod-api): expose field residual descriptors
2026-08-24 08:35:10 -04:00
bryanthaboi 1905261c5b Spider Car Unleashed
CLOSES #1483, CLOSES #1610, CLOSES #1615, CLOSES #1646, CLOSES #1649, CLOSES #1651, CLOSES #1653, CLOSES #1656, CLOSES #1683, CLOSES #1685, CLOSES #1686, CLOSES #1687, CLOSES #1688, CLOSES #1689, CLOSES #1690, CLOSES #1693, CLOSES #1694, CLOSES #1695, CLOSES #1696, CLOSES #1702, CLOSES #1704, CLOSES #1705, CLOSES #1706, CLOSES #1707, CLOSES #1708, CLOSES #1710, CLOSES #1711, CLOSES #1712, CLOSES #1713, CLOSES #1716, CLOSES #1717, CLOSES #1718, CLOSES #1719, CLOSES #1720, CLOSES #1721, CLOSES #1725, CLOSES #1732, CLOSES #1745, CLOSES #1748, CLOSES #1749, CLOSES #1751, CLOSES #1754
2026-08-24 07:52:05 -04:00
MaxTomahawk 96ed862b50 docs(mod-api): clarify developer mode sources 2026-08-24 10:51:09 +02:00
MaxTomahawk 58681fe62e feat(mod-api): expose developer mode 2026-08-24 10:38:31 +02:00
MaxTomahawk 38d515f547 fix(mod-api): reserve generated metadata ids 2026-08-24 10:10:23 +02:00
MaxTomahawk 7e069df740 fix(mod-api): validate dataset roots lazily 2026-08-24 09:57:57 +02:00
MaxTomahawk ca700c44d7 fix(mod-api): harden imported dataset views 2026-08-24 09:33:51 +02:00
MaxTomahawk 2ad2e028d1 feat(mod-api): expose field residual descriptors 2026-08-24 09:32:34 +02:00
MaxTomahawk b286e6584f feat(mod-api): add imported dataset views 2026-08-24 09:10:35 +02:00
DESKTOP-8SRFDDM\cam95 01c5eb2189 tests, docs: cover world.talk and link.battle_ended
gate_meta_coverage asks every extension point for a unit test through the
public mod API, a no-mod parity test, and docs. The seams commit shipped the
call sites and owed the rest.

Both cases drive the real engine path, and both assert the unhooked build
first, so they fail if the seam is deleted and if it changes vanilla
behaviour. world_talk stands an object on the faced cell: with no mod the A
press reaches talkTo, with a mod that owns the object it does not, and an
object the mod ignores still falls through. link_battle_ended parks a
session at the end of a battle and checks the event carries the result, the
role, and both party copies.

The parity side needed nothing. gate_hooks and gate_events walk the live
catalog, so both seams were covered structurally as soon as the call sites
existed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-23 10:19:06 -05:00
Bo Layer d17f0725d8 fix(mod-api): validate active block storage 2026-08-23 03:20:43 -06:00
Bo Layer c9221daa90 fix(mod-api): fail closed on malformed map blocks 2026-08-23 03:19:19 -06:00
Bo Layer 0147e3d87b feat(mod-api): add composable map occupancy seam 2026-08-23 03:17:27 -06:00
bryanthaboi d191aaa34d Merge pull request #1616 from HighDrexler/fix/large-required-imports-v2
Fix/large required imports v2
2026-08-21 09:59:17 -04:00
MaxTomahawk 4b0496bad1 feat(mod-api): expose charge decision hook 2026-08-21 14:40:51 +02:00
github-actions[bot] 2d28d18bf6 fix(mods): support large required imports end-to-end 2026-08-20 21:10:01 +00:00
bryanthaboi ec9dc29646 Pokemon Silver as a full launcher version, plus launcher mods-list and title-tempo fixes
Silver: derived import manifest (tools/make_silver_manifest.py re-resolves
the Gold manifest's symbols from pokesilver.sym), silver GameVersion row,
generation-keyed extractor routing, required-files override, edition save
stamping (a Silver playthrough no longer writes into the Gold save),
checkver-driven edition data, SILVER/KAMON/OSCAR/MAX presets, GOLD rival
default, edition credits banner, Lugia title screen (OAM layouts, bob,
trail, palettes as title.lua data keys with Gold defaults so old caches
need no re-import), packaging for every build target, docs, and tests.

Launcher: the installed-mods list is one continuous scroll (rows culled to
the viewport) instead of a pager with an inner scroll viewport; the pad
cursor's edge-scroll no longer runs it to the bottom. The game dropdown
shows just the initial and caret. Find-tab behavior unchanged.

Title tempo: a sprite-anim frame shows duration+1 ticks
(engine/sprite_anims/core.asm GetSpriteAnimFrame), which locks both
editions' 64-tick wing beat to the 64-tick sine bob; the title screens no
longer run fast and out of phase.
2026-08-20 08:27:25 -04:00
AverageConsumer c655217120 feat(gen2): expose stock ball catch previews 2026-08-17 23:00:38 +02:00
AverageConsumer 360b692963 android: route asymmetric companion displays 2026-08-17 03:00:05 +02:00
AverageConsumer 1fc34da2a9 android: extend secondary display presentation 2026-08-16 22:57:10 +02:00
AverageConsumer 99d9908017 render: add cross-platform desktop companion display 2026-08-16 22:24:12 +02:00
bryanthaboi fdffb12571 Merge pull request #1399 from AverageConsumer/codex/mod-battle-special-intents 2026-08-16 12:09:03 -04:00
bryanthaboi 0c941cecd4 Merge pull request #1402 from AverageConsumer/codex/mod-field-advanced-actions 2026-08-16 12:08:47 -04:00
AverageConsumer 1f3d13adaf mods: add OS-independent game viewport composition 2026-08-16 15:17:35 +02:00
AverageConsumer a3a20a07e1 feat(mods): expose Fly and Softboiled field actions 2026-08-16 14:57:46 +02:00
AverageConsumer b39e11b7cd feat(mods): add special battle intents 2026-08-16 14:43:08 +02:00
AverageConsumer c22888a7fd feat(mods): add validated battle menu intents 2026-08-16 02:56:03 +02:00
bryanthaboi 992dc80aa7 Merge pull request #1370 from AverageConsumer/codex/mod-field-action-busy 2026-08-15 20:20:12 -04:00
AverageConsumer fcb5d1d348 feat(mods): expose read-only battle snapshots 2026-08-16 01:32:23 +02:00
AverageConsumer d99072b44e feat(mods): report field action availability state 2026-08-16 01:01:16 +02:00
Shane McGovern cf335f67de feat(mods): add mod.postLog one-way log reporting to a manifest-declared URL 2026-08-15 21:03:24 +01:00
anxiousintrovert 9bf15c33fd Cover required imports across platforms 2026-08-15 12:20:21 -05:00
bryanthaboi 5198b35945 bazinga 2026-08-15 10:44:20 -04:00
bryanthaboi 43cbc554c3 legcompat 2026-08-15 06:04:04 -04:00
bryanthaboi 72f126ae26 Merge pull request #1312 from AverageConsumer/feat/contextual-field-moves 2026-08-14 21:42:22 -04:00
anxiousintrovert c48fc578ca Address required import review feedback 2026-08-14 20:34:14 -05:00
anxiousintrovert 542856c83d Add manifest-driven required mod imports 2026-08-14 20:34:14 -05:00