feat(战斗系统): 扩展为4条战斗线路并调整相关配置

- 将战斗线路从2条扩展为4条,新增LINE3和LINE4
- 修改Monster生成逻辑以支持4条线路
- 更新英雄刘邦的技能配置
- 调整基础攻击技能消耗为0
- 更新地图预制体以包含新增线路
This commit is contained in:
walkpan
2026-01-02 00:03:07 +08:00
parent ad4fd30314
commit ffa6bbec6f
5 changed files with 319 additions and 114 deletions

View File

@@ -166,7 +166,7 @@ export const SkillSet: Record<number, SkillConfig> = {
// ========== 基础攻击 ========== 6001-6099
6001: {
uuid:6001,name:"挥击",sp_name:"atk_s1",icon:"3036",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,DType:DType.ATK,
ap:100,cd:1,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,cost:10,with:0,dis:80,
ap:100,cd:1,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,cost:0,with:0,dis:80,
ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd,
buffs:[],neAttrs:[],info:"向最前方敌人扔出石斧,造成100%攻击的伤害",
},

View File

@@ -68,6 +68,8 @@ export const MonSet = {
export enum MonStart {
SLINE_1=130, //上线y
SLINE_2=110, //下线y
SLINE_3=150, //下线y
SLINE_4=90, //y起始点
START_X=240, //x起始点
START_I=60, //x轴间隔
}
@@ -124,7 +126,7 @@ export const HeroInfo: Record<number, heroInfo> = {
// 刘邦 - 领导型战士(善于用人,知人善任)
5001:{uuid:5001,name:"刘邦",path:"hk1", fac:FacSet.HERO, kind:1,as:1.5,
type:HType.warrior,lv:1,hp:200,mp:200,def:9,ap:15,dis:100,speed:120,skills:[6001,6100,6101,6102],
type:HType.warrior,lv:1,hp:200,mp:200,def:9,ap:15,dis:100,speed:120,skills:[6001,6001],
buff:[],tal:[],info:"楚汉争霸领袖,领导统御型战士"},
// 荆轲 - 刺客(敏捷型,高速度和暴击率)

View File

@@ -44,8 +44,10 @@ export class Monster extends ecs.Entity {
var node = instantiate(prefab);
let LINE1=scene.entityLayer!.node!.getChildByName("LINE1")!;
let LINE2=scene.entityLayer!.node!.getChildByName("LINE2")!;
let LINE3=scene.entityLayer!.node!.getChildByName("LINE3")!;
let LINE4=scene.entityLayer!.node!.getChildByName("LINE4")!;
// 🔥 设置初始 SiblingIndex - 防止溢出
const baseLane = lane === 0 ? LINE1 : LINE2;
const baseLane = lane === 0 ? LINE1 : lane === 1 ? LINE2 : lane === 2 ? LINE3 : LINE4;
node.parent = baseLane
const collider = node.getComponent(BoxCollider2D);
if (collider) collider.enabled = false; // 先禁用 // 延迟一帧启用碰撞体

View File

@@ -240,13 +240,32 @@ export class MissionMonCompComp extends CCComp {
let scale = -1;
// 使用 MonStart 计算怪物出生位置:
// x 从 START_X 开始,按 START_I 的间隔递增;
// y 在线路之间交替:偶数索引为 SLINE_1,奇数索引为 SLINE_2。
const x = MonStart.START_X + Math.floor(i / 2) * MonStart.START_I;
const y = (i % 2 === 0) ? MonStart.SLINE_1 : MonStart.SLINE_2;
let pos: Vec3 = v3(x, y, 0);
// y 在线路之间交替:0->SLINE_1, 1->SLINE_2, 2->SLINE_3, 3->SLINE_4
const x = MonStart.START_X + Math.floor(i / 4) * MonStart.START_I;
// 根据位置判断线路y=SLINE_1 为一线(lane=0)y=SLINE_2 为二线(lane=1)
const lane = y === MonStart.SLINE_1 ? 0 : 1;
let y = MonStart.SLINE_1;
let lane = 0;
switch (i % 4) {
case 0:
y = MonStart.SLINE_1;
lane = 0;
break;
case 1:
y = MonStart.SLINE_2;
lane = 1;
break;
case 2:
y = MonStart.SLINE_3;
lane = 2;
break;
case 3:
y = MonStart.SLINE_4;
lane = 3;
break;
}
let pos: Vec3 = v3(x, y, 0);
// 递增全局生成顺序 - 🔥 添加溢出保护
this.globalSpawnOrder = (this.globalSpawnOrder + 1) % 999; // 防止无限增长在999处循环重置