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