FightConComp 的效用已经取消,下一步 进一步 精简,去掉临时 buff debuff 因为本身就是 当局游戏 没必要加零时debuff 直接当局永久debuff
This commit is contained in:
@@ -8,7 +8,6 @@ import { GameEvent } from '../common/config/GameEvent';
|
||||
import { BoxSet, FacSet } from '../common/config/BoxSet';
|
||||
import { smc } from '../common/SingletonModuleComp';
|
||||
import { CCComp } from 'db://oops-framework/module/common/CCComp';
|
||||
import { FightConComp } from '../map/FightConComp';
|
||||
import { MonModelComp } from './MonModelComp';
|
||||
import { HeroModelComp } from './HeroModelComp';
|
||||
import { FightSet } from '../common/config/Mission';
|
||||
@@ -18,7 +17,6 @@ const { ccclass, property } = _decorator;
|
||||
@ccclass('SkillCon')
|
||||
@ecs.register('SkillCon')
|
||||
export class SkillConComp extends CCComp {
|
||||
FIGHTCON:FightConComp=null!
|
||||
HeroView:any=null;
|
||||
HeroEntity:any=null;
|
||||
private _timers: { [key: string]: number } = {};
|
||||
@@ -36,7 +34,6 @@ export class SkillConComp extends CCComp {
|
||||
}
|
||||
onLoad(){
|
||||
this.HeroView=this.node.getComponent(HeroViewComp)
|
||||
this.FIGHTCON=this.node.parent.getComponent(FightConComp)
|
||||
// //console.log(this.HeroView.uuid+"=>"+this.HeroView.hero_name+"=> SkillConComp onLoad")
|
||||
this.on(GameEvent.CastHeroSkill,this.cast_master_skill,this)
|
||||
oops.message.on(GameEvent.MaxSkill,this.use_max_skill,this)
|
||||
@@ -51,7 +48,7 @@ export class SkillConComp extends CCComp {
|
||||
if(!smc.mission.play||smc.mission.pause) return
|
||||
if(this.HeroView.DEBUFF_STUN <= 0&&this.HeroView.DEBUFF_FROST <= 0) this.HeroView.at += dt;
|
||||
|
||||
let cd = this.get_cd(this.HeroView.cd,this.HeroView)
|
||||
let cd = this.count_cd(this.HeroView.cd,this.HeroView)
|
||||
if (this.HeroView.is_atking &&(this.HeroView.at > cd)) {
|
||||
if(this.HeroView.is_dead) return
|
||||
const config = SkillSet[this.HeroView.atk_skill];
|
||||
@@ -95,7 +92,7 @@ export class SkillConComp extends CCComp {
|
||||
if(!this.HeroView.is_master) return
|
||||
//console.log("hart cast_skill",uuid ,e)
|
||||
const config = SkillSet[uuid];
|
||||
this.castSkill(config,false,this.FIGHTCON.hero_buff.SKILL_DMG)
|
||||
this.castSkill(config,false,this.HeroView.skill_dmg)
|
||||
}
|
||||
/** 施放技能 */
|
||||
castSkill(config: typeof SkillSet[keyof typeof SkillSet],is_wfuny:boolean=false,dmg:number=0) {
|
||||
@@ -176,10 +173,8 @@ export class SkillConComp extends CCComp {
|
||||
}
|
||||
|
||||
check_wfuny(){
|
||||
let buff=this.get_buff(this.HeroView)
|
||||
if(buff==null) return false
|
||||
let random = Math.random()*100
|
||||
if(random < buff.WFUNY){
|
||||
if(random < this.HeroView.wfuny){
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -287,11 +282,7 @@ export class SkillConComp extends CCComp {
|
||||
// //console.log("clear_timer");
|
||||
Object.values(this._timers).forEach(clearTimeout);
|
||||
}
|
||||
get_cd(cd:number,view:HeroViewComp){
|
||||
|
||||
let buff=this.get_buff(view)
|
||||
let buff_cd=0
|
||||
if(buff!=null) buff_cd=buff.ATK_CD
|
||||
count_cd(cd:number,view:HeroViewComp){
|
||||
|
||||
// 汇总DEBUFF_DECD并处理count值
|
||||
let decd = 0;
|
||||
@@ -311,21 +302,15 @@ export class SkillConComp extends CCComp {
|
||||
view.BUFF_CDS.splice(i, 1);
|
||||
}
|
||||
}
|
||||
return cd*(100-bcd-buff_cd+decd)/100
|
||||
return cd*(100-bcd+decd)/100
|
||||
}
|
||||
get_count(count:number,view:HeroViewComp){
|
||||
let buff=this.get_buff(view)
|
||||
if(buff==null) return count
|
||||
let re=count+(buff.WFUNY)
|
||||
let re=count+view.wfuny
|
||||
if(re<1) re=1
|
||||
return re
|
||||
}
|
||||
|
||||
get_buff(view:HeroViewComp){
|
||||
if(view.is_master) return this.FIGHTCON.hero_buff
|
||||
if(view.is_boss||view.is_kalami) return this.FIGHTCON.enemy_buff
|
||||
return null
|
||||
}
|
||||
|
||||
reset() {
|
||||
this.clear_timer();
|
||||
this.aoe_queues = [] // 清空技能队列
|
||||
|
||||
Reference in New Issue
Block a user