Skip to content

Game_Enemy: rrActionPatterns and rrEquipSource for plugins (runtime 20261112.1) - #81

Merged
Psychronic-Games merged 1 commit into
Psychronic-Games:mainfrom
Xehanort88:feat/enemy-action-equip-seams
Nov 12, 2026
Merged

Psychronic-Games merged 1 commit into
Psychronic-Games:mainfrom
Xehanort88:feat/enemy-action-equip-seams

Conversation

@Xehanort88

@Xehanort88 Xehanort88 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A plugin that gives an enemy other skills or other gear has nothing to replace.

  • Action patterns are read straight from the database entry in five places: 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 swap enemy().actions on 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.
  • Enemy equipment (Enemy equipment, off by default #80) reads an enemy's authored rows and caches them in one method, rrEquipRows. A plugin that wants to equip an enemy from somewhere else has to wrap that method and rebuild the cached _rrEquips record 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 to enemy().actions for a battler that does not have the method.
  • rrEquipSource() returns the rows an enemy's equipment is first read from. rrEquipRows copies 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/js is synced with sync-runtime.cjs.

Verification

  • Two new tests in editor/tests/enemy-equipment.test.cjs, run on the shipped objects. One asserts that no runtime/reactor_*.js file reads enemy().actions beyond the stage's fallback.
  • The whole editor suite was run on this branch and on main at 0.99.5, and the failing test names compared. One name differed each way, both unrelated to this change: a timer test in memory-budget.test.cjs failed only in the run with the change and passed three times in a row when run alone, and a character-builder test failed only on main.
  • In a real game with a plugin that overrides both methods: a battle test under the turn-based mode ran several turns with no errors, and Game_Fight.prototype.chooseAction called on a live enemy picked the skills the plugin supplied.

Limits

  • The Tactical driver's two readers are covered by the source assertion only. No Tactical battle was played.
  • chooseAction was called directly on a live enemy; no Action-mode battle was played end to end.
  • No editor change, so nothing here was checked on screen in the editor.
  • The real-game run was made before the rebase, on the 0.99.4 runtime with the same two methods. After the rebase only the tests were run.

🤖 Generated with Claude Code

…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
Xehanort88 force-pushed the feat/enemy-action-equip-seams branch from 963dcad to 1666a46 Compare November 12, 2026 08:20
@Xehanort88 Xehanort88 changed the title Game_Enemy: rrActionPatterns and rrEquipSource for plugins (runtime 20261111.1) Game_Enemy: rrActionPatterns and rrEquipSource for plugins (runtime 20261112.1) Nov 12, 2026
@Psychronic-Games
Psychronic-Games merged commit bcde5ba into Psychronic-Games:main Nov 12, 2026
4 of 10 checks passed
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.

2 participants