测试:添加战斗测试
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user