统一 英雄能量增长

This commit is contained in:
2025-07-25 23:17:24 +08:00
parent 655a4eef56
commit 4bd2e5566a
4 changed files with 9 additions and 31 deletions

View File

@@ -128,10 +128,7 @@ export const VmInfo = {
wind:0, wind:0,
thorns:0, thorns:0,
lifesteal:0, lifesteal:0,
ATK_TO_POWER:0, POWER_UP:0,
ATKED_TO_POWER:0,
CRIT_TO_POWER:0,
DODGE_TO_POWER:0,
atk_count:0, atk_count:0,
atked_count:0, atked_count:0,
crit_count:0, crit_count:0,

View File

@@ -128,10 +128,7 @@ export enum BuffAttr {
STUN_RATTO = 26, //击晕概率 STUN_RATTO = 26, //击晕概率
FROST_TIME = 27, //冰冻时间 FROST_TIME = 27, //冰冻时间
HP_MAX = 28, //最大生命值数值 HP_MAX = 28, //最大生命值数值
ATK_TO_POWER = 29, //攻击涨能量 POWER_UP = 29, //能量增加
ATKED_TO_POWER = 30, //被攻击涨能量
CRIT_TO_POWER = 31, //暴击涨能量
DODGE_TO_POWER = 32, //闪避涨能量
} }
export const geDebuffNum=()=>{ export const geDebuffNum=()=>{
@@ -183,10 +180,7 @@ export const getBuffNum=()=>{
STUN_RATTO:0, STUN_RATTO:0,
FROST_TIME:0, FROST_TIME:0,
HP_MAX:0,//最大生命值数值 HP_MAX:0,//最大生命值数值
ATK_TO_POWER:0, POWER_UP:0,//能量增加
ATKED_TO_POWER:0,
CRIT_TO_POWER:0,
DODGE_TO_POWER:0,
} }
} }

View File

@@ -93,10 +93,6 @@ export class Hero extends ecs.Entity {
hv.hp= hv.hp_max = hv.hp_base=hero.hp+info.hp hv.hp= hv.hp_max = hv.hp_base=hero.hp+info.hp
hv.ap = hero.ap+info.ap; hv.ap = hero.ap+info.ap;
hv.ap_base=hero.ap+info.ap; hv.ap_base=hero.ap+info.ap;
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)=>{ hero.buff.forEach((buff:any)=>{
switch(buff.buff_type){ switch(buff.buff_type){
case BuffAttr.CRITICAL: case BuffAttr.CRITICAL:
@@ -153,17 +149,8 @@ export class Hero extends ecs.Entity {
case BuffAttr.FROST_TIME: case BuffAttr.FROST_TIME:
hv.frost_time=buff.value hv.frost_time=buff.value
break break
case BuffAttr.ATK_TO_POWER: case BuffAttr.POWER_UP:
smc.vmdata.hero.ATK_TO_POWER+=buff.value smc.vmdata.hero.POWER_UP+=buff.value
break
case BuffAttr.ATKED_TO_POWER:
smc.vmdata.hero.ATKED_TO_POWER+=buff.value
break
case BuffAttr.CRIT_TO_POWER:
smc.vmdata.hero.CRIT_TO_POWER+=buff.value
break
case BuffAttr.DODGE_TO_POWER:
smc.vmdata.hero.DODGE_TO_POWER+=buff.value
break break
} }
}) })

View File

@@ -461,11 +461,11 @@ export class HeroViewComp extends CCComp {
let damage = this.count_damage(remainingDamage) let damage = this.count_damage(remainingDamage)
if(is_crit) { if(is_crit) {
damage = Math.floor(damage * (1 + (FightSet.CRIT_DAMAGE+crit_d)/100)) damage = Math.floor(damage * (1 + (FightSet.CRIT_DAMAGE+crit_d)/100))
if(this.fac==FacSet.MON) smc.vmdata.hero.power+=smc.vmdata.hero.CRIT_TO_POWER //暴击涨能量 怪物被暴击,因为只有一个英雄 直接处理 if(this.fac==FacSet.MON) smc.vmdata.hero.power+=smc.vmdata.hero.POWER_UP+FightSet.CRIT_TO_POWER //暴击涨能量 怪物被暴击,因为只有一个英雄 直接处理
} }
this.hp -= damage; this.hp -= damage;
if(this.fac==FacSet.HERO) {smc.vmdata.hero.power+=smc.vmdata.hero.ATKED_TO_POWER;console.log("被攻击涨能量",this)} //被攻击涨能量 if(this.fac==FacSet.HERO) {smc.vmdata.hero.power+=smc.vmdata.hero.POWER_UP+FightSet.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.fac==FacSet.MON) {smc.vmdata.hero.power+=smc.vmdata.hero.POWER_UP+FightSet.ATK_TO_POWER;console.log("攻击命中涨能量",this)} //攻击命中涨能量 因为是只有1个英雄 直接处理
if(this.hp <= 0) { if(this.hp <= 0) {
if(this == null) return; if(this == null) return;
@@ -531,7 +531,7 @@ export class HeroViewComp extends CCComp {
} }
check_dodge(){ check_dodge(){
if(this.fac==FacSet.HERO) smc.vmdata.hero.power+=smc.vmdata.hero.DODGE_TO_POWER //闪避涨能量 if(this.fac==FacSet.HERO) smc.vmdata.hero.power+=smc.vmdata.hero.POWER_UP+FightSet.DODGE_TO_POWER //闪避涨能量
if(this.dod > 0){ if(this.dod > 0){
let random = Math.random()*100 let random = Math.random()*100
if(random < this.dod) { if(random < this.dod) {