← King & Dragon  ยท  Wiki  โ€บ  Systems  โ€บ  Pawn Shop

๐Ÿช The Pawn Shop (Lombard)

Where dead players' belongings come back into the economy โ€” and the kingdom's treasury takes its cut.

The Pawn Shop (in-game: Lombard) is the kingdom's second-hand market. When a player dies from any cause, every item they were carrying is transferred to the shop, where any other living non-king player can buy it for gold. Every sale funnels straight into the king's treasury.

It's the only recycling path in the game โ€” without it, a death would permanently remove weapon parts from the economy and dragon-slay paths could become unwinnable.

Pawn Shop UI showing seven purchasable items with buy buttons
The Lombard with stock โ€” seven items dropped from fallen players, each listing icon, name, quantity, and buy price.

When does the shop get stocked?

Items are deposited into the pawn shop whenever a player dies. The resolver tracks a deposit intent for every death event and the turn-scheduler processes them after the turn resolves.

Cause of deathItems go toNotes
Eaten by dragonPawn ShopBoth weapon parts and unique bow parts
Failed dragon-slay attemptPawn ShopAttacker dies, all their parts drop
AssassinatedPawn ShopPlus gold โ†’ treasury via the assassin's cut
Drained by a VampirePawn ShopBody joins the Vampire's ghoul pack
Hunted by a WerewolfPawn ShopWolf pack grows by one
Robbery gone wrongPawn ShopTarget survives robbery but drops via mutual kill
Vampire / Werewolf mutual killPawn Shop (both)Contested combat, both hunters die โ€” double drop

All item drops use the same plumbing โ€” TurnResult.pawn_shop_deposits collects {player_id, reason} entries during resolution, and the persistence layer moves all that player's rows from player_items into pawn_shop in a single transaction.

Dragon-specific Dragon victims are processed through a separate deposit loop that also transfers items. It lives next to the main deposit loop in the turn scheduler โ€” the behaviour is identical, the separation exists purely because dragon victims are tracked on a different list (dragon_victims) during resolution.

Item lifecycle

Here's how a single weapon part can move through the economy:

Player A
earns part
(tournament / forest / craft)
โ†’
Death
dragon / slay-fail /
special function
โ†’
Pawn Shop
stocked at
fixed price
โ†’
Player B
buys it
(gold โ†’ treasury)

The item's type (knight weapon part, ACME kit part, unique bow string, etc.) is preserved, so Player B can continue assembling a dragon-kill weapon from where Player A left off.

Prices & payment

Every item in the shop is listed at a flat price of 67 gold regardless of what it would cost to earn or craft directly:

pawn_shop:
  part_price: 67   # game_config.yaml โ€” single source of truth

This is a balance lever. 67g is set just high enough to matter (about 4โ€“6 turns of peasant work) but well below what crafting a fresh part costs, so the pawn shop genuinely competes with the normal paths rather than being a pure last resort.

Gold Flow When a non-king buys from the shop, the gold doesn't vanish โ€” it goes directly into the kingdom's treasury. This means dead players effectively pay taxes one last time. In close games, a clever king can time peasant deaths and pawn-shop sales to close the 10,000-gold victory gap.

Who can buy โ€” and who can't

Player stateCan buy?Reason
Living peasant / citizen / knight / princeโœ… YesHas gold, needs parts
The KingโŒ NoKings don't haggle. Also, the king already owns the treasury โ€” buying would just move gold from their right pocket to their left
Dead playersโŒ NoDead men buy no bows
Player with less gold than the item priceโŒ No (disabled button)Can't afford โ€” shown greyed out
Any player if shop is emptyโ€” (shown as empty state)See screenshot below

The empty state

Pawn Shop showing 'Empty โ€” items appear here when players perish.' message
Before any player has died, the shop greets visitors with a grim reminder of how it gets stocked.

Buying UI

The pawn shop panel lives inside the game screen, beneath the forest map. It renders as a list of item rows:

Clicking the buy button sends a DataStar POST to /games/{game_id}/buy_pawnshop with the item name. The server re-validates everything (item exists, player is alive, player is not king, player has enough gold) inside a transaction and broadcasts an SSE update to all players.

First-come, first-served There's no reservation or bid system. If two players click the same item on the same tick, the database transaction that lands first wins the sale โ€” the second gets a "not available" error. This creates a real-time race dynamic when a high-value part drops.

Strategic considerations

For peasants & citizens

For knights

For princes

For the king

For Thieves, Assassins, Vampires, Werewolves

Edge cases & rules

CaseBehaviour
Unique bow parts (only one exists in the game)Treated like any other item โ€” stacks into the shop on death. Since there's only one of each bow string / shaft / arrowhead, the pawn shop becomes the only way to acquire one without searching the forest yourself.
Multiple players dropped the same generic partQuantity increments. One row, shown as "Item (x2)", "(x3)", etc.
An item is bought, leaving quantity = 0Row vanishes from the shop on next SSE refresh. Never shown with "(x0)".
Dead player had no inventoryNothing is deposited โ€” the deposit intent is still recorded for logging but no rows are written.
Game ends with items still in shopItems are lost. There's no rollover between games.

Implementation notes (for developers)

PieceFile
Schemaserver/migrations/002_inventory.sql โ€” defines pawn_shop and player_items tables
Deposit intents (pure logic)server/turn_resolver.py โ€” every death path appends to s.pawn_shop_deposits
Persistence (DB writes)server/turn_scheduler.py โ€” after resolver returns, moves items row-by-row in a transaction
Buy APIPOST /games/{game_id}/buy_pawnshop โ†’ game_manager.buy_from_pawn_shop()
UI renderserver/view_renderer.py::render_pawn_shop() โ€” SSE fragment targeting #pawn-shop
Target divclient/templates/game.html โ€” <div id="pawn-shop"></div> under the forest map region
Configgame_config.yaml โ†’ pawn_shop.part_price
History Before v0.10.1, two bugs hid the pawn shop from the UI entirely: the target #pawn-shop div was missing from game.html, and the SSE stream's initial full-sync didn't query pawn shop rows. Items were being created correctly in the database but never rendered. Fixed while writing this wiki page.