Remove GBT reward from Trainer

This commit is contained in:
Joseph Ferano 2022-05-07 10:52:27 +07:00
parent 49f716bff7
commit 22cac7c96a

View File

@ -13,7 +13,6 @@ let hackItem = Arsenal.weapons |> Inventory.findItemById (string ItemId.REMOTE)
let shieldItem = Arsenal.weapons |> Inventory.findItemById (string ItemId.FIREWALL) let shieldItem = Arsenal.weapons |> Inventory.findItemById (string ItemId.FIREWALL)
let defaultHack = (Inventory.getHackItem hackItem).Value let defaultHack = (Inventory.getHackItem hackItem).Value
let defaultShield = (Inventory.getShieldItem shieldItem ).Value let defaultShield = (Inventory.getShieldItem shieldItem ).Value
let CurrencyGift = 250<GBT>
let BeginnerProtectionHours = 24 let BeginnerProtectionHours = 24
let HackEvent () = { let HackEvent () = {
@ -169,7 +168,6 @@ Here, I'm going to gift you:
1. A hack - `{defaultHack.Name}`, 1. A hack - `{defaultHack.Name}`,
2. A shield - `{defaultShield.Name}`, 2. A shield - `{defaultShield.Name}`,
3. `{CurrencyGift} 💰 $GBT`,
I'm also going to give you some **TEMPORARY SHIELDS** until you buy your own. I'm also going to give you some **TEMPORARY SHIELDS** until you buy your own.
They will **ONLY** protect you from hacks for **{BeginnerProtectionHours} hrs**... They will **ONLY** protect you from hacks for **{BeginnerProtectionHours} hrs**...
@ -199,22 +197,6 @@ let handleArsenal (ctx : IDiscordContext) = PlayerInteractions.executePlayerActi
if inventory |> List.exists (fun i -> i.Id = weapon.Id) if inventory |> List.exists (fun i -> i.Id = weapon.Id)
then inventory then inventory
else weapon::inventory else weapon::inventory
let updatedPlayer = {
player with
Events =
player
|> Player.removeExpiredActions
|> fun p -> p.Events
|> List.filter (fun e -> match e.Type with Shielding _ -> false | _ -> true)
|> List.append (ShieldEvents())
|> List.consTo (HackEvent())
Inventory =
player.Inventory
|> addIfDoesntExist hackItem
|> addIfDoesntExist shieldItem
Bank = player.Bank + CurrencyGift
}
do! DbService.updatePlayer updatedPlayer |> Async.Ignore
if player.Inventory |> List.exists (fun i -> i.Id = hackItem.Id) |> not then if player.Inventory |> List.exists (fun i -> i.Id = hackItem.Id) |> not then
do! DbService.addToPlayerInventory player.DiscordId hackItem |> Async.Ignore do! DbService.addToPlayerInventory player.DiscordId hackItem |> Async.Ignore
if player.Inventory |> List.exists (fun i -> i.Id = shieldItem.Id) |> not then if player.Inventory |> List.exists (fun i -> i.Id = shieldItem.Id) |> not then
@ -228,11 +210,25 @@ let handleArsenal (ctx : IDiscordContext) = PlayerInteractions.executePlayerActi
printfn "%s" ex.Message printfn "%s" ex.Message
() ()
let updatedPlayer = {
player with
Events =
player
|> Player.removeExpiredActions
|> fun p -> p.Events
|> List.filter (fun e -> match e.Type with Shielding _ -> false | _ -> true)
|> List.append (ShieldEvents())
|> List.consTo (HackEvent())
Inventory =
player.Inventory
|> addIfDoesntExist hackItem
|> addIfDoesntExist shieldItem
}
let embed = Embeds.getArsenalEmbed updatedPlayer let embed = Embeds.getArsenalEmbed updatedPlayer
do! ctx.FollowUp(embed) |> Async.AwaitTask do! ctx.FollowUp(embed) |> Async.AwaitTask
do! Async.Sleep 2000 do! Async.Sleep 2000
let rewards = [ $"{defaultHack.Name} Hack" ; $"{defaultShield.Name} Shield" ; $"{CurrencyGift} 💰$GBT"] let rewards = [ $"{defaultHack.Name} Hack" ; $"{defaultShield.Name} Shield" ]
let embed = Embeds.getAchievementEmbed rewards "You completed the Training Dojo and collected some gifts." TrainerAchievement let embed = Embeds.getAchievementEmbed rewards "You completed the Training Dojo and collected some gifts." TrainerAchievement
do! ctx.FollowUp(embed) |> Async.AwaitTask do! ctx.FollowUp(embed) |> Async.AwaitTask