summaryrefslogtreecommitdiffstats
path: root/wat/game.go
diff options
context:
space:
mode:
authoralex2019-09-22 10:56:10 +0100
committeralex2019-09-22 10:56:10 +0100
commit85ff6578e812248367b75c574e55dd19ec472087 (patch)
treedc315effdce17d95c07414517536821cd3a9c569 /wat/game.go
parent03d90245091936d7db14a08ea57bdc4d3b41484a (diff)
downloadwatbot-85ff6578e812248367b75c574e55dd19ec472087.tar.gz
watbot-85ff6578e812248367b75c574e55dd19ec472087.tar.bz2
watbot-85ff6578e812248367b75c574e55dd19ec472087.zip
fixes #8
Diffstat (limited to 'wat/game.go')
-rw-r--r--wat/game.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/wat/game.go b/wat/game.go
index e401a72..b46707b 100644
--- a/wat/game.go
+++ b/wat/game.go
@@ -204,12 +204,19 @@ func (g *WatGame) Roll(player *Player, fields []string) string {
dieSize = int64(userDieSize)
}
}
+ lotteryNum := int64(-1)
+ if dieSize > 100 {
+ lotteryNum = int64(g.RandInt(dieSize)) + 1
+ }
if amount > player.Coins {
return "wat? brokeass"
}
n := int64(g.RandInt(dieSize)) + 1
ret := fmt.Sprintf("%s rolls the %d sided die... %d! ", player.Nick, dieSize, n)
- if n < dieSize/2 {
+ if n == lotteryNum {
+ player.Coins += player.Coins
+ ret += fmt.Sprintf("You won the wattery! Your bet was ignored, but your bank balance was doubled!")
+ } else if n < dieSize/2 {
player.Coins += amount
ret += fmt.Sprintf("You win! ◕ ◡ ◕ total: %d %s", player.Coins, currency)
} else {