Compare commits

...

2 Commits

Author SHA1 Message Date
YZ\249929363 e7184691eb Merge branch 'main' of https://git.sparkus.cn/yangzhao/cb 2025-07-08 18:56:55 +08:00
YZ\249929363 704e2f113c 更新 2025-07-08 18:56:40 +08:00
2 changed files with 20 additions and 10 deletions

View File

@ -1346,8 +1346,9 @@ export default class MapConroler extends cc.Component {
if (this.blockNum == 0 && !this.gameWin && !this.gameOver) { if (this.blockNum == 0 && !this.gameWin && !this.gameOver) {
// alert("游戏成功"); // alert("游戏成功");
MiniGameSdk.API.showToast(cc.fx.GameConfig.GM_INFO.level);
this.gameWin = true; this.gameWin = true;
console.log("恢复一点体力") console.log("恢复一点体力",cc.fx.GameConfig.GM_INFO.level);
cc.fx.GameTool.setUserHealth(1, (data) => { cc.fx.GameTool.setUserHealth(1, (data) => {
}) })
this.stopTimeCutDown(); this.stopTimeCutDown();
@ -1390,7 +1391,6 @@ export default class MapConroler extends cc.Component {
} }
winLevel() { winLevel() {
if(this.node.parent.parent.getChildByName("Win"). if(this.node.parent.parent.getChildByName("Win").
getChildByName("nextBtn").getComponent("btnControl")._touch == false){ getChildByName("nextBtn").getComponent("btnControl")._touch == false){
return; return;
@ -1398,9 +1398,18 @@ export default class MapConroler extends cc.Component {
this.node.parent.parent.getChildByName("Win"). this.node.parent.parent.getChildByName("Win").
getChildByName("nextBtn").getComponent("btnControl").setTouch(false); getChildByName("nextBtn").getComponent("btnControl").setTouch(false);
cc.fx.AudioManager._instance.playEffect("anniu_Big", null); cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
console.log("下一关",cc.fx.GameConfig.GM_INFO.level);
if (cc.fx.GameConfig.GM_INFO.level > 249) { if (cc.fx.GameConfig.GM_INFO.level > 249) {
cc.fx.GameConfig.GM_INFO.level = 249; cc.fx.GameConfig.GM_INFO.level = 249;
MiniGameSdk.API.showToast("每周更新,敬请期待!"); MiniGameSdk.API.showToast("每周更新,敬请期待!");
setTimeout(() => {
this.node.parent.parent.getChildByName("Win").
getChildByName("nextBtn").getComponent("btnControl").setTouch(true);
}, 500);
}
else if (cc.fx.GameConfig.GM_INFO.level == 249) {
MiniGameSdk.API.showToast("每周更新,敬请期待!");
} }
else { else {
// console.log("下一关"); // console.log("下一关");
@ -1749,8 +1758,8 @@ export default class MapConroler extends cc.Component {
setTimeout(() => { setTimeout(() => {
this.setPropNum(); this.setPropNum();
// this.iceLabel.string = cc.fx.GameConfig.GM_INFO.freezeAmount.toString(); // this.iceLabel.string = cc.fx.GameConfig.GM_INFO.freezeAmount.toString();
MiniGameSdk.API.showToast("购买冻结时间道具成功"); MiniGameSdk.API.showToast("购买冻结时间成功");
}, 200); }, 2000);
} }
@ -1762,14 +1771,14 @@ export default class MapConroler extends cc.Component {
cc.fx.StorageMessage.setStorage("prop", propInfo); cc.fx.StorageMessage.setStorage("prop", propInfo);
this.node.parent.parent.parent.getComponent("SceneManager").closePropBuy(); this.node.parent.parent.parent.getComponent("SceneManager").closePropBuy();
setTimeout(() => { setTimeout(() => {
MiniGameSdk.API.showToast("购买锤子道具成功"); MiniGameSdk.API.showToast("购买魔法棒成功");
this.setPropNum(); this.setPropNum();
// this.magicLabel.string = cc.fx.GameConfig.GM_INFO.magicAmount.toString(); // this.magicLabel.string = cc.fx.GameConfig.GM_INFO.magicAmount.toString();
}, 200); }, 2000);
} }
else if (data == "hammerAmount") { else if (data == "hammerAmount") {
cc.fx.GameConfig.GM_INFO.hammerAmount += 3; cc.fx.GameConfig.GM_INFO.hammerAmount += 1;
let propInfo = cc.fx.StorageMessage.getStorage("prop"); let propInfo = cc.fx.StorageMessage.getStorage("prop");
propInfo.hammerAmount = cc.fx.GameConfig.GM_INFO.hammerAmount; propInfo.hammerAmount = cc.fx.GameConfig.GM_INFO.hammerAmount;
propInfo.timestamp = timestamp; propInfo.timestamp = timestamp;
@ -1778,8 +1787,8 @@ export default class MapConroler extends cc.Component {
setTimeout(() => { setTimeout(() => {
this.setPropNum(); this.setPropNum();
// this.hammerLabel.string = cc.fx.GameConfig.GM_INFO.hammerAmount.toString(); // this.hammerLabel.string = cc.fx.GameConfig.GM_INFO.hammerAmount.toString();
MiniGameSdk.API.showToast("购买魔法棒道具成功"); MiniGameSdk.API.showToast("购买锤子成功");
}, 200); }, 2000);
} }
@ -1852,7 +1861,7 @@ export default class MapConroler extends cc.Component {
} }
buyHammer() { buyHammer() {
if (cc.fx.GameConfig.GM_INFO.coin < 1500) { if (cc.fx.GameConfig.GM_INFO.coin < 1000) {
MiniGameSdk.API.showToast("金币不足,无法购买道具"); MiniGameSdk.API.showToast("金币不足,无法购买道具");
setTimeout(() => { setTimeout(() => {
this.openShop(); this.openShop();

View File

@ -288,6 +288,7 @@ export default class SceneManager extends cc.Component {
openPropBuy(name) { openPropBuy(name) {
MapConroler._instance.pause = true; MapConroler._instance.pause = true;
MapConroler._instance.stopBoom(); MapConroler._instance.stopBoom();
this.btnName = name; this.btnName = name;
let propWindow = this.node.getChildByName("Game").getChildByName("propWindow"); let propWindow = this.node.getChildByName("Game").getChildByName("propWindow");
propWindow.active = true; propWindow.active = true;