旋风斩 螺旋丸 完成

This commit is contained in:
2025-01-09 15:51:00 +08:00
parent b1e50d0721
commit 2903e06ed4
17 changed files with 1199 additions and 117 deletions

View File

@@ -1,23 +1,19 @@
import { _decorator, Component, Node, tween, Vec3 } from 'cc';
import { SkillCom } from './SkillCom';
import { SkillSet } from '../common/config/SkillSet';
const { ccclass, property } = _decorator;
@ccclass('NoRunCom')
export class NoRunCom extends Component {
base:SkillCom
start() {
let base =this.node.getComponent(SkillCom)
tween(this.node).to( base.in_time,
{ position: new Vec3(this.node.position.x,this.node.position.y) },
{
onComplete: (target?: object) => {
base.is_destroy=true
},
}
).start();
this.base =this.node.getComponent(SkillCom)
}
update(deltaTime: number) {
}
}

View File

@@ -28,8 +28,9 @@ export class Skill extends ecs.Entity {
var prefab: Prefab = oops.res.get(path, Prefab)!;
console.log("load skill pos:",pos)
var node = instantiate(prefab);
pos=v3(pos.x,pos.y)
node.parent = parent.parent;
if(SkillSet[uuid].with){node.parent = parent;t_pos=v3(0,0)}
if(!SkillSet[uuid].with){node.parent = parent.parent;}
node.setPosition(pos)
if(group==BoxSet.MONSTER) node.setScale(v3(-1*node.scale.x,node.scale.y));
var sv = node.getComponent(SkillCom);

View File

@@ -1,6 +1,8 @@
import { _decorator, Component, Node } from 'cc';
import { _decorator, Animation, Component, Node } from 'cc';
import { SkillCom } from './SkillCom';
import { SkillSet } from '../common/config/SkillSet';
import { ecs } from 'db://oops-framework/libs/ecs/ECS';
import { Skill } from './Skill';
const { ccclass, property } = _decorator;
@ccclass('seCom')
@@ -9,12 +11,18 @@ export class seCom extends Component {
start() {
this.base =this.node.getComponent(SkillCom)
let anim = this.node.getComponent(Animation);
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
}
update(deltaTime: number) {
if (this.base.is_destroy) {
console.log("执行第二技能",SkillSet[this.base.s_uuid].sonsk)
}
}
onAnimationFinished(){
let skill = ecs.getEntity<Skill>(Skill);
this.base.to_console("=>技能二段触发=>"+SkillSet[this.base.s_uuid].sonsk)
skill.load(this.node.position,this.base.box_group,this.base.node,SkillSet[this.base.s_uuid].sonsk,this.base.ap,this.base.t_pos,this.base.is_crit,this.base.crit_add);
this.base.is_destroy=true
}
}