暂时 解决 血条错位和 打到新产生的怪问题

This commit is contained in:
2025-07-21 10:08:54 +08:00
parent 9fd8fa02af
commit 9b4e9073a2
5 changed files with 39 additions and 30 deletions

View File

@@ -14,7 +14,7 @@ const { ccclass, property } = _decorator;
@ccclass('Main')
export class Main extends Root {
start() {
PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb
// PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb
}
protected async run() {
smc.initialize = ecs.getEntity<Initialize>(Initialize);

View File

@@ -53,24 +53,33 @@ export const HQuality = {
ORANGE:5,
}
export const MonSet = {
0:{pos:v3(370,0,0)},
1:{pos:v3(370,+80,0)},
2:{pos:v3(370,-80,0)},
3:{pos:v3(400,0,0)},
4:{pos:v3(420,0,0)},
5:{pos:v3(440,0,0)},
6:{pos:v3(460,0,0)},
7:{pos:v3(480,0,0)},
8:{pos:v3(500,0,0)},
9:{pos:v3(520,0,0)},
10:{pos:v3(540,0,0)},
11:{pos:v3(560,0,0)},
12:{pos:v3(580,0,0)},
13:{pos:v3(600,0,0)},
14:{pos:v3(620,0,0)},
15:{pos:v3(640,0,0)},
16:{pos:v3(660,0,0)},
17:{pos:v3(680,0,0)},
0:{pos:v3(390,0,0)},
1:{pos:v3(390,+80,0)},
2:{pos:v3(390,-80,0)},
3:{pos:v3(420,0,0)},
4:{pos:v3(420,+80,0)},
5:{pos:v3(420,-80,0)},
6:{pos:v3(450,0,0)},
7:{pos:v3(450,+80,0)},
8:{pos:v3(450,-80,0)},
9:{pos:v3(480,0,0)},
10:{pos:v3(480,+80,0)},
11:{pos:v3(480,-80,0)},
12:{pos:v3(510,0,0)},
13:{pos:v3(510,+80,0)},
14:{pos:v3(510,-80,0)},
15:{pos:v3(540,0,0)},
16:{pos:v3(540,+80,0)},
17:{pos:v3(540,-80,0)},
18:{pos:v3(570,0,0)},
19:{pos:v3(570,+80,0)},
20:{pos:v3(570,-80,0)},
21:{pos:v3(600,0,0)},
22:{pos:v3(600,+80,0)},
23:{pos:v3(600,-80,0)},
24:{pos:v3(630,0,0)},
25:{pos:v3(630,+80,0)},
26:{pos:v3(630,-80,0)},
}
// 经验值计算函数 - 复杂递增规律

View File

@@ -1,4 +1,4 @@
import { _decorator, Component, instantiate, Label, Node, Prefab, ProgressBar, tween, v3, Vec3 } from 'cc';
import { _decorator, Component, instantiate, Label, Node, Prefab, ProgressBar, tween, UITransform, v3, Vec3 } from 'cc';
import { oops } from 'db://oops-framework/core/Oops';
import { ecs } from 'db://oops-framework/libs/ecs/ECS';
import { Tooltip } from '../skills/Tooltip';
@@ -48,6 +48,8 @@ export class BuffComp extends Component {
this.HeroView=this.node.getComponent(HeroViewComp)
this.FIGHTCON=this.node.parent.getComponent(FightConComp)
this.top_node = this.node.getChildByName("top");
let hp_y=this.node.getComponent(UITransform).height+20
this.top_node.setPosition(0,hp_y,0)
// this.top_node.getChildByName("hp").active=(this.node.getComponent(HeroViewComp).fac == 1 ? true : false)
this.vmdata_update()

View File

@@ -29,7 +29,7 @@ export class MissionMonCompComp extends CCComp {
buffData?: any[] // 使用BuffAttr格式的buff数据
}> = [];
private isSpawning: boolean = false;// 是否正在生成怪物
private spawnInterval: number = 2; // 每个怪物生成间隔时间
private spawnInterval: number = 0.5; // 每个怪物生成间隔时间
private spawnTimer: number = 0; // 生成计时器
private is_fight:boolean = false;
@@ -105,10 +105,9 @@ export class MissionMonCompComp extends CCComp {
// 为每个怪物组生成指定数量的怪物
for (let i = 0; i < count; i++) {
// 随机选择位置 (0-9)
let x=i%3 //0 1 2
this.addToSpawnQueueWithAffixes(
uuid,
x,
i,
isBoss || false,
monsterLevel,
affixes,
@@ -189,10 +188,9 @@ export class MissionMonCompComp extends CCComp {
lv: number = 1,
buffData?: any[]
) {
let x=RandomManager.instance.getRandomInt(0,2)
let mon = ecs.getEntity<Monster>(Monster);
let scale = -1;
let pos: Vec3 = v3(MonSet[x].pos);
let pos: Vec3 = v3(MonSet[i].pos);
// 生成怪物传递词条buff数据
mon.load(pos, scale, uuid, is_boss, is_call, lv, buffData);