添加角色 远程攻击逻辑

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

@@ -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,
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "27b49d92-b5a7-4972-9a72-856cbb2daaf3",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -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();
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "95040d38-b26e-4de8-97c8-9e1ec860843e",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -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();
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "565d04ae-ff80-4b3c-ac82-97dfcce552c2",
"files": [],
"subMetas": {},
"userData": {}
}