Exemple #1
0
func NewPlayer(_name string) *Player {
	p := &Player{}
	p.uid = puh.GenerateUniqueID()
	p.Conn = nil
	p.Outfit = NewOutfit()
	p.name = _name

	p.Pokemon = make(pkmn.PlayerPokemonList)
	p.PokemonParty = pkmn.NewPokemonParty()
	p.Friends = make(FriendList)

	p.Backpack = NewDepot(25)
	p.Storage = NewDepot(100)

	p.lastStep = PUSYS_TIME()
	p.moveSpeed = 250
	p.VisibleCreatures = make(pul.CreatureList)
	p.ConditionList = list.New()
	p.TimeoutCounter = 0

	p.Quests = make(PlayerQuestList)

	// Add self to visible creatures
	p.VisibleCreatures[p.GetUID()] = p

	return p
}
Exemple #2
0
func NewNpc() *Npc {
	n := Npc{}
	n.uid = puh.GenerateUniqueID()
	n.Outfit = NewOutfit()
	n.moveSpeed = 280
	n.VisibleCreatures = make(pul.CreatureList)
	n.ConditionList = list.New()
	n.script = nil

	n.interactingPlayers = make(PlayerList)

	n.moveInterval = 5
	n.moveRadius = 5
	n.ticksWithoutPlayer = 0

	return &n
}