dd
This commit is contained in:
@@ -3,13 +3,14 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
|
||||
import { BoxSet } from "../common/config/BoxSet";
|
||||
import { SkillSet } from "../common/config/SkillSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { FightConComp } from "../map/FightConComp";
|
||||
import { SkillCom } from "./SkillCom";
|
||||
import { instantiate, Node, Prefab, Vec3 ,tween, v3,animation,Label,resources,SpriteFrame,Sprite} from "cc";
|
||||
|
||||
/** Skill 模块 */
|
||||
@ecs.register(`Skill`)
|
||||
export class Skill extends ecs.Entity {
|
||||
|
||||
FIGHTCON:FightConComp=null!
|
||||
SkillView!: SkillCom;
|
||||
/** 实始添加的数据层组件 */
|
||||
protected init() {
|
||||
@@ -29,6 +30,7 @@ export class Skill extends ecs.Entity {
|
||||
targetPos: Vec3, // 目标位置
|
||||
caster:any=null // 施法者
|
||||
) {
|
||||
let FIGHTCON=parent.getComponent(FightConComp);
|
||||
const config = SkillSet[uuid];
|
||||
if (!config) return;
|
||||
|
||||
@@ -44,6 +46,15 @@ export class Skill extends ecs.Entity {
|
||||
// 添加技能组件
|
||||
const skillComp = node.getComponent(SkillCom); // 初始化技能参数
|
||||
skillComp.ap = caster.ap;
|
||||
if(caster.fac==0){
|
||||
if(caster.is_master){
|
||||
skillComp.ap=Math.floor(skillComp.ap*(100+FIGHTCON.hero.ATK+FIGHTCON.ally.ATK)/100);
|
||||
}else{
|
||||
skillComp.ap=Math.floor(skillComp.ap*(100+FIGHTCON.friend.ATK+FIGHTCON.ally.ATK)/100);
|
||||
}
|
||||
}else{
|
||||
skillComp.ap=Math.floor(skillComp.ap*(100-FIGHTCON.enemy.ATK)/100);
|
||||
}
|
||||
skillComp.s_uuid = uuid;
|
||||
skillComp.animType = config.AnimType;
|
||||
skillComp.endType = config.endType;
|
||||
|
||||
Reference in New Issue
Block a user