fix: 장수 카드에 부상스탯 미반영

This commit is contained in:
2022-07-30 14:25:23 +09:00
parent e041080773
commit 5ce899ee6e
3 changed files with 16 additions and 6 deletions
+5 -3
View File
@@ -27,7 +27,7 @@
<div> <div>
<div class="row gx-0"> <div class="row gx-0">
<div class="col"> <div class="col">
<span :style="{ color: injuryInfo.color }">{{ general.leadership }}</span> <span :style="{ color: injuryInfo.color }">{{ calcInjury('leadership', general) }}</span>
<!-- eslint-disable-next-line vue/no-v-html --> <!-- eslint-disable-next-line vue/no-v-html -->
<span v-if="general.lbonus > 0" style="color: cyan">+{{ general.lbonus }}</span> <span v-if="general.lbonus > 0" style="color: cyan">+{{ general.lbonus }}</span>
</div> </div>
@@ -40,7 +40,7 @@
<div> <div>
<div class="row gx-0"> <div class="row gx-0">
<div class="col" :style="{ color: injuryInfo.color }"> <div class="col" :style="{ color: injuryInfo.color }">
{{ general.strength }} {{ calcInjury('strength', general) }}
</div> </div>
<div class="col align-self-center"> <div class="col align-self-center">
<SammoBar :height="10" :percent="(general.strength_exp / 20) * 100" /> <SammoBar :height="10" :percent="(general.strength_exp / 20) * 100" />
@@ -51,7 +51,7 @@
<div> <div>
<div class="row gx-0"> <div class="row gx-0">
<div class="col" :style="{ color: injuryInfo.color }"> <div class="col" :style="{ color: injuryInfo.color }">
{{ general.intel }} {{ calcInjury('intel', general) }}
</div> </div>
<div class="col align-self-center"> <div class="col align-self-center">
<SammoBar :height="10" :percent="(general.intel_exp / 20) * 100" /> <SammoBar :height="10" :percent="(general.intel_exp / 20) * 100" />
@@ -163,6 +163,8 @@ import { parseTime } from "@/util/parseTime";
import { clamp } from "lodash"; import { clamp } from "lodash";
import { formatCityName } from "@/utilGame/formatCityName"; import { formatCityName } from "@/utilGame/formatCityName";
import { isValidObjKey } from "@/utilGame/isValidObjKey"; import { isValidObjKey } from "@/utilGame/isValidObjKey";
import { calcInjury } from "@/utilGame/calcInjury";
const imagePath = window.pathConfig.gameImage; const imagePath = window.pathConfig.gameImage;
const gameConstStore = unwrap(inject<Ref<GameConstStore>>("gameConstStore")); const gameConstStore = unwrap(inject<Ref<GameConstStore>>("gameConstStore"));
const props = defineProps<{ const props = defineProps<{
+5 -3
View File
@@ -23,7 +23,7 @@
<div> <div>
<div class="row gx-0"> <div class="row gx-0">
<div class="col"> <div class="col">
<span :style="{ color: injuryInfo.color }">{{ general.leadership }}</span> <span :style="{ color: injuryInfo.color }">{{ calcInjury('leadership', general) }}</span>
<!-- eslint-disable-next-line vue/no-v-html --> <!-- eslint-disable-next-line vue/no-v-html -->
<span v-if="general.lbonus > 0" style="color: cyan">+{{ general.lbonus }}</span> <span v-if="general.lbonus > 0" style="color: cyan">+{{ general.lbonus }}</span>
</div> </div>
@@ -33,7 +33,7 @@
<div> <div>
<div class="row gx-0"> <div class="row gx-0">
<div class="col" :style="{ color: injuryInfo.color }"> <div class="col" :style="{ color: injuryInfo.color }">
{{ general.strength }} {{ calcInjury('strength', general) }}
</div> </div>
</div> </div>
</div> </div>
@@ -41,7 +41,7 @@
<div> <div>
<div class="row gx-0"> <div class="row gx-0">
<div class="col" :style="{ color: injuryInfo.color }"> <div class="col" :style="{ color: injuryInfo.color }">
{{ general.intel }} {{ calcInjury('intel', general) }}
</div> </div>
</div> </div>
</div> </div>
@@ -91,6 +91,8 @@ import { unwrap } from "@/util/unwrap";
import type { GameConstStore } from "@/GameConstStore"; import type { GameConstStore } from "@/GameConstStore";
import { formatGeneralTypeCall } from "@/utilGame/formatGeneralTypeCall"; import { formatGeneralTypeCall } from "@/utilGame/formatGeneralTypeCall";
import { formatConnectScore } from "@/utilGame/formatConnectScore"; import { formatConnectScore } from "@/utilGame/formatConnectScore";
import { calcInjury } from "@/utilGame/calcInjury";
const gameConstStore = unwrap(inject<Ref<GameConstStore>>("gameConstStore")); const gameConstStore = unwrap(inject<Ref<GameConstStore>>("gameConstStore"));
const props = defineProps<{ const props = defineProps<{
general: GeneralListItemP0; general: GeneralListItemP0;
+6
View File
@@ -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);
}