fix 修复奇遇本答题逻辑
This commit is contained in:
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user