秘境本挑战次数

This commit is contained in:
luying
2020-11-13 18:06:53 +08:00
parent 9574bada4f
commit ada3cfe849
18 changed files with 439 additions and 82 deletions
+15 -9
View File
@@ -41,29 +41,35 @@ export class WarReward {
}
public setFixReward(reward: string) {
let last = this.fixReward.substr(this.fixReward.length - 1, 1);
if(this.fixReward.length && last == '&') {
let str = this.fixReward;
let last = str.substr(str.length-1, 1);
if(last == '&') str = str.substr(0, str.length - 1);
if(str.length) {
this.fixReward += reward;
} else {
this.fixReward += '&' + reward;
this.fixReward += '|' + reward;
}
}
public setConditionReward(reward: string) {
let last = this.conditionReward.substr(this.fixReward.length - 1, 1);
if(last == '&') {
let str = this.conditionReward;
let last = str.substr(str.length-1, 1);
if(last == '&') str = str.substr(0, str.length - 1);
if(str.length) {
this.conditionReward += reward;
} else {
this.conditionReward += '&' + reward;
this.conditionReward += '|' + reward;
}
}
public setRandomReward(reward: string) {
let last = this.randomReward.substr(this.fixReward.length - 1, 1);
if(last == '&') {
let str = this.randomReward;
let last = str.substr(str.length-1, 1);
if(last == '&') str = str.substr(0, str.length - 1);
if(str.length) {
this.randomReward += reward;
} else {
this.randomReward += '&' + reward;
this.randomReward += '|' + reward;
}
}