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.

fishcap.gno

0.85 Kb · 49 lines
 1package fishcap
 2
 3const capFish = 4
 4
 5type fish struct {
 6	owner    address
 7	name     string
 8	rarity   string
 9	trait    string
10	bite     int
11	hpMax    int
12	hp       int
13	speed    int
14	pool     int64
15	bouts    int
16	commitH  int64
17	touched  int64
18	inSea    bool
19	revealed bool
20	mustHeal bool
21}
22
23var (
24	minted int
25	roster [capFish + 1]fish
26)
27
28func Version() string { return "cap-1" }
29
30func Plant(caller address) int {
31	if minted >= capFish {
32		panic("full")
33	}
34	minted++
35	roster[minted].owner = caller
36	roster[minted].name = "Bubble"
37	roster[minted].rarity = "common"
38	roster[minted].trait = "swift"
39	roster[minted].bite = 24
40	roster[minted].hpMax = 100
41	roster[minted].hp = 100
42	roster[minted].speed = 108
43	roster[minted].pool = 0
44	roster[minted].commitH = 1
45	roster[minted].inSea = false
46	roster[minted].revealed = true
47	roster[minted].mustHeal = false
48	return minted
49}