Prize amounts
This commit is contained in:
parent
7526d8bd7c
commit
86906c1b55
@ -93,8 +93,8 @@ let asdf (_ : DiscordClient) (event : DSharpPlus.EventArgs.InteractionCreateEven
|
||||
:> Task
|
||||
//hackerBattleBot.add_InteractionCreated(AsyncEventHandler(asdf))
|
||||
|
||||
//slotsBot.ConnectAsync() |> Async.AwaitTask |> Async.RunSynchronously
|
||||
//GuildEnvironment.botClientSlots <- Some slotsBot
|
||||
slotsBot.ConnectAsync() |> Async.AwaitTask |> Async.RunSynchronously
|
||||
GuildEnvironment.botClientSlots <- Some slotsBot
|
||||
|
||||
hackerBattleBot.ConnectAsync() |> Async.AwaitTask |> Async.RunSynchronously
|
||||
GuildEnvironment.botClientHacker <- Some hackerBattleBot
|
||||
|
@ -48,14 +48,14 @@ type Slot =
|
||||
|
||||
let prizeTable =
|
||||
[ Symbol BigBrother , Symbol BigBrother , Symbol BigBrother , Jackpot
|
||||
Symbol Eye , Symbol Eye , Symbol Eye , Money 1000<GBT>
|
||||
Symbol Eye , Symbol Eye , Symbol Obey , Money 1000<GBT>
|
||||
Symbol AnonMask , Symbol AnonMask , Symbol AnonMask , Money 250<GBT>
|
||||
Symbol AnonMask , Symbol AnonMask , Symbol Eye , Money 250<GBT>
|
||||
Symbol Ramen , Symbol Ramen , Symbol Ramen , Money 100<GBT>
|
||||
Symbol Ramen , Symbol Ramen , Symbol Eye , Money 100<GBT>
|
||||
Symbol Sushi , Symbol Sushi , Any , Money 10<GBT>
|
||||
Symbol Pizza , Any , Any , Money 5<GBT> ]
|
||||
Symbol Eye , Symbol Eye , Symbol Eye , Money 2000<GBT>
|
||||
Symbol Eye , Symbol Eye , Symbol Obey , Money 2000<GBT>
|
||||
Symbol AnonMask , Symbol AnonMask , Symbol AnonMask , Money 500<GBT>
|
||||
Symbol AnonMask , Symbol AnonMask , Symbol Eye , Money 500<GBT>
|
||||
Symbol Ramen , Symbol Ramen , Symbol Ramen , Money 250<GBT>
|
||||
Symbol Ramen , Symbol Ramen , Symbol Eye , Money 250<GBT>
|
||||
Symbol Sushi , Symbol Sushi , Any , Money 100<GBT>
|
||||
Symbol Pizza , Any , Any , Money 50<GBT> ]
|
||||
|
||||
|
||||
let slots =
|
||||
@ -111,7 +111,7 @@ let slotsImages =
|
||||
|
||||
let payTable = [| |]
|
||||
|
||||
let PlayPrice = 10<GBT>
|
||||
let PlayPrice = 5<GBT>
|
||||
let twoOfAKindPrize = 100<GBT>
|
||||
let threeOfAKindPrize = 1000<GBT>
|
||||
let sleepTime = 1500
|
||||
@ -174,7 +174,7 @@ let spinFiles (results : int array) (ctx : IDiscordContext) =
|
||||
builder.IsEphemeral <- true
|
||||
let! followUp = itx.CreateFollowupMessageAsync(builder) |> Async.AwaitTask
|
||||
|
||||
do! Async.Sleep sleepTime
|
||||
// do! Async.Sleep sleepTime
|
||||
// let ( name , stream ) = slotsImages.[results.[0]]
|
||||
// let! _ = itx.EditFollowupMessageAsync(followUp.Id, DiscordWebhookBuilder()
|
||||
// .AddFile(name + "1.png", stream)) |> Async.AwaitTask
|
||||
@ -194,34 +194,33 @@ let spin spinType (ctx : IDiscordContext) =
|
||||
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)] |]
|
||||
|
||||
let winConditions = symbols.[0] = symbols.[1] && symbols.[0] = symbols.[2]
|
||||
let prize =
|
||||
prizeTable
|
||||
|> List.pick (fun (s1,s2,s3,prize) ->
|
||||
|> List.tryPick (fun (s1,s2,s3,prize) ->
|
||||
match s1 , s2 , s3 with
|
||||
| Symbol s1' , Symbol s2' , Symbol s3' when s1'.index = symbols.[0] && s2'.index = symbols.[1] && s3'.index = symbols.[2] -> Some prize
|
||||
| Symbol s1' , Symbol s2' , Any when s1'.index = symbols.[0] && s2'.index = symbols.[1] -> Some prize
|
||||
| Symbol s1' , Any , Any when s1'.index = symbols.[0] -> Some prize
|
||||
| _ -> None)
|
||||
|
||||
if winConditions
|
||||
then do! DbService.updatePlayerCurrency twoOfAKindPrize player |> Async.Ignore
|
||||
else do! DbService.updatePlayerCurrency -PlayPrice player |> Async.Ignore
|
||||
|
||||
match spinType with
|
||||
| "Embeds" -> do! spinEmbeds symbols ctx
|
||||
| "Emojis" -> do! spinEmojis symbols ctx
|
||||
| "Files" -> do! spinFiles symbols ctx
|
||||
| _ -> ()
|
||||
|
||||
do! Async.Sleep sleepTime
|
||||
let builder = DiscordFollowupMessageBuilder()
|
||||
builder.IsEphemeral <- true
|
||||
let embed4 = DiscordEmbedBuilder()
|
||||
embed4.Title <- "Slot Machine"
|
||||
if winConditions then
|
||||
embed4.Description <- $"You win {threeOfAKindPrize} GBT!"
|
||||
else
|
||||
match prize with
|
||||
| Some (Money amount) ->
|
||||
do! DbService.updatePlayerCurrency twoOfAKindPrize player |> Async.Ignore
|
||||
embed4.Description <- $"You win {amount} GBT!"
|
||||
| Some (Jackpot) ->
|
||||
embed4.Description <- $"YOU HIT THE JACKPOT!!!"
|
||||
| None ->
|
||||
do! DbService.updatePlayerCurrency -PlayPrice player |> Async.Ignore
|
||||
builder.Content <- "Better luck next time! You paid 1 $GBT"
|
||||
builder.AddEmbed(embed4) |> ignore
|
||||
do! ctx.FollowUp(builder) |> Async.AwaitTask |> Async.Ignore
|
||||
@ -253,10 +252,11 @@ let sendInitialEmbed (ctx : IDiscordContext) =
|
||||
|
||||
builder.AddEmbed(embed) |> ignore
|
||||
|
||||
let button1 = DiscordButtonComponent(ButtonStyle.Success, $"spin-embeds", $"Spin Embeds 1 $GBT") :> DiscordComponent
|
||||
let button2 = DiscordButtonComponent(ButtonStyle.Success, $"spin-emojis", $"Spin Emojis 5 $GBT") :> DiscordComponent
|
||||
let button3 = DiscordButtonComponent(ButtonStyle.Success, $"spin-files", $"Spin Files 10 $GBT") :> DiscordComponent
|
||||
builder.AddComponents [| button1 ; button2 ; button3 |] |> ignore
|
||||
let button1 = DiscordButtonComponent(ButtonStyle.Success, $"spin-embeds", $"Spin Embeds {PlayPrice} $GBT") :> DiscordComponent
|
||||
let button2 = DiscordButtonComponent(ButtonStyle.Success, $"spin-emojis", $"Spin Emojis {PlayPrice} $GBT") :> DiscordComponent
|
||||
// let button3 = DiscordButtonComponent(ButtonStyle.Success, $"spin-files", $"Spin Files 10 $GBT") :> DiscordComponent
|
||||
// builder.AddComponents [| button1 ; button2 ; button3 |] |> ignore
|
||||
builder.AddComponents [| button1 ; button2 |] |> ignore
|
||||
do! GuildEnvironment.botClientSlots.Value.SendMessageAsync(channel, builder)
|
||||
|> Async.AwaitTask
|
||||
|> Async.Ignore
|
||||
|
Loading…
x
Reference in New Issue
Block a user