添加新技能
This commit is contained in:
@@ -82,7 +82,8 @@ export enum AType {
|
||||
export enum RType {
|
||||
linear = 0, //直线
|
||||
bezier = 1, //贝塞尔
|
||||
fixed = 2, //固定
|
||||
fixed = 2, //固定起点
|
||||
fixedEnd = 3, //固定终点
|
||||
}
|
||||
|
||||
export enum EType {
|
||||
@@ -304,9 +305,9 @@ export interface SkillConfig {
|
||||
export const SkillSet: Record<number, SkillConfig> = {
|
||||
// ========== 基础攻击 ========== 6001-6099
|
||||
6001: {
|
||||
uuid:6001,name:"挥击",for_hero:false,sp_name:"atk1",AtkedType:AtkedType.atked,path:"3036",quality:QualitySet.GREEN,TType:TType.Frontline,
|
||||
uuid:6001,name:"挥击",for_hero:false,sp_name:"atk_s1",AtkedType:AtkedType.atked,path:"3036",quality:QualitySet.GREEN,TType:TType.Frontline,
|
||||
TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single,CdType:CdType.cd,AType:AType.fixedStart,EType:EType.animationEnd,
|
||||
ap:100,cd:5,in:0,hit_num:1,hit:1,hited:0.2,speed:720,cost:10,fname:"max",flash:false,with:0,maxC:1,
|
||||
ap:100,cd:5,in:0.2,hit_num:1,hit:1,hited:0.2,speed:720,cost:10,fname:"max",flash:false,with:0,maxC:1,
|
||||
buffs:[],debuffs:[],info:"向最前方敌人扔出石斧,造成100%攻击的伤害"
|
||||
},
|
||||
6002: {
|
||||
|
||||
@@ -105,25 +105,25 @@ export const MonSet = {
|
||||
export const HeroInfo = {
|
||||
//主将
|
||||
5001:{uuid:5001,name:"火焰骑士",path:"hk1", fac:FacSet.HERO, quality:QualitySet.GREEN,lv:1,kind:1,
|
||||
type:HType.warrior,hp:100,mp:100,def:5,ap:15,dis:100,cd:1,speed:150,skills:[6005,6005],
|
||||
type:HType.warrior,hp:100,mp:100,def:5,ap:15,dis:100,cd:1,speed:150,skills:[6001,6001],
|
||||
buff:[],info:""},
|
||||
|
||||
5002:{uuid:5002,name:"刺客",path:"hc1", fac:FacSet.HERO, quality:QualitySet.BLUE,lv:1,kind:1,
|
||||
type:HType.warrior,hp:100,mp:100,def:5,ap:15,dis:100,cd:1,speed:150,skills:[6005,6005],
|
||||
type:HType.warrior,hp:100,mp:100,def:5,ap:15,dis:100,cd:1,speed:150,skills:[6001,6001],
|
||||
buff:[],info:""},
|
||||
|
||||
|
||||
5005:{uuid:5005,name:"绿箭",path:"ha1", fac:FacSet.HERO, quality:QualitySet.BLUE,lv:1,kind:2,
|
||||
type:HType.remote,hp:100,mp:100,def:5,ap:15,dis:400,cd:1,speed:100,skills:[6005,6005],
|
||||
type:HType.remote,hp:100,mp:100,def:5,ap:15,dis:400,cd:1,speed:100,skills:[6001,6001],
|
||||
buff:[],info:""},
|
||||
|
||||
|
||||
5007:{uuid:5007,name:"牧师",path:"hmh1", fac:FacSet.HERO, quality:QualitySet.PURPLE,lv:1,kind:2,
|
||||
type:HType.mage,hp:100,mp:100,def:5,ap:15,dis:400,cd:1,speed:100,skills:[6005,6005],
|
||||
type:HType.mage,hp:100,mp:100,def:5,ap:15,dis:400,cd:1,speed:100,skills:[6001,6001],
|
||||
buff:[],info:""},
|
||||
|
||||
5008:{uuid:5008,name:"火女",path:"hmf1", fac:FacSet.HERO, quality:QualitySet.BLUE,lv:1,kind:2,
|
||||
type:HType.mage,hp:100,mp:100,def:5,ap:15,dis:400,cd:1.5,speed:100,skills:[6005,6005],
|
||||
type:HType.mage,hp:100,mp:100,def:5,ap:15,dis:400,cd:1.5,speed:100,skills:[6001,6001],
|
||||
buff:[],info:""},
|
||||
|
||||
// 5009:{uuid:5009,name:"风暴精灵",path:"hk1", fac:FacSet.HERO, quality:QualitySet.BLUE,lv:1,kind:2,
|
||||
@@ -141,65 +141,65 @@ export const HeroInfo = {
|
||||
|
||||
//怪物
|
||||
5201:{uuid:5201,name:"兽人战士",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1,
|
||||
type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6005,6005],
|
||||
type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001,6001],
|
||||
buff:[],info:"普通怪物-战士型"},
|
||||
|
||||
5202:{uuid:5202,name:"兽人刺客",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1,
|
||||
type:HType.remote,hp:20,mp:100,def:5,ap:5,dis:350,cd:1,speed:100,skills:[6005,6005],
|
||||
type:HType.remote,hp:20,mp:100,def:5,ap:5,dis:350,cd:1,speed:100,skills:[6001,6001],
|
||||
buff:[],info:"普通怪物-战士型"},
|
||||
|
||||
5203:{uuid:5203,name:"兽人护卫",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1,
|
||||
type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6005,6005],
|
||||
type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001,6001],
|
||||
buff:[],info:"普通怪物-战士型"},
|
||||
|
||||
5204:{uuid:5204,name:"石卫", path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1,
|
||||
type:HType.mage,hp:18,mp:100,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6005,6005],
|
||||
type:HType.mage,hp:18,mp:100,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6001,6001],
|
||||
buff:[],info:"法师怪物-高伤害脆弱"},
|
||||
|
||||
5205:{uuid:5205,name:"土卫", path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1,
|
||||
type:HType.mage,hp:18,mp:100,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6005,6005],
|
||||
type:HType.mage,hp:18,mp:100,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6001,6001],
|
||||
buff:[],info:"法师怪物-高伤害脆弱"},
|
||||
|
||||
5206:{uuid:5206,name:"树卫", path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1,
|
||||
type:HType.mage,hp:18,mp:100,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6005,6005],
|
||||
type:HType.mage,hp:18,mp:100,def:5,ap:5,dis:90,cd:2.5,speed:100,skills:[6001,6001],
|
||||
buff:[],info:"法师怪物-高伤害脆弱"},
|
||||
|
||||
|
||||
|
||||
5219:{uuid:5219,name:"牛头战士",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:2,kind:1,
|
||||
type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6005,6005],
|
||||
type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001,6001],
|
||||
buff:[],info:"普通怪物-战士型"},
|
||||
|
||||
5220:{uuid:5220,name:"牛头战士",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1,
|
||||
type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6005,6005],
|
||||
type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001,6001],
|
||||
buff:[],info:"普通怪物-战士型"},
|
||||
|
||||
5221:{uuid:5221,name:"牛头战士",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1,
|
||||
type:HType.remote,hp:20,mp:100,def:5,ap:5,dis:350,cd:1.5,speed:100,skills:[6005,6005],
|
||||
type:HType.remote,hp:20,mp:100,def:5,ap:5,dis:350,cd:1.5,speed:100,skills:[6001,6001],
|
||||
buff:[],info:"普通怪物-战士型"},
|
||||
|
||||
5222:{uuid:5222,name:"独眼巨人",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1,
|
||||
type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6005,6005],
|
||||
type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001,6001],
|
||||
buff:[],info:"普通怪物-战士型"},
|
||||
|
||||
5223:{uuid:5223,name:"独眼巨人",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1,
|
||||
type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6005,6005],
|
||||
type:HType.warrior,hp:25,mp:100,def:5,ap:5,dis:90,cd:2,speed:100,skills:[6001,6001],
|
||||
buff:[],info:"普通怪物-战士型"},
|
||||
|
||||
5224:{uuid:5224,name:"独眼巨人",path:"mo1", fac:FacSet.MON, quality:QualitySet.GREEN,lv:1,kind:1,
|
||||
type:HType.remote,hp:20,mp:100,def:5,ap:5,dis:350,cd:1.5,speed:100,skills:[6005,6005],
|
||||
type:HType.remote,hp:20,mp:100,def:5,ap:5,dis:350,cd:1.5,speed:100,skills:[6001,6001],
|
||||
buff:[],info:"普通怪物-战士型"},
|
||||
|
||||
5225:{uuid:5225,name:"精英独眼",path:"mo1", fac:FacSet.MON, quality:QualitySet.BLUE,lv:1,kind:1,
|
||||
type:HType.warrior,hp:45,mp:100,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6005],
|
||||
type:HType.warrior,hp:45,mp:100,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6001],
|
||||
buff:[],info:"精英怪物-战士型"},
|
||||
|
||||
5226:{uuid:5226,name:"精英牛头",path:"mo1", fac:FacSet.MON, quality:QualitySet.BLUE,lv:1,kind:1,
|
||||
type:HType.warrior,hp:45,mp:100,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6005,6005],
|
||||
type:HType.warrior,hp:45,mp:100,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6001,6001],
|
||||
buff:[],info:"精英怪物-战士型"},
|
||||
|
||||
5227:{uuid:5227,name:"精英兽人",path:"mo1", fac:FacSet.MON, quality:QualitySet.BLUE,lv:1,kind:1,
|
||||
type:HType.warrior,hp:45,mp:100,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6005,6005],
|
||||
type:HType.warrior,hp:45,mp:100,def:5,ap:12,dis:300,cd:2,speed:100,skills:[6001,6001],
|
||||
buff:[],info:"精英怪物-战士型"},
|
||||
|
||||
};
|
||||
|
||||
@@ -112,6 +112,7 @@ export class SkillConComp extends CCComp {
|
||||
if (!this.node || !this.node.isValid || !this.HeroView || !this.HeroView.node || !this.HeroView.node.isValid) {
|
||||
return;
|
||||
}
|
||||
console.log("技能开始",sEnt)
|
||||
sEnt.load(
|
||||
new Vec3(this.HeroView.node.position.x,this.HeroView.node.position.y,0),
|
||||
this.node.parent,
|
||||
|
||||
@@ -111,6 +111,15 @@ export class AtkConCom extends CCComp {
|
||||
bm.rotationSmoothness=0.6
|
||||
bm.moveTo(this.targetPos);
|
||||
}
|
||||
do_fixedEnd(){
|
||||
this.node.setPosition(this.targetPos.x > 360?300:this.targetPos.x,0,0)
|
||||
this.do_anim()
|
||||
}
|
||||
do_fixedStart(){
|
||||
this.node.setPosition(this.startPos.x > 360?300:this.startPos.x,0,0)
|
||||
this.do_anim()
|
||||
}
|
||||
|
||||
onAnimationFinished(){
|
||||
// console.log("[SkillCom]:onAnimationFinished",this.s_uuid)
|
||||
if (!this.skillConfig) return;
|
||||
|
||||
@@ -30,13 +30,15 @@ load(startPos: Vec3, parent: Node, uuid: number, targetPos: any[], caster:Hero
|
||||
console.error("[Skill] 预制体加载失败:", path);
|
||||
return;
|
||||
}
|
||||
console.log("load skill startPos",startPos)
|
||||
// console.log("load skill startPos",startPos)
|
||||
const node: Node = instantiate(prefab);
|
||||
console.log("load skill node",node)
|
||||
node.parent = parent;
|
||||
// 设置节点属性
|
||||
node.setPosition(startPos);
|
||||
if(caster.fac==FacSet.MON){
|
||||
node.scale=v3(node.scale.x*-1,1,1)
|
||||
|
||||
}else{
|
||||
if(caster.type==HType.warrior){
|
||||
if(caster.node.scale.x<0){
|
||||
|
||||
@@ -64,11 +64,13 @@ export class SkillViewCom extends CCComp {
|
||||
start() {
|
||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
this.node.getChildByName("ready").active = this.hasReady
|
||||
console.log("[skillView] start ",this.hasReady)
|
||||
}
|
||||
protected update(dt: number): void {
|
||||
this.doTimer(dt)
|
||||
this.move(dt)
|
||||
this.doEnd(dt)
|
||||
this.do_cd(dt)
|
||||
if(this.readyFinish) this.doAtk(dt)
|
||||
}
|
||||
doEnd(dt: number) {
|
||||
@@ -79,25 +81,32 @@ export class SkillViewCom extends CCComp {
|
||||
}
|
||||
|
||||
doTimer(dt: number){
|
||||
console.log('[skillview]:doTimer',this.ReadyTime,this.readyFinish)
|
||||
if(this.ReadyTime > 0) this.ReadyTime -= dt
|
||||
if(this.ReadyTime <=0) this.readyFinish=true
|
||||
}
|
||||
doAtk(dt:number): void {
|
||||
// console.log(`${this.cName}_[SkillViewCom] doAtkC`)
|
||||
console.log(`${this.cName}_[SkillViewCom] doAtkC`,this.s_cd,this.s_count)
|
||||
if(this.s_cd <= 0&&this.s_count > 0) {
|
||||
console.log(`${this.cName}_[SkillViewCom] doAtk 2`)
|
||||
this.doSkill()
|
||||
this.s_count--
|
||||
this.s_cd = this.s_interval
|
||||
}
|
||||
}
|
||||
do_cd(dt:number){
|
||||
if(this.s_cd > 0) this.s_cd -= dt
|
||||
}
|
||||
doSkill(){
|
||||
// console.log(`${this.cName}_[SkillViewCom] doSkill`,this.atkPrefab)
|
||||
console.log(`${this.cName}_[SkillViewCom] atkPrefab`,this.atkPrefab)
|
||||
if(this.atkPrefab!=null){
|
||||
let atkNode:Node = instantiate(this.atkPrefab)
|
||||
atkNode.parent = this.node.parent
|
||||
atkNode.setPosition(v3(this.node.position.x + this.atk_x*this.scale, this.node.position.y + this.atk_y))
|
||||
// console.log(`${this.cName}_[SkillViewCom] doSkill atkNode`,this.node.position,atkNode.position)
|
||||
if(this.node.scale.x < 0){
|
||||
atkNode.setScale(v3(atkNode.scale.x*-1,atkNode.scale.y,atkNode.scale.z))
|
||||
}
|
||||
atkNode.setPosition(v3(this.node.position.x + this.atk_x*atkNode.scale.x, this.node.position.y + this.atk_y))
|
||||
console.log(`${this.cName}_[SkillViewCom] doSkill atkNode`,this.node.position,atkNode.position)
|
||||
let atkCom=atkNode.getComponent(AtkConCom)
|
||||
// 计算延长后的目标点坐标
|
||||
const originalStart = v3(this.node.position.x + this.atk_x, this.node.position.y + this.atk_y);
|
||||
@@ -142,6 +151,9 @@ export class SkillViewCom extends CCComp {
|
||||
case RType.fixed:
|
||||
this.do_fixed(atkNode)
|
||||
break
|
||||
case RType.fixedEnd:
|
||||
this.do_fixedEnd(atkNode)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -155,6 +167,12 @@ export class SkillViewCom extends CCComp {
|
||||
}
|
||||
do_fixed(atkNode:any): void {
|
||||
console.log(`${this.cName}_[SkillViewCom] skille run type: fixed`)
|
||||
atkNode.getComponent(AtkConCom).do_fixedStart()
|
||||
|
||||
}
|
||||
do_fixedEnd(atkNode:any): void {
|
||||
console.log(`${this.cName}_[SkillViewCom] skille run type: fixedEnd`)
|
||||
atkNode.getComponent(AtkConCom).do_fixedEnd()
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs
|
||||
import { CCComp } from "../../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { HeroViewComp } from "../../hero/HeroViewComp";
|
||||
import { SkillCom } from "../SkillCom";
|
||||
import { AtkConCom } from "../../skill/AtkConCom";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -17,7 +18,9 @@ export class AtkComComp extends CCComp {
|
||||
}
|
||||
|
||||
public atk(args:any){
|
||||
let skill=this.node.getComponent(SkillCom)
|
||||
let scom=this.node.getComponent(SkillCom)
|
||||
let acom=this.node.getComponent(AtkConCom)
|
||||
let skill=scom?scom:acom
|
||||
let dis=this.node.getComponent(UITransform).width/2
|
||||
let targetsInRange: HeroViewComp[] = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user