From 5ce899ee6e92dbd115afd3b6d943d58d3b78e044 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 30 Jul 2022 14:25:23 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=9E=A5=EC=88=98=20=EC=B9=B4=EB=93=9C?= =?UTF-8?q?=EC=97=90=20=EB=B6=80=EC=83=81=EC=8A=A4=ED=83=AF=20=EB=AF=B8?= =?UTF-8?q?=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/components/GeneralBasicCard.vue | 8 +++++--- hwe/ts/components/GeneralLiteCard.vue | 8 +++++--- hwe/ts/utilGame/calcInjury.ts | 6 ++++++ 3 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 hwe/ts/utilGame/calcInjury.ts diff --git a/hwe/ts/components/GeneralBasicCard.vue b/hwe/ts/components/GeneralBasicCard.vue index 78a4a2d7..ece1e410 100644 --- a/hwe/ts/components/GeneralBasicCard.vue +++ b/hwe/ts/components/GeneralBasicCard.vue @@ -27,7 +27,7 @@
- {{ general.leadership }} + {{ calcInjury('leadership', general) }} +{{ general.lbonus }}
@@ -40,7 +40,7 @@
- {{ general.strength }} + {{ calcInjury('strength', general) }}
@@ -51,7 +51,7 @@
- {{ general.intel }} + {{ calcInjury('intel', general) }}
@@ -163,6 +163,8 @@ import { parseTime } from "@/util/parseTime"; import { clamp } from "lodash"; import { formatCityName } from "@/utilGame/formatCityName"; import { isValidObjKey } from "@/utilGame/isValidObjKey"; +import { calcInjury } from "@/utilGame/calcInjury"; + const imagePath = window.pathConfig.gameImage; const gameConstStore = unwrap(inject>("gameConstStore")); const props = defineProps<{ diff --git a/hwe/ts/components/GeneralLiteCard.vue b/hwe/ts/components/GeneralLiteCard.vue index 71919d4f..28af6775 100644 --- a/hwe/ts/components/GeneralLiteCard.vue +++ b/hwe/ts/components/GeneralLiteCard.vue @@ -23,7 +23,7 @@
- {{ general.leadership }} + {{ calcInjury('leadership', general) }} +{{ general.lbonus }}
@@ -33,7 +33,7 @@
- {{ general.strength }} + {{ calcInjury('strength', general) }}
@@ -41,7 +41,7 @@
- {{ general.intel }} + {{ calcInjury('intel', general) }}
@@ -91,6 +91,8 @@ import { unwrap } from "@/util/unwrap"; import type { GameConstStore } from "@/GameConstStore"; import { formatGeneralTypeCall } from "@/utilGame/formatGeneralTypeCall"; import { formatConnectScore } from "@/utilGame/formatConnectScore"; +import { calcInjury } from "@/utilGame/calcInjury"; + const gameConstStore = unwrap(inject>("gameConstStore")); const props = defineProps<{ general: GeneralListItemP0; diff --git a/hwe/ts/utilGame/calcInjury.ts b/hwe/ts/utilGame/calcInjury.ts new file mode 100644 index 00000000..e3f5c29c --- /dev/null +++ b/hwe/ts/utilGame/calcInjury.ts @@ -0,0 +1,6 @@ +import type { GeneralListItemP0 } from "@/defs/API/Nation"; + +export function calcInjury(statKey: 'leadership'|'strength'|'intel', general: GeneralListItemP0){ + const baseStat = general[statKey]; + return Math.round(baseStat * (100 -general.injury) / 100); +} \ No newline at end of file