mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
重置配置表
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
//创建一个状态机
|
||||
|
@@ -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());
|
||||
}
|
||||
|
Reference in New Issue
Block a user