fix 修复奇遇本答题逻辑

This commit is contained in:
luying
2020-10-19 16:56:22 +08:00
parent 6b9a749a2b
commit 99e50c9c36
7 changed files with 94 additions and 32 deletions
+11 -5
View File
@@ -35,16 +35,22 @@ export class WarReward {
if(this.isSuccess) { // 成功了才给固定奖励
let {fixReward = ''} = this.warInfo;
let reward = decodeStr('fixReward', fixReward);
for(let obj of reward) this.rewards.push({type: BATTLE_REWARD_TYPE.FIX_REWARD, ...obj, count: obj.count * num});
for(let i = 0; i < num; i++) {
for(let obj of reward) {
this.rewards.push({type: BATTLE_REWARD_TYPE.FIX_REWARD, times: i +1, ...obj, count: obj.count });
}
}
}
}
private handleConditionReward(num: number) {
if(this.isSuccess) {
let {conditionReward = ''} = this.warInfo;
let reward = decodeStr('conditionReward', conditionReward);
for(let obj of reward) {
if(this.condition.get(obj.condition)) {
this.rewards.push({type: BATTLE_REWARD_TYPE.CONDITION_REWARD, ...obj, count: obj.count * num});
for(let i = 0; i < num; i++) {
for(let obj of reward) {
if(this.condition.get(obj.condition)) {
this.rewards.push({type: BATTLE_REWARD_TYPE.CONDITION_REWARD, times: i +1, ...obj, count: obj.count});
}
}
}
}
@@ -73,7 +79,7 @@ export class WarReward {
}
if(flag) {
getNum ++; getSum++;
this.rewards.push({type: BATTLE_REWARD_TYPE.RANDOM_REWARD, ...obj});
this.rewards.push({type: BATTLE_REWARD_TYPE.RANDOM_REWARD, times: i +1, ...obj});
}
}
await BattleDropModel.updateByGid(this.roleId, this.battleId, gid, {