天赋完善 继续

This commit is contained in:
2025-07-30 22:25:31 +08:00
parent c3ecc08767
commit 23ef6c3ca0
6 changed files with 170 additions and 43 deletions

View File

@@ -66,14 +66,13 @@ export class HeroViewComp extends CCComp {
atk_skill:number=0;
puncture:number=0; //穿刺敌人伤害后方敌人个数
puncture_damage:number=0; //后伤害加成
def: number = 0; //防御
def_base:number=0;
def_buff:number=0;
def: number = 0; //免伤
vun: number = 0; //易伤
burn_count:number=0; //易伤次数
burn_value:number=0; //易伤值
stun_time:number=0; //眩晕加成
stun_ratto:number=0; //攻击眩晕概率加成
stun_no:boolean=false; //眩晕免疫
dod: number = 0; //闪避率
dod_no:boolean=false;
crit:number=0; //暴击率
@@ -82,10 +81,14 @@ export class HeroViewComp extends CCComp {
wfuny:number=0; //风怒概率
frost_ratto:number=0; //冰冻概率
frost_time:number=0; //冰冻时间
frost_no:boolean=false; //冰冻免疫
knockback:number=0; //击退概率
knockback_no:boolean=false; //击退免疫
shield:number = 0; //护盾,免伤1次减1
speed: number = 100; /** 角色移动速度 */
ospeed: number = 100; /** 角色初始速度 */
reflect:number=0; //反射伤害比率
lifesteal:number=0; //吸血比率
atk_count: number = 0;
atked_count: number = 0;
@@ -228,21 +231,70 @@ export class HeroViewComp extends CCComp {
if(this.shield>6) this.shield=6
if(this.shield>0) this.BUFFCOMP.show_shield(true)
}
// add_cd(cd: number){
// this.cd += this.cd*((100-cd)/100);
// this.BUFFCOMP.buff_get("cd")
// }
/**
* 增加英雄的攻击AP
* @param ap 要增加的攻击。
*/
add_def(def: number){
this.def_base+=def
this.count_atrr(BuffAttr.DEF)
change_puncture(puncture: number){
this.puncture+=puncture
if(this.puncture<1) this.puncture=1
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
change_puncture_damage(puncture_damage: number){
this.puncture_damage+=puncture_damage
if(this.puncture_damage<0) this.puncture_damage=0
if(this.puncture_damage>80) this.puncture_damage=80
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
change_dodge(dodge: number){
this.dod+=dodge
if(this.dod<0) this.dod=0
if(this.dod>90) this.dod=90
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
change_frost_ratto(frost_ratto: number){
this.frost_ratto+=frost_ratto
if(this.frost_ratto<0) this.frost_ratto=0
if(this.frost_ratto>90) this.frost_ratto=90
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
change_knockback(knockback: number){
this.knockback+=knockback
if(this.knockback<0) this.knockback=0
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
change_stun_ratto(stun_ratto: number){
this.stun_ratto+=stun_ratto
if(this.stun_ratto<0) this.stun_ratto=0
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
change_def(def: number){
this.def+=def
if(this.def>90) this.def=90
if(this.def<0) this.def=0
if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.BUFFCOMP.tooltip(TooltipTypes.defup,def.toFixed(0));
}
change_crit(crit: number){
this.crit+=crit
if(this.crit<0) this.crit=0
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
change_crit_d(crit_d: number){
this.crit_d+=crit_d
if(this.crit_d<0) this.crit_d=0
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
change_reflect(reflect: number){
this.reflect+=reflect
if(this.reflect<0) this.reflect=0
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
change_lifesteal(lifesteal: number){
this.lifesteal+=lifesteal
if(this.lifesteal<0) this.lifesteal=0
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
check_atrr(buff:BuffAttr){
switch(buff){
case BuffAttr.ATK:
@@ -251,8 +303,7 @@ export class HeroViewComp extends CCComp {
return this.cd_base/((this.cd_buff+this.TALENT[BuffAttr.ATK_CD])/100+1)
case BuffAttr.HP:
return Math.floor(this.hp_base*(100+this.hp_buff+this.TALENT[BuffAttr.HP])/100)
case BuffAttr.DEF:
return this.def_base+this.def_buff+this.TALENT[BuffAttr.DEF]
}
}
@@ -270,18 +321,14 @@ export class HeroViewComp extends CCComp {
if(this.is_master) this.BUFFCOMP.vmdata_update()
break
case BuffAttr.HP:
let diff=this.check_atrr(BuffAttr.HP)-this.hp_max
this.hp_max=this.check_atrr(BuffAttr.HP)
this.hp+=diff
if(this.is_master) this.BUFFCOMP.vmdata_update(true)
break
case BuffAttr.DEF:
this.def=this.check_atrr(BuffAttr.DEF)
if(this.is_master) this.BUFFCOMP.vmdata_update()
break
}
}
add_speed(cd: number){
this.cd_buff+=cd
this.count_atrr(BuffAttr.ATK_CD)
@@ -296,7 +343,6 @@ export class HeroViewComp extends CCComp {
}else{
this.ap += Math.floor(ap);
}
let diff=this.check_atrr(BuffAttr.ATK)-this.ap
this.count_atrr(BuffAttr.ATK)
// this.BUFFCOMP.tooltip(TooltipTypes.apup,diff.toFixed(0));
}
@@ -308,7 +354,6 @@ export class HeroViewComp extends CCComp {
}else{
this.ap -= Math.floor(ap/100*this.ap);
}
let diff=this.check_atrr(BuffAttr.ATK)-this.ap
this.count_atrr(BuffAttr.ATK)
}
@@ -319,18 +364,14 @@ export class HeroViewComp extends CCComp {
}else{
this.hp_buff+=hp
}
let diff=this.check_atrr(BuffAttr.HP)-this.hp_max
this.count_atrr(BuffAttr.HP)
this.hp+=diff
// this.BUFFCOMP.tooltip(TooltipTypes.hpup,diff.toFixed(0));
}
de_hp_max(hp: number=0,is_num:boolean=true){ //最大值 只存在数值添加, 比例通过hp_buff处理
//console.log("[HeroViewComp]:de_hp_max de:",hp,this.hp_max)
this.hp_base -= Math.floor(hp) ;
let diff=this.check_atrr(BuffAttr.HP)-this.hp_max
this.count_atrr(BuffAttr.HP)
this.hp+=diff
if(this.is_master) this.BUFFCOMP.vmdata_update(true)
}