Пример #1
0
func (c *Creature) init() {
	c.visibleCreatures = make(interfaces.CreatureMap)

	c.movementSpeed = 250
	c.lastStep = interfaces.PUSYS_TIME()
}
Пример #2
0
// Methods for all moving creatures
func (c *Creature) OnCreatureMove(_creature interfaces.ICreature, _from position.Position, _to position.Position, _teleport bool) {
	if _creature.GetUID() == c.GetUID() {
		c.lastStep = interfaces.PUSYS_TIME()
	}
}
Пример #3
0
func (c *Creature) getTimeSinceLastMove() int {
	return int(interfaces.PUSYS_TIME() - c.lastStep)
}