Fix embeds, take money upfront, GTE
This commit is contained in:
parent
310699ea50
commit
c0282083a2
@ -232,6 +232,7 @@ let spin multiplier (ctx : IDiscordContext) =
|
||||
| 2 -> PlayPricex2
|
||||
| _ -> PlayPricex3
|
||||
let execute player = async {
|
||||
do! DbService.updatePlayerCurrency -playAmount player |> Async.Ignore
|
||||
let random = Random(Guid.NewGuid().GetHashCode())
|
||||
let symbols = [| reel1.[random.Next(0, reel1.Length)] ; reel2.[random.Next(0, reel2.Length)] ; reel3.[random.Next(0, reel3.Length)] |]
|
||||
|
||||
@ -265,27 +266,30 @@ let spin multiplier (ctx : IDiscordContext) =
|
||||
let prizeWithMultiplier = amount * multiplier
|
||||
do! DbService.updatePlayerCurrency prizeWithMultiplier player |> Async.Ignore
|
||||
embed.Color <- DiscordColor.Green
|
||||
embed.Description <- $"You win **{prizeWithMultiplier}** GBT!"
|
||||
embed.AddField("Result", $"{slotsContent}", true) |> ignore
|
||||
embed.Description <- $"You win! You got **{prizeWithMultiplier}** GBT 🎉"
|
||||
// embed.AddField("Result", $"{slotsContent}", true) |> ignore
|
||||
embed.AddField("Bet", $"{playAmount}", true) |> ignore
|
||||
embed.AddField("Prize", $"{prizeWithMultiplier}") |> ignore
|
||||
addGBTField embed prizeWithMultiplier
|
||||
return "WON" , prizeWithMultiplier
|
||||
| Some (Jackpot) ->
|
||||
let! jackpot = getJackpotAmount ()
|
||||
embed.Color <- DiscordColor.Purple
|
||||
embed.Description <- $"YOU HIT THE JACKPOT!!!"
|
||||
embed.AddField("Result", $"{slotsContent}", true) |> ignore
|
||||
// embed.AddField("Result", $"{slotsContent}", true) |> ignore
|
||||
embed.AddField("Bet", $"{playAmount}", true) |> ignore
|
||||
embed.AddField("Prize", $"{jackpot}") |> ignore
|
||||
addGBTField embed jackpot
|
||||
do! DbService.updatePlayerCurrency jackpot player |> Async.Ignore
|
||||
do! resetJackpot BaseJackpotAmount |> Async.Ignore
|
||||
return "JACKPOT" , jackpot
|
||||
| None ->
|
||||
do! DbService.updatePlayerCurrency -playAmount player |> Async.Ignore
|
||||
do! incrementJackpot playAmount |> Async.Ignore
|
||||
let! jackpot = getJackpotAmount ()
|
||||
embed.Description <- $"Better luck next time! You paid {playAmount} $GBT"
|
||||
embed.Color <- DiscordColor.Red
|
||||
embed.AddField("New JACKPOT", $"`💰` {jackpot} `$GBT`", true) |> ignore
|
||||
embed.AddField("Result", $"{slotsContent}", true) |> ignore
|
||||
embed.AddField("Bet", $"{playAmount}", true) |> ignore
|
||||
// embed.AddField("New JACKPOT", $"`💰` {jackpot} `$GBT`", true) |> ignore
|
||||
// embed.AddField("Result", $"{slotsContent}", true) |> ignore
|
||||
addGBTField embed -playAmount
|
||||
return "LOST" , 0<GBT>
|
||||
}
|
||||
@ -295,7 +299,7 @@ let spin multiplier (ctx : IDiscordContext) =
|
||||
do! Analytics.slotPlayed (ctx.GetDiscordMember()) playAmount result prizeAmount
|
||||
}
|
||||
PlayerInteractions.executePlayerAction ctx (fun player ->
|
||||
if player.Bank > playAmount then
|
||||
if player.Bank >= playAmount then
|
||||
execute player
|
||||
else
|
||||
Messaging.sendFollowUpMessage ctx "You do not have sufficient funds to play")
|
||||
|
Loading…
x
Reference in New Issue
Block a user