Assorted fixes

This commit is contained in:
Joseph Ferano 2022-06-03 00:24:56 +07:00
parent a80d31b40c
commit 1ff6a4dc28

View File

@ -11,6 +11,7 @@ let shieldGif = "https://s10.gifyu.com/images/Defense-Degenz-V2-min.gif"
let constructButtons (actionId: string) (buttonInfo : string) (player: PlayerData) (items : Inventory) ignoreCooldown =
items
|> List.sortBy (fun item -> item.Id)
|> List.map (fun item ->
let action =
player.Events
@ -71,7 +72,7 @@ let pickHack actionId attacker defender bonus isTrainer =
let stealMsg =
if not isTrainer
then $"""
**{defender.Name}** has `{defender.Bank} $GBT` we can take from them.
**{defender.Name}** has `{defender.Bank} 💰$GBT` we can take from them.
**__Your Strength:__**
`💪 {attacker.Stats.Strength.Amount}`
@ -86,7 +87,8 @@ let pickHack actionId attacker defender bonus isTrainer =
.WithDescription($"{stealMsg}\n\nPick the hack you want to use.")
if not isTrainer then
for hack in Inventory.getHacks attacker.Inventory do
let hacks = Inventory.getHacks attacker.Inventory |> List.sortBy (fun h -> h.Id)
for hack in hacks do
let amount = if hack.Power > int defender.Bank then int defender.Bank else hack.Power
let emoji =
match hack.Id with
@ -95,11 +97,10 @@ let pickHack actionId attacker defender bonus isTrainer =
| "WORM" -> "<:worm_hack:971636842640310312>"
| _ -> ""
let fieldMsg = $"""
**Cooldown:** {hack.Cooldown} mins
**Hack Base:** {hack.Power}
**Strength Bonus:** {bonus}
**Hack Total:** {amount + bonus} $GBT"""
embed.AddField($"{emoji} {hack.Name}", fieldMsg, true) |> ignore
Hack Base: `{hack.Power} 💰$GBT`
Bonus: `{bonus} 💰$GBT`
**Hack Total:** `{amount + bonus} 💰$GBT`"""
embed.AddField($"{emoji} __{hack.Name}__", fieldMsg, true) |> ignore
DiscordFollowupMessageBuilder()
.AddComponents(buttons)