Documentation
¶
Index ¶
- func ReadNames(cache *lbx.LbxCache) ([]string, error)
- func ReadNamesPerWizard(cache *lbx.LbxCache) map[int]map[HeroType]string
- type Hero
- func (hero *Hero) AddAbility(ability data.AbilityType) bool
- func (hero *Hero) AddEnchantment(enchantment data.UnitEnchantment)
- func (hero *Hero) AddExperience(amount int)
- func (hero *Hero) AdjustHealth(amount int)
- func (hero *Hero) CanTouchAttack(damage units.Damage) bool
- func (hero *Hero) FullName() string
- func (hero *Hero) GainLevel(maxLevel units.HeroExperienceLevel)
- func (hero *Hero) GetAbilities() []data.Ability
- func (hero *Hero) GetAbilityBonus(ability data.AbilityType) int
- func (hero *Hero) GetAbilityDefense() int
- func (hero *Hero) GetAbilityExperienceBonus() int
- func (hero *Hero) GetAbilityFame() int
- func (hero *Hero) GetAbilityHealth() int
- func (hero *Hero) GetAbilityLeadership() int
- func (hero *Hero) GetAbilityMagicRangedAttack() int
- func (hero *Hero) GetAbilityMelee() int
- func (hero *Hero) GetAbilityRangedAttack() int
- func (hero *Hero) GetAbilityReference(ability data.AbilityType) *data.Ability
- func (hero *Hero) GetAbilityResearch() int
- func (hero *Hero) GetAbilityResistance() int
- func (hero *Hero) GetAbilityToHit() int
- func (hero *Hero) GetAbilityValue(ability data.AbilityType) float32
- func (hero *Hero) GetArtifactSlots() []artifact.ArtifactSlot
- func (hero *Hero) GetArtifacts() []*artifact.Artifact
- func (hero *Hero) GetAttackSound() units.AttackSound
- func (hero *Hero) GetBanner() data.BannerType
- func (hero *Hero) GetBaseDefense() int
- func (hero *Hero) GetBaseHitPoints() int
- func (hero *Hero) GetBaseMeleeAttackPower() int
- func (hero *Hero) GetBaseProgression() []string
- func (hero *Hero) GetBaseRangedAttackPower() int
- func (hero *Hero) GetBaseResistance() int
- func (hero *Hero) GetBusy() units.BusyStatus
- func (hero *Hero) GetCombatIndex(facing units.Facing) int
- func (hero *Hero) GetCombatLbxFile() string
- func (hero *Hero) GetCombatRangeIndex(facing units.Facing) int
- func (hero *Hero) GetCount() int
- func (hero *Hero) GetDefense() int
- func (hero *Hero) GetEnchantments() []data.UnitEnchantment
- func (hero *Hero) GetExperience() int
- func (hero *Hero) GetExperienceData() units.ExperienceData
- func (hero *Hero) GetExperienceLevel() units.NormalExperienceLevel
- func (hero *Hero) GetHealth() int
- func (hero *Hero) GetHeroExperienceLevel() units.HeroExperienceLevel
- func (hero *Hero) GetHireFee() int
- func (hero *Hero) GetHitPoints() int
- func (hero *Hero) GetKnownSpells() []string
- func (hero *Hero) GetLbxFile() string
- func (hero *Hero) GetLbxIndex() int
- func (hero *Hero) GetMaxHealth() int
- func (hero *Hero) GetMeleeAttackPower() int
- func (hero *Hero) GetMovementSound() units.MovementSound
- func (hero *Hero) GetMovementSpeed() int
- func (hero *Hero) GetMovesLeft() fraction.Fraction
- func (hero *Hero) GetName() string
- func (hero *Hero) GetPlane() data.Plane
- func (hero *Hero) GetPortraitLbxInfo() (string, int)
- func (hero *Hero) GetProductionCost() int
- func (hero *Hero) GetRace() data.Race
- func (hero *Hero) GetRangeAttackSound() units.RangeAttackSound
- func (hero *Hero) GetRangedAttackDamageType() units.Damage
- func (hero *Hero) GetRangedAttackPower() int
- func (hero *Hero) GetRangedAttacks() int
- func (hero *Hero) GetRawUnit() units.Unit
- func (hero *Hero) GetRealm() data.MagicType
- func (hero *Hero) GetRequiredFame() int
- func (hero *Hero) GetResistance() int
- func (hero *Hero) GetSightRange() int
- func (hero *Hero) GetSpellChargeSpells() map[spellbook.Spell]int
- func (hero *Hero) GetTitle() string
- func (hero *Hero) GetToHitMelee() int
- func (hero *Hero) GetUpkeepFood() int
- func (hero *Hero) GetUpkeepGold() int
- func (hero *Hero) GetUpkeepMana() int
- func (hero *Hero) GetWeaponBonus() data.WeaponBonus
- func (hero *Hero) GetX() int
- func (hero *Hero) GetY() int
- func (hero *Hero) HasAbility(ability data.AbilityType) bool
- func (hero *Hero) HasEnchantment(enchantment data.UnitEnchantment) bool
- func (hero *Hero) HasItem(itemType artifact.ArtifactType) bool
- func (hero *Hero) HasItemAbility(ability data.ItemAbility) bool
- func (hero *Hero) IsChampion() bool
- func (hero *Hero) IsFlying() bool
- func (hero *Hero) IsHero() bool
- func (hero *Hero) IsLandWalker() bool
- func (hero *Hero) IsSailing() bool
- func (hero *Hero) IsSwimmer() bool
- func (hero *Hero) IsUndead() bool
- func (hero *Hero) Move(dx int, dy int, cost fraction.Fraction, ...)
- func (hero *Hero) NaturalHeal(rate float64)
- func (hero *Hero) RemoveEnchantment(enchantment data.UnitEnchantment)
- func (hero *Hero) ResetMoves()
- func (hero *Hero) ResetOwner()
- func (hero *Hero) SetBanner(banner data.BannerType)
- func (hero *Hero) SetBusy(busy units.BusyStatus)
- func (hero *Hero) SetExperienceInfo(info units.ExperienceInfo)
- func (hero *Hero) SetExtraAbilities()
- func (hero *Hero) SetId(id uint64)
- func (hero *Hero) SetMovesLeft(moves fraction.Fraction)
- func (hero *Hero) SetName(name string)
- func (hero *Hero) SetPlane(plane data.Plane)
- func (hero *Hero) SetStatus(status HeroStatus)
- func (hero *Hero) SetWeaponBonus(bonus data.WeaponBonus)
- func (hero *Hero) SetX(x int)
- func (hero *Hero) SetY(y int)
- type HeroStatus
- type HeroType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Hero ¶
type Hero struct { Unit *units.OverworldUnit HeroType HeroType Name string Status HeroStatus // set at start of game Abilities []data.Ability Equipment [3]*artifact.Artifact }
func MakeHeroSimple ¶
func (*Hero) AddAbility ¶
func (hero *Hero) AddAbility(ability data.AbilityType) bool
returns true if the ability is added. some abilities cannot be added in case the hero already has a super version of that ability, or the limit of 1 is reached for others
func (*Hero) AddEnchantment ¶
func (hero *Hero) AddEnchantment(enchantment data.UnitEnchantment)
func (*Hero) AddExperience ¶
func (*Hero) AdjustHealth ¶
func (*Hero) GainLevel ¶
func (hero *Hero) GainLevel(maxLevel units.HeroExperienceLevel)
force hero to go up one level
func (*Hero) GetAbilities ¶
func (*Hero) GetAbilityBonus ¶
func (hero *Hero) GetAbilityBonus(ability data.AbilityType) int
returns a number that corresponds to the bonus this ability would apply. Might on a champion would return 5 Super Agility on a captain would return 4
func (*Hero) GetAbilityDefense ¶
any added resistance from abilities (agility)
func (*Hero) GetAbilityExperienceBonus ¶
extra experience points to apply to all normal units in the same stack as the hero
func (*Hero) GetAbilityHealth ¶
func (*Hero) GetAbilityLeadership ¶
func (*Hero) GetAbilityMagicRangedAttack ¶
func (*Hero) GetAbilityMelee ¶
func (*Hero) GetAbilityRangedAttack ¶
func (*Hero) GetAbilityReference ¶
func (hero *Hero) GetAbilityReference(ability data.AbilityType) *data.Ability
func (*Hero) GetAbilityResearch ¶
extra research points to apply at each turn
func (*Hero) GetAbilityResistance ¶
func (*Hero) GetAbilityToHit ¶
func (*Hero) GetAbilityValue ¶
func (hero *Hero) GetAbilityValue(ability data.AbilityType) float32
func (*Hero) GetArtifactSlots ¶
func (hero *Hero) GetArtifactSlots() []artifact.ArtifactSlot
func (*Hero) GetArtifacts ¶
func (*Hero) GetAttackSound ¶
func (hero *Hero) GetAttackSound() units.AttackSound
func (*Hero) GetBanner ¶
func (hero *Hero) GetBanner() data.BannerType
func (*Hero) GetBaseDefense ¶
func (*Hero) GetBaseHitPoints ¶
func (*Hero) GetBaseMeleeAttackPower ¶
func (*Hero) GetBaseProgression ¶
func (*Hero) GetBaseRangedAttackPower ¶
func (*Hero) GetBaseResistance ¶
func (*Hero) GetBusy ¶
func (hero *Hero) GetBusy() units.BusyStatus
func (*Hero) GetCombatLbxFile ¶
func (*Hero) GetDefense ¶
func (*Hero) GetEnchantments ¶
func (hero *Hero) GetEnchantments() []data.UnitEnchantment
func (*Hero) GetExperience ¶
func (*Hero) GetExperienceData ¶
func (hero *Hero) GetExperienceData() units.ExperienceData
func (*Hero) GetExperienceLevel ¶
func (hero *Hero) GetExperienceLevel() units.NormalExperienceLevel
func (*Hero) GetHeroExperienceLevel ¶
func (hero *Hero) GetHeroExperienceLevel() units.HeroExperienceLevel
func (*Hero) GetHireFee ¶
fee is halved if the hiring wizard is charismatic, handle that elsewhere
func (*Hero) GetHitPoints ¶
func (*Hero) GetKnownSpells ¶
func (*Hero) GetLbxFile ¶
func (*Hero) GetLbxIndex ¶
func (*Hero) GetMaxHealth ¶
func (*Hero) GetMeleeAttackPower ¶
func (*Hero) GetMovementSound ¶
func (hero *Hero) GetMovementSound() units.MovementSound
func (*Hero) GetMovementSpeed ¶
func (*Hero) GetMovesLeft ¶
func (*Hero) GetPortraitLbxInfo ¶
func (*Hero) GetProductionCost ¶
func (*Hero) GetRangeAttackSound ¶
func (hero *Hero) GetRangeAttackSound() units.RangeAttackSound
func (*Hero) GetRangedAttackDamageType ¶
func (*Hero) GetRangedAttackPower ¶
func (*Hero) GetRangedAttacks ¶
func (*Hero) GetRawUnit ¶
func (*Hero) GetRequiredFame ¶
func (*Hero) GetResistance ¶
func (*Hero) GetSightRange ¶
func (*Hero) GetSpellChargeSpells ¶
func (*Hero) GetToHitMelee ¶
func (*Hero) GetUpkeepFood ¶
func (*Hero) GetUpkeepGold ¶
func (*Hero) GetUpkeepMana ¶
func (*Hero) GetWeaponBonus ¶
func (hero *Hero) GetWeaponBonus() data.WeaponBonus
func (*Hero) HasAbility ¶
func (hero *Hero) HasAbility(ability data.AbilityType) bool
func (*Hero) HasEnchantment ¶
func (hero *Hero) HasEnchantment(enchantment data.UnitEnchantment) bool
note that HasEnchantment is not the same as contains(GetEnchantments(), enchantment) because HasEnchantment will search in the artifacts as well. GetEnchantments will only return the enchantments that have been explicitly cast on a unit
func (*Hero) HasItemAbility ¶
func (hero *Hero) HasItemAbility(ability data.ItemAbility) bool
func (*Hero) IsChampion ¶
func (*Hero) IsLandWalker ¶
func (*Hero) NaturalHeal ¶
func (*Hero) RemoveEnchantment ¶
func (hero *Hero) RemoveEnchantment(enchantment data.UnitEnchantment)
func (*Hero) ResetMoves ¶
func (hero *Hero) ResetMoves()
func (*Hero) ResetOwner ¶
func (hero *Hero) ResetOwner()
func (*Hero) SetBanner ¶
func (hero *Hero) SetBanner(banner data.BannerType)
func (*Hero) SetBusy ¶
func (hero *Hero) SetBusy(busy units.BusyStatus)
func (*Hero) SetExperienceInfo ¶
func (hero *Hero) SetExperienceInfo(info units.ExperienceInfo)
func (*Hero) SetMovesLeft ¶
func (*Hero) SetStatus ¶
func (hero *Hero) SetStatus(status HeroStatus)
func (*Hero) SetWeaponBonus ¶
func (hero *Hero) SetWeaponBonus(bonus data.WeaponBonus)
for mythril/adamantium, heroes dont use those
type HeroStatus ¶
type HeroStatus int
const ( StatusAvailable HeroStatus = iota StatusEmployed StatusDead )
type HeroType ¶
type HeroType int
const ( HeroTorin HeroType = iota HeroFang HeroBShan HeroMorgana HeroWarrax HeroMysticX HeroBahgtru HeroDethStryke HeroSpyder HeroSirHarold HeroBrax HeroRavashack HeroGreyfairer HeroShalla HeroRoland HeroMalleus HeroMortu HeroGunther HeroRakir HeroJaer HeroTaki HeroYramrag HeroValana HeroElana HeroAerie HeroMarcus HeroReywind HeroAlorra HeroZaldron HeroShinBo HeroSerena HeroShuri HeroTheria HeroTumu HeroAureus )
func AllHeroTypes ¶
func AllHeroTypes() []HeroType
func (HeroType) DefaultName ¶
func (HeroType) GetRequiredFame ¶
func (HeroType) RandomAbilityCount ¶
func (HeroType) RandomAbilityType ¶
func (heroType HeroType) RandomAbilityType() abilityChoice