抽卡:修改细节
This commit is contained in:
@@ -54,9 +54,6 @@ export class GachaHandler {
|
|||||||
const sid: string = session.get('sid');
|
const sid: string = session.get('sid');
|
||||||
const serverId: number = session.get('serverId');
|
const serverId: number = session.get('serverId');
|
||||||
|
|
||||||
|
|
||||||
let { lv } = await RoleModel.findByRoleId(roleId);
|
|
||||||
|
|
||||||
let dicGacha = gameData.gacha.get(gachaId);
|
let dicGacha = gameData.gacha.get(gachaId);
|
||||||
if (!dicGacha) return resResult(STATUS.DIC_DATA_NOT_FOUND);
|
if (!dicGacha) return resResult(STATUS.DIC_DATA_NOT_FOUND);
|
||||||
if (!dicGacha.count.includes(count)) return resResult(STATUS.WRONG_PARMS);
|
if (!dicGacha.count.includes(count)) return resResult(STATUS.WRONG_PARMS);
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ class GachaResults {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public shouldPurpleFloor(floorCount: number) {
|
public shouldPurpleFloor(floorCount: number) {
|
||||||
return this.count == floorCount && !this.hasPurple();
|
return this.count % floorCount == 0 && !this.hasPurple();
|
||||||
}
|
}
|
||||||
|
|
||||||
public hasPurple() {
|
public hasPurple() {
|
||||||
@@ -293,12 +293,9 @@ export class GachaPull {
|
|||||||
public setAssignFloor(dicFloorCount: number) {
|
public setAssignFloor(dicFloorCount: number) {
|
||||||
let floorType = GACHA_FLOOR_TYPE.ASSIGN;
|
let floorType = GACHA_FLOOR_TYPE.ASSIGN;
|
||||||
let { floorCount: historyCount, hasGetFloor } = this.player.getFloorCountByFloorType(floorType);
|
let { floorCount: historyCount, hasGetFloor } = this.player.getFloorCountByFloorType(floorType);
|
||||||
console.log('#### gachaResult', this.result.list)
|
|
||||||
for(let gachaResult of this.result.list) {
|
for(let gachaResult of this.result.list) {
|
||||||
let isTarget = this.bigReward.id == gachaResult.contentId;
|
let isTarget = this.bigReward.id == gachaResult.contentId;
|
||||||
console.log('#### setAssignFloor', historyCount, dicFloorCount, isTarget)
|
|
||||||
if(++historyCount >= dicFloorCount || isTarget) {
|
if(++historyCount >= dicFloorCount || isTarget) {
|
||||||
console.log('#### setAssignFloor', isTarget, hasGetFloor)
|
|
||||||
if(hasGetFloor) { // 已经获得过一次保底了, 不给,换个给
|
if(hasGetFloor) { // 已经获得过一次保底了, 不给,换个给
|
||||||
gachaResult.setContentId(getGachaContentOfHeroQuality(HERO_QUALITY_TYPE.PURPLE));
|
gachaResult.setContentId(getGachaContentOfHeroQuality(HERO_QUALITY_TYPE.PURPLE));
|
||||||
} else {
|
} else {
|
||||||
@@ -306,7 +303,6 @@ export class GachaPull {
|
|||||||
hasGetFloor = true;
|
hasGetFloor = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log('#### setAssignFloor after', historyCount, dicFloorCount)
|
|
||||||
if(historyCount >= dicFloorCount) {
|
if(historyCount >= dicFloorCount) {
|
||||||
hasGetFloor = false;
|
hasGetFloor = false;
|
||||||
historyCount = 0;
|
historyCount = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user