mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 10:17:59 -05:00
[Economy] House always wins in slots (#2875)
* [Economy] House always wins in slots - Expected payout is negative - No flat increase payouts, all payouts are multiplicative * actually do math properly * UX + Changelog * How the hell did I mess that up?!
This commit is contained in:
1
changelog.d/2875.enhance.rst
Normal file
1
changelog.d/2875.enhance.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Slots now has a 62.5% expected payout and won't inflate economy when spammed.
|
||||||
@@ -38,40 +38,43 @@ class SMReel(Enum):
|
|||||||
_ = lambda s: s
|
_ = lambda s: s
|
||||||
PAYOUTS = {
|
PAYOUTS = {
|
||||||
(SMReel.two, SMReel.two, SMReel.six): {
|
(SMReel.two, SMReel.two, SMReel.six): {
|
||||||
"payout": lambda x: x * 2500 + x,
|
"payout": lambda x: x * 50,
|
||||||
"phrase": _("JACKPOT! 226! Your bid has been multiplied * 2500!"),
|
"phrase": _("JACKPOT! 226! Your bid has been multiplied * 50!"),
|
||||||
},
|
},
|
||||||
(SMReel.flc, SMReel.flc, SMReel.flc): {
|
(SMReel.flc, SMReel.flc, SMReel.flc): {
|
||||||
"payout": lambda x: x + 1000,
|
"payout": lambda x: x * 25,
|
||||||
"phrase": _("4LC! +1000!"),
|
"phrase": _("4LC! Your bid has been multiplied * 25!"),
|
||||||
},
|
},
|
||||||
(SMReel.cherries, SMReel.cherries, SMReel.cherries): {
|
(SMReel.cherries, SMReel.cherries, SMReel.cherries): {
|
||||||
"payout": lambda x: x + 800,
|
"payout": lambda x: x * 20,
|
||||||
"phrase": _("Three cherries! +800!"),
|
"phrase": _("Three cherries! Your bid has been multiplied * 20!"),
|
||||||
},
|
},
|
||||||
(SMReel.two, SMReel.six): {
|
(SMReel.two, SMReel.six): {
|
||||||
"payout": lambda x: x * 4 + x,
|
"payout": lambda x: x * 4,
|
||||||
"phrase": _("2 6! Your bid has been multiplied * 4!"),
|
"phrase": _("2 6! Your bid has been multiplied * 4!"),
|
||||||
},
|
},
|
||||||
(SMReel.cherries, SMReel.cherries): {
|
(SMReel.cherries, SMReel.cherries): {
|
||||||
"payout": lambda x: x * 3 + x,
|
"payout": lambda x: x * 3,
|
||||||
"phrase": _("Two cherries! Your bid has been multiplied * 3!"),
|
"phrase": _("Two cherries! Your bid has been multiplied * 3!"),
|
||||||
},
|
},
|
||||||
"3 symbols": {"payout": lambda x: x + 500, "phrase": _("Three symbols! +500!")},
|
"3 symbols": {
|
||||||
|
"payout": lambda x: x * 10,
|
||||||
|
"phrase": _("Three symbols! Your bid has been multiplied * 10!"),
|
||||||
|
},
|
||||||
"2 symbols": {
|
"2 symbols": {
|
||||||
"payout": lambda x: x * 2 + x,
|
"payout": lambda x: x * 2,
|
||||||
"phrase": _("Two consecutive symbols! Your bid has been multiplied * 2!"),
|
"phrase": _("Two consecutive symbols! Your bid has been multiplied * 2!"),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
SLOT_PAYOUTS_MSG = _(
|
SLOT_PAYOUTS_MSG = _(
|
||||||
"Slot machine payouts:\n"
|
"Slot machine payouts:\n"
|
||||||
"{two.value} {two.value} {six.value} Bet * 2500\n"
|
"{two.value} {two.value} {six.value} Bet * 50\n"
|
||||||
"{flc.value} {flc.value} {flc.value} +1000\n"
|
"{flc.value} {flc.value} {flc.value} Bet * 25\n"
|
||||||
"{cherries.value} {cherries.value} {cherries.value} +800\n"
|
"{cherries.value} {cherries.value} {cherries.value} Bet * 20\n"
|
||||||
"{two.value} {six.value} Bet * 4\n"
|
"{two.value} {six.value} Bet * 4\n"
|
||||||
"{cherries.value} {cherries.value} Bet * 3\n\n"
|
"{cherries.value} {cherries.value} Bet * 3\n\n"
|
||||||
"Three symbols: +500\n"
|
"Three symbols: Bet * 10\n"
|
||||||
"Two symbols: Bet * 2"
|
"Two symbols: Bet * 2"
|
||||||
).format(**SMReel.__dict__)
|
).format(**SMReel.__dict__)
|
||||||
_ = T_
|
_ = T_
|
||||||
@@ -485,6 +488,7 @@ class Economy(commands.Cog):
|
|||||||
elif has_two:
|
elif has_two:
|
||||||
payout = PAYOUTS["2 symbols"]
|
payout = PAYOUTS["2 symbols"]
|
||||||
|
|
||||||
|
pay = 0
|
||||||
if payout:
|
if payout:
|
||||||
then = await bank.get_balance(author)
|
then = await bank.get_balance(author)
|
||||||
pay = payout["payout"](bid)
|
pay = payout["payout"](bid)
|
||||||
@@ -513,15 +517,16 @@ class Economy(commands.Cog):
|
|||||||
await channel.send(
|
await channel.send(
|
||||||
(
|
(
|
||||||
"{slot}\n{author.mention} {phrase}\n\n"
|
"{slot}\n{author.mention} {phrase}\n\n"
|
||||||
+ _("Your bid: {amount}")
|
+ _("Your bid: {bid}")
|
||||||
+ "\n{old_balance} → {new_balance}!"
|
+ _("\n{old_balance} - {bid} (Your bid) + {pay} (Winnings) → {new_balance}!")
|
||||||
).format(
|
).format(
|
||||||
slot=slot,
|
slot=slot,
|
||||||
author=author,
|
author=author,
|
||||||
phrase=phrase,
|
phrase=phrase,
|
||||||
amount=bid,
|
bid=bid,
|
||||||
old_balance=then,
|
old_balance=then,
|
||||||
new_balance=now,
|
new_balance=now,
|
||||||
|
pay=pay,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user