func init() { world.Register("forge", world.Visible((*Forge)(nil))) world.RegisterSpawnFunc(func(s string) world.Visible { if s == "forge" { return &Forge{} } return nil }) }
func init() { world.Register("door", world.Visible((*Door)(nil))) world.RegisterSpawnFunc(func(s string) world.Visible { if s == "door" { return &Door{} } return nil }) }
func init() { world.Register("wall", world.Visible((*Wall)(nil))) world.RegisterSpawnFunc(WrapSpawnFunc(func(material *Material, s string) world.Visible { if s == "wall" { return &Wall{ material: material, } } return nil })) }
func init() { world.Register("floor", world.Visible((*Floor)(nil))) world.RegisterSpawnFunc(WrapSpawnFunc(func(material *Material, s string) world.Visible { if s == "floor" { return &Floor{ material: material, } } return nil })) }
func init() { world.Register("hero", HeroLike((*Hero)(nil))) world.RegisterSpawnFunc(func(s string) world.Visible { for i := range raceInfo { r := Race(i) if r.Name() == s { return GenerateHeroRace(rand.New(rand.NewSource(rand.Int63())), r) } } return nil }) }
func init() { world.Register("ingot", world.Visible((*Ingot)(nil))) world.RegisterSpawnFunc(WrapSpawnFunc(func(material *Material, s string) world.Visible { wood, stone, metal := material.Get() if len(wood) != 0 || len(stone) != 0 || len(metal) == 0 { return nil } if s == "ingot" { return &Ingot{ material: material, } } return nil })) }
func init() { world.Register("equip", world.Visible((*Equip)(nil))) world.RegisterSpawnFunc(material.WrapSpawnFunc(func(mat *material.Material, s string) world.Visible { wood, stone, metal := mat.Get() for t := range equippables { for i, e := range equippables[t] { if e.name == s { haveWood := false haveStone := false haveMetal := false for _, c := range e.colors { if c == woodColor { haveWood = true } if c == stoneColor { haveStone = true } if c == metalColor { haveMetal = true } } if !haveWood && len(wood) != 0 { continue } if !haveStone && len(stone) != 0 { continue } if !haveMetal && len(metal) != 0 { continue } return &Equip{ slot: EquipSlot(t), kind: uint64(i), materials: []*material.Material{mat}, } } } } return nil })) }
func init() { world.Register("critter", world.Combat((*Critter)(nil))) world.RegisterSpawnFunc(func(s string) world.Visible { living, s := world.SpawnModules(s) for t := CritterType(0); t < critterTypeCount; t++ { if s == t.Name() { return &Critter{ CombatObject: world.CombatObject{ LivingObject: living, }, kind: t, colors: t.GenerateColors(), } } } return nil }) }
func init() { world.Register("stone", world.Visible((*Stone)(nil))) }
func init() { world.Register("tree", NodeLike((*Tree)(nil))) }
func init() { world.Register("logs", world.Visible((*Logs)(nil))) }
func init() { world.Register("player", HeroLike((*Player)(nil))) }
func init() { world.Register("playerinst", world.ObjectLike((*PlayerInstance)(nil))) }
func init() { world.Register("ancestry", world.ObjectLike((*PlayerAncestry)(nil))) }
func init() { world.Register("rock", NodeLike((*Rock)(nil))) }
func init() { world.Register("ore", world.Visible((*Ore)(nil))) }
func init() { world.Register("slime", world.Visible((*Slime)(nil))) }
func init() { world.Register("mat", world.ObjectLike((*Material)(nil))) }
func init() { world.Register("resnode", NodeLike((*Node)(nil))) }