Documentation
¶
Index ¶
- func CastLeftSideDistortions1(page *ebiten.Image) util.Distortion
- func CastLeftSideDistortions2(page *ebiten.Image) util.Distortion
- func CastRightSideDistortions1(page *ebiten.Image) util.Distortion
- func CastRightSideDistortions2(page *ebiten.Image) util.Distortion
- func LeftSideDistortions1(page *ebiten.Image) util.Distortion
- func LeftSideDistortions2(page *ebiten.Image) util.Distortion
- func MakeSpellBookCastUI(ui *uilib.UI, cache *lbx.LbxCache, spells Spells, charges map[Spell]int, ...) []*uilib.UIElement
- func ReadSpellDescriptions(file *lbx.LbxFile) ([]string, error)
- func ReadSpellDescriptionsFromCache(cache *lbx.LbxCache) ([]string, error)
- func RightSideDistortions1(page *ebiten.Image) util.Distortion
- func RightSideDistortions2(page *ebiten.Image) util.Distortion
- func ShowSpellBook(yield coroutine.YieldFunc, cache *lbx.LbxCache, allSpells Spells, ...)
- type EligibilityType
- type Page
- type Section
- type Spell
- type SpellRarity
- type Spells
- func (spells *Spells) AddAllSpells(more Spells)
- func (spells *Spells) AddSpell(spell Spell) bool
- func (spells Spells) CombatSpells() Spells
- func (spells *Spells) Contains(spell Spell) bool
- func (spells *Spells) Copy() Spells
- func (spells *Spells) FindById(id int) Spell
- func (spells *Spells) FindByName(name string) Spell
- func (spells Spells) GetSpellsByMagic(magic data.MagicType) Spells
- func (spells Spells) GetSpellsByRarity(rarity SpellRarity) Spells
- func (spells Spells) GetSpellsBySection(section Section) Spells
- func (spells *Spells) HasSpell(spell Spell) bool
- func (spells Spells) OverlandSpells() Spells
- func (spells *Spells) RemoveSpell(toRemove Spell)
- func (spells *Spells) RemoveSpells(toRemove Spells)
- func (spells *Spells) RemoveSpellsByMagic(magic data.MagicType)
- func (spells *Spells) ShuffleSpells()
- func (spells *Spells) SortByRarity()
- func (spells *Spells) Sub(min int, max int) Spells
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CastLeftSideDistortions1 ¶
func CastLeftSideDistortions1(page *ebiten.Image) util.Distortion
func CastLeftSideDistortions2 ¶
func CastLeftSideDistortions2(page *ebiten.Image) util.Distortion
func CastRightSideDistortions1 ¶
func CastRightSideDistortions1(page *ebiten.Image) util.Distortion
func CastRightSideDistortions2 ¶
func CastRightSideDistortions2(page *ebiten.Image) util.Distortion
func LeftSideDistortions1 ¶
func LeftSideDistortions1(page *ebiten.Image) util.Distortion
flipping the page to the left
func LeftSideDistortions2 ¶
func LeftSideDistortions2(page *ebiten.Image) util.Distortion
func MakeSpellBookCastUI ¶
func MakeSpellBookCastUI(ui *uilib.UI, cache *lbx.LbxCache, spells Spells, charges map[Spell]int, castingSkill int, currentSpell Spell, currentProgress int, overland bool, chosenCallback func(Spell, bool)) []*uilib.UIElement
FIXME: take in the wizard/player that is casting the spell chosenCallback is invoked when the spellbook ui goes away, either because the user selected a spell or because they canceled the ui if a spell is chosen then it will be passed in as the first argument to the callback along with true if the ui is cancelled then the second argument will be false
func ReadSpellDescriptions ¶
pass in desc.lbx
func RightSideDistortions1 ¶
func RightSideDistortions1(page *ebiten.Image) util.Distortion
func RightSideDistortions2 ¶
func RightSideDistortions2(page *ebiten.Image) util.Distortion
func ShowSpellBook ¶
func ShowSpellBook(yield coroutine.YieldFunc, cache *lbx.LbxCache, allSpells Spells, knownSpells Spells, researchSpells Spells, researchingSpell Spell, researchProgress int, researchPoints int, castingSkill int, learnedSpell Spell, pickResearchSpell bool, chosenSpell *Spell, drawFunc *func(screen *ebiten.Image))
three modes: * 1. when a new spell is learned, flip to the page where the spell would go and show the sparkle animation over the new spell * 2. flip to the 'research spells' page and let the user pick a new spell * 3. show book and let user flip between pages. on the 'research spells' page, show currently * researching spell as glowing text * * This function does all 3, which makes it kind of ugly and has too many parameters.
Types ¶
type EligibilityType ¶
type EligibilityType int
const ( EligibilityCombatOnly EligibilityType = 0xff EligibilityCombatOnly2 EligibilityType = 0xfe EligibilityBoth EligibilityType = 0x0 EligibilityOverlandOnly EligibilityType = 0x1 EligibilityBoth2 EligibilityType = 0x2 EligibilityOverlandOnlyFriendlyCity EligibilityType = 0x3 EligibilityBothSameCost = 0x4 EligibilityOverlandWhileBanished = 0x5 )
func (EligibilityType) CanCastInCombat ¶
func (eligibility EligibilityType) CanCastInCombat() bool
func (EligibilityType) CanCastInOverland ¶
func (eligibility EligibilityType) CanCastInOverland() bool
type Section ¶
type Section int
func (Section) HasPrevious ¶
func (Section) NextSection ¶
func (Section) PreviousSection ¶
type Spell ¶
type Spell struct { Name string Index int AiGroup int AiValue int SpellType int Section Section Realm int Eligibility EligibilityType CastCost int OverrideCost int ResearchCost int Sound int Summoned int Flag1 int Flag2 int Flag3 int // which book of magic this spell is a part of Magic data.MagicType Rarity SpellRarity }
func (Spell) IsVariableCost ¶
type SpellRarity ¶
type SpellRarity int
const ( SpellRarityCommon SpellRarity = iota SpellRarityUncommon SpellRarityRare SpellRarityVeryRare )
func (SpellRarity) String ¶
func (rarity SpellRarity) String() string
type Spells ¶
type Spells struct {
Spells []Spell
}
func ReadSpells ¶
pass in spelldat.lbx and 0
func SpellsFromArray ¶
func (*Spells) AddAllSpells ¶
func (Spells) CombatSpells ¶
the subset of spells that can be cast in combat
func (*Spells) FindByName ¶
func (Spells) GetSpellsByRarity ¶
func (spells Spells) GetSpellsByRarity(rarity SpellRarity) Spells
func (Spells) GetSpellsBySection ¶
func (Spells) OverlandSpells ¶
the subset of spells that can be cast on the overworld
func (*Spells) RemoveSpell ¶
func (*Spells) RemoveSpells ¶
func (*Spells) RemoveSpellsByMagic ¶
func (*Spells) ShuffleSpells ¶
func (spells *Spells) ShuffleSpells()
func (*Spells) SortByRarity ¶
func (spells *Spells) SortByRarity()