任务:按条件开启任务
This commit is contained in:
@@ -30,7 +30,7 @@ export async function getAp(now: number, roleId: string) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function setAp(now: number, roleId: string, sid: string, changeAp: number) {
|
||||
export async function setAp(now: number, roleId: string, sid: string, funcs: number[], changeAp: number) {
|
||||
let ApResult = await getAp(now, roleId);
|
||||
let { ap, maxAp, refTime, apRemainTime, isOver } = ApResult; // 更新ap
|
||||
ap += changeAp;
|
||||
@@ -44,7 +44,7 @@ export async function setAp(now: number, roleId: string, sid: string, changeAp:
|
||||
if(isOver && ap < maxAp) apRemainTime = Math.floor(ACTION_POIN.PER / 1000); // 特殊处理
|
||||
|
||||
if(changeAp < 0) {
|
||||
await checkTask(roleId, sid, TASK_TYPE.BATTLE_COST_AP, -1 * changeAp, true, {});
|
||||
await checkTask(roleId, sid, funcs, TASK_TYPE.BATTLE_COST_AP, -1 * changeAp, true, {});
|
||||
}
|
||||
return {ap, maxAp, refTime, apRemainTime}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user