card_id/common/game/card/brand.go

25 lines
368 B
Go
Raw Normal View History

2022-04-13 23:09:58 +00:00
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
}