FightConComp 的效用已经取消,下一步 进一步 精简,去掉临时 buff debuff 因为本身就是 当局游戏 没必要加零时debuff 直接当局永久debuff
This commit is contained in:
@@ -4,12 +4,8 @@ import { ecs } from 'db://oops-framework/libs/ecs/ECS';
|
||||
import { Tooltip } from '../skills/Tooltip';
|
||||
import { timedCom } from '../skills/timedCom';
|
||||
import { smc } from '../common/SingletonModuleComp';
|
||||
import { BuffGet } from '../skills/BuffGet';
|
||||
import { HeroViewComp } from './HeroViewComp';
|
||||
import { FightConComp } from '../map/FightConComp';
|
||||
import { BuffAttr, DebuffAttr } from '../common/config/SkillSet';
|
||||
import { GameEvent } from '../common/config/GameEvent';
|
||||
import { FacSet } from '../common/config/BoxSet';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('BuffComp')
|
||||
@@ -36,7 +32,6 @@ export class BuffComp extends Component {
|
||||
wind_cd:number=0;
|
||||
speek_time:number=0;
|
||||
HeroView:HeroViewComp=null!
|
||||
FIGHTCON:FightConComp=null!
|
||||
hp_bar:any=null
|
||||
protected onLoad(): void {
|
||||
oops.message.on(GameEvent.UpdateVMData,this.to_update_vmdata,this)
|
||||
@@ -47,7 +42,6 @@ export class BuffComp extends Component {
|
||||
|
||||
info_init(){
|
||||
this.HeroView=this.node.getComponent(HeroViewComp)
|
||||
this.FIGHTCON=this.node.parent.getComponent(FightConComp)
|
||||
this.top_node = this.node.getChildByName("top");
|
||||
let hp_y=this.node.getComponent(UITransform).height+20
|
||||
this.top_node.setPosition(0,hp_y,0)
|
||||
@@ -91,26 +85,20 @@ export class BuffComp extends Component {
|
||||
vmdata_update(is_hp:boolean=false){
|
||||
// console.log("[BuffComp]:to_update_vmdata:"+this.HeroView.hero_name)
|
||||
|
||||
let buff=null
|
||||
let info= null
|
||||
if(!this.HeroView) return
|
||||
if(!this.HeroView.is_master) return
|
||||
if(this.HeroView.fac==FacSet.HERO) {info=smc.vmdata.hero;buff=this.FIGHTCON.hero_buff}
|
||||
if(this.HeroView.is_boss) {info=smc.vmdata.boss;buff=this.FIGHTCON.enemy_buff}
|
||||
//if(this.HeroView.is_kalami) {target_key="enemy";buff_key="enemy"} 不显示小怪
|
||||
info=smc.vmdata.hero
|
||||
if(info==null) return
|
||||
let view_atk = 0 //临时buff
|
||||
let view_deatk = 0 //临时debuff
|
||||
if(is_hp){
|
||||
info.hp=this.HeroView.hp
|
||||
info.hp_buff=buff.HP
|
||||
info.hp_max=this.HeroView.hp_max*(100+buff.HP)/100
|
||||
// info.exp=this.HeroView.exp
|
||||
// info.next_exp=this.HeroView.next_exp
|
||||
info.hp_max=this.HeroView.hp_max
|
||||
}else{
|
||||
info.hp=this.HeroView.hp
|
||||
info.hp_buff=buff.HP
|
||||
info.hp_max=this.HeroView.hp_max*(100+buff.HP)/100
|
||||
info.hp_max=this.HeroView.hp_max
|
||||
|
||||
for(let i=0;i<this.HeroView.BUFF_ATKS.length;i++){
|
||||
view_atk += this.HeroView.BUFF_ATKS[i].value
|
||||
}
|
||||
@@ -118,20 +106,20 @@ export class BuffComp extends Component {
|
||||
for(let i=0;i<this.HeroView.DEBUFF_DEATKS.length;i++){
|
||||
view_deatk += this.HeroView.DEBUFF_DEATKS[i].value
|
||||
}
|
||||
|
||||
info.ap=this.HeroView.ap
|
||||
// info.lv=this.HeroView.lv
|
||||
info.cd=Number((this.HeroView.cd*(100-buff.ATK_CD)/100).toFixed(2))
|
||||
console.log("info.buff.ATK_CD",buff.ATK_CD)
|
||||
info.equip_ap=buff.ATK
|
||||
info.cd=Number(this.HeroView.cd.toFixed(2))
|
||||
|
||||
info.equip_ap=this.HeroView.ap_base*this.HeroView.buff_ap
|
||||
info.buff_ap=view_atk
|
||||
info.debuff_ap=view_deatk
|
||||
info.damage=this.HeroView.ap*(100+buff.ATK)/100*(100+view_atk-view_deatk)/100
|
||||
info.crit=this.HeroView.crit+buff.CRITICAL
|
||||
info.crit_d=this.HeroView.crit_d+buff.CRITICAL_DMG
|
||||
info.dod=this.HeroView.dod+buff.DODGE
|
||||
info.def=this.HeroView.def+buff.DEF
|
||||
info.wind=buff.WFUNY
|
||||
info.skill_cd_buff=buff.SKILL_CD
|
||||
info.damage=this.HeroView.ap*(100+view_atk-view_deatk)/100
|
||||
info.crit=this.HeroView.crit
|
||||
info.crit_d=this.HeroView.crit_d
|
||||
info.dod=this.HeroView.dod
|
||||
info.def=this.HeroView.def
|
||||
info.wind=this.HeroView.wfuny
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user