pvp:修改等级和军功对应关系

This commit is contained in:
luying
2022-02-21 15:10:56 +08:00
parent a52715b852
commit bd76fa9e94
4 changed files with 27 additions and 17 deletions

View File

@@ -461,6 +461,13 @@ export function getPLvByScore(score: number) {
return lv;
}
export function getPlvAndScore(scores: number[] = []) {
if(scores.length <= 0) scores = [0];
let maxScore = Math.max(...scores); // 等级:军功最高者的军功*6
let score = scores.reduce((pre, cur) => pre + cur, 0);
return { score, pLv: getPLvByScore(maxScore)};
}
export function getPvpHeroRewardsByScore(score: number) {
for (let item of gameData.pvpHeroRewards) {
if ((item.max >= score || item.max == -1) && score >= item.min) {