Commit b525a596 authored by Master Q's avatar Master Q

开始游戏逻辑调整

parent 88dfd6e5
{
"success": true
}
\ No newline at end of file
...@@ -14,6 +14,6 @@ ...@@ -14,6 +14,6 @@
"rewardCredits": 10 "rewardCredits": 10
} }
], ],
"skiingGuideFlag": 1 "skiingGuideFlag": 0
} }
} }
\ No newline at end of file
...@@ -656,5 +656,5 @@ export const ResJson = { ...@@ -656,5 +656,5 @@ export const ResJson = {
"name": "svga" "name": "svga"
} }
], ],
"path": "https://yun.duiba.com.cn/db_games/activity/template/1639627848/resource/" "path": "https://yun.duiba.com.cn/db_games/activity/template/1639994156/resource/"
} }
\ No newline at end of file
...@@ -118,7 +118,8 @@ export enum TbNetName { ...@@ -118,7 +118,8 @@ export enum TbNetName {
showRuleModal = 'mine.showRuleModal', showRuleModal = 'mine.showRuleModal',
back = 'mine.back', back = 'mine.back',
indexSceneVisible="mine.indexSceneVisible", indexSceneVisible="mine.indexSceneVisible",
turnBgm = 'mine.turnBgm' turnBgm = 'mine.turnBgm',
checkGameNum = 'snow.checkGameNum'
} }
export enum TBBgm { export enum TBBgm {
......
...@@ -276,6 +276,11 @@ export class GameScene extends Scene { ...@@ -276,6 +276,11 @@ export class GameScene extends Scene {
await sendTbNet(TbNetName.doModifySkiingGuideFlag, { await sendTbNet(TbNetName.doModifySkiingGuideFlag, {
flag: 1 flag: 1
}) })
const { success, data } = await sendTbNet(TbNetName.doStart)
if (!success) {
changeScene(IndexScene)
return
}
this.RabbitCont.visible = true this.RabbitCont.visible = true
this.onStart() this.onStart()
})) }))
......
import { showToast } from './../../module/ctrls/toastCtrl';
import { changeScene } from './../../module/ctrls/index'; import { changeScene } from './../../module/ctrls/index';
import { layers } from './../../module/views/layers'; import { layers } from './../../module/views/layers';
import { Scene } from "../../module/views/Scene"; import { Scene } from "../../module/views/Scene";
...@@ -73,15 +74,25 @@ export default class IndexScene extends Scene { ...@@ -73,15 +74,25 @@ export default class IndexScene extends Scene {
} }
async onGameStart() { async onGameStart() {
const { success, data } = await sendTbNet(TbNetName.doStart) const {success: s} = await sendTbNet(TbNetName.checkGameNum)
if (success) { if (!s) {
sendTbNet(TbNetName.indexSceneVisible, {visible: false}) showToast('游戏次数不足')
return
}
sendTbNet(TbNetName.indexSceneVisible, {visible: false})
if ( this.indexSceneData.skiingGuideFlag == 0 ) {
changeScene(GameScene, { changeScene(GameScene, {
isNewGuy: !this.indexSceneData.skiingGuideFlag, isNewGuy: true
haveRadish: data.haveRadish
}) })
} else {
const { success, data } = await sendTbNet(TbNetName.doStart)
if (success) {
changeScene(GameScene, {
isNewGuy: false,
haveRadish: data.haveRadish
})
}
} }
} }
onRuleShowPanel() { onRuleShowPanel() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment