Documentation ¶
Index ¶
- Constants
- func PlayerDisconnected(p *Player)
- func SaveAllPlayers()
- func SavePlayer(p *Player)
- type CraftItemType
- type Equip
- func (e *Equip) Actions(player world.PlayerLike) []string
- func (e *Equip) AdminOnly() bool
- func (e *Equip) AnimationType() string
- func (e *Equip) Colors() []string
- func (e *Equip) Examine() (string, [][][2]string)
- func (e *Equip) Interact(player world.PlayerLike, action string)
- func (e *Equip) Load(version uint, data interface{}, attached []world.ObjectLike)
- func (e *Equip) Name() string
- func (e *Equip) Quality() *big.Int
- func (e *Equip) Save() (uint, interface{}, []world.ObjectLike)
- func (e *Equip) Scale() uint
- func (e *Equip) Sprite() string
- func (e *Equip) SpritePos() (uint, uint)
- func (e *Equip) SpriteSize() (uint, uint)
- func (e *Equip) Stat(stat world.Stat) *big.Int
- func (e *Equip) Volume() uint64
- func (e *Equip) Weight() uint64
- type EquipSlot
- type Gender
- type HUD
- type Hero
- func (h *Hero) AnimationType() string
- func (h *Hero) Attached() []world.Visible
- func (h *Hero) Colors() []string
- func (h *Hero) Equip(e *Equip)
- func (h *Hero) Examine() (string, [][][2]string)
- func (h *Hero) Gender() Gender
- func (h *Hero) GetEquip(slot EquipSlot) *Equip
- func (h *Hero) GiveItem(item world.Visible) bool
- func (h *Hero) Inventory() []world.Visible
- func (h *Hero) Load(version uint, data interface{}, attached []world.ObjectLike)
- func (h *Hero) MaxHealth() *big.Int
- func (h *Hero) MaxQuality() *big.Int
- func (h *Hero) Name() string
- func (h *Hero) NotifyPosition(old, new *world.Tile)
- func (h *Hero) Occupation() Occupation
- func (h *Hero) Race() Race
- func (h *Hero) RemoveItem(item world.Visible) bool
- func (h *Hero) Save() (uint, interface{}, []world.ObjectLike)
- func (h *Hero) Sprite() string
- func (h *Hero) SpritePos() (uint, uint)
- func (h *Hero) SpriteSize() (uint, uint)
- func (h *Hero) Stat(stat world.Stat) *big.Int
- func (h *Hero) Think()
- func (h *Hero) Unequip(slot EquipSlot)
- type HeroLike
- type HeroName
- type LoginPacket
- type Message
- type NameSubtype
- type Occupation
- type Player
- func (p *Player) Actions(player world.PlayerLike) []string
- func (p *Player) AdminCommand(addr string, command ...string)
- func (p *Player) AnimationType() string
- func (p *Player) Attached() []world.Visible
- func (p *Player) CanSpawn() bool
- func (p *Player) CharacterCreation(command string)
- func (p *Player) Chat(addr, message string)
- func (p *Player) ClearHUD()
- func (p *Player) Colors() []string
- func (p *Player) Die()
- func (p *Player) Examine() (string, [][][2]string)
- func (p *Player) Impersonate(o world.Visible)
- func (p *Player) InitPlayer() (kick <-chan string, hud <-chan HUD, inventory <-chan []world.Visible, ...)
- func (p *Player) Instance(pos *world.Tile) world.Instance
- func (p *Player) IsAdmin() bool
- func (p *Player) Kick(message string)
- func (p *Player) Load(version uint, data interface{}, attached []world.ObjectLike)
- func (p *Player) LoginPosition() (int64, uint8, int64, uint8, int8)
- func (p *Player) Name() string
- func (p *Player) NotifyPosition(old, new *world.Tile)
- func (p *Player) Save() (uint, interface{}, []world.ObjectLike)
- func (p *Player) SaveSelf()
- func (p *Player) Scale() uint
- func (p *Player) SendMessage(message string)
- func (p *Player) SendMessageColor(message, color string)
- func (p *Player) SetHUD(name string, data map[string]interface{})
- func (p *Player) Sprite() string
- func (p *Player) SpritePos() (uint, uint)
- func (p *Player) SpriteSize() (uint, uint)
- func (p *Player) Think()
- func (p *Player) UpdatePosition()
- func (p *Player) Volume() uint64
- func (p *Player) VolumeMax() uint64
- func (p *Player) Weight() uint64
- func (p *Player) WeightMax() uint64
- type PlayerAncestry
- type PlayerInstance
- type PlayerInstances
- type Race
Constants ¶
View Source
const CryptoCost = bcrypt.DefaultCost
Variables ¶
This section is empty.
Functions ¶
func PlayerDisconnected ¶
func PlayerDisconnected(p *Player)
func SaveAllPlayers ¶
func SaveAllPlayers()
func SavePlayer ¶
func SavePlayer(p *Player)
Types ¶
type CraftItemType ¶
type CraftItemType uint64
const ( CraftLongHandle CraftItemType = iota CraftShortHandle CraftGrip CraftPommelCross CraftHilt CraftMaceHead CraftChain CraftHatchetHead CraftPickaxeHead CraftAxeHead CraftHammerHead CraftSpearHead CraftHalberdBlade CraftKnifeBlade CraftDaggerBlade CraftShortBlade CraftLongBlade CraftBroadBlade CraftThinBlade CraftHandleChain CraftMace CraftFlail CraftHatchet CraftPickaxe CraftBattleaxe CraftPoleaxe CraftWarhammer CraftSpear CraftHalberd CraftKnife CraftDagger CraftShortsword CraftLongsword CraftBroadsword CraftRapier CraftSwordChain CraftSwordChucks )
type Equip ¶
type Equip struct { world.VisibleObject // contains filtered or unexported fields }
func (*Equip) AnimationType ¶
func (*Equip) Load ¶
func (e *Equip) Load(version uint, data interface{}, attached []world.ObjectLike)
func (*Equip) SpriteSize ¶
type Hero ¶
type Hero struct { world.CombatObject // contains filtered or unexported fields }
func GenerateHero ¶
func GenerateHeroOccupation ¶
func GenerateHeroOccupation(r *rand.Rand, race Race, occupation Occupation) *Hero
func (*Hero) AnimationType ¶
func (*Hero) Load ¶
func (h *Hero) Load(version uint, data interface{}, attached []world.ObjectLike)
func (*Hero) MaxQuality ¶
func (*Hero) NotifyPosition ¶
func (*Hero) Occupation ¶
func (h *Hero) Occupation() Occupation
func (*Hero) SpriteSize ¶
type HeroName ¶
type HeroName struct { FirstT NameSubtype First uint64 Nickname string Last1T NameSubtype Last1 uint64 Last2T NameSubtype Last2 uint64 Last3T NameSubtype Last3 uint64 PrefixT NameSubtype Prefix uint64 SuffixT NameSubtype Suffix uint64 }
func GenerateHumanName ¶
GenerateHumanName randomly generates a name suitable for a human. The first name is chosen from a gender-specific list. There is a 3% chance of no surname. For the other 97% of names, 25% have a surname beginning with a male first name and ending with "son". An additional 5% have a surname of a single English word, such as "smith" or "cook". The remaining 70% have a surname generated from two syllables.
type LoginPacket ¶
type NameSubtype ¶
type NameSubtype uint64
const ( NameUtil NameSubtype = iota NameMaleHuman NameFemaleHuman NameSurnameConsonant NameSurnameVowel NameFrontSyllableConsonant NameEndConsonant NameEndVowel NameTitlePrefix NameTitleSuffix )
type Occupation ¶
type Occupation uint64
const ( OccupationAdventurer Occupation = iota OccupationCitizen OccupationKnight )
type Player ¶
type Player struct { Hero // contains filtered or unexported fields }
func Login ¶
func Login(addr string, packet *LoginPacket) (*Player, string)
Login returns a non-nil player and an empty error string OR a nil player and an error to show to the user.
func (*Player) AdminCommand ¶
func (*Player) AnimationType ¶
func (*Player) CharacterCreation ¶
func (*Player) Impersonate ¶
func (*Player) InitPlayer ¶
func (*Player) Load ¶
func (p *Player) Load(version uint, data interface{}, attached []world.ObjectLike)
func (*Player) NotifyPosition ¶
func (*Player) SendMessage ¶
func (*Player) SendMessageColor ¶
func (*Player) SpriteSize ¶
func (*Player) UpdatePosition ¶
func (p *Player) UpdatePosition()
type PlayerAncestry ¶
func (*PlayerAncestry) Load ¶
func (a *PlayerAncestry) Load(version uint, data interface{}, attached []world.ObjectLike)
func (*PlayerAncestry) Save ¶
func (a *PlayerAncestry) Save() (uint, interface{}, []world.ObjectLike)
type PlayerInstance ¶
func (*PlayerInstance) Items ¶
func (pi *PlayerInstance) Items(f func([]world.Visible) []world.Visible)
func (*PlayerInstance) Load ¶
func (pi *PlayerInstance) Load(version uint, data interface{}, attached []world.ObjectLike)
func (*PlayerInstance) Save ¶
func (pi *PlayerInstance) Save() (uint, interface{}, []world.ObjectLike)
type PlayerInstances ¶
func (*PlayerInstances) Load ¶
func (pi *PlayerInstances) Load(version uint, data interface{}, attached []world.ObjectLike)
func (*PlayerInstances) Save ¶
func (pi *PlayerInstances) Save() (uint, interface{}, []world.ObjectLike)
type Race ¶
type Race uint64
func (Race) BaseHealth ¶
func (Race) Occupations ¶
func (r Race) Occupations() []Occupation
func (Race) SpriteSize ¶
Click to show internal directories.
Click to hide internal directories.