免费赠送bug修改
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 43s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 43s
This commit is contained in:
parent
ce73cab708
commit
536a1946db
@ -5,7 +5,7 @@ import { SLOT_BAR_EVENT } from './game/Define';
|
|||||||
import { AutoSpinPanel } from './game/AutoSpinPanel';
|
import { AutoSpinPanel } from './game/AutoSpinPanel';
|
||||||
import { NodePoolManager } from '../../Loading/scripts/manager/NodePoolManager';
|
import { NodePoolManager } from '../../Loading/scripts/manager/NodePoolManager';
|
||||||
import { webView } from './game/WebView';
|
import { webView } from './game/WebView';
|
||||||
import { getHistoryUrl, getOddsUrl, getSupportUrl, gold2cash } from '../../Loading/scripts/comm';
|
import { cash2gold, getHistoryUrl, getOddsUrl, getSupportUrl, gold2cash } from '../../Loading/scripts/comm';
|
||||||
import { GameDataManager } from '../../Loading/scripts/manager/GameDataManager';
|
import { GameDataManager } from '../../Loading/scripts/manager/GameDataManager';
|
||||||
import { I18nManager } from '../../Loading/scripts/manager/I18nManager';
|
import { I18nManager } from '../../Loading/scripts/manager/I18nManager';
|
||||||
import { LocalizedSprite } from '../../Loading/scripts/i18n/LocalizedSprite';
|
import { LocalizedSprite } from '../../Loading/scripts/i18n/LocalizedSprite';
|
||||||
@ -504,7 +504,9 @@ export class SlotBar extends Component {
|
|||||||
|
|
||||||
getBet() {
|
getBet() {
|
||||||
if (this.betIndex == -1) {
|
if (this.betIndex == -1) {
|
||||||
return +this.betLabel.string * 10000;
|
let betNum = cash2gold(this.betLabel.string);
|
||||||
|
let betCount = betNum * 10000;
|
||||||
|
return betCount;
|
||||||
}
|
}
|
||||||
return this.betGrade[this.betIndex];
|
return this.betGrade[this.betIndex];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,6 +99,8 @@ export class SlotScene extends Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
batchingTimer: number = 0;
|
batchingTimer: number = 0;
|
||||||
|
isErr: boolean = false;
|
||||||
|
|
||||||
|
|
||||||
async start() {
|
async start() {
|
||||||
await this.init();
|
await this.init();
|
||||||
@ -217,6 +219,7 @@ export class SlotScene extends Component {
|
|||||||
this.gameState.isOnReconnect = false;
|
this.gameState.isOnReconnect = false;
|
||||||
this.isReceiveMsg = false;
|
this.isReceiveMsg = false;
|
||||||
|
|
||||||
|
this.isErr = false
|
||||||
this.slotGame.spin(this.gameState.isInFreeSpin);
|
this.slotGame.spin(this.gameState.isInFreeSpin);
|
||||||
this.gameState.isOneRoundEnd = false;
|
this.gameState.isOneRoundEnd = false;
|
||||||
this.slotGame.changeBg(this.gameState.isInFreeSpin);
|
this.slotGame.changeBg(this.gameState.isInFreeSpin);
|
||||||
@ -256,28 +259,28 @@ export class SlotScene extends Component {
|
|||||||
this.spinInfo = await callGameApi("spin", msg);
|
this.spinInfo = await callGameApi("spin", msg);
|
||||||
|
|
||||||
if (this.spinInfo.Frb.Ongoing) {
|
if (this.spinInfo.Frb.Ongoing) {
|
||||||
|
if (!isFreeSpin) {
|
||||||
|
let count = this.spinInfo.Frb.Ongoing.Frn;
|
||||||
|
if (count <= 0) {
|
||||||
|
count = 0;
|
||||||
|
}
|
||||||
|
this.SysGift.handleSysInfoFreeCount(count);
|
||||||
|
}
|
||||||
if (this.gameState.isAutoSpin) {
|
if (this.gameState.isAutoSpin) {
|
||||||
this.slotBar.closeAutoSpin();
|
this.slotBar.closeAutoSpin();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.spinInfo.Frb.Finished) {
|
||||||
GameDataManager.instance.frb = this.spinInfo.Frb;
|
if (!isFreeSpin) {
|
||||||
if (frb) {
|
let count = this.spinInfo.Frb.Finished.Frn;
|
||||||
let count = 0;
|
if (count <= 0) {
|
||||||
|
count = 0;
|
||||||
if (frb.Ongoing != null) {
|
}
|
||||||
count = frb.Ongoing.Frn - 1;
|
this.SysGift.handleSysInfoFreeCount(count);
|
||||||
}
|
}
|
||||||
if (frb.Finished != null) {
|
|
||||||
count = frb.Finished.Frn;
|
|
||||||
|
|
||||||
}
|
|
||||||
if (count <= 0) {
|
|
||||||
count = 0;
|
|
||||||
}
|
|
||||||
this.SysGift.handleSysInfoFreeCount(count);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GameDataManager.instance.frb = this.spinInfo.Frb;
|
||||||
// if (frb?.Ongoing?.Frn - 1 != GameDataManager.instance.frb?.Ongoing?.Frn) {
|
// if (frb?.Ongoing?.Frn - 1 != GameDataManager.instance.frb?.Ongoing?.Frn) {
|
||||||
// this.SysGift.handleSysInfoFreeCount(this.spinInfo.Frb.Ongoing.Frn);
|
// this.SysGift.handleSysInfoFreeCount(this.spinInfo.Frb.Ongoing.Frn);
|
||||||
// }
|
// }
|
||||||
@ -294,7 +297,7 @@ export class SlotScene extends Component {
|
|||||||
this.isReceiveMsg = true;
|
this.isReceiveMsg = true;
|
||||||
await this.handleSpinResult();
|
await this.handleSpinResult();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('获取数据时error', error)
|
this.isErr = true
|
||||||
let errCode = parseInt(error.message.split('#')[0]);
|
let errCode = parseInt(error.message.split('#')[0]);
|
||||||
if (isNaN(errCode)) {
|
if (isNaN(errCode)) {
|
||||||
this.showErrorTip(4);
|
this.showErrorTip(4);
|
||||||
@ -362,6 +365,7 @@ export class SlotScene extends Component {
|
|||||||
this.slotGame.setRollerIconRule(this.spinData.Mode == 0 ? ROLLER_RULE : FREE_SPIN_ROLLER_RULE);
|
this.slotGame.setRollerIconRule(this.spinData.Mode == 0 ? ROLLER_RULE : FREE_SPIN_ROLLER_RULE);
|
||||||
this.gameState.isAutoSpin = false;
|
this.gameState.isAutoSpin = false;
|
||||||
this.spinData.AllScore = 0;
|
this.spinData.AllScore = 0;
|
||||||
|
this.spinData.RoundInfo.AllScore = 0;
|
||||||
this.slotGame.stopScroll(this.spinData, false, null);
|
this.slotGame.stopScroll(this.spinData, false, null);
|
||||||
this.slotGame.manualStop();
|
this.slotGame.manualStop();
|
||||||
this.slotBar.setBalance(this.spinInfo.Balance);
|
this.slotBar.setBalance(this.spinInfo.Balance);
|
||||||
@ -527,6 +531,7 @@ export class SlotScene extends Component {
|
|||||||
async onIconsDeleted() {
|
async onIconsDeleted() {
|
||||||
try {
|
try {
|
||||||
this.isReceiveMsg = false;
|
this.isReceiveMsg = false;
|
||||||
|
this.isErr = false
|
||||||
if (!this.gameState.isDebug) {
|
if (!this.gameState.isDebug) {
|
||||||
this.spinInfo = await callGameApi("spin", {
|
this.spinInfo = await callGameApi("spin", {
|
||||||
Bet: this.slotBar.getBet()
|
Bet: this.slotBar.getBet()
|
||||||
@ -554,7 +559,7 @@ export class SlotScene extends Component {
|
|||||||
this.slotGame.createNewIconTop(this.spinData);
|
this.slotGame.createNewIconTop(this.spinData);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('消除时error', error)
|
this.isErr = true
|
||||||
let errCode = parseInt(error.message.split('#')[0]);
|
let errCode = parseInt(error.message.split('#')[0]);
|
||||||
if (isNaN(errCode)) {
|
if (isNaN(errCode)) {
|
||||||
this.showErrorTip(5, () => {
|
this.showErrorTip(5, () => {
|
||||||
@ -721,6 +726,23 @@ export class SlotScene extends Component {
|
|||||||
|
|
||||||
if (winType != WIN_TYPE.NONE) {
|
if (winType != WIN_TYPE.NONE) {
|
||||||
if (!isReconnect) {
|
if (!isReconnect) {
|
||||||
|
if (this.isErr) {
|
||||||
|
this.slotBar.setBalance(this.spinData.Balance);
|
||||||
|
this.slotGame.showWinScore(
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
isReconnect,
|
||||||
|
false,
|
||||||
|
this.spinData.AllScore
|
||||||
|
);
|
||||||
|
this.slotBar.setWin(this.spinData.AllScore);
|
||||||
|
this.slotGame.changeBg(false);
|
||||||
|
this.checkAutoSpin(true, isReconnect);
|
||||||
|
AudioManager.instance.playBGM("Normal_Mode_BGM");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
this.TotalWin.show(this.spinData.AllScore, () => {
|
this.TotalWin.show(this.spinData.AllScore, () => {
|
||||||
this.slotBar.setBalance(this.spinData.Balance);
|
this.slotBar.setBalance(this.spinData.Balance);
|
||||||
this.slotGame.showWinScore(true, false, true, isReconnect, false, false, this.spinData.AllScore);
|
this.slotGame.showWinScore(true, false, true, isReconnect, false, false, this.spinData.AllScore);
|
||||||
|
|||||||
@ -113,6 +113,11 @@ export function gold2cash(v: number): string {
|
|||||||
return v.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
return v.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 取消逗号,转换为数字
|
||||||
|
export function cash2gold(v: string): number {
|
||||||
|
v = v.replace(/,/g, '');
|
||||||
|
return Number(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export function gold2cash2(v: number): string {
|
export function gold2cash2(v: number): string {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user