buff动画优化 + 添加闪避最大值限定值
This commit is contained in:
@@ -5,6 +5,7 @@ import { ecs } from 'db://oops-framework/libs/ecs/ECS';
|
||||
import { Tooltip } from '../skills/Tooltip';
|
||||
import { timedCom } from '../skills/timedCom';
|
||||
import { smc } from '../common/SingletonModuleComp';
|
||||
import { BuffGet } from '../skills/BuffGet';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('BuffComp')
|
||||
@@ -33,7 +34,7 @@ export class BuffComp extends Component {
|
||||
|
||||
start() {
|
||||
this.heroView = this.node.getComponent(HeroViewComp);
|
||||
this.show_ap(10)
|
||||
this.buff_get("dodge")
|
||||
// this.node.getChildByName("top").getChildByName("buff").getChildByName("ap").active = false;
|
||||
// this.node.getChildByName("top").getChildByName("buff").getChildByName("cd").active = false;
|
||||
// this.node.getChildByName("top").getChildByName("buff").getChildByName("def").active = false;
|
||||
@@ -64,119 +65,15 @@ export class BuffComp extends Component {
|
||||
}
|
||||
|
||||
}
|
||||
show_ap(t:number=2){
|
||||
this.ap_cd = t;
|
||||
this.node.getChildByName("top").getChildByName("buff").getChildByName("ap").active = true;
|
||||
let node = this.node.getChildByName("top").getChildByName("buff").getChildByName("ap")
|
||||
this.scheduleOnce(()=>{
|
||||
tween(node).to( 0.1,
|
||||
{ position: new Vec3(node.position.x,node.position.y+50) },
|
||||
{ onComplete:()=>{ node.position=v3(0,0);node.active = false; }, }
|
||||
).start();
|
||||
}, 1);
|
||||
|
||||
}
|
||||
show_cd(t:number=2){
|
||||
this.cd_cd = t;
|
||||
this.node.getChildByName("top").getChildByName("buff").getChildByName("cd").active = true;
|
||||
let node = this.node.getChildByName("top").getChildByName("buff").getChildByName("cd")
|
||||
this.scheduleOnce(()=>{
|
||||
tween(node).to( 0.1,
|
||||
{ position: new Vec3(node.position.x,node.position.y+50) },
|
||||
{ onComplete:()=>{ node.position=v3(0,0);node.active = false; }, }
|
||||
).start();
|
||||
}, 1);
|
||||
}
|
||||
show_def(t:number=2){
|
||||
this.def_cd = t;
|
||||
this.node.getChildByName("top").getChildByName("buff").getChildByName("def").active = true;
|
||||
let node = this.node.getChildByName("top").getChildByName("buff").getChildByName("def")
|
||||
this.scheduleOnce(()=>{
|
||||
tween(node).to( 0.1,
|
||||
{ position: new Vec3(node.position.x,node.position.y+50) },
|
||||
{ onComplete:()=>{ node.position=v3(0,0);node.active = false; }, }
|
||||
).start();
|
||||
}, 1);
|
||||
}
|
||||
show_hp(t:number=2){
|
||||
this.hp_cd = t;
|
||||
this.node.getChildByName("top").getChildByName("buff").getChildByName("hp").active = true;
|
||||
let node = this.node.getChildByName("top").getChildByName("buff").getChildByName("hp")
|
||||
this.scheduleOnce(()=>{
|
||||
tween(node).to( 0.1,
|
||||
{ position: new Vec3(node.position.x,node.position.y+50) },
|
||||
{ onComplete:()=>{ node.position=v3(0,0);node.active = false; }, }
|
||||
).start();
|
||||
}, 1);
|
||||
}
|
||||
show_crit(t:number=2){
|
||||
this.crit_cd = t;
|
||||
this.node.getChildByName("top").getChildByName("buff").getChildByName("crit").active = true;
|
||||
let node = this.node.getChildByName("top").getChildByName("buff").getChildByName("crit")
|
||||
this.scheduleOnce(()=>{
|
||||
tween(node).to( 0.1,
|
||||
{ position: new Vec3(node.position.x,node.position.y+50) },
|
||||
{ onComplete:()=>{ node.position=v3(0,0);node.active = false; }, }
|
||||
).start();
|
||||
}, 1);
|
||||
}
|
||||
show_debuff_ap(t:number=2){
|
||||
this.deap_cd = t;
|
||||
this.node.getChildByName("top").getChildByName("buff").getChildByName("deap").active = true;
|
||||
let node = this.node.getChildByName("top").getChildByName("buff").getChildByName("deap")
|
||||
this.scheduleOnce(()=>{
|
||||
tween(node).to( 0.1,
|
||||
{ position: new Vec3(node.position.x,node.position.y+50) },
|
||||
{ onComplete:()=>{ node.position=v3(0,0);node.active = false; }, }
|
||||
).start();
|
||||
}, 1);
|
||||
}
|
||||
show_debuff_cd(t:number=2){
|
||||
this.decd_cd = t;
|
||||
this.node.getChildByName("top").getChildByName("buff").getChildByName("decd").active = true;
|
||||
let node = this.node.getChildByName("top").getChildByName("buff").getChildByName("decd")
|
||||
this.scheduleOnce(()=>{
|
||||
tween(node).to( 0.1,
|
||||
{ position: new Vec3(node.position.x,node.position.y+50) },
|
||||
{ onComplete:()=>{ node.position=v3(0,0);node.active = false; }, }
|
||||
).start();
|
||||
}, 1);
|
||||
}
|
||||
show_debuff_def(t:number=2){
|
||||
this.dedef_cd = t;
|
||||
this.node.getChildByName("top").getChildByName("buff").getChildByName("dedef").active = true;
|
||||
let node = this.node.getChildByName("top").getChildByName("buff").getChildByName("dedef")
|
||||
this.scheduleOnce(()=>{
|
||||
tween(node).to( 0.1,
|
||||
{ position: new Vec3(node.position.x,node.position.y+50) },
|
||||
{ onComplete:()=>{ node.position=v3(0,0);node.active = false; }, }
|
||||
).start();
|
||||
}, 1);
|
||||
}
|
||||
show_debuff_hp(t:number=2){
|
||||
this.dehp_cd = t;
|
||||
this.node.getChildByName("top").getChildByName("buff").getChildByName("dehp").active = true;
|
||||
let node = this.node.getChildByName("top").getChildByName("buff").getChildByName("dehp")
|
||||
this.scheduleOnce(()=>{
|
||||
tween(node).to( 0.1,
|
||||
{ position: new Vec3(node.position.x,node.position.y+50) },
|
||||
{ onComplete:()=>{ node.position=v3(0,0);node.active = false; }, }
|
||||
).start();
|
||||
}, 1);
|
||||
}
|
||||
show_debuff_crit(t:number=2){
|
||||
this.decrit_cd = t;
|
||||
this.node.getChildByName("top").getChildByName("buff").getChildByName("decrit").active = true;
|
||||
let node = this.node.getChildByName("top").getChildByName("buff").getChildByName("decrit")
|
||||
this.scheduleOnce(()=>{
|
||||
tween(node).to( 0.1,
|
||||
{ position: new Vec3(node.position.x,node.position.y+50) },
|
||||
{ onComplete:()=>{ node.position=v3(0,0);node.active = false; }, }
|
||||
).start();
|
||||
}, 1);
|
||||
}
|
||||
|
||||
|
||||
buff_get(name:string){
|
||||
var path = "game/skills/buffget/buffget";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.parent = this.node.getChildByName("top").getChildByName("buff");
|
||||
let comp=node.getComponent(BuffGet)
|
||||
comp.init(name)
|
||||
}
|
||||
show_wind(t:number=1){
|
||||
this.wind_cd = t;
|
||||
this.node.getChildByName("wind").active = true;
|
||||
|
||||
Reference in New Issue
Block a user