Read actual shield used in trainer, mention right hack target, slow things down
This commit is contained in:
parent
3b5852bcfb
commit
36471195aa
@ -66,12 +66,12 @@ let pickHack actionId attacker defender =
|
|||||||
.AddEmbed(embed.Build())
|
.AddEmbed(embed.Build())
|
||||||
.AsEphemeral true
|
.AsEphemeral true
|
||||||
|
|
||||||
let responseSuccessfulHack (hack : BattleItem) =
|
let responseSuccessfulHack (targetId : uint64) (hack : BattleItem) =
|
||||||
let embed = DiscordEmbedBuilder()
|
let embed = DiscordEmbedBuilder()
|
||||||
embed.ImageUrl <- getHackGif (enum<HackId>(hack.Id))
|
embed.ImageUrl <- getHackGif (enum<HackId>(hack.Id))
|
||||||
|
|
||||||
DiscordFollowupMessageBuilder()
|
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())
|
.AddEmbed(embed.Build())
|
||||||
.AsEphemeral(true)
|
.AsEphemeral(true)
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ let successfulHack (event : ComponentInteractionCreateEventArgs) attacker defend
|
|||||||
async {
|
async {
|
||||||
do! updateCombatants attacker defender hack Game.HackPrize
|
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)
|
do! event.Interaction.CreateFollowupMessageAsync(embed)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|> Async.Ignore
|
|> Async.Ignore
|
||||||
|
@ -76,14 +76,16 @@ let handleDefenseMsg = {
|
|||||||
let handleDefense (event : ComponentInteractionCreateEventArgs) =
|
let handleDefense (event : ComponentInteractionCreateEventArgs) =
|
||||||
Game.executePlayerEvent event (fun player -> async {
|
Game.executePlayerEvent event (fun player -> async {
|
||||||
let sendMessage' = sendFollowUpMessage event
|
let sendMessage' = sendFollowUpMessage event
|
||||||
let shield = Player.shields player |> Array.tryHead |> Option.defaultValue defaultShield
|
let split = event.Id.Split("-")
|
||||||
|
let shieldId = enum<ShieldId>(int split.[2])
|
||||||
|
let shield = Armory.getItem (int shieldId)
|
||||||
let embed = Embeds.responseCreatedShieldTrainer shield
|
let embed = Embeds.responseCreatedShieldTrainer shield
|
||||||
do! event.Interaction.CreateFollowupMessageAsync(embed) |> Async.AwaitTask |> Async.Ignore
|
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! 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! 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
|
do! sendFollowUpMessageWithButton event handleDefenseMsg
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -134,16 +136,16 @@ let handleAttack (event : ComponentInteractionCreateEventArgs) =
|
|||||||
let sendMessage' = sendFollowUpMessage event
|
let sendMessage' = sendFollowUpMessage event
|
||||||
do! Async.Sleep 1000
|
do! Async.Sleep 1000
|
||||||
let hack = Player.hacks player |> Array.tryHead |> Option.defaultValue defaultHack
|
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! event.Interaction.CreateFollowupMessageAsync(embed) |> Async.AwaitTask |> Async.Ignore
|
||||||
do! Async.Sleep 3000
|
do! Async.Sleep 5000
|
||||||
do! sendMessage'
|
do! sendMessage'
|
||||||
("🎉 **Congratulations**\n\n"
|
("🎉 **Congratulations**\n\n"
|
||||||
+ "You successfully **HACKED** me, and are now an **Elite Haxor!**\n\n"
|
+ "You successfully **HACKED** me, and are now an **Elite Haxor!**\n\n"
|
||||||
+ "When you **HACK** other Degenz, you **STEAL** their 💰$GBT.\n"
|
+ "When you **HACK** other Degenz, you **STEAL** their 💰$GBT.\n"
|
||||||
+ "But remember, hacks take time to recover, so use them wisely.")
|
+ "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 membr = event.User :?> DiscordMember
|
||||||
let role = event.Guild.GetRole(GuildEnvironment.roleTrainee)
|
let role = event.Guild.GetRole(GuildEnvironment.roleTrainee)
|
||||||
@ -154,7 +156,7 @@ let handleAttack (event : ComponentInteractionCreateEventArgs) =
|
|||||||
("Your training is **complete!**\n\n"
|
("Your training is **complete!**\n\n"
|
||||||
+ "But, you’re going to need more **HACKS & SHIELDS** 🛡 to survive in **Beautopia©...**\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"
|
+ $"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) =
|
let handleButtonEvent (event : ComponentInteractionCreateEventArgs) =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user