feat: 기본 내정보 카드
- 아직 bar가 없음
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import type { GameConstType } from "@/defs/GameObj";
|
||||
|
||||
export function formatGeneralTypeCall(leadership: number, strength: number, intel: number, gameConst: GameConstType): string {
|
||||
if (leadership < 40) {
|
||||
if (strength + intel < 40) {
|
||||
return '아둔';
|
||||
}
|
||||
if (intel >= gameConst.chiefStatMin && strength < intel * 0.8) {
|
||||
return '학자';
|
||||
}
|
||||
if (strength >= gameConst.chiefStatMin && intel < strength * 0.8) {
|
||||
return '장사';
|
||||
}
|
||||
return '명사';
|
||||
}
|
||||
|
||||
const maxStat = Math.max(leadership, strength, intel);
|
||||
const sum2Stat = Math.min(leadership + strength, strength + intel, intel + leadership);
|
||||
if (maxStat >= gameConst.chiefStatMin + gameConst.statGradeLevel && sum2Stat >= maxStat * 1.7) {
|
||||
return '만능';
|
||||
}
|
||||
if (strength >= gameConst.chiefStatMin - gameConst.statGradeLevel && intel < strength * 0.8) {
|
||||
return '용장';
|
||||
}
|
||||
if (intel >= gameConst.chiefStatMin - gameConst.statGradeLevel && strength < intel * 0.8) {
|
||||
return '명장';
|
||||
}
|
||||
if (leadership >= gameConst.chiefStatMin - gameConst.statGradeLevel && strength + intel < leadership) {
|
||||
return '차장';
|
||||
}
|
||||
return '평범';
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
export function formatInjury(injury: number): [string, string]{
|
||||
if(injury <= 0){
|
||||
return ['건강', 'white'];
|
||||
}
|
||||
if(injury <= 20){
|
||||
return ['경상', 'yellow'];
|
||||
}
|
||||
if(injury <= 40){
|
||||
return ['중상', 'orange'];
|
||||
}
|
||||
if(injury <= 60){
|
||||
return ['심각', 'magenta'];
|
||||
}
|
||||
return ['위독', 'red'];
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export function nextExpLevelRemain(exp: number, expLevel: number): [number, number] {
|
||||
if (exp < 1000) {
|
||||
return [exp - expLevel * 100, 100]
|
||||
}
|
||||
|
||||
const expBase = 10 * expLevel ** 2;
|
||||
const expNext = 10 * (expLevel + 1) ** 2;
|
||||
return [exp - expBase, expNext - expBase];
|
||||
}
|
||||
Reference in New Issue
Block a user