Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v0 source realm

Package rpgroom is a tiny single-room on-chain RPG. There is exactly one monster in the room at a time. Spawn a hero,...

Readme View source

RPG Room

⚠️ Experimental — generated with no human supervision by the daily MCP pipeline to exercise gno tooling. Not audited. See r/moul/x/daily.


A tiny shared on-chain dungeon room: everyone fights the same resident monster. Spawn a hero, Attack to chip away at the monster (or get hit back), Rest to heal, Revive if you fall. Every kill replaces the monster with a tougher one and grants XP/gold/level-ups, so the room escalates as the community grinds through it together, with a live leaderboard ranking every hero.

Built for gno 0.9.


Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

Dependency graph:

gno.land/r/moul/x/daily/rpgroom/v0 dependency graph

🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.

Overview

Package rpgroom is a tiny single-room on-chain RPG. There is exactly one monster in the room at a time. Spawn a hero, take a swing, and see what happens: land the killing blow and the room's monster gets replaced by a tougher one while your hero gains XP, gold, and (eventually) a level; get hit hard enough and your hero falls until it's revived. A room-wide leaderboard tracks who has climbed the highest.

Functions 5

func Attack

crossing Action
1func Attack(cur realm)
source

Attack swings the caller's hero at the room's current monster. Killing it grants XP and gold and replaces it with a tougher one; otherwise the monster strikes back.

func Render

1func Render(path string) string
source

Render shows the room overview and leaderboard at path "", or a single hero's detail page when path is a bech32 address.

func Rest

crossing Action
1func Rest(cur realm)
source

Rest heals the caller's hero for a quarter of its max HP.

func Revive

crossing Action
1func Revive(cur realm)
source

Revive brings a fallen hero back at half max HP.

func Spawn

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

Spawn creates the caller's hero in the room. Each address gets exactly one hero; call Revive (not Spawn again) if it dies.

Types 2

type Hero

struct
 1type Hero struct {
 2	Name   string
 3	Level  int
 4	XP     int
 5	HP     int
 6	MaxHP  int
 7	Attack int
 8	Kills  int
 9	Gold   int
10	Alive  bool
11}
source

Hero is one player's on-chain character in the room.

type Monster

struct
1type Monster struct {
2	Name   string
3	Level  int
4	HP     int
5	MaxHP  int
6	Attack int
7}
source

Monster is the room's current resident.

Imports 7

Source Files 3