下一步 英雄技能 ui 制作
This commit is contained in:
@@ -58,13 +58,7 @@ export class RoleViewComp extends CCComp {
|
||||
power_max: number = 1200; /** 能量最大值 */
|
||||
power_speed: number = 1; //能量回复速度每0.1秒回复量
|
||||
skill:8001;
|
||||
skills:{
|
||||
1:{uuid:8001,cd:2,alive:true },
|
||||
2:{uuid:8001,cd:2,alive:false},
|
||||
3:{uuid:8001,cd:2,alive:false},
|
||||
4:{uuid:8001,cd:2,alive:false},
|
||||
5:{uuid:8001,cd:2,alive:false},
|
||||
}
|
||||
skills:any=[]
|
||||
buff_atks:any = [];
|
||||
buff_atk:number = 0;
|
||||
|
||||
@@ -173,9 +167,23 @@ export class RoleViewComp extends CCComp {
|
||||
this.in_stop(dt);
|
||||
this.atk_time += dt;
|
||||
this.in_atk();
|
||||
this.skill_cds(dt);
|
||||
// this.move();
|
||||
this.check_enemys()
|
||||
}
|
||||
skill_cds(dt:number){
|
||||
this.skills.forEach((e:any) => {
|
||||
if(e.cd > 0&&e.alive){
|
||||
e.cd -= dt;
|
||||
if(e.cd <= 0){
|
||||
this.shoot(e.uuid);
|
||||
e.cd=smc.skills[e.uuid].cd
|
||||
console.log("shoot uuid :"+e.uuid);
|
||||
}
|
||||
}
|
||||
});
|
||||
// console.log(this.skills);
|
||||
}
|
||||
check_enemys(){
|
||||
let enemys=ecs.query(ecs.allOf(MonViewComp));
|
||||
if(enemys.length > 0){
|
||||
|
||||
@@ -100,13 +100,14 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
next_exp:100,
|
||||
power:300,
|
||||
skill:8001,
|
||||
skills:{
|
||||
1:{uuid:8001,cd:2,alive:true },
|
||||
2:{uuid:9002,cd:2,alive:false},
|
||||
3:{uuid:9003,cd:2,alive:false},
|
||||
4:{uuid:9004,cd:2,alive:false},
|
||||
5:{uuid:9005,cd:2,alive:false},
|
||||
}
|
||||
skills:[
|
||||
{uuid:1002,cd:2,alive:true },
|
||||
{uuid:1003,cd:3,alive:true},
|
||||
{uuid:1004,cd:4,alive:true},
|
||||
{uuid:0,cd:0,alive:false},
|
||||
{uuid:0,cd:0,alive:false},
|
||||
]
|
||||
|
||||
},
|
||||
/** 当前等级 */
|
||||
cards:{
|
||||
|
||||
Reference in New Issue
Block a user