From 6d233253adda8455b74499a51d443e257babb22b Mon Sep 17 00:00:00 2001 From: walkpan Date: Mon, 23 Sep 2024 23:29:36 +0800 Subject: [PATCH] dd --- .../script/game/common/SingletonModuleComp.ts | 4 +-- assets/script/game/common/config/heroSet.ts | 26 +++++++++---------- assets/script/game/hero/Hero.ts | 6 ++--- assets/script/game/hero/HeroViewComp.ts | 16 +++++++----- assets/script/game/map/CardController.ts | 13 ++++------ assets/script/game/mon/MonViewComp.ts | 15 ++++++----- 6 files changed, 41 insertions(+), 39 deletions(-) diff --git a/assets/script/game/common/SingletonModuleComp.ts b/assets/script/game/common/SingletonModuleComp.ts index b5bd2a12..77b655be 100644 --- a/assets/script/game/common/SingletonModuleComp.ts +++ b/assets/script/game/common/SingletonModuleComp.ts @@ -91,12 +91,12 @@ export class SingletonModuleComp extends ecs.Comp { hero:{ atk:1, atk_cd:1, - hp:0, + hp:1, }, role:{ atk:1, atk_cd:1, - hp:0, + hp:1, } }, role:{ diff --git a/assets/script/game/common/config/heroSet.ts b/assets/script/game/common/config/heroSet.ts index ea82e150..06e88c4a 100644 --- a/assets/script/game/common/config/heroSet.ts +++ b/assets/script/game/common/config/heroSet.ts @@ -1,31 +1,31 @@ export const HeroSet = { 9001: { - uuid: 9001, path: "k3", type: 1, level: 1,cost:2, name: "骑士", atk: 4, hp: 60, atk_dis: 40, atk_cd: 1, power: 0, power_max: 20, speed: 40, + uuid: 9001, path: "k3", type: 1, level: 1,cost:2, name: "骑士", atk: 10, hp: 100, atk_dis: 40, atk_cd: 1, power: 0, power_max: 20, speed: 40, max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 2002, word: "守护", info: "自身护盾", atktype: 1, }, 9002: { - uuid: 9002, path: "k1", type: 1, level: 1,cost:2, name: "战士", atk: 8, hp: 30, atk_dis: 40, atk_cd: 1, power: 0, power_max: 20, speed: 40, + uuid: 9002, path: "k1", type: 1, level: 1,cost:2, name: "战士", atk: 20, hp: 50, atk_dis: 40, atk_cd: 1, power: 0, power_max: 20, speed: 40, max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 2003, word: "守护", info: "自身护盾", atktype: 1, }, 9011: { - uuid: 9004, path: "m1", type: 3, level: 1,cost:2, name: "冰法", atk: 15, hp: 20, atk_dis: 260, atk_cd: 2.5, power: 0, power_max: 20, speed: 30, + uuid: 9004, path: "m1", type: 3, level: 1,cost:2, name: "冰法", atk: 25, hp: 50, atk_dis: 260, atk_cd: 2.5, power: 0, power_max: 20, speed: 30, max_skill: "寒冰箭", skill_uuid: 9002, max_skill_uuid: 1002, word: "守护", info: "自身护盾", atktype: 1, }, 9021: { - uuid: 9006, path: "m3", type: 3, level: 1,cost:2, name: "火法", atk: 10, hp: 20, atk_dis: 260, atk_cd: 2, power: 0, power_max: 20, speed: 30, + uuid: 9006, path: "m3", type: 3, level: 1,cost:2, name: "火法", atk: 20, hp: 50, atk_dis: 260, atk_cd: 2, power: 0, power_max: 20, speed: 30, max_skill: "火球术", skill_uuid: 9002, max_skill_uuid: 1001, word: "守护", info: "自身护盾", atktype: 2 }, 9031: { - uuid: 9005, path: "m2", type: 3, level: 1,cost:2, name: "牧师", atk: 3, hp: 20, atk_dis: 260, atk_cd: 2, power: 15, power_max: 20, speed: 30, + uuid: 9005, path: "m2", type: 3, level: 1,cost:2, name: "牧师", atk: 10, hp: 50, atk_dis: 260, atk_cd: 2, power: 1, power_max: 1, speed: 30, max_skill: "治愈术", skill_uuid: 9002, max_skill_uuid: 2001, word: "守护", info: "自身护盾", atktype: 2 }, 9041: { - uuid: 9009, path: "arc1", type: 2, level: 1,cost:2, name: "弓箭手", atk: 5, hp: 30, atk_dis: 200, atk_cd: 1.5, power: 0, power_max: 20, speed: 30, + uuid: 9009, path: "arc1", type: 2, level: 1,cost:2, name: "弓箭手", atk: 15, hp: 50, atk_dis: 200, atk_cd: 1.5, power: 0, power_max: 20, speed: 30, max_skill: "精准射击", skill_uuid: 9003, max_skill_uuid: 1003, word: "狂暴", info: "全体攻击", atktype: 2 }, @@ -34,34 +34,34 @@ export const HeroSet = { export const MonSet = { 1011: { - uuid: 1011, path: "orc1", type: 1, level: 1,cost:2, name: "森林兽人", atk: 8, hp: 30, atk_dis: 40, atk_cd: 2, power: 0, power_max: 20, speed: 30, + uuid: 1011, path: "orc1", type: 1, level: 1,cost:2, name: "森林兽人", atk: 10, hp: 100, atk_dis: 40, atk_cd: 2, power: 0, power_max: 20, speed: 30, max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, word: "守护", info: "自身护盾", atktype: 1 }, 1012: { - uuid: 1012, path: "orc2", type: 1, level: 1,cost:2, name: "荒野兽人", atk: 8, hp: 40, atk_dis: 40, atk_cd: 2, power: 0, power_max: 20, speed: 30, + uuid: 1012, path: "orc2", type: 1, level: 1,cost:2, name: "荒野兽人", atk: 15, hp: 100, atk_dis: 40, atk_cd: 2, power: 0, power_max: 20, speed: 30, max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, word: "守护", info: "自身护盾", atktype: 1 }, 1013: { - uuid: 1013, path: "orc3", type: 1, level: 1,cost:2, name: "兽人战士", atk: 8, hp: 60, atk_dis: 40, atk_cd: 2, power: 0, power_max: 20, speed: 30, + uuid: 1013, path: "orc3", type: 1, level: 1,cost:2, name: "兽人战士", atk: 20, hp: 100, atk_dis: 40, atk_cd: 2, power: 0, power_max: 20, speed: 30, max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, word: "守护", info: "自身护盾", atktype: 1 }, 1031: { - uuid: 1031, path: "du1", type: 1, level: 1,cost:2, name: "独眼巨人", atk: 4, hp: 50, atk_dis: 40, atk_cd: 2, power: 0, power_max: 10, speed: 30, + uuid: 1031, path: "du1", type: 1, level: 1,cost:2, name: "独眼巨人", atk: 10, hp: 100, atk_dis: 40, atk_cd: 2, power: 0, power_max: 10, speed: 30, max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, word: "守护", info: "自身护盾", atktype: 1 }, 1032: { - uuid: 1032, path: "du2", type: 1, level: 1,cost:2, name: "狂暴独眼", atk: 5, hp: 60, atk_dis: 40, atk_cd: 2, power: 0, power_max: 10, speed: 30, + uuid: 1032, path: "du2", type: 1, level: 1,cost:2, name: "狂暴独眼", atk: 15, hp: 100, atk_dis: 40, atk_cd: 2, power: 0, power_max: 10, speed: 30, max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, word: "守护", info: "自身护盾", atktype: 1 }, 1033: { - uuid: 1033, path: "du3", type: 1, level: 1,cost:2, name: "独眼首领", atk: 6, hp: 100, atk_dis: 40, atk_cd: 2, power: 0, power_max: 10, speed: 30, + uuid: 1033, path: "du3", type: 1, level: 1,cost:2, name: "独眼首领", atk: 20, hp: 100, atk_dis: 40, atk_cd: 2, power: 0, power_max: 10, speed: 30, max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 0, word: "守护", info: "自身护盾", atktype: 1 }, 5001: { - uuid: 5001, path: "boss1", type: 1, level: 1,cost:2, name: "骷髅王", atk: 20, hp: 1000, 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: 1000, atk_dis: 200, atk_cd: 2, power: 0, power_max: 10, speed: 7, max_skill: "精准打击", skill_uuid: 1001, max_skill_uuid: 1002, word: "守护", info: "自身护盾", atktype: 1 }, diff --git a/assets/script/game/hero/Hero.ts b/assets/script/game/hero/Hero.ts index 8537faff..eb0f6389 100644 --- a/assets/script/game/hero/Hero.ts +++ b/assets/script/game/hero/Hero.ts @@ -62,14 +62,14 @@ export class Hero extends ecs.Entity { hv.speed =hv.ospeed = hero_set.speed; hv.hero_uuid= uuid; hv.hero_name= hero_set.name; - hv.hp= hv.hp_max = hero_set.hp*(1+smc.vm_data.talent[11].bonus*smc.vm_data.talent[11].lv)*smc.vm_data.mission.hero.hp; - hv.level = hero_set.level; - hv.atk = hero_set.atk*(1+smc.vm_data.talent[12].bonus*smc.vm_data.talent[12].lv); + hv.hp= hv.hp_max =Math.floor(hero_set.hp*(1+smc.vm_data.talent[11].bonus*smc.vm_data.talent[11].lv)*smc.vm_data.mission.hero.hp); + hv.atk = Math.floor(hero_set.atk*(1+smc.vm_data.talent[12].bonus*smc.vm_data.talent[12].lv)) hv.atk_cd = hero_set.atk_cd*(1-smc.vm_data.talent[13].bonus*smc.vm_data.talent[13].lv); hv.st_boncus=1+smc.vm_data.talent[15].bonus*smc.vm_data.talent[15].lv; hv.s_boncus=1+smc.vm_data.talent[16].bonus*smc.vm_data.talent[16].lv; hv.atk_dis = hero_set.atk_dis; hv.power = hero_set.power; + hv.level = hero_set.level; hv.power_max= hero_set.power_max*(1-smc.vm_data.talent[14].bonus*smc.vm_data.talent[14].lv);; hv.type = hero_set.type; hv.skill_uuid = hero_set.skill_uuid; diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 33bea13b..646711a9 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -288,7 +288,8 @@ export class HeroViewComp extends CCComp { shoot_enemy(skill_uuid:number,y:number=0,x:number=0){ // console.log("mon shoot_enemy"); let skill = ecs.getEntity(Skill); - let atk = smc.skills[skill_uuid].atk+this.atk*smc.vm_data.mission.hero.atk+this.buff_atk; + let increase_atk=Math.floor(this.atk*smc.vm_data.mission.hero.atk) + let atk = smc.skills[skill_uuid].atk+this.buff_atk+increase_atk; let {pos,t_pos}=this.get_enemy_pos() pos.y=pos.y + y @@ -302,13 +303,16 @@ export class HeroViewComp extends CCComp { let {pos,t_pos}=this.get_hero_pos(hero) skill.load(pos,BoxSet.HERO,this.node,this.max_skill_uuid,atk,t_pos); if(smc.skills[s_uuid].hp > 0){ //buff加血 - hero.HeroView.add_hp(smc.skills[s_uuid].hp*this.atk*this.s_boncus*smc.vm_data.mission.hero.atk) + let increase_hp=Math.floor(smc.skills[s_uuid].hp*this.atk*this.s_boncus*smc.vm_data.mission.hero.atk) + hero.HeroView.add_hp(increase_hp) } if(smc.skills[s_uuid].atk > 0){ //buff加攻击 - hero.HeroView.add_atk(smc.skills[s_uuid].atk*this.atk*this.s_boncus*smc.vm_data.mission.hero.atk,smc.skills[s_uuid].bsd*this.st_boncus) + let increase_atk=Math.floor(smc.skills[s_uuid].atk*this.atk*this.s_boncus*smc.vm_data.mission.hero.atk) + hero.HeroView.add_atk(increase_atk,smc.skills[s_uuid].bsd*this.st_boncus) } if(smc.skills[s_uuid].shield > 0){ //buff护盾 - hero.HeroView.add_shield(smc.skills[s_uuid].shield*this.atk*this.s_boncus*smc.vm_data.mission.hero.atk,smc.skills[s_uuid].bsd*this.st_boncus) + let increase_shield=Math.floor(smc.skills[s_uuid].shield*this.atk*this.s_boncus*smc.vm_data.mission.hero.atk) + hero.HeroView.add_shield(increase_shield,smc.skills[s_uuid].bsd*this.st_boncus) } } push_least_buff(skill:number){ @@ -419,8 +423,8 @@ export class HeroViewComp extends CCComp { } add_hp_max(hp: number=0){ this.hp_max_add() - // this.hp = this.hp + hp; - // this.hp_max = this.hp_max +hp; + this.hp += hp; + this.hp_max += hp; console.log("hp_max:"+this.hp_max+":"+hp+":"+this.hp) let hp_progress= this.hp/this.hp_max; this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress; diff --git a/assets/script/game/map/CardController.ts b/assets/script/game/map/CardController.ts index 860c78dd..d2fcfc1f 100644 --- a/assets/script/game/map/CardController.ts +++ b/assets/script/game/map/CardController.ts @@ -397,17 +397,16 @@ export class CardControllerComp extends CCComp { this.node.getChildByName('rewards').active = false; smc.vm_data.game_pause = false; let reward=this.rewards[value] - console.log("reward:",this.rewards,value) if(reward.type==1){ if(reward.atk > 0){ - smc.vm_data.mission.hero.atk += reward.atk*100; + smc.vm_data.mission.hero.atk += reward.atk / 100 } if(reward.atk_cd > 0){ - smc.vm_data.mission.hero.atk_cd -= reward.atk_cd/100; + smc.vm_data.mission.hero.atk_cd -= reward.atk_cd/100 } if(reward.hp > 0){ - smc.vm_data.mission.hero.hp += reward.hp; - this.add_hero_hp_max(reward.hp) + smc.vm_data.mission.hero.hp += reward.hp / 100; + this.add_hero_hp_max(reward.hp / 100) } } } @@ -422,13 +421,11 @@ export class CardControllerComp extends CCComp { } add_hero_hp_max(hp:number){ let heros:any = ecs.query(ecs.allOf(HeroModelComp)); - console.log("heros:",heros) if (heros.length > 0) { for (let i = 0; i < heros.length; i++) { let hero = heros[i]; if(!hero.HeroView) continue - let add_hp=smc.heros[hero.HeroView.hero_uuid].hp*hp/100 - hero.HeroView.add_hp_max(add_hp) + hero.HeroView.add_hp_max(Math.floor(hero.HeroView.hp_max*hp)) } } } diff --git a/assets/script/game/mon/MonViewComp.ts b/assets/script/game/mon/MonViewComp.ts index cbadb84c..892147ac 100644 --- a/assets/script/game/mon/MonViewComp.ts +++ b/assets/script/game/mon/MonViewComp.ts @@ -149,6 +149,7 @@ export class MonViewComp extends CCComp { if(selfCollider.group != otherCollider.group&&otherCollider.tag == 0){ this.stop_cd = 0.1; this.is_atking=true + } } onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D) {} @@ -177,15 +178,17 @@ export class MonViewComp extends CCComp { } check_enemy_alive(){ let dir = 320 + this.enemy = v3(720,this.node.position.y) for (let i = 0; i < GameSet.ATK_LINES; i++) { - let hero:any = smc.hero_pos[i]; - let x=Math.abs(hero.x-this.node.position.x) - let y = Math.abs(hero.y-this.node.position.y) + + let ho:any = smc.hero_pos[i]; + let x=Math.abs(ho.x-this.node.position.x) + let y = Math.abs(ho.y-this.node.position.y) let squaredDistance =x*x+y*y let distance = Math.sqrt(squaredDistance); if(distance < dir){ dir = distance - this.enemy = hero + this.enemy = ho } } @@ -280,14 +283,12 @@ export class MonViewComp extends CCComp { if(this.atk_time >= this.atk_cd){ if(this.is_atking){ this.atk_time = 0; - // console.log("atk_cd:"+this.atk_cd); this.as.atk(); this.scheduleOnce(()=>{ + console.log("mon skill_cd:"+this.skill_uuid); this.shoot(this.skill_uuid); },0.4) } - }else{ - this.atk_time += dt; } }