Hero
typeHero is one player's on-chain character in the room.
Value
v0.Hero
Monster
typeMonster is the room's current resident.
Value
v0.Monster
heroes
v0.Tree// address string -> \*Hero
- OID
- 08f555…3961:4
heroes details
monster
*v0.Monster- OID
- 08f555…3961:23
monster details
roomLevel
intValue
1
totalKills
intValue
0
monsterNames
[]string- OID
- 08f555…3961:9
monsterNames details
init.7
func()- OID
- 08f555…3961:10
init.7 details
spawnMonster
func(level int) *v0.Monster- OID
- 08f555…3961:12
spawnMonster details
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.
- OID
- 08f555…3961:13
Spawn details
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.
- OID
- 08f555…3961:14
Attack details
Rest
func()Rest heals the caller's hero for a quarter of its max HP.
- OID
- 08f555…3961:15
Rest details
Revive
func()Revive brings a fallen hero back at half max HP.
- OID
- 08f555…3961:16
Revive details
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.
- OID
- 08f555…3961:17
levelUp details
byRank
typebyRank orders heroes for the leaderboard: highest level first, then XP, then kills, as a tiebreaker.
Value
v0.byRank
collectHeroes
func() []*v0.Hero- OID
- 08f555…3961:18
collectHeroes details
hpBar
func(hp int, maxHP int) string- OID
- 08f555…3961:19
hpBar details
Render
func(path string) stringRender shows the room overview and leaderboard at path "", or a single hero's detail page when path is a bech32 address.
- OID
- 08f555…3961:20
Render details
renderRoom
func() string- OID
- 08f555…3961:21
renderRoom details
renderHero
func(addr string) string- OID
- 08f555…3961:22