Skip to content

Add the Duel Arena minigame - #1274

Open
HarleyGilpin wants to merge 11 commits into
GregHib:mainfrom
HarleyGilpin:feat/duel-arena
Open

Add the Duel Arena minigame#1274
HarleyGilpin wants to merge 11 commits into
GregHib:mainfrom
HarleyGilpin:feat/duel-arena

Conversation

@HarleyGilpin

@HarleyGilpin HarleyGilpin commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Adds the Duel Arena - content/minigame/duel_arena

What's included

  • Challenge player option on the walkways/hospital (interface 640 friendly/staked selection, chat request, mutual-accept handshake like trading).
  • Rules screens 631 (staked) / 637 (friendly): all 12 rules plus the 11 equipment bans, mirrored to both players through the real 634 varbits, with the No Ranged/Melee/Magic and Obstacles/No Movement exclusions.
  • Staking through the 628 side tab into inventory 134, mirrored to the opponent's secondary container; tradeable items only.
  • Confirmation screens 626 / 639 with the before/during lists and stake summaries, then teleport into a random obstacle or obstacle-free arena (side-by-side placement for No Movement), banned gear unequipped, countdown "3, 2, 1, FIGHT!".
  • Enforcement: duellers and their familiars may only attack each other and only after the countdown; combat style, fun weapon, special attack, food, drink, prayer, summoning, movement, equipment, teleport, drop and logout blocks.
  • Ending by death, the forfeit trapdoor or disconnect: both players healed and sent to the hospital, winner gets 633/634 with the winnings in inventory 136 (claimed on close, bank fallback), audit log entries, and an in-memory scoreboard of the last 50 duels on object 3192.

Generic hooks were added to Eating, Equipping, Movement, Summoning and QuickPrayers (no_food_message, blocked_equip_slots, ...) because item/interface option handlers can't veto each other.

Tests

DuelTest (21 WorldTest cases) covers the request handshake, rule toggles and exclusions, stake mirroring/removal/restrictions, accept space and fun-weapon checks, countdown and fight start, death and forfeit payouts, disconnect forfeit, logout veto, walk-away decline, third-party attack blocking, leftover-item recovery and the scoreboard cap. Full :game:test passes.

Component ids and the rule varbits (4157-4183, 4275 on varp 286) were
dumped from the 634 cache; Darkan's rule bit encoding and most of its
727 component ids don't match this revision.

teleport_block was declared on varbit 4163, which is the duel arena's
No Magic rule in 634, so it becomes a plain persisted variable.
Challenge requests, friendly and staked rules screens with all rules and
equipment bans, mirrored stakes, confirmation screens, arena placement
(obstacle/no-obstacle, no-movement side-by-side), countdown, rule
enforcement, forfeit trapdoor, logout veto with forfeit on disconnect,
victory screens with winnings, hospital healing and an in-memory
scoreboard of the last fifty duels.

Duellers and their familiars can only fight their opponent. Food, drink,
prayer, summoning, movement and equipment bans are enforced through
generic message/slot variables read by the existing skill scripts.
Clicking a duel request in the chat box makes the client send player
option 1, so the option has to live there like Attack does.
Interface 632 rebuilds its rows from varc strings 224-273 when it opens
and shows Loading... while all of them are blank, so the rows are sent
as those strings before opening instead of appended with a row script.
The victory screens copy that string over the name component when they
open, which replaced the text sent directly with null.
Varc 236 turns the worn equipment tab icon into the forfeit trapdoor
during a duel; the 634 cache has no forfeit tab interface for any other
slot, so clicking that tab now asks to forfeit like the trapdoor does.
Drop the equipment tab icon swap; the logout button now asks whether to
forfeit instead of refusing, and the trapdoor keeps working.
@HarleyGilpin
HarleyGilpin marked this pull request as ready for review September 7, 2026 18:34
Queue a save of both players whenever stake items change hands so a
crash can't restore a pre-transfer snapshot, return leftover stakes
instead of clearing them, route the bank fallback through BankDeposit
so noted and unbankable items are handled, re-check inventory space at
the final accept, and treat every death inside an arena as drop-free so
simultaneous deaths never drop items.
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