Documentation
¶
Index ¶
- Constants
- func RenderArtifactBox(screen *ebiten.Image, imageCache *util.ImageCache, artifact Artifact, ...)
- func RenderArtifactImage(screen *ebiten.Image, imageCache *util.ImageCache, artifact Artifact, ...) *ebiten.Image
- type Artifact
- func (artifact *Artifact) AddPower(power Power)
- func (artifact *Artifact) DefenseBonus() int
- func (artifact *Artifact) FirstAbility() data.ItemAbility
- func (artifact *Artifact) GetSpellCharge() (spellbook.Spell, int)
- func (artifact *Artifact) HasAbilities() bool
- func (artifact *Artifact) HasAbility(ability data.AbilityType) bool
- func (artifact *Artifact) HasAbilityPower() bool
- func (artifact *Artifact) HasDefensePower() bool
- func (artifact *Artifact) HasEnchantment(enchantment data.UnitEnchantment) bool
- func (artifact *Artifact) HasItemAbility(ability data.ItemAbility) bool
- func (artifact *Artifact) HasMovementPower() bool
- func (artifact *Artifact) HasResistancePower() bool
- func (artifact *Artifact) HasSpellCharges() bool
- func (artifact *Artifact) HasSpellSavePower() bool
- func (artifact *Artifact) HasSpellSkillPower() bool
- func (artifact *Artifact) HasToHitPower() bool
- func (artifact *Artifact) LastAbility() data.ItemAbility
- func (artifact *Artifact) MagicAttackBonus() int
- func (artifact *Artifact) MeleeBonus() int
- func (artifact *Artifact) MovementBonus() int
- func (artifact *Artifact) RangedAttackBonus() int
- func (artifact *Artifact) RemovePower(remove Power)
- func (artifact *Artifact) ResistanceBonus() int
- func (artifact *Artifact) SpellSaveBonus() int
- func (artifact *Artifact) SpellSkillBonus() int
- func (artifact *Artifact) ToHitBonus() int
- type ArtifactFonts
- type ArtifactSlot
- type ArtifactType
- type CreationScreen
- type MagicLevel
- type Power
- type PowerType
- type Requirement
Constants ¶
View Source
const CreationScreenCostThreshold = 200 // TODO: validate this again with abilities
Variables ¶
This section is empty.
Functions ¶
func RenderArtifactBox ¶
func RenderArtifactImage ¶
func RenderArtifactImage(screen *ebiten.Image, imageCache *util.ImageCache, artifact Artifact, counter uint64, options ebiten.DrawImageOptions) *ebiten.Image
Types ¶
type Artifact ¶
type Artifact struct { Type ArtifactType Image int Name string Cost int Powers []Power Requirements []Requirement }
func MakeRandomArtifact ¶
generate an artifact with random properties
func ShowCreateArtifactScreen ¶
func ShowCreateArtifactScreen(yield coroutine.YieldFunc, cache *lbx.LbxCache, creationType CreationScreen, magicLevel MagicLevel, artificer bool, runemaster bool, availableSpells spellbook.Spells, draw *func(*ebiten.Image)) (*Artifact, bool)
returns the artifact that was created and true, * otherwise false for cancelled
func (*Artifact) DefenseBonus ¶
func (*Artifact) FirstAbility ¶
func (artifact *Artifact) FirstAbility() data.ItemAbility
func (*Artifact) GetSpellCharge ¶
returns the spell and how many charges it has
func (*Artifact) HasAbilities ¶
if true then generally this artifact should be rendered with a glow around it
func (*Artifact) HasAbility ¶
func (artifact *Artifact) HasAbility(ability data.AbilityType) bool
func (*Artifact) HasAbilityPower ¶
func (*Artifact) HasDefensePower ¶
func (*Artifact) HasEnchantment ¶
func (artifact *Artifact) HasEnchantment(enchantment data.UnitEnchantment) bool
func (*Artifact) HasItemAbility ¶
func (artifact *Artifact) HasItemAbility(ability data.ItemAbility) bool
func (*Artifact) HasMovementPower ¶
func (*Artifact) HasResistancePower ¶
func (*Artifact) HasSpellCharges ¶
func (*Artifact) HasSpellSavePower ¶
func (*Artifact) HasSpellSkillPower ¶
func (*Artifact) HasToHitPower ¶
func (*Artifact) LastAbility ¶
func (artifact *Artifact) LastAbility() data.ItemAbility
func (*Artifact) MagicAttackBonus ¶
func (*Artifact) MeleeBonus ¶
func (*Artifact) MovementBonus ¶
func (*Artifact) RangedAttackBonus ¶
func (*Artifact) RemovePower ¶
func (*Artifact) ResistanceBonus ¶
func (*Artifact) SpellSaveBonus ¶
func (*Artifact) SpellSkillBonus ¶
func (*Artifact) ToHitBonus ¶
type ArtifactFonts ¶
type ArtifactSlot ¶
type ArtifactSlot int
const ( ArtifactSlotMeleeWeapon ArtifactSlot = iota ArtifactSlotRangedWeapon ArtifactSlotMagicWeapon ArtifactSlotAnyWeapon ArtifactSlotArmor ArtifactSlotJewelry )
func (ArtifactSlot) CompatibleWith ¶
func (slot ArtifactSlot) CompatibleWith(kind ArtifactType) bool
func (ArtifactSlot) ImageIndex ¶
func (slot ArtifactSlot) ImageIndex() int
the index in itemisc.lbx for this slot
type ArtifactType ¶
type ArtifactType int
const ( ArtifactTypeNone ArtifactType = iota ArtifactTypeSword ArtifactTypeMace ArtifactTypeAxe ArtifactTypeBow ArtifactTypeStaff ArtifactTypeWand ArtifactTypeMisc ArtifactTypeShield ArtifactTypeChain ArtifactTypePlate )
func (ArtifactType) Name ¶
func (a ArtifactType) Name() string
func (ArtifactType) String ¶
func (a ArtifactType) String() string
type CreationScreen ¶
type CreationScreen int
the screen can be invoked as either the 'Enchant Item' spell or 'Create Artifact'
const ( CreationEnchantItem CreationScreen = iota CreationCreateArtifact )
type MagicLevel ¶
type MagicLevel interface { // for a given magic type, returns the number of books of that magic MagicLevel(kind data.MagicType) int }
a way to know how many books of magic the wizard has
type Power ¶
type Power struct { Type PowerType Amount int // for an ability this is the number of books of the Magic needed Name string Ability data.ItemAbility Magic data.MagicType // for abilities Spell spellbook.Spell SpellCharges int // powers are sorted by how they are defined in itempow.lbx, so we just use that number here // this field has no utility other than sorting Index int }
type Requirement ¶
Click to show internal directories.
Click to hide internal directories.