refactor(skill): 优化技能系统实现和配置
- 删除未使用的ECS元文件和组件 - 修复技能视图和移动逻辑,添加调试日志 - 调整技能预制体配置和动画参数 - 简化技能加载和方向处理逻辑 - 新增技能6002并更新英雄配置 - 统一受击特效路径命名
This commit is contained in:
@@ -21,13 +21,16 @@ export class SkillView extends CCComp {
|
||||
@property({ type: CCInteger })
|
||||
atk_x: number = 0
|
||||
@property({ type: CCInteger })
|
||||
|
||||
atk_y: number = 0
|
||||
@property({ type: CCInteger })
|
||||
runType: number = 0 //技能运行类型 0-线性 1-贝塞尔 2-开始位置固定 3-目标位置固定
|
||||
|
||||
anim:Animation=null;
|
||||
group:number=0;
|
||||
SConf:any=null;
|
||||
s_uuid:number=1001
|
||||
start() {
|
||||
console.log("SkillView start scale",this.node.scale)
|
||||
this.SConf = SkillSet[this.s_uuid]
|
||||
this.anim=this.node.getComponent(Animation)
|
||||
this.node.active = true;
|
||||
@@ -38,13 +41,14 @@ export class SkillView extends CCComp {
|
||||
}
|
||||
const SMove=this.ent.get(SMoveDataComp)
|
||||
// 计算延长后的目标点坐标
|
||||
SMove.rePos(v3(this.node.position.x + this.atk_x, this.node.position.y + this.atk_y))
|
||||
|
||||
switch(this.SConf.RType){
|
||||
|
||||
switch(this.runType){
|
||||
case RType.linear:
|
||||
SMove.rePos(v3(this.node.position.x + this.atk_x, this.node.position.y + this.atk_y))
|
||||
this.do_linear(SMove.startPos,SMove.targetPos)
|
||||
break
|
||||
case RType.bezier:
|
||||
SMove.rePos(v3(this.node.position.x + this.atk_x, this.node.position.y + this.atk_y))
|
||||
this.do_bezier(SMove.startPos,SMove.targetPos)
|
||||
break
|
||||
case RType.fixed:
|
||||
@@ -67,6 +71,7 @@ export class SkillView extends CCComp {
|
||||
}
|
||||
|
||||
do_bezier(startPos:Vec3,targetPos:Vec3){
|
||||
console.log("do_bezier",startPos,targetPos)
|
||||
let bm=this.node.getComponent(BezierMove)
|
||||
this.node.angle +=10
|
||||
// bm.speed=700
|
||||
@@ -75,6 +80,7 @@ export class SkillView extends CCComp {
|
||||
bm.moveTo(targetPos)
|
||||
}
|
||||
do_linear(startPos:Vec3,targetPos:Vec3){
|
||||
console.log("do_linear",startPos,targetPos)
|
||||
let bm=this.node.getComponent(BezierMove)
|
||||
let s_x=startPos.x
|
||||
let s_y=startPos.y
|
||||
@@ -95,11 +101,13 @@ export class SkillView extends CCComp {
|
||||
bm.moveTo(targetPos);
|
||||
}
|
||||
do_fixedEnd(startPos:Vec3,targetPos:Vec3){
|
||||
console.log("do_fixedEnd",startPos,targetPos)
|
||||
this.node.setPosition(targetPos.x > 360?300:targetPos.x,this.node.position.y,0)
|
||||
this.do_anim()
|
||||
}
|
||||
do_fixedStart(startPos:Vec3,targetPos:Vec3){
|
||||
this.node.setPosition(startPos.x > 360?300:startPos.x,this.node.position.y,0)
|
||||
console.log("do_fixedStart",startPos,targetPos)
|
||||
this.node.setPosition(startPos.x,this.node.position.y,0)
|
||||
this.do_anim()
|
||||
}
|
||||
do_anim(){
|
||||
@@ -168,11 +176,12 @@ export class SkillView extends CCComp {
|
||||
if (!this.SConf) return;
|
||||
let sData=this.ent.get(SDataCom)
|
||||
//伤害处理
|
||||
let dmgData=target.ent.add(DmgDataCom)
|
||||
target.ent.add(DmgDataCom)
|
||||
let dmgData=target.ent.get(DmgDataCom)
|
||||
dmgData.Attrs=sData.Attrs
|
||||
dmgData.caster=sData.caster
|
||||
dmgData.s_uuid=sData.s_uuid
|
||||
|
||||
console.log("[SkillCom]:apply_damage",target,sData,dmgData)
|
||||
sData.hit_count++
|
||||
// console.log("[SkillCom]:碰撞次数:技能次数:穿刺次数",this.hit_count,this.Config.hit,this.puncture)
|
||||
if(sData.hit_count>=(this.SConf.hit+sData.Attrs[Attrs.PUNCTURE])&&(this.SConf.DTType!=DTType.range)&&(this.SConf.EType!=EType.animationEnd)&&(this.SConf.EType!=EType.timeEnd)) this.ent.destroy// 技能命中次数
|
||||
|
||||
Reference in New Issue
Block a user