const FeastCost, FeastXP
FeastCost and FeastXP describe the Gnome Feast: a coin sink that lets a hard-working gnome convert earnings into experience, once per day.
Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.
Package tavernlogic holds the pure game rules of the Gnome Tavern: the menu, the level ladder, the rotating daily que...
Package tavernlogic holds the pure game rules of the Gnome Tavern: the menu, the level ladder, the rotating daily quest board and the per-gnome state machine (serving drinks, claiming quests, feasting).
It is a pure package (gno.land/p/...): it owns no chain state of its own. The Gnome Tavern realm keeps the state (a *Gnome per player) and calls into these functions, which keeps every rule unit-testable without a chain.
FeastCost and FeastXP describe the Gnome Feast: a coin sink that lets a hard-working gnome convert earnings into experience, once per day.
Quest kinds: what the progress counter measures.
DayBlocks is the length of one tavern day, in blocks. Quest boards, daily serve counters and feast allowances all reset when the day rolls over. A short day keeps the game lively on a testnet: at Onyx's block pace a tavern day lasts roughly an hour.
MaxServesPerDay caps how many items one gnome may serve per tavern day.
XPPerLevel is the amount of XP between consecutive levels.
DayAt maps a chain height to its tavern day number.
LevelForXP returns the level of a gnome holding xp experience points. Level 1 is the starting level; every XPPerLevel XP earns a new level.
XPForLevel returns the cumulative XP at which level l is reached.
NewGnome creates a fresh gnome registered under the given name.
Menu returns the full tavern menu, in serving order.
MenuItemByID looks up a menu item by its ID.
QuestPool returns every quest that can appear on the board.
QuestsForDay deterministically picks the 3 quests on the board for a tavern day. The same day always yields the same board, on every node, with no randomness source beyond the day number itself (a small LCG).
Gnome is one player's tavern career. The realm owns one *Gnome per registered address; all fields are plain data so the realm can persist it directly.
ClaimQuest pays out the quest in board slot (0-2) for the given day, if the gnome has met its requirement and has not claimed it yet today.
Feast lets the gnome spend FeastCost coins on a Gnome Feast, gaining FeastXP experience. Once per tavern day.
Level returns the gnome's current level.
ProgressFor reports the gnome's progress toward a quest today.
Serve records the gnome serving one menu item on the given day and returns what was earned. It enforces the menu's level requirement and the daily serve cap.
MenuItem is one serveable entry on the tavern menu. Serving it pays the gnome Coins tavern coins and XP experience, and requires MinLevel.
Quest is one entry on the daily quest board.