弹出礼包: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
@@ -131,7 +131,7 @@ export class PopUpShopHandler {
newLv: param||100,
quality: param||3,
warId: param||128,
score: param||10,
seasonWinNum: param||10,
equipStar: param||10
});
@@ -276,7 +276,7 @@ export class PvpHandler {
let myRank = await r.getMyRank({ roleId });
result.setMyRank(myRank);
await checkTaskInPvpEnd(serverId, roleId, sid, isSuccess, pvpDefense.heroScores, pvpDefense.score);
await checkTaskInPvpEnd(serverId, roleId, sid, isSuccess, pvpDefense.heroScores, pvpDefense.seasonWinNum);
if(hisWinStreakNum < pvpDefense.hisWinStreakNum) {
await unlockFigure(sid, roleId, [{ type: FIGURE_UNLOCK_CONDITION.PVP_WIN_SERIES, paramWinStreakNum: pvpDefense.hisWinStreakNum }]);
}
@@ -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);
}
}