免费赠送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 { NodePoolManager } from '../../Loading/scripts/manager/NodePoolManager';
|
||||
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 { I18nManager } from '../../Loading/scripts/manager/I18nManager';
|
||||
import { LocalizedSprite } from '../../Loading/scripts/i18n/LocalizedSprite';
|
||||
@ -504,7 +504,9 @@ export class SlotBar extends Component {
|
||||
|
||||
getBet() {
|
||||
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];
|
||||
}
|
||||
|
||||
@ -99,6 +99,8 @@ export class SlotScene extends Component {
|
||||
};
|
||||
|
||||
batchingTimer: number = 0;
|
||||
isErr: boolean = false;
|
||||
|
||||
|
||||
async start() {
|
||||
await this.init();
|
||||
@ -217,6 +219,7 @@ export class SlotScene extends Component {
|
||||
this.gameState.isOnReconnect = false;
|
||||
this.isReceiveMsg = false;
|
||||
|
||||
this.isErr = false
|
||||
this.slotGame.spin(this.gameState.isInFreeSpin);
|
||||
this.gameState.isOneRoundEnd = false;
|
||||
this.slotGame.changeBg(this.gameState.isInFreeSpin);
|
||||
@ -256,28 +259,28 @@ export class SlotScene extends Component {
|
||||
this.spinInfo = await callGameApi("spin", msg);
|
||||
|
||||
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) {
|
||||
this.slotBar.closeAutoSpin();
|
||||
}
|
||||
}
|
||||
|
||||
GameDataManager.instance.frb = this.spinInfo.Frb;
|
||||
if (frb) {
|
||||
let count = 0;
|
||||
|
||||
if (frb.Ongoing != null) {
|
||||
count = frb.Ongoing.Frn - 1;
|
||||
if (this.spinInfo.Frb.Finished) {
|
||||
if (!isFreeSpin) {
|
||||
let count = this.spinInfo.Frb.Finished.Frn;
|
||||
if (count <= 0) {
|
||||
count = 0;
|
||||
}
|
||||
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) {
|
||||
// this.SysGift.handleSysInfoFreeCount(this.spinInfo.Frb.Ongoing.Frn);
|
||||
// }
|
||||
@ -294,7 +297,7 @@ export class SlotScene extends Component {
|
||||
this.isReceiveMsg = true;
|
||||
await this.handleSpinResult();
|
||||
} catch (error) {
|
||||
console.log('获取数据时error', error)
|
||||
this.isErr = true
|
||||
let errCode = parseInt(error.message.split('#')[0]);
|
||||
if (isNaN(errCode)) {
|
||||
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.gameState.isAutoSpin = false;
|
||||
this.spinData.AllScore = 0;
|
||||
this.spinData.RoundInfo.AllScore = 0;
|
||||
this.slotGame.stopScroll(this.spinData, false, null);
|
||||
this.slotGame.manualStop();
|
||||
this.slotBar.setBalance(this.spinInfo.Balance);
|
||||
@ -527,6 +531,7 @@ export class SlotScene extends Component {
|
||||
async onIconsDeleted() {
|
||||
try {
|
||||
this.isReceiveMsg = false;
|
||||
this.isErr = false
|
||||
if (!this.gameState.isDebug) {
|
||||
this.spinInfo = await callGameApi("spin", {
|
||||
Bet: this.slotBar.getBet()
|
||||
@ -554,7 +559,7 @@ export class SlotScene extends Component {
|
||||
this.slotGame.createNewIconTop(this.spinData);
|
||||
|
||||
} catch (error) {
|
||||
console.log('消除时error', error)
|
||||
this.isErr = true
|
||||
let errCode = parseInt(error.message.split('#')[0]);
|
||||
if (isNaN(errCode)) {
|
||||
this.showErrorTip(5, () => {
|
||||
@ -721,6 +726,23 @@ export class SlotScene extends Component {
|
||||
|
||||
if (winType != WIN_TYPE.NONE) {
|
||||
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.slotBar.setBalance(this.spinData.Balance);
|
||||
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, ',');
|
||||
}
|
||||
|
||||
// 取消逗号,转换为数字
|
||||
export function cash2gold(v: string): number {
|
||||
v = v.replace(/,/g, '');
|
||||
return Number(v);
|
||||
}
|
||||
|
||||
|
||||
export function gold2cash2(v: number): string {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user