From 5b96c1720392f6f560d8ece1190ccb407126d0bf Mon Sep 17 00:00:00 2001 From: luying Date: Fri, 2 Jul 2021 11:51:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=BD=E5=8D=A1=EF=BC=9A=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BC=AA=E9=9A=8F=E6=9C=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/services/activity/gachaService.ts | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) 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 }