Skip to content

Enemy equipment, off by default - #80

Merged
Psychronic-Games merged 1 commit into
Psychronic-Games:mainfrom
Xehanort88:feat/enemy-equipment
Nov 10, 2026
Merged

Psychronic-Games merged 1 commit into
Psychronic-Games:mainfrom
Xehanort88:feat/enemy-equipment

Conversation

@Xehanort88

@Xehanort88 Xehanort88 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Enemies cannot have equipment. An author who wants an enemy's sword to give it stats and traits, set its attack animation, or be changed by a battle event has to fake each of those separately.

What changed

A new Reactor Feature, Enemy Equipment, off by default. With it off, the game and the Database behave as before and any entered data is kept.

  • Database › Enemies › Equipment... opens a window of ordered slots: add, repeat, reorder and remove equipment types, pick from a searchable list of the weapons and armors that fit, and see item details and parameter totals. OK/Cancel works on a draft.
  • The enemy's page shows read-only Equipment Bonus and Equipped Total beside Base, from the same calculation. The totals are labelled as leaving out plugin processing, JavaScript, battle states and random variance. No project code runs in the editor.
  • Runtime: Game_Enemy gains equipSlots, equips, weapons, armors and changeEquip. Equipment adds parameters and traits. Stat variance stays in paramBase, and Dual Wield does not rewrite slots. A change clamps HP and MP without healing or reviving.
  • Change Enemy Equipment (code 357, RPGReactor / ChangeEnemyEquipment) changes one troop member's slot and never touches the party's inventory. Invalid targets do nothing. On a troop page the dialog names the members and their slots.
  • Battle Presentation: cleared Weapon 1/2 fields ([0, 0]) no longer hide what the enemy holds; a non-zero authored weapon still overrides what is shown. The attack animation order is the authored animation, then the new Game_Enemy.rrWeaponAnimationId, then the existing fallback. Equipped weapons reach weapon-bound sequences, held models and Map Battle reach, as authored weapons already do.
  • Referenced by lists equipped items. New strings are in all 17 locales as a machine-assisted first pass and would benefit from review.

Data

Optional enemy.rrEquipment: an ordered list of { etypeId, kind, itemId }, with kind using the drop-item numbering (2 weapon, 3 armor, 0 empty). No migration. An enemy with no slots carries no field. In the game, each enemy holds a plain copy tagged with its enemy id, so:

  • a change stays on that enemy and survives a Map Battle save;
  • a Transform to another enemy reads that enemy's rows, and a Transform to the same id keeps the loadout;
  • an enemy from an older save reads its rows on first use.

Verification

  • Automated: new enemy-equipment.test.cjs runs on the shipped objects. The whole suite was names-diffed against a clean main on the same machine: 70 failing names before and after, the same set once the new files were tracked. Those are this Windows machine's environmental failures, plus timing-sensitive tests. After that run, one escaping helper in the new window was swapped to rrEscapeHtml; only the affected test files were re-run (92 of 92 passed).

  • Editor, driven over CDP at 1280×800 and fullscreen: feature off and on, picking by mouse and keyboard, search, repeat, reorder, remove, add, Cancel, OK with and without changes, missing-item warnings, live totals, and a command round trip. 36 of 36 checks passed.

  • Live, in NW.js with this runtime: a large project's real plugin set in a battle test, plus a zero-plugin boot. Run for feature on and feature off. This exercised the object layer against live battlers; a full attack animation was not watched on screen.

  • Rebase: the runs above were made on a tree that also held two unrelated local commits. The branch was then rebased onto upstream/main, where it contains only this change; the affected test files were re-run there (93 of 93 passed). The whole suite and the live runs were not repeated after the rebase. The runtime revision here was already ahead of upstream's, so it jumps from 20261101.41 to 20261108.4.

Limits

  • A plugin that changes an enemy's attack animation with a tag needs to override rrWeaponAnimationId. Without that, an equipped weapon's animation outranks such a tag, only on enemies an author has equipped.
  • Equipment creates no loot, has no durability or player-facing inspection, and no equipment artwork. A conventional mid-battle save is not a feature of the engine, so only Map Battle saves apply.

🤖 Generated with Claude Code

Enemies had no equipment: a weapon or armor could not give one stats or
traits, and nothing in a battle could change what it carried.

Database > Reactor Features gains Enemy Equipment, off by default. With it on,
Equipment... on an enemy opens a window of ordered slots with a matching-item
picker, item details and parameter totals, and the enemy's page shows read-only
Equipment Bonus and Equipped Total columns from the same calculation. Rows are
stored as an optional rrEquipment list of { etypeId, kind, itemId }.

In the game each enemy keeps a plain copy of its rows tagged with its enemy id,
so a change stays on that enemy, survives a Map Battle save, and a Transform to
another enemy reads that enemy's rows. Equipment adds parameters and traits; a
change clamps HP and MP without healing or reviving. Change Enemy Equipment
(code 357) changes one troop member's slot without touching the party's
inventory.

Battle Presentation: cleared Weapon 1/2 fields ([0, 0]) no longer hide what the
enemy holds, and the weapon's attack animation goes through a new
Game_Enemy.rrWeaponAnimationId so a plugin can replace it.

Tests: enemy-equipment.test.cjs, on the shipped objects. Names-diff of the whole
suite against a clean main: the same failures, nothing new.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Xehanort88
Xehanort88 force-pushed the feat/enemy-equipment branch from 6e8b7a2 to b1299d4 Compare November 8, 2026 23:33
@Psychronic-Games

Copy link
Copy Markdown
Owner

Oh Hell yeah I was going to get to this eventually but you got ahead of me on it, Will merge!

@Psychronic-Games
Psychronic-Games merged commit e7dcc63 into Psychronic-Games:main Nov 10, 2026
3 of 10 checks passed
Psychronic-Games added a commit that referenced this pull request Nov 12, 2026
…y Equipment

Runtime 20261110.13, synced into the bundled projects.

Audit of 2026-11-10: twenty-one read-only reviews of the runtime, the online
server, the editor, the Forge and the importers. Over eighty findings fixed,
each re-read in the code first; the rest, with the parts not read in full and
six decisions for the owner, are in docs/AUDIT-2026-11-10.md. Among the fixes:

- A draw batch left for a later frame after a context restore was drawn with
  its arrays gone; grass drawn twice after a border crossing; ground picking
  that ignored shaped terrain.
- A join line that stopped a battle host's game, a guest believing any
  sender, and a change that ended the server's Engine for everyone.
- Removed or signed in elsewhere now stands until a game is started again.
- Saves no longer carry the common-event database.
- White patches on clothing at standard quality, and the in-game creator
  showing another outfit than the one picked.
- Hover explanations, the text-code menu and the Plugin Manager's list
  editor in pop-out windows.
- Builds leave out .git and other version-control and IDE folders.
- Importers: weapon and armor drops, HP and SP conditions, ally state
  skills, XP button input.

The server's PHP and Engine changes of 11-06 and 11-07 were deployed and
tested on demo.rpgreactor.org for the first time, with today's.

Runtime .12 answers a crash found in play on .11: PIXI's sprite update met a
sprite no batch held. Such a sprite is now passed over and the draw list
built again, and the Tilemap's visible setter marks the list on every write
as before.

Enemy Equipment (pull request #80, Xehanort88) is applied here as its patch,
ahead of the merge of origin/main that records it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Psychronic-Games added a commit that referenced this pull request Nov 12, 2026
The pull request's changes were already applied in the commit before this
one, so the merge changes no file. Conflicts in the runtime revision stamp
(runtime/reactor_main.js and the Demo's copy) and in the appended
translations were resolved to the local side, which holds both; the editor
changelog index stays as it was, with the pull request's line in the 0.99.5
changelogs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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