天赋替换完成

This commit is contained in:
2025-07-31 22:56:31 +08:00
parent 15e41c628a
commit cac739c52b
5 changed files with 39 additions and 6 deletions

View File

@@ -25,6 +25,7 @@ export class HeroConComp extends CCComp {
this.on(GameEvent.UseSpecialCard,this.use_special_card,this)
this.on(GameEvent.UseEnhancement,this.use_enhancement,this)
this.on(GameEvent.UseTalentCard,this.use_talent_card,this)
this.on(GameEvent.RemoveTalent,this.remove_talent_card,this)
this.heroView=this.node.getComponent(HeroViewComp)
console.log("[HeroConCompComp]:onLoad",this.heroView)
@@ -155,12 +156,15 @@ export class HeroConComp extends CCComp {
}
}
remove_talent_card(e:GameEvent,data:any){
console.log("[HeroConCompComp]:remove_talent_card",data)
let tal=TalentList[data.uuid]
console.log("[HeroConCompComp]:remove_talent_card",data,tal)
switch(tal.buffType){
case BuffAttr.ATK:
console.log("[HeroConCompComp]:atk",this.heroView.TALENT[BuffAttr.ATK],tal.value)
this.heroView.TALENT[BuffAttr.ATK]-=tal.value
this.heroView.count_atrr(BuffAttr.ATK)
console.log("[HeroConCompComp]ed:atk",this.heroView.TALENT[BuffAttr.ATK],tal.value)
break
case BuffAttr.ATK_CD:
this.heroView.TALENT[BuffAttr.ATK_CD]-=tal.value

View File

@@ -305,7 +305,7 @@ export class HeroViewComp extends CCComp {
check_atrr(buff:BuffAttr){
switch(buff){
case BuffAttr.ATK:
return Math.floor(this.ap*(100+this.ap+this.TALENT[BuffAttr.ATK])/100)
return Math.floor(this.ap_base*(100+this.ap_buff+this.TALENT[BuffAttr.ATK])/100)
case BuffAttr.ATK_CD:
return this.cd_base/((this.cd_buff+this.TALENT[BuffAttr.ATK_CD])/100+1)
case BuffAttr.HP: