2023-10-27 19:17:47 +08:00
|
|
|
import { Node } from "cc";
|
2023-10-27 02:38:08 +08:00
|
|
|
import { TableGRoleAttack } from "../../../../resources/config/ts/TableGRoleAttack";
|
|
|
|
import GRoleBase from "../role/GRoleBase";
|
|
|
|
import GAttackNormal from "./GAttackNormal";
|
2023-10-30 02:34:11 +08:00
|
|
|
import GAttackParabolicBangRemote from "./GAttackParabolicBangRemote";
|
2023-10-27 19:17:47 +08:00
|
|
|
import { UITransform } from "cc";
|
|
|
|
import GButtleBase from "../bullet/GButtleBase";
|
2023-10-27 02:38:08 +08:00
|
|
|
|
2023-10-27 19:17:47 +08:00
|
|
|
//攻击子弹类
|
|
|
|
export class GAttackBullet{
|
2023-10-27 02:38:08 +08:00
|
|
|
|
2023-10-27 19:17:47 +08:00
|
|
|
//创建子弹
|
|
|
|
static create<T extends GButtleBase<{}>>(GClass:{new():T},data:{}):T{
|
|
|
|
let bulletNode = new Node();
|
|
|
|
bulletNode.addComponent(UITransform);
|
|
|
|
let bullet = bulletNode.addComponent(GClass);
|
|
|
|
bullet.setData(data);
|
|
|
|
return bullet;
|
|
|
|
}
|
2023-10-27 02:38:08 +08:00
|
|
|
|
2023-10-27 19:17:47 +08:00
|
|
|
}
|
2023-10-27 02:38:08 +08:00
|
|
|
|
|
|
|
//攻击方式基类
|
2023-10-30 02:34:11 +08:00
|
|
|
export interface GAttackBase{
|
|
|
|
attack(role:GRoleBase<{}>,info:TableGRoleAttack);
|
2023-10-27 02:38:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//攻击方式
|
2023-10-27 19:17:47 +08:00
|
|
|
export const GAttack:{[key:string]:(new () => GAttackBase)} = {
|
2023-10-27 02:38:08 +08:00
|
|
|
["Normal"]:GAttackNormal,
|
2023-10-30 02:34:11 +08:00
|
|
|
["ParabolicBangRemote"]:GAttackParabolicBangRemote,
|
2023-10-27 02:38:08 +08:00
|
|
|
}
|
|
|
|
|