名将擂台:刷新机制

This commit is contained in:
luying
2022-08-17 14:00:53 +08:00
parent f1b1ac49e7
commit 87bde927d2
2 changed files with 19 additions and 19 deletions

View File

@@ -54,10 +54,6 @@ export class LadderDefense {
export class LadderOppPlayerInDB {
@prop({ required: true })
rank: number;
@prop({ required: true })
roleId: string;
@prop({ required: true })
isRobot: boolean;
}
// ladderMatchRec
@@ -206,13 +202,12 @@ export class LadderOppPlayerReturn {
defCe: number = 0; // 对手防守阵容战力
isRobot: boolean = true; // 是否是机器人
constructor(rank: number, isRobot: boolean) {
constructor(rank: number) {
this.rank = rank;
this.isRobot = isRobot;
if(isRobot) this.roleId = `robot${this.rank}`;
}
setByRedis(param: RoleRankInfo, defCe: number) {
this.isRobot = false;
this.roleId = param.roleId;
this.roleName = param.roleName;
this.head = param.head;
@@ -224,6 +219,8 @@ export class LadderOppPlayerReturn {
}
setByRobot(ladderDifficultRatio: DicLadderDifficultRatio) {
this.isRobot = true;
this.roleId = `robot${this.rank}`;
this.head = ladderDifficultRatio.head;
this.spine = ladderDifficultRatio.spine;
this.lv = ladderDifficultRatio.level;