Skip to content

Barrows: align tunnel doors, brothers, loot, elite clue and Combat Achievements with live - #6623

Merged
UnhealthyKraken merged 4 commits into
RSPSApp:mainfrom
Bandit-HaxUnit:fix/4407-barrows-alignment
Nov 23, 2026
Merged

UnhealthyKraken merged 4 commits into
RSPSApp:mainfrom
Bandit-HaxUnit:fix/4407-barrows-alignment

Conversation

@Bandit-HaxUnit

@Bandit-HaxUnit Bandit-HaxUnit commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #4407

Problem

Barrows reports from #4407 and its follow-up comments, checked against current main and the rsprox captures:

# Server (main) Live
Doors The crossing waits 3 ticks and spawns its monster only if the player is still on the arrival tile; the leaves are removed; a click within the 3 ticks is ignored One walk step; each leaf turns into an invisible wall plus an open leaf, with sounds 62 and 41; the monster appears on the crossing tick; the leaves are back after 2 ticks; the player is never held
Diagonal A click from beside the other leaf does nothing Crosses diagonally to the tile beyond the clicked leaf (227/1000436 tick 10239)
Puzzle door No line; a solve crosses straight away "The door is locked with a strange puzzle." (spam); a solve sends "You hear the doors' locking mechanism grind open." with sound 37, and the next click crosses
Door brothers Say "You dare disturb my rest!" Say nothing
Chase Brothers walk home through the open-world aggression leash They follow through the tunnels and are deleted once the player is more than 8 tiles from where they rose
Takeover A creature attacking in single-way combat blocks the brother, which never retries The creature stops when the brother appears and resumes once he is dead
"We'll finish this later..." Never sent Sent when the player leaves a crypt fight for the tunnels or another crypt, and on death
Elite clue Always a clue scroll, ignoring capacity Goes through Treasure Trails: a scroll box after X Marks the Spot, none when full
Can't Touch Me String(CombatType) === "MELEE" never matched (numeric enum), so it was awarded whenever the four melee brothers died Fails on a melee brother's melee swing, hit or miss, with its failure line

Items 2 (shake) and 3 (prayer drain restart) of the issue were already fixed on main (#4203).

Fix

server/plugins/minigames/Barrows.plugin.js:

  • crossDoor, useDoor, endCrossing and shutDoor:
    • Leaf swap: an inviswall on the leaf's own shape and rotation, plus the open leaf on the wall's outer tile, turned 3 quarters (left leaf) or 1 quarter (right leaf).
    • The open sounds, then a one-step walk.
    • The crossing monster spawns on the same call.
    • The leaves are restored after 2 ticks.
    • The doorway's clipping is ignored only until the player leaves the start tile.
    • A new crossing first closes any pending one, so no click is ever ignored. A repeat click on the same doorway before the step is still one crossing with one monster.
    • Either leaf's side counts as the start, which allows the diagonal step.
  • spawnEncounter takes the arrival tile, and its skeleton is armed (1687) or unarmed (1685).
  • Puzzle door: the lock spam line, and a solve's "grind open" message with sound 37 instead of crossing.
  • spawnNpc(…, line): the overhead line comes only from the crypt search or the chest. Brothers get combat:no-retreat and combat:keep-target.
  • takeOver: owned creatures targeting the player reset, and clearAttackerIf releases the single-way hold. Each such creature resumes once no live brother is left.
  • leashBrother: the over-8-tiles despawn (face reset, then removal); otherwise the brother re-attacks if a single-way refusal left him without a target.
  • queueFarewell: the "We'll finish this later..." timing.
  • searchChest: the loot still re-rolls the layout (the Wiki's shift). eliteClueForm routes the clue through treasure-trails:can-receive and treasure-trails:clue-item.
  • processPlayer: the post-loot collapse damage (1-4 every 10 ticks) is kept, moved into collapse() on api.core.HitDamage/HitMask.
  • Combat Achievements:
    • trackBrotherAttack (onCombatHitPrepare, the swing tick) checks api.core.CombatType.MELEE.
    • trackBrotherHit and checkFaithless handle the other two run tasks.
    • All three emit combat-achievements:failed with the recorded reason.

docs/barrows-tunnels.md: the capture facts above, with ticks.

docs/progress/osrs-progress.json: Barrows' stale maze steps are corrected, with a dated note.

Testing

  • server/tests/barrows-run.test.cjs has 10 new tests:
    • the crossing's swap, sounds, same-tick spawn and 2-tick restore, with no hold, and one monster on a repeat click;
    • the diagonal crossing;
    • the puzzle lines and sound, and that a solve doesn't cross;
    • a door brother's silence;
    • the leash;
    • the farewell after entering the tunnels and on death;
    • takeover and resume;
    • the layout shift and collapse damage after the loot, and none once out of the tunnels (Wiki);
    • the clue's form and capacity;
    • Can't Touch Me and Pray for Success failures.
  • Revert check: main's plugin, with only the test exports added, fails all 10 for behavioural reasons.
  • barrows-run: 34/34 in 6 consecutive runs after the review fixes (the puzzle test picks its side by room, no longer by distance).
  • Neighbours: barrows-run, barrows-tunnel-prompt, barrows-death-durability, barrows-drop-degrade, his-faithful-servants-capture, collection-log, league-passives, qh728-q130, combat-achievements: 169 tests, 169 pass.
  • In game, on the worktree's agent MCP:
    • Doors cross in one click, including while fighting, and the step comes the tick after arrival.
    • A brother raised at the chest made three attacking creatures drop the player on his tick, and he attacked 2 ticks later.
    • After the loot there was no damage over 30 ticks and the door varbits were unchanged; the next door raised Torag.
    • Torag was gone once the player was 12 tiles from where he rose, with no line.
    • A death mid-fight sent "We'll finish this later...".

Not covered

  • Recorded difference, where the server follows the Wiki: the Wiki says the looted tunnels "start to collapse, causing occasional damage to the player, and the arrangement of the doors and rooms will shift". 37 captured loots show neither: no damage (one player stayed 135 ticks) and no door varbit change before leaving. The 1-4 damage every 10 ticks is Ours; the Wiki gives no numbers.
  • Ours:
    • The crossing monster becomes visible 1 tick after the step (the world add queue); live shows both on the same tick.
    • The two skeletons' odds are even.
    • No farewell line on a tunnel leash: 227/1000433 has it, 227/00086 twice doesn't.
    • The death farewell is sent on the death's tick (live: a tick later).
    • Faithless Crypt Run fails once per brother; Pray for Success and Can't Touch Me once per run.
  • Not reproduced: the reported two-click door didn't reproduce in game on the new code, idle or mid-fight. The old 3-tick crossing lock silently ignored clicks, which matches the report.
  • Not addressed: the rare live tick where both a creature and a brother hit the player (237/04057 tick 8841).

Self-reviewed with the review checklist at 382d685; its non-blocking findings (a repeat click's second monster, puzzle sound 37, the progress note's item) are fixed in 28dc19a. The review at 28dc19a asked for the Wiki on the post-loot collapse and shift, and found a flaky puzzle test; both are fixed in b06add7.

Reference

🤖 Generated with Claude Code

Bandit-HaxUnit and others added 3 commits November 23, 2026 11:56
…th live (RSPSApp#4407)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…PSApp#4407

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd 37, progress note on the Barrows item

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Bandit-HaxUnit
Bandit-HaxUnit marked this pull request as ready for review November 23, 2026 11:20
@UnhealthyKraken
UnhealthyKraken self-requested a review November 23, 2026 18:09
@UnhealthyKraken

Copy link
Copy Markdown
Collaborator

Reviewing this now (review loop, head 28dc19a).

@UnhealthyKraken UnhealthyKraken left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed PR #6623 at 28dc19a (main e7ec324, integration tree 5e6dac30ea1ca654dc31a167e827e572a6142cd8).

What it does

Aligns Barrows (issue #4407) with the recordings: one-click tunnel doors with the recorded leaf swap and sounds, the crossing monster raised on the crossing tick, a puzzle-door lock line and unlock step, silent door brothers, a brother leash, takeover of a crypt monster's fight, the "We'll finish this later..." line, an elite clue that goes through Treasure Trails, and Combat Achievement failure lines.
It also removes the post-loot collapse damage and the post-loot door re-randomisation.

What was checked

  • Behaviour: door crossing, puzzle, leash, takeover, farewell, chest loot, elite clue and the three Combat Achievements, traced through crossDoor/useDoor/processPlayer/leashBrother/searchChest/eliteClueForm. No coins or items are given twice. The elite clue is converted on a fresh Item, and treasure-trails:can-receive and clue-item are answered by plugins/treasuretrails/Capacity.ClueCapacity.js. The flags combat:no-retreat and combat:keep-target exist in Combat.ts.
  • Parity (recordings, all opened):
    • rsprox_transcripts/227/910469.txt (227/1000436) tick 10239: swap with 38848/20678/20697 and sounds 62, 41, a same-tick Skeleton 1685 add, and the diagonal step to (3551,9683). The leaf rotations and outer tiles match openLeaf (also 226/01694 tick 9139).
    • rsprox_transcripts/236/03929.txt: "The door is locked with a strange puzzle." is spam at tick 415; "You hear the doors' locking mechanism grind open." is gamemessage at tick 417 with sound 37; the click that crosses is at 418.
    • rsprox_transcripts/227/00550.txt: the three failure lines at ticks 28263, 28886 and 29246 match the PR text, and the Can't Touch Me line comes on the swing tick for a 0 hit.
    • The farewell exists in 227/910598, 227/910298 and 227/910466 (one tick after the leash despawn at tick 17111).
    • 226/01694 tick 9139 and 227/00086 tick 12490: a door Torag with no [say].
  • Parity (Wiki): Can't Touch Me and Scroll box (elite) agree with the PR (boxes replace clues after X Marks the Spot, one per tier, capacity). The Barrows/Strategies page says the looted tunnels "shake and start to collapse, causing occasional damage to the player" and "the arrangement of the doors and rooms will shift". The PR removes both (finding 1).
  • Traced: spawnEncounter odds are unchanged (12/128 brother, 52 skeleton, 32 bloodworm, 32 rat), and the two skeleton ids are 1685/1687 in NpcIdentifiers.ts. rollRewards is untouched: the elite clue is still 1/200 per roll, at most one per chest (Wiki: 1/200 per roll, up to 1/29). The combat-achievements:failed handler, onCombatHitPrepare (the event carries combatType) and the answerPuzzle handler were also traced.
  • Rules: no generated JSON edited. docs/progress/osrs-progress.json is hand-written and passes check-content-progress.mjs; the new note line is indented two spaces differently from its neighbours (cosmetic). No plugin description or config change, so no world-config-docs row is needed.

Findings

  1. server/plugins/minigames/Barrows.plugin.js (searchChest: the removed randomiseLayout(run); syncTunnels(player, run); processPlayer: the removed collapse HitDamage) plus docs/barrows-tunnels.md "Chest" and the progress note — the PR deletes the post-loot collapse damage and the door/room shift because 37 recordings show neither. The Wiki (Barrows/Strategies) states both, and where the Wiki and a recording disagree the Wiki wins (sources.md). The PR's own "Not covered" calls this a recorded difference, so it knowingly follows the recordings.
    Fix: keep the previous looted-tunnel behaviour (damage every 10 ticks, layout re-randomised after the loot), say in docs/barrows-tunnels.md that recordings show neither, and drop the matching sentences, the test "looting leaves the doors as they were and hurts nobody" and the progress-note wording. If the maintainer wants the recordings to win here, that is his call and this finding goes away.
  2. server/tests/barrows-run.test.cjs:804-824 (new puzzle test) — flaky: about 1 run in 4 (when the random puzzle door is varbit 473, sides (3551,9700)/(3551,9701)) the "outside" side is picked with getDistance(chest) > 6, finds neither (distances 5 and 6), falls back to sides[0] which is inside room 4, so useDoor never raises the puzzle and assert.ok(subject.sent.spam.includes(...)) fails at line 817. Seen in 6 of 8 runs of the file; no other test ever failed.
    Fix: choose the side whose roomAt is not 4 instead of the distance test. Repro: node --test tests/barrows-run.test.cjs repeatedly, from server/.

Scope

ordinary

Verified

  • Build (yarn build, Yarn 4.12.0, server/) on the integration commit: ok.
  • barrows-run.test.cjs: 34 tests; 34/34 in 2 of 8 runs, 33/34 in the other 6, always the puzzle test of finding 2.
  • Neighbours, each on its own: barrows-tunnel-prompt 2/2, barrows-death-durability 12/12, barrows-drop-degrade 6/6, his-faithful-servants-capture 8/8, collection-log 34/34, league-passives 21/21, qh728-q130 21/21, combat-achievements 31/31, clue-capacity 40/40, treasure-trails-elite 16/16.
  • Revert check: main's plugin with only the test exports added (the three new exports stubbed) fails the PR's 10 new tests and leaves the other 24 passing.
  • scripts/check-content-progress.mjs: valid (20 categories, 520 items).
  • docs: yarn install --frozen-lockfile and yarn build with Yarn 1.22.22: build complete. docs/barrows-tunnels.md is not linked from any docs index (nothing links its sibling barrows-prayer.md either).
  • main+head merge tree: clean (integration commit built).
  • generated JSON: none edited.

Not verified

  • The "37 loots show no damage or door change" count: not recounted. Finding 1 does not depend on it.
  • Live game: not run. The in-game MCP claims in the PR body are the author's.
  • Leash tick details (227/00086 ticks 12498-12509, 227/910466 ticks 17109-17110) and 237/04057 tick 8841 were not opened.
  • The "sneaking suspicion" clue warning is not sent when the chest's elite clue is dropped for a full player (other sources send treasure-trails:missed-clue). No Wiki text or recording settles it for the chest, so this is a note, not a finding.
  • Faithless Crypt Run fails once per brother in the code; three failure lines appear in 227/00550, which looks consistent, but I did not match them tick by tick.

Verdict

Await author (1, 2)

…fix the flaky puzzle test

The review asks for the Wiki (Barrows/Strategies) over the 37 recorded loots, which stay
documented as the recorded difference. The puzzle test now picks a side outside the chest room by
room, not distance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Bandit-HaxUnit

Copy link
Copy Markdown
Collaborator Author

Addressed in b06add7:

  1. Post-loot collapse and shift: restored per the Wiki (Barrows/Strategies). Looting re-rolls the layout and syncs it again, and the looted tunnels hit for 1-4 every 10 ticks until left (collapse(), now on api.core.HitDamage/HitMask; the numbers are Ours, the Wiki gives none). The 37 recorded loots stay in docs/barrows-tunnels.md and the PR body as the recorded difference. The test is now "looting shifts the doors and rooms, and the collapsing tunnels hurt until left (Wiki)", and it fails against 28dc19a's plugin. The progress note's wording was updated, and its indentation now matches its neighbours.
  2. Flaky puzzle test: it now picks a puzzle-door side whose roomAt isn't 4 (roomAt added to _test), instead of the distance test that missed varbit 473's doorway. barrows-run passed 34/34 in 6 consecutive runs; the neighbours passed 114/114.

@UnhealthyKraken
UnhealthyKraken self-requested a review November 23, 2026 21:17
@UnhealthyKraken

Copy link
Copy Markdown
Collaborator

Reviewing this now (review loop, head b06add7).

@UnhealthyKraken
UnhealthyKraken dismissed their stale review November 23, 2026 21:22

Both findings are fixed at b06add7 (see the new review).

@UnhealthyKraken UnhealthyKraken left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed PR #6623 at b06add7 (main 093d8ab, integration tree b98de18a811379351cbc47ffaa8266ae6b661f58).
Prior review: #6623 (review) on 28dc19a

Prior findings

  1. Looted-tunnel collapse damage and door shift removed against the Wiki: resolved. searchChest calls randomiseLayout(run); syncTunnels(player, run) again after the loot, and processPlayer calls the new collapse() (1-4 damage every 10 ticks, phase === "tunnels", run.looted, hitpoints above 0). Both match main's behaviour before this PR. docs/barrows-tunnels.md, the code comment and the progress note now state the Wiki text and keep the recordings as the recorded difference.
  2. Flaky puzzle test: resolved. The test now picks a door side with roomAt(side) !== 4 (roomAt added to _test). 20 of 20 consecutive runs of barrows-run.test.cjs passed (34/34 each).

What it does

Aligns Barrows (issue #4407) with the recordings: one-click tunnel doors with the recorded leaf swap and sounds, the crossing monster raised on the crossing tick, a puzzle-door lock line and unlock step, silent door brothers, a brother leash, takeover of a crypt monster's fight, the "We'll finish this later..." line, an elite clue that goes through Treasure Trails, and Combat Achievement failure lines.
This revision puts back the post-loot door/room shift and the looted-tunnel collapse damage that the previous revision had removed.

What was checked

  • Behaviour: the new commit only adds randomiseLayout(run); syncTunnels(player, run) after the rewards are added in searchChest, and collapse() in processPlayer. The shift runs after forceAdd and before the barrows:chest-looted event, so no item or coin is given twice and nothing moves. collapse is guarded by hitpoints above 0 and by phase tunnels of a looted run, so it stops once the player leaves; dig and the leave paths still reset a looted run to freshRun. The old crossing state is unaffected: endCrossing restores the original leaf objects, not the layout.
  • Parity (Wiki): read the Barrows/Strategies wikitext. It says "Once the chest is looted, the tunnels will shake and start to collapse, causing occasional damage to the player, and the arrangement of the doors and rooms will shift", and that each door opened afterwards summons one unkilled brother (already in main, line run.looted || roll < 12). The restored behaviour follows the Wiki. The 1-4 every 10 ticks are Ours, as the code and docs say.
  • Parity (recordings): rsprox_transcripts/227/01885.txt lines 276125-279266 (loot, then tick 10757 onward): the chest count at 276125, cam_shake before it, no hitsplat on the player (the [hit] rows are on Verac and Torag), and the door varbits 469-484 are not re-sent until the next dig at 289-300 of that block. This agrees with the recorded difference the PR documents. The PR's "37 loots" is not an exact count of what the cited files hold (Your Barrows chest count appears 127, 135, 29, 1, 8 and 3 times in 227/01885, 227/910477, 237/04057, 226/01694, 227/910469 and 234/03276), so it is a conservative subset, not a contradiction. The Wiki wins anyway.
  • Traced: collapse uses pluginApi.core.HitDamage and HitMask, the same pattern as AgilityPyramid.plugin.js and DesertHeat.plugin.js, replacing main's direct HitDamage import. The only consumers of searchChest/processPlayer are the Barrows handlers and the tests listed below.
  • Rules: no plugin description or config change (no world-config-docs row). No generated JSON edited. docs/progress/osrs-progress.json is hand-written, and the note's indentation now matches its neighbours. All four changed files have LF endings in the commit.
  • Related PRs: none looked at.

Findings

No defects found.

Scope

ordinary

Verified

  • Build (yarn build, Yarn 4.12.0, server/) on the integration commit: ok.
  • barrows-run.test.cjs: 34/34, and 20 of 20 consecutive runs pass (the prior flake did not recur).
  • Neighbours, each on its own: barrows-tunnel-prompt 2/2, barrows-death-durability 12/12, barrows-drop-degrade 6/6, his-faithful-servants-capture 8/8, collection-log 34/34, league-passives 26/26, qh728-q130 21/21, combat-achievements 31/31, clue-capacity 40/40, treasure-trails-elite 16/16.
  • Revert check on the new commit's change: with 28dc19a's plugin (plus the roomAt export) the rewritten loot test "looting shifts the doors and rooms, and the collapsing tunnels hurt until left (Wiki)" fails and the other 33 pass, so it covers the restored behaviour. The earlier revert check (main's plugin, 10 new tests failing) stands from the prior review and was not repeated on unchanged code.
  • docs: yarn install --frozen-lockfile and yarn build with Yarn 1.22.22: build complete.
  • main+head merge tree: clean (integration commit built).
  • generated JSON: none edited.

Not verified

  • Live game: not run; the in-game MCP claims in the PR body are the author's.
  • The exact "37 loots" count was not reproduced (see Parity). Only one loot window in 227/01885 was read for damage and varbit changes.
  • Recording citations that did not change since 28dc19a (leaf swap, puzzle lines, farewell, Combat Achievement lines) were verified in the prior review and not reopened. 237/04057 tick 8841 and the leash ticks were not opened.
  • The chest's elite clue for a full inventory sends no "sneaking suspicion" warning; no Wiki text or recording settles it, so it stays a note.

Verdict

Merge

@UnhealthyKraken
UnhealthyKraken merged commit e80eee0 into RSPSApp:main Nov 23, 2026
2 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.

[Bug]: Barrows: tunnel transitions, Prayer timer, chest effects, brother aggro and achievement issues

2 participants