光环和装备加成 都改为buff 不再使用buff

This commit is contained in:
2025-06-25 13:44:51 +08:00
parent 03456dd990
commit 2b5ed007b4
5 changed files with 39 additions and 26 deletions

View File

@@ -43,17 +43,17 @@ export class SingletonModuleComp extends ecs.Comp {
hp:0,
hp_max:0,
cd:3,
t_ap:9999,
damage:9999,
ap:9999,
equip_ap:9999,
buff_ap:9999,
debuff_ap:9999,
def:9999,
crit:9999,
crit_d:99,
dod:99,
dod_no:false,
crit_no:false,
equip_ap:9999,
buff_ap:9999,
debuff_ap:9999,
},
friend:{
hp:0,

View File

@@ -112,14 +112,13 @@ export class BuffComp extends Component {
}
let buff=this.FIGHTCON[buff_key+"_buff"]
let debuff=this.FIGHTCON[buff_key+"_debuff"]
smc.vmdata[target_key].ap=this.HeroView.ap
smc.vmdata[target_key].equip_ap=buff.ATK+debuff.DEATK
smc.vmdata[target_key].equip_ap=buff.ATK
smc.vmdata[target_key].buff_ap=view_atk
smc.vmdata[target_key].debuff_ap=view_deatk
smc.vmdata[target_key].t_ap=this.HeroView.ap*(100+buff.ATK-debuff.DEATK)/100*(100+view_atk-view_deatk)/100
smc.vmdata[target_key].damage=this.HeroView.ap*(100+buff.ATK)/100*(100+view_atk-view_deatk)/100

View File

@@ -445,9 +445,9 @@ export class HeroViewComp extends CCComp {
if(this.is_boss) {buff_key="enemy"}
if(this.is_kalami) {buff_key="enemy"}
if(buff_key==null) return
let debuff=this.FIGHTCON[buff_key+"_debuff"]
let buff=this.FIGHTCON[buff_key+"_buff"]
damage=remainingDamage*(100-(buff.DEF+def)+(debuff.BURN+Burn))/100
damage=remainingDamage*(100-(buff.DEF+def)+Burn)/100
return Math.floor(damage)
}

View File

@@ -214,18 +214,18 @@ export class SkillConComp extends CCComp {
}
}
return cd*(100-bcd-buff.ATK_CD+decd+debuff.DECD)/100
return cd*(100-bcd-buff.ATK_CD)/100
}
get_count(count:number,view:HeroViewComp){
if(view.fac==FacSet.HERO){
if(view.is_master){
return count+(this.FIGHTCON.hero_buff.ATK_COUNT-this.FIGHTCON.hero_debuff.DECOUNT)
return count+(this.FIGHTCON.hero_buff.ATK_COUNT)
}else{
return count+(this.FIGHTCON.friend_buff.ATK_COUNT-this.FIGHTCON.friend_debuff.DECOUNT)
return count+(this.FIGHTCON.friend_buff.ATK_COUNT)
}
}else{
return count+(this.FIGHTCON.enemy_buff.ATK_COUNT-this.FIGHTCON.enemy_debuff.DECOUNT)
return count+(this.FIGHTCON.enemy_buff.ATK_COUNT)
}
}

View File

@@ -19,9 +19,7 @@ export class EquipsComp extends Component {
attrs:any={
hero_buff:getBuffNum(),
friend_buff:getBuffNum(),
hero_debuff:geDebuffNum(),
friend_debuff:geDebuffNum(),
enemy_debuff:geDebuffNum(),
enemy_debuff:getBuffNum(),
}
/** 视图层逻辑代码分离演示 */
onLoad() {
@@ -166,13 +164,13 @@ export class EquipsComp extends Component {
// 根据目标类型获取对应的key
switch (target) {
case EquipAttrTarget.HERO:
targetKey = 'hero_debuff';
targetKey = 'hero_buff';
break;
case EquipAttrTarget.FRIEND:
targetKey = 'friend_debuff';
targetKey = 'friend_buff';
break;
case EquipAttrTarget.ENEMY:
targetKey = 'enemy_debuff';
targetKey = 'enemy_debuff'; //都是敌人的减益
break;
}
this.add_debuff(targetKey,attr)
@@ -241,8 +239,28 @@ export class EquipsComp extends Component {
}
add_debuff(targetKey:string,attr:any){
if(targetKey){
this.attrs[targetKey][DebuffAttr[attr.type]] += attr.value;
switch(attr.type){
case DebuffAttr.BURN:
this.attrs[targetKey][BuffAttr.DEF] -= attr.value; //免伤, 负的免伤 就是加伤害
break
case DebuffAttr.DECD:
this.attrs[targetKey][BuffAttr.ATK_CD] -= attr.value; //加cd值 技能释放中 按-cd 计算 所以 cd 值负数实际是加cd
break
case DebuffAttr.DEHP:
this.attrs[targetKey][BuffAttr.HP] -= attr.value;
break
case DebuffAttr.DEATK:
this.attrs[targetKey][BuffAttr.ATK] -= attr.value;
break
case DebuffAttr.DECOUNT:
this.attrs[targetKey][BuffAttr.ATK_COUNT] -= attr.value;
break
case DebuffAttr.CRITICAL:
this.attrs[targetKey][BuffAttr.CRITICAL] -= attr.value;
break
case DebuffAttr.DODGE:
this.attrs[targetKey][BuffAttr.DODGE] -= attr.value;
break
}
}
@@ -252,9 +270,7 @@ export class EquipsComp extends Component {
const newAttrs = {
hero_buff: getBuffNum(),
friend_buff: getBuffNum(),
hero_debuff: geDebuffNum(),
friend_debuff: geDebuffNum(),
enemy_debuff: geDebuffNum(),
enemy_debuff: getBuffNum(),
};
// 替换整个 attrs 对象
@@ -262,9 +278,7 @@ export class EquipsComp extends Component {
console.log("重置属性", {
hero_buff: this.attrs.hero_buff,
hero_debuff: this.attrs.hero_debuff,
friend_buff: this.attrs.friend_buff,
friend_debuff: this.attrs.friend_debuff,
enemy_debuff: this.attrs.enemy_debuff,
});
}