抽卡:修复伪随机逻辑
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user