boss等级
This commit is contained in:
@@ -22,6 +22,9 @@ export default class BossInstance extends BaseModel {
|
||||
@prop({ required: true })
|
||||
bossHp: number;
|
||||
|
||||
@prop({ required: true })
|
||||
bossLv: number;
|
||||
|
||||
@prop({ required: true, type: Rank, default:[]})
|
||||
ranks:Array<Rank>;
|
||||
|
||||
@@ -48,13 +51,14 @@ export default class BossInstance extends BaseModel {
|
||||
|
||||
@prop({ required: true, default: false })
|
||||
winSettled: boolean; //胜利是否结算过
|
||||
|
||||
public static async findBossInstance(guildCode: string, lean = true) {
|
||||
const bossInstance: BossInstanceType = await BossInstanceModel.findOne({ guildCode }).lean(lean);
|
||||
return bossInstance;
|
||||
}
|
||||
|
||||
public static async openBossInstance(guildCode: string, bossHp: number, warId: number, lean = true) {
|
||||
const bossInstance: BossInstanceType = await BossInstanceModel.findOneAndUpdate({ guildCode },{ranks:[], time: nowSeconds(), bossHp, warId, $inc: { recordNum: 1 }}, {new: true, upsert: true}).lean(lean);
|
||||
public static async openBossInstance(guildCode: string, bossHp: number, warId: number, bossLv: number, lean = true) {
|
||||
const bossInstance: BossInstanceType = await BossInstanceModel.findOneAndUpdate({ guildCode },{ranks:[], time: nowSeconds(), bossHp, bossLv, warId, $inc: { recordNum: 1 }}, {new: true, upsert: true}).lean(lean);
|
||||
return bossInstance;
|
||||
}
|
||||
//记录玩家boss通关后首次查看boss关卡
|
||||
|
||||
Reference in New Issue
Block a user