diff --git a/Bot/Embeds.fs b/Bot/Embeds.fs index 7bd827b..cdac675 100644 --- a/Bot/Embeds.fs +++ b/Bot/Embeds.fs @@ -66,12 +66,12 @@ let pickHack actionId attacker defender = .AddEmbed(embed.Build()) .AsEphemeral true -let responseSuccessfulHack (hack : BattleItem) = +let responseSuccessfulHack (targetId : uint64) (hack : BattleItem) = let embed = DiscordEmbedBuilder() embed.ImageUrl <- getHackGif (enum(hack.Id)) DiscordFollowupMessageBuilder() - .WithContent($"You successfully hacked <@{GuildEnvironment.botHackerBattle}> using {hack.Name}, and stole 💰$GBT {Game.HackPrize} from them!") + .WithContent($"You successfully hacked <@{targetId}> using {hack.Name}, and stole 💰$GBT {Game.HackPrize} from them!") .AddEmbed(embed.Build()) .AsEphemeral(true) diff --git a/Bot/HackerBattle.fs b/Bot/HackerBattle.fs index 0d30728..87c9b7a 100644 --- a/Bot/HackerBattle.fs +++ b/Bot/HackerBattle.fs @@ -79,7 +79,7 @@ let successfulHack (event : ComponentInteractionCreateEventArgs) attacker defend async { do! updateCombatants attacker defender hack Game.HackPrize - let embed = Embeds.responseSuccessfulHack (Armory.getItem (int hack)) + let embed = Embeds.responseSuccessfulHack (defender.DiscordId) (Armory.getItem (int hack)) do! event.Interaction.CreateFollowupMessageAsync(embed) |> Async.AwaitTask |> Async.Ignore diff --git a/Bot/Trainer.fs b/Bot/Trainer.fs index e8de436..dcbd1e5 100644 --- a/Bot/Trainer.fs +++ b/Bot/Trainer.fs @@ -76,14 +76,16 @@ let handleDefenseMsg = { let handleDefense (event : ComponentInteractionCreateEventArgs) = Game.executePlayerEvent event (fun player -> async { let sendMessage' = sendFollowUpMessage event - let shield = Player.shields player |> Array.tryHead |> Option.defaultValue defaultShield + let split = event.Id.Split("-") + let shieldId = enum(int split.[2]) + let shield = Armory.getItem (int shieldId) let embed = Embeds.responseCreatedShieldTrainer shield do! event.Interaction.CreateFollowupMessageAsync(embed) |> Async.AwaitTask |> Async.Ignore - do! Async.Sleep 2000 - do! sendMessage' "Ok, good, let me make sure that worked.\n\nI'll try to **hack** you now" do! Async.Sleep 4000 + do! sendMessage' "Ok, good, let me make sure that worked.\n\nI'll try to **hack** you now" + do! Async.Sleep 5000 do! sendMessage' $"❌ HACKING FAILED!\n\n{player.Name} defended the hack from <@{GuildEnvironment.botHackerBattle}>, and stole 💰$GBT {Game.ShieldPrize} from them!" - do! Async.Sleep 3000 + do! Async.Sleep 4000 do! sendFollowUpMessageWithButton event handleDefenseMsg }) @@ -134,16 +136,16 @@ let handleAttack (event : ComponentInteractionCreateEventArgs) = let sendMessage' = sendFollowUpMessage event do! Async.Sleep 1000 let hack = Player.hacks player |> Array.tryHead |> Option.defaultValue defaultHack - let embed = Embeds.responseSuccessfulHack hack + let embed = Embeds.responseSuccessfulHack GuildEnvironment.botHackerBattle hack do! event.Interaction.CreateFollowupMessageAsync(embed) |> Async.AwaitTask |> Async.Ignore - do! Async.Sleep 3000 + do! Async.Sleep 5000 do! sendMessage' ("🎉 **Congratulations**\n\n" + "You successfully **HACKED** me, and are now an **Elite Haxor!**\n\n" + "When you **HACK** other Degenz, you **STEAL** their 💰$GBT.\n" + "But remember, hacks take time to recover, so use them wisely.") - do! Async.Sleep 5000 + do! Async.Sleep 6000 let membr = event.User :?> DiscordMember let role = event.Guild.GetRole(GuildEnvironment.roleTrainee) @@ -154,7 +156,7 @@ let handleAttack (event : ComponentInteractionCreateEventArgs) = ("Your training is **complete!**\n\n" + "But, you’re going to need more **HACKS & SHIELDS** 🛡 to survive in **Beautopia©...**\n" + $"You can purchase them from <@{GuildEnvironment.botArmory}> anytime you want...\n\n" - + $"Go to the <#{GuildEnvironment.channelArmory}> **NOW** and type the `/buy-shield` slash command! 😱") + + $"Go to the <#{GuildEnvironment.channelArmory}> **NOW** and type the `/buy-hack` slash command! 😱") }) let handleButtonEvent (event : ComponentInteractionCreateEventArgs) =