重置配置表

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-11-06 02:25:02 +08:00
parent e8f8cb3ce9
commit e24dded990
154 changed files with 1214 additions and 26044 deletions

View File

@@ -16,16 +16,11 @@ import axios from "../../extensions/ngame/assets/plugins/axios.js";
import GBattleModeManager from "./battle/GBattleModeManager";
import { GLayer, UIConfig } from "./ui/UIConfig";
import JLoaderSystem from "../../extensions/ngame/assets/ngame/system/JLoaderSystem";
import { TableGRole } from "../resources/config/ts/TableGRole";
import { sp } from "cc";
import { TableGRoleAttack } from "../resources/config/ts/TableGRoleAttack";
import { SpriteFrame } from "cc";
import { TableGRoleAttackBullet } from "../resources/config/ts/TableGRoleAttackBullet";
import { TableGRoleAttackEffect } from "../resources/config/ts/TableGRoleAttackEffect";
import { TableGRoleSkill } from "../resources/config/ts/TableGRoleSkill";
import { TableGRoleSkillEffect } from "../resources/config/ts/TableGRoleSkillEffect";
import { TableGMap } from "../resources/config/ts/TableGMap";
import Loading from "../../extensions/ngame/assets/ngame/util/Loading";
import { TB, Tables } from "../resources/config/data/schema";
import { JsonAsset } from "cc";
let IP = "kyu.jisol.cn";
@@ -104,37 +99,33 @@ export abstract class JNGSyncProtoBase<T> extends JNSyncFrameProtoComponent<T>{
}
export var TD:Tables = null;
//读写config
export class JNGConfig extends SystemBase{
static loading = "JNGConfig";
//配置JSON加载
jsons:JsonLoad[] = [
{name:TableGRole.TableName}, //角色
{name:TableGRoleAttack.TableName}, //角色攻击
{name:TableGRoleAttackBullet.TableName}, //角色攻击子弹
{name:TableGRoleAttackEffect.TableName}, //角色攻击特效
{name:TableGRoleSkill.TableName}, //角色技能
{name:TableGRoleSkillEffect.TableName}, //角色技能特效
{name:TableGMap.TableName}, //游戏地图
].map((table) => {
return {
name:table.name,
bundle:"resources",
path:"config/game/"
}
});
async onInit(): Promise<any> {
app.loading.setCurrent(JNGConfig.loading);
for (const key in this.jsons) {
const load = this.jsons[key];
let json2 = resources.getDirWithPath("config/json/",JsonAsset).map((info) => {
let args = info.path.split("/");
return {
name:args[args.length - 1],
bundle:"resources",
path:"config/json/"
}
})
for (const key in json2) {
const load = json2[key];
await JsonUtil.load(load);
}
TD = new Tables((file) => JsonUtil.get(file))
console.log(TD);
app.loading.ok(JNGConfig.loading);
}
@@ -146,10 +137,11 @@ export class JLoaderBattle extends JLoaderSystem{
static loading = "JLoaderBattle";
static loadingInit = "JLoaderBattle_Init";
skData:{[id:number]:sp.SkeletonData} = {}; //角色Spine
bullets:{[id:number]:SpriteFrame} = {}; //子弹
effects:{[id:number]:sp.SkeletonData} = {}; //Spine特效
maps:{[id:number]:SpriteFrame[]} = {}; //地图
roleSpine:{[id:number]:sp.SkeletonData} = {}; //角色Spine
roleResImage:{[id:number]:SpriteFrame} = {}; //角色战斗素材图片
roleResSpine:{[id:number]:sp.SkeletonData} = {}; //角色战斗素材Spine
effects:{[id:number]:sp.SkeletonData} = {}; //Spine特效
maps:{[id:number]:SpriteFrame[]} = {}; //地图
async onInit(): Promise<any> {
@@ -162,43 +154,33 @@ export class JLoaderBattle extends JLoaderSystem{
app.loading.setCurrent(JLoaderBattle.loadingInit);
//将配置表的角色都读取出来
for (const info of Object.values(TableGRole.getAllConfig())) {
this.skData[info.id] = await (new Promise(r => {
for (const info of TD.TbGRole.getDataMap().values()) {
this.roleSpine[info.id] = await (new Promise(r => {
this.bundle.load(info.spine,sp.SkeletonData,(err,data) => {
r(data);
})
}))
}
//将所有子弹读取出来
for (const info of Object.values(TableGRoleAttackBullet.getAllConfig())) {
this.bullets[info.id] = await (new Promise(r => {
this.bundle.load(info.bulletSrc,SpriteFrame,(err,data) => {
r(data);
})
}))
}
//攻击特效读取
for (const info of Object.values(TableGRoleAttackEffect.getAllConfig())) {
this.effects[info.id] = await (new Promise(r => {
this.bundle.load(info.spine,sp.SkeletonData,(err,data) => {
r(data);
})
}))
}
//技能特效读取
for (const info of Object.values(TableGRoleSkillEffect.getAllConfig())) {
this.effects[info.id] = await (new Promise(r => {
this.bundle.load(info.spine,sp.SkeletonData,(err,data) => {
r(data);
})
}))
//读取角色战斗素材
for(const info of TD.TbGRoleBattleRes.getDataMap().values()){
if(info.resType == "Spine"){
this.roleResSpine[info.id] = await (new Promise(r => {
this.bundle.load(info.resSrc,sp.SkeletonData,(err,data) => {
r(data);
})
}))
}else{
this.roleResImage[info.id] = await (new Promise(r => {
this.bundle.load(info.resSrc,SpriteFrame,(err,data) => {
r(data);
})
}))
}
}
//读取地图
for (const info of Object.values(TableGMap.getAllConfig())) {
for (const info of TD.TbGMap.getDataMap().values()) {
this.maps[info.id] = await (Promise.all(["1","2","3"].map(index => `map${index}`).map(key => {
return new Promise<SpriteFrame>(r => {
@@ -234,5 +216,5 @@ export const app = {
[JNGConfig.loading]:{title:"加载配置文件"},
[JLoaderBattle.loading]:{title:"加载战斗资源"},
[JLoaderBattle.loadingInit]:{title:"初始化战斗资源"},
})
}),
}

View File

@@ -2,7 +2,6 @@ import { _decorator, Component, director, instantiate, Node, Prefab } from 'cc';
import { app } from './App';
import { JNGame } from '../../extensions/ngame/assets/ngame/JNGame';
import { JNSyncAction } from '../../extensions/ngame/assets/ngame/sync/JNSyncAction';
import { TableGRole } from '../resources/config/ts/TableGRole';
const { ccclass, property } = _decorator;
@ccclass('Main')
@@ -24,13 +23,11 @@ export class Main extends Component {
{path:"proto/GDemo"}
]);
console.log("TableGRole",TableGRole.getAllConfig())
//发生帧同步开始
app.socket.Send(JNSyncAction.NSyncFrameStart);
// 创建世界
// director.getScene().addChild(instantiate(this.WorldPrefab));
director.getScene().addChild(instantiate(this.WorldPrefab));
}

View File

@@ -1,14 +1,10 @@
import { Node } from "cc";
import { TableGRoleAttack } from "../../../../resources/config/ts/TableGRoleAttack";
import GRoleBase from "../role/GRoleBase";
import GAttackNormal from "./GAttackNormal";
import GAttackParabolicBangRemote from "./GAttackParabolicBangRemote";
import { UITransform } from "cc";
import GButtleBase from "../bullet/GButtleBase";
import { GFSMAnimBase } from "../fsm/GFSMAnimBase";
import GFSMBase from "../fsm/GFSMBase";
import GRoleDefault from "../role/GRoleDefault";
import GNode from "../common/GNode";
import { TB } from "../../../../resources/config/data/schema";
//攻击子弹类
export class GAttackBullet{
@@ -26,7 +22,7 @@ export class GAttackBullet{
//攻击方式基类
export interface GAttackBase{
attack(role:GRoleDefault,info:TableGRoleAttack);
attack(role:GRoleDefault,info:TB.TbGRoleAttack);
}
//攻击方式

View File

@@ -1,4 +1,4 @@
import { TableGRoleAttack } from "../../../../resources/config/ts/TableGRoleAttack";
import { TB } from "../../../../resources/config/data/schema";
import GRoleDefault from "../role/GRoleDefault";
import { GAttackBase } from "./GAttack";
@@ -6,7 +6,7 @@ import { GAttackBase } from "./GAttack";
//普通攻击
export default class GAttackNormal implements GAttackBase{
attack(role: GRoleDefault, info: TableGRoleAttack) {
attack(role: GRoleDefault, info: TB.TbGRoleAttack) {
role.fsm.enemy.onHit();
}

View File

@@ -1,6 +1,5 @@
import { SpriteFrame } from "cc";
import { TableGRoleAttack } from "../../../../resources/config/ts/TableGRoleAttack";
import { app } from "../../../App";
import { TD, app } from "../../../App";
import GRoleBase from "../role/GRoleBase";
import { GAttackBase, GAttackBullet } from "./GAttack";
import GButtleDefault from "../bullet/GButtleDefault";
@@ -9,10 +8,10 @@ import { bezier } from "cc";
import { v2 } from "cc";
import { Vec2 } from "cc";
import GEffectUtil from "../common/GEffectUtil";
import { TableGRoleAttackEffect } from "../../../../resources/config/ts/TableGRoleAttackEffect";
import GDetection from "../common/GDetection";
import { rect } from "cc";
import GRoleDefault from "../role/GRoleDefault";
import { TB } from "../../../../resources/config/data/schema";
/**
* 抛物线 爆炸普攻
@@ -20,15 +19,15 @@ import GRoleDefault from "../role/GRoleDefault";
*/
export default class GAttackParabolicRemote implements GAttackBase{
attack(role: GRoleDefault, info: TableGRoleAttack): void {
attack(role: GRoleDefault, info: TB.TbGRoleAttack): void {
let enemy = role.fsm.enemy;
if(!enemy) return;
let image:SpriteFrame = app.battleRes.bullets[info.attackArgs[0]];
let image:SpriteFrame = app.battleRes.roleResImage[info.attackArgs[0]];
let bang = {
ske: app.battleRes.effects[info.attackArgs[1]],
info: TableGRoleAttackEffect.getConfig(info.attackArgs[1])
ske: app.battleRes.roleResSpine[info.attackArgs[1]],
info: TD.TbGRoleBattleRes.get(parseInt(info.attackArgs[1]))
};
let bone = role.spine.findBone(info.attackArgs[2]);
let scale:number = parseFloat(info.attackArgs[3]);
@@ -73,7 +72,7 @@ export default class GAttackParabolicRemote implements GAttackBase{
let effect = GEffectUtil.createOne(bang.ske);
role.mode.addGNode(effect.node,bullet.node.worldPosition);
//获取默认动画
effect.setAnimation(0,bang.info.animation,false);
effect.setAnimation(0,"animation",false);
//销毁
bullet.node.destroy();

View File

@@ -1,11 +1,9 @@
import { _decorator, Component, Node } from 'cc';
import { app, JNGSyncBase } from '../../../../App';
import { SpriteFrame } from 'cc';
import { TableGMap } from '../../../../../resources/config/ts/TableGMap';
import { Sprite } from 'cc';
import { UITransform } from 'cc';
import { v3 } from 'cc';
import { Vec2 } from 'cc';
import { size } from 'cc';
import GNode from '../GNode';
const { ccclass, property } = _decorator;

View File

@@ -3,13 +3,11 @@ import GObject, { GTowards } from "../GObject";
import { JNFrameInfo } from "../../../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame";
import { Vec2 } from "cc";
import { v3 } from "cc";
import { TableGRole } from "../../../../resources/config/ts/TableGRole";
import { TableGRoleSkill } from "../../../../resources/config/ts/TableGRoleSkill";
import { GSkill, GSkillBase, GSkillState } from "../../skill/GSkill";
import JNSkeleton from "../../../../../extensions/ngame/assets/ngame/sync/frame/game/spine/JNFrameSkeleton";
import { GFSMAnimBase } from "../fsm/GFSMAnimBase";
import GFSMBase from "../fsm/GFSMBase";
import { app } from "../../../App";
import { TB } from "../../../../resources/config/data/schema";
const { ccclass, property } = _decorator;
export enum GRoleAnimEvent{
@@ -23,7 +21,7 @@ export default abstract class GRoleBase<T> extends GObject<T>{
spine:JNSkeleton;
//角色
role:TableGRole;
role:TB.TbGRole;
//状态机
fsm:GFSMBase;
@@ -80,9 +78,9 @@ export default abstract class GRoleBase<T> extends GObject<T>{
}
//初始化
protected init(role:TableGRole){
protected init(role:TB.TbGRole){
if(this.spine)
this.spine.skeletonData = app.battleRes.skData[role.id];
this.spine.skeletonData = app.battleRes.roleSpine[role.id];
}
//创建一个状态机

View File

@@ -2,19 +2,18 @@ import { _decorator } from "cc";
import GRoleBase, { GRoleAnimEvent } from "./GRoleBase";
import { ProgressBar } from "cc";
import { JNFrameInfo } from "../../../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame";
import { TableGRole } from "../../../../resources/config/ts/TableGRole";
import { GFSMAnimBase, GFSMBattleAminEnum } from "../fsm/GFSMAnimBase";
import { GFSMDefaultAnim } from "../fsm/Default/GFSMDefaultAnim";
import GFSMDefault from "../fsm/Default/GFSMDefault";
import { JEasing } from "../../../../../extensions/ngame/assets/ngame/sync/frame/game/tween/JNFrameTween";
import { TableGRoleAttack } from "../../../../resources/config/ts/TableGRoleAttack";
import { GAttack } from "../attack/GAttack";
import { v2 } from "cc";
import { GTactical } from "../../entity/GTactical";
import { Vec2 } from "cc";
import { GSkill, GSkillBase, GSkillState } from "../../skill/GSkill";
import { TableGRoleSkill } from "../../../../resources/config/ts/TableGRoleSkill";
import JNFrameTime from "../../../../../extensions/ngame/assets/ngame/sync/frame/game/time/JNFrameTime";
import { TB } from "../../../../resources/config/data/schema";
import { TD } from "../../../App";
const { property,ccclass } = _decorator;
//默认角色类
@@ -77,7 +76,7 @@ export default class GRoleDefault extends GRoleBase<{}>{
}
//初始化
onInit(type:number,role:TableGRole,tactical:GTactical,tacticalIndex:number){
onInit(type:number,role:TB.TbGRole,tactical:GTactical,tacticalIndex:number){
super.init(role);
this.type = type;
@@ -89,7 +88,7 @@ export default class GRoleDefault extends GRoleBase<{}>{
// 设置技能
this.skills = role.roleSkillIds.map(skillId => {
let info = TableGRoleSkill.getConfig(skillId);
let info = TD.TbGRoleSkill.get(skillId);
return (new GSkill[info.skillController]()).bind(this,info);
})
@@ -123,7 +122,7 @@ export default class GRoleDefault extends GRoleBase<{}>{
if(!this.fsm.enemy) return;
console.log(`播放动画[${this.nId}] onAttack`,this.fsm.enemy.nId)
//敌人扣血
let info = TableGRoleAttack.getConfig(this.role.id);
let info = TD.TbGRoleAttack.get(this.role.id);
(new GAttack[info.attackWay]()).attack(this,info);
this.attackCallbacks.forEach(fun => fun());
}

View File

@@ -1,6 +1,5 @@
import { TableGRole } from "../../../resources/config/ts/TableGRole";
import { GFSMAnimBase } from "../base/fsm/GFSMAnimBase";
import GFSMBase from "../base/fsm/GFSMBase";
import { TB } from "../../../resources/config/data/schema";
import { TD } from "../../App";
import GRoleBase from "../base/role/GRoleBase";
//角色工具类
@@ -17,13 +16,13 @@ export class GRoleUtil{
}
//通过Id 获取 GRole
static getGRole(id:number):TableGRole{
let info:TableGRole;
if(!(info = TableGRole.getConfig(id))) return null;
static getGRole(id:number):TB.TbGRole{
let info:TB.TbGRole;
if(!(info = TD.TbGRole.get(id))) return null;
return info
}
static getGRoles(ids:number[]):TableGRole[]{
static getGRoles(ids:number[]):TB.TbGRole[]{
return ids.map(id => GRoleUtil.getGRole(id));
}

View File

@@ -1,5 +1,4 @@
import { Vec2 } from "cc";
import { TableGRole } from "../../../resources/config/ts/TableGRole";
import GBaseMode from "../GBaseMode";
import { GRoleUtil } from "../entity/GRole";
import { GTactical } from "../entity/GTactical";
@@ -12,11 +11,11 @@ import { JNFrameInfo } from "../../../../extensions/ngame/assets/ngame/sync/fram
import { GMapLoop } from "../base/common/map/GMapLoop";
import { Node } from "cc";
import JNFrameTime from "../../../../extensions/ngame/assets/ngame/sync/frame/game/time/JNFrameTime";
import { TableGMap } from "../../../resources/config/ts/TableGMap";
import { app } from "../../App";
import { TD, app } from "../../App";
import { v3 } from "cc";
import { v2 } from "cc";
import GFSMOnHookMode from "./OnHook/GFSMOnHookMode";
import { TB } from "../../../resources/config/data/schema";
const { ccclass, property } = _decorator;
//挂机模式状态
@@ -37,7 +36,7 @@ export interface GOnHookInfo{
//阵法
tactical: GTactical;
//宠物列表
roles: TableGRole[];
roles: TB.TbGRole[];
}
/**
@@ -80,7 +79,7 @@ export default class GOnHookMode extends GBaseMode<{}>{
enemyRoles: GRoleDefault[] = [];
//地图信息
mapInfo:TableGMap;
mapInfo:TB.TbGMap;
//每一波怪的距离
everyX:number = 600;
@@ -113,7 +112,7 @@ export default class GOnHookMode extends GBaseMode<{}>{
this.fsm = new GFSMOnHookMode(this);
//初始化地图
this.mapInfo = TableGMap.getConfig(60001);
this.mapInfo = TD.TbGMap.get(60001);
this.map1.init(app.battleRes.maps[60001][0],1);
this.map2.init(app.battleRes.maps[60001][1],1);
this.map3.init(app.battleRes.maps[60001][2],1,app.battleRes.maps[60001][1].width,app.battleRes.maps[60001][1].height);
@@ -169,7 +168,7 @@ export default class GOnHookMode extends GBaseMode<{}>{
}
//生成宠物
onGenRole(type: GOnHookModePlayerEnum,index:number,info:TableGRole) {
onGenRole(type: GOnHookModePlayerEnum,index:number,info:TB.TbGRole) {
let tactical = this.getInfo(type).tactical;
let pos:Vec2 = this.getInfo(type).tactical.getPosition(index);

View File

@@ -5,9 +5,9 @@ import { Prefab } from "cc";
import { instantiate } from "cc";
import { Vec2 } from "cc";
import { GRoleUtil } from "../entity/GRole";
import { TableGRole } from "../../../resources/config/ts/TableGRole";
import GRoleDefault from "../base/role/GRoleDefault";
import { v3 } from "cc";
import { TB } from "../../../resources/config/data/schema";
const { ccclass, property } = _decorator;
//PVP 角色
@@ -21,7 +21,7 @@ export interface GPVPModePlayerInfo{
//阵法
tactical: GTactical;
//宠物列表
roles: TableGRole[];
roles: TB.TbGRole[];
}
/**
@@ -79,7 +79,7 @@ export default class GPVPMode extends GBaseMode<{}>{
}
//生成角色
onGenRole(type: GPVPModePlayerEnum,index:number,info:TableGRole) {
onGenRole(type: GPVPModePlayerEnum,index:number,info:TB.TbGRole) {
let tactical = this.getInfo(type).tactical;
let pos:Vec2 = this.getInfo(type).tactical.getPosition(index);

View File

@@ -1,8 +1,7 @@
import { TableGRoleSkill } from "../../../resources/config/ts/TableGRoleSkill";
import GRoleBase from "../base/role/GRoleBase";
import GSkillCrazySquirrel from "./RoleSkill/疯狂松鼠/GSkillCrazySquirrel";
import GSkillBulbasaurDoubleHit from "./RoleSkill/妙蛙种子/GSkillBulbasaurDoubleHit";
import GRoleDefault from "../base/role/GRoleDefault";
import { TB } from "../../../resources/config/data/schema";
//技能状态
export enum GSkillState{
@@ -15,7 +14,7 @@ export enum GSkillState{
export interface GSkillBase {
//设置
bind(role:GRoleDefault,info:TableGRoleSkill):GSkillBase;
bind(role:GRoleDefault,info:TB.TbGRoleSkill):GSkillBase;
//是否允许释放
isRelease():boolean;

View File

@@ -1,5 +1,4 @@
import { TableGRoleSkill } from "../../../resources/config/ts/TableGRoleSkill";
import GRoleBase from "../base/role/GRoleBase";
import { TB } from "../../../resources/config/data/schema";
import GRoleDefault from "../base/role/GRoleDefault";
import { GSkillBase, GSkillState } from "./GSkill";
@@ -12,7 +11,7 @@ export default abstract class GSkillAngerBase implements GSkillBase {
//怒气最大值
angerMax:number = 0;
bind(role: GRoleDefault, info: TableGRoleSkill): GSkillBase {
bind(role: GRoleDefault, info: TB.TbGRoleSkill): GSkillBase {
throw new Error("Method not implemented.");
}
isRelease(): boolean {

View File

@@ -1,4 +1,4 @@
import { TableGRoleSkill } from "../../../resources/config/ts/TableGRoleSkill";
import { TB } from "../../../resources/config/data/schema";
import GRoleBase from "../base/role/GRoleBase";
import GRoleDefault from "../base/role/GRoleDefault";
import { GSkillBase, GSkillState } from "./GSkill";
@@ -12,7 +12,7 @@ export default abstract class GSkillCDBase implements GSkillBase {
//冷却时间
cdTime:number = 0;
bind(role:GRoleDefault,info: TableGRoleSkill):GSkillCDBase {
bind(role:GRoleDefault,info: TB.TbGRoleSkill):GSkillCDBase {
return this;
}

View File

@@ -1,4 +1,4 @@
import { TableGRoleSkill } from "../../../../../resources/config/ts/TableGRoleSkill";
import { TB } from "../../../../../resources/config/data/schema";
import GRoleBase from "../../../base/role/GRoleBase";
import GRoleDefault from "../../../base/role/GRoleDefault";
import GSkillAngerBase from "../../GSkillAngerBase";
@@ -6,9 +6,9 @@ import GSkillAngerBase from "../../GSkillAngerBase";
export default class GSkillBulbasaurDoubleHit extends GSkillAngerBase{
role:GRoleDefault;
info: TableGRoleSkill;
info: TB.TbGRoleSkill;
bind(role:GRoleDefault,info: TableGRoleSkill):GSkillBulbasaurDoubleHit {
bind(role:GRoleDefault,info: TB.TbGRoleSkill):GSkillBulbasaurDoubleHit {
//技能冷却
this.role = role;
this.info = info;

View File

@@ -1,6 +1,5 @@
import { v2 } from "cc";
import { JTween } from "../../../../../../extensions/ngame/assets/ngame/sync/frame/game/tween/JNFrameTween";
import { TableGRoleSkill } from "../../../../../resources/config/ts/TableGRoleSkill";
import { app } from "../../../../App";
import GSpine from "../../../base/common/GSpine";
import GRoleBase from "../../../base/role/GRoleBase";
@@ -10,6 +9,7 @@ import GBaseMode from "../../../GBaseMode";
import GDetection from "../../../base/common/GDetection";
import { rect } from "cc";
import GRoleDefault from "../../../base/role/GRoleDefault";
import { TB } from "../../../../../resources/config/data/schema";
/**
* 疯狂松鼠技能
@@ -18,9 +18,9 @@ import GRoleDefault from "../../../base/role/GRoleDefault";
export default class GSkillCrazySquirrel extends GSkillCDBase{
role:GRoleDefault;
info: TableGRoleSkill;
info: TB.TbGRoleSkill;
bind(role:GRoleDefault,info: TableGRoleSkill):GSkillCrazySquirrel {
bind(role:GRoleDefault,info: TB.TbGRoleSkill):GSkillCrazySquirrel {
//技能冷却
this.cdTatal = parseInt(info.skillArgs[0]);
this.role = role;
@@ -40,14 +40,14 @@ export default class GSkillCrazySquirrel extends GSkillCDBase{
let ah = parseInt(this.info.skillArgs[2]);
//出现松鼠丢炸弹
GSpine.onPlayAnotherSpine(this.role,app.battleRes.effects[50001],"skill",{
GSpine.onPlayAnotherSpine(this.role,app.battleRes.roleResSpine[30003],"skill",{
end:() => {
//从天而降
let pos = enemy.v2World.add(v2(0,1000));
let end = enemy.v2World;
//生成火球
let spine = GSpine.onCreateSpine(app.battleRes.effects[50002]);
let spine = GSpine.onCreateSpine(app.battleRes.roleResSpine[30004]);
this.role.mode.addGNode(spine.node,pos);
spine.setAnimation(0,"animation",true);
spine.node.angle = 90;
@@ -59,7 +59,7 @@ export default class GSkillCrazySquirrel extends GSkillCDBase{
.onComplete(() => {
let world = spine.node.worldPosition;
spine.node.destroy();
GSpine.onPlaySceneSpine(scene,v2(world.x,world.y),app.battleRes.effects[50003],"animation");
GSpine.onPlaySceneSpine(scene,v2(world.x,world.y),app.battleRes.roleResSpine[30005],"animation");
console.log(GDetection.testAABBRole(rect(world.x,world.y,aw,ah)).length)
GDetection.testAABBRole(rect(world.x,world.y,aw,ah)).forEach(role =>{
role.onHit();