Repository navigation
Game_Enemy: rrActionPatterns and rrEquipSource for plugins (runtime 20261112.1) - #81
Merged
Psychronic-Games merged 1 commit intoNov 12, 2026
Conversation
…0261112.1) A plugin that gives an enemy other skills or other gear had nothing to replace. The action patterns were read straight from the database entry in five places, so the only way to reach all of them was to swap the entry's list for the length of a call, and the Action and Tactical battle modes still missed it. An enemy's first equipment rows were read and cached in one method, so supplying rows from elsewhere meant rebuilding the cache by hand. Game_Enemy.rrActionPatterns() returns the patterns an enemy chooses from. makeActions, Game_Fight.chooseAction, the stage's skill preload and the two Tactical readers go through it. Game_Enemy.rrEquipSource() returns the rows rrEquipRows copies the first time an enemy's equipment is read. Both return the database lists by default, so a project without such a plugin plays as before. Tests: two more in enemy-equipment.test.cjs, on the shipped objects, one of which asserts no runtime file reads enemy().actions beyond the stage's fallback. Names-diff of the whole suite against the same tree without the change: nothing new fails. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Xehanort88
force-pushed
the
feat/enemy-action-equip-seams
branch
from
November 12, 2026 08:20
963dcad to
1666a46
Compare
Psychronic-Games
merged commit Nov 12, 2026
bcde5ba
into
Psychronic-Games:main
4 of 10 checks passed
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.
Problem
A plugin that gives an enemy other skills or other gear has nothing to replace.
Game_Enemy.makeActions,Game_Fight.chooseAction, the stage's skill preload, and two readers in the Tactical driver. The only way for a plugin to reach them is to swapenemy().actionson the database entry for the length of a call, and that still misses the Action and Tactical battle modes, which read the list outside any method a plugin can wrap.rrEquipRows. A plugin that wants to equip an enemy from somewhere else has to wrap that method and rebuild the cached_rrEquipsrecord by hand.Change
Two methods on
Game_Enemy, both returning the database lists by default, so a project without such a plugin plays as before.rrActionPatterns()returns the action patterns an enemy chooses from. All five readers go through it. The stage's preload keeps a fallback toenemy().actionsfor a battler that does not have the method.rrEquipSource()returns the rows an enemy's equipment is first read from.rrEquipRowscopies what it returns, so the returned list is never changed, and a method that returns no list means no equipment. It is not read while the feature is off. The default slots 0.99.5 gives a never-edited enemy (one empty slot per equipment type) are built in this method.Runtime revision 20261112.1, rebased onto 0.99.5.
template/Demo/jsis synced withsync-runtime.cjs.Verification
editor/tests/enemy-equipment.test.cjs, run on the shipped objects. One asserts that noruntime/reactor_*.jsfile readsenemy().actionsbeyond the stage's fallback.mainat 0.99.5, and the failing test names compared. One name differed each way, both unrelated to this change: a timer test inmemory-budget.test.cjsfailed only in the run with the change and passed three times in a row when run alone, and a character-builder test failed only onmain.Game_Fight.prototype.chooseActioncalled on a live enemy picked the skills the plugin supplied.Limits
chooseActionwas called directly on a live enemy; no Action-mode battle was played end to end.🤖 Generated with Claude Code