hero 添加了buff up max 特效,hero设定继续完善
This commit is contained in:
@@ -1,74 +1,20 @@
|
||||
|
||||
export const HeroSet = {
|
||||
9001: {
|
||||
uuid: 9001, path: "k1", type: 1, lv: 1,name: "白骑士", wp:1001,arm:2001,ring:3001,shoes:4001,
|
||||
atk: 20, atk_rate:0.1, hp: 100, hp_rate:0.1, def:10,def_rate:0.1, dis: 100, atk_cd: 1, power: 0, power_max: 15, speed: 40,
|
||||
uuid: 9001, path: "k1", type: 1, lv: 1,name: "白骑士", wp:1001,arm:2001,ring:3001,shoes:4001,lv2:5,lv3:10,lv4:20,lv5:30,ae_add:1,uae_add:1,
|
||||
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,
|
||||
sk1: 9001, sk2: 2002, sk3: 9001, sk4: 2002, sk5: 9001, sk6: 2002, atktype: 1,
|
||||
},
|
||||
|
||||
|
||||
|
||||
1011: {
|
||||
uuid: 1011, path: "orc1", type: 1, level: 1,cost:2, name: "森林兽人", atk: 5, hp: 15, atk_dis: 100, atk_cd: 2, power: 0, power_max: 20, speed: 30,
|
||||
max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, atktype: 1
|
||||
},
|
||||
1012: {
|
||||
uuid: 1012, path: "orc2", type: 1, level: 1,cost:2, name: "荒野兽人", atk: 10, hp: 15, atk_dis: 100, atk_cd: 2, power: 0, power_max: 20, speed: 30,
|
||||
max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, atktype: 1
|
||||
},
|
||||
1013: {
|
||||
uuid: 1013, path: "orc3", type: 1, level: 1,cost:2, name: "兽人战士", atk: 15, hp: 15, atk_dis: 100, atk_cd: 2, power: 0, power_max: 20, speed: 30,
|
||||
max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, atktype: 1
|
||||
},
|
||||
|
||||
1031: {
|
||||
uuid: 1031, path: "du1", type: 1, level: 1,cost:2, name: "独眼巨人", atk: 5, hp: 15, atk_dis: 100, atk_cd: 2, power: 0, power_max: 10, speed: 30,
|
||||
max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, atktype: 1
|
||||
},
|
||||
1032: {
|
||||
uuid: 1032, path: "du2", type: 1, level: 1,cost:2, name: "狂暴独眼", atk: 10, hp: 15, atk_dis: 100, atk_cd: 2, power: 0, power_max: 10, speed: 30,
|
||||
max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, atktype: 1
|
||||
},
|
||||
1033: {
|
||||
uuid: 1033, path: "du3", type: 1, level: 1,cost:2, name: "独眼首领", atk: 15, hp: 15, atk_dis: 100, atk_cd: 2, power: 0, power_max: 10, speed: 30,
|
||||
max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, atktype: 1
|
||||
},
|
||||
5001: {
|
||||
uuid: 5001, path: "boss1", type: 1, level: 1,cost:2, name: "骷髅王", atk: 30, hp: 150, atk_dis: 200, atk_cd: 2, power: 0, power_max: 10, speed: 7,
|
||||
uuid: 5001, path: "boss1", type: 1, level: 1,cost:2, name: "骷髅王", atk: 30, hp: 150, atk_dis: 200, a_cd: 2, power: 0, power_max: 10, speed: 7,
|
||||
max_skill: "精准打击", skill_uuid: 1001, max_skill_uuid: 1002, atktype: 1
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
export const MonSet = {
|
||||
1011: {
|
||||
uuid: 1011, path: "orc1", type: 1, level: 1,cost:2, name: "森林兽人", atk: 5, hp: 15, atk_dis: 100, atk_cd: 2, power: 0, power_max: 20, speed: 30,
|
||||
max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, atktype: 1
|
||||
},
|
||||
1012: {
|
||||
uuid: 1012, path: "orc2", type: 1, level: 1,cost:2, name: "荒野兽人", atk: 10, hp: 15, atk_dis: 100, atk_cd: 2, power: 0, power_max: 20, speed: 30,
|
||||
max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, atktype: 1
|
||||
},
|
||||
1013: {
|
||||
uuid: 1013, path: "orc3", type: 1, level: 1,cost:2, name: "兽人战士", atk: 15, hp: 15, atk_dis: 100, atk_cd: 2, power: 0, power_max: 20, speed: 30,
|
||||
max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, atktype: 1
|
||||
},
|
||||
|
||||
1031: {
|
||||
uuid: 1031, path: "du1", type: 1, level: 1,cost:2, name: "独眼巨人", atk: 5, hp: 15, atk_dis: 100, atk_cd: 2, power: 0, power_max: 10, speed: 30,
|
||||
max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, atktype: 1
|
||||
},
|
||||
1032: {
|
||||
uuid: 1032, path: "du2", type: 1, level: 1,cost:2, name: "狂暴独眼", atk: 10, hp: 15, atk_dis: 100, atk_cd: 2, power: 0, power_max: 10, speed: 30,
|
||||
max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, atktype: 1
|
||||
},
|
||||
1033: {
|
||||
uuid: 1033, path: "du3", type: 1, level: 1,cost:2, name: "独眼首领", atk: 15, hp: 15, atk_dis: 100, atk_cd: 2, power: 0, power_max: 10, speed: 30,
|
||||
max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, atktype: 1
|
||||
},
|
||||
5001: {
|
||||
uuid: 5001, path: "boss1", type: 1, level: 1,cost:2, name: "骷髅王", atk: 30, hp: 150, atk_dis: 200, atk_cd: 2, power: 0, power_max: 10, speed: 7,
|
||||
max_skill: "精准打击", skill_uuid: 1001, max_skill_uuid: 1002, atktype: 1
|
||||
},
|
||||
|
||||
}
|
||||
@@ -88,8 +88,8 @@ export class Hero extends ecs.Entity {
|
||||
hv.sk5 = hero_set.sk5;
|
||||
hv.type = hero_set.type;
|
||||
hv.hp= hv.hp_max =hero_set.hp;
|
||||
hv.atk = hero_set.atk;
|
||||
hv.atk_cd = hero_set.atk_cd
|
||||
hv.ap = hero_set.ap;
|
||||
hv.cd = hero_set.a_cd
|
||||
hv.power_max= hero_set.power_max
|
||||
this.add(hv);
|
||||
}
|
||||
|
||||
@@ -74,13 +74,13 @@ export class HeroViewComp extends CCComp {
|
||||
sk4:number = 1001;
|
||||
sk5:number = 1001;
|
||||
|
||||
atk: number = 10; /**攻击力 */
|
||||
atk_buff: number = 0;
|
||||
atk_buffs:any = [];
|
||||
ap: number = 10; /**攻击力 */
|
||||
ap_buff: number = 0;
|
||||
ap_buffs:any = [];
|
||||
// atk_speed: number = 1;
|
||||
atk_cd: number = 1.3; /**攻击速度 攻击间隔 */
|
||||
cd: number = 1.3; /**攻击速度 攻击间隔 */
|
||||
dis: number = 80;
|
||||
atk_time: number = 0; /** 冷却时间 */
|
||||
at: number = 0; /** 冷却时间 */
|
||||
|
||||
def: number = 0; //防御
|
||||
vun: number = 0; //易伤
|
||||
@@ -125,11 +125,11 @@ export class HeroViewComp extends CCComp {
|
||||
// this.node.getChildByName("shielded").active = false;
|
||||
// this.node.getChildByName("top").setScale(this.scale,1);
|
||||
// this.node.getChildByName("atk").setScale(this.scale,1);
|
||||
// this.node.getChildByName("atk").getComponent(Label).string = this.atk.toString();
|
||||
// this.node.getChildByName("atk").getComponent(Label).string = this.ap.toString();
|
||||
// this.node.getChildByName("hp_max").setScale(this.scale,1);
|
||||
// this.node.getChildByName("hp_max").getComponent(Label).string=this.hp_max.toString();
|
||||
// this.BoxRang.getComponent(BoxRangComp).box_group = this.box_group;
|
||||
// this.BoxRang.getComponent(BoxRangComp).atk_range = this.atk_range
|
||||
// this.BoxRang.getComponent(BoxRangComp).atk_range = this.ap_range
|
||||
// this.BoxRang.getComponent(BoxRangComp).offset_x = 300;
|
||||
// console.log("monseter ",this.BoxRang);
|
||||
// console.log("monseter ",this.BoxRang);
|
||||
@@ -230,7 +230,7 @@ export class HeroViewComp extends CCComp {
|
||||
// }
|
||||
this.check_atk_buffs(dt)
|
||||
this.in_stop(dt);
|
||||
this.atk_time += dt;
|
||||
this.at += dt;
|
||||
this.check_enemy_alive()
|
||||
this.in_atk(dt);
|
||||
// this.hp_show()
|
||||
@@ -373,8 +373,8 @@ 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.atk*smc.vm_data.mission.hero.atk)
|
||||
let atk = smc.skills[sk1].atk+this.atk_buff+increase_atk;
|
||||
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 {pos,t_pos}=this.get_enemy_pos()
|
||||
|
||||
pos.y=pos.y + y
|
||||
@@ -385,15 +385,15 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
to_add_buff(hero:any,s_uuid:number){
|
||||
let skill = ecs.getEntity<Skill>(Skill);
|
||||
let atk = smc.skills[s_uuid].atk+this.atk;
|
||||
let atk = smc.skills[s_uuid].atk+this.ap;
|
||||
let {pos,t_pos}=this.get_hero_pos(hero)
|
||||
skill.load(pos,this.box_group,this.node,this.sk2,atk,t_pos);
|
||||
if(smc.skills[s_uuid].hp > 0){ //buff加血
|
||||
let increase_hp=Math.floor(smc.skills[s_uuid].hp*this.atk)
|
||||
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.atk)
|
||||
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].shield > 0){ //buff护盾
|
||||
@@ -481,10 +481,10 @@ export class HeroViewComp extends CCComp {
|
||||
|
||||
|
||||
in_atk(dt: number) {
|
||||
if(this.atk_time >= this.atk_cd){
|
||||
if(this.at >= this.cd){
|
||||
if(this.is_atking){
|
||||
this.atk_time = 0;
|
||||
console.log("atk_cd:"+this.atk_cd);
|
||||
this.at = 0;
|
||||
console.log("cd:"+this.cd);
|
||||
this.as.atk();
|
||||
this.scheduleOnce(()=>{
|
||||
this.handle_skill(this.sk1)
|
||||
@@ -544,29 +544,29 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
add_atk(atk: number,time:number=0){
|
||||
if(time > 0){
|
||||
this.atk_buff=0
|
||||
this.ap_buff=0
|
||||
let buff={atk:atk,time:time}
|
||||
this.atk_buffs.push(buff);
|
||||
this.atk_buffs.forEach((element: { atk: number; }) => {
|
||||
this.atk_buff += element.atk
|
||||
this.ap_buffs.push(buff);
|
||||
this.ap_buffs.forEach((element: { atk: number; }) => {
|
||||
this.ap_buff += element.atk
|
||||
});
|
||||
}else{
|
||||
this.atk += atk;
|
||||
this.ap += atk;
|
||||
}
|
||||
// console.log(this.atk_buffs)
|
||||
// console.log(this.ap_buffs)
|
||||
}
|
||||
|
||||
check_atk_buffs(dt: number){
|
||||
for(let i=0;i<this.atk_buffs.length;i++){
|
||||
let buff=this.atk_buffs[i];
|
||||
for(let i=0;i<this.ap_buffs.length;i++){
|
||||
let buff=this.ap_buffs[i];
|
||||
buff.time -= dt;
|
||||
if(buff.time <= 0){
|
||||
this.atk_buff -= buff.atk
|
||||
this.atk_buffs.splice(i,1);
|
||||
this.ap_buff -= buff.atk
|
||||
this.ap_buffs.splice(i,1);
|
||||
}
|
||||
}
|
||||
if(this.atk_buffs.length <= 0){
|
||||
this.atk_buff = 0
|
||||
if(this.ap_buffs.length <= 0){
|
||||
this.ap_buff = 0
|
||||
// this.buff_icon_change("atk",false)
|
||||
this.sprite.setSharedMaterial(this.orginalFlashMaterial, 0);
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user