✨ feat(百家争鸣):祈灵 更新至 eb9f941ae

This commit is contained in:
luying
2023-08-25 14:57:06 +08:00
parent f8349849eb
commit e6665208e1
13 changed files with 417 additions and 137 deletions
@@ -19,6 +19,8 @@ import { isHeroHidden } from "../../../services/dataService";
import { GachaResultIndb } from "../../../domain/activityField/gachaField";
import { CreateHeroParam } from "../../../domain/roleField/hero";
import { ItemInter, RewardInter } from "../../../pubUtils/interface";
import { getPlayerAuthorGachaData } from "../../../services/activity/authorGachaService";
import { ActivityAuthorGachaRecModel, ActivityAuthorGachaRecModelType } from "../../../db/AuthorGachaRec";
export default function (app: Application) {
new HandlerService(app, {});
@@ -113,6 +115,14 @@ export class GachaHandler {
await UserGachaRecModel.createRec(roleId, gachaId, activityId, count, resultList);
if(dicGacha.isTask) await checkTaskInGacha(serverId, roleId, sid, count, resultHeroes, resultList, false);
//百家争鸣祈灵
let playerData = await getPlayerAuthorGachaData(activityId, serverId, roleId);
let dbAuthorGacha:ActivityAuthorGachaRecModelType;
if (playerData) {
dbAuthorGacha = await ActivityAuthorGachaRecModel.updateGachaCnt(serverId, activityId, playerData.roundIndex, roleId, gachaId, count);
}
return resResult(STATUS.SUCCESS, {
gachaId, activityId,
isFree: freeCount < newDicGacha.free.count, cost: newDicGacha.cost,
@@ -120,7 +130,8 @@ export class GachaHandler {
// heroes: resultHeroes,
addHeros: heroes,
result: resultList,
remainFloor: getGachaRemainFloor(gachaId, floor)
remainFloor: getGachaRemainFloor(gachaId, floor),
authorGachaCnt:dbAuthorGacha?.gachaCnt||0,
});
}