From ae8bee68388b67be26aeadbceb9bfe45f652b00c Mon Sep 17 00:00:00 2001 From: "COMPUTER\\EDY" <249929363@qq.com> Date: Mon, 13 Oct 2025 14:44:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BD=93=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Script/Block.ts | 1 + assets/Script/GameManager.ts | 2 +- assets/Script/JiaZai.ts | 16 +++-- assets/Script/Map.ts | 2 + assets/Script/module/Config/GameConfig.ts | 4 +- assets/Script/module/Tool/GameTool.ts | 6 +- assets/prefab/pop/heathpop.prefab | 85 ++++++++++++++++------- 7 files changed, 79 insertions(+), 37 deletions(-) diff --git a/assets/Script/Block.ts b/assets/Script/Block.ts index 5e11a03..32d28cb 100644 --- a/assets/Script/Block.ts +++ b/assets/Script/Block.ts @@ -673,6 +673,7 @@ export default class Block extends cc.Component { MapConroler._instance.node.parent.getChildByName("Bottom").getChildByName("destroyBtn").getComponent("btnControl").setTouch(true); MapConroler._instance.costHammer(); MapConroler._instance.usePause(); + MapConroler._instance.node.parent.getChildByName("Mask").active = false; return false; } if (this.type != BlockType.上锁块 && this.type != BlockType.冻结块) { diff --git a/assets/Script/GameManager.ts b/assets/Script/GameManager.ts index 1f31acb..94e74ba 100644 --- a/assets/Script/GameManager.ts +++ b/assets/Script/GameManager.ts @@ -542,7 +542,7 @@ export default class GameManager extends cc.Component { cc.fx.GameConfig.GM_INFO.hp_Max = 7; cc.fx.GameConfig.GM_INFO.doubleCoin = 2; } else { - cc.fx.GameConfig.GM_INFO.hp_Max = 5; + cc.fx.GameConfig.GM_INFO.hp_Max = 3; cc.fx.GameConfig.GM_INFO.doubleCoin = 1; } //本地储存当前服务器时间 diff --git a/assets/Script/JiaZai.ts b/assets/Script/JiaZai.ts index a823c66..93313a6 100644 --- a/assets/Script/JiaZai.ts +++ b/assets/Script/JiaZai.ts @@ -472,16 +472,18 @@ export default class JiaZai extends cc.Component { if (cc.fx.GameConfig.GM_INFO.min_Time <= 0) { this.stopHeathTimeCutDown(); - let timeTemp = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time); + let timeTemp = cc.fx.GameTool.getTimeMargin2(cc.fx.GameConfig.GM_INFO.min_Time); //console.log("健康值倒计时结束,当前时间:", timeTemp, cc.fx.GameConfig.GM_INFO.min_Time); if (timeLabelNode) { - NumberToImage.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time, 50, "month_", timeLabelNode); + timeLabelNode.getComponent(cc.Label).string = timeTemp; + // NumberToImage.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time, 50, "month_", timeLabelNode); } NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.hp, 40, 20, "month_", this.heath, true); } else { - let timeTemp = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time); + let timeTemp = cc.fx.GameTool.getTimeMargin2(cc.fx.GameConfig.GM_INFO.min_Time); if (timeLabelNode) { - NumberToImage.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time, 50, "month_", timeLabelNode); + timeLabelNode.getComponent(cc.Label).string = timeTemp; + // NumberToImage.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time, 50, "month_", timeLabelNode); } } }.bind(this); @@ -501,7 +503,7 @@ export default class JiaZai extends cc.Component { this.scheduleCallback = function () { if (cc.fx.GameConfig.GM_INFO.min_Time <= 0) { this.stopTimeCutDown(); - var timeTemp = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time); + var timeTemp = cc.fx.GameTool.getTimeMargin2(cc.fx.GameConfig.GM_INFO.min_Time); // 同步显示 if (this.Stamina && this.Stamina.getChildByName("time")) { this.Stamina.getChildByName("time").getComponent(cc.Label).string = timeTemp; @@ -518,7 +520,7 @@ export default class JiaZai extends cc.Component { } else { cc.fx.GameConfig.GM_INFO.min_Time -= 1; - var timeTemp = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time); + var timeTemp = cc.fx.GameTool.getTimeMargin2(cc.fx.GameConfig.GM_INFO.min_Time); // 同步显示 if (this.Stamina && this.Stamina.getChildByName("time")) { let power = cc.fx.GameTool.getUserPowerTime(); @@ -635,7 +637,7 @@ export default class JiaZai extends cc.Component { NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.hp, 25, 15, "hp_", this.Stamina.getChildByName("health"), false); this.Stamina.getChildByName("time").active = true; if (cc.fx.GameConfig.GM_INFO.min_Time != 0) { - let time = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time); + let time = cc.fx.GameTool.getTimeMargin2(cc.fx.GameConfig.GM_INFO.min_Time); this.Stamina.getChildByName("time").getComponent(cc.Label).string = time; let power = cc.fx.GameTool.getUserPowerTime(); if (!power) this.Stamina.getChildByName("time").opacity = 255; diff --git a/assets/Script/Map.ts b/assets/Script/Map.ts index 230843b..6044368 100644 --- a/assets/Script/Map.ts +++ b/assets/Script/Map.ts @@ -2662,6 +2662,7 @@ export default class MapConroler extends cc.Component { else { if (!this.hammer) { this.hammerMask.active = true; + this.node.parent.getChildByName("Mask").active = true; this.hammer = true; this.ishammer = true; this.stopBoom(); @@ -3826,6 +3827,7 @@ export default class MapConroler extends cc.Component { if (!this.hammer) { const timestamp = Date.now(); this.hammerMask.active = true; + this.node.parent.getChildByName("Mask").active = true; this.hammer = true; this.ishammer = true; //// this.winStreakBtn.node.active = false; diff --git a/assets/Script/module/Config/GameConfig.ts b/assets/Script/module/Config/GameConfig.ts index 4331eee..507ff40 100644 --- a/assets/Script/module/Config/GameConfig.ts +++ b/assets/Script/module/Config/GameConfig.ts @@ -226,7 +226,7 @@ export class GameConfig { this.GM_INFO = { // isEnd: false, mean_Time: 0, //平均放箭速度 - hp: 5, //体力值 + hp: 3, //体力值 review: 0, //复活次数 reviewBoom: 0, //炸弹复活次数 reviewDoor: 0, //门复活次数 @@ -272,7 +272,7 @@ export class GameConfig { hammerFirst: false, //锤子道具第一次 magicAFirst: false, //魔法棒道具第一次 winStreakFirst: false, //每次第一次连胜 - hp_Max: 5, //体力最大值 + hp_Max: 3, //体力最大值 doubleCoin: 1, //是否双倍 // monthTime: 0, //月卡时间 // revive: 0, //复活礼包购买次数 diff --git a/assets/Script/module/Tool/GameTool.ts b/assets/Script/module/Tool/GameTool.ts index 4d5f6d0..64902e2 100644 --- a/assets/Script/module/Tool/GameTool.ts +++ b/assets/Script/module/Tool/GameTool.ts @@ -524,7 +524,7 @@ var GameTool = { } else if (health.health < cc.fx.GameConfig.GM_INFO.hp_Max) { // 30分钟的毫秒数 - const thirtyMinutes = 30 * 60 * 1000; + const thirtyMinutes = 240 * 60 * 1000; const elapsedTime = timestamp - health.timestamp; // 计算恢复的体力值 const recoveredHealth = Math.min(cc.fx.GameConfig.GM_INFO.hp_Max - health.health, Math.floor(elapsedTime / thirtyMinutes)); @@ -1149,13 +1149,13 @@ var GameTool = { cc.fx.GameConfig.GM_INFO.doubleCoin = 2; return true; } else { - cc.fx.GameConfig.GM_INFO.hp_Max = 5; + cc.fx.GameConfig.GM_INFO.hp_Max = 3; cc.fx.GameConfig.GM_INFO.doubleCoin = 1; return false; } } else { - cc.fx.GameConfig.GM_INFO.hp_Max = 5; + cc.fx.GameConfig.GM_INFO.hp_Max = 3; cc.fx.GameConfig.GM_INFO.doubleCoin = 1; cc.fx.StorageMessage.setStorage("mCardDate", 0); return false; diff --git a/assets/prefab/pop/heathpop.prefab b/assets/prefab/pop/heathpop.prefab index 7606361..71d55a2 100644 --- a/assets/prefab/pop/heathpop.prefab +++ b/assets/prefab/pop/heathpop.prefab @@ -27,14 +27,14 @@ "_active": true, "_components": [ { - "__id__": 69 + "__id__": 70 }, { - "__id__": 70 + "__id__": 71 } ], "_prefab": { - "__id__": 71 + "__id__": 72 }, "_opacity": 255, "_color": { @@ -251,7 +251,7 @@ "_active": true, "_components": [], "_prefab": { - "__id__": 68 + "__id__": 69 }, "_opacity": 255, "_color": { @@ -636,16 +636,16 @@ "__id__": 53 }, { - "__id__": 61 + "__id__": 62 }, { - "__id__": 64 + "__id__": 65 } ], "_active": true, "_components": [], "_prefab": { - "__id__": 67 + "__id__": 68 }, "_opacity": 255, "_color": { @@ -2047,11 +2047,11 @@ "_active": true, "_components": [ { - "__id__": 59 + "__id__": 60 } ], "_prefab": { - "__id__": 60 + "__id__": 61 }, "_opacity": 255, "_color": { @@ -2108,7 +2108,7 @@ "__id__": 53 }, "_children": [], - "_active": true, + "_active": false, "_components": [ { "__id__": 55 @@ -2218,22 +2218,26 @@ }, "_children": [], "_active": true, - "_components": [], + "_components": [ + { + "__id__": 58 + } + ], "_prefab": { - "__id__": 58 + "__id__": 59 }, "_opacity": 255, "_color": { "__type__": "cc.Color", - "r": 0, - "g": 0, - "b": 0, + "r": 142, + "g": 88, + "b": 42, "a": 255 }, "_contentSize": { "__type__": "cc.Size", "width": 0, - "height": 50.4 + "height": 75.6 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -2244,8 +2248,8 @@ "__type__": "TypedArray", "ctor": "Float64Array", "array": [ - -400.572, - 0, + -295.355, + -1, 0, 0, 0, @@ -2269,6 +2273,39 @@ "groupIndex": 0, "_id": "" }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 57 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "", + "_N$string": "", + "_fontSize": 60, + "_lineHeight": 60, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 1, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 0, + "_id": "" + }, { "__type__": "cc.PrefabInfo", "root": { @@ -2336,11 +2373,11 @@ "_active": false, "_components": [ { - "__id__": 62 + "__id__": 63 } ], "_prefab": { - "__id__": 63 + "__id__": 64 }, "_opacity": 255, "_color": { @@ -2394,7 +2431,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 61 + "__id__": 62 }, "_enabled": true, "_materials": [ @@ -2445,11 +2482,11 @@ "_active": true, "_components": [ { - "__id__": 65 + "__id__": 66 } ], "_prefab": { - "__id__": 66 + "__id__": 67 }, "_opacity": 255, "_color": { @@ -2503,7 +2540,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 64 + "__id__": 65 }, "_enabled": true, "_materials": [