mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-12-14 00:39:16 +00:00
添加角色 远程攻击逻辑
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { JsonUtil } from "../../../../extensions/ngame/assets/ngame/util/JsonUtil";
|
||||
|
||||
export class TableGRoleAttack {
|
||||
static TableName: string = "GRoleAttack";
|
||||
|
||||
static getAllConfig(): { [id: string]: TableGRoleAttack } {
|
||||
return JsonUtil.get(TableGRoleAttack.TableName);
|
||||
}
|
||||
|
||||
static getConfig(id: number | string) {
|
||||
return TableGRoleAttack.getAllConfig()[id] as TableGRoleAttack;
|
||||
}
|
||||
|
||||
private data: any;
|
||||
|
||||
init(roleId: number) {
|
||||
var table = JsonUtil.get(TableGRoleAttack.TableName);
|
||||
this.data = table[roleId];
|
||||
this._roleId = roleId;
|
||||
}
|
||||
/** 角色Id */
|
||||
private _roleId: number = 0;
|
||||
|
||||
/** 角色Id */
|
||||
get roleId(): number {
|
||||
return this.data.roleId;
|
||||
}
|
||||
/** 攻击方式 */
|
||||
get attackWay(): string {
|
||||
return this.data.attackWay;
|
||||
}
|
||||
/** 攻击参数 */
|
||||
get attackArgs(): string[] {
|
||||
return this.data.attackArgs;
|
||||
}
|
||||
Reference in New Issue
Block a user