Documentation ¶
Index ¶
- Variables
- func CalcAttack(prog string) (int, int)
- func CalcHP(prog string) (int, int)
- func LoadCards(cardFile string)
- func Random(min int, max int) int
- func Register(id string, newfunc AbilityCtor)
- type Ability
- type AbilityCtor
- type Backstab
- type Blight
- type Card
- func (card *Card) AttackAndHitPointsString() string
- func (card *Card) CalculateAttack() int
- func (card *Card) CalculateHitPoints() int
- func (card *Card) Heal(amount int)
- func (card *Card) Init()
- func (card *Card) LoseAttack(amount int) (remainingAtk int)
- func (card *Card) TakeDamage(amount int) (remainingHP int)
- type CardContainer
- func (cc *CardContainer) AddCard(card *Card)
- func (cc *CardContainer) CardAtSlot(slotNum int) *Card
- func (cc *CardContainer) Collapse()
- func (cc *CardContainer) DoesContain(card *Card) bool
- func (cc *CardContainer) DrawCard() *Card
- func (cc *CardContainer) GetSlotNumForCard(card *Card) int
- func (cc *CardContainer) KillCard(card *Card)
- func (cc *CardContainer) PrintCards()
- func (cc *CardContainer) RemoveCard(card *Card)
- func (cc *CardContainer) SelectRandomCard() *Card
- func (cc *CardContainer) SelectRandomCards(num int) []*Card
- func (cc *CardContainer) Shuffle()
- func (cc *CardContainer) Size() int
- type Deck
- type Effect
- type Fireball
- type Iceball
- type Immunity
- type Match
- func (match *Match) AttackCard(attackingCard *Card, defendingCard *Card) (cardIsDead bool)
- func (match *Match) CardsAttack()
- func (match *Match) DoRound()
- func (match *Match) PlayerAttack(attackingCard *Card, defendingBoard *PlayerBoard)
- func (match *Match) Run()
- func (match *Match) UpdateHandWaits()
- type MatchSummary
- type Player
- type PlayerBoard
- type Rejuvenation
- type Rune
- type Thunderbolt
- type UnimplementedAbility
Constants ¶
This section is empty.
Variables ¶
View Source
var MasterCardList = make(map[string]Card)
Functions ¶
func CalcAttack ¶
func Register ¶
func Register(id string, newfunc AbilityCtor)
Types ¶
type Ability ¶
type Ability interface { SetLevel(level int) Execute(castingCard *Card, playerBoard *PlayerBoard, defendingBoard *PlayerBoard) }
func FindAbility ¶
type AbilityCtor ¶
type AbilityCtor func() Ability
type Backstab ¶
type Backstab struct{ Level int }
Backstab
func (*Backstab) Execute ¶
func (a *Backstab) Execute(castingCard *Card, PlayerBoard *PlayerBoard, defendingBoard *PlayerBoard)
type Blight ¶
type Blight struct{ Level int }
Blight
func (*Blight) Execute ¶
func (a *Blight) Execute(castingCard *Card, playerBoard *PlayerBoard, defendingBoard *PlayerBoard)
type Card ¶
type Card struct { Name string Class string Stars int Cost int Wait int Level int BaseAttack int AttackGainPerLevel int CurrentAttack int BaseHitPoints int HitPointsGainPerLevel int CurrentHitPoints int MaxHitPoints int Level0SkillName string Level0Skill Ability Level5SkillName string Level5Skill Ability Level10SkillName string Level10Skill Ability Level99SkillName string }
func FindCardByName ¶
func (*Card) AttackAndHitPointsString ¶
func (*Card) CalculateAttack ¶
func (*Card) CalculateHitPoints ¶
func (*Card) LoseAttack ¶
func (*Card) TakeDamage ¶
type CardContainer ¶
func NewCardContainer ¶
func NewCardContainer() *CardContainer
func (*CardContainer) AddCard ¶
func (cc *CardContainer) AddCard(card *Card)
func (*CardContainer) CardAtSlot ¶
func (cc *CardContainer) CardAtSlot(slotNum int) *Card
func (*CardContainer) Collapse ¶
func (cc *CardContainer) Collapse()
func (*CardContainer) DoesContain ¶
func (cc *CardContainer) DoesContain(card *Card) bool
func (*CardContainer) DrawCard ¶
func (cc *CardContainer) DrawCard() *Card
func (*CardContainer) GetSlotNumForCard ¶
func (cc *CardContainer) GetSlotNumForCard(card *Card) int
func (*CardContainer) KillCard ¶
func (cc *CardContainer) KillCard(card *Card)
Removes the card but does not collapse the slice
func (*CardContainer) PrintCards ¶
func (cc *CardContainer) PrintCards()
func (*CardContainer) RemoveCard ¶
func (cc *CardContainer) RemoveCard(card *Card)
func (*CardContainer) SelectRandomCard ¶
func (cc *CardContainer) SelectRandomCard() *Card
func (*CardContainer) SelectRandomCards ¶
func (cc *CardContainer) SelectRandomCards(num int) []*Card
func (*CardContainer) Shuffle ¶
func (cc *CardContainer) Shuffle()
func (*CardContainer) Size ¶
func (cc *CardContainer) Size() int
type Fireball ¶
type Fireball struct{ Level int }
Fireball
func (*Fireball) Execute ¶
func (fb *Fireball) Execute(castingCard *Card, playerBoard *PlayerBoard, defendingBoard *PlayerBoard)
type Iceball ¶
type Iceball struct{ Level int }
Iceball
func (*Iceball) Execute ¶
func (a *Iceball) Execute(castingCard *Card, playerBoard *PlayerBoard, defendingBoard *PlayerBoard)
type Immunity ¶
type Immunity struct{}
Immuniity
func (*Immunity) Execute ¶
func (i *Immunity) Execute(castingCard *Card, playerBoard *PlayerBoard, defendingBoard *PlayerBoard)
type Match ¶
type Match struct { Hero Player Opponent Player HeroBoard PlayerBoard OpponentBoard PlayerBoard AttackerBoard *PlayerBoard DefenderBoard *PlayerBoard Round int Summary *MatchSummary InteractiveMode bool }
func (*Match) AttackCard ¶
func (*Match) CardsAttack ¶
func (match *Match) CardsAttack()
func (*Match) PlayerAttack ¶
func (match *Match) PlayerAttack(attackingCard *Card, defendingBoard *PlayerBoard)
Attack the opposing player directly
type MatchSummary ¶
func NewMatchSummary ¶
func NewMatchSummary() *MatchSummary
type PlayerBoard ¶
type PlayerBoard struct { Player Player CurrentHitPoints int Deck *CardContainer Hand *CardContainer Battlefield *CardContainer Cemetery *CardContainer }
func NewPlayerBoard ¶
func NewPlayerBoard(player Player, deck Deck) PlayerBoard
func (*PlayerBoard) DecrementWaits ¶
func (pb *PlayerBoard) DecrementWaits(amount int)
func (*PlayerBoard) DrawCard ¶
func (pb *PlayerBoard) DrawCard()
func (*PlayerBoard) KillCard ¶
func (pb *PlayerBoard) KillCard(idx int)
func (*PlayerBoard) MoveExpiredHandCards ¶
func (pb *PlayerBoard) MoveExpiredHandCards()
func (*PlayerBoard) PrintBoard ¶
func (pb *PlayerBoard) PrintBoard()
type Rejuvenation ¶
type Rejuvenation struct{ Level int }
Rejuvenation
func (*Rejuvenation) Execute ¶
func (r *Rejuvenation) Execute(castingCard *Card, playerBoard *PlayerBoard, defendingBoard *PlayerBoard)
func (*Rejuvenation) SetLevel ¶
func (r *Rejuvenation) SetLevel(level int)
type Thunderbolt ¶
type Thunderbolt struct{ Level int }
Thunderbolt
func (*Thunderbolt) Execute ¶
func (a *Thunderbolt) Execute(castingCard *Card, playerBoard *PlayerBoard, defendingBoard *PlayerBoard)
func (*Thunderbolt) SetLevel ¶
func (a *Thunderbolt) SetLevel(level int)
type UnimplementedAbility ¶
type UnimplementedAbility struct{}
Unimplmented
func (*UnimplementedAbility) Execute ¶
func (u *UnimplementedAbility) Execute(castingCard *Card, playerBoard *PlayerBoard, defendingBoard *PlayerBoard)
func (*UnimplementedAbility) SetLevel ¶
func (u *UnimplementedAbility) SetLevel(level int)
Click to show internal directories.
Click to hide internal directories.