Documentation
¶
Index ¶
- Constants
- Variables
- type ArmorItems
- type Character
- type Effect
- type Item
- type RingPair
- type Store
- type Wizard
- func (w *Wizard) ApplyAttackEffects(c *Character)
- func (w *Wizard) ApplyDefendEffects(c *Character)
- func (w *Wizard) Attack(spell string, c *Character)
- func (w *Wizard) AvailableSpells() []string
- func (w *Wizard) CheapestAvailableSpell() string
- func (w *Wizard) Defend(c *Character)
- func (w *Wizard) DumpActiveEffects() []string
- func (w *Wizard) IsActive(ef string) bool
- func (w *Wizard) IsAvailable(spell string) bool
- func (w *Wizard) NecessarySpell(c *Character) string
Constants ¶
View Source
const ( MagicMissile = "Magic Missile" Drain = "Drain" Shield = "Shield" Poison = "Poison" Recharge = "Recharge" )
Variables ¶
View Source
var Effects = []Effect{ { Name: "Magic Missile", Cost: 53, Timer: 0, OnAttack: func(w *Wizard, c *Character) { c.HitPoints -= 4 }, OnDefend: func(w *Wizard, c *Character) {}, }, { Name: "Drain", Cost: 73, Timer: 0, OnAttack: func(w *Wizard, c *Character) { c.HitPoints -= 2 w.HitPoints += 2 }, OnDefend: func(w *Wizard, c *Character) {}, }, { Name: "Shield", Cost: 113, Timer: 6, OnAttack: func(w *Wizard, c *Character) {}, OnDefend: func(w *Wizard, c *Character) { w.Armor = 7 }, }, { Name: "Poison", Cost: 173, Timer: 6, OnAttack: func(w *Wizard, c *Character) { c.HitPoints -= 3 }, OnDefend: func(w *Wizard, c *Character) { c.HitPoints -= 3 }, }, { Name: "Recharge", Cost: 229, Timer: 5, OnAttack: func(w *Wizard, c *Character) { w.Mana += 101 }, OnDefend: func(w *Wizard, c *Character) { w.Mana += 101 }, }, }
Functions ¶
This section is empty.
Types ¶
type ArmorItems ¶
func (ArmorItems) Cost ¶
func (ais ArmorItems) Cost() int
func (ArmorItems) Items ¶
func (ais ArmorItems) Items() []*Item
type Character ¶
func NewCharacter ¶
type Effect ¶
type Store ¶
type Store struct { Weapons map[string]*Item Armor map[string]*Item DamageRings map[string]*Item ArmorRings map[string]*Item }
func (*Store) AddArmorRing ¶
func (*Store) AddDamageRing ¶
func (*Store) CheckCheapest ¶
func (*Store) CheckExpenciest ¶
type Wizard ¶
func (*Wizard) ApplyAttackEffects ¶
func (*Wizard) ApplyDefendEffects ¶
func (*Wizard) AvailableSpells ¶
func (*Wizard) CheapestAvailableSpell ¶
func (*Wizard) DumpActiveEffects ¶
func (*Wizard) IsAvailable ¶
func (*Wizard) NecessarySpell ¶
Click to show internal directories.
Click to hide internal directories.