战斗暴击 闪避 基本完成
This commit is contained in:
@@ -118,7 +118,7 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
reward_gold:0,
|
||||
reward_exp:0,
|
||||
hero:{
|
||||
atk:1,
|
||||
ap:1,
|
||||
atk_cd:1,
|
||||
hp:1,
|
||||
},
|
||||
|
||||
@@ -29,40 +29,40 @@ run:number = 0; // 0有目标 带方向,1贝塞尔曲线 2 不动 ,3 直线
|
||||
*/
|
||||
export const SkillSet={
|
||||
1001:{uuid: 1001,path: "1001",type: 1,tg:3,angle:true,level: 1,name: "火球术",sp_name:"fire",info:"释放一个火球术攻击敌人",
|
||||
dis:1,count:1,in:0,run:0,atk:10,hp:0,shield:0,sd:10,cd:3,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
|
||||
dis:1,count:1,in:0,run:0,ap:10,hp:0,shield:0,sd:10,cd:3,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
|
||||
1002:{uuid: 1002,path: "1002",type: 1,tg:3,angle:true,level: 3,name: "寒冰箭",sp_name:"ice",info:"释放一个寒冰箭攻击敌人",
|
||||
dis:1,count:1,in:0,run:0,atk:10,hp:0,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
|
||||
dis:1,count:1,in:0,run:0,ap:10,hp:0,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
|
||||
1003:{uuid: 1003,path: "1003",type: 1,tg:3,angle:true,level: 3,name: "强效射击",sp_name:"b_arrow",info:"释放一个火球术攻击敌人",
|
||||
dis:1,count:1,in:0,run:1,atk:10,hp:0,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
|
||||
dis:1,count:1,in:0,run:1,ap:10,hp:0,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
|
||||
1004:{uuid: 1004,path: "1004",type: 1,tg:3,angle:true,level: 3,name: "奥术冲击",sp_name:"bm_ball",info:"释放一个寒冰箭攻击敌人",
|
||||
dis:1,count:1,in:0,run:0,atk:10,hp:0,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
|
||||
dis:1,count:1,in:0,run:0,ap:10,hp:0,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
|
||||
|
||||
2001:{uuid: 2001,path: "2001",type: 91,tg:1,angle:false,level: 1,name: "治愈术",sp_name:"heath",info:"释放一个寒冰箭攻击敌人",
|
||||
dis:1,count:1,in:0,run:1,atk:0,hp:3,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:450, },
|
||||
dis:1,count:1,in:0,run:1,ap:0,hp:3,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:450, },
|
||||
2002:{uuid: 2002,path: "2002",type: 91,tg:0,angle:false,level: 1,name: "魔法盾",sp_name:"shield",info:"释放一个寒冰箭攻击敌人",
|
||||
dis:1,count:1,in:0.2,run:2,atk:0,hp:0,shield:1,sd:0,cd:0,bsd:8,bcd:0,sk_uuid:1001,sk_count:0,speed:450, },
|
||||
dis:1,count:1,in:0.2,run:2,ap:0,hp:0,shield:1,sd:0,cd:0,bsd:8,bcd:0,sk_uuid:1001,sk_count:0,speed:450, },
|
||||
2003:{uuid: 2003,path: "2003",type: 91,tg:0,angle:false,level: 1,name: "狂暴",sp_name:"atkup",info:"释放一个寒冰箭攻击敌人",
|
||||
dis:1,count:1,in:0.2,run:2,atk:1,hp:0,shield:0,sd:0,cd:0,bsd:8,bcd:0,sk_uuid:1001,sk_count:0,speed:450, },
|
||||
dis:1,count:1,in:0.2,run:2,ap:1,hp:0,shield:0,sd:0,cd:0,bsd:8,bcd:0,sk_uuid:1001,sk_count:0,speed:450, },
|
||||
|
||||
|
||||
3001:{uuid: 3001,path: "3001",type: 1,tg:3,angle:true,level: 1,name: "三连击",sp_name:"patk",info:"释放一个魔法球攻击敌人",
|
||||
dis:1,count:3,in:0.3,run:2,atk:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600,},
|
||||
dis:1,count:3,in:0.3,run:2,ap:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600,},
|
||||
|
||||
4011:{uuid: 4011,path: "1011",type: 11,tg:3,angle:true,level: 3,name: "火焰风暴",sp_name:"fire",info:"释放多个个火球术攻击敌人",
|
||||
dis:1,count:5,in:0,run:0,atk:10,hp:0,shield:0,sd:10,cd:2,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
|
||||
dis:1,count:5,in:0,run:0,ap:10,hp:0,shield:0,sd:10,cd:2,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
|
||||
4012:{uuid: 4012,path: "1012",type: 11,tg:3,angle:true,level: 3,name: "冰晶风暴",sp_name:"ice",info:"释放多个个寒冰箭攻击敌人",
|
||||
dis:1,count:5,in:0,run:0,atk:10,hp:0,shield:0,sd:10,cd:2,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
|
||||
dis:1,count:5,in:0,run:0,ap:10,hp:0,shield:0,sd:10,cd:2,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
|
||||
|
||||
9001:{uuid: 9001,path: "1001",type: 1,tg:3,angle:true,level: 1,name: "普攻",sp_name:"patk",info:"释放一个魔法球攻击敌人",
|
||||
dis:1,count:1,in:0,run:0,atk:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:1000,},
|
||||
dis:1,count:1,in:0,run:0,ap:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:1000,},
|
||||
9002:{uuid: 9002,path: "1001",type: 1,tg:3,angle:true,level: 1,name: "魔法小球",sp_name:"mball",info:"释放一个魔法球攻击敌人",
|
||||
dis:1,count:1,in:0,run:0,atk:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600,},
|
||||
dis:1,count:1,in:0,run:0,ap:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600,},
|
||||
9003:{uuid: 9003,path: "1001",type: 1,tg:3,angle:true,level: 1,name: "射击",sp_name:"arrow",info:"释放一个魔法球攻击敌人",
|
||||
dis:1,count:1,in:0,run:1,atk:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600,},
|
||||
dis:1,count:1,in:0,run:1,ap:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600,},
|
||||
|
||||
|
||||
8001:{uuid: 8001,path: "8001",type: 1,tg:3,angle:true,level: 1,name: "飞刀",sp_name:"sword1",info:"释放一个魔法球攻击敌人",
|
||||
dis:1,count:1,in:0,run:0,atk:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:8001,sk_count:0,speed:600,},
|
||||
dis:1,count:1,in:0,run:0,ap:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:8001,sk_count:0,speed:600,},
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ export const HeroInfo = {
|
||||
9001: {
|
||||
uuid: 9001, path: "k1", type: 1, lv: 1,name: "白骑士", wp:1001,arm:2001,ring:3001,shoes:4001,
|
||||
exp_type:0,lv2:5,lv3:10,lv4:20,lv5:30,a_exp:1,ua_exp:1,d_exp:10,ed_exp:1,a_buff:8101,ua_buff:8201,d_buff:8301,ed_buff:8401,
|
||||
ap: 20, ap_rate:0.1, hp: 100, hp_rate:0.1, def:10,def_rate:0.1, dis: 100, a_cd: 1, power: 0, power_max: 15, speed: 40,
|
||||
ap: 20, ap_rate:0.1, hp: 100, hp_rate:0.1, def:10,def_rate:0.1,dis: 100, a_cd: 1, power: 0, power_max: 15, speed: 100,vun:0,crit:20,crit_add:0,dodge:0,
|
||||
sk1: 9001, sk2: 2002, sk3: 9003, sk4: 9004, sk5: 9005, sk6: 9006, atktype: 1,skr:[0,10,20,30,40,50],uar:[0,10,20,30,40,50],
|
||||
},
|
||||
|
||||
|
||||
@@ -95,6 +95,10 @@ export class Hero extends ecs.Entity {
|
||||
hv.ap = HInf.ap;
|
||||
hv.def= HInf.def;
|
||||
hv.cd = HInf.a_cd
|
||||
hv.vun = HInf.vun; //易伤
|
||||
hv.crit = HInf.crit; //暴击率
|
||||
hv.crit_add = HInf.crit_add;//暴击伤害加成
|
||||
hv.dodge = HInf.dodge; //闪避率
|
||||
hv.power_max= HInf.power_max
|
||||
this.add(hv);
|
||||
}
|
||||
|
||||
@@ -79,8 +79,8 @@ export class HeroViewComp extends CCComp {
|
||||
def: number = 0; //防御
|
||||
vun: number = 0; //易伤
|
||||
|
||||
crit: number = 1.5; //暴击伤害比率
|
||||
crit_rate: number = 0;//暴击伤害加成
|
||||
crit: number = 0; //暴击率
|
||||
crit_add: number = 0;//暴击伤害加成
|
||||
dodge: number = 10; //闪避率
|
||||
|
||||
shield:number = 0; //护盾,免伤1次减1
|
||||
@@ -153,17 +153,15 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
return
|
||||
}
|
||||
let dodge = RandomManager.instance.getRandomInt(0,100,3)
|
||||
if(dodge < this.dodge){
|
||||
//todo 闪避跳字
|
||||
console.log("闪避了",dodge,this.dodge);
|
||||
return
|
||||
if(this.check_dodge()) return
|
||||
let l_hp=(skill.ap-this.def)*-1
|
||||
if(skill.is_crit){
|
||||
l_hp = l_hp * (150+skill.crit_add)/100
|
||||
}
|
||||
let l_hp=(skill.atk-this.def)*-1
|
||||
if(l_hp >= 0){
|
||||
l_hp=-1 //最低1点伤害
|
||||
}
|
||||
this.hp_change(l_hp);
|
||||
this.hp_change(l_hp,skill.is_crit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,20 +330,41 @@ export class HeroViewComp extends CCComp {
|
||||
|
||||
return {pos,t_pos}
|
||||
}
|
||||
//暴击判断
|
||||
check_crit(){
|
||||
let i = RandomManager.instance.getRandomInt(0,100,3)
|
||||
if(i < this.crit){
|
||||
console.log("攻击会暴击",i,this.crit);
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}
|
||||
//闪避判断
|
||||
check_dodge(){
|
||||
let i = RandomManager.instance.getRandomInt(0,100,3)
|
||||
if(i < this.dodge){
|
||||
this.tooltip(5,"闪避");
|
||||
console.log("闪避了",i,this.dodge);
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}
|
||||
check_atk_counts(){
|
||||
if(this.atk_count >= 1){
|
||||
this.atk_count = 0
|
||||
console.log("atk_count 清零:"+this.atk_count);
|
||||
// let i = RandomManager.instance.getRandomInt(0,100,3)
|
||||
// console.log("大招判断: i="+i+":skr="+this.skr[this.lv]);
|
||||
// if(i < this.skr[this.lv]){
|
||||
// console.log("大招触发: i="+i+":skr="+this.skr[this.lv]);
|
||||
// this.node.getChildByName("max").active=true
|
||||
// this.scheduleOnce(()=>{
|
||||
// this.node.getChildByName("max").active=false
|
||||
// },0.8)
|
||||
// this.handle_skill(this.sk2)
|
||||
// }
|
||||
let i = RandomManager.instance.getRandomInt(0,100,3)
|
||||
console.log("大招判断: i="+i+":skr="+this.skr[this.lv]);
|
||||
if(i < this.skr[this.lv]){
|
||||
console.log("大招触发: i="+i+":skr="+this.skr[this.lv]);
|
||||
this.node.getChildByName("max").active=true
|
||||
this.scheduleOnce(()=>{
|
||||
this.node.getChildByName("max").active=false
|
||||
},0.8)
|
||||
this.handle_skill(this.sk2)
|
||||
}
|
||||
}
|
||||
if(this.atked_count >= 1){
|
||||
this.atked_count = 0
|
||||
@@ -400,31 +419,30 @@ export class HeroViewComp extends CCComp {
|
||||
shoot_enemy(sk1:number,y:number=0,x:number=0){
|
||||
// console.log("mon shoot_enemy");
|
||||
let skill = ecs.getEntity<Skill>(Skill);
|
||||
let increase_atk=Math.floor(this.ap*smc.vm_data.mission.hero.atk)
|
||||
let atk = smc.skills[sk1].atk+this.ap_buff+increase_atk;
|
||||
let increase_ap=Math.floor(this.ap*smc.vm_data.mission.hero.ap)
|
||||
let ap = smc.skills[sk1].ap+this.ap_buff+increase_ap;
|
||||
let {pos,t_pos}=this.get_enemy_pos()
|
||||
|
||||
pos.y=pos.y + y
|
||||
pos.x=pos.x + x
|
||||
skill.load(pos,this.box_group,this.node,sk1,atk,t_pos);
|
||||
let is_crit=this.check_crit()
|
||||
skill.load(pos,this.box_group,this.node,sk1,ap,t_pos,is_crit,this.crit_add);
|
||||
console.log(this.scale+this.hero_name+"使用技能:"+sk1);
|
||||
// this.tooltip(3,smc.skills[sk1].name,this.sk1);
|
||||
}
|
||||
to_add_buff(hero:any,s_uuid:number){
|
||||
|
||||
let skill = ecs.getEntity<Skill>(Skill);
|
||||
let atk = smc.skills[s_uuid].atk+this.ap;
|
||||
let ap = smc.skills[s_uuid].ap+this.ap;
|
||||
let {pos,t_pos}=this.get_hero_pos(hero)
|
||||
console.log("to_add_buff:"+hero.hero_name+" "+s_uuid);
|
||||
skill.load(pos,this.box_group,this.node,this.sk2,atk,t_pos);
|
||||
|
||||
let is_crit=this.check_crit()
|
||||
skill.load(pos,this.box_group,this.node,this.sk2,ap,t_pos,is_crit,this.crit_add);
|
||||
if(smc.skills[s_uuid].hp > 0){ //buff加血
|
||||
let increase_hp=Math.floor(smc.skills[s_uuid].hp*this.ap)
|
||||
hero.add_hp(increase_hp)
|
||||
}
|
||||
if(smc.skills[s_uuid].atk > 0){ //buff加攻击
|
||||
let increase_atk=Math.floor(smc.skills[s_uuid].atk*this.ap)
|
||||
hero.add_atk(increase_atk,smc.skills[s_uuid].bsd)
|
||||
if(smc.skills[s_uuid].ap > 0){ //buff加攻击
|
||||
let increase_atk=Math.floor(smc.skills[s_uuid].ap*this.ap)
|
||||
hero.add_ap(increase_atk,smc.skills[s_uuid].bsd)
|
||||
}
|
||||
|
||||
if(smc.skills[s_uuid].shield > 0){ //buff护盾
|
||||
@@ -513,13 +531,19 @@ export class HeroViewComp extends CCComp {
|
||||
let hp_progress= this.hp/this.hp_max;
|
||||
this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress;
|
||||
}
|
||||
hp_change(hp: number){
|
||||
hp_change(hp: number,is_crit:boolean=false){
|
||||
if(this.is_dead){
|
||||
return;
|
||||
}
|
||||
|
||||
this.hp += hp;
|
||||
this.tooltip(1,hp.toString(),250);
|
||||
|
||||
if(is_crit){
|
||||
this.tooltip(4,hp.toString(),250);
|
||||
}else{
|
||||
this.tooltip(1,hp.toString(),250);
|
||||
}
|
||||
|
||||
if(this.hp > this.hp_max){
|
||||
this.hp = this.hp_max;
|
||||
}
|
||||
@@ -533,25 +557,15 @@ export class HeroViewComp extends CCComp {
|
||||
// }, 15);
|
||||
}
|
||||
}
|
||||
add_atk(atk: number,time:number=0){
|
||||
if(time > 0){
|
||||
this.ap_buff=0
|
||||
let buff={atk:atk,time:time}
|
||||
this.ap_buffs.push(buff);
|
||||
this.ap_buffs.forEach((element: { atk: number; }) => {
|
||||
this.ap_buff += element.atk
|
||||
});
|
||||
}else{
|
||||
this.ap += atk;
|
||||
}
|
||||
// console.log(this.ap_buffs)
|
||||
add_ap(ap: number,time:number=0){
|
||||
this.ap += ap;
|
||||
}
|
||||
check_atk_buffs(dt: number){
|
||||
for(let i=0;i<this.ap_buffs.length;i++){
|
||||
let buff=this.ap_buffs[i];
|
||||
buff.time -= dt;
|
||||
if(buff.time <= 0){
|
||||
this.ap_buff -= buff.atk
|
||||
this.ap_buff -= buff.ap
|
||||
this.ap_buffs.splice(i,1);
|
||||
}
|
||||
}
|
||||
@@ -573,13 +587,12 @@ export class HeroViewComp extends CCComp {
|
||||
this.node.getChildByName("shielded").active=true
|
||||
}
|
||||
}
|
||||
tooltip(type:number=1,value:string="",s_uuid:number=1001,y:number=60){
|
||||
tooltip(type:number=1,value:string="",s_uuid:number=1001,y:number=90){
|
||||
// console.log("tooltip",type);
|
||||
let tip =ecs.getEntity<Tooltip>(Tooltip);
|
||||
let pos = this.node.getPosition();
|
||||
let node =this.node.parent
|
||||
let pos = v3(0,0);
|
||||
pos.y=pos.y+y;
|
||||
tip.load(pos,type,value,s_uuid,node);
|
||||
tip.load(pos,type,value,s_uuid,this.node);
|
||||
}
|
||||
|
||||
/** 静止时间 */
|
||||
|
||||
@@ -29,9 +29,8 @@ export class Skill extends ecs.Entity {
|
||||
this.remove(SkillCom);
|
||||
super.destroy();
|
||||
}
|
||||
load(pos: Vec3 = Vec3.ZERO,group:number,parent:Node,
|
||||
uuid:number=1001,atk:number =10,t_pos:Vec3 = null,dis:number=0,)
|
||||
|
||||
load(pos: Vec3 = Vec3.ZERO,group:number,parent:Node,uuid:number=1001,
|
||||
ap:number =10,t_pos:Vec3 = null,is_crit:boolean=false,crit_add:number=0)
|
||||
{
|
||||
var path = "game/skills/"+smc.skills[uuid].sp_name;
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
@@ -56,11 +55,13 @@ export class Skill extends ecs.Entity {
|
||||
sv.angle = angle;
|
||||
// console.log(smc.skills[uuid].name+"angle:"+angle)
|
||||
sv.s_uuid = uuid;
|
||||
sv.atk = atk;
|
||||
sv.ap = ap;
|
||||
sv.is_crit=is_crit
|
||||
sv.crit_add=crit_add
|
||||
// node.setScale(v3(node.scale.x*scale,node.scale.y))
|
||||
|
||||
sv.speed=smc.skills[uuid].speed;
|
||||
sv.dis=smc.skills[uuid].dis+dis;
|
||||
sv.dis=smc.skills[uuid].dis;
|
||||
sv.run_type=smc.skills[uuid].run;
|
||||
if(sv.dis == 0){
|
||||
sv.run_type=2
|
||||
|
||||
@@ -26,8 +26,10 @@ export class SkillCom extends CCComp {
|
||||
x_speed:number = 0;
|
||||
dis:number = 80;
|
||||
scale:number = 1;
|
||||
atk:number = 10;
|
||||
ap:number = 10;
|
||||
atk_count:number = 0;
|
||||
is_crit:boolean = false;
|
||||
crit_add: number = 0;//暴击伤害加成
|
||||
angle:number = 0;
|
||||
t_pos:Vec3 = v3(0,0,0); // 目标增量
|
||||
is_destroy:boolean = false;
|
||||
|
||||
@@ -35,13 +35,16 @@ export class Tooltip extends ecs.Entity {
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.parent = parent;
|
||||
if(parent.scale.x < 0){
|
||||
node.setScale(-node.scale.x, node.scale.y, 0);
|
||||
}
|
||||
node.setPosition(pos)
|
||||
var sv = node.getComponent(TooltipCom)!;
|
||||
// console.log("load tooltip type",type,vaule,s_uuid);
|
||||
sv.stype = type;
|
||||
sv.value = vaule;
|
||||
sv.s_uuid = s_uuid;
|
||||
sv.alive_time = 0.3;
|
||||
sv.alive_time = 0.5;
|
||||
this.add(sv)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,10 +22,8 @@ export class TooltipCom extends CCComp {
|
||||
s_uuid:number = 1001;
|
||||
alive_time:number = 0.2;
|
||||
skill_name_time=0.5;
|
||||
scale:number = 1;
|
||||
start() {
|
||||
this.node.getChildByName("loss_life").active=false;
|
||||
this.node.getChildByName("add_life").active=false
|
||||
this.node.getChildByName("skill").active=false;
|
||||
// console.log("TooltipView start",this.node);
|
||||
switch(this.stype){
|
||||
case 1:
|
||||
@@ -33,7 +31,7 @@ export class TooltipCom extends CCComp {
|
||||
this.node.getChildByName("loss_life").active=true;
|
||||
tween(this.node).to(
|
||||
this.alive_time,
|
||||
{position:v3(this.node.position.x+30,this.node.position.y+20), },
|
||||
{position:v3(this.node.position.x-10,this.node.position.y+20), },
|
||||
{
|
||||
onComplete:()=>{ this.ent.destroy()},
|
||||
easing:"linear"
|
||||
@@ -53,20 +51,45 @@ export class TooltipCom extends CCComp {
|
||||
).start()
|
||||
break
|
||||
case 3:
|
||||
|
||||
this.node.getChildByName("skill").getChildByName("name").getComponent(Label).string = smc.skills[this.s_uuid].name;
|
||||
this.node.getChildByName("skill").active=true;
|
||||
this.node.setPosition(v3(this.node.position.x,this.node.position.y+60))
|
||||
// this.alive_time = 2
|
||||
tween(this.node).to(
|
||||
this.alive_time,
|
||||
{position:v3(this.node.position.x,this.node.position.y), },
|
||||
{position:v3(this.node.position.x,this.node.position.y+30), },
|
||||
{
|
||||
onComplete:()=>{ this.ent.destroy()},
|
||||
easing:"linear"
|
||||
}
|
||||
).start()
|
||||
break
|
||||
case 4:
|
||||
this.node.getChildByName("bloss").getChildByName("hp").getComponent(Label).string = this.value;
|
||||
this.node.getChildByName("bloss").active=true;
|
||||
tween(this.node).to(
|
||||
this.alive_time,
|
||||
{position:v3(this.node.position.x-10,this.node.position.y+20), },
|
||||
{
|
||||
onComplete:()=>{ this.ent.destroy()},
|
||||
easing:"linear"
|
||||
}
|
||||
).start()
|
||||
break
|
||||
case 5:
|
||||
this.node.getChildByName("skill").getChildByName("name").getComponent(Label).string = this.value;
|
||||
this.node.getChildByName("skill").active=true;
|
||||
this.node.setPosition(v3(this.node.position.x,this.node.position.y+60))
|
||||
// this.alive_time = 2
|
||||
tween(this.node).to(
|
||||
this.alive_time,
|
||||
{position:v3(this.node.position.x-20,this.node.position.y+30), },
|
||||
{
|
||||
onComplete:()=>{ this.ent.destroy()},
|
||||
easing:"linear"
|
||||
}
|
||||
).start()
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,9 +100,6 @@ export class TooltipCom extends CCComp {
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.getChildByName("loss_life").active=false;
|
||||
this.node.getChildByName("add_life").active=false;
|
||||
this.node.getChildByName("skill").active=false;
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user