feat(skill): 重构技能模块,新增技能前后摇动画和组件
- 新增技能前后摇动画资源及配置 - 添加技能组件(SkillCom, EndAnmCom)和视图组件 - 重构技能配置表,支持前后摇动画配置 - 删除旧版技能资源(prefab, boom目录) - 调整技能预制体路径结构
This commit is contained in:
@@ -124,25 +124,52 @@ export interface NeAttrsConf {
|
||||
value:number;
|
||||
time:number;
|
||||
}
|
||||
interface IReady {
|
||||
uuid:number,
|
||||
loop: boolean,
|
||||
SkillTime: number,// 技能控制存续时间时间
|
||||
ReadyTime: number,// 技能前摇时间
|
||||
runType: number, //技能运行类型 0-线性 1-贝塞尔 2-开始位置固定 3-目标位置固定
|
||||
ready_y: number,
|
||||
path:string,
|
||||
}
|
||||
|
||||
interface IEndAnm {
|
||||
uuid:number,
|
||||
path:string,
|
||||
loop:boolean,
|
||||
time:number,
|
||||
}
|
||||
// 技能配置接口 - 按照6001格式排列
|
||||
export interface SkillConfig {
|
||||
uuid:number,name:string,sp_name:string,AtkedName:AtkedName,path:string,TGroup:TGroup,SType:SType,act:string,DTType:DTType,DType:DType,
|
||||
ap:number,cd:number,t_num:number,hit_num:number,hit:number,hitcd:number,speed:number,cost:number,with:number,
|
||||
buffs:BuffConf[],neAttrs:NeAttrsConf[],info:string,hero?:number
|
||||
ap:number,cd:number,t_num:number,hit_num:number,hit:number,hitcd:number,speed:number,cost:number,with:number,ready:number,endAnm:number
|
||||
buffs:BuffConf[],neAttrs:NeAttrsConf[],info:string,hero?:number ,
|
||||
}
|
||||
|
||||
|
||||
export const SkillSet: Record<number, SkillConfig> = {
|
||||
// ========== 基础攻击 ========== 6001-6099
|
||||
6001: {
|
||||
uuid:6001,name:"挥击",sp_name:"atk_s1",AtkedName:AtkedName.atked,path:"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:0,with:0,
|
||||
buffs:[],neAttrs:[],info:"向最前方敌人扔出石斧,造成100%攻击的伤害"
|
||||
ap:100,cd:1,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,cost:0,with:0,ready:0,endAnm:0,
|
||||
buffs:[],neAttrs:[],info:"向最前方敌人扔出石斧,造成100%攻击的伤害",
|
||||
},
|
||||
6005: {
|
||||
uuid:6005,name:"火球术",sp_name:"atk_fires",AtkedName:AtkedName.atked,path:"3039",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,DType:DType.MAGE,
|
||||
ap:100,cd:5,t_num:1,hit_num:1,hit:2,hitcd:0.3,speed:720,cost:20,with:90,
|
||||
buffs:[],neAttrs:[],info:"召唤大火球攻击前方所有敌人,造成300%攻击的伤害,有一定几率施加灼烧"
|
||||
uuid:6005,name:"火球术",sp_name:"atk_fire1",AtkedName:AtkedName.atked,path:"3039",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,DType:DType.MAGE,
|
||||
ap:100,cd:5,t_num:1,hit_num:1,hit:2,hitcd:0.3,speed:720,cost:20,with:90,ready:8001,endAnm:9001,
|
||||
buffs:[],neAttrs:[],info:"召唤大火球攻击前方所有敌人,造成300%攻击的伤害,有一定几率施加灼烧",
|
||||
},
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
export const SkillReadyConf: Record<number, IReady> = {
|
||||
0:{uuid:0,loop:false,SkillTime:0,ReadyTime:0,runType:0,ready_y:0,path:""}, // 无前摇
|
||||
8001:{uuid:8001,loop:false,SkillTime:0,ReadyTime:0,runType:0,ready_y:0,path:"fire1"},
|
||||
};
|
||||
|
||||
export const EndAnmConf: Record<number, IEndAnm> = {
|
||||
0:{uuid:0,path:"",loop:false,time:0}, // 无结束动画
|
||||
9001:{uuid:9001,path:"end1",loop:false,time:0},
|
||||
};
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "d2d775f5-1dc0-455e-89d7-4a17f43170e0",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"compressionType": {},
|
||||
"isRemoteBundle": {}
|
||||
}
|
||||
}
|
||||
34
assets/script/game/skill/EndAnm.ts
Normal file
34
assets/script/game/skill/EndAnm.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
|
||||
/** EndAnm 模块 */
|
||||
@ecs.register(`EndAnm`)
|
||||
export class EndAnm extends ecs.Entity {
|
||||
/** ---------- 数据层 ---------- */
|
||||
// EndAnmModel!: EndAnmModelComp;
|
||||
|
||||
/** ---------- 业务层 ---------- */
|
||||
// EndAnmBll!: EndAnmBllComp;
|
||||
|
||||
/** ---------- 视图层 ---------- */
|
||||
// EndAnmView!: EndAnmViewComp;
|
||||
|
||||
/** 实始添加的数据层组件 */
|
||||
protected init() {
|
||||
// this.addComponents<ecs.Comp>();
|
||||
}
|
||||
|
||||
/** 模块资源释放 */
|
||||
destroy() {
|
||||
// 注: 自定义释放逻辑,视图层实现 ecs.IComp 接口的 ecs 组件需要手动释放
|
||||
super.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
/** EndAnm 模块业务逻辑系统组件,如无业务逻辑处理可删除此对象 */
|
||||
export class EcsEndAnmSystem extends ecs.System {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
// this.add(new ecs.ComblockSystem());
|
||||
}
|
||||
}
|
||||
9
assets/script/game/skill/EndAnm.ts.meta
Normal file
9
assets/script/game/skill/EndAnm.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "1262d5a7-b1a1-49dc-9715-b7e28619304f",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
24
assets/script/game/skill/EndAnmCom.ts
Normal file
24
assets/script/game/skill/EndAnmCom.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
|
||||
/** 业务层对象 */
|
||||
@ecs.register('EndAnmCom')
|
||||
export class EndAnmComComp extends ecs.Comp {
|
||||
/** 业务层组件移除时,重置所有数据为默认值 */
|
||||
reset() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/** 业务层业务逻辑处理对象 */
|
||||
export class EndAnmComSystem extends ecs.ComblockSystem implements ecs.IEntityEnterSystem {
|
||||
filter(): ecs.IMatcher {
|
||||
return ecs.allOf(EndAnmComComp);
|
||||
}
|
||||
|
||||
entityEnter(e: ecs.Entity): void {
|
||||
// 注:自定义业务逻辑
|
||||
|
||||
|
||||
e.remove(EndAnmComComp);
|
||||
}
|
||||
}
|
||||
9
assets/script/game/skill/EndAnmCom.ts.meta
Normal file
9
assets/script/game/skill/EndAnmCom.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "e0728072-f94e-4741-b172-4157e7a3b335",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
29
assets/script/game/skill/EndView.ts
Normal file
29
assets/script/game/skill/EndView.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { _decorator } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('EndViewComp')
|
||||
@ecs.register('EndView', false)
|
||||
export class EndViewComp extends CCComp {
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||
}
|
||||
|
||||
/** 全局消息逻辑处理 */
|
||||
// private onHandler(event: string, args: any) {
|
||||
// switch (event) {
|
||||
// case ModuleEvent.Cmd:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
9
assets/script/game/skill/EndView.ts.meta
Normal file
9
assets/script/game/skill/EndView.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "b6a93d92-4e42-4f75-8c60-8d616afe33a1",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
34
assets/script/game/skill/Ready.ts
Normal file
34
assets/script/game/skill/Ready.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
|
||||
/** Read 模块 */
|
||||
@ecs.register(`Read`)
|
||||
export class Read extends ecs.Entity {
|
||||
/** ---------- 数据层 ---------- */
|
||||
// ReadModel!: ReadModelComp;
|
||||
|
||||
/** ---------- 业务层 ---------- */
|
||||
// ReadBll!: ReadBllComp;
|
||||
|
||||
/** ---------- 视图层 ---------- */
|
||||
// ReadView!: ReadViewComp;
|
||||
|
||||
/** 实始添加的数据层组件 */
|
||||
protected init() {
|
||||
// this.addComponents<ecs.Comp>();
|
||||
}
|
||||
|
||||
/** 模块资源释放 */
|
||||
destroy() {
|
||||
// 注: 自定义释放逻辑,视图层实现 ecs.IComp 接口的 ecs 组件需要手动释放
|
||||
super.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
/** Read 模块业务逻辑系统组件,如无业务逻辑处理可删除此对象 */
|
||||
export class EcsReadSystem extends ecs.System {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
// this.add(new ecs.ComblockSystem());
|
||||
}
|
||||
}
|
||||
9
assets/script/game/skill/Ready.ts.meta
Normal file
9
assets/script/game/skill/Ready.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "de61eb09-969a-4528-a822-edbb732dea01",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
29
assets/script/game/skill/ReadyView.ts
Normal file
29
assets/script/game/skill/ReadyView.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { _decorator } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('ReadyViewComp')
|
||||
@ecs.register('ReadyView', false)
|
||||
export class ReadyViewComp extends CCComp {
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||
}
|
||||
|
||||
/** 全局消息逻辑处理 */
|
||||
// private onHandler(event: string, args: any) {
|
||||
// switch (event) {
|
||||
// case ModuleEvent.Cmd:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
9
assets/script/game/skill/ReadyView.ts.meta
Normal file
9
assets/script/game/skill/ReadyView.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "6a8d3e5b-f363-4035-8bab-0b556b0d540e",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
34
assets/script/game/skill/Skill.ts
Normal file
34
assets/script/game/skill/Skill.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
|
||||
/** Skill 模块 */
|
||||
@ecs.register(`Skill`)
|
||||
export class Skill extends ecs.Entity {
|
||||
/** ---------- 数据层 ---------- */
|
||||
// SkillModel!: SkillModelComp;
|
||||
|
||||
/** ---------- 业务层 ---------- */
|
||||
// SkillBll!: SkillBllComp;
|
||||
|
||||
/** ---------- 视图层 ---------- */
|
||||
// SkillView!: SkillViewComp;
|
||||
|
||||
/** 实始添加的数据层组件 */
|
||||
protected init() {
|
||||
// this.addComponents<ecs.Comp>();
|
||||
}
|
||||
|
||||
/** 模块资源释放 */
|
||||
destroy() {
|
||||
// 注: 自定义释放逻辑,视图层实现 ecs.IComp 接口的 ecs 组件需要手动释放
|
||||
super.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
/** Skill 模块业务逻辑系统组件,如无业务逻辑处理可删除此对象 */
|
||||
export class EcsSkillSystem extends ecs.System {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
// this.add(new ecs.ComblockSystem());
|
||||
}
|
||||
}
|
||||
9
assets/script/game/skill/Skill.ts.meta
Normal file
9
assets/script/game/skill/Skill.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "95624913-36b6-472f-997b-552502dc437d",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
24
assets/script/game/skill/SkillCom.ts
Normal file
24
assets/script/game/skill/SkillCom.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
|
||||
/** 业务层对象 */
|
||||
@ecs.register('SkillCom')
|
||||
export class SkillComComp extends ecs.Comp {
|
||||
/** 业务层组件移除时,重置所有数据为默认值 */
|
||||
reset() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/** 业务层业务逻辑处理对象 */
|
||||
export class SkillComSystem extends ecs.ComblockSystem implements ecs.IEntityEnterSystem {
|
||||
filter(): ecs.IMatcher {
|
||||
return ecs.allOf(SkillComComp);
|
||||
}
|
||||
|
||||
entityEnter(e: ecs.Entity): void {
|
||||
// 注:自定义业务逻辑
|
||||
|
||||
|
||||
e.remove(SkillComComp);
|
||||
}
|
||||
}
|
||||
9
assets/script/game/skill/SkillCom.ts.meta
Normal file
9
assets/script/game/skill/SkillCom.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "4338992d-a768-4089-b1d2-dd8695712fc4",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
29
assets/script/game/skill/SkillView.ts
Normal file
29
assets/script/game/skill/SkillView.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { _decorator } from "cc";
|
||||
import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('SkillViewComp')
|
||||
@ecs.register('SkillView', false)
|
||||
export class SkillViewComp extends CCComp {
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||
}
|
||||
|
||||
/** 全局消息逻辑处理 */
|
||||
// private onHandler(event: string, args: any) {
|
||||
// switch (event) {
|
||||
// case ModuleEvent.Cmd:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
9
assets/script/game/skill/SkillView.ts.meta
Normal file
9
assets/script/game/skill/SkillView.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "57aabb3b-4c4d-49e6-86d3-01973373eeb8",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
Reference in New Issue
Block a user