hero

package
v0.0.0-...-e988257 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadNames

func ReadNames(cache *lbx.LbxCache) ([]string, error)

func ReadNamesPerWizard

func ReadNamesPerWizard(cache *lbx.LbxCache) map[int]map[HeroType]string

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 MakeHero

func MakeHero(unit *units.OverworldUnit, heroType HeroType, name string) *Hero

func MakeHeroSimple

func MakeHeroSimple(heroType HeroType) *Hero

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 *Hero) AddExperience(amount int)

func (*Hero) AdjustHealth

func (hero *Hero) AdjustHealth(amount int)

func (*Hero) CanTouchAttack

func (hero *Hero) CanTouchAttack(damage units.Damage) bool

func (*Hero) FullName

func (hero *Hero) FullName() string

func (*Hero) GainLevel

func (hero *Hero) GainLevel(maxLevel units.HeroExperienceLevel)

force hero to go up one level

func (*Hero) GetAbilities

func (hero *Hero) GetAbilities() []data.Ability

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

func (hero *Hero) GetAbilityDefense() int

any added resistance from abilities (agility)

func (*Hero) GetAbilityExperienceBonus

func (hero *Hero) GetAbilityExperienceBonus() int

extra experience points to apply to all normal units in the same stack as the hero

func (*Hero) GetAbilityFame

func (hero *Hero) GetAbilityFame() int

added fame to the wizard

func (*Hero) GetAbilityHealth

func (hero *Hero) GetAbilityHealth() int

func (*Hero) GetAbilityLeadership

func (hero *Hero) GetAbilityLeadership() int

func (*Hero) GetAbilityMagicRangedAttack

func (hero *Hero) GetAbilityMagicRangedAttack() int

func (*Hero) GetAbilityMelee

func (hero *Hero) GetAbilityMelee() int

func (*Hero) GetAbilityRangedAttack

func (hero *Hero) GetAbilityRangedAttack() int

func (*Hero) GetAbilityReference

func (hero *Hero) GetAbilityReference(ability data.AbilityType) *data.Ability

func (*Hero) GetAbilityResearch

func (hero *Hero) GetAbilityResearch() int

extra research points to apply at each turn

func (*Hero) GetAbilityResistance

func (hero *Hero) GetAbilityResistance() int

func (*Hero) GetAbilityToHit

func (hero *Hero) GetAbilityToHit() int

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 *Hero) GetArtifacts() []*artifact.Artifact

func (*Hero) GetAttackSound

func (hero *Hero) GetAttackSound() units.AttackSound

func (*Hero) GetBanner

func (hero *Hero) GetBanner() data.BannerType

func (*Hero) GetBaseDefense

func (hero *Hero) GetBaseDefense() int

func (*Hero) GetBaseHitPoints

func (hero *Hero) GetBaseHitPoints() int

func (*Hero) GetBaseMeleeAttackPower

func (hero *Hero) GetBaseMeleeAttackPower() int

func (*Hero) GetBaseProgression

func (hero *Hero) GetBaseProgression() []string

func (*Hero) GetBaseRangedAttackPower

func (hero *Hero) GetBaseRangedAttackPower() int

func (*Hero) GetBaseResistance

func (hero *Hero) GetBaseResistance() int

func (*Hero) GetBusy

func (hero *Hero) GetBusy() units.BusyStatus

func (*Hero) GetCombatIndex

func (hero *Hero) GetCombatIndex(facing units.Facing) int

func (*Hero) GetCombatLbxFile

func (hero *Hero) GetCombatLbxFile() string

func (*Hero) GetCombatRangeIndex

func (hero *Hero) GetCombatRangeIndex(facing units.Facing) int

func (*Hero) GetCount

func (hero *Hero) GetCount() int

func (*Hero) GetDefense

func (hero *Hero) GetDefense() int

func (*Hero) GetEnchantments

func (hero *Hero) GetEnchantments() []data.UnitEnchantment

func (*Hero) GetExperience

func (hero *Hero) GetExperience() int

func (*Hero) GetExperienceData

func (hero *Hero) GetExperienceData() units.ExperienceData

func (*Hero) GetExperienceLevel

func (hero *Hero) GetExperienceLevel() units.NormalExperienceLevel

func (*Hero) GetHealth

func (hero *Hero) GetHealth() int

func (*Hero) GetHeroExperienceLevel

func (hero *Hero) GetHeroExperienceLevel() units.HeroExperienceLevel

func (*Hero) GetHireFee

func (hero *Hero) GetHireFee() int

fee is halved if the hiring wizard is charismatic, handle that elsewhere

func (*Hero) GetHitPoints

func (hero *Hero) GetHitPoints() int

func (*Hero) GetKnownSpells

func (hero *Hero) GetKnownSpells() []string

func (*Hero) GetLbxFile

func (hero *Hero) GetLbxFile() string

func (*Hero) GetLbxIndex

func (hero *Hero) GetLbxIndex() int

func (*Hero) GetMaxHealth

func (hero *Hero) GetMaxHealth() int

func (*Hero) GetMeleeAttackPower

func (hero *Hero) GetMeleeAttackPower() int

func (*Hero) GetMovementSound

func (hero *Hero) GetMovementSound() units.MovementSound

func (*Hero) GetMovementSpeed

func (hero *Hero) GetMovementSpeed() int

func (*Hero) GetMovesLeft

func (hero *Hero) GetMovesLeft() fraction.Fraction

func (*Hero) GetName

func (hero *Hero) GetName() string

func (*Hero) GetPlane

func (hero *Hero) GetPlane() data.Plane

func (*Hero) GetPortraitLbxInfo

func (hero *Hero) GetPortraitLbxInfo() (string, int)

func (*Hero) GetProductionCost

func (hero *Hero) GetProductionCost() int

func (*Hero) GetRace

func (hero *Hero) GetRace() data.Race

func (*Hero) GetRangeAttackSound

func (hero *Hero) GetRangeAttackSound() units.RangeAttackSound

func (*Hero) GetRangedAttackDamageType

func (hero *Hero) GetRangedAttackDamageType() units.Damage

func (*Hero) GetRangedAttackPower

func (hero *Hero) GetRangedAttackPower() int

func (*Hero) GetRangedAttacks

func (hero *Hero) GetRangedAttacks() int

func (*Hero) GetRawUnit

func (hero *Hero) GetRawUnit() units.Unit

func (*Hero) GetRealm

func (hero *Hero) GetRealm() data.MagicType

heroes are never part of a magic realm (life, death, etc)

func (*Hero) GetRequiredFame

func (hero *Hero) GetRequiredFame() int

func (*Hero) GetResistance

func (hero *Hero) GetResistance() int

func (*Hero) GetSightRange

func (hero *Hero) GetSightRange() int

func (*Hero) GetSpellChargeSpells

func (hero *Hero) GetSpellChargeSpells() map[spellbook.Spell]int

func (*Hero) GetTitle

func (hero *Hero) GetTitle() string

func (*Hero) GetToHitMelee

func (hero *Hero) GetToHitMelee() int

func (*Hero) GetUpkeepFood

func (hero *Hero) GetUpkeepFood() int

func (*Hero) GetUpkeepGold

func (hero *Hero) GetUpkeepGold() int

func (*Hero) GetUpkeepMana

func (hero *Hero) GetUpkeepMana() int

func (*Hero) GetWeaponBonus

func (hero *Hero) GetWeaponBonus() data.WeaponBonus

func (*Hero) GetX

func (hero *Hero) GetX() int

func (*Hero) GetY

func (hero *Hero) GetY() int

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) HasItem

func (hero *Hero) HasItem(itemType artifact.ArtifactType) bool

func (*Hero) HasItemAbility

func (hero *Hero) HasItemAbility(ability data.ItemAbility) bool

func (*Hero) IsChampion

func (hero *Hero) IsChampion() bool

func (*Hero) IsFlying

func (hero *Hero) IsFlying() bool

func (*Hero) IsHero

func (hero *Hero) IsHero() bool

func (*Hero) IsLandWalker

func (hero *Hero) IsLandWalker() bool

func (*Hero) IsSailing

func (hero *Hero) IsSailing() bool

func (*Hero) IsSwimmer

func (hero *Hero) IsSwimmer() bool

func (*Hero) IsUndead

func (hero *Hero) IsUndead() bool

func (*Hero) Move

func (hero *Hero) Move(dx int, dy int, cost fraction.Fraction, normalize units.NormalizeCoordinateFunc)

func (*Hero) NaturalHeal

func (hero *Hero) NaturalHeal(rate float64)

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) SetExtraAbilities

func (hero *Hero) SetExtraAbilities()

add N random abilities

func (*Hero) SetId

func (hero *Hero) SetId(id uint64)

func (*Hero) SetMovesLeft

func (hero *Hero) SetMovesLeft(moves fraction.Fraction)

func (*Hero) SetName

func (hero *Hero) SetName(name string)

func (*Hero) SetPlane

func (hero *Hero) SetPlane(plane data.Plane)

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

func (*Hero) SetX

func (hero *Hero) SetX(x int)

func (*Hero) SetY

func (hero *Hero) SetY(y int)

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 HeroType) DefaultName() string

func (HeroType) GetRequiredFame

func (heroType HeroType) GetRequiredFame() int

func (HeroType) GetUnit

func (heroType HeroType) GetUnit() units.Unit

func (HeroType) RandomAbilityCount

func (heroType HeroType) RandomAbilityCount() int

func (HeroType) RandomAbilityType

func (heroType HeroType) RandomAbilityType() abilityChoice

Jump to

Keyboard shortcuts

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