Skip to content

Add a Skill Costs card to Database > Skills for Skills and States Core cost types - #82

Open
Xehanort88 wants to merge 3 commits into
Psychronic-Games:mainfrom
Xehanort88:pr/skill-costs-card
Open

Xehanort88 wants to merge 3 commits into
Psychronic-Games:mainfrom
Xehanort88:pr/skill-costs-card

Conversation

@Xehanort88

Copy link
Copy Markdown
Contributor

Problem

VisuStella Skills and States Core lets a project define skill cost types (HP, Gold, Potion, and any it adds) in its Skill Cost Types parameter. Only MP and TP have fields in Database › Skills; every other cost is typed into the Note by hand as <Gold Cost: 100>, skill by skill.

What this adds

A Skill Costs card on Database › Skills, after Invocation, in the manner of the Passive States card: it appears only when the project's js/reactor_plugins.js enables VisuMZ_1_SkillsStatesCore and that entry defines a cost type the card can read. Without the plugin there is no card and the page is unchanged.

  • One row per cost type: amount, a value / % choice where the type reads both, Maximum and Minimum.
  • MP and TP as a value are the Invocation fields themselves; as a percent they are the tag. A flat <MP Cost: n> in the Note is flagged, because the plugin copies it over the field when the database loads.
  • Item, weapon and armor costs are a list with Add and Delete, picked by record name (the plugin finds the record by name). A name no record has is flagged.
  • Nothing is stored but the notetag the plugin already reads, changed where it stands in the Note, with the Note's own line ends.

How the tags are found: each cost type's CalcJS is scanned for regex literals that start with <, they are compiled, and every tag the card could write is tried against them. A form is offered only when the type's own pattern reads the card's tag back with the number it was given, so the card never writes a tag the plugin would not read. A type whose patterns fit none of the known shapes is listed with a count of its tags and no fields.

Where

  • new editor/src/database/SkillCostsSection.js (RRSkillCosts): a pure half (classify, read, write) and createSection
  • editor/src/database/DatabaseSkillEditor.js: mounts the card after Invocation
  • editor/index.html: script tag
  • editor/src/I18nReviewedTranslations.js: 8 new phrases in all 17 locales
  • editor/CHANGELOG.md
  • new editor/tests/skill-costs-section.test.cjs: 14 tests

No runtime change.

Verification

  • tests/skill-costs-section.test.cjs: 14 pass. They load the real module and draw the real card against card-dom: discovery, classification, in-place edits with LF and CRLF notes, unit change, MP as field and as tag, item costs, and that showing the card or setting a field to the value it already shows writes nothing.
  • Full suite: the set of failing test names is the same before and after the change (compared by name, on a Windows checkout whose existing failures are environmental).
  • Driven in the running editor over CDP (SDK NW.js) at 1280x800, 2560x1392 and a 700px detail pane: opening skills and moving between them leaves getDirtyKeys() empty; edits land in the Note; typing in the Note updates the card; with the plugin disabled the card is absent.

Limits

  • The translations are a machine-assisted first pass and are marked so in the catalog.
  • The item picker is a plain select of record names; it has no search.
  • Per-item Max / Min tags, <JS … Cost> blocks and the battler-side cost tags (on actors, classes, equipment, states) are not edited. A JS block is flagged as present.
  • A cost type written in a shape the probes do not recognise gets a read-only row, not fields.
  • A change made from the card drops the Note textarea's own undo history, as the Passive States and Tactics cards do. Not measured, inferred from how the field is set.

🤖 Generated with Claude Code

Xehanort88 and others added 3 commits November 12, 2026 19:45
…e cost types

When the project's plugin list enables VisuMZ_1_SkillsStatesCore, the Skills
page lists the cost types its Skill Cost Types parameter defines and sets them
with fields: amount, a value / % choice where the type reads both, Maximum and
Minimum, and item costs as a list picked by name. Everything is stored as the
notetag the plugin already reads, changed where it stands in the Note. MP and
TP as a value are the Invocation fields themselves.

A form is offered only when the cost type's own pattern reads the card's tag
back, so a type written another way is listed with a count of its tags and no
fields. Opening a skill writes nothing, and without the plugin there is no card.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A line under the table, shown when MP or TP is among the cost types: their
value is the Invocation cost field itself, the same number in both places, and
a % is a notetag the plugin adds on top of that field.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…w pane

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.

1 participant