refactor(game): 精简肉鸽模式关卡配置并优化怪物加载逻辑
- 调整SkillSet基础攻击技能参数,降低CD时间和技能消耗 - 更新HeroInfo中英雄和怪物的技能组合,替换为更合理的技能ID - 注释掉部分法师及精英怪物的定义,简化怪物列表 - 优化Monster类load和hero_init方法,移除不再使用的增强属性和关卡倍数参数 - 精简MissionMonComp刷怪队列逻辑,移除增强属性和关卡倍数支持 - 调整RogueConfig,去除怪物增强属性相关代码,仅保留基础刷怪类型和数量配置 - 修正SkillCom中使用属性枚举的地方,使用统一Attrs枚举 - 清理代码注释和多余空行,提升代码规范性和可读性
This commit is contained in:
@@ -364,7 +364,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: {
|
||||||
|
|||||||
@@ -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:[6001,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:[6001,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:[6001,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:"精英怪物-战士型"},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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,198 +21,47 @@ 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开始)
|
||||||
@@ -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}关基础属性倍数`
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user