继续完善 装备buff
This commit is contained in:
@@ -4,7 +4,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { HeroModelComp } from "./HeroModelComp";
|
||||
import { HeroViewComp } from "./HeroViewComp";
|
||||
import { BoxSet } from "../common/config/BoxSet";
|
||||
import { BoxSet, FacSet } from "../common/config/BoxSet";
|
||||
import { HeroInfo } from "../common/config/heroSet";
|
||||
import { BattleMoveComp } from "../common/ecs/position/BattleMoveComp";
|
||||
import { SkillConComp } from "./SkillConComp";
|
||||
@@ -41,7 +41,7 @@ export class Hero extends ecs.Entity {
|
||||
var hv = node.getComponent(HeroViewComp)!;
|
||||
let hero= HeroInfo[uuid] // 共用英雄数据
|
||||
hv.scale = 1;
|
||||
hv.fac = 0;
|
||||
hv.fac = FacSet.HERO;
|
||||
hv.is_master=true;
|
||||
hv.type = hero.type;
|
||||
hv.box_group = box_group;
|
||||
@@ -75,7 +75,7 @@ export class Hero extends ecs.Entity {
|
||||
var hv = node.getComponent(HeroViewComp)!;
|
||||
let hero= HeroInfo[uuid] // 共用英雄数据
|
||||
hv.scale = scale;
|
||||
hv.fac = 0;
|
||||
hv.fac = FacSet.HERO;
|
||||
hv.fight_pos=fight_pos
|
||||
hv.type = hero.type;
|
||||
hv.box_group = box_group;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/O
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { HeroViewComp } from "./HeroViewComp";
|
||||
import { BoxSet } from "../common/config/BoxSet";
|
||||
import { BoxSet, FacSet } from "../common/config/BoxSet";
|
||||
import { HeroInfo } from "../common/config/heroSet";
|
||||
import { MonModelComp } from "./MonModelComp";
|
||||
import { BattleMoveComp } from "../common/ecs/position/BattleMoveComp";
|
||||
@@ -56,7 +56,7 @@ export class Monster extends ecs.Entity {
|
||||
// console.log("hero_init",buff)
|
||||
let hero= HeroInfo[uuid] // 共用英雄数据
|
||||
hv.scale = scale;
|
||||
hv.fac = 1;
|
||||
hv.fac = FacSet.MON;
|
||||
hv.type = hero.type;
|
||||
hv.is_boss = is_boss;
|
||||
hv.box_group = box_group;
|
||||
|
||||
@@ -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