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

eggling state

Back to all declarations

minIncubation

int64

minIncubation is the minimum number of blocks an egg must sit before it can hatch.

Value

20

waitCap

int64

waitCap is the incubation-time bonus cap (in blocks) used by rarityTier, so waiting forever doesn't guarantee a legendary — it just improves odds.

Value

200

egg

type

egg is the persisted record for one planted egg, hatched or not.

Value

eggling.egg

eggs

v0.Tree

// id string -> \*egg

Open
OID
08db17…086c:10
eggs details

Inspect ref

nextID

int

Value

0

totalPlanted

int

Value

0

totalHatched

int

Value

0

get

func(id string) (*eggling.egg, bool)
Open
OID
08db17…086c:16
get details

Inspect func

hashSeed

func(parts []string) string

hashSeed hashes the given parts (joined with ":") to a deterministic hex digest. Used to derive an egg's species and rarity roll from facts already fixed at plant time, so nobody — not even the owner — can game the outcome after the fact.

Open
OID
08db17…086c:18
hashSeed details

Inspect func

seedBytes

func(seedHex string) (uint8, uint8)

seedBytes pulls the first two bytes out of a hex digest for use as two independent 0-255 rolls (species pick, rarity roll).

Open
OID
08db17…086c:19
seedBytes details

Inspect func

rarityTier

func(roll uint8, waitBlocks int64) int

rarityTier turns a 0-255 roll plus the blocks waited into a tier index 0..3 (common..legendary). Waiting longer raises the effective score, so patience improves your odds, but a bad roll can still land common even after a long wait, and a lucky roll can hatch rare almost immediately.

Open
OID
08db17…086c:20
rarityTier details

Inspect func

plant

func(owner .uverse.address, height int64) *eggling.egg

plant is the non-crossing core of PlantEgg.

Open
OID
08db17…086c:21
plant details

Inspect func

PlantEgg

func() string

PlantEgg starts incubating a new egg for the caller. Returns its ID.

Open
OID
08db17…086c:22
PlantEgg details

Inspect func

hatch

func(e *eggling.egg, height int64) string

hatch is the non-crossing core of Hatch.

Open
OID
08db17…086c:23
hatch details

Inspect func

Hatch

func(id string) string

Hatch hatches an incubated egg the caller owns.

Open
OID
08db17…086c:24
Hatch details

Inspect func

train

func(e *eggling.egg) string

train is the non-crossing core of Train.

Open
OID
08db17…086c:25
train details

Inspect func

Train

func(id string) string

Train gives a hatched creature the caller owns some experience, leveling it up every 50 XP.

Open
OID
08db17…086c:26
Train details

Inspect func

rename

func(e *eggling.egg, name string) string

rename is the non-crossing core of Rename.

Open
OID
08db17…086c:27
rename details

Inspect func

Rename

func(id string, name string) string

Rename gives a hatched creature the caller owns a custom name.

Open
OID
08db17…086c:28
Rename details

Inspect func

escapeInline

func(s string) string

escapeInline neutralizes markdown-active characters in untrusted text before it's embedded inline in Render output.

Open
OID
08db17…086c:29
escapeInline details

Inspect func

shortAddr

func(a .uverse.address) string
Open
OID
08db17…086c:30
shortAddr details

Inspect func

byIDNumeric

type

byIDNumeric orders eggs by their numeric ID, ascending.

Value

eggling.byIDNumeric

renderEgg

func(id string, height int64) string
Open
OID
08db17…086c:33
renderEgg details

Inspect func

renderOwner

func(rawAddr string) string
Open
OID
08db17…086c:34
renderOwner details

Inspect func

Render

func(path string) string

Render shows the full egg list at "", a single egg's detail when path is a numeric ID, or one owner's eggs when path is a bech32 address.

Open
OID
08db17…086c:35
Render details

Inspect func
minIncubation : int64 =20
waitCap : int64 =200
speciesNames : [8]string Inspect
rarityNames : [4]string Inspect
rarityEmoji : [4]string Inspect
egg : type =eggling.egg
eggs : v0.Tree Inspect
nextID : int =0
totalPlanted : int =0
totalHatched : int =0
rarityCounts : [4]int Inspect
get : func(id string) (*eggling.egg, bool) Inspect
hashSeed : func(parts []string) string Inspect
seedBytes : func(seedHex string) (uint8, uint8) Inspect
rarityTier : func(roll uint8, waitBlocks int64) int Inspect
plant : func(owner .uverse.address, height int64) *eggling.egg Inspect
PlantEgg : func() string Inspect
hatch : func(e *eggling.egg, height int64) string Inspect
Hatch : func(id string) string Inspect
train : func(e *eggling.egg) string Inspect
Train : func(id string) string Inspect
rename : func(e *eggling.egg, name string) string Inspect
Rename : func(id string, name string) string Inspect
escapeInline : func(s string) string Inspect
shortAddr : func(a .uverse.address) string Inspect
byIDNumeric : type =eggling.byIDNumeric
allEggs : func() []*eggling.egg Inspect
renderHome : func() string Inspect
renderEgg : func(id string, height int64) string Inspect
renderOwner : func(rawAddr string) string Inspect
Render : func(path string) string Inspect