🐞 fix(巅峰演武): 修改等级计算、2倍碾压

This commit is contained in:
zhangxk
2023-10-13 17:03:06 +08:00
parent 73a44e9828
commit b82d525f7f
5 changed files with 38 additions and 20 deletions

View File

@@ -65,10 +65,14 @@ export class Defense {
@prop({ required: true, type: () => Combo, _id: false })
combo: Combo[]; // 防守阵容的等级
constructor(heroes: DefenseHero[], scores: number[], warId: number, buff: number, combo: Combo[]) {
constructor(heroes: DefenseHero[], scores: number[], warId: number, buff: number, combo: Combo[], heroScores:HeroScore[]) {
this.heroes = heroes;
this.score = scores.reduce((pre, cur) => pre + cur, 0);
let {pLv, score} = getPlvAndScore(scores);
let newScores: number[] = [];
for(let {score} of heroScores){
newScores.push(score);
}
let {pLv, score} = getPlvAndScore(newScores);
this.pLv = pLv,
this.score = score;
this.warId = warId;
@@ -96,10 +100,14 @@ export class Attack {
@prop({ required: true })
pLv: number; // 防守阵容的等级
constructor(heroes: AttackHero[], scores: number[]) {
constructor(heroes: AttackHero[], scores: number[], heroScores:HeroScore[]) {
this.heroes = heroes;
this.score = scores.reduce((pre, cur) => pre + cur, 0);
let {pLv, score} = getPlvAndScore(scores);
let newScores: number[] = [];
for(let {score} of heroScores){
newScores.push(score);
}
let {pLv, score} = getPlvAndScore(newScores);
this.pLv = pLv;
this.score = score;
}