diff --git a/game-server/app/services/activity/gachaService.ts b/game-server/app/services/activity/gachaService.ts index 43befc58c..fd06004e6 100644 --- a/game-server/app/services/activity/gachaService.ts +++ b/game-server/app/services/activity/gachaService.ts @@ -168,25 +168,23 @@ export class GachaPull { return base; } } else if (this.dicFloorType == GACHA_FLOOR_TYPE.ASSIGN) { + let result = base; + if(isTarget || this.floorCount + 1 >= this.dicFloorCount) { + if(this.hasGetFloor) { // 已经获得过一次保底了, 不给,换个给 + let { dic } = getRandEelmWithWeight(this.percent.filter(cur => cur.id != this.dicFloor.id)); + result = dic + } else { + this.hasGetFloor = true; + result = this.dicFloor; + } + } this.floorCount ++; - console.log('******', this.floorCount, this.dicFloorCount, this.hasGetFloor ) if(this.floorCount >= this.dicFloorCount) { - if(!this.hasGetFloor) isTarget = true; this.hasGetFloor = false; this.floorCount = 0; } - console.log('******2', this.floorCount, this.dicFloorCount, this.hasGetFloor, isTarget ) - if(isTarget) { - if(this.hasGetFloor) { // 已经获得过一次保底了, 不给,换个给 - let { dic } = getRandEelmWithWeight(this.percent.filter(cur => cur.id != this.dicFloor.id)); - return dic - } else { - this.hasGetFloor = true; - return this.dicFloor; - } - } else { - return base - } + console.log('******', this.floorCount, this.dicFloorCount, this.hasGetFloor ) + return result; } else { return base }