mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
添加角色 远程攻击逻辑
This commit is contained in:
19
JisolGameCocos/assets/script/battle/base/attack/GAttack.ts
Normal file
19
JisolGameCocos/assets/script/battle/base/attack/GAttack.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { TableGRoleAttack } from "../../../../resources/config/ts/TableGRoleAttack";
|
||||
import GRoleBase from "../role/GRoleBase";
|
||||
import GAttackNormal from "./GAttackNormal";
|
||||
import GAttackRemote from "./GAttackRemote";
|
||||
|
||||
|
||||
|
||||
|
||||
//攻击方式基类
|
||||
export class GAttackBase{
|
||||
attack(role:GRoleBase<{}>,info:TableGRoleAttack){};
|
||||
}
|
||||
|
||||
//攻击方式
|
||||
export const GAttack:{[key:string]:new () => GAttackBase} = {
|
||||
["Normal"]:GAttackNormal,
|
||||
["Remote"]:GAttackRemote,
|
||||
}
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "27b49d92-b5a7-4972-9a72-856cbb2daaf3",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
import { TableGRoleAttack } from "../../../../resources/config/ts/TableGRoleAttack";
|
||||
import GRoleBase from "../role/GRoleBase";
|
||||
import { GAttackBase } from "./GAttack";
|
||||
|
||||
|
||||
//普通攻击
|
||||
export default class GAttackNormal implements GAttackBase{
|
||||
|
||||
attack(role: GRoleBase<{}>, info: TableGRoleAttack) {
|
||||
role.fsm.enemy.onHit();
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "95040d38-b26e-4de8-97c8-9e1ec860843e",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
import { TableGRoleAttack } from "../../../../resources/config/ts/TableGRoleAttack";
|
||||
import { app } from "../../../App";
|
||||
import GRoleBase from "../role/GRoleBase";
|
||||
import { GAttackBase } from "./GAttack";
|
||||
|
||||
export default class GAttackRemote implements GAttackBase{
|
||||
|
||||
attack(role: GRoleBase<{}>, info: TableGRoleAttack): void {
|
||||
console.log(app.role.bullets[info.attackArgs[0]]);
|
||||
role.fsm.enemy.onHit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "565d04ae-ff80-4b3c-ac82-97dfcce552c2",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
Reference in New Issue
Block a user