能量增长完善 下一步 开始设计英雄

This commit is contained in:
panw
2025-07-24 17:06:40 +08:00
parent 054fc0a44a
commit cafd6f4073
24 changed files with 3745 additions and 5249 deletions

View File

@@ -52,7 +52,6 @@ export class Hero extends ecs.Entity {
hv.scale = 1;
hv.is_master=true;
hv.lv=1
console.log("hero load",hv.ATK_TO_POWER,hv.ATKED_TO_POWER,hv.CRIT_TO_POWER,hv.DODGE_TO_POWER)
this.add(hv);
this.addComponents<ecs.Comp>(MasterModelComp)
oops.message.dispatchEvent(GameEvent.MasterCalled,{uuid:uuid})
@@ -94,10 +93,10 @@ export class Hero extends ecs.Entity {
hv.hp= hv.hp_max = hv.hp_base=hero.hp+info.hp
hv.ap = hero.ap+info.ap;
hv.ap_base=hero.ap+info.ap;
hv.ATK_TO_POWER=FightSet.ATK_TO_POWER
hv.ATKED_TO_POWER=FightSet.ATKED_TO_POWER
hv.CRIT_TO_POWER=FightSet.CRIT_TO_POWER
hv.DODGE_TO_POWER=FightSet.DODGE_TO_POWER
smc.vmdata.hero.ATK_TO_POWER=FightSet.ATK_TO_POWER
smc.vmdata.hero.ATKED_TO_POWER=FightSet.ATKED_TO_POWER
smc.vmdata.hero.CRIT_TO_POWER=FightSet.CRIT_TO_POWER
smc.vmdata.hero.DODGE_TO_POWER=FightSet.DODGE_TO_POWER
hero.buff.forEach((buff:any)=>{
switch(buff.buff_type){
case BuffAttr.CRITICAL:
@@ -155,16 +154,16 @@ export class Hero extends ecs.Entity {
hv.frost_time=buff.value
break
case BuffAttr.ATK_TO_POWER:
hv.ATK_TO_POWER+=buff.value
smc.vmdata.hero.ATK_TO_POWER+=buff.value
break
case BuffAttr.ATKED_TO_POWER:
hv.ATKED_TO_POWER+=buff.value
smc.vmdata.hero.ATKED_TO_POWER+=buff.value
break
case BuffAttr.CRIT_TO_POWER:
hv.CRIT_TO_POWER+=buff.value
smc.vmdata.hero.CRIT_TO_POWER+=buff.value
break
case BuffAttr.DODGE_TO_POWER:
hv.DODGE_TO_POWER+=buff.value
smc.vmdata.hero.DODGE_TO_POWER+=buff.value
break
}
})

View File

@@ -111,10 +111,7 @@ export class HeroViewComp extends CCComp {
DEBUFF_COUNT:number=0; //debuff 持续次数
DEBUFF_UP:number=0; //debuff 概率提升
ATK_TO_POWER:number=0;
ATKED_TO_POWER:number=0;
CRIT_TO_POWER:number=0;
DODGE_TO_POWER:number=0;
private damageQueue: Array<{
@@ -466,11 +463,11 @@ export class HeroViewComp extends CCComp {
let damage = this.count_damage(remainingDamage)
if(is_crit) {
damage = Math.floor(damage * (1 + (FightSet.CRIT_DAMAGE+crit_d)/100))
if(this.fac==FacSet.MON) smc.vmdata.hero.power+=this.CRIT_TO_POWER //暴击涨能量 怪物被暴击,因为只有一个英雄 直接处理
if(this.fac==FacSet.MON) smc.vmdata.hero.power+=smc.vmdata.hero.CRIT_TO_POWER //暴击涨能量 怪物被暴击,因为只有一个英雄 直接处理
}
this.hp -= damage;
if(this.fac==FacSet.HERO) {smc.vmdata.hero.power+=this.ATKED_TO_POWER;console.log("被攻击涨能量",this)} //被攻击涨能量
if(this.fac==FacSet.MON) {smc.vmdata.hero.power+=this.ATK_TO_POWER;console.log("攻击命中涨能量",this)} //攻击命中涨能量 因为是只有1个英雄 直接处理
if(this.fac==FacSet.HERO) {smc.vmdata.hero.power+=smc.vmdata.hero.ATKED_TO_POWER;console.log("被攻击涨能量",this)} //被攻击涨能量
if(this.fac==FacSet.MON) {smc.vmdata.hero.power+=smc.vmdata.hero.ATK_TO_POWER;console.log("攻击命中涨能量",this)} //攻击命中涨能量 因为是只有1个英雄 直接处理
if(this.hp <= 0) {
if(this == null) return;
@@ -536,7 +533,7 @@ export class HeroViewComp extends CCComp {
}
check_dodge(){
if(this.fac==FacSet.HERO) smc.vmdata.hero.power+=this.DODGE_TO_POWER //闪避涨能量
if(this.fac==FacSet.HERO) smc.vmdata.hero.power+=smc.vmdata.hero.DODGE_TO_POWER //闪避涨能量
if(this.dod > 0){
let random = Math.random()*100
if(random < this.dod) {