This commit is contained in:
YZ\249929363 2025-07-25 20:58:36 +08:00
parent c50cac4bed
commit 3366342098
8 changed files with 50 additions and 16 deletions

View File

@ -16642,7 +16642,7 @@
"__id__": 416 "__id__": 416
} }
], ],
"_active": true, "_active": false,
"_components": [], "_components": [],
"_prefab": null, "_prefab": null,
"_opacity": 255, "_opacity": 255,

View File

@ -604,7 +604,7 @@ export default class Block extends cc.Component {
this.node.active = false; this.node.active = false;
this.node.removeFromParent(); this.node.removeFromParent();
setTimeout(() => { setTimeout(() => {
if (type == true && MapConroler._instance.openWall.length > 0 if (MapConroler._instance.blockNum != 0 && type == true && MapConroler._instance.openWall.length > 0
&& !MapConroler._instance.gameOver && MapConroler._instance.gameWin) { && !MapConroler._instance.gameOver && MapConroler._instance.gameWin) {
let gameover = MapConroler._instance.predict_End(); let gameover = MapConroler._instance.predict_End();
if (gameover == false) { if (gameover == false) {
@ -937,7 +937,15 @@ export default class Block extends cc.Component {
MapConroler._instance.nextLevel(); MapConroler._instance.nextLevel();
this.node.active = false; this.node.active = false;
this.node.removeFromParent(); this.node.removeFromParent();
console.log("222") setTimeout(() => {
if (MapConroler._instance.blockNum != 0 && MapConroler._instance.openWall.length > 0
&& !MapConroler._instance.gameOver && MapConroler._instance.gameWin) {
let gameover = MapConroler._instance.predict_End();
if (gameover == false) {
MapConroler._instance.failLevel("lock");
}
}
}, 500);
//如果是锤子状态消除 //如果是锤子状态消除
MapConroler._instance.ishammer = false; MapConroler._instance.ishammer = false;
MapConroler._instance.ismagic = false; MapConroler._instance.ismagic = false;

View File

@ -201,7 +201,7 @@ export default class JiaZai extends cc.Component {
// this.openHeath(); // this.openHeath();
this.uploadToCloud(cc.fx.GameConfig.GM_INFO.level + 1); this.uploadToCloud(cc.fx.GameConfig.GM_INFO.level + 1);
this.rewarded(); this.rewarded();
this.getMonthlyCardValidityDays();
Utils.getMonthlyCard((data) => { Utils.getMonthlyCard((data) => {
if (data.code == 1) { if (data.code == 1) {
cc.fx.GameConfig.GM_INFO.hp_Max = 7; cc.fx.GameConfig.GM_INFO.hp_Max = 7;
@ -769,7 +769,7 @@ export default class JiaZai extends cc.Component {
} else { } else {
this.monthCardBtn.active = false; this.monthCardBtn.active = false;
this.monthCardBtn2.active = true; this.monthCardBtn2.active = true;
NumberToImage.numberToImageNodes(25, 35, 20, "month_", this.monthCardTime, true); NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.monthTime, 35, 20, "month_", this.monthCardTime, true);
} }
}) })
this.monthCard.active = false; this.monthCard.active = false;
@ -798,7 +798,7 @@ export default class JiaZai extends cc.Component {
}) })
this.monthCardBtn.active = false; this.monthCardBtn.active = false;
this.monthCardBtn2.active = true; this.monthCardBtn2.active = true;
NumberToImage.numberToImageNodes(25, 35, 20, "month_", this.monthCardTime, true); NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.monthTime, 35, 20, "month_", this.monthCardTime, true);
} }
}) })
@ -872,16 +872,22 @@ export default class JiaZai extends cc.Component {
} }
//获取月卡有效期距离今天的天数 //获取月卡有效期距离今天的天数
getMonthlyCardValidityDays() { //获取月卡有效期距离今天的天数
let nowTime = Math.floor(Date.now() / 1000); getMonthlyCardValidityDays(callback) {
let validityTime = 0; const nowTime = Date.now(); // 毫秒
Utils.getMonthlyCard((data) => { Utils.getMonthlyCard((data) => {
if (data.code == 1) { if (data.code === 1) {
validityTime = data.monthCardTime; const validityTime = data.data.monthCardTime; // 毫秒
const diffMs = validityTime - nowTime;
const days = Math.floor(diffMs / 86400000);
cc.fx.GameConfig.GM_INFO.monthTime = days;
console.log('剩余天数', days);
callback(days); // 把结果通过回调返回
} else {
callback(0); // 失败时返回 0
} }
}) });
let days = Math.floor((validityTime - nowTime) / (24 * 60 * 60));
return days;
} }
// update (dt) {} // update (dt) {}

View File

@ -1751,6 +1751,7 @@ export default class MapConroler extends cc.Component {
}); });
} }
} }
returnHome() { returnHome() {
cc.fx.AudioManager._instance.playEffect("anniu_Big", null); cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
if (MapConroler._instance = null) { if (MapConroler._instance = null) {
@ -1810,6 +1811,9 @@ export default class MapConroler extends cc.Component {
this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = false; this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = false;
if (type) { if (type) {
if (type == "time") { if (type == "time") {
this.node.parent.parent.getChildByName("Lose").getChildByName("Time").active = true;
this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = false;
this.node.parent.parent.getChildByName("Lose").getChildByName("Lock").active = false;
let buyBtn = this.node.parent.parent.getChildByName("Lose").getChildByName("Time").getChildByName("buyBtn"); let buyBtn = this.node.parent.parent.getChildByName("Lose").getChildByName("Time").getChildByName("buyBtn");
buyBtn.getChildByName("coin1").active = buyBtn.getChildByName("coin2").active = buyBtn.getChildByName("coin3").active = false; buyBtn.getChildByName("coin1").active = buyBtn.getChildByName("coin2").active = buyBtn.getChildByName("coin3").active = false;
if (cc.fx.GameConfig.GM_INFO.review == 0) buyBtn.getChildByName("coin1").active = true; if (cc.fx.GameConfig.GM_INFO.review == 0) buyBtn.getChildByName("coin1").active = true;
@ -1819,6 +1823,7 @@ export default class MapConroler extends cc.Component {
else if (type == "boom") { else if (type == "boom") {
this.node.parent.parent.getChildByName("Lose").getChildByName("Time").active = false; this.node.parent.parent.getChildByName("Lose").getChildByName("Time").active = false;
this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = true; this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = true;
this.node.parent.parent.getChildByName("Lose").getChildByName("Lock").active = false;
let buyBtn = this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").getChildByName("buyBtn"); let buyBtn = this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").getChildByName("buyBtn");
buyBtn.getChildByName("coin1").active = buyBtn.getChildByName("coin2").active = buyBtn.getChildByName("coin3").active = false; buyBtn.getChildByName("coin1").active = buyBtn.getChildByName("coin2").active = buyBtn.getChildByName("coin3").active = false;
if (cc.fx.GameConfig.GM_INFO.reviewBoom == 0) buyBtn.getChildByName("coin1").active = true; if (cc.fx.GameConfig.GM_INFO.reviewBoom == 0) buyBtn.getChildByName("coin1").active = true;

View File

@ -106,6 +106,7 @@ export class GameConfig {
magicAFirst: boolean; //魔法棒道具第一次 magicAFirst: boolean; //魔法棒道具第一次
hp_Max: number; //体力最大值 hp_Max: number; //体力最大值
doubleCoin: number;//是否翻倍 doubleCoin: number;//是否翻倍
monthTime: number;//月卡时间
}; };
@ -256,6 +257,7 @@ export class GameConfig {
magicAFirst: false, //魔法棒道具第一次 magicAFirst: false, //魔法棒道具第一次
hp_Max: 5, //体力最大值 hp_Max: 5, //体力最大值
doubleCoin: 1, //是否双倍 doubleCoin: 1, //是否双倍
monthTime: 0, //月卡时间
}; };
// this.setCode(this.getKey("scode")); // this.setCode(this.getKey("scode"));
// this.GM_INFO.level = 0; // this.GM_INFO.level = 0;

View File

@ -646,6 +646,13 @@ var GameTool = {
"timestamp": 0 "timestamp": 0
} }
} }
else if (health > 0 && cc.fx.GameConfig.GM_INFO.hp != cc.fx.GameConfig.GM_INFO.hp_Max) {
let oldTime = cc.fx.StorageMessage.getStorage("health").timestamp;
healthInfo = {
"health": cc.fx.GameConfig.GM_INFO.hp,
"timestamp": oldTime
}
}
else { else {
healthInfo = { healthInfo = {
"health": cc.fx.GameConfig.GM_INFO.hp, "health": cc.fx.GameConfig.GM_INFO.hp,
@ -699,12 +706,18 @@ var GameTool = {
buyProp(propid, callback: Function) { buyProp(propid, callback: Function) {
//@ts-ignore //@ts-ignore
if (typeof wx !== 'undefined' && wx !== null) { if (typeof wx !== 'undefined' && wx !== null) {
let num = 3; let num = 3;
let cost = 600; let cost = 600;
if (propid == 2003) { if (propid == 2003) {
cost = 900; cost = 900;
num = 3;
}
else if (propid == 2002) {
num = 1; num = 1;
} }
console.log("_____________新版本", num);
cc.fx.GameTool.changeCoin(-cost); cc.fx.GameTool.changeCoin(-cost);
const dataTemp = { const dataTemp = {
change_reason: "商城购买道具消耗", change_reason: "商城购买道具消耗",

View File

@ -162,7 +162,7 @@ export default class NewClass extends cc.Component {
} else { } else {
this.monthCardBtn.active = false; this.monthCardBtn.active = false;
this.monthCardBtn2.active = true; this.monthCardBtn2.active = true;
NumberToImage.numberToImageNodes(25, 35, 20, "month_", this.monthCardTime, true); NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.monthTime, 35, 20, "month_", this.monthCardTime, true);
} }
}) })
} }

View File

@ -691,7 +691,7 @@ export default class NewClass extends cc.Component {
this.monthCardTime.active = true; this.monthCardTime.active = true;
} }
}) })
NumberToImage.numberToImageNodes(25, 35, 15, "button_", this.monthCardTime.children[1], true); NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.monthTime, 35, 15, "button_", this.monthCardTime.children[1], true);
} }
// update (dt) {} // update (dt) {}