镇念塔:重复发放奖励

This commit is contained in:
luying
2022-08-31 12:08:57 +08:00
parent 61a3f201e0
commit 7e0ffc3273
3 changed files with 11 additions and 5 deletions
+6 -3
View File
@@ -37,9 +37,9 @@ export class WarReward {
this.battleId = battleId;
this.warInfo = gameData.war.get(battleId);
let { fixReward, conditionReward, randomReward } = this.warInfo;
this.fixReward = fixReward;
this.conditionReward = conditionReward;
this.randomReward = randomReward;
this.setFixReward(fixReward);
this.setConditionReward(conditionReward);
this.setRandomReward(randomReward);
}
this.condition = new Map();
@@ -53,6 +53,7 @@ export class WarReward {
public setFixReward(reward: RewardInter[]) {
for(let r of reward) {
console.log('#####setFixReward', JSON.stringify(r));
this.fixReward.push(r);
}
}
@@ -83,6 +84,7 @@ export class WarReward {
if(!this.fixReward) return
for(let i = 0; i < num; i++) {
for(let obj of this.fixReward) {
console.log('##### handleFixReward', JSON.stringify(obj));
this.rewards.push({type: BATTLE_REWARD_TYPE.FIX_REWARD, times: i +1, ...obj, count: obj.count });
}
}
@@ -156,6 +158,7 @@ export class WarReward {
if(combine) {
rewards = combineItems(rewards);
}
console.log('##### saveReward', JSON.stringify(rewards))
await addItems(this.roleId, this.roleName, this.sid, rewards, getReasonByWarType(this.warInfo.warType));
return rewards;
}