涨能量需要再处理下, 怪物被攻击算命中 如何涨

This commit is contained in:
2025-07-24 00:05:11 +08:00
parent 690f0547cd
commit af89bb7707
8 changed files with 8602 additions and 7557 deletions

View File

@@ -111,7 +111,12 @@ 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<{
damage: number,
isCrit: boolean,
@@ -461,8 +466,12 @@ 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 //暴击涨能量 怪物被暴击,因为只有一个英雄 直接处理
}
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.hp <= 0) {
if(this == null) return;
this.is_dead=true
@@ -527,6 +536,7 @@ export class HeroViewComp extends CCComp {
}
check_dodge(){
if(this.fac==FacSet.HERO) smc.vmdata.hero.power+=this.DODGE_TO_POWER //闪避涨能量
if(this.dod > 0){
let random = Math.random()*100
if(random < this.dod) {
@@ -538,6 +548,7 @@ export class HeroViewComp extends CCComp {
}
check_crit(crit:number=0){
if(this.crit_no) return false
if(crit > 0){
let random = Math.random()*100
@@ -574,10 +585,9 @@ export class HeroViewComp extends CCComp {
to_grave(){
tween(this.node).to(0.5, { position:v3(-900,this.node.position.y+300,0)},{
onComplete: (target?: object) => {
this.node.setPosition(-900,this.node.position.y-300,0)
}
}
).start()
this.node.setPosition(-900,this.node.position.y-300,0)
}
}).start()
}
// to_alive(){
// this.is_dead=false
@@ -681,7 +691,8 @@ export class HeroViewComp extends CCComp {
/** 立即显示伤害效果 */
private showDamageImmediate(damage: number, isCrit: boolean) {
this.BUFFCOMP.in_atked();
this.as.atked()
// this.BUFFCOMP.in_atked()
this.atked_count++;
if (isCrit) {
this.BUFFCOMP.tooltip(TooltipTypes.crit, damage.toFixed(0), damage);