✨ feat(gvg): 激战期获取挑战对手阵容

This commit is contained in:
luying
2023-02-17 10:59:38 +08:00
parent aa099dddaf
commit 6815bf316a
13 changed files with 1023 additions and 46 deletions
+3 -6
View File
@@ -89,10 +89,7 @@ export default class GVGTeam extends BaseModel {
defenseTime: number; // 防守保护时间
@prop({ required: true, default: 0 })
playerScore: number; // 积分
@prop({ required: true, default: 0 })
leagueScore: number; // 积分
score: number; // 积分
@prop({ required: true, type: () => GVGHeroInfo, _id: false })
lineup: GVGHeroInfo[];
@@ -216,8 +213,8 @@ export default class GVGTeam extends BaseModel {
}
// 结算挑战方
public static async battleEndAttack(teamCode: string, hpInc: number, playerScoreInc: number, leagueScoreInc: number) {
const team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $inc: { durability: hpInc, playerScore: playerScoreInc, leagueScore: leagueScoreInc } }, { new: true }).lean();
public static async battleEndAttack(teamCode: string, hpInc: number, playerScoreInc: number) {
const team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $inc: { durability: hpInc, playerScore: playerScoreInc } }, { new: true }).lean();
return team;
}