Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Commit

Permalink
fix: coinflip earnings show reward instead of profit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Harrington committed Jun 20, 2020
1 parent 827cd47 commit c2b2b71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/commands/coinflip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const sendReward = (msg, user, client, embed) => {
const nextCost: number = 100 * (2 ** coinflipStreak + 1)
const nextReward: number = 100 * (3 ** (coinflipStreak + 1)) + ((coinflipStreak + 1) * 150)
const description: any = {
reward: `**${name}** just earned $**${currency(profit)}**`,
reward: `**${name}** just earned $**${currency(reward)}**`,
streak: `with a streak of **${coinflipStreak + 1}**!`,
chance: `The chances of winning this is **${streakChance}**%!`,
nextCostMsg: `Your next coin flip will cost $**${currency(nextCost)}**.`,
Expand Down
6 changes: 1 addition & 5 deletions src/commands/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ export default async (msg, client, args) => {
}

const coinflipChance: number = Math.round((100 / (2 ** coinflipBestStreak)) * 100) / 100
let coinflipEarnings: number = Math.round(
(100 * (3 ** (coinflipBestStreak - 1))) +
(coinflipBestStreak * 150) -
(100 * (2 ** coinflipBestStreak))
)
let coinflipEarnings: number = Math.round((100 * (3 ** (coinflipBestStreak - 1))) + (coinflipBestStreak * 150))

if (!coinflipBestStreak) {
coinflipEarnings = 0
Expand Down

0 comments on commit c2b2b71

Please sign in to comment.