Repository navigation
Conversation
# Conflicts: # src/mods/Loader.lua
# Conflicts: # docs/modding.md # src/mods/Loader.lua # src/world/WorldAPI.lua
This was referenced Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mods currently need private held-item readers to suppress or substitute effects. Add the native
held_item.trigger(next, ctx)producer for Gen2/3 hosts, using the sharedHELD_*names and public byte-odds contract. GB/DS report unavailable.The context carries the actual opaque battle, holder Pokemon, item/definition, effect, parameter and comparison reason. API 3 normalizes item/Pokemon identities. Constructors, external/link battlers, replacements and side synchronization bind the correct controller. Native code continues to own rolls, HP, messages, consumption and queues. No subscriber means no hook dispatch or context construction; error recovery and two-result API-3 replay are retained.
Wire actual priority, damage/crit/type/stat, accuracy, endurance, flinch, confusion, cure, PP and residual reads, plus GBA Macho Brace, Shell Bell, escape and entry prize/White Herb paths. Preserve the reference's scalar definition transactions: Gold edits persist on the live item definition; GBA edits remain temporary. Invalid transactional metadata edits cannot partially commit Pokemon changes.
Native integration tests also exposed and fix Gold's disconnected Focus Band damage path (including 1 HP), Gold Berry's strict-below-half threshold and GBA's nominal-100% accuracy shortcut bypassing item penalties. Source-catalog scanning now tolerates multiline calls so formatting cannot hide the producer.
Dependency and remaining native gap
Stacked on #164 and its prerequisites. The incremental change is 1ce83fa; compare against #164.
This establishes the read/steering contract and the tested native consumers, not universal mod or complete battle equivalence. The source GBA residual scheduler performs extra after-action item scans: a hook granting a 7-HP Berry even to empty hands heals 35 HP in the reference versus 7 in the host. The checker records that raw
native_policy, prints the gap and excludes it from equal observations.--require-native-schedule-paritydeliberately rejects it. The unchanged public consumer defaults to requiring an actual item, so consumption ends its override. Full GBA scheduling, Choice Band locking and other native rules remain separate work.Includes docs, public consumer, shared/native suites, imported-data driver and a pinned CI workflow. No ROM, generated cartridge cache, save or private mod is distributed.
Validation
At feature ref
1ce83faf4b980584be9d747eee82efc530ede09f:79ea62f45fb2ea8f65d081a109431e4eb1bbdb36. Uses native readers, actual moves/order/entry/escape and registered residual handlers; all 66 GBA enums round-trip through the real item-data fallback reader. Raw scheduling differences are recorded separately.Combined testfork runtime
3d6bfceeaf25b97d7a7ce708ada8fe3306e0357d:All 26 hosted PR workflows report
action_requiredpending maintainer approval. The new held-item workflow has zero jobs and has not executed. Local results above are separate.