1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-30 02:55:23 +00:00
OpenDiablo2/common/NPC.go
Tim Sarbin 920a4f51b0
Initial NPC support (#111)
* Started adding support for NPCs. Added Monstats dictionary.
2019-11-07 23:44:03 -05:00

26 lines
612 B
Go

package common
import (
"github.com/OpenDiablo2/OpenDiablo2/palettedefs"
"github.com/hajimehoshi/ebiten"
)
type NPC struct {
AnimatedEntity *AnimatedEntity
Paths []Path
}
func CreateNPC(object Object, fileProvider FileProvider) *NPC {
result := &NPC{
AnimatedEntity: CreateAnimatedEntity(object, fileProvider, palettedefs.Units),
Paths: object.Paths,
}
result.AnimatedEntity.SetMode(object.Lookup.Mode, object.Lookup.Class, 0, fileProvider)
return result
}
func (v *NPC) Render(target *ebiten.Image, offsetX, offsetY int) {
v.AnimatedEntity.Render(target, offsetX, offsetY)
}