修改无尽关卡0体力后还可以继续游戏

This commit is contained in:
huanghaipeng 2026-01-19 10:57:18 +08:00
parent 81f4c41b37
commit caa9b232cd

View File

@ -963,6 +963,23 @@ export default class JiaZai extends cc.Component {
} }
cc.fx.AudioManager._instance.playEffect("anniu_Big", null); cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
let version = cc.fx.GameTool.getWechatGameVersion(); let version = cc.fx.GameTool.getWechatGameVersion();
let power = cc.fx.GameTool.getUserPowerTime();
if (cc.fx.GameConfig.GM_INFO.hp < 1 && power == false) {
MiniGameSdk.API.showToast("体力值不足");
setTimeout(() => {
this.openHeath();
}, 500);
return;
}
//@ts-ignore
if (typeof wx !== 'undefined') {
//@ts-ignore
wx.offShow(this.onShowListener);
//@ts-ignore
wx.offHide(this.onHideListener);
}
if (cc.fx.GameTool.maxLevel() && cc.fx.GameConfig.GM_INFO.otherLevel == 0) { if (cc.fx.GameTool.maxLevel() && cc.fx.GameConfig.GM_INFO.otherLevel == 0) {
// if (version != "开发版" && version != "体验版") { // if (version != "开发版" && version != "体验版") {
// MiniGameSdk.API.showToast("关卡每周更新,敬请期待!"); // MiniGameSdk.API.showToast("关卡每周更新,敬请期待!");
@ -1004,22 +1021,6 @@ export default class JiaZai extends cc.Component {
// } // }
} }
let power = cc.fx.GameTool.getUserPowerTime();
if (cc.fx.GameConfig.GM_INFO.hp < 1 && power == false) {
MiniGameSdk.API.showToast("体力值不足");
setTimeout(() => {
this.openHeath();
}, 500);
return;
}
//@ts-ignore
if (typeof wx !== 'undefined') {
//@ts-ignore
wx.offShow(this.onShowListener);
//@ts-ignore
wx.offHide(this.onHideListener);
}
if (this.node.getChildByName("Load").getChildByName("startBtn").getComponent("btnControl")._touch) { if (this.node.getChildByName("Load").getChildByName("startBtn").getComponent("btnControl")._touch) {
this.node.getChildByName("Load").getChildByName("startBtn").getComponent("btnControl").setTouch(false); this.node.getChildByName("Load").getChildByName("startBtn").getComponent("btnControl").setTouch(false);
let version = cc.fx.GameTool.getWechatGameVersion(); let version = cc.fx.GameTool.getWechatGameVersion();