forked from devsam/core
fix: 장수 카드에 부상스탯 미반영
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
<div>
|
||||
<div class="row gx-0">
|
||||
<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 -->
|
||||
<span v-if="general.lbonus > 0" style="color: cyan">+{{ general.lbonus }}</span>
|
||||
</div>
|
||||
@@ -40,7 +40,7 @@
|
||||
<div>
|
||||
<div class="row gx-0">
|
||||
<div class="col" :style="{ color: injuryInfo.color }">
|
||||
{{ general.strength }}
|
||||
{{ calcInjury('strength', general) }}
|
||||
</div>
|
||||
<div class="col align-self-center">
|
||||
<SammoBar :height="10" :percent="(general.strength_exp / 20) * 100" />
|
||||
@@ -51,7 +51,7 @@
|
||||
<div>
|
||||
<div class="row gx-0">
|
||||
<div class="col" :style="{ color: injuryInfo.color }">
|
||||
{{ general.intel }}
|
||||
{{ calcInjury('intel', general) }}
|
||||
</div>
|
||||
<div class="col align-self-center">
|
||||
<SammoBar :height="10" :percent="(general.intel_exp / 20) * 100" />
|
||||
@@ -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<Ref<GameConstStore>>("gameConstStore"));
|
||||
const props = defineProps<{
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<div>
|
||||
<div class="row gx-0">
|
||||
<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 -->
|
||||
<span v-if="general.lbonus > 0" style="color: cyan">+{{ general.lbonus }}</span>
|
||||
</div>
|
||||
@@ -33,7 +33,7 @@
|
||||
<div>
|
||||
<div class="row gx-0">
|
||||
<div class="col" :style="{ color: injuryInfo.color }">
|
||||
{{ general.strength }}
|
||||
{{ calcInjury('strength', general) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,7 +41,7 @@
|
||||
<div>
|
||||
<div class="row gx-0">
|
||||
<div class="col" :style="{ color: injuryInfo.color }">
|
||||
{{ general.intel }}
|
||||
{{ calcInjury('intel', general) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -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<Ref<GameConstStore>>("gameConstStore"));
|
||||
const props = defineProps<{
|
||||
general: GeneralListItemP0;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user