// PKGPATH: gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/z1 // Publish two moves and read them back. package z1 import "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/moves/v2" func main(cur realm) { println(moves.Check("Blink Thief/60/D82S11")) println(moves.Check("Blink Thief/84/D82S11")) a := moves.Publish(cross(cur), "Blink Thief/84/D82S11") b := moves.Publish(cross(cur), "Long Pull/24/P15") println(a, b, moves.Count()) println(moves.Recipe(b)) println(moves.List(0, 10)) println(moves.ByAuthor(moves.Author(a))) println(moves.Render("")) println(moves.Render("move/1")) } // Output: // recipe: these effects need a cooldown of at least 84 // ok 84 // 1 2 2 // Long Pull/24/P15 // [{"id":2,"author":"g1uaj9za4jkmc4e49h2a2n0cru7jfv60lgcxcjf4","recipe":"Long Pull/24/P15","name":"Long Pull","cd":24,"cost":24},{"id":1,"author":"g1uaj9za4jkmc4e49h2a2n0cru7jfv60lgcxcjf4","recipe":"Blink Thief/84/D82S11","name":"Blink Thief","cd":84,"cost":84}] // [{"id":1,"author":"g1uaj9za4jkmc4e49h2a2n0cru7jfv60lgcxcjf4","recipe":"Blink Thief/84/D82S11","name":"Blink Thief","cd":84,"cost":84},{"id":2,"author":"g1uaj9za4jkmc4e49h2a2n0cru7jfv60lgcxcjf4","recipe":"Long Pull/24/P15","name":"Long Pull","cd":24,"cost":24}] // # Move recipes // // Special moves anyone can design, written as data. Equip one in the brawler to use it in place of your class special; the chain runs it with the same rules as the browser. // // A recipe is `name/cooldown/effects`, for example `Blink Thief/84/D82S11`: dash 4 squares to the nearest gold, then steal 1 gold in melee. Stronger effects need longer cooldowns. Check one with `Check(recipe)` and publish it with `Publish(recipe)`. // // ## Newest // // | # | Move | Recharge | What it does | Author | // |---|---|---|---|---| // | [#2](:move/2) | Long Pull | 2.4s | pull the nearest coin within 5 squares | [g1uaj9…cjf4](:by/g1uaj9za4jkmc4e49h2a2n0cru7jfv60lgcxcjf4) | // | [#1](:move/1) | Blink Thief | 8.4s | dash 4 squares to the nearest gold, then steal 1 gold within 1.45 squares | [g1uaj9…cjf4](:by/g1uaj9za4jkmc4e49h2a2n0cru7jfv60lgcxcjf4) | // // 2 moves published. // // Need testnet GNOT to play? Get it free at [faucet.gno.land](https://faucet.gno.land). // // # Blink Thief // // Move #1 by [g1uaj9…cjf4](:by/g1uaj9za4jkmc4e49h2a2n0cru7jfv60lgcxcjf4). Recharges in 8.4s (its effects need at least 8.4s). // // - dash 4 squares to the nearest gold // - steal 1 gold within 1.45 squares // // Recipe: `Blink Thief/84/D82S11`