2 Commits

Author SHA1 Message Date
6571eb2ef0 feat(game): 技能基础框架基本搭建完成,下步遇到再完善
- 调整了英雄角色top.prefab节点结构和组件关联,优化层级关系和属性值
- 修改pow、mpb等子节点的组件及位置,提升表现效果
- 更新技能atk_fires.prefab增加了ReadyLoop、SkillTime等新属性
- 调整攻击技能atk_s1.prefab的运行类型及相关时间与计数参数
- 修正atk_s1.prefab目标覆盖配置,完善prefab实例结构
- 精简atk_s_1.prefab的子节点引用,去除冗余id链接,简化资源结构
2025-10-19 15:16:39 +08:00
6d5c768a30 refactor(game): 精简肉鸽模式关卡配置并优化怪物加载逻辑
- 调整SkillSet基础攻击技能参数,降低CD时间和技能消耗
- 更新HeroInfo中英雄和怪物的技能组合,替换为更合理的技能ID
- 注释掉部分法师及精英怪物的定义,简化怪物列表
- 优化Monster类load和hero_init方法,移除不再使用的增强属性和关卡倍数参数
- 精简MissionMonComp刷怪队列逻辑,移除增强属性和关卡倍数支持
- 调整RogueConfig,去除怪物增强属性相关代码,仅保留基础刷怪类型和数量配置
- 修正SkillCom中使用属性枚举的地方,使用统一Attrs枚举
- 清理代码注释和多余空行,提升代码规范性和可读性
2025-10-19 12:06:18 +08:00
18 changed files with 747 additions and 750 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -312,11 +312,15 @@
"__expectedType__": "cc.Prefab" "__expectedType__": "cc.Prefab"
}, },
"hasReady": true, "hasReady": true,
"ReadyTime": 0.1, "ReadyLoop": true,
"SkillTime": 5,
"ReadyTime": 0.2,
"runType": 0, "runType": 0,
"ready_y": 200, "ready_y": 200,
"atk_x": 10, "atk_x": 0,
"atk_y": 40, "atk_y": 0,
"s_count": 5,
"s_interval": 0.2,
"_id": "" "_id": ""
}, },
{ {

View File

@@ -311,12 +311,16 @@
"__uuid__": "551c634e-b486-4ff5-a302-279e365751ee", "__uuid__": "551c634e-b486-4ff5-a302-279e365751ee",
"__expectedType__": "cc.Prefab" "__expectedType__": "cc.Prefab"
}, },
"runType": 2,
"hasReady": false, "hasReady": false,
"ReadyLoop": false,
"SkillTime": 1,
"ReadyTime": 0.1, "ReadyTime": 0.1,
"runType": 2,
"ready_y": 0, "ready_y": 0,
"atk_x": 10, "atk_x": 10,
"atk_y": 0, "atk_y": 0,
"s_count": 1,
"s_interval": 0,
"_id": "" "_id": ""
}, },
{ {
@@ -333,6 +337,7 @@
}, },
"fileId": "c46/YsCPVOJYA4mWEpNYRx", "fileId": "c46/YsCPVOJYA4mWEpNYRx",
"instance": null, "instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": [ "nestedPrefabInstanceRoots": [
{ {
"__id__": 2 "__id__": 2

View File

@@ -32,13 +32,10 @@
}, },
{ {
"__id__": 16 "__id__": 16
},
{
"__id__": 18
} }
], ],
"_prefab": { "_prefab": {
"__id__": 20 "__id__": 18
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -359,24 +356,6 @@
"__type__": "cc.CompPrefabInfo", "__type__": "cc.CompPrefabInfo",
"fileId": "157f8YWOhK6pBg6CBgHHww" "fileId": "157f8YWOhK6pBg6CBgHHww"
}, },
{
"__type__": "b1d8e1ZA0dLtqufhidnFK/K",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 19
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "eeypCqftdF9bW7NF55WalQ"
},
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {

View File

@@ -32,13 +32,10 @@
}, },
{ {
"__id__": 16 "__id__": 16
},
{
"__id__": 18
} }
], ],
"_prefab": { "_prefab": {
"__id__": 20 "__id__": 18
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -359,24 +356,6 @@
"__type__": "cc.CompPrefabInfo", "__type__": "cc.CompPrefabInfo",
"fileId": "157f8YWOhK6pBg6CBgHHww" "fileId": "157f8YWOhK6pBg6CBgHHww"
}, },
{
"__type__": "b1d8e1ZA0dLtqufhidnFK/K",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 19
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "eeypCqftdF9bW7NF55WalQ"
},
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {

View File

@@ -32,13 +32,10 @@
}, },
{ {
"__id__": 16 "__id__": 16
},
{
"__id__": 18
} }
], ],
"_prefab": { "_prefab": {
"__id__": 20 "__id__": 18
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -359,24 +356,6 @@
"__type__": "cc.CompPrefabInfo", "__type__": "cc.CompPrefabInfo",
"fileId": "157f8YWOhK6pBg6CBgHHww" "fileId": "157f8YWOhK6pBg6CBgHHww"
}, },
{
"__type__": "b1d8e1ZA0dLtqufhidnFK/K",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 19
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "eeypCqftdF9bW7NF55WalQ"
},
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {

View File

@@ -7,11 +7,11 @@
"embeddedPlayerGroups": [] "embeddedPlayerGroups": []
}, },
"_native": "", "_native": "",
"sample": 60, "sample": 30,
"speed": 1, "speed": 1,
"wrapMode": 1, "wrapMode": 1,
"enableTrsBlending": false, "enableTrsBlending": false,
"_duration": 0.05, "_duration": 0.1,
"_hash": 500763545, "_hash": 500763545,
"_tracks": [ "_tracks": [
{ {
@@ -24,12 +24,12 @@
"_exoticAnimation": null, "_exoticAnimation": null,
"_events": [ "_events": [
{ {
"frame": 0.03333333333333333, "frame": 0.06666666666666667,
"func": "", "func": "",
"params": [] "params": []
}, },
{ {
"frame": 0.03333333333333333, "frame": 0.06666666666666667,
"func": "atk", "func": "atk",
"params": [] "params": []
} }
@@ -88,7 +88,7 @@
"__type__": "cc.RealCurve", "__type__": "cc.RealCurve",
"_times": [ "_times": [
0, 0,
0.05000000074505806 0.1
], ],
"_values": [ "_values": [
{ {
@@ -101,9 +101,7 @@
"leftTangent": 0, "leftTangent": 0,
"leftTangentWeight": 1, "leftTangentWeight": 1,
"easingMethod": 0, "easingMethod": 0,
"__editorExtras__": { "__editorExtras__": null
"tangentMode": 0
}
}, },
{ {
"__type__": "cc.RealKeyframeValue", "__type__": "cc.RealKeyframeValue",
@@ -115,9 +113,7 @@
"leftTangent": 0, "leftTangent": 0,
"leftTangentWeight": 1, "leftTangentWeight": 1,
"easingMethod": 0, "easingMethod": 0,
"__editorExtras__": { "__editorExtras__": null
"tangentMode": 0
}
} }
], ],
"preExtrapolation": 1, "preExtrapolation": 1,
@@ -133,7 +129,7 @@
"__type__": "cc.RealCurve", "__type__": "cc.RealCurve",
"_times": [ "_times": [
0, 0,
0.05000000074505806 0.1
], ],
"_values": [ "_values": [
{ {
@@ -146,9 +142,7 @@
"leftTangent": 0, "leftTangent": 0,
"leftTangentWeight": 1, "leftTangentWeight": 1,
"easingMethod": 0, "easingMethod": 0,
"__editorExtras__": { "__editorExtras__": null
"tangentMode": 0
}
}, },
{ {
"__type__": "cc.RealKeyframeValue", "__type__": "cc.RealKeyframeValue",
@@ -160,9 +154,7 @@
"leftTangent": 0, "leftTangent": 0,
"leftTangentWeight": 1, "leftTangentWeight": 1,
"easingMethod": 0, "easingMethod": 0,
"__editorExtras__": { "__editorExtras__": null
"tangentMode": 0
}
} }
], ],
"preExtrapolation": 1, "preExtrapolation": 1,
@@ -178,7 +170,7 @@
"__type__": "cc.RealCurve", "__type__": "cc.RealCurve",
"_times": [ "_times": [
0, 0,
0.05000000074505806 0.1
], ],
"_values": [ "_values": [
{ {
@@ -191,9 +183,7 @@
"leftTangent": 0, "leftTangent": 0,
"leftTangentWeight": 1, "leftTangentWeight": 1,
"easingMethod": 0, "easingMethod": 0,
"__editorExtras__": { "__editorExtras__": null
"tangentMode": 0
}
}, },
{ {
"__type__": "cc.RealKeyframeValue", "__type__": "cc.RealKeyframeValue",
@@ -205,9 +195,7 @@
"leftTangent": 0, "leftTangent": 0,
"leftTangentWeight": 1, "leftTangentWeight": 1,
"easingMethod": 0, "easingMethod": 0,
"__editorExtras__": { "__editorExtras__": null
"tangentMode": 0
}
} }
], ],
"preExtrapolation": 1, "preExtrapolation": 1,
@@ -279,8 +267,8 @@
{ {
"__type__": "cc.RealCurve", "__type__": "cc.RealCurve",
"_times": [ "_times": [
0.03333333507180214, 0.06666666666666667,
0.05000000074505806 0.1
], ],
"_values": [ "_values": [
{ {
@@ -293,9 +281,7 @@
"leftTangent": 0, "leftTangent": 0,
"leftTangentWeight": 1, "leftTangentWeight": 1,
"easingMethod": 0, "easingMethod": 0,
"__editorExtras__": { "__editorExtras__": null
"tangentMode": 0
}
}, },
{ {
"__type__": "cc.RealKeyframeValue", "__type__": "cc.RealKeyframeValue",
@@ -307,9 +293,7 @@
"leftTangent": 0, "leftTangent": 0,
"leftTangentWeight": 1, "leftTangentWeight": 1,
"easingMethod": 0, "easingMethod": 0,
"__editorExtras__": { "__editorExtras__": null
"tangentMode": 0
}
} }
], ],
"preExtrapolation": 1, "preExtrapolation": 1,
@@ -324,8 +308,8 @@
{ {
"__type__": "cc.RealCurve", "__type__": "cc.RealCurve",
"_times": [ "_times": [
0.03333333507180214, 0.06666666666666667,
0.05000000074505806 0.1
], ],
"_values": [ "_values": [
{ {
@@ -338,9 +322,7 @@
"leftTangent": 0, "leftTangent": 0,
"leftTangentWeight": 1, "leftTangentWeight": 1,
"easingMethod": 0, "easingMethod": 0,
"__editorExtras__": { "__editorExtras__": null
"tangentMode": 0
}
}, },
{ {
"__type__": "cc.RealKeyframeValue", "__type__": "cc.RealKeyframeValue",
@@ -352,9 +334,7 @@
"leftTangent": 0, "leftTangent": 0,
"leftTangentWeight": 1, "leftTangentWeight": 1,
"easingMethod": 0, "easingMethod": 0,
"__editorExtras__": { "__editorExtras__": null
"tangentMode": 0
}
} }
], ],
"preExtrapolation": 1, "preExtrapolation": 1,
@@ -369,8 +349,8 @@
{ {
"__type__": "cc.RealCurve", "__type__": "cc.RealCurve",
"_times": [ "_times": [
0.03333333507180214, 0.06666666666666667,
0.05000000074505806 0.1
], ],
"_values": [ "_values": [
{ {
@@ -383,9 +363,7 @@
"leftTangent": 0, "leftTangent": 0,
"leftTangentWeight": 1, "leftTangentWeight": 1,
"easingMethod": 0, "easingMethod": 0,
"__editorExtras__": { "__editorExtras__": null
"tangentMode": 0
}
}, },
{ {
"__type__": "cc.RealKeyframeValue", "__type__": "cc.RealKeyframeValue",
@@ -397,9 +375,7 @@
"leftTangent": 0, "leftTangent": 0,
"leftTangentWeight": 1, "leftTangentWeight": 1,
"easingMethod": 0, "easingMethod": 0,
"__editorExtras__": { "__editorExtras__": null
"tangentMode": 0
}
} }
], ],
"preExtrapolation": 1, "preExtrapolation": 1,
@@ -414,8 +390,8 @@
{ {
"__type__": "cc.RealCurve", "__type__": "cc.RealCurve",
"_times": [ "_times": [
0.03333333507180214, 0.06666666666666667,
0.05000000074505806 0.1
], ],
"_values": [ "_values": [
{ {
@@ -428,9 +404,7 @@
"leftTangent": 0, "leftTangent": 0,
"leftTangentWeight": 1, "leftTangentWeight": 1,
"easingMethod": 0, "easingMethod": 0,
"__editorExtras__": { "__editorExtras__": null
"tangentMode": 0
}
}, },
{ {
"__type__": "cc.RealKeyframeValue", "__type__": "cc.RealKeyframeValue",
@@ -442,9 +416,7 @@
"leftTangent": 0, "leftTangent": 0,
"leftTangentWeight": 1, "leftTangentWeight": 1,
"easingMethod": 0, "easingMethod": 0,
"__editorExtras__": { "__editorExtras__": null
"tangentMode": 0
}
} }
], ],
"preExtrapolation": 1, "preExtrapolation": 1,

View File

@@ -148,6 +148,8 @@ export enum Attrs {
SHIELD_UP = 28, //护盾效果提升 SHIELD_UP = 28, //护盾效果提升
BURN = 29, //攻击带易伤 BURN = 29, //攻击带易伤
DEBURN = 30, //被攻击易伤 DEBURN = 30, //被攻击易伤
PUNCTURE=31, // 穿刺次数
PUNCTURE_DMG=32, //穿刺伤害加成
} }
@@ -191,6 +193,7 @@ export const AttrsType: Record<Attrs, BType> = {
[Attrs.DIS]: BType.VALUE, // 攻击距离 - 数值型 [Attrs.DIS]: BType.VALUE, // 攻击距离 - 数值型
[Attrs.BURN]: BType.VALUE, // 易伤 - 数值型 [Attrs.BURN]: BType.VALUE, // 易伤 - 数值型
[Attrs.DEBURN]: BType.VALUE, // 被攻击易伤 - 数值型 [Attrs.DEBURN]: BType.VALUE, // 被攻击易伤 - 数值型
[Attrs.PUNCTURE]: BType.VALUE, // 穿刺次数 - 数值型
// ========== 百分比型属性 ========== // ========== 百分比型属性 ==========
[Attrs.CRITICAL]: BType.RATIO, // 暴击率 - 百分比型 [Attrs.CRITICAL]: BType.RATIO, // 暴击率 - 百分比型
@@ -214,6 +217,7 @@ export const AttrsType: Record<Attrs, BType> = {
[Attrs.DBUFF_UP]: BType.RATIO, // debuff效果提升 - 百分比型 [Attrs.DBUFF_UP]: BType.RATIO, // debuff效果提升 - 百分比型
[Attrs.SPEED]: BType.RATIO, // 移动速度加成 - 百分比型 [Attrs.SPEED]: BType.RATIO, // 移动速度加成 - 百分比型
[Attrs.SHIELD_UP]: BType.RATIO, // 护盾效果提升 - 百分比型 [Attrs.SHIELD_UP]: BType.RATIO, // 护盾效果提升 - 百分比型
[Attrs.PUNCTURE_DMG]: BType.RATIO,
}; };
/** /**
@@ -364,7 +368,7 @@ export const SkillSet: Record<number, SkillConfig> = {
// ========== 基础攻击 ========== 6001-6099 // ========== 基础攻击 ========== 6001-6099
6001: { 6001: {
uuid:6001,name:"挥击",sp_name:"atk_s1",AtkedType:AtkedType.atked,path:"3036",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single, uuid:6001,name:"挥击",sp_name:"atk_s1",AtkedType:AtkedType.atked,path:"3036",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,
ap:100,cd:5,in:0.2,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,cost:10,with:0, ap:100,cd:1,in:0.2,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,cost:0,with:0,
buffs:[],debuffs:[],info:"向最前方敌人扔出石斧,造成100%攻击的伤害" buffs:[],debuffs:[],info:"向最前方敌人扔出石斧,造成100%攻击的伤害"
}, },
6002: { 6002: {
@@ -384,7 +388,7 @@ export const SkillSet: Record<number, SkillConfig> = {
}, },
6005: { 6005: {
uuid:6005,name:"火球术",sp_name:"atk_fires",AtkedType:AtkedType.fire,path:"3039",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single, uuid:6005,name:"火球术",sp_name:"atk_fires",AtkedType:AtkedType.fire,path:"3039",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,
ap:100,cd:5,in:1,t_num:1,hit_num:1,hit:2,hitcd:0.3,speed:720,cost:10,with:90, ap:100,cd:5,in:1,t_num:1,hit_num:1,hit:2,hitcd:0.3,speed:720,cost:20,with:90,
buffs:[],debuffs:[],info:"召唤大火球攻击前方所有敌人,造成300%攻击的伤害,有一定几率施加灼烧" buffs:[],debuffs:[],info:"召唤大火球攻击前方所有敌人,造成300%攻击的伤害,有一定几率施加灼烧"
}, },
6006: { 6006: {

View File

@@ -107,25 +107,25 @@ export interface heroInfo{
export const HeroInfo: Record<number, heroInfo> = { export const HeroInfo: Record<number, heroInfo> = {
//主将 //主将
5001:{uuid:5001,name:"火焰骑士",path:"hk1", fac:FacSet.HERO, kind:1, 5001:{uuid:5001,name:"火焰骑士",path:"hk1", fac:FacSet.HERO, kind:1,
type:HType.warrior,lv:1,hp:100,mp:100,map:100,def:5,ap:15,dis:100,cd:1,speed:150,skills:[6001,6001], type:HType.warrior,lv:1,hp:100,mp:100,map:100,def:5,ap:15,dis:100,cd:1,speed:150,skills:[6001,6005],
buff:[],debuff:[],info:""}, buff:[],debuff:[],info:""},
5002:{uuid:5002,name:"刺客",path:"hc1", fac:FacSet.HERO, kind:1, 5002:{uuid:5002,name:"刺客",path:"hc1", fac:FacSet.HERO, kind:1,
type:HType.warrior,lv:1,hp:100,mp:100,map:100,def:5,ap:15,dis:100,cd:1,speed:150,skills:[6001,6001], type:HType.warrior,lv:1,hp:100,mp:100,map:100,def:5,ap:15,dis:100,cd:1,speed:150,skills:[6001,6005],
buff:[],debuff:[],info:""}, buff:[],debuff:[],info:""},
5005:{uuid:5005,name:"绿箭",path:"ha1", fac:FacSet.HERO, kind:2, 5005:{uuid:5005,name:"绿箭",path:"ha1", fac:FacSet.HERO, kind:2,
type:HType.remote,lv:1,hp:100,mp:100,map:100,def:5,ap:15,dis:400,cd:1,speed:100,skills:[6001,6001], type:HType.remote,lv:1,hp:100,mp:100,map:100,def:5,ap:15,dis:400,cd:1,speed:100,skills:[6001,6005],
buff:[],debuff:[],info:""}, buff:[],debuff:[],info:""},
5007:{uuid:5007,name:"牧师",path:"hmh1", fac:FacSet.HERO, kind:2, 5007:{uuid:5007,name:"牧师",path:"hmh1", fac:FacSet.HERO, kind:2,
type:HType.mage,lv:1,hp:100,mp:100,map:100,def:5,ap:15,dis:400,cd:1,speed:100,skills:[6001,6001], type:HType.mage,lv:1,hp:100,mp:100,map:100,def:5,ap:15,dis:400,cd:1,speed:100,skills:[6001,6005],
buff:[],debuff:[],info:""}, buff:[],debuff:[],info:""},
5008:{uuid:5008,name:"火女",path:"hmf1", fac:FacSet.HERO, kind:2, 5008:{uuid:5008,name:"火女",path:"hmf1", fac:FacSet.HERO, kind:2,
type:HType.mage,lv:1,hp:100,mp:100,map:100,def:5,ap:15,dis:400,cd:1.5,speed:100,skills:[6001,6001], type:HType.mage,lv:1,hp:100,mp:100,map:100,def:5,ap:15,dis:400,cd:1.5,speed:100,skills:[6001,6005],
buff:[],debuff:[],info:""}, buff:[],debuff:[],info:""},
// 5009:{uuid:5009,name:"风暴精灵",path:"hk1", fac:FacSet.HERO, kind:2, // 5009:{uuid:5009,name:"风暴精灵",path:"hk1", fac:FacSet.HERO, kind:2,
@@ -143,66 +143,66 @@ export const HeroInfo: Record<number, heroInfo> = {
//怪物 //怪物
5201:{uuid:5201,name:"兽人战士",path:"mo1", fac:FacSet.MON, kind:1, 5201:{uuid:5201,name:"兽人战士",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.warrior,lv:1,hp:25,mp:100,map:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001,6001], type:HType.warrior,lv:1,hp:25,mp:100,map:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6005],
buff:[],debuff:[],info:"普通怪物-战士型"}, buff:[],debuff:[],info:"普通怪物-战士型"},
5202:{uuid:5202,name:"兽人刺客",path:"mo1", fac:FacSet.MON, kind:1, 5202:{uuid:5202,name:"兽人刺客",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.remote,lv:1,hp:20,mp:100,map:100,def:5,ap:5,dis:350,cd:1,speed:100,skills:[6001,6001], type:HType.remote,lv:1,hp:20,mp:100,map:100,def:5,ap:5,dis:350,cd:1,speed:100,skills:[6005],
buff:[],debuff:[],info:"普通怪物-战士型"}, buff:[],debuff:[],info:"普通怪物-战士型"},
5203:{uuid:5203,name:"兽人护卫",path:"mo1", fac:FacSet.MON, kind:1, 5203:{uuid:5203,name:"兽人护卫",path:"mo3", fac:FacSet.MON, kind:1,
type:HType.warrior,lv:1,hp:25,mp:100,map:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001,6001], type:HType.warrior,lv:1,hp:25,mp:100,map:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6005],
buff:[],debuff:[],info:"普通怪物-战士型"}, buff:[],debuff:[],info:"普通怪物-战士型"},
5204:{uuid:5204,name:"石卫", path:"mo1", fac:FacSet.MON, kind:1, // 5204:{uuid:5204,name:"石卫", path:"mo1", fac:FacSet.MON, kind:1,
type:HType.mage,lv:1,hp:18,mp:100,map:100,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6001,6001], // type:HType.mage,lv:1,hp:18,mp:100,map:100,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6001,6005],
buff:[],debuff:[],info:"法师怪物-高伤害脆弱"}, // buff:[],debuff:[],info:"法师怪物-高伤害脆弱"},
5205:{uuid:5205,name:"土卫", path:"mo1", fac:FacSet.MON, kind:1, // 5205:{uuid:5205,name:"土卫", path:"mo1", fac:FacSet.MON, kind:1,
type:HType.mage,lv:1,hp:18,mp:100,map:100,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6001,6001], // type:HType.mage,lv:1,hp:18,mp:100,map:100,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6001,6005],
buff:[],debuff:[],info:"法师怪物-高伤害脆弱"}, // buff:[],debuff:[],info:"法师怪物-高伤害脆弱"},
5206:{uuid:5206,name:"树卫", path:"mo1", fac:FacSet.MON, kind:1, // 5206:{uuid:5206,name:"树卫", path:"mo1", fac:FacSet.MON, kind:1,
type:HType.mage,lv:1,hp:18,mp:100,map:100,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6001,6001], // type:HType.mage,lv:1,hp:18,mp:100,map:100,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6001,6005],
buff:[],debuff:[],info:"法师怪物-高伤害脆弱"}, // buff:[],debuff:[],info:"法师怪物-高伤害脆弱"},
5219:{uuid:5219,name:"牛头战士",path:"mo1", fac:FacSet.MON,kind:1, // 5219:{uuid:5219,name:"牛头战士",path:"mo1", fac:FacSet.MON,kind:1,
type:HType.warrior,lv:1,hp:25,mp:100,map:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001,6001], // type:HType.warrior,lv:1,hp:25,mp:100,map:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001,6005],
buff:[],debuff:[],info:"普通怪物-战士型"}, // buff:[],debuff:[],info:"普通怪物-战士型"},
5220:{uuid:5220,name:"牛头战士",path:"mo1", fac:FacSet.MON, kind:1, // 5220:{uuid:5220,name:"牛头战士",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.warrior,lv:1,hp:25,mp:100,map:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001,6001], // type:HType.warrior,lv:1,hp:25,mp:100,map:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001,6005],
buff:[],debuff:[],info:"普通怪物-战士型"}, // buff:[],debuff:[],info:"普通怪物-战士型"},
5221:{uuid:5221,name:"牛头战士",path:"mo1", fac:FacSet.MON, kind:1, // 5221:{uuid:5221,name:"牛头战士",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.remote,lv:1,hp:20,mp:100,map:100,def:5,ap:5,dis:350,cd:1.5,speed:100,skills:[6001,6001], // type:HType.remote,lv:1,hp:20,mp:100,map:100,def:5,ap:5,dis:350,cd:1.5,speed:100,skills:[6001,6005],
buff:[],debuff:[],info:"普通怪物-战士型"}, // buff:[],debuff:[],info:"普通怪物-战士型"},
5222:{uuid:5222,name:"独眼巨人",path:"mo1", fac:FacSet.MON, kind:1, // 5222:{uuid:5222,name:"独眼巨人",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.warrior,lv:1,hp:25,mp:100,map:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001,6001], // type:HType.warrior,lv:1,hp:25,mp:100,map:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001,6005],
buff:[],debuff:[],info:"普通怪物-战士型"}, // buff:[],debuff:[],info:"普通怪物-战士型"},
5223:{uuid:5223,name:"独眼巨人",path:"mo1", fac:FacSet.MON, kind:1, // 5223:{uuid:5223,name:"独眼巨人",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.warrior,lv:1,hp:25,mp:100,map:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001,6001], // type:HType.warrior,lv:1,hp:25,mp:100,map:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001,6005],
buff:[],debuff:[],info:"普通怪物-战士型"}, // buff:[],debuff:[],info:"普通怪物-战士型"},
5224:{uuid:5224,name:"独眼巨人",path:"mo1", fac:FacSet.MON, kind:1, // 5224:{uuid:5224,name:"独眼巨人",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.remote,lv:1,hp:20,mp:100,map:100,def:5,ap:5,dis:350,cd:1.5,speed:100,skills:[6001,6001], // type:HType.remote,lv:1,hp:20,mp:100,map:100,def:5,ap:5,dis:350,cd:1.5,speed:100,skills:[6001,6005],
buff:[],debuff:[],info:"普通怪物-战士型"}, // buff:[],debuff:[],info:"普通怪物-战士型"},
5225:{uuid:5225,name:"精英独眼",path:"mo1", fac:FacSet.MON, kind:1, // 5225:{uuid:5225,name:"精英独眼",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.warrior,lv:1,hp:45,mp:100,map:100,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6001], // type:HType.warrior,lv:1,hp:45,mp:100,map:100,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6001],
buff:[],debuff:[],info:"精英怪物-战士型"}, // buff:[],debuff:[],info:"精英怪物-战士型"},
5226:{uuid:5226,name:"精英牛头",path:"mo1", fac:FacSet.MON, kind:1, // 5226:{uuid:5226,name:"精英牛头",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.warrior,lv:1,hp:45,mp:100,map:100,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6001,6001], // type:HType.warrior,lv:1,hp:45,mp:100,map:100,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6001,6005],
buff:[],debuff:[],info:"精英怪物-战士型"}, // buff:[],debuff:[],info:"精英怪物-战士型"},
5227:{uuid:5227,name:"精英兽人",path:"mo1", fac:FacSet.MON, kind:1, // 5227:{uuid:5227,name:"精英兽人",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.warrior,lv:1,hp:45,mp:100,map:100,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6001,6001], // type:HType.warrior,lv:1,hp:45,mp:100,map:100,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6001,6005],
buff:[],debuff:[],info:"精英怪物-战士型"}, // buff:[],debuff:[],info:"精英怪物-战士型"},
}; };

View File

@@ -91,6 +91,12 @@ export class BuffComp extends Component {
// this.node.getChildByName("top").getChildByName("hp").active = (hp == hp_max) ? false : true; // this.node.getChildByName("top").getChildByName("hp").active = (hp == hp_max) ? false : true;
} }
mp_show(mp:number,mp_max:number){
this.node.getChildByName("top").getChildByName("pow").getComponent(ProgressBar).progress = mp/mp_max;
this.scheduleOnce(()=>{
this.node.getChildByName("top").getChildByName("pow").getChildByName("mpb").getComponent(ProgressBar).progress = mp/mp_max;
},0.15)
}
update_info_lv(){ update_info_lv(){

View File

@@ -120,7 +120,7 @@ export class HeroViewComp extends CCComp {
} }
/* 显示角色血*/ /* 显示角色血*/
this.node.getChildByName("top").getChildByName("hp").active = true; this.node.getChildByName("top").getChildByName("hp").active = true;
this.BUFFCOMP.show_shield(this.shield,this.Attrs[Attrs.SHIELD_MAX]) this.node.getChildByName("top").getChildByName("pow").active = true;
} }
// ==================== BUFF系统初始==================== // ==================== BUFF系统初始====================
@@ -494,12 +494,16 @@ export class HeroViewComp extends CCComp {
this.processDamageQueue(); this.processDamageQueue();
// 更新临时 buff/debuff 时间 // 更新临时 buff/debuff 时间
this.updateTemporaryBuffsDebuffs(dt); this.updateTemporaryBuffsDebuffs(dt);
this.BUFFCOMP.hp_show(this.hp,this.Attrs[Attrs.HP_MAX])
this.BUFFCOMP.mp_show(this.mp,this.Attrs[Attrs.MP_MAX])
this.BUFFCOMP.show_shield(this.shield,this.Attrs[Attrs.SHIELD_MAX])
} }
BaseUp(dt:number){ BaseUp(dt:number){
this.mp += HeroUpSet.MP*dt this.mp += HeroUpSet.MP*dt
this.hp += HeroUpSet.HP*dt this.hp += HeroUpSet.HP*dt
if(this.mp > this.Attrs[Attrs.MP_MAX]) this.mp = this.Attrs[Attrs.MP_MAX] if(this.mp > this.Attrs[Attrs.MP_MAX]) this.mp = this.Attrs[Attrs.MP_MAX]
if(this.hp > this.Attrs[Attrs.HP_MAX]) this.hp = this.Attrs[Attrs.HP_MAX] if(this.hp > this.Attrs[Attrs.HP_MAX]) this.hp = this.Attrs[Attrs.HP_MAX]
} }
do_fight_end(){ do_fight_end(){
this.as.do_buff() this.as.do_buff()
@@ -587,23 +591,15 @@ export class HeroViewComp extends CCComp {
} }
do_atked(remainingDamage:number, do_atked(remainingDamage:number,CAttrs:any,s_uuid:number){
crit:number=0,crit_d:number=0, let SConf=SkillSet[s_uuid]
burn_count:number=0,burn_value:number=0,
stun_time:number=0,stun_ratio:number=0,
frost_time:number=0,frost_ratio:number=0,
atked_anm:string="atked"
){
this.do_atked_trigger() this.do_atked_trigger()
if(this.check_dodge()) return if(this.check_dodge()) return
let is_crit = this.check_crit(crit) let is_crit = this.check_crit(CAttrs[Attrs.CRITICAL])
if(this == null) return; if(this == null) return;
let damage = this.count_damage(remainingDamage) let damage = this.count_damage(remainingDamage)
if(is_crit) { if(is_crit) {
damage = Math.floor(damage * (1 + (FightSet.CRIT_DAMAGE+crit_d)/100)) damage = Math.floor(damage * (1 + (FightSet.CRIT_DAMAGE+CAttrs[Attrs.CRITICAL_DMG])/100))
} }
// console.log(this.hero_name+"[HeroViewComp]:heroview :damage|hp|hp_max",damage,this.hp,this.Attrs[BuffAttr.HP_MAX]) // console.log(this.hero_name+"[HeroViewComp]:heroview :damage|hp|hp_max",damage,this.hp,this.Attrs[BuffAttr.HP_MAX])
damage=this.check_shield(damage) damage=this.check_shield(damage)
@@ -625,12 +621,9 @@ export class HeroViewComp extends CCComp {
} }
} }
// this.update_vm // this.update_vm
this.back() this.back()
this.showDamage(damage, is_crit,atked_anm); this.showDamage(damage, is_crit,SConf.AtkedType);
} }
//后退 //后退
back(){ back(){

View File

@@ -30,7 +30,7 @@ export class Monster extends ecs.Entity {
} }
/** 加载角色 */ /** 加载角色 */
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,is_boss:boolean=false,is_call:boolean=false,enhancement?: any, stageMultipliers?: any) { load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,is_boss:boolean=false,is_call:boolean=false) {
scale=-1 scale=-1
let box_group=BoxSet.MONSTER let box_group=BoxSet.MONSTER
// console.log("mon load",uuid) // console.log("mon load",uuid)
@@ -45,7 +45,7 @@ export class Monster extends ecs.Entity {
const collider = node.getComponent(BoxCollider2D); const collider = node.getComponent(BoxCollider2D);
if (collider) collider.enabled = false; // 先禁用 // 延迟一帧启用碰撞体 if (collider) collider.enabled = false; // 先禁用 // 延迟一帧启用碰撞体
node.setPosition(pos) node.setPosition(pos)
this.hero_init(uuid,node,scale,box_group,is_boss,is_call,enhancement,stageMultipliers) this.hero_init(uuid,node,scale,box_group,is_boss,is_call)
oops.message.dispatchEvent("monster_load",this) oops.message.dispatchEvent("monster_load",this)
// 初始化移动参数 // 初始化移动参数
@@ -62,7 +62,7 @@ export class Monster extends ecs.Entity {
node.parent = scene.entityLayer!.node! node.parent = scene.entityLayer!.node!
node.setPosition(pos) node.setPosition(pos)
} }
hero_init(uuid:number=1001,node:Node,scale:number=1,box_group=BoxSet.HERO,is_boss:boolean=false,is_call:boolean=false,enhancement?: any, stageMultipliers?: any) { hero_init(uuid:number=1001,node:Node,scale:number=1,box_group=BoxSet.HERO,is_boss:boolean=false,is_call:boolean=false) {
var hv = node.getComponent(HeroViewComp)!; var hv = node.getComponent(HeroViewComp)!;
@@ -80,28 +80,18 @@ export class Monster extends ecs.Entity {
hv.hero_uuid= uuid; hv.hero_uuid= uuid;
hv.hero_name= hero.name; hv.hero_name= hero.name;
// 初始化Attrs属性系统参考Hero.ts的实 // 初始化基础属性
// 计算基础属性(使用关卡倍数)
const baseHp = hero.hp; const baseHp = hero.hp;
const baseAp = hero.ap; const baseAp = hero.ap;
// 应用关卡倍数
let finalHp = baseHp;
let finalAp = baseAp;
if (stageMultipliers) {
finalHp = Math.floor(baseHp * stageMultipliers.hp);
finalAp = Math.floor(baseAp * stageMultipliers.attack);
// console.log(`[Monster]: 怪物${hero.name} 关卡倍数 - HP: ${baseHp} x ${stageMultipliers.hp.toFixed(2)} = ${finalHp}, AP: ${baseAp} x ${stageMultipliers.attack.toFixed(2)} = ${finalAp}`);
}
for(let i=0;i<hero.skills.length;i++){ for(let i=0;i<hero.skills.length;i++){
let skill={ uuid:SkillSet[hero.skills[i]].uuid, cd_max:SkillSet[hero.skills[i]].cd,cost:SkillSet[hero.skills[i]].cost,cd:0 } let skill={ uuid:SkillSet[hero.skills[i]].uuid, cd_max:SkillSet[hero.skills[i]].cd,cost:SkillSet[hero.skills[i]].cost,cd:0 }
hv.skills.push(skill) hv.skills.push(skill)
} }
hv.base_ap=finalAp hv.base_ap=baseAp
hv.base_map=hero.mp hv.base_map=hero.mp
hv.base_def=hero.def hv.base_def=hero.def
hv.base_hp=finalHp hv.base_hp=baseHp
hv.base_mp=hero.mp hv.base_mp=hero.mp
hv.hp=hv.base_hp hv.hp=hv.base_hp
hv.mp=hv.base_mp hv.mp=hv.base_mp
@@ -116,8 +106,6 @@ export class Monster extends ecs.Entity {
// 初始化 buff/debuff 系统 // 初始化 buff/debuff 系统
hv.initAttrs(); hv.initAttrs();
this.add(hv); this.add(hv);
} }

View File

@@ -7,11 +7,8 @@ import { smc } from "../common/SingletonModuleComp";
import { GameEvent } from "../common/config/GameEvent"; import { GameEvent } from "../common/config/GameEvent";
// 导入肉鸽配置 // 导入肉鸽配置
import { import {
generateStageConfig, getStageMonsterConfigs,
getStageMonsterConfigs,
getStageAllMultipliers,
MonsterType, MonsterType,
StageType,
getStageType getStageType
} from "./RogueConfig"; } from "./RogueConfig";
import { MonModelComp } from "../hero/MonModelComp"; import { MonModelComp } from "../hero/MonModelComp";
@@ -21,14 +18,13 @@ const { ccclass, property } = _decorator;
/** 视图层对象 */ /** 视图层对象 */
@ccclass('MissionMonCompComp') @ccclass('MissionMonCompComp')
@ecs.register('MissionMonComp', false) @ecs.register('MissionMonComp', false)
export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使用新的RogueConfig格式 export class MissionMonCompComp extends CCComp {
// 添加刷怪队列 - 使用新的RogueConfig格式
private monsterQueue: Array<{ private monsterQueue: Array<{
uuid: number, uuid: number,
position: number, position: number,
type: MonsterType, type: MonsterType,
level: number, level: number
enhancement?: any, // 增强属性配置
stageMultipliers?: any // 关卡倍数配置
}> = []; }> = [];
private isSpawning: boolean = false;// 是否正在生成怪物 private isSpawning: boolean = false;// 是否正在生成怪物
private spawnInterval: number = 0.1; // 每个怪物生成间隔时间 private spawnInterval: number = 0.1; // 每个怪物生成间隔时间
@@ -41,8 +37,8 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使
onLoad(){ onLoad(){
this.on(GameEvent.FightReady,this.fight_ready,this) this.on(GameEvent.FightReady,this.fight_ready,this)
this.on(GameEvent.NewWave,this.fight_ready,this) this.on(GameEvent.NewWave,this.fight_ready,this)
} }
/** 视图层逻辑代码分离演示 */ /** 视图层逻辑代码分离演示 */
start() { start() {
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象 // var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
@@ -55,7 +51,6 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使
this.do_mon_wave() this.do_mon_wave()
} }
protected update(dt: number): void { protected update(dt: number): void {
if(!smc.mission.play||smc.mission.pause) return if(!smc.mission.play||smc.mission.pause) return
@@ -90,7 +85,6 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使
} }
} }
do_mon_wave(){ do_mon_wave(){
// 重置召唤相关状态 // 重置召唤相关状态
this.spawnCount = 0; this.spawnCount = 0;
@@ -120,7 +114,7 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使
// 为每个怪物配置生成怪物 // 为每个怪物配置生成怪物
monsterConfigs.forEach((monsterConfig: any, index: number) => { monsterConfigs.forEach((monsterConfig: any, index: number) => {
const { uuid, type, enhancement, stageMultipliers } = monsterConfig; const { uuid, type } = monsterConfig;
// 位置循环使用 (0-4) // 位置循环使用 (0-4)
const position = index % 5; const position = index % 5;
@@ -129,21 +123,11 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使
uuid, uuid,
position, position,
type, type,
1, // 默认等级1 1 // 默认等级1
enhancement,
stageMultipliers
); );
}); });
// console.log(`[MissionMonComp]:关卡${currentStage}将生成 ${monsterConfigs.length} 只怪物`); // console.log(`[MissionMonComp]:关卡${currentStage}将生成 ${monsterConfigs.length} 只怪物`);
// 输出增强属性信息
monsterConfigs.forEach((monsterConfig: any) => {
if (monsterConfig.enhancement && monsterConfig.enhancement.buffList.length > 0) {
// console.log(`[MissionMonComp]:怪物 ${monsterConfig.uuid} (${monsterConfig.type}) 拥有增强属性:`,
// monsterConfig.enhancement.buffList.map((buff: any) => `${buff.name}:+${buff.value}`));
}
});
} }
// 添加到关卡刷怪队列 - 使用新的配置格式 // 添加到关卡刷怪队列 - 使用新的配置格式
@@ -151,17 +135,13 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使
uuid: number, uuid: number,
position: number, position: number,
type: MonsterType, type: MonsterType,
level: number = 1, level: number = 1
enhancement?: any,
stageMultipliers?: any
) { ) {
this.monsterQueue.push({ this.monsterQueue.push({
uuid: uuid, uuid: uuid,
position: position, position: position,
type: type, type: type,
level: level, level: level
enhancement: enhancement,
stageMultipliers: stageMultipliers
}); });
} }
@@ -178,9 +158,7 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使
monsterData.position, monsterData.position,
isBoss, isBoss,
false, false,
monsterData.level, monsterData.level
monsterData.enhancement,
monsterData.stageMultipliers
); );
// 增加召唤计数 // 增加召唤计数
@@ -194,28 +172,16 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使
i: number = 0, i: number = 0,
is_boss: boolean = false, is_boss: boolean = false,
is_call: boolean = false, is_call: boolean = false,
lv: number = 1, lv: number = 1
enhancement?: any,
stageMultipliers?: any
) { ) {
let mon = ecs.getEntity<Monster>(Monster); let mon = ecs.getEntity<Monster>(Monster);
let scale = -1; let scale = -1;
let pos: Vec3 = v3(MonSet[i].pos); let pos: Vec3 = v3(MonSet[i].pos);
// 生成怪物,传递增强属性和关卡倍数 // 生成怪物
mon.load(pos,scale,uuid,is_boss,is_call,enhancement, stageMultipliers); mon.load(pos,scale,uuid,is_boss,is_call);
// 如果有增强属性,记录到控制台
if (enhancement && enhancement.buffList && enhancement.buffList.length > 0) {
// console.log(`[MissionMonComp]: 怪物 ${uuid} 获得增强属性:`,
// enhancement.buffList.map((buff: any) => `${buff.name}:+${buff.value}`));
}
// 如果有关卡倍数,记录到控制台
if (stageMultipliers) {
// console.log(`[MissionMonComp]: 怪物 ${uuid} 关卡倍数 - HP: x${stageMultipliers.hp.toFixed(2)}, 攻击: x${stageMultipliers.attack.toFixed(2)}`);
}
} }
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() { reset() {
// this.node.destroy(); // this.node.destroy();

View File

@@ -2,17 +2,14 @@
* 肉鸽模式配置脚本 - 简化版 * 肉鸽模式配置脚本 - 简化版
* *
* 功能说明: * 功能说明:
* - 提供基于怪物类型的属性加成配置 * - 提供基础的刷怪配置:刷什么怪,刷多少怪
* - 使用Attrs枚举定义属性增强
* - 供游戏系统调用获取怪物增强数据
* *
* @author 游戏开发团队 * @author 游戏开发团队
* @version 3.0 简化版 * @version 1.0 简化版
* @date 2025-07-12 * @date 2025-10-19
*/ */
import { QualitySet } from "../common/config/BoxSet"; import { QualitySet } from "../common/config/BoxSet";
import { Attrs } from "../common/config/SkillSet";
import { getMonList } from "../common/config/heroSet"; import { getMonList } from "../common/config/heroSet";
/** /**
@@ -24,199 +21,48 @@ export enum MonsterType {
BOSS = "boss" // Boss怪物 BOSS = "boss" // Boss怪物
} }
/**
* 怪物类型增强属性个数配置
*/
export const MonsterEnhancementCountConfig = {
[MonsterType.NORMAL]: 0, // 普通怪物0个增强属性
[MonsterType.ELITE]: 1, // 精英怪物1个增强属性
[MonsterType.BOSS]: 2 // Boss怪物2个增强属性
};
/** /**
* 关卡类型枚举 * 关卡类型枚举
*/ */
export enum StageType { export enum StageType {
NORMAL = "normal", // 普通关卡1-4关 NORMAL = "normal", // 普通关卡
ELITE = "elite", // 精英关卡5关 ELITE = "elite", // 精英关卡
BOSS = "boss" // Boss关卡10关 BOSS = "boss" // Boss关卡
} }
/** /**
* 关卡配置数据接口 * 关卡配置规则 - 只保留刷怪类型和数量
*/
export interface StageConfig {
stageNumber: number;
stageType: StageType;
description: string;
monsters: Array<{
type: MonsterType;
count: number;
}>;
}
/**
* 关卡配置规则
*/ */
export const StageConfigRules = { export const StageConfigRules = {
// 普通关卡1-4关 // 普通关卡
[StageType.NORMAL]: { [StageType.NORMAL]: {
description: "普通关卡", description: "普通关卡",
monsters: [ monsters: [
{ type: MonsterType.NORMAL, count: 5 } // 5个小怪 { type: MonsterType.NORMAL, count: 1 } // 5个普通怪物
] ]
}, },
// 精英关卡5关 // 精英关卡
[StageType.ELITE]: { [StageType.ELITE]: {
description: "精英关卡", description: "精英关卡",
monsters: [ monsters: [
{ type: MonsterType.ELITE, count: 2 }, // 2个精英 { type: MonsterType.ELITE, count: 1 }, // 2个精英怪物
{ type: MonsterType.NORMAL, count: 3 } // 3个小怪 { type: MonsterType.NORMAL, count: 1 } // 3个普通怪物
] ]
}, },
// Boss关卡10关 // Boss关卡
[StageType.BOSS]: { [StageType.BOSS]: {
description: "Boss关卡", description: "Boss关卡",
monsters: [ monsters: [
{ type: MonsterType.BOSS, count: 1 }, // 1个Boss { type: MonsterType.BOSS, count: 1 }, // 1个Boss怪物
{ type: MonsterType.ELITE, count: 2 }, // 2个精英 { type: MonsterType.ELITE, count: 1 }, // 2个精英怪物
{ type: MonsterType.NORMAL, count: 2 } // 2个小怪 { type: MonsterType.NORMAL, count: 1 } // 2个普通怪物
] ]
} }
}; };
/** /**
* 可用的增强属性池
* 按权重排序,数值越大优先级越高
*/
export const AvailableEnhancementPool = [
{ buffType: Attrs.HP_MAX, weight: 10, baseValue: 80, name: "生命值增强" },
{ buffType: Attrs.AP, weight: 9, baseValue: 50, name: "攻击力增强" },
{ buffType: Attrs.CRITICAL, weight: 8, baseValue: 30, name: "暴击率增强" },
{ buffType: Attrs.DEF, weight: 7, baseValue: 40, name: "防御增强" },
{ buffType: Attrs.CRITICAL_DMG, weight: 6, baseValue: 60, name: "暴击伤害增强" },
{ buffType: Attrs.DODGE, weight: 5, baseValue: 25, name: "闪避增强" },
{ buffType: Attrs.AS, weight: 4, baseValue: 20, name: "攻击速度增强" },
{ buffType: Attrs.LIFESTEAL, weight: 3, baseValue: 15, name: "吸血" },
];
/**
* 基于怪物类型的基础配置
*/
export const MonsterTypeBaseConfig = {
[MonsterType.NORMAL]: {
name: "普通怪物",
description: "基础属性无增强"
},
[MonsterType.ELITE]: {
name: "精英怪物",
description: "单一属性增强"
},
[MonsterType.BOSS]: {
name: "Boss怪物",
description: "双重属性增强"
}
};
/**
* 怪物增强数据接口
*/
export interface MonsterEnhancementData {
name: string;
description: string;
buffs: { [key in Attrs]?: number };
buffList: Array<{ buffType: Attrs; value: number; name: string }>;
}
/**
* 根据权重随机选择增强属性
* @param count 需要选择的属性个数
* @param excludeTypes 排除的属性类型
* @returns 选中的增强属性数组
*/
export function selectRandomEnhancements(count: number, excludeTypes: Attrs[] = []): Array<{buffType: Attrs, weight: number, baseValue: number, name: string}> {
if (count <= 0) return [];
// 过滤掉排除的属性类型
const availablePool = AvailableEnhancementPool.filter(item => !excludeTypes.includes(item.buffType));
if (availablePool.length === 0) return [];
const selectedEnhancements = [];
const usedTypes = new Set<Attrs>();
for (let i = 0; i < count && i < availablePool.length; i++) {
// 计算权重总和
const totalWeight = availablePool
.filter(item => !usedTypes.has(item.buffType))
.reduce((sum, item) => sum + item.weight, 0);
if (totalWeight === 0) break;
// 随机选择
let randomValue = Math.random() * totalWeight;
for (const enhancement of availablePool) {
if (usedTypes.has(enhancement.buffType)) continue;
randomValue -= enhancement.weight;
if (randomValue <= 0) {
selectedEnhancements.push(enhancement);
usedTypes.add(enhancement.buffType);
break;
}
}
}
return selectedEnhancements;
}
/**
* 获取怪物类型的属性加成配置
* @param monsterType 怪物类型
* @param useRandom 是否使用随机生成默认true
* @returns 属性加成配置包含buffs字段
*/
export function getMonsterEnhancement(monsterType: MonsterType, useRandom: boolean = true): MonsterEnhancementData {
const baseConfig = MonsterTypeBaseConfig[monsterType];
const enhancementCount = MonsterEnhancementCountConfig[monsterType];
let selectedEnhancements: Array<{buffType: Attrs, weight: number, baseValue: number, name: string}> = [];
if (useRandom) {
// 随机生成增强属性
selectedEnhancements = selectRandomEnhancements(enhancementCount);
} else {
// 使用固定的最高权重属性
selectedEnhancements = AvailableEnhancementPool
.slice(0, enhancementCount)
.map(item => ({...item}));
}
// 构建buffs对象
const buffs: { [key in Attrs]?: number } = {};
const buffList: Array<{ buffType: Attrs; value: number; name: string }> = [];
selectedEnhancements.forEach(enhancement => {
buffs[enhancement.buffType] = enhancement.baseValue;
buffList.push({
buffType: enhancement.buffType,
value: enhancement.baseValue,
name: enhancement.name
});
});
return {
name: baseConfig.name,
description: `${baseConfig.description} (${enhancementCount}个属性)`,
buffs: buffs,
buffList: buffList
};
}
/**
* 根据关卡号和等级判断关卡类型 * 根据关卡号和等级判断关卡类型
* @param stageNumber 关卡号从1开始 * @param stageNumber 关卡号从1开始
* @param level 等级1-5 * @param level 等级1-5
@@ -308,90 +154,28 @@ export function getStageMonsterUUIDs(stageNumber: number, level: number = 1): nu
} }
/** /**
* 获取关卡怪物配置包含UUID和增强属性 * 获取关卡怪物配置(包含UUID
* @param stageNumber 关卡号 * @param stageNumber 关卡号
* @param level 等级1-5 * @param level 等级1-5
* @param useRandomBuff 是否使用随机buff * @returns 怪物配置数组
* @returns 完整的怪物配置数组
*/ */
export function getStageMonsterConfigs(stageNumber: number, level: number = 1, useRandomBuff: boolean = true) { export function getStageMonsterConfigs(stageNumber: number, level: number = 1) {
const monsterTypes = generateStageConfig(stageNumber, level); const monsterTypes = generateStageConfig(stageNumber, level);
const stageMultipliers = getStageAllMultipliers(stageNumber);
const monsterConfigs = []; const monsterConfigs = [];
monsterTypes.forEach((monsterType, index) => { monsterTypes.forEach((monsterType, index) => {
const availableUUIDs = getMonsterUUIDsByType(monsterType); const availableUUIDs = getMonsterUUIDsByType(monsterType);
if (availableUUIDs.length > 0) { if (availableUUIDs.length > 0) {
const randomUUID = availableUUIDs[Math.floor(Math.random() * availableUUIDs.length)]; const randomUUID = availableUUIDs[Math.floor(Math.random() * availableUUIDs.length)];
const enhancement = getMonsterEnhancement(monsterType, useRandomBuff);
monsterConfigs.push({ monsterConfigs.push({
id: `stage_${stageNumber}_level_${level}_${index}`,
uuid: randomUUID, uuid: randomUUID,
type: monsterType, type: monsterType,
stageNumber: stageNumber, stageNumber: stageNumber,
level: level, level: level
enhancement: enhancement,
stageMultipliers: stageMultipliers
}); });
} }
}); });
return monsterConfigs; return monsterConfigs;
} }
/**
* 关卡基础属性倍数配置
*/
export const StageMultiplierConfig = {
// 每级提升的基础倍数
baseMultiplierPerLevel: 0.05, // 每级基础属性提升5%
// 每10级的大幅提升倍数
bigBoostMultiplier: 0.3, // 每10级额外提升30%
// 不同属性的提升权重
attributeWeights: {
hp: 1.2, // 生命值提升权重较高
attack: 1.0, // 攻击力标准权重
}
};
/**
* 计算关卡的基础属性倍数
* @param stageNumber 关卡号从1开始
* @param attributeType 属性类型hp, attack
* @returns 属性倍数
*/
export function calculateStageMultiplier(stageNumber: number, attributeType: 'hp' | 'attack'): number {
const config = StageMultiplierConfig;
// 基础倍数1.0第1关不变
let multiplier = 1.0;
// 每级小提升:(关卡-1) * 每级提升率 * 属性权重
const levelBoost = (stageNumber - 1) * config.baseMultiplierPerLevel * config.attributeWeights[attributeType];
// 每10级大提升向下取整(关卡/10) * 大幅提升率 * 属性权重
const bigBoostCount = Math.floor(stageNumber / 10);
const bigBoost = bigBoostCount * config.bigBoostMultiplier * config.attributeWeights[attributeType];
multiplier += levelBoost + bigBoost;
return multiplier;
}
/**
* 获取关卡所有属性的倍数
* @param stageNumber 关卡号
* @returns 所有属性倍数对象
*/
export function getStageAllMultipliers(stageNumber: number) {
return {
stageNumber: stageNumber,
hp: calculateStageMultiplier(stageNumber, 'hp'),
attack: calculateStageMultiplier(stageNumber, 'attack'),
description: `${stageNumber}关基础属性倍数`
};
}

View File

@@ -1,8 +1,8 @@
import { _decorator, Animation, CCBoolean, Collider2D, Contact2DType, Tween, v3, Vec3 } from "cc"; import { _decorator, Animation, CCBoolean, Collider2D, Contact2DType, Tween, UITransform, v3, Vec3 } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { BezierMove } from "../BezierMove/BezierMove"; import { BezierMove } from "../BezierMove/BezierMove";
import { DTType, EType, SkillSet, SType } from "../common/config/SkillSet"; import { Attrs, DTType, EType, SkillSet, SType } from "../common/config/SkillSet";
import { BoxSet, FacSet } from "../common/config/BoxSet"; import { BoxSet, FacSet } from "../common/config/BoxSet";
import { HeroViewComp } from "../hero/HeroViewComp"; import { HeroViewComp } from "../hero/HeroViewComp";
import { GameEvent } from "../common/config/GameEvent"; import { GameEvent } from "../common/config/GameEvent";
@@ -28,6 +28,7 @@ export class AtkConCom extends CCComp {
run_time:number = 0; run_time:number = 0;
// 战斗相关运行时数据 // 战斗相关运行时数据
Attrs:any=null Attrs:any=null
hit_count:number = 0;
// 组件引用 // 组件引用
anim:Animation=null; anim:Animation=null;
tweenInstance:Tween<any> = null; tweenInstance:Tween<any> = null;
@@ -133,29 +134,16 @@ export class AtkConCom extends CCComp {
// if(this.hit_count > 0&&!is_range) this.ap=this.ap*(50+this.puncture_damage)/100 // 穿刺后 伤害减半,过滤范围伤害 // if(this.hit_count > 0&&!is_range) this.ap=this.ap*(50+this.puncture_damage)/100 // 穿刺后 伤害减半,过滤范围伤害
if(target == null) return; if(target == null) return;
if (!this.Config) return; if (!this.Config) return;
// let ap=this.ap let damage=Math.floor(this.Attrs[Attrs.AP]*(SkillSet[this.s_uuid].ap/100))
// if(this.hit_count > 0 &&!is_range ){ if(this.hit_count > 0 &&!is_range ){
// ap=ap*(50+this.puncture_damage)/100 let Percentage=Math.pow((50+this.Attrs[Attrs.PUNCTURE_DMG])/100, this.hit_count)
// } damage=damage*Percentage
// target.do_atked(ap,this.caster_crit,this.caster_crit_d, }
// this.burn_count,this.burn_value, target.do_atked(damage,this.Attrs,this.s_uuid) // ap 及暴击 属性已经在skill.ts 处理
// this.stun_time,this.stun_ratio, // console.log("[SkillCom]:single_damage t:tp:rtp",this.node.position,this.targetPos,target.node.position)
// this.frost_time,this.frost_ratio, this.hit_count++
// this.Config.AtkedType // console.log("[SkillCom]:碰撞次数:技能次数:穿刺次数",this.hit_count,this.Config.hit,this.puncture)
// ) // ap 及暴击 属性已经在skill.ts 处理 if(this.hit_count>=(this.Config.hit+this.Attrs[Attrs.PUNCTURE])&&(this.Config.DTType!=DTType.range)&&(this.Config.EType!=EType.animationEnd)&&(this.Config.EType!=EType.timeEnd)) this.is_destroy=true // 技能命中次数
// // console.log("[SkillCom]:single_damage t:tp:rtp",this.node.position,this.targetPos,target.node.position)
// if(this.Config.debuff>0){
// let debuff=this.Config
// let dev=debuff.deV*(100+this.debuff_value)/100
// let deR=debuff.deR+this.debuff_up
// dev=Math.round(dev*100)/100
// let deC=debuff.deC+this.debuff_count //dec只作为次数叠加
// // //console.log("[SkillCom]:debuff",this.Config.name,debuff.debuff,deUP.deV,deUP.deC)
// target.add_debuff(debuff.debuff,dev,deC,deR)
// }
// this.hit_count++
// // console.log("[SkillCom]:碰撞次数:技能次数:穿刺次数",this.hit_count,this.Config.hit,this.puncture)
// if(this.hit_count>=(this.Config.hit+this.puncture)&&(this.Config.DTType!=DTType.range)&&(this.Config.EType!=EType.animationEnd)&&(this.Config.EType!=EType.timeEnd)) this.is_destroy=true // 技能命中次数
} }
update(deltaTime: number) { update(deltaTime: number) {
// 确保配置已初始化(处理 update 可能先于 start 执行的情况) // 确保配置已初始化(处理 update 可能先于 start 执行的情况)
@@ -181,7 +169,50 @@ export class AtkConCom extends CCComp {
this.toDestroy(); this.toDestroy();
} }
public atk(args:any){
let dis=this.node.getComponent(UITransform).width/2
let targetsInRange: HeroViewComp[] = []
// 收集范围内所有敌方目标
ecs.query(ecs.allOf(HeroViewComp)).some(e => {
const view = e.get(HeroViewComp);
if(view.fac!=this.fac) {
const distance = Math.abs(this.node.position.x - view.node.position.x);
if(distance <= dis) {
targetsInRange.push(view);
}
}
});
// 根据配置的hit_num决定攻击模式
const hitNum = SkillSet[this.s_uuid].hit_num || 0;
if(hitNum > 0) {
// 限制目标数量按距离排序选择最近的N个目标
if(targetsInRange.length > 0) {
// 按距离排序(从近到远)
targetsInRange.sort((a, b) => {
const distanceA = Math.abs(this.node.position.x - a.node.position.x);
const distanceB = Math.abs(this.node.position.x - b.node.position.x);
return distanceA - distanceB;
});
// 限制目标数量
const maxTargets = Math.min(hitNum, targetsInRange.length);
const selectedTargets = targetsInRange.slice(0, maxTargets);
selectedTargets.forEach(target => {
this.single_damage(target, false);
});
}
} else {
// 范围伤害:对所有范围内目标造成伤害
if(targetsInRange.length > 0) {
targetsInRange.forEach(target => {
this.single_damage(target, false);
});
}
}
}
toDestroy() { toDestroy() {
if(this.is_destroy){ if(this.is_destroy){
if (this.ent) { if (this.ent) {

View File

@@ -1,4 +1,4 @@
import { _decorator, CCBoolean, CCInteger, instantiate, Node, Prefab, v3, Vec3 } from "cc"; import { _decorator, CCBoolean, CCFloat, CCInteger, instantiate, Node, Prefab, v3, Vec3 } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { HeroViewComp } from "../hero/HeroViewComp"; import { HeroViewComp } from "../hero/HeroViewComp";
@@ -17,23 +17,29 @@ export class SkillViewCom extends CCComp {
atkPrefab: Prefab = null! atkPrefab: Prefab = null!
@property @property
hasReady: boolean = false; hasReady: boolean = false;
@property
ReadyLoop: boolean = false // 预备是否循环
@property({ type: CCFloat })
SkillTime: number = 0 // 技能控制存续时间时间
@property({ type: CCFloat })
ReadyTime: number = 0 // 技能前摇时间
@property({ type: CCInteger }) @property({ type: CCInteger })
ReadyTime: number = 0 runType: number = 0 //技能运行类型 0-线性 1-贝塞尔 2-开始位置固定 3-目标位置固定
@property({ type: CCInteger })
runType: number = 0
@property({ type: CCInteger }) @property({ type: CCInteger })
ready_y: number = 0 ready_y: number = 0
@property({ type: CCInteger }) @property({ type: CCInteger })
atk_x: number = 0 atk_x: number = 0
@property({ type: CCInteger }) @property({ type: CCInteger })
atk_y: number = 0 atk_y: number = 0
@property({ type: CCInteger })
s_count:number=1;
@property({ type: CCFloat })
s_interval:number=0.2;
endTime: number = 0; endTime: number = 0;
readyFinish: boolean = false; readyFinish: boolean = false;
caster:HeroViewComp=null!; caster:HeroViewComp=null!;
s_uuid:number=0; s_uuid:number=0;
s_count:number=1;
s_interval:number=0.2;
s_cd:number=0; s_cd:number=0;
scale: number = 0; scale: number = 0;
cName:string=""; cName:string="";
@@ -60,7 +66,7 @@ export class SkillViewCom extends CCComp {
} }
doEnd(dt: number) { doEnd(dt: number) {
this.endTime += dt this.endTime += dt
if(this.endTime >= SkillSet[this.s_uuid].in) { if(this.endTime >= this.SkillTime) {
this.ent.destroy() this.ent.destroy()
} }
} }

View File

@@ -3,7 +3,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { smc } from "../common/SingletonModuleComp"; import { smc } from "../common/SingletonModuleComp";
import { GameEvent } from "../common/config/GameEvent"; import { GameEvent } from "../common/config/GameEvent";
import { AType, DTType, EType, SkillSet, SType, TGroup } from "../common/config/SkillSet"; import { Attrs, AType, DTType, EType, SkillSet, SType, TGroup } from "../common/config/SkillSet";
import { BoxSet, FacSet } from "../common/config/BoxSet"; import { BoxSet, FacSet } from "../common/config/BoxSet";
import { HeroViewComp } from "../hero/HeroViewComp"; import { HeroViewComp } from "../hero/HeroViewComp";
import { BezierMove } from "../BezierMove/BezierMove"; import { BezierMove } from "../BezierMove/BezierMove";
@@ -156,7 +156,7 @@ export class SkillCom extends CCComp {
switch(this.skillConfig.SType){ switch(this.skillConfig.SType){
case SType.shield: case SType.shield:
this.caster.add_shield(this.caster[BuffAttr.HP_MAX]*(100+this.skillConfig.buV/100)) this.caster.add_shield(this.caster[Attrs.HP_MAX]*(100+this.skillConfig.buV/100))
break; break;
} }
} }
@@ -184,7 +184,7 @@ export class SkillCom extends CCComp {
dev=Math.round(dev*100)/100 dev=Math.round(dev*100)/100
let deC=debuff.deC+this.debuff_count //dec只作为次数叠加 let deC=debuff.deC+this.debuff_count //dec只作为次数叠加
// //console.log("[SkillCom]:debuff",this.skillConfig.name,debuff.debuff,deUP.deV,deUP.deC) // //console.log("[SkillCom]:debuff",this.skillConfig.name,debuff.debuff,deUP.deV,deUP.deC)
target.add_debuff(debuff.debuff,dev,deC,deR) target.addDebuff(debuff.debuff)
} }
this.hit_count++ this.hit_count++
// console.log("[SkillCom]:碰撞次数:技能次数:穿刺次数",this.hit_count,this.skillConfig.hit,this.puncture) // console.log("[SkillCom]:碰撞次数:技能次数:穿刺次数",this.hit_count,this.skillConfig.hit,this.puncture)

View File

@@ -4,6 +4,7 @@ import { CCComp } from "../../../../../extensions/oops-plugin-framework/assets/m
import { HeroViewComp } from "../../hero/HeroViewComp"; import { HeroViewComp } from "../../hero/HeroViewComp";
import { SkillCom } from "../SkillCom"; import { SkillCom } from "../SkillCom";
import { AtkConCom } from "../../skill/AtkConCom"; import { AtkConCom } from "../../skill/AtkConCom";
import { SkillSet } from "../../common/config/SkillSet";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
@@ -17,53 +18,7 @@ export class AtkComComp extends CCComp {
// this.on(ModuleEvent.Cmd, this.onHandler, this); // this.on(ModuleEvent.Cmd, this.onHandler, this);
} }
public atk(args:any){
let scom=this.node.getComponent(SkillCom)
let acom=this.node.getComponent(AtkConCom)
let skill=scom?scom:acom
let dis=this.node.getComponent(UITransform).width/2
let targetsInRange: HeroViewComp[] = []
// 收集范围内所有敌方目标
ecs.query(ecs.allOf(HeroViewComp)).some(e => {
const view = e.get(HeroViewComp);
if(view.fac!=skill.fac) {
const distance = Math.abs(skill.node.position.x - view.node.position.x);
if(distance <= dis) {
targetsInRange.push(view);
}
}
});
// 根据配置的hit_num决定攻击模式
const hitNum = skill.skillConfig?.hit_num || 0;
if(hitNum > 0) {
// 限制目标数量按距离排序选择最近的N个目标
if(targetsInRange.length > 0) {
// 按距离排序(从近到远)
targetsInRange.sort((a, b) => {
const distanceA = Math.abs(skill.node.position.x - a.node.position.x);
const distanceB = Math.abs(skill.node.position.x - b.node.position.x);
return distanceA - distanceB;
});
// 限制目标数量
const maxTargets = Math.min(hitNum, targetsInRange.length);
const selectedTargets = targetsInRange.slice(0, maxTargets);
selectedTargets.forEach(target => {
skill.single_damage(target, false);
});
}
} else {
// 范围伤害:对所有范围内目标造成伤害
if(targetsInRange.length > 0) {
targetsInRange.forEach(target => {
skill.single_damage(target, false);
});
}
}
}
/** 全局消息逻辑处理 */ /** 全局消息逻辑处理 */
// private onHandler(event: string, args: any) { // private onHandler(event: string, args: any) {
// switch (event) { // switch (event) {