测试:添加战斗测试

This commit is contained in:
luying
2021-11-03 20:04:06 +08:00
parent 88e7ee906d
commit fb59fcd0ca
13 changed files with 364 additions and 22 deletions

View File

@@ -138,7 +138,22 @@ export class GachaHandler {
}
}
}
let userGacha = await UserGachaModel.updateInfo(roleId, gachaId, 0, { hope: hope.map(cur => { return { ...cur, hasGet: false } }) })
let userGacha = await UserGachaModel.findByRole(roleId, gachaId);
let { hope: userHope = []} = await refreshGacha(gameData.gacha.get(gachaId), userGacha);
for (let { id, hid } of hope) {
let curHope = userHope.find(cur => cur.id == id);
if(curHope) {
if(curHope.hasGet) {
continue;
} else {
curHope.hid = hid;
curHope.hasGet = false;
}
} else {
userHope.push({ id, hid, hasGet: false })
}
}
userGacha = await UserGachaModel.updateInfo(roleId, gachaId, 0, { hope: userHope });
return resResult(STATUS.SUCCESS, {
gachaId,