添加角色 远程攻击逻辑

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-10-27 02:38:08 +08:00
parent 39dd60bb8d
commit 7e402432dd
199 changed files with 7059 additions and 5 deletions

View File

@@ -10,6 +10,8 @@ import { JEasing, JTween } from "../../../../../extensions/ngame/assets/ngame/sy
import { v2 } from "cc";
import GRole from "../../entity/GRole";
import { app } from "../../../App";
import { TableGRoleAttack } from "../../../../resources/config/ts/TableGRoleAttack";
import { GAttack, GAttackBase } from "../attack/GAttack";
const { ccclass, property } = _decorator;
export enum GRoleAnimEvent{
@@ -96,6 +98,7 @@ export default abstract class GRoleBase<T> extends GObject<T>{
bind(role:GRole){
if(this.spine)
this.spine.skeletonData = app.role.skData[role.id];
this.range = role.range; //设置攻击范围
this.role = role;
}
@@ -143,7 +146,8 @@ export default abstract class GRoleBase<T> extends GObject<T>{
//攻击
onAttack(){
//敌人扣血
this.fsm.enemy?.onHit();
let info = TableGRoleAttack.getConfig(this.role.id);
(new GAttack[info.attackWay]()).attack(this,info);
}
//受击