🐞 fix(活动): 宴请百家解锁条件修改
This commit is contained in:
@@ -64,7 +64,7 @@ export class EntertainHandler {
|
|||||||
if(!randResult) return resResult(STATUS.ACTIVITY_ENTERTAIN_NO_NUM);
|
if(!randResult) return resResult(STATUS.ACTIVITY_ENTERTAIN_NO_NUM);
|
||||||
|
|
||||||
let rewards = stringToRewardParam(randResult.reward);
|
let rewards = stringToRewardParam(randResult.reward);
|
||||||
let playerRecord = await ActivityEntertainRecModel.record(serverId, activityId, playerData.roundIndex, roleId, { todayIndex: playerData.todayIndex, id: randResult.id, hid: randResult.hid, time: new Date(), reward: randResult.reward })
|
let playerRecord = await ActivityEntertainRecModel.record(serverId, activityId, playerData.roundIndex, roleId, { todayIndex: playerData.todayIndex, id: randResult.id, hid: randResult.hid, index: randResult.index, time: new Date(), reward: randResult.reward })
|
||||||
let { goods } = await addReward(roleId, roleName, sid, serverId, rewards, ITEM_CHANGE_REASON.ACT_ENTERTAIN);
|
let { goods } = await addReward(roleId, roleName, sid, serverId, rewards, ITEM_CHANGE_REASON.ACT_ENTERTAIN);
|
||||||
randResult.incNum();
|
randResult.incNum();
|
||||||
playerData.updateBuyCnt(playerRecord);
|
playerData.updateBuyCnt(playerRecord);
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ class EntertainRecord {
|
|||||||
@prop({ required: true })
|
@prop({ required: true })
|
||||||
hid: number; // 冗余,武将id
|
hid: number; // 冗余,武将id
|
||||||
|
|
||||||
|
@prop({ required: true })
|
||||||
|
index: number; // 冗余,武将id
|
||||||
|
|
||||||
@prop({ required: true })
|
@prop({ required: true })
|
||||||
reward: string; // 冗余,奖励
|
reward: string; // 冗余,奖励
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ export class EntertainData extends ActivityBase {
|
|||||||
this.todayPlayCnt = 0;
|
this.todayPlayCnt = 0;
|
||||||
this.playCnt = 0;
|
this.playCnt = 0;
|
||||||
let recByDay = new Map<number, number>();
|
let recByDay = new Map<number, number>();
|
||||||
for (let { id, hid, todayIndex } of (playerData.record || [])) {
|
for (let { id, index, todayIndex } of (playerData.record || [])) {
|
||||||
if (todayIndex == this.todayIndex) {
|
if (todayIndex == this.todayIndex) {
|
||||||
this.todayPlayCnt++;
|
this.todayPlayCnt++;
|
||||||
this.playCnt++;
|
this.playCnt++;
|
||||||
@@ -136,8 +136,8 @@ export class EntertainData extends ActivityBase {
|
|||||||
|
|
||||||
let hero = this.findHeroById(id);
|
let hero = this.findHeroById(id);
|
||||||
hero.incNum();
|
hero.incNum();
|
||||||
if(this.invitedHids.indexOf(hid) == -1) {
|
if(this.invitedHids.indexOf(index) == -1) {
|
||||||
this.invitedHids.push(hid);
|
this.invitedHids.push(index);
|
||||||
this.invitedHeroNum++;
|
this.invitedHeroNum++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user