This commit is contained in:
YZ\249929363 2025-07-25 17:57:40 +08:00
parent 1575fea359
commit fd29149380
6 changed files with 2307 additions and 1268 deletions

File diff suppressed because it is too large Load Diff

View File

@ -478,7 +478,7 @@ export default class Block extends cc.Component {
if (jg >= 0) {
this.over = true;
MapConroler._instance.changeState();
MapConroler._instance.changeState(true);
this.removeBoxCollider();
this.removeMapBlock();
this.removeAction(jg, type);

View File

@ -807,15 +807,19 @@ export default class JiaZai extends cc.Component {
console.log("到期");
cc.fx.GameConfig.GM_INFO.hp_Max = 5;
//如果体力大于5设置为5小于5设置为体力值
if (cc.fx.GameConfig.GM_INFO.hp >= 5) {
if (cc.fx.GameConfig.GM_INFO.hp > 5) {
cc.fx.GameConfig.GM_INFO.hp = 5;
}
this.updateCoin();
this.setHealthInfo(false);
this.startTimeCutDown();
cc.fx.GameTool.setUserHealth(0, (data) => {
cc.fx.GameTool.getHealth(null);
})
}
setTimeout(() => {
this.updateCoin();
this.setHealthInfo(false);
this.startTimeCutDown();
}, 300);
}
if (data.data != null && data.code == 0) {
console.log("未到期已领取");
@ -830,6 +834,13 @@ export default class JiaZai extends cc.Component {
setTimeout(() => {
this.openRewardWindow(rewardData);
}, 500);
const dataTemp = {
change_reason: "month",
id: "1001",
num: 500,
compensate: false
}
cc.fx.GameTool.shushu_Track("resource_get", dataTemp);
}

View File

@ -143,6 +143,7 @@ export default class MapConroler extends cc.Component {
cc.fx.GameConfig.GM_INFO.review = 0;
cc.fx.GameConfig.GM_INFO.reviewBoom = 0;
cc.fx.GameConfig.GM_INFO.reviewDoor = 0;
cc.fx.GameConfig.GM_INFO.gameState = true;
this.mask.opacity = 0;
this.node.getChildByName("Adhesive").zIndex = 500;
@ -1187,13 +1188,13 @@ export default class MapConroler extends cc.Component {
return jg;
}
changeState() {
changeState(type) {
if (this.openWall.length != 0) {
for (let i = 0; i < this.openWall.length; i++) {
this.openWall[i].getChildByName("wall").getComponent("Wall").changeLock();
}
}
if (type) {
if (this.freezeWall.length != 0) {
for (let i = 0; i < this.freezeWall.length; i++) {
this.freezeWall[i].getChildByName("wall").getComponent("Wall").changeFreeze();
@ -1201,6 +1202,8 @@ export default class MapConroler extends cc.Component {
}
}
}
//检测是否可以通过门
passWall(jg, wallArray, node) {
for (let i = 0; i < wallArray.length; i++) {
@ -1644,6 +1647,10 @@ export default class MapConroler extends cc.Component {
if (cc.fx.GameConfig.GM_INFO.reviewBoom == 1) coin = 1000;
else if (cc.fx.GameConfig.GM_INFO.reviewBoom == 2) coin = 1500;
}
else if (type == "lock") {
if (cc.fx.GameConfig.GM_INFO.reviewDoor == 1) coin = 1000;
else if (cc.fx.GameConfig.GM_INFO.reviewDoor == 2) coin = 1500;
}
data.coin = -coin;
// console.log("自身金币:",cc.fx.GameConfig.GM_INFO.coin,"消耗金币:",coin);
if (cc.fx.GameConfig.GM_INFO.coin < Math.abs(coin)) {
@ -1681,6 +1688,11 @@ export default class MapConroler extends cc.Component {
if (cc.fx.GameConfig.GM_INFO.reviewBoom < 2)
cc.fx.GameConfig.GM_INFO.reviewBoom += 1;
}
else if (data.type == "lock") {
this.changeState(true);
if (cc.fx.GameConfig.GM_INFO.reviewDoor < 2)
cc.fx.GameConfig.GM_INFO.reviewDoor += 1;
}
this.gameOver = false;
@ -1817,6 +1829,11 @@ export default class MapConroler extends cc.Component {
this.node.parent.parent.getChildByName("Lose").getChildByName("Time").active = false;
this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = false;
this.node.parent.parent.getChildByName("Lose").getChildByName("Lock").active = true;
let buyBtn = this.node.parent.parent.getChildByName("Lose").getChildByName("Lock").getChildByName("buyBtn");
buyBtn.getChildByName("coin1").active = buyBtn.getChildByName("coin2").active = buyBtn.getChildByName("coin3").active = false;
if (cc.fx.GameConfig.GM_INFO.reviewDoor == 0) buyBtn.getChildByName("coin1").active = true;
else if (cc.fx.GameConfig.GM_INFO.reviewDoor == 1) buyBtn.getChildByName("coin2").active = true;
else if (cc.fx.GameConfig.GM_INFO.reviewDoor == 2) buyBtn.getChildByName("coin3").active = true;
}
}
}, time);
@ -2786,8 +2803,41 @@ export default class MapConroler extends cc.Component {
// .start();
}
//判断方块是否可以正常通过门
blockCanPass(block, wall) {
let jg = false;
let heng = block.getComponent("Block").heng;
let shu = block.getComponent("Block").shu;
let direction = wall.node.parent.name;
if (direction == "left" || direction == "right") {
if (wall.wall_Info.length >= shu) {
jg = true;
}
}
else {
if (wall.wall_Info.length >= heng) {
jg = true;
}
}
if (!jg) {
console.log("普通快:不可通过");
}
return jg;
}
//判断方块是否是可移动类型
blockCanMove(block) {
if (block.getComponent("Block").type == 10 || block.getComponent("Block").type == 3
|| block.getComponent("Block").type == 4) {
return false;
}
return true;
}
//提前判断游戏结束
predict_End() {
//return true;
console.log("提前判断游戏结束");
let result = false;
for (let i = 0; i < this.blocks.length; i++) {
@ -2842,37 +2892,6 @@ export default class MapConroler extends cc.Component {
return result;
}
//判断方块是否可以正常通过门
blockCanPass(block, wall) {
let jg = false;
let heng = block.getComponent("Block").heng;
let shu = block.getComponent("Block").shu;
let direction = wall.node.parent.name;
if (direction == "left" || direction == "right") {
if (wall.wall_Info.length >= shu) {
jg = true;
}
}
else {
if (wall.wall_Info.length >= heng) {
jg = true;
}
}
if (!jg) {
console.log("普通快:不可通过");
}
return jg;
}
//判断方块是否是可移动类型
blockCanMove(block) {
if (block.getComponent("Block").type == 10 || block.getComponent("Block").type == 3
|| block.getComponent("Block").type == 4) {
return false;
}
return true;
}
update(dt) {

View File

@ -640,6 +640,12 @@ var GameTool = {
"timestamp": oldTime
}
}
else if (cc.fx.GameConfig.GM_INFO.hp == cc.fx.GameConfig.GM_INFO.hp_Max && health == 0) {
healthInfo = {
"health": cc.fx.GameConfig.GM_INFO.hp,
"timestamp": 0
}
}
else {
healthInfo = {
"health": cc.fx.GameConfig.GM_INFO.hp,

View File

@ -123,7 +123,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1080,
"height": 2340
"height": 1920
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -178,7 +178,7 @@
"__uuid__": "22372cf5-9d4b-4926-ace8-921c11cf8dd5"
},
"_type": 0,
"_sizeMode": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
@ -204,8 +204,8 @@
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": -210,
"_bottom": -210,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
@ -440,7 +440,7 @@
"ctor": "Float64Array",
"array": [
0,
-395.349,
-395.34899999999993,
0,
0,
0,