2019-11-07 23:44:03 -05:00
|
|
|
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,
|
|
|
|
}
|
2019-11-09 23:37:02 -05:00
|
|
|
result.AnimatedEntity.SetMode(object.Lookup.Mode, object.Lookup.Class, 1, fileProvider)
|
2019-11-07 23:44:03 -05:00
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
|
|
|
func (v *NPC) Render(target *ebiten.Image, offsetX, offsetY int) {
|
|
|
|
v.AnimatedEntity.Render(target, offsetX, offsetY)
|
|
|
|
}
|