Add treasure boxes (#188)
* Filter out slots from the body. (#181) * Slots changes (#182) * Switch slots result to title and fix snappy * These two guys again * These two guys again * Fix breaking-even * ...?? * Initial commit * Finalize initial blackjack attempt * Fix blackjack issue * Add treasure functionality * Remove obsolete file * Add blackjack winnings to user winnings * Minor changes to treasure functionality * 25 percent chance of mimic
This commit is contained in:
parent
fef0dcf0cc
commit
90d1263440
8 changed files with 64 additions and 7 deletions
|
@ -64,11 +64,9 @@ class Blackjack:
|
|||
if self.command_word in in_text:
|
||||
for word in in_text.split():
|
||||
if self.command_word in word:
|
||||
try:
|
||||
wager = word[len(self.command_word):]
|
||||
wager_value = int(wager)
|
||||
except: break
|
||||
|
||||
wager = word[len(self.command_word):]
|
||||
wager_value = int(wager)
|
||||
|
||||
if (wager_value < self.minimum_bet):
|
||||
break
|
||||
elif (wager_value > self.maximum_bet):
|
||||
|
@ -158,11 +156,12 @@ class Blackjack:
|
|||
elif result == 'won':
|
||||
reward = int(wager) * 2
|
||||
elif result == 'blackjack':
|
||||
reward = floor(int(wager) * (3/2))
|
||||
reward = int(wager) + floor(int(wager) * (3/2))
|
||||
|
||||
if (reward > 0):
|
||||
user = from_comment.author
|
||||
user.coins += reward
|
||||
user.winnings += reward - int(wager)
|
||||
|
||||
self.db.add(user)
|
||||
self.db.commit()
|
Loading…
Add table
Add a link
Reference in a new issue