Skip to content

Add portable wallet, inventory and party script actions - #110

Closed
Roxas2712 wants to merge 23 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/portable-script-state
Closed

Roxas2712 wants to merge 23 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/portable-script-state

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 22, 2026 •

Copy link
Copy Markdown

Depends on #109 and its API prerequisites. Merge those first and rebase before merging. Isolated commit 235b8f975f9e4c74cf0775dc6f18e9cc7220439b (focused diff).

Extend the bounded portable script language with give_money, take_money, check_money, take_coins, check_item, take_item, check_dex_owned, mark_seen and heal_party. Resolve canonical item/species IDs through the existing loader index. Validate the whole program's arguments, content and referenced live stores before any prefix runs, including unreachable rows; revalidate stores when executing after a wait.

Use native Bag.remove/order cleanup and Pokemon healing with the current Game's moves for PP. The optional moves argument preserves existing Pokemon.heal callers. Preserve the verified Gen1 API's wallet semantics: Gen2/3 cap addition at999999, Gen1 retains its native uncapped wallet, with host exact-integer overflow refusal. Removal saturates at available quantity/zero; no gift UI is introduced in this synchronous group.

Commands, bounds and reproduction.

Validation

  • 118/118 targeted checks, including real native Bag removal/order cleanup and Pokemon HP/status/PP restoration, canonical content, malformed/unreachable-row refusal with no prefix effects, wallet caps/overflow, saturation, copied arguments and changed live stores.
  • 88 cross-engine comparisons /176 isolated loader runs against clean pinned Gen1 79ea62f45fb2ea8f65d081a109431e4eb1bbdb36, clean feature head. Same public-only program on Red, Blue, Yellow, Gold, Silver, Crystal, FireRed and Emerald. Compare resulting money, coins, item quantity, seen state, HP/PP and conditional branches through the actual native save/bag/party backends.
  • Existing portable dialogue5268, script flags134 and native flag18348 checks remain passing.
  • Full ROM-free run: 84/94 engine, SDK3/3, B30 PASS. All 27 complete FAIL lines equal the fresh series baseline exactly, in order.
  • All-PR integration through Add prevalidated portable flag script commands #109 plus this commit (04ea058693a1801013343db1d09813eb2bc0e927): 89/99 engine, SDK3/3, B30 PASS; same exact baseline failures. All88 comparisons/176runs pass on that clean combined tree.
  • Changed modern Lua formatting and diff checks pass; the tiny native heal signature extension keeps surrounding formatting. Fixtures are synthetic and ROM-free, not a story/render playthrough. Effects before a later runtime failure are not rolled back.

Unchanged failing suites: gate_fingerprint, gate_meta_coverage, quit_thread_shutdown, rebind_capture_bug510, rebind_swap_clear_bug589, soft_reset_bug563, tool_mod_hooks, update_check_tests, update_tests, wide_battle_layout; full test entry remains nonzero.

Hosted CI

Published open/non-draft at the tested head. API 3 contracts and ci currently conclude action_required pending maintainer fork-workflow approval. Hosted CI is not green; validation above ran locally.

# Conflicts:
#	src/mods/Loader.lua
# Conflicts:
#	docs/modding.md
#	src/mods/Loader.lua
#	src/world/WorldAPI.lua
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant