Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

gnometavern source realm

Realm gnometavern is the Gnome Tavern: a small on-chain tavern game on Gno.land. Players register a gnome, work shift...

Overview

Realm gnometavern is the Gnome Tavern: a small on-chain tavern game on Gno.land. Players register a gnome, work shifts serving drinks and food from the menu, complete a rotating daily quest board, level up, feast, and leave notes on the tavern wall.

All game rules live in the pure package tavernlogic; this realm owns the persistent state and the caller authentication, and renders the tavern board for gnoweb.

Constants 2

const MaxWallNotes

1const MaxWallNotes = 30
source

MaxWallNotes caps how many wall notes are kept (oldest are dropped).

const RealmPath

1const RealmPath = "gno.land/r/g17dvvky49vjqj6a4cjhwcvzctteqjm9stee000h/gnometavern"
source

RealmPath is this realm's on-chain address, used in help text.

Functions 10

func ClaimQuest

crossing Action
1func ClaimQuest(cur realm, slot int) string
source

ClaimQuest claims the reward for today's quest in board slot 0, 1 or 2, once its requirement has been met by serving.

func Feast

crossing Action
1func Feast(cur realm) string
source

Feast spends 50 coins on a Gnome Feast, gaining 15 XP. Once per day.

func PostNote

crossing Action
1func PostNote(cur realm, text string) string
source

PostNote pins a one-line note (max 140 chars) to the tavern wall.

func Profile

Action
1func Profile(addr address) string
source

Profile returns a one-line summary of the gnome at addr.

func Register

crossing Action
1func Register(cur realm, name string) string
source

Register creates a gnome for the caller's address. One gnome per address, and names are unique across the tavern.

func Render

1func Render(path string) string
source

Render draws the tavern for gnoweb. Pages:

Example
1""               the tavern board (stats, today's quests, top 10, wall)
2"menu"           the full menu with level requirements
3"quests"         today's quest board in detail
4"leaderboard"    every gnome, ranked
5"wall"           the full message wall
6"gnome/<addr>"   one gnome's card

func Serve

crossing Action
1func Serve(cur realm, itemID int) string
source

Serve serves one menu item to a tavern guest. The item is chosen by its menu ID (see the menu page). Pays coins and XP per the menu.

Types 1

type WallNote

struct
1type WallNote struct {
2	Author string
3	Text   string
4	Day    int64
5}
source

WallNote is one message pinned to the tavern wall.

Dependencies

Source Files 4