diff --git a/game-server/app/services/activity/gachaService.ts b/game-server/app/services/activity/gachaService.ts index 653694fca..62949c60d 100644 --- a/game-server/app/services/activity/gachaService.ts +++ b/game-server/app/services/activity/gachaService.ts @@ -199,15 +199,14 @@ export class GachaResults { } public getTargetCnt(floor: GachaFloor) { - return this.getTarget(floor).length; + let target = this.list.filter(cur => cur.heroQuality == floor.heroQuality); + return target.length; } public getRandomResultOfTarget(floor: GachaFloor, cnt: number) { - return getRandEelm(this.getTarget(floor), cnt); - } - - private getTarget(floor: GachaFloor) { - return this.list.filter(cur => cur.heroQuality == floor.heroQuality); + let target = this.list.filter(cur => cur.heroQuality == floor.heroQuality); + let targetRemoveLast = target.slice(0, target.length - 2); + return getRandEelm(targetRemoveLast, cnt); } // 具体的卡池 @@ -440,6 +439,7 @@ export class GachaPull { if(replacePlan) gachaResult.changePlan(replacePlan.planId, replacePlan.heroQuality); } else { // 设置为保底 let replacePlan = this.percent.getFloorTarget(floor.heroQuality); + if(replacePlan) gachaResult.changePlan(replacePlan.planId, replacePlan.heroQuality); hasGetFloor = true; } @@ -456,7 +456,7 @@ export class GachaPull { // 10连最多多少个武将 private setTenMostFloor(floor: GachaFloor) { let targetCnt = this.result.getTargetCnt(floor); - if(this.result.count == 10 && targetCnt >= floor.param) { + if(this.result.count == 10 && targetCnt > floor.param) { let gachaResults = this.result.getRandomResultOfTarget(floor, targetCnt - floor.param); for(let gachaResult of gachaResults) { let replacePlan = this.percent.getReplacePlan(gachaResult.heroQuality, floor.isReplaceLower());