pvp:添加购买挑战次数

This commit is contained in:
luying
2021-11-01 15:30:03 +08:00
parent e507ff933b
commit bb625b88ed
7 changed files with 59 additions and 37 deletions
+4 -3
View File
@@ -331,15 +331,16 @@ export async function sendLastSeasonRewardIfNotSent(pvpDefense: PvpDefenseType)
}
// 获取刷新对手次数及消耗
export function refreshRefOppCnt(refOppCnt: number, setAttackCnt: number, refDaily: Date) {
export function refreshRefOppCnt(pvpDefense: PvpDefenseType) {
let { refOppCnt = 0, setAttackCnt = 0, buyAttackCnt = 0, refDaily } = pvpDefense;
let curTime = new Date();
let shouldRefOpp = shouldRefresh(refDaily, curTime);
if (shouldRefOpp) {
refOppCnt = 0; setAttackCnt = 0; refDaily = curTime;
refOppCnt = 0; setAttackCnt = 0; buyAttackCnt =0; refDaily = curTime;
}
return {
shouldRefOpp,
refOppCnt, refDaily, setAttackCnt,
refOppCnt, refDaily, setAttackCnt, buyAttackCnt,
consume: gameData.pvpRefreshConsume.get(refOppCnt + 1)
}
}