mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
添加角色 远程攻击逻辑
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
//受击
|
||||
|
Reference in New Issue
Block a user