Condense a little hack stuff

This commit is contained in:
Joseph Ferano 2022-06-24 11:33:26 +07:00
parent 31777c96e5
commit b56457e25d
2 changed files with 10 additions and 19 deletions

View File

@ -100,6 +100,8 @@ let asdf _ (event : DSharpPlus.EventArgs.InteractionCreateEventArgs) =
} |> Async.StartAsTask
:> Task
//hackerBattleBot.add_InteractionCreated(AsyncEventHandler(asdf))
hackerBattleBot.ConnectAsync() |> Async.AwaitTask |> Async.RunSynchronously
GuildEnvironment.botClientHacker <- Some hackerBattleBot
jpegBot.ConnectAsync() |> Async.AwaitTask |> Async.RunSynchronously
GuildEnvironment.botClientJpeg <- Some jpegBot
@ -109,9 +111,6 @@ GuildEnvironment.botClientStore <- Some storeBot
adminBot.ConnectAsync() |> Async.AwaitTask |> Async.RunSynchronously
hackerBattleBot.ConnectAsync() |> Async.AwaitTask |> Async.RunSynchronously
GuildEnvironment.botClientHacker <- Some hackerBattleBot
inviterBot.ConnectAsync() |> Async.AwaitTask |> Async.RunSynchronously
GuildEnvironment.botClientRecruit <- Some inviterBot

View File

@ -130,27 +130,19 @@ let responseSuccessfulHack (hacker : PlayerData) (target : PlayerData) totalTake
let responseSuccessfulHack2 successful (hacker : PlayerData) (target : PlayerData) (hackerMember : DiscordMember) (targetMember : DiscordMember) totalTaken bonus (hack : HackItem) =
let earnedMoney = totalTaken > 0<GBT>
let msg =
if successful then
$"{hacker.Name} successfully hacked {target.Name}!\n\n"
+ (if earnedMoney then $"**__Total Hacked__**: `{totalTaken} 💰$GBT`\n" else "")
else
$"{hacker.Name} failed to hack {target.Name}!\n\n"
+ (if earnedMoney then $"**__Defender Extracted__**: `{totalTaken} 💰$GBT`\n" else "")
let bonusMsg =
if bonus > 0<GBT>
then $"Because **{hacker.Name}** strength is `💪 {hacker.Stats.Strength.Amount}` and **{target.Name}** strength is `💪 {target.Stats.Strength.Amount}`, they got a `{bonus}` 💰$GBT bonus"
else ""
let title = if successful then "✅ Hack Successful!" else "❌ Hack Failed!"
let title = if successful then $"✅ {hacker.Name} Hacked Successful!" else $"❌ {target.Name} Hack Failed!"
let embed1 =
DiscordEmbedBuilder()
.WithThumbnail(hackGif)
.WithColor(DiscordColor.Blurple)
.WithTitle(title)
.WithDescription($"{msg}\n{bonusMsg}")
if successful then
if earnedMoney then embed1.AddField($"Total Hacked", $"`{totalTaken} 💰$GBT`", true) |> ignore
else
if earnedMoney then embed1.AddField($"Defender Extracted", $"`{totalTaken} 💰$GBT`", true) |> ignore
if bonus > 0<GBT> then embed1.AddField("Bonus", $"`{bonus}` 💰$GBT", true) |> ignore
let h = ( hacker.Name , hackerMember.AvatarUrl )
let t = ( target.Name , targetMember.AvatarUrl )