fix 修复远征当前血量和最大血量无法匹配bug

This commit is contained in:
luying
2020-11-19 10:37:39 +08:00
parent f07109d11c
commit 225d55f98f
6 changed files with 55 additions and 31 deletions
+7 -6
View File
@@ -45,9 +45,9 @@ export class WarReward {
let last = str.substr(str.length-1, 1);
if(last == '&') str = str.substr(0, str.length - 1);
if(str.length) {
this.fixReward += '|' + reward;
this.fixReward = str + '|' + reward;
} else {
this.fixReward += reward;
this.fixReward = str + reward;
}
}
@@ -56,9 +56,9 @@ export class WarReward {
let last = str.substr(str.length-1, 1);
if(last == '&') str = str.substr(0, str.length - 1);
if(str.length) {
this.conditionReward += reward;
this.conditionReward = str + '|' + reward;
} else {
this.conditionReward += '|' + reward;
this.conditionReward = str + reward;
}
}
@@ -67,9 +67,9 @@ export class WarReward {
let last = str.substr(str.length-1, 1);
if(last == '&') str = str.substr(0, str.length - 1);
if(str.length) {
this.randomReward += reward;
this.randomReward = str + '|' + reward;
} else {
this.randomReward += '|' + reward;
this.randomReward = str + reward;
}
}
@@ -127,6 +127,7 @@ export class WarReward {
// let warType = this.warInfo.warType;
if(this.isSuccess) { // 成功了才给固定奖励
console.log(this.fixReward)
if(this.fixReward) this.handleFixReward(num, this.fixReward);
if(this.conditionReward) this.handleConditionReward(num, this.conditionReward);
if(this.randomReward) await this.handleRandomReward(num, this.randomReward);