弹出礼包:pvp改为挑战次数

This commit is contained in:
luying
2022-07-09 10:12:58 +08:00
parent 4962055782
commit c1eceaeba5
7 changed files with 20 additions and 11 deletions
@@ -108,9 +108,10 @@ export async function checkPopUpConditions(serverId: number, roleId: string, con
map.get(item.param).push(item);
}
for(let [_, items] of map) {
let effectTimes = await pkg.getEffectTime();
let popUpShopRec = await ActivityPopUpShopModel.createRecord({
serverId, activityId, roleId, id: pkg.id,
...pkg.getEffectTime(),
...effectTimes,
items: items.map(item => new PopUpShopItem(item))
});
let result = pkg.pushPackage(popUpShopRec);
+1 -1
View File
@@ -314,7 +314,7 @@ export async function getParamStr(activity: ActivityModelType, productID: string
} else {
let popUpShopRec = await ActivityPopUpShopModel.createRecord({
serverId, activityId: activity.activityId, roleId, id: pkg.id,
...pkg.getEffectTime(),
...await pkg.getEffectTime(),
items: pkg.items.map(item => new PopUpShopItem(item))
});
param['code'] = popUpShopRec.code;
+3 -3
View File
@@ -208,14 +208,14 @@ export async function checkTaskInComBattleEnd(roleStatus: RoleStatus[], capId: s
}
}
export async function checkTaskInPvpEnd(serverId: number, roleId: string, sid: string, isSuccess: boolean, heroScores: HeroScores[], score: number) {
export async function checkTaskInPvpEnd(serverId: number, roleId: string, sid: string, isSuccess: boolean, heroScores: HeroScores[], seasonWinNum: number) {
let task = new CheckTask(serverId, roleId);
task.setParam(TASK_TYPE.PVP_WIN, { isSuccess });
task.setParam(TASK_TYPE.PVP_WIN_SERIES, { isSuccess });
task.setParam(TASK_TYPE.PVP_HERO_SCORE, { heroScores });
await task.saveAndPush(sid);
if(score) {
checkPopUpCondition(serverId, roleId, POP_UP_SHOP_CONDITION_TYPE.PVP, { score }, sid);
if(seasonWinNum) {
checkPopUpCondition(serverId, roleId, POP_UP_SHOP_CONDITION_TYPE.PVP, { seasonWinNum }, sid);
}
}