maplib

package
v0.0.0-...-94f88f4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncounterType

type EncounterType int
const (
	// lair, plane tower, ancient temple, fallen temple, ruins, abandoned keep, dungeon
	EncounterTypeLair EncounterType = iota
	EncounterTypeCave
	EncounterTypePlaneTower
	EncounterTypePlaneTowerOpen
	EncounterTypeAncientTemple
	EncounterTypeFallenTemple
	EncounterTypeRuins
	EncounterTypeAbandonedKeep
	EncounterTypeDungeon
)

type ExtraBonus

type ExtraBonus struct {
	Bonus data.BonusType
}

wild game, gold ore, mithril, etc

func (*ExtraBonus) DrawLayer1

func (bonus *ExtraBonus) DrawLayer1(screen *ebiten.Image, imageCache *util.ImageCache, options *ebiten.DrawImageOptions, counter uint64, tileWidth int, tileHeight int)

func (*ExtraBonus) DrawLayer2

func (bonus *ExtraBonus) DrawLayer2(screen *ebiten.Image, imageCache *util.ImageCache, options *ebiten.DrawImageOptions, counter uint64, tileWidth int, tileHeight int)

type ExtraEncounter

type ExtraEncounter struct {
	Type  EncounterType
	Units []units.Unit
}

lair, plane tower, etc

func (*ExtraEncounter) DrawLayer1

func (extra *ExtraEncounter) DrawLayer1(screen *ebiten.Image, imageCache *util.ImageCache, options *ebiten.DrawImageOptions, counter uint64, tileWidth int, tileHeight int)

func (*ExtraEncounter) DrawLayer2

func (extra *ExtraEncounter) DrawLayer2(screen *ebiten.Image, imageCache *util.ImageCache, options *ebiten.DrawImageOptions, counter uint64, tileWidth int, tileHeight int)

type ExtraMagicNode

type ExtraMagicNode struct {
	Kind      MagicNode
	Empty     bool
	Guardians []units.Unit
	Secondary []units.Unit
	// list of points that are affected by the node
	Zone []image.Point

	// if this node is melded, then this player receives the power
	MeldingWizard Melder
	// true if melded by a guardian spirit, otherwise false if melded by a magic spirit
	GuardianSpiritMeld bool
}

func MakeMagicNode

func MakeMagicNode(kind MagicNode, magicSetting data.MagicSetting, difficulty data.DifficultySetting, plane data.Plane) *ExtraMagicNode

func (*ExtraMagicNode) DrawLayer1

func (node *ExtraMagicNode) DrawLayer1(screen *ebiten.Image, imageCache *util.ImageCache, options *ebiten.DrawImageOptions, counter uint64, tileWidth int, tileHeight int)

func (*ExtraMagicNode) DrawLayer2

func (node *ExtraMagicNode) DrawLayer2(screen *ebiten.Image, imageCache *util.ImageCache, options *ebiten.DrawImageOptions, counter uint64, tileWidth int, tileHeight int)

func (*ExtraMagicNode) Meld

func (node *ExtraMagicNode) Meld(meldingWizard Melder, spirit units.Unit) bool

type ExtraRoad

type ExtraRoad struct {
}

type ExtraTile

type ExtraTile interface {
	DrawLayer1(screen *ebiten.Image, imageCache *util.ImageCache, options *ebiten.DrawImageOptions, counter uint64, tileWidth int, tileHeight int)
	DrawLayer2(screen *ebiten.Image, imageCache *util.ImageCache, options *ebiten.DrawImageOptions, counter uint64, tileWidth int, tileHeight int)
}

type FullTile

type FullTile struct {
	Extra ExtraTile
	Tile  terrain.Tile
	X     int
	Y     int
}

func (*FullTile) GetBonus

func (tile *FullTile) GetBonus() data.BonusType

func (*FullTile) HasWildGame

func (tile *FullTile) HasWildGame() bool

func (*FullTile) Valid

func (tile *FullTile) Valid() bool

type MagicNode

type MagicNode int
const (
	MagicNodeNature MagicNode = iota
	MagicNodeSorcery
	MagicNodeChaos
)

type Map

type Map struct {
	Map *terrain.Map

	Plane data.Plane

	// contains information about map squares that contain extra features on top
	// such as a road, enchantment, encounter place (plane tower, lair, etc)
	ExtraMap map[image.Point]ExtraTile

	Data *terrain.TerrainData

	TileCache map[int]*ebiten.Image
	// contains filtered or unexported fields
}

func MakeMap

func MakeMap(data *terrain.TerrainData, landSize int, plane data.Plane) *Map

func (*Map) CreateEncounter

func (mapObject *Map) CreateEncounter(x int, y int, encounterType EncounterType, difficulty data.DifficultySetting, weakStrength bool, plane data.Plane) bool

func (*Map) CreateEncounterRandom

func (mapObject *Map) CreateEncounterRandom(x int, y int, difficulty data.DifficultySetting, plane data.Plane) bool

func (*Map) CreateNode

func (mapObject *Map) CreateNode(x int, y int, node MagicNode, plane data.Plane, magicSetting data.MagicSetting, difficulty data.DifficultySetting) *ExtraMagicNode

func (*Map) DrawLayer1

func (mapObject *Map) DrawLayer1(cameraX int, cameraY int, animationCounter uint64, imageCache *util.ImageCache, screen *ebiten.Image, geom ebiten.GeoM)

draw base map tiles, in general stuff that should go under cities/units

func (*Map) DrawLayer2

func (mapObject *Map) DrawLayer2(cameraX int, cameraY int, animationCounter uint64, imageCache *util.ImageCache, screen *ebiten.Image, geom ebiten.GeoM)

give the extra nodes a chance to draw on top of cities/units, but still under the fog

func (*Map) DrawMinimap

func (mapObject *Map) DrawMinimap(screen *ebiten.Image, cities []MiniMapCity, centerX int, centerY int, fog [][]bool, counter uint64, crosshairs bool)

func (*Map) GetBonusTile

func (mapObject *Map) GetBonusTile(x int, y int) data.BonusType

func (*Map) GetCatchmentArea

func (mapObject *Map) GetCatchmentArea(x int, y int) map[image.Point]FullTile

func (*Map) GetLair

func (mapObject *Map) GetLair(x int, y int) *ExtraEncounter

func (*Map) GetMagicNode

func (mapObject *Map) GetMagicNode(x int, y int) *ExtraMagicNode

func (*Map) GetMeldedNodes

func (mapObject *Map) GetMeldedNodes(melder Melder) []*ExtraMagicNode

func (*Map) GetTile

func (mapObject *Map) GetTile(tileX int, tileY int) FullTile

func (*Map) GetTileImage

func (mapObject *Map) GetTileImage(tileX int, tileY int, animationCounter uint64) (*ebiten.Image, error)

func (*Map) Height

func (mapObject *Map) Height() int

func (*Map) SetBonus

func (mapObject *Map) SetBonus(x int, y int, bonus data.BonusType)

func (*Map) TileHeight

func (mapObject *Map) TileHeight() int

func (*Map) TileWidth

func (mapObject *Map) TileWidth() int

func (*Map) TilesPerColumn

func (mapObject *Map) TilesPerColumn(screenHeight int) int

func (*Map) TilesPerRow

func (mapObject *Map) TilesPerRow(screenWidth int) int

func (*Map) Width

func (mapObject *Map) Width() int

func (*Map) WrapX

func (mapObject *Map) WrapX(x int) int

type Melder

type Melder interface {
	GetBanner() data.BannerType
}

type MiniMapCity

type MiniMapCity interface {
	GetX() int
	GetY() int
	GetBanner() data.BannerType
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL