Should count defenses only
This commit is contained in:
parent
d311423ca2
commit
213f9be2ee
@ -59,7 +59,7 @@ module Player =
|
|||||||
let attacks player =
|
let attacks player =
|
||||||
player.Actions
|
player.Actions
|
||||||
|> Array.filter (fun act -> match act.Type with Attack _ -> true | _ -> false)
|
|> Array.filter (fun act -> match act.Type with Attack _ -> true | _ -> false)
|
||||||
let defenses player = player.Actions |> Array.filter (fun act -> match act.Type with Defense -> true | _ -> false)
|
let getDefenses player = player.Actions |> Array.filter (fun act -> match act.Type with Defense -> true | _ -> false)
|
||||||
|
|
||||||
let removeExpiredActions filterByAttackCooldown player =
|
let removeExpiredActions filterByAttackCooldown player =
|
||||||
let actions =
|
let actions =
|
||||||
|
@ -58,8 +58,8 @@ let checkTargetHasMoney (target : PlayerData) attacker =
|
|||||||
|
|
||||||
let checkPlayerHasShieldSlotsAvailable shield player =
|
let checkPlayerHasShieldSlotsAvailable shield player =
|
||||||
let updatedPlayer = player |> Player.removeExpiredActions false
|
let updatedPlayer = player |> Player.removeExpiredActions false
|
||||||
let defenses = updatedPlayer |> fun p -> p.Actions
|
let defenses = Player.getDefenses updatedPlayer
|
||||||
match defenses |> Array.length > 2 with
|
match defenses |> Array.length >= 2 with
|
||||||
| true ->
|
| true ->
|
||||||
let timestamp = defenses |> Array.rev |> Array.head |> fun a -> a.Timestamp // This should be the next expiring timestamp
|
let timestamp = defenses |> Array.rev |> Array.head |> fun a -> a.Timestamp // This should be the next expiring timestamp
|
||||||
let cooldown = getTimeText true (TimeSpan.FromMinutes(int shield.Cooldown)) timestamp
|
let cooldown = getTimeText true (TimeSpan.FromMinutes(int shield.Cooldown)) timestamp
|
||||||
@ -74,7 +74,7 @@ let calculateDamage (hack : BattleItem) (shield : BattleItem) =
|
|||||||
let runHackerBattle defender hack =
|
let runHackerBattle defender hack =
|
||||||
defender
|
defender
|
||||||
|> Player.removeExpiredActions false
|
|> Player.removeExpiredActions false
|
||||||
|> Player.defenses
|
|> Player.getDefenses
|
||||||
|> Array.map (fun dfn -> Armory.battleItems |> Array.find (fun w -> w.Id = dfn.ActionId))
|
|> Array.map (fun dfn -> Armory.battleItems |> Array.find (fun w -> w.Id = dfn.ActionId))
|
||||||
|> Array.map (calculateDamage (hack))
|
|> Array.map (calculateDamage (hack))
|
||||||
|> Array.contains Weak
|
|> Array.contains Weak
|
||||||
|
@ -57,7 +57,7 @@ let statusFormat p =
|
|||||||
$"**Hacks:** {Player.hacks p |> battleItemFormat}\n
|
$"**Hacks:** {Player.hacks p |> battleItemFormat}\n
|
||||||
**Shields:** {Player.getShields p |> battleItemFormat}\n
|
**Shields:** {Player.getShields p |> battleItemFormat}\n
|
||||||
**Hack Attacks:**\n{Player.attacks p |> actionFormat}\n
|
**Hack Attacks:**\n{Player.attacks p |> actionFormat}\n
|
||||||
**Active Shields:**\n{Player.defenses p |> actionFormat}"
|
**Active Shields:**\n{Player.getDefenses p |> actionFormat}"
|
||||||
|
|
||||||
// TODO: There's a 1000 character limit for embeds, so you need to filter by N last actions
|
// TODO: There's a 1000 character limit for embeds, so you need to filter by N last actions
|
||||||
let arsenal (ctx : InteractionContext) =
|
let arsenal (ctx : InteractionContext) =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user