Skip to content Search Apps Documentation Source Content 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.

v0 state

Back to all declarations

Hero

type

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

Value

v0.Hero

Monster

type

Monster is the room's current resident.

Value

v0.Monster

heroes

v0.Tree

// address string -> \*Hero

Open
OID
0b2be8…ee08:4
heroes details

Inspect ref

roomLevel

int

Value

1

totalKills

int

Value

0

spawnMonster

func(level int) *v0.Monster
Open
OID
0b2be8…ee08:12
spawnMonster details

Inspect func

Spawn

func(name string)

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

Open
OID
0b2be8…ee08:13
Spawn details

Inspect func

Attack

func()

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.

Open
OID
0b2be8…ee08:14
Attack details

Inspect func

Rest

func()

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

Open
OID
0b2be8…ee08:15
Rest details

Inspect func

Revive

func()

Revive brings a fallen hero back at half max HP.

Open
OID
0b2be8…ee08:16
Revive details

Inspect func

levelUp

func(h *v0.Hero)

levelUp applies every level-up a hero's current XP qualifies for. The threshold to reach level N+1 from level N is N\*50 XP.

Open
OID
0b2be8…ee08:17
levelUp details

Inspect func

byRank

type

byRank orders heroes for the leaderboard: highest level first, then XP, then kills, as a tiebreaker.

Value

v0.byRank

collectHeroes

func() []*v0.Hero
Open
OID
0b2be8…ee08:18
collectHeroes details

Inspect func

hpBar

func(hp int, maxHP int) string
Open
OID
0b2be8…ee08:19
hpBar details

Inspect func

Render

func(path string) string

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

Open
OID
0b2be8…ee08:20
Render details

Inspect func

renderHero

func(addr string) string
Open
OID
0b2be8…ee08:22
renderHero details

Inspect func
Hero : type =v0.Hero
Monster : type =v0.Monster
heroes : v0.Tree Inspect
monster : *v0.Monster Inspect
roomLevel : int =1
totalKills : int =0
monsterNames : []string (len=10) Inspect
init.7 : func() Inspect
spawnMonster : func(level int) *v0.Monster Inspect
Spawn : func(name string) Inspect
Attack : func() Inspect
Rest : func() Inspect
Revive : func() Inspect
levelUp : func(h *v0.Hero) Inspect
byRank : type =v0.byRank
collectHeroes : func() []*v0.Hero Inspect
hpBar : func(hp int, maxHP int) string Inspect
Render : func(path string) string Inspect
renderRoom : func() string Inspect
renderHero : func(addr string) string Inspect