card_id/common/game/card/brand.go

25 lines
368 B
Go

package card
import (
"lukechampine.com/frand"
)
type Brand struct {
Name string
SelectionWeight float64
RewardDeck *Deck
SpecialDeck *Deck
SpecialChance float64
}
func (l *Brand) GetDeck() *Deck {
if l.SpecialChance == 0 {
return l.RewardDeck
}
if l.SpecialChance > (frand.Float64() * 100) {
return l.SpecialDeck
}
return l.RewardDeck
}