This commit is contained in:
Joseph Ferano 2022-03-05 00:05:03 +07:00
parent 3775ff5a44
commit 81cd471a7f
3 changed files with 3 additions and 0 deletions

View File

@ -57,6 +57,7 @@ let pickDefense actionId player isTrainer =
.WithDescription("Pick a shield to protect yourself from hacks")
for shield in Inventory.getShields player.Inventory do
// TODO: This is returning a decimal so look into why
let hours = TimeSpan.FromMinutes(int shield.Cooldown).TotalHours
let against = WeaponClass.getGoodAgainst(shield.Class) |> snd
embed.AddField(shield.Item.Name, $"Active {hours} hours\nDefeats {against}", true) |> ignore

View File

@ -81,6 +81,7 @@ let runHackerBattle defender (hack : HackItem) =
|> List.contains Weak
let updateCombatants successfulHack (attacker : PlayerData) (defender : PlayerData) (hack : HackItem) prize =
// TODO: Look into the prizes and how we're handling them because it seems it can be negative
let updatePlayer amount attack p =
{ p with Events = attack::p.Events ; Bank = max (p.Bank + amount) 0<GBT> }
let event isDefenderEvent =

View File

@ -167,6 +167,7 @@ let handleHack (ctx : IDiscordContext) =
let handleArsenal (ctx : IDiscordContext) =
PlayerInteractions.executePlayerAction ctx (fun player -> async {
let hasStockWeapons =
// TODO: This didn't seem to work and someone was gifted both weapons when they already owned one
player.Inventory
|> List.choose (fun item -> if item.Id = defaultHack.Item.Id || item.Id = defaultShield.Item.Id then Some item else None)
|> List.length > 0