继续完善 装备buff
This commit is contained in:
@@ -5,7 +5,7 @@ import { Skill } from '../skills/Skill';
|
||||
import { ecs } from 'db://oops-framework/libs/ecs/ECS';
|
||||
import { oops } from 'db://oops-framework/core/Oops';
|
||||
import { GameEvent } from '../common/config/GameEvent';
|
||||
import { BoxSet } from '../common/config/BoxSet';
|
||||
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';
|
||||
@@ -36,16 +36,27 @@ export class SkillConComp extends CCComp {
|
||||
update(dt: number) {
|
||||
if(!smc.mission.play||smc.mission.pause) return
|
||||
this.HeroView.at += dt;
|
||||
if (this.HeroView.is_atking &&this.HeroView.at > this.HeroView.cd) {
|
||||
|
||||
let cd = this.HeroView.cd
|
||||
let count=1
|
||||
if(this.HeroView.fac==FacSet.HERO){
|
||||
if(this.HeroView.is_master){
|
||||
count+=this.FIGHTCON.hero.ATK_COUNT+this.FIGHTCON.ally.ATK_COUNT-this.FIGHTCON.hero_debuff.DECOUNT-this.FIGHTCON.ally_debuff.DECOUNT
|
||||
cd=this.HeroView.cd*(100-this.FIGHTCON.hero.ATK_CD-this.FIGHTCON.ally.ATK_CD+this.FIGHTCON.hero_debuff.DECD+this.FIGHTCON.ally_debuff.DECD)/100
|
||||
}else{
|
||||
count+=this.FIGHTCON.friend.ATK_COUNT+this.FIGHTCON.ally.ATK_COUNT-this.FIGHTCON.friend_debuff.DECOUNT-this.FIGHTCON.ally_debuff.DECOUNT
|
||||
cd=this.HeroView.cd*(100-this.FIGHTCON.friend.ATK_CD-this.FIGHTCON.ally.ATK_CD+this.FIGHTCON.friend_debuff.DECD+this.FIGHTCON.ally_debuff.DECD)/100
|
||||
}
|
||||
}else{
|
||||
cd=this.HeroView.cd*(100-this.FIGHTCON.enemy.ATK_CD+this.FIGHTCON.enemy_debuff.DECD)/100
|
||||
count+=this.FIGHTCON.enemy.ATK_COUNT-this.FIGHTCON.enemy_debuff.DECOUNT
|
||||
}
|
||||
if(count<1) count=1
|
||||
console.log(this.HeroView.hero_name+(this.HeroView.is_master?"[主]":"[从] 准备释放")+SkillSet[this.HeroView.atk_skill].name+"=>"+"=>cd:"+cd+"=> count:"+count)
|
||||
if (this.HeroView.is_atking &&(this.HeroView.at > cd)) {
|
||||
const config = SkillSet[this.HeroView.atk_skill];
|
||||
if (!config) return;
|
||||
let count=1
|
||||
if(this.HeroView.is_master){
|
||||
count+=this.FIGHTCON.hero.ATK_COUNT+this.FIGHTCON.ally.ATK_COUNT
|
||||
}else{
|
||||
count+=this.FIGHTCON.friend.ATK_COUNT+this.FIGHTCON.ally.ATK_COUNT
|
||||
}
|
||||
console.log(this.HeroView.hero_name+(this.HeroView.is_master?"[主]":"[从]")+"=>"+config.name+"=>"+count)
|
||||
console.log(this.HeroView.hero_name+(this.HeroView.is_master?"[主]":"[从] 释放")+"=>"+config.name+"=>"+count)
|
||||
this.castSkill(config,count);
|
||||
this.HeroView.at = 0;
|
||||
}
|
||||
@@ -121,7 +132,7 @@ export class SkillConComp extends CCComp {
|
||||
|
||||
private selectEnemyTargets(config: typeof SkillSet[keyof typeof SkillSet]): ecs.Entity[] {
|
||||
const team = this.HeroView.fac;
|
||||
const isEnemyTeam = team === 0 ? 1 : 0;
|
||||
const isEnemyTeam = team === FacSet.HERO ? FacSet.MON : FacSet.HERO;
|
||||
const candidates= ecs.query(ecs.allOf(HeroViewComp)).filter(e => e.get(HeroViewComp).fac !== team);
|
||||
return this.filterFrontRow(candidates, isEnemyTeam);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user