diff --git a/assets/resources/gui/role_controller.prefab b/assets/resources/gui/role_controller.prefab index 47c53129..2a291a3c 100644 --- a/assets/resources/gui/role_controller.prefab +++ b/assets/resources/gui/role_controller.prefab @@ -5434,8 +5434,8 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 152.289, - "y": 232.822, + "x": 444.753, + "y": 513.78, "z": 0 }, "_lrot": { diff --git a/assets/script/game/common/config/heroSet.ts b/assets/script/game/common/config/heroSet.ts index b62d3e83..99f599a6 100644 --- a/assets/script/game/common/config/heroSet.ts +++ b/assets/script/game/common/config/heroSet.ts @@ -43,7 +43,7 @@ export const HeroPos={ 1:{pos:v3(-220,0,0)}, 2:{pos:v3(-150,0,0)}, } -export const HeroQuality = { +export const HQuality = { WHITE:1, GREEN:2, BLUE:3, @@ -63,89 +63,89 @@ export const MonSet = { 9:{pos:v3(800,0,0)}, } export const HeroInfo = { - 5001:{uuid:5001,name:"神圣守护",path:"k2", lv:1,kind:1,type:0,hp:50,ap:10,dis:700,a_cd:3,quality:HeroQuality.BLUE, + 5001:{uuid:5001,name:"神圣守护",path:"k2", quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:50,ap:10,dis:700,cd:3, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5002:{uuid:5002,name:"幻影剑豪",path:"k1", lv:1,kind:2,type:0,hp:50,ap:10,dis:700,a_cd:3,quality:HeroQuality.BLUE, + 5002:{uuid:5002,name:"幻影剑豪",path:"k1", quality:HQuality.BLUE,lv:1,kind:2,type:0,hp:50,ap:10,dis:700,cd:3, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5003:{uuid:5003,name:"战争领主",path:"k5", lv:1,kind:2,type:0,hp:50,ap:10,dis:700,a_cd:3,quality:HeroQuality.BLUE, + 5003:{uuid:5003,name:"战争领主",path:"k5", quality:HQuality.BLUE,lv:1,kind:2,type:0,hp:50,ap:10,dis:700,cd:3, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5004:{uuid:5004,name:"混沌法师",path:"zh1", lv:1,kind:2,type:2,hp:50,ap:10,dis:700,a_cd:3.5,quality:HeroQuality.BLUE, + 5004:{uuid:5004,name:"混沌法师",path:"zh1", quality:HQuality.BLUE,lv:1,kind:2,type:2,hp:50,ap:10,dis:700,cd:3.5, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5005:{uuid:5005,name:"火焰法师",path:"zh2", lv:1,kind:2,type:2,hp:50,ap:15,dis:700,a_cd:3.5,quality:HeroQuality.BLUE, + 5005:{uuid:5005,name:"火焰法师",path:"zh2", quality:HQuality.BLUE,lv:1,kind:2,type:2,hp:50,ap:15,dis:700,cd:3.5, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5006:{uuid:5006,name:"风暴精灵",path:"m4", lv:1,kind:2,type:2,hp:50,ap:15,dis:700,a_cd:3.5,quality:HeroQuality.BLUE, + 5006:{uuid:5006,name:"风暴精灵",path:"m4", quality:HQuality.BLUE,lv:1,kind:2,type:2,hp:50,ap:15,dis:700,cd:3.5, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5008:{uuid:5008,name:"战争祭祀",path:"d2", lv:1,kind:2,type:2,hp:50,ap:10,dis:700,a_cd:3.5,quality:HeroQuality.BLUE, + 5008:{uuid:5008,name:"战争祭祀",path:"d2", quality:HQuality.BLUE,lv:1,kind:2,type:2,hp:50,ap:10,dis:700,cd:3.5, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5009:{uuid:5009,name:"暴风射手",path:"a5", lv:1,kind:2,type:1,hp:50,ap:15,dis:700,a_cd:3.2,quality:HeroQuality.BLUE, + 5009:{uuid:5009,name:"暴风射手",path:"a5", quality:HQuality.BLUE,lv:1,kind:2,type:1,hp:50,ap:15,dis:700,cd:3.2, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6002],info:"说明"}, - 5010:{uuid:5010,name:"苍穹射手",path:"a3", lv:1,kind:1,type:1,hp:50,ap:15,dis:700,a_cd:3.2,quality:HeroQuality.BLUE, + 5010:{uuid:5010,name:"苍穹射手",path:"a3", quality:HQuality.BLUE,lv:1,kind:1,type:1,hp:50,ap:15,dis:700,cd:3.2, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6002],info:"说明"}, - 5011:{uuid:5011,name:"幽灵射手",path:"a4", lv:1,kind:2,type:1,hp:50,ap:15,dis:700,a_cd:3.2,quality:HeroQuality.BLUE, + 5011:{uuid:5011,name:"幽灵射手",path:"a4", quality:HQuality.BLUE,lv:1,kind:2,type:1,hp:50,ap:15,dis:700,cd:3.2, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6002],info:"说明"}, //怪物 - 5201:{uuid:5201,name:"兽人战士",path:"mor1", lv:1,kind:1,type:0,hp:200,ap:5,dis:400,a_cd:3,quality:HeroQuality.WHITE, + 5201:{uuid:5201,name:"兽人战士",path:"mor1", quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:200,ap:5,dis:400,cd:3, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5202:{uuid:5202,name:"兽人刺客",path:"mor2", lv:1,kind:1,type:0,hp:200,ap:5,dis:400,a_cd:3,quality:HeroQuality.WHITE, + 5202:{uuid:5202,name:"兽人刺客",path:"mor2", quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:200,ap:5,dis:400,cd:3, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5203:{uuid:5203,name:"兽人护卫",path:"mor3", lv:1,kind:1,type:1,hp:200,ap:5,dis:400,a_cd:3.2,quality:HeroQuality.WHITE, + 5203:{uuid:5203,name:"兽人护卫",path:"mor3", quality:HQuality.BLUE,lv:1,kind:1,type:1,hp:200,ap:5,dis:400,cd:3.2, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5204:{uuid:5204,name:"石卫", path:"mgem1",lv:1,kind:1,type:0,hp:200,ap:5,dis:400,a_cd:3,quality:HeroQuality.WHITE, + 5204:{uuid:5204,name:"石卫", path:"mgem1",quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:200,ap:5,dis:400,cd:3, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5205:{uuid:5205,name:"土卫", path:"mgem2",lv:1,kind:1,type:0,hp:200,ap:5,dis:400,a_cd:3,quality:HeroQuality.WHITE, + 5205:{uuid:5205,name:"土卫", path:"mgem2",quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:200,ap:5,dis:400,cd:3, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5206:{uuid:5206,name:"树人", path:"mgem3",lv:1,kind:1,type:0,hp:200,ap:5,dis:400,a_cd:3,quality:HeroQuality.WHITE, + 5206:{uuid:5206,name:"树人", path:"mgem3",quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:200,ap:5,dis:400,cd:3, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5216:{uuid:5216,name:"元素1", path:"my1", lv:2,kind:1,type:2,hp:200,ap:5,dis:400,a_cd:3.5,quality:HeroQuality.WHITE, + 5216:{uuid:5216,name:"元素1", path:"my1", quality:HQuality.BLUE,lv:2,kind:1,type:2,hp:200,ap:5,dis:400,cd:3.5, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5217:{uuid:5217,name:"元素2", path:"my2", lv:2,kind:1,type:2,hp:200,ap:5,dis:400,a_cd:3.5,quality:HeroQuality.WHITE, + 5217:{uuid:5217,name:"元素2", path:"my2", quality:HQuality.BLUE,lv:2,kind:1,type:2,hp:200,ap:5,dis:400,cd:3.5, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5218:{uuid:5218,name:"元素3", path:"my3", lv:2,kind:1,type:2,hp:200,ap:5,dis:400,a_cd:3.5,quality:HeroQuality.WHITE, + 5218:{uuid:5218,name:"元素3", path:"my3", quality:HQuality.BLUE,lv:2,kind:1,type:2,hp:200,ap:5,dis:400,cd:3.5, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5219:{uuid:5219,name:"牛头战士",path:"mn1", lv:2,kind:1,type:0,hp:200,ap:5,dis:400,a_cd:3,quality:HeroQuality.WHITE, + 5219:{uuid:5219,name:"牛头战士",path:"mn1", quality:HQuality.BLUE,lv:2,kind:1,type:0,hp:200,ap:5,dis:400,cd:3, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5220:{uuid:5220,name:"牛头战士",path:"mn2", lv:1,kind:1,type:1,hp:200,ap:5,dis:400,a_cd:3.2,quality:HeroQuality.WHITE, + 5220:{uuid:5220,name:"牛头战士",path:"mn2", quality:HQuality.BLUE,lv:1,kind:1,type:1,hp:200,ap:5,dis:400,cd:3.2, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5221:{uuid:5221,name:"牛头战士",path:"mn3", lv:1,kind:1,type:0,hp:200,ap:5,dis:400,a_cd:3,quality:HeroQuality.WHITE, + 5221:{uuid:5221,name:"牛头战士",path:"mn3", quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:200,ap:5,dis:400,cd:3, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5222:{uuid:5222,name:"独眼巨人",path:"md1", lv:1,kind:1,type:0,hp:200,ap:5,dis:400,a_cd:3,quality:HeroQuality.WHITE, + 5222:{uuid:5222,name:"独眼巨人",path:"md1", quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:200,ap:5,dis:400,cd:3, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5223:{uuid:5223,name:"独眼巨人",path:"md2", lv:1,kind:1,type:0,hp:200,ap:5,dis:400,a_cd:3,quality:HeroQuality.WHITE, + 5223:{uuid:5223,name:"独眼巨人",path:"md2", quality:HQuality.BLUE,lv:1,kind:1,type:0,hp:200,ap:5,dis:400,cd:3, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5224:{uuid:5224,name:"独眼巨人",path:"md3", lv:1,kind:1,type:1,hp:200,ap:5,dis:400,a_cd:3.2,quality:HeroQuality.WHITE, + 5224:{uuid:5224,name:"独眼巨人",path:"md3", quality:HQuality.BLUE,lv:1,kind:1,type:1,hp:200,ap:5,dis:400,cd:3.2, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5225:{uuid:5225,name:"精英独眼",path:"md4", lv:1,kind:1,type:2,hp:200,ap:5,dis:400,a_cd:3,quality:HeroQuality.WHITE, + 5225:{uuid:5225,name:"精英独眼",path:"md4", quality:HQuality.BLUE,lv:1,kind:1,type:2,hp:200,ap:5,dis:400,cd:3, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5226:{uuid:5226,name:"精英牛头",path:"mn4", lv:1,kind:1,type:2,hp:200,ap:5,dis:400,a_cd:3,quality:HeroQuality.WHITE, + 5226:{uuid:5226,name:"精英牛头",path:"mn4", quality:HQuality.BLUE,lv:1,kind:1,type:2,hp:200,ap:5,dis:400,cd:3, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"}, - 5227:{uuid:5227,name:"精英兽人",path:"mor4", lv:1,kind:1,type:2,hp:200,ap:5,dis:400,a_cd:3,quality:HeroQuality.WHITE, + 5227:{uuid:5227,name:"精英兽人",path:"mor4", quality:HQuality.BLUE,lv:1,kind:1,type:2,hp:200,ap:5,dis:400,cd:3, crit:5,crit_d:0,crit_no:false,dod:0,dod_no:false,speed:50,skills:[6001],info:"说明"} }; diff --git a/assets/script/game/hero/BuffComp.ts b/assets/script/game/hero/BuffComp.ts index bc9be75a..1c2d8a97 100644 --- a/assets/script/game/hero/BuffComp.ts +++ b/assets/script/game/hero/BuffComp.ts @@ -60,6 +60,7 @@ export class BuffComp extends Component { this.vmdata_update() } to_update_vmdata(){ + this.vmdata_update(false) } update(deltaTime: number) { @@ -91,7 +92,9 @@ export class BuffComp extends Component { } vmdata_update(is_hp:boolean=false){ - console.log("[BuffComp]:vmdata_update",is_hp) + if(this.HeroView.is_kalami) return + console.log("[BuffComp]:to_update_vmdata:"+this.HeroView.hero_name) + let buff=null let info= null if(!this.HeroView) return @@ -104,12 +107,12 @@ export class BuffComp extends Component { let view_deatk = 0 //临时debuff if(is_hp){ info.hp=this.HeroView.hp - info.hp_max=this.HeroView.hp_max*(100+buff.HP)/100 info.hp_buff=buff.HP + info.hp_max=this.HeroView.hp_max*(100+buff.HP)/100 }else{ info.hp=this.HeroView.hp - info.hp_max=this.HeroView.hp_max*(100+buff.HP)/100 info.hp_buff=buff.HP + info.hp_max=this.HeroView.hp_max*(100+buff.HP)/100 for(let i=0;i(FriendModelComp); // const move = this.get(BattleMoveComp); @@ -90,7 +91,7 @@ export class Hero extends ecs.Entity { hv.hero_name= hero.name; hv.speed =hv.ospeed = hero.speed; hv.dis = hero.dis; - hv.cd = hero.a_cd + hv.cd = hero.cd hv.hp= hv.hp_max =hero.hp+info.hp hv.ap = hero.ap+info.ap; hv.crit=hero.crit+info.crit diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index d177bccc..6ae12b36 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -30,11 +30,9 @@ export class HeroViewComp extends CCComp { hero_name : string = "hero"; fight_pos:number=0; lv:number =1; - slv:number =1; scale: number = 1; /** 角色阵营 1:hero -1 :mon */ type: number = 0; /**角色类型 0近战-需要贴身 1远程-保持距离 2辅助 */ fac:number=0; //阵营 0:hero 1:monster - atk_range:number = 150; box_group:number = BoxSet.HERO; @@ -47,21 +45,20 @@ export class HeroViewComp extends CCComp { is_master:boolean =false; is_friend:boolean =false; is_kalami:boolean =false; - ap_u:number=0; - ap_ur:number=0; - hp_up:number=0; + hp: number = 100; /** 血量 */ hp_max: number = 100; /** 最大血量 */ - hp_buff:number=0; - hp_speed: number = 0; //每秒回复量 + buff_hp:number=0; pwt:Timer = new Timer(1); //计时器 ap: number = 10; /**攻击力 */ + buff_ap:number=0; // atk_speed: number = 1; cd: number = 1.3; /**攻击速度 攻击间隔 */ dis: number = 80; at: number = 0; /** 冷却时间 */ atk_skill:number=0; + def: number = 0; //防御 vun: number = 0; //易伤 @@ -79,12 +76,12 @@ export class HeroViewComp extends CCComp { atked_count: number = 0; atk_add_count:number=0; stop_cd: number = 0; /*停止倒计时*/ - dir_y:number = 0; speek_time:number = 0; - is_stop_temp:boolean = false;i + is_stop_temp:boolean = false Friend_alive_cd:Timer=new Timer(10) double_dead:boolean=false double_atked:boolean=false + BUFF_DEFS: Array<{value: number, count: number}> = [] BUFF_ATKS: Array<{value: number, count: number}> = [] BUFF_CDS: Array<{value: number, count: number}> = [] @@ -127,11 +124,8 @@ export class HeroViewComp extends CCComp { } /* 显示角色血量 */ this.node.getChildByName("top").getChildByName("hp").active = true; - if(!this.is_master&&this.fac==FacSet.HERO){ - this.is_friend=true - } - if(this.fac==FacSet.MON&&!this.is_boss&&!this.is_big_boss){ - this.is_kalami=true + if(this.is_friend){ //只有伙伴需要召唤后添加hp 怪物,和boss 不要设置减hp debuff 主要 一开始就战斗开始就存在,所以不需要 + this.hp+=this.FIGHTCON.friend_buff.HP*this.hp_max/100 } } @@ -237,34 +231,25 @@ export class HeroViewComp extends CCComp { update_hp(e:GameEvent,data:any){ console.log("[HeroViewComp]:update_hp",data) if(this.is_master===data.is_master&&this.fac===FacSet.HERO){ - this.hp_buff += data.hp + this.buff_hp += data.hp if(data.hp > 0){ this.hp += this.hp_max*data.hp/100 - if(this.hp > this.hp_max*(100+this.hp_buff/100)){ - this.hp=this.hp_max*(100+this.hp_buff/100) + if(this.hp > this.hp_max*(100+this.buff_hp/100)){ + this.hp=this.hp_max*(100+this.buff_hp/100) } } } } add_hp_max(hp: number=0,is_num:boolean=true){ - console.log("[HeroViewComp]:add_hp_max add:",hp,this.hp_max) - if(is_num){ - this.hp_max += Math.floor(hp) ; - this.hp += Math.floor(hp) ; - }else{ - this.hp_max += Math.floor(hp/100*this.hp_max); - this.hp += Math.floor(hp/100*this.hp_max); - } + this.hp_max += Math.floor(hp) ; + this.hp += Math.floor(hp*(100+this.buff_hp)/100) ; this.BUFFCOMP.update_info_hp() + } - de_hp_max(hp: number=0,is_num:boolean=true){ + de_hp_max(hp: number=0,is_num:boolean=true){ //最大值 只存在数值添加, 比例通过buff_hp处理 console.log("[HeroViewComp]:de_hp_max de:",hp,this.hp_max) - if(is_num){ - this.hp_max -= Math.floor(hp) ; - }else{ - this.hp_max -= Math.floor(hp/100*this.hp_max); - } + this.hp_max -= Math.floor(hp) ; this.BUFFCOMP.update_info_hp() this.BUFFCOMP.vmdata_update(true) } @@ -539,7 +524,7 @@ export class HeroViewComp extends CCComp { } to_alive(){ this.is_dead=false - this.hp=this.hp_max + this.hp=this.hp_max*(100+this.buff_hp)/100 this.BUFFCOMP.update_info_hp() this.node.setPosition(HeroPos[this.fight_pos].pos) this.BUFFCOMP.heathed() diff --git a/assets/script/game/hero/Mon.ts b/assets/script/game/hero/Mon.ts index 14a41730..93116a1e 100644 --- a/assets/script/game/hero/Mon.ts +++ b/assets/script/game/hero/Mon.ts @@ -59,6 +59,9 @@ export class Monster extends ecs.Entity { hv.fac = FacSet.MON; hv.type = hero.type; hv.is_boss = is_boss; + if(!is_boss){ + hv.is_kalami=true + } hv.box_group = box_group; hv.hero_uuid= uuid; hv.hero_name= hero.name; @@ -66,13 +69,14 @@ export class Monster extends ecs.Entity { hv.dis = hero.dis; hv.hp= hv.hp_max =hero.hp; hv.ap = hero.ap; - hv.cd = hero.a_cd + hv.cd = hero.cd hv.crit=hero.crit hv.crit_d=hero.crit_d hv.dod=hero.dod hv.dod_no=hero.dod_no hv.crit_no=hero.crit_no hv.atk_skill=hero.skills[0] + this.add(hv); } diff --git a/assets/script/game/map/BarComp.ts b/assets/script/game/map/BarComp.ts index 0a7c6a7b..4ffb9a55 100644 --- a/assets/script/game/map/BarComp.ts +++ b/assets/script/game/map/BarComp.ts @@ -57,11 +57,7 @@ export class BarCompComp extends CCComp { } update_bar(){ if(!this.get_hero()) return - let hp_bar = this.hero_bar.getChildByName("hp").getChildByName("bar").getComponent(ProgressBar) - let ap_bar = this.hero_bar.getChildByName("ap").getChildByName("val").getComponent(Label) - let ap =this.hero.ap+"("+this.hero.ap_ur+")" - hp_bar.progress = this.hero.hp/this.hero.hp_max - ap_bar.string = ap.toString() + } /** 全局消息逻辑处理 */ // private onHandler(event: string, args: any) {