From 68018c924ef16604368419e3234b5090e9589157 Mon Sep 17 00:00:00 2001 From: Michael H Date: Tue, 27 Aug 2019 12:38:56 -0400 Subject: [PATCH] [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?! --- changelog.d/2875.enhance.rst | 1 + redbot/cogs/economy/economy.py | 39 +++++++++++++++++++--------------- 2 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 changelog.d/2875.enhance.rst diff --git a/changelog.d/2875.enhance.rst b/changelog.d/2875.enhance.rst new file mode 100644 index 000000000..79ae6a859 --- /dev/null +++ b/changelog.d/2875.enhance.rst @@ -0,0 +1 @@ +Slots now has a 62.5% expected payout and won't inflate economy when spammed. \ No newline at end of file diff --git a/redbot/cogs/economy/economy.py b/redbot/cogs/economy/economy.py index 8626c5bb7..468935deb 100644 --- a/redbot/cogs/economy/economy.py +++ b/redbot/cogs/economy/economy.py @@ -38,40 +38,43 @@ class SMReel(Enum): _ = lambda s: s PAYOUTS = { (SMReel.two, SMReel.two, SMReel.six): { - "payout": lambda x: x * 2500 + x, - "phrase": _("JACKPOT! 226! Your bid has been multiplied * 2500!"), + "payout": lambda x: x * 50, + "phrase": _("JACKPOT! 226! Your bid has been multiplied * 50!"), }, (SMReel.flc, SMReel.flc, SMReel.flc): { - "payout": lambda x: x + 1000, - "phrase": _("4LC! +1000!"), + "payout": lambda x: x * 25, + "phrase": _("4LC! Your bid has been multiplied * 25!"), }, (SMReel.cherries, SMReel.cherries, SMReel.cherries): { - "payout": lambda x: x + 800, - "phrase": _("Three cherries! +800!"), + "payout": lambda x: x * 20, + "phrase": _("Three cherries! Your bid has been multiplied * 20!"), }, (SMReel.two, SMReel.six): { - "payout": lambda x: x * 4 + x, + "payout": lambda x: x * 4, "phrase": _("2 6! Your bid has been multiplied * 4!"), }, (SMReel.cherries, SMReel.cherries): { - "payout": lambda x: x * 3 + x, + "payout": lambda x: x * 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": { - "payout": lambda x: x * 2 + x, + "payout": lambda x: x * 2, "phrase": _("Two consecutive symbols! Your bid has been multiplied * 2!"), }, } SLOT_PAYOUTS_MSG = _( "Slot machine payouts:\n" - "{two.value} {two.value} {six.value} Bet * 2500\n" - "{flc.value} {flc.value} {flc.value} +1000\n" - "{cherries.value} {cherries.value} {cherries.value} +800\n" + "{two.value} {two.value} {six.value} Bet * 50\n" + "{flc.value} {flc.value} {flc.value} Bet * 25\n" + "{cherries.value} {cherries.value} {cherries.value} Bet * 20\n" "{two.value} {six.value} Bet * 4\n" "{cherries.value} {cherries.value} Bet * 3\n\n" - "Three symbols: +500\n" + "Three symbols: Bet * 10\n" "Two symbols: Bet * 2" ).format(**SMReel.__dict__) _ = T_ @@ -485,6 +488,7 @@ class Economy(commands.Cog): elif has_two: payout = PAYOUTS["2 symbols"] + pay = 0 if payout: then = await bank.get_balance(author) pay = payout["payout"](bid) @@ -513,15 +517,16 @@ class Economy(commands.Cog): await channel.send( ( "{slot}\n{author.mention} {phrase}\n\n" - + _("Your bid: {amount}") - + "\n{old_balance} → {new_balance}!" + + _("Your bid: {bid}") + + _("\n{old_balance} - {bid} (Your bid) + {pay} (Winnings) → {new_balance}!") ).format( slot=slot, author=author, phrase=phrase, - amount=bid, + bid=bid, old_balance=then, new_balance=now, + pay=pay, ) )