Documentation
¶
Index ¶
- Variables
- func GeneratePlaneTowerPositions(landSize int, count int) []image.Point
- func MakeMagicNode(kind MagicNode, magicSetting data.MagicSetting, ...) (*ExtraMagicNode, *ExtraEncounter)
- type CityProvider
- type Direction
- type EncounterType
- type ExtraBonus
- type ExtraCorruption
- type ExtraEncounter
- type ExtraKind
- type ExtraMagicNode
- func (node *ExtraMagicNode) DrawLayer1(screen *ebiten.Image, imageCache *util.ImageCache, ...)
- func (node *ExtraMagicNode) DrawLayer2(screen *ebiten.Image, imageCache *util.ImageCache, ...)
- func (node *ExtraMagicNode) GetPower(magicBonus float64) float64
- func (node *ExtraMagicNode) Meld(meldingWizard Wizard, spirit units.Unit) bool
- type ExtraOpenTower
- type ExtraRoad
- type ExtraTile
- type ExtraVolcano
- type FullTile
- func (tile *FullTile) Corrupted() bool
- func (tile *FullTile) FoodBonus() fraction.Fraction
- func (tile *FullTile) GetBonus() data.BonusType
- func (tile *FullTile) GoldBonus(mapObject *Map) int
- func (tile *FullTile) HasEncounter() bool
- func (tile *FullTile) IsRiverMouth(mapObject *Map) bool
- func (tile *FullTile) IsTouchingShore(mapObject *Map) bool
- func (tile *FullTile) Name(mapObject *Map) string
- func (tile *FullTile) ProductionBonus(hasGaiasBlessing bool) int
- func (tile *FullTile) Valid() bool
- type MagicNode
- type Map
- func (mapObject *Map) ContainsRoad(x int, y int) bool
- func (mapObject *Map) CreateEncounter(x int, y int, encounterType EncounterType, difficulty data.DifficultySetting, ...) bool
- func (mapObject *Map) CreateEncounterRandom(x int, y int, difficulty data.DifficultySetting, plane data.Plane) bool
- func (mapObject *Map) CreateNode(x int, y int, node MagicNode, plane data.Plane, magicSetting data.MagicSetting, ...) *ExtraMagicNode
- func (mapObject *Map) DrawLayer1(camera cameralib.Camera, animationCounter uint64, imageCache *util.ImageCache, ...)
- func (mapObject *Map) DrawLayer2(camera cameralib.Camera, animationCounter uint64, imageCache *util.ImageCache, ...)
- func (mapObject *Map) DrawMinimap(screen *ebiten.Image, cities []MiniMapCity, centerX int, centerY int, ...)
- func (mapObject *Map) GetBonusTile(x int, y int) data.BonusType
- func (mapObject *Map) GetCastedVolcanoes(caster Wizard) []*ExtraVolcano
- func (mapObject *Map) GetCatchmentArea(x int, y int) map[image.Point]FullTile
- func (mapObject *Map) GetContinentTiles(x int, y int) []FullTile
- func (mapObject *Map) GetEncounter(x int, y int) *ExtraEncounter
- func (mapObject *Map) GetMagicNode(x int, y int) *ExtraMagicNode
- func (mapObject *Map) GetMeldedNodes(melder Wizard) []*ExtraMagicNode
- func (mapObject *Map) GetRoadNeighbors(x int, y int) map[Direction]bool
- func (mapObject *Map) GetSquareAreaAround(x int, y int, radius int) map[image.Point]FullTile
- func (mapObject *Map) GetTile(tileX int, tileY int) FullTile
- func (mapObject *Map) GetTileImage(tileX int, tileY int, animationCounter uint64, scaler util.Scaler) (*ebiten.Image, error)
- func (mapObject *Map) HasCorruption(x int, y int) bool
- func (mapObject *Map) HasMagicNode(x int, y int) bool
- func (mapObject *Map) HasOpenTower(x int, y int) bool
- func (mapObject *Map) HasVolcano(x int, y int) bool
- func (mapObject *Map) Height() int
- func (mapObject *Map) OnShore(x int, y int) bool
- func (mapObject *Map) RemoveBonus(x int, y int)
- func (mapObject *Map) RemoveCorruption(x int, y int)
- func (mapObject *Map) RemoveEncounter(x int, y int)
- func (mapObject *Map) RemoveRoad(x int, y int)
- func (mapObject *Map) RemoveVolcano(x int, y int)
- func (mapObject *Map) ResetCache()
- func (mapObject *Map) SetBonus(x int, y int, bonus data.BonusType)
- func (mapObject *Map) SetCorruption(x int, y int)
- func (mapObject *Map) SetPlaneTower(x int, y int)
- func (mapObject *Map) SetRoad(x int, y int, enchanted bool)
- func (mapObject *Map) SetVolcano(x int, y int, caster Wizard)
- func (mapObject *Map) TileDistance(x1 int, y1 int, x2 int, y2 int) int
- func (mapObject *Map) TileHeight() int
- func (mapObject *Map) TileWidth() int
- func (mapObject *Map) TilesPerColumn(screenHeight int) int
- func (mapObject *Map) TilesPerRow(screenWidth int) int
- func (mapObject *Map) Width() int
- func (mapObject *Map) WrapX(x int) int
- func (mapObject *Map) XDistance(x1 int, x2 int) int
- type MiniMapCity
- type Wizard
Constants ¶
This section is empty.
Variables ¶
var ExtraDrawOrder = []ExtraKind{ ExtraKindVolcano, ExtraKindCorruption, ExtraKindRoad, ExtraKindBonus, ExtraKindMagicNode, ExtraKindEncounter, ExtraKindOpenTower, }
Functions ¶
func MakeMagicNode ¶
func MakeMagicNode(kind MagicNode, magicSetting data.MagicSetting, difficulty data.DifficultySetting, plane data.Plane) (*ExtraMagicNode, *ExtraEncounter)
Types ¶
type CityProvider ¶
type EncounterType ¶
type EncounterType int
const ( // lair, plane tower, ancient temple, fallen temple, ruins, abandoned keep, dungeon EncounterTypeLair EncounterType = iota EncounterTypeCave EncounterTypePlaneTower EncounterTypeAncientTemple EncounterTypeFallenTemple EncounterTypeRuins EncounterTypeAbandonedKeep EncounterTypeDungeon EncounterTypeChaosNode EncounterTypeNatureNode EncounterTypeSorceryNode )
func (EncounterType) Name ¶
func (encounterType EncounterType) Name() string
func (EncounterType) ShortName ¶
func (encounterType EncounterType) ShortName() string
type ExtraBonus ¶
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 ExtraCorruption ¶
type ExtraCorruption struct { }
func (*ExtraCorruption) DrawLayer1 ¶
func (node *ExtraCorruption) DrawLayer1(screen *ebiten.Image, imageCache *util.ImageCache, options *ebiten.DrawImageOptions, counter uint64, tileWidth int, tileHeight int)
func (*ExtraCorruption) DrawLayer2 ¶
func (node *ExtraCorruption) 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 Budget int // used for treasure ExploredBy *set.Set[Wizard] }
lair, plane tower, etc and also the initial enemies on nodes
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 // list of points that are affected by the node Zone []image.Point // if this node is melded, then this player receives the power MeldingWizard Wizard // true if melded by a guardian spirit, otherwise false if melded by a magic spirit GuardianSpiritMeld bool Warped bool // the wizard that cast warp node (so it can be dispelled) WarpedOwner Wizard }
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) GetPower ¶
func (node *ExtraMagicNode) GetPower(magicBonus float64) float64
type ExtraOpenTower ¶
type ExtraOpenTower struct { }
func (*ExtraOpenTower) DrawLayer1 ¶
func (extra *ExtraOpenTower) DrawLayer1(screen *ebiten.Image, imageCache *util.ImageCache, options *ebiten.DrawImageOptions, counter uint64, tileWidth int, tileHeight int)
func (*ExtraOpenTower) DrawLayer2 ¶
func (extra *ExtraOpenTower) DrawLayer2(screen *ebiten.Image, imageCache *util.ImageCache, options *ebiten.DrawImageOptions, counter uint64, tileWidth int, tileHeight int)
type ExtraRoad ¶
type ExtraRoad struct { Map *Map // either cast Enchant Road, or build the road in Myrror Enchanted bool X int Y int }
func (*ExtraRoad) DrawLayer1 ¶
func (*ExtraRoad) DrawLayer2 ¶
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 ExtraVolcano ¶
type ExtraVolcano struct {
CastingWizard Wizard
}
func (*ExtraVolcano) DrawLayer1 ¶
func (node *ExtraVolcano) DrawLayer1(screen *ebiten.Image, imageCache *util.ImageCache, options *ebiten.DrawImageOptions, counter uint64, tileWidth int, tileHeight int)
func (*ExtraVolcano) DrawLayer2 ¶
func (node *ExtraVolcano) DrawLayer2(screen *ebiten.Image, imageCache *util.ImageCache, options *ebiten.DrawImageOptions, counter uint64, tileWidth int, tileHeight int)
type FullTile ¶
func (*FullTile) HasEncounter ¶
func (*FullTile) IsRiverMouth ¶
func (*FullTile) IsTouchingShore ¶
func (*FullTile) ProductionBonus ¶
percent bonus increase, 3 = 3%
type Map ¶
type Map struct { Map *terrain.Map Plane data.Plane CityProvider CityProvider // 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]map[ExtraKind]ExtraTile Data *terrain.TerrainData TileCache map[int]*ebiten.Image // contains filtered or unexported fields }
func MakeMap ¶
func MakeMap(terrainData *terrain.TerrainData, landSize int, magicSetting data.MagicSetting, difficulty data.DifficultySetting, plane data.Plane, cityProvider CityProvider, planeTowers []image.Point) *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 (*Map) CreateNode ¶
func (mapObject *Map) CreateNode(x int, y int, node MagicNode, plane data.Plane, magicSetting data.MagicSetting, difficulty data.DifficultySetting) *ExtraMagicNode
for testing purposes
func (*Map) DrawLayer1 ¶
func (mapObject *Map) DrawLayer1(camera cameralib.Camera, 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(camera cameralib.Camera, 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 (*Map) GetCastedVolcanoes ¶
func (mapObject *Map) GetCastedVolcanoes(caster Wizard) []*ExtraVolcano
func (*Map) GetCatchmentArea ¶
Returns city catchment area (5x5 square minus the corners)
func (*Map) GetContinentTiles ¶
get all the tiles that are part of the continent that contains the given x, y
func (*Map) GetEncounter ¶
func (mapObject *Map) GetEncounter(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 Wizard) []*ExtraMagicNode
func (*Map) GetRoadNeighbors ¶
returns a map where for each direction, if the value is true then there is a road there
func (*Map) GetSquareAreaAround ¶
Returns a square with a side of (radius * 2 + 1), and x, y in the center. May be useful for some spells or area effects Radius has to be >= 0
func (*Map) GetTileImage ¶
func (*Map) RemoveBonus ¶
func (*Map) RemoveCorruption ¶
func (*Map) RemoveEncounter ¶
func (*Map) RemoveRoad ¶
func (*Map) RemoveVolcano ¶
func (*Map) ResetCache ¶
func (mapObject *Map) ResetCache()
func (*Map) SetCorruption ¶
func (*Map) TileDistance ¶
distance in tiles between two points
func (*Map) TileHeight ¶
func (*Map) TilesPerColumn ¶
func (*Map) TilesPerRow ¶
type MiniMapCity ¶
type MiniMapCity interface { GetX() int GetY() int GetBanner() data.BannerType }
type Wizard ¶
type Wizard interface {
GetBanner() data.BannerType
}