Skip to content

Apply review fixes and replace CoX spell toggles with a dropdown#13

Open
mcscoobe wants to merge 6 commits into
masterfrom
review-refactor
Open

Apply review fixes and replace CoX spell toggles with a dropdown#13
mcscoobe wants to merge 6 commits into
masterfrom
review-refactor

Conversation

@mcscoobe

@mcscoobe mcscoobe commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Applies the outstanding review fixes and refactors the Chambers of Xeric spellbook handling.

Validation logic

  • Generalize the Kodai-only infinite-rune handling into a single INFINITE_RUNE_SOURCES mechanism covering elemental staves, combination staves, and the charged Tome of Fire/Water; scans inventory + worn equipment (Conventions performance review #4)
  • Remove the Twinflame staff from the infinite-rune sources: its rune behavior is a special-attack mechanic that does not fit the "carrying the item grants unlimited rune X" model
  • Replace the EQUIPMENT_CONTAINER_ID literal (94) with InventoryID.WORN (Close: #6 #9)

Chambers of Xeric spellbook requirement (config change)

  • Replace the four CoX spell checkboxes (coxRequireSpell/coxRequireDeathCharge/coxRequireHumidify/coxRequireVengeance) with a single mutually-exclusive CoxSpellRequirement dropdown.
  • Thralls/Death Charge (Arceuus) and Humidify/Vengeance (Lunar) live on different spellbooks, so requiring both is unsatisfiable. Modelling the choice as one value makes the conflict impossible to express, which also removes the stale-checkbox lag — RuneLite's config panel does not refresh on programmatic config changes.
  • Removes the runtime conflict-resolution handler and the ConfigManager dependency it needed.
  • No legacy migration: the new coxSpellRequirement key is distinct from the old boolean keys, so existing CoX spell settings reset to None after this update.

Config / docs

  • Correct Thralls cost descriptions (10 Fire, 5 Blood, 1 Cosmic; Aether substitution) and Blood Barrage (4 Death runes, was "1 Death rune") (Add inferno + readme cleanup #5)
  • Mention staves/tomes in the Ice Barrage, Humidify, and Thralls descriptions
  • Fix hasResurrectGreaterGhostRunes Javadoc (5 Blood runes, was "2") (New spell #6)
  • Drop the inaccurate "(Thralls or Death Charge)" parenthetical from the no-requirements warning, which fires for all five locations

Plugin behavior

Line endings

  • Add *.bat text eol=crlf to .gitattributes and renormalize gradlew.bat. The committed blob held CRLF while * text eol=lf mandated LF, leaving the file perpetually "modified" (CLOSE #6 #8)

Tests

  • Property tests for infinite-rune sources (staves, charged vs uncharged tomes, equipped sources, non-elemental exclusion)
  • New CoxSpellRequirementTest, including the invariant that no enum value requires both spellbooks
  • Enum-driven CoX validation tests (Arceuus combo, missing-spellbook failure, Lunar path, NONE path)

mcscoobe added 6 commits June 13, 2026 17:08
Address review items #4-6, #9-11 and resolve the perpetual gradlew.bat
"modified" state.

Validation logic:
- Generalize Kodai-only infinite-rune handling into a single
  INFINITE_RUNE_SOURCES mechanism covering elemental staves, combination
  staves, and charged Tome of Fire/Water; scans inventory + worn equipment
  (#4)
- Replace EQUIPMENT_CONTAINER_ID literal (94) with InventoryID.WORN (#9)

Config / docs:
- Correct Thralls cost descriptions (10 Fire, 5 Blood, 1 Cosmic; Aether
  substitution) and Blood Barrage (4 Death runes, was "1 Death rune") (#5)
- Mention staves/tomes in Ice Barrage, Humidify, and Thralls descriptions
- Fix hasResurrectGreaterGhostRunes Javadoc (5 Blood runes, was "2") (#6)

Plugin behavior:
- Block unsatisfiable dual-spellbook CoX config by reverting the second
  conflicting toggle to off and posting feedback, instead of warn-only (#11)
- Close first-tick menu-protection gap by validating on demand in
  onMenuEntryAdded when no cached result exists (#10)

Line endings:
- Add "*.bat text eol=crlf" to .gitattributes so batch files are legitimately
  CRLF, and renormalize gradlew.bat. The committed blob previously held CRLF
  while "* text eol=lf" mandated LF, leaving the file eternally "modified" (#8)

Tests:
- Add 6 property tests for infinite-rune sources (staves, charged vs uncharged
  tomes, equipped sources, non-elemental exclusion)
- Rework CoX conflict tests to drive onConfigChanged and assert the toggle is
  reverted via ConfigManager
Follow-up to the review of PR #13.

Code-quality fixes:
- Remove stale @SuppressWarnings("unused") on the now-used configManager field
- Add AccessDeniedConfig.CONFIG_GROUP constant and route the @ConfigGroup
  annotation and both plugin call sites through it, removing the three
  duplicated "accessdenied" literals
- Replace every raw rune/item literal in PlayerStateValidator with
  net.runelite.api.gameval.ItemID constants (FIRERUNE, WATERRUNE, ...,
  BOOK_OF_THE_DEAD) across the infinite-source map and all per-spell
  requirement maps, keeping the two provably consistent
- Add Twinflame staff to the infinite rune sources (covers fire + water)
- Switch the six parameterless infinite-rune tests from @Property to @example

New tests (108 total, up from 95):
- Blood Barrage runes: pass/fail/Aether, including a 3-Death-rune regression
  guard locking the 1 -> 4 Death requirement
- onMenuEntryAdded first-tick on-demand validation: reorders when invalid,
  not when valid, skipped during an active CoX raid
- Rune pouch: runes count toward requirements, are ignored when no pouch item
  is present (stale-varbit guard), and all four pouch variants are recognized
- Spellbook discrimination across varbit 0-3
- Chug Jug / Saturated Heart presence checks
- Uncharged Tome of Fire negative (symmetry with the Tome of Water case)
The Twinflame staff is a special-attack weapon whose rune behavior does not map cleanly to the "carrying this item grants an unlimited supply of rune X" model used here, and it was the only entry with no test coverage. Removing it avoids wrongly suppressing fire/water requirements for Ice Barrage, Humidify, and Thralls.
Enabling a CoX spell from one spellbook now switches off any enabled spells from the other spellbook, keeping the just-enabled toggle, instead of reverting the new toggle. The feedback message names the spells that were disabled.

Also clarify the on-demand validation path in onMenuEntryAdded and name the affected toggle in conflict messaging.

Fixes #14
Modelling the Chambers of Xeric spell requirement as a single CoxSpellRequirement enum (rendered as a dropdown) makes the Arceuus/Lunar cross-spellbook conflict impossible to express. This removes the runtime conflict-resolution code and the stale-checkbox lag it caused, since RuneLite's config panel does not refresh on programmatic config changes.

Validation now maps the enum to the required spells; the old four boolean toggles, the conflict handler, and the ConfigManager dependency are removed. Adds a CoxSpellRequirement enum test (including the no-value-requires-both-spellbooks invariant) and enum-driven validation tests.
The warning fired for all five locations but named 'Thralls or Death Charge', which is wrong for Inferno (Ice/Blood Barrage) and for the CoX dropdown. Use a location-agnostic message.
@mcscoobe mcscoobe changed the title Apply review fixes and fix gradlew.bat line-ending churn Apply review fixes and replace CoX spell toggles with a dropdown Jun 14, 2026
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