Documentation ¶
Index ¶
- type AIBehavior
- type AICreateUnitDecision
- type AIDecision
- type AIMoveStackDecision
- type ActiveMap
- type PathFinder
- type Player
- func (player *Player) AddCity(city *citylib.City) *citylib.City
- func (player *Player) AddHero(hero *herolib.Hero) bool
- func (player *Player) AddStack(stack *UnitStack)
- func (player *Player) AddUnit(unit units.StackUnit) units.StackUnit
- func (player *Player) AliveHeroes() []*herolib.Hero
- func (player *Player) AllianceWithPlayer(other *Player)
- func (player *Player) AwarePlayer(other *Player)
- func (player *Player) CastingSkillPerTurn(power int) int
- func (player *Player) ComputeCastingSkill() int
- func (player *Player) FindCity(x int, y int) *citylib.City
- func (player *Player) FindFortressCity() *citylib.City
- func (player *Player) FindStack(x int, y int) *UnitStack
- func (player *Player) FindStackByUnit(unit units.StackUnit) *UnitStack
- func (player *Player) FindSummoningCity() *citylib.City
- func (player *Player) FoodPerTurn() int
- func (player *Player) GetBanner() data.BannerType
- func (player *Player) GetFog(plane data.Plane) [][]bool
- func (player *Player) GetKnownPlayers() []*Player
- func (player *Player) GetUnits(x int, y int) []units.StackUnit
- func (player *Player) GoldPerTurn() int
- func (player *Player) IsAI() bool
- func (player *Player) IsHuman() bool
- func (player *Player) LearnSpell(spell spellbook.Spell)
- func (player *Player) LiftFog(x int, y int, radius int, plane data.Plane)
- func (player *Player) LiftFogSquare(x int, y int, squares int, plane data.Plane)
- func (player *Player) MakeExperienceInfo() units.ExperienceInfo
- func (player *Player) ManaPerTurn(power int) int
- func (player *Player) MergeStacks(stack1 *UnitStack, stack2 *UnitStack) *UnitStack
- func (player *Player) PactWithPlayer(other *Player)
- func (player *Player) RemoveCity(city *citylib.City)
- func (player *Player) RemoveUnit(unit units.StackUnit)
- func (player *Player) SetSelectedStack(stack *UnitStack)
- func (player *Player) SpellResearchPerTurn(power int) float64
- func (player *Player) TotalUnitUpkeepFood() int
- func (player *Player) TotalUnitUpkeepGold() int
- func (player *Player) TotalUnitUpkeepMana() int
- func (player *Player) UpdateResearchCandidates()
- func (player *Player) UpdateTaxRate(rate fraction.Fraction)
- func (player *Player) WarWithPlayer(other *Player)
- func (player *Player) WrapX(x int) int
- type PowerDistribution
- type Relationship
- type UnitStack
- func (stack *UnitStack) ActiveUnits() []units.StackUnit
- func (stack *UnitStack) AddUnit(unit units.StackUnit)
- func (stack *UnitStack) AllFlyers() bool
- func (stack *UnitStack) ContainsUnit(unit units.StackUnit) bool
- func (stack *UnitStack) EnableMovers()
- func (stack *UnitStack) ExhaustMoves()
- func (stack *UnitStack) HasMoves() bool
- func (stack *UnitStack) InactiveUnits() []units.StackUnit
- func (stack *UnitStack) IsActive(unit units.StackUnit) bool
- func (stack *UnitStack) IsEmpty() bool
- func (stack *UnitStack) Leader() units.StackUnit
- func (stack *UnitStack) Move(dx int, dy int, cost fraction.Fraction)
- func (stack *UnitStack) NaturalHeal(rate float64)
- func (stack *UnitStack) OffsetX() float64
- func (stack *UnitStack) OffsetY() float64
- func (stack *UnitStack) OutOfMoves() bool
- func (stack *UnitStack) Plane() data.Plane
- func (stack *UnitStack) RemoveUnit(unit units.StackUnit)
- func (stack *UnitStack) RemoveUnits(units []units.StackUnit)
- func (stack *UnitStack) ResetMoves()
- func (stack *UnitStack) SetOffset(x float64, y float64)
- func (stack *UnitStack) SetPlane(plane data.Plane)
- func (stack *UnitStack) ToggleActive(unit units.StackUnit)
- func (stack *UnitStack) Units() []units.StackUnit
- func (stack *UnitStack) X() int
- func (stack *UnitStack) Y() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AIBehavior ¶
type AIBehavior interface { Update(*Player, []*Player, PathFinder) []AIDecision NewTurn() }
type AICreateUnitDecision ¶
type AIDecision ¶
type AIDecision interface { }
type AIMoveStackDecision ¶
type PathFinder ¶
type Player ¶
type Player struct { // matrix the same size as the map, where true means the player can see the tile // and false means the tile has not yet been discovered ArcanusFog [][]bool MyrrorFog [][]bool TaxRate fraction.Fraction Gold int Mana int Human bool Defeated bool Fame int // used to seed the random number generator for generating the order of how magic books are drawn BookOrderSeed1 uint64 BookOrderSeed2 uint64 // known spells KnownSpells spellbook.Spells // the full set of spells that can be known by the wizard ResearchPoolSpells spellbook.Spells // spells that can be researched ResearchCandidateSpells spellbook.Spells GlobalEnchantments *set.Set[data.Enchantment] PowerDistribution PowerDistribution AIBehavior AIBehavior // relations with other players (treaties, etc) PlayerRelations map[*Player]*Relationship Heroes [6]*herolib.Hero VaultEquipment [4]*artifact.Artifact // total power points put into the casting skill CastingSkillPower int // how much casting skill remains in this turn RemainingCastingSkill int ResearchingSpell spellbook.Spell ResearchProgress int // current spell being cast CastingSpell spellbook.Spell // how much mana has been put towards the current spell. When this value equals // the spell's casting cost, the spell is cast CastingSpellProgress int // the artifact currently being created by a spell cast of Create Artifact or Enchant Item CreateArtifact *artifact.Artifact Wizard setup.WizardCustom Units []units.StackUnit Stacks []*UnitStack Cities []*citylib.City // counter for the next created unit owned by this player UnitId uint64 SelectedStack *UnitStack }
func MakePlayer ¶
func (*Player) AliveHeroes ¶
func (*Player) AllianceWithPlayer ¶
func (*Player) AwarePlayer ¶
this player should now be aware of the other player
func (*Player) CastingSkillPerTurn ¶
func (*Player) ComputeCastingSkill ¶
func (*Player) FindFortressCity ¶
return the city that contains the summoning circle
func (*Player) FindStackByUnit ¶
func (*Player) FindSummoningCity ¶
return the city that contains the summoning circle
func (*Player) FoodPerTurn ¶
func (*Player) GetBanner ¶
func (player *Player) GetBanner() data.BannerType
func (*Player) GetKnownPlayers ¶
func (*Player) GoldPerTurn ¶
func (*Player) LearnSpell ¶
func (*Player) LiftFogSquare ¶
func (*Player) MakeExperienceInfo ¶
func (player *Player) MakeExperienceInfo() units.ExperienceInfo
func (*Player) ManaPerTurn ¶
func (*Player) MergeStacks ¶
func (*Player) PactWithPlayer ¶
func (*Player) RemoveCity ¶
func (*Player) RemoveUnit ¶
func (*Player) SetSelectedStack ¶
func (*Player) SpellResearchPerTurn ¶
func (*Player) TotalUnitUpkeepFood ¶
func (*Player) TotalUnitUpkeepGold ¶
func (*Player) TotalUnitUpkeepMana ¶
func (*Player) UpdateResearchCandidates ¶
func (player *Player) UpdateResearchCandidates()
fill up the research candidate spells so that there are at most 8. * choose spells from the research pool that are not already known, but preferring * lower rarity spells first.
func (*Player) UpdateTaxRate ¶
func (*Player) WarWithPlayer ¶
type PowerDistribution ¶
in the magic screen, power is distributed across the 3 categories
type Relationship ¶
type Relationship struct {
Treaty data.TreatyType
}
type UnitStack ¶
type UnitStack struct { CurrentPath pathfinding.Path // contains filtered or unexported fields }
func MakeUnitStack ¶
func MakeUnitStack() *UnitStack
func MakeUnitStackFromUnits ¶
func (*UnitStack) ActiveUnits ¶
func (*UnitStack) EnableMovers ¶
func (stack *UnitStack) EnableMovers()
func (*UnitStack) ExhaustMoves ¶
func (stack *UnitStack) ExhaustMoves()
func (*UnitStack) InactiveUnits ¶
func (*UnitStack) NaturalHeal ¶
func (*UnitStack) OutOfMoves ¶
true if no unit has any moves left
func (*UnitStack) RemoveUnit ¶
func (*UnitStack) RemoveUnits ¶
func (*UnitStack) ResetMoves ¶
func (stack *UnitStack) ResetMoves()
func (*UnitStack) ToggleActive ¶
Click to show internal directories.
Click to hide internal directories.