From 7bb49f86d5f6ec6a34081c23abd627fac9ef2afc Mon Sep 17 00:00:00 2001 From: panfudan Date: Thu, 31 Jul 2025 17:22:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=BB=E4=BA=A1=E8=AE=A1=E6=95=B0=E5=87=BA?= =?UTF-8?q?=E9=94=99=E4=BF=AE=E5=A4=8D=20+=20=E5=88=B7=E6=80=AA5=E4=B8=AA?= =?UTF-8?q?=E5=90=8E=E9=97=B4=E9=9A=945=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/resources/game/heros/md4.prefab | 2 +- assets/resources/game/heros/mn4.prefab | 2 +- assets/resources/game/heros/mor4.prefab | 2 +- assets/script/game/hero/BuffComp.ts | 4 +-- assets/script/game/hero/HeroViewComp.ts | 8 ++++- assets/script/game/map/MissionComp.ts | 2 +- assets/script/game/map/MissionMonComp.ts | 39 ++++++++++++++++++++++-- 7 files changed, 50 insertions(+), 9 deletions(-) diff --git a/assets/resources/game/heros/md4.prefab b/assets/resources/game/heros/md4.prefab index f719b0a9..70b3b204 100644 --- a/assets/resources/game/heros/md4.prefab +++ b/assets/resources/game/heros/md4.prefab @@ -1342,7 +1342,7 @@ "_contentSize": { "__type__": "cc.Size", "width": 80, - "height": 80 + "height": 100 }, "_anchorPoint": { "__type__": "cc.Vec2", diff --git a/assets/resources/game/heros/mn4.prefab b/assets/resources/game/heros/mn4.prefab index 341172d0..1fb25015 100644 --- a/assets/resources/game/heros/mn4.prefab +++ b/assets/resources/game/heros/mn4.prefab @@ -1342,7 +1342,7 @@ "_contentSize": { "__type__": "cc.Size", "width": 80, - "height": 80 + "height": 120 }, "_anchorPoint": { "__type__": "cc.Vec2", diff --git a/assets/resources/game/heros/mor4.prefab b/assets/resources/game/heros/mor4.prefab index b42b1789..1f6b9bcf 100644 --- a/assets/resources/game/heros/mor4.prefab +++ b/assets/resources/game/heros/mor4.prefab @@ -1342,7 +1342,7 @@ "_contentSize": { "__type__": "cc.Size", "width": 80, - "height": 80 + "height": 100 }, "_anchorPoint": { "__type__": "cc.Vec2", diff --git a/assets/script/game/hero/BuffComp.ts b/assets/script/game/hero/BuffComp.ts index 4b7b3d0f..97691833 100644 --- a/assets/script/game/hero/BuffComp.ts +++ b/assets/script/game/hero/BuffComp.ts @@ -42,7 +42,7 @@ export class BuffComp extends Component { info_init(){ this.HeroView=this.node.getComponent(HeroViewComp) this.top_node = this.node.getChildByName("top"); - let hp_y=this.node.getComponent(UITransform).height+20 + let hp_y=this.node.getComponent(UITransform).height this.top_node.setPosition(0,hp_y,0) this.hp_bar=this.top_node.getChildByName("hp").getComponent(ProgressBar) // this.top_node.getChildByName("hp").active=(this.node.getComponent(HeroViewComp).fac == 1 ? true : false) @@ -228,7 +228,7 @@ export class BuffComp extends Component { hp_tip(type:number=1,value:string="",s_uuid:number=1001,y:number=90){ let tip =ecs.getEntity(Tooltip); let x=this.node.position.x; - let ny=this.node.getComponent(UITransform).height-20; + let ny=this.node.getComponent(UITransform).height+20; let pos = v3(x,ny,0); tip.load(pos,type,value,s_uuid,this.node.parent); } diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 6777c23c..32dca185 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -39,6 +39,7 @@ export class HeroViewComp extends CCComp { box_group:number = BoxSet.HERO; is_dead:boolean = false; //是否摧毁 + is_count_dead:boolean = false; //是否计数死亡 is_stop:boolean = false; is_atking:boolean = false; @@ -446,7 +447,12 @@ export class HeroViewComp extends CCComp { //console.log("[HeroViewComp]:角色死亡",this.hero_uuid) if(this.fac==FacSet.MON){ - oops.message.dispatchEvent(GameEvent.MonDead) + if(this.is_count_dead) return + this.is_count_dead=true + this.scheduleOnce(()=>{ + oops.message.dispatchEvent(GameEvent.MonDead) + },0.1) + } if(this.fac==FacSet.HERO){ diff --git a/assets/script/game/map/MissionComp.ts b/assets/script/game/map/MissionComp.ts index 0c948eb8..4e568eaf 100644 --- a/assets/script/game/map/MissionComp.ts +++ b/assets/script/game/map/MissionComp.ts @@ -104,7 +104,7 @@ export class MissionComp extends CCComp { smc.vmdata.mission_data.mon_num-- if(smc.vmdata.mission_data.mon_num<=0 && this.count_tal() < 6) { if(smc.vmdata.mission_data.current_wave == RogueTalWave[this.count_tal()].wave){ - console.log("[MissionComp] 怪物全死亡后触发天赋奖励",RogueTalWave[this.count_tal()].tal_slot_key) + console.log("[MissionComp] current_wave:"+smc.vmdata.mission_data.current_wave+" tal wave:"+RogueTalWave[this.count_tal()].wave) oops.message.dispatchEvent(GameEvent.TalentSelect,{slot:TalentSlot[this.count_tal()]}) this.tals[this.count_tal()]=true diff --git a/assets/script/game/map/MissionMonComp.ts b/assets/script/game/map/MissionMonComp.ts index 3777d0f8..c8b42c9f 100644 --- a/assets/script/game/map/MissionMonComp.ts +++ b/assets/script/game/map/MissionMonComp.ts @@ -32,6 +32,9 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 扩 private isSpawning: boolean = false;// 是否正在生成怪物 private spawnInterval: number = 0.1; // 每个怪物生成间隔时间 private spawnTimer: number = 0; // 生成计时器 + private spawnCount: number = 0; // 召唤计数器 + private pauseInterval: number = 5.0; // 暂停间隔时间(5秒) + private isPausing: boolean = false; // 是否正在暂停 onLoad(){ @@ -46,12 +49,34 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 扩 protected update(dt: number): void { if(!smc.mission.play||smc.mission.pause) return + // 处理刷怪队列 if (this.monsterQueue.length > 0 && !this.isSpawning) { this.spawnTimer += dt; + + // 检查是否需要暂停(每召唤5次后暂停5秒) + if (this.isPausing) { + if (this.spawnTimer >= this.pauseInterval) { + // 暂停结束,重置状态 + this.isPausing = false; + this.spawnCount = 0; + this.spawnTimer = 0; + console.log("[MissionMonComp]: 暂停结束,继续召唤怪物"); + } + return; // 暂停期间不召唤怪物 + } + + // 正常召唤间隔 if (this.spawnTimer >= this.spawnInterval) { this.spawnNextMonster(); this.spawnTimer = 0; + + // 检查是否需要进入暂停状态 + if (this.spawnCount >= 5) { + this.isPausing = true; + this.spawnTimer = 0; // 重置计时器用于暂停计时 + console.log("[MissionMonComp]: 已召唤5只怪物,开始暂停5秒"); + } } } } @@ -59,6 +84,11 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 扩 do_mon_wave(){ console.log("[MissionMonComp]:怪物登场,当前波次 :",smc.vmdata.mission_data.current_wave) + // 重置召唤相关状态 + this.spawnCount = 0; + this.isPausing = false; + this.spawnTimer = 0; + const currentWave = smc.vmdata.mission_data.current_wave; // 使用肉鸽模式配置 const rogueWaveConfig = getRogueWaveConfig(currentWave); @@ -86,10 +116,11 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 扩 // 为每个怪物组生成指定数量的怪物 for (let i = 0; i < count; i++) { - // 随机选择位置 (0-9) + // 位置循环使用 (0-9),如果怪物数量超过10个位置,则循环使用 + const position = i % 5; this.addToSpawnQueueWithAffixes( uuid, - i, + position, isBoss || false, monsterLevel, affixes, @@ -167,6 +198,10 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 扩 monsterData.rogueHp, monsterData.rogueAttack ); + + // 增加召唤计数 + this.spawnCount++; + console.log(`[MissionMonComp]: 召唤第${this.spawnCount}只怪物,剩余队列: ${this.monsterQueue.length}`); } }