captainbattle 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cc/dist/index.d.ts +60 -97
- package/dist/cc/dist/index.js +42 -67
- package/dist/core/util/GameUtil.d.ts +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +18 -0
- package/node_modules/cc/dist/index.js +67 -46
- package/node_modules/cc/package.json +2 -1
- package/package.json +1 -5
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +0 -9
package/dist/cc/dist/index.d.ts
CHANGED
|
@@ -1,29 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
export const __esModule: boolean;
|
|
2
|
+
export const js: {};
|
|
3
|
+
export const math: {};
|
|
4
|
+
export const director: Director;
|
|
5
|
+
export namespace _decorator {
|
|
6
|
+
function ccclass(nameOrTarget: any): (target: any) => any;
|
|
7
|
+
function property(...args: any[]): (target: any, propertyKey: any) => void;
|
|
8
|
+
function executeInEditMode(target: any): any;
|
|
9
|
+
function requireComponent(_type: any): (target: any) => any;
|
|
10
|
+
function executionOrder(_order: any): (target: any) => any;
|
|
11
|
+
function disallowMultiple(target: any): any;
|
|
12
|
+
function allowMultiple(target: any): any;
|
|
13
|
+
function menu(_path: any): (target: any) => any;
|
|
14
|
+
function help(_url: any): (target: any) => any;
|
|
15
|
+
function type(_type: any): (target: any, _key: any) => any;
|
|
16
|
+
function integer(target: any, _key: any): any;
|
|
17
|
+
function float(target: any, _key: any): any;
|
|
18
|
+
function boolean(target: any, _key: any): any;
|
|
19
|
+
function string(target: any, _key: any): any;
|
|
20
|
+
function serializable(target: any, _key: any): any;
|
|
21
|
+
function editable(target: any, _key: any): any;
|
|
22
|
+
function override(target: any, _key: any): any;
|
|
23
|
+
function visible(target: any, _key: any): any;
|
|
24
|
+
function displayName(_name: any): (target: any, _key: any) => any;
|
|
25
|
+
function tooltip(_text: any): (target: any, _key: any) => any;
|
|
26
|
+
function range(_min: any, _max: any, _step: any): (target: any, _key: any) => any;
|
|
27
|
+
function min(_value: any): (target: any, _key: any) => any;
|
|
28
|
+
function max(_value: any): (target: any, _key: any) => any;
|
|
29
|
+
function slide(_value: any): (target: any, _key: any) => any;
|
|
30
|
+
function group(_value: any): (target: any, _key: any) => any;
|
|
31
|
+
function notify(_fn: any): (target: any, _key: any) => any;
|
|
32
|
+
}
|
|
33
|
+
export const assetManager: AssetManager;
|
|
34
|
+
export const resources: any;
|
|
22
35
|
export function log(...args: any[]): void;
|
|
23
36
|
export function warn(...args: any[]): void;
|
|
24
37
|
export function error(...args: any[]): void;
|
|
25
|
-
export const js: any;
|
|
26
|
-
export const math: any;
|
|
27
38
|
/** 引擎的 EventTarget。Node / director 都靠它做 on/off/emit */
|
|
28
39
|
export class EventTarget {
|
|
29
40
|
_listeners: any;
|
|
@@ -54,7 +65,32 @@ export class Scheduler {
|
|
|
54
65
|
resume(): void;
|
|
55
66
|
isPaused(): boolean;
|
|
56
67
|
}
|
|
57
|
-
|
|
68
|
+
/** 引擎的全局单例 director */
|
|
69
|
+
declare class Director extends EventTarget {
|
|
70
|
+
static EVENT_BEFORE_UPDATE: string;
|
|
71
|
+
static EVENT_AFTER_UPDATE: string;
|
|
72
|
+
_scheduler: Scheduler;
|
|
73
|
+
_deltaTime: number;
|
|
74
|
+
_totalTime: number;
|
|
75
|
+
_totalFrames: number;
|
|
76
|
+
_paused: boolean;
|
|
77
|
+
getScheduler(): Scheduler;
|
|
78
|
+
getDeltaTime(): number;
|
|
79
|
+
getTotalTime(): number;
|
|
80
|
+
getTotalFrames(): number;
|
|
81
|
+
isPaused(): boolean;
|
|
82
|
+
pause(): void;
|
|
83
|
+
resume(): void;
|
|
84
|
+
/**
|
|
85
|
+
* 非 cc API。
|
|
86
|
+
* 引擎里时间由主循环推进,Node 下没有主循环,所以开这个口子让宿主
|
|
87
|
+
* (战斗模拟的驱动方)手动推帧。
|
|
88
|
+
*
|
|
89
|
+
* dt 不乘 timeScale:引擎里 timeScale 影响的是派发给组件的 dt,由主循环负责,
|
|
90
|
+
* 这里保持原样传入,免得和 core 自己的 Time.ts 重复缩放。
|
|
91
|
+
*/
|
|
92
|
+
tick(dt: any): void;
|
|
93
|
+
}
|
|
58
94
|
export class CCInteger {
|
|
59
95
|
constructor(value: any);
|
|
60
96
|
value: any;
|
|
@@ -71,34 +107,6 @@ export class CCString {
|
|
|
71
107
|
constructor(value: any);
|
|
72
108
|
value: any;
|
|
73
109
|
}
|
|
74
|
-
export namespace _decorator {
|
|
75
|
-
function ccclass(nameOrTarget: any): (target: any) => any;
|
|
76
|
-
function property(...args: any[]): (target: any, propertyKey: any) => void;
|
|
77
|
-
function executeInEditMode(target: any): any;
|
|
78
|
-
function requireComponent(_type: any): (target: any) => any;
|
|
79
|
-
function executionOrder(_order: any): (target: any) => any;
|
|
80
|
-
function disallowMultiple(target: any): any;
|
|
81
|
-
function allowMultiple(target: any): any;
|
|
82
|
-
function menu(_path: any): (target: any) => any;
|
|
83
|
-
function help(_url: any): (target: any) => any;
|
|
84
|
-
function type(_type: any): (target: any, _key: any) => any;
|
|
85
|
-
function integer(target: any, _key: any): any;
|
|
86
|
-
function float(target: any, _key: any): any;
|
|
87
|
-
function boolean(target: any, _key: any): any;
|
|
88
|
-
function string(target: any, _key: any): any;
|
|
89
|
-
function serializable(target: any, _key: any): any;
|
|
90
|
-
function editable(target: any, _key: any): any;
|
|
91
|
-
function override(target: any, _key: any): any;
|
|
92
|
-
function visible(target: any, _key: any): any;
|
|
93
|
-
function displayName(_name: any): (target: any, _key: any) => any;
|
|
94
|
-
function tooltip(_text: any): (target: any, _key: any) => any;
|
|
95
|
-
function range(_min: any, _max: any, _step: any): (target: any, _key: any) => any;
|
|
96
|
-
function min(_value: any): (target: any, _key: any) => any;
|
|
97
|
-
function max(_value: any): (target: any, _key: any) => any;
|
|
98
|
-
function slide(_value: any): (target: any, _key: any) => any;
|
|
99
|
-
function group(_value: any): (target: any, _key: any) => any;
|
|
100
|
-
function notify(_fn: any): (target: any, _key: any) => any;
|
|
101
|
-
}
|
|
102
110
|
/** 引擎的 Component 基类 */
|
|
103
111
|
export class Component extends EventTarget {
|
|
104
112
|
node: any;
|
|
@@ -213,51 +221,6 @@ export class Bundle {
|
|
|
213
221
|
_readDir(dir: any, type: any): Promise<any[]>;
|
|
214
222
|
_noSourceError(method: any, path: any): Error;
|
|
215
223
|
}
|
|
216
|
-
export const assetManager: AssetManager;
|
|
217
|
-
/** 引擎内置的 resources bundle。Cfg.ts 从这里读 config/*.json */
|
|
218
|
-
export const resources: any;
|
|
219
|
-
export const Vec2: any;
|
|
220
|
-
export const Vec3: any;
|
|
221
|
-
export const EPSILON: any;
|
|
222
|
-
export const PI: any;
|
|
223
|
-
export const HALF_PI: any;
|
|
224
|
-
export const TWO_PI: any;
|
|
225
|
-
export const RAD: any;
|
|
226
|
-
export const DEG: any;
|
|
227
|
-
export const lerp: any;
|
|
228
|
-
export const clamp: any;
|
|
229
|
-
export const clamp01: any;
|
|
230
|
-
export const toRadian: any;
|
|
231
|
-
export const toDegree: any;
|
|
232
|
-
export const randomRange: any;
|
|
233
|
-
export const randomRangeInt: any;
|
|
234
|
-
export const sign: any;
|
|
235
|
-
/** 引擎的全局单例 director */
|
|
236
|
-
declare class Director extends EventTarget {
|
|
237
|
-
static EVENT_BEFORE_UPDATE: string;
|
|
238
|
-
static EVENT_AFTER_UPDATE: string;
|
|
239
|
-
_scheduler: Scheduler;
|
|
240
|
-
_deltaTime: number;
|
|
241
|
-
_totalTime: number;
|
|
242
|
-
_totalFrames: number;
|
|
243
|
-
_paused: boolean;
|
|
244
|
-
getScheduler(): Scheduler;
|
|
245
|
-
getDeltaTime(): number;
|
|
246
|
-
getTotalTime(): number;
|
|
247
|
-
getTotalFrames(): number;
|
|
248
|
-
isPaused(): boolean;
|
|
249
|
-
pause(): void;
|
|
250
|
-
resume(): void;
|
|
251
|
-
/**
|
|
252
|
-
* 非 cc API。
|
|
253
|
-
* 引擎里时间由主循环推进,Node 下没有主循环,所以开这个口子让宿主
|
|
254
|
-
* (战斗模拟的驱动方)手动推帧。
|
|
255
|
-
*
|
|
256
|
-
* dt 不乘 timeScale:引擎里 timeScale 影响的是派发给组件的 dt,由主循环负责,
|
|
257
|
-
* 这里保持原样传入,免得和 core 自己的 Time.ts 重复缩放。
|
|
258
|
-
*/
|
|
259
|
-
tick(dt: any): void;
|
|
260
|
-
}
|
|
261
224
|
declare class AssetManager {
|
|
262
225
|
_bundles: Map<any, any>;
|
|
263
226
|
getBundle(name: any): any;
|
package/dist/cc/dist/index.js
CHANGED
|
@@ -1,42 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.sign = exports.randomRangeInt = exports.randomRange = exports.toDegree = exports.toRadian = exports.clamp01 = exports.clamp = exports.lerp = exports.DEG = exports.RAD = exports.TWO_PI = exports.HALF_PI = exports.PI = exports.EPSILON = exports.Vec3 = exports.Vec2 = exports.resources = exports.assetManager = exports.Bundle = exports.BufferAsset = exports.TextAsset = exports.JsonAsset = exports.Asset = exports.ProgressBar = exports.Label = exports.Node = exports.Component = exports._decorator = exports.CCString = exports.CCBoolean = exports.CCFloat = exports.CCInteger = exports.director = exports.Scheduler = exports.EventTarget = exports.math = exports.js = void 0;
|
|
37
|
-
exports.log = log;
|
|
38
|
-
exports.warn = warn;
|
|
39
|
-
exports.error = error;
|
|
40
2
|
/**
|
|
41
3
|
* cc —— Cocos Creator 引擎 API 在 Node 侧的替身实现
|
|
42
4
|
*
|
|
@@ -58,6 +20,11 @@ exports.error = error;
|
|
|
58
20
|
* 放在单文件里是有意的:编译产物是 ESM,一旦拆成多个文件,相对 import 就得带
|
|
59
21
|
* `.js` 后缀 Node 才解析得了;这里没有相对 import,省掉这个坑。
|
|
60
22
|
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.sign = exports.randomRangeInt = exports.randomRange = exports.toDegree = exports.toRadian = exports.clamp01 = exports.clamp = exports.lerp = exports.DEG = exports.RAD = exports.TWO_PI = exports.HALF_PI = exports.PI = exports.EPSILON = exports.Vec3 = exports.Vec2 = exports.resources = exports.assetManager = exports.Bundle = exports.BufferAsset = exports.TextAsset = exports.JsonAsset = exports.Asset = exports.ProgressBar = exports.Label = exports.Node = exports.Component = exports._decorator = exports.CCString = exports.CCBoolean = exports.CCFloat = exports.CCInteger = exports.director = exports.Scheduler = exports.EventTarget = exports.math = exports.js = void 0;
|
|
25
|
+
exports.log = log;
|
|
26
|
+
exports.warn = warn;
|
|
27
|
+
exports.error = error;
|
|
61
28
|
/* -------------------------------------------------------------------------- */
|
|
62
29
|
/* 日志:log / warn / error */
|
|
63
30
|
/* -------------------------------------------------------------------------- */
|
|
@@ -81,6 +48,7 @@ function error(...args) {
|
|
|
81
48
|
/* -------------------------------------------------------------------------- */
|
|
82
49
|
const _classByName = new Map();
|
|
83
50
|
const _classById = new Map();
|
|
51
|
+
var js;
|
|
84
52
|
(function (js) {
|
|
85
53
|
/**
|
|
86
54
|
* 建一个纯字典对象。
|
|
@@ -258,7 +226,14 @@ const _classById = new Map();
|
|
|
258
226
|
_classByName.set(getClassName(constructor), constructor);
|
|
259
227
|
}
|
|
260
228
|
js.registerClass = registerClass;
|
|
261
|
-
})(
|
|
229
|
+
})(js || (exports.js = js = {}));
|
|
230
|
+
/* -------------------------------------------------------------------------- */
|
|
231
|
+
/* math 命名空间 */
|
|
232
|
+
/* */
|
|
233
|
+
/* Vec2/Vec3 定义在命名空间里,再桥到顶层导出(见文件末尾)。这样 cc.Vec3 和 */
|
|
234
|
+
/* math.Vec3 拿到的是同一个类对象,instanceof / 装饰器检查都安全。 */
|
|
235
|
+
/* -------------------------------------------------------------------------- */
|
|
236
|
+
var math;
|
|
262
237
|
(function (math) {
|
|
263
238
|
math.EPSILON = 0.000001;
|
|
264
239
|
math.PI = Math.PI;
|
|
@@ -544,7 +519,7 @@ const _classById = new Map();
|
|
|
544
519
|
return value < 0 ? -1 : (value > 0 ? 1 : 0);
|
|
545
520
|
}
|
|
546
521
|
math.sign = sign;
|
|
547
|
-
})(
|
|
522
|
+
})(math || (exports.math = math = {}));
|
|
548
523
|
/** 引擎的 EventTarget。Node / director 都靠它做 on/off/emit */
|
|
549
524
|
class EventTarget {
|
|
550
525
|
_listeners = null;
|
|
@@ -744,8 +719,8 @@ exports._decorator = {
|
|
|
744
719
|
ccclass(nameOrTarget) {
|
|
745
720
|
return (target) => {
|
|
746
721
|
target.__isCCClass__ = true;
|
|
747
|
-
|
|
748
|
-
|
|
722
|
+
js.setClassName(target, typeof nameOrTarget === "string" ? nameOrTarget : target.name);
|
|
723
|
+
js.registerClass(target);
|
|
749
724
|
return target;
|
|
750
725
|
};
|
|
751
726
|
},
|
|
@@ -793,7 +768,7 @@ exports._decorator = {
|
|
|
793
768
|
class Component extends EventTarget {
|
|
794
769
|
node = null;
|
|
795
770
|
enabled = true;
|
|
796
|
-
get name() { return
|
|
771
|
+
get name() { return js.getClassName(this.constructor); }
|
|
797
772
|
get isValid() { return this.node != null && this.node.isValid; }
|
|
798
773
|
getComponent(type) {
|
|
799
774
|
return this.node ? this.node.getComponent(type) : null;
|
|
@@ -821,9 +796,9 @@ class Node extends EventTarget {
|
|
|
821
796
|
_children = [];
|
|
822
797
|
_components = [];
|
|
823
798
|
_destroyed = false;
|
|
824
|
-
position = new
|
|
825
|
-
scale = new
|
|
826
|
-
worldPosition = new
|
|
799
|
+
position = new math.Vec3();
|
|
800
|
+
scale = new math.Vec3(1, 1, 1);
|
|
801
|
+
worldPosition = new math.Vec3();
|
|
827
802
|
constructor(name = "Node") {
|
|
828
803
|
super();
|
|
829
804
|
this._name = name;
|
|
@@ -895,7 +870,7 @@ class Node extends EventTarget {
|
|
|
895
870
|
}
|
|
896
871
|
_matchComponent(component, type) {
|
|
897
872
|
if (typeof type === "string")
|
|
898
|
-
return
|
|
873
|
+
return js.getClassName(component.constructor) === type;
|
|
899
874
|
return component instanceof type;
|
|
900
875
|
}
|
|
901
876
|
destroy() {
|
|
@@ -1030,8 +1005,8 @@ class Bundle {
|
|
|
1030
1005
|
async _readOne(path, type) {
|
|
1031
1006
|
if (!this.localRoot)
|
|
1032
1007
|
throw this._noSourceError("load", path);
|
|
1033
|
-
const fs = await Promise.resolve().then(() =>
|
|
1034
|
-
const pathMod = await Promise.resolve().then(() =>
|
|
1008
|
+
const fs = await Promise.resolve().then(() => require("node:fs/promises"));
|
|
1009
|
+
const pathMod = await Promise.resolve().then(() => require("node:path"));
|
|
1035
1010
|
const base = pathMod.join(this.localRoot, path);
|
|
1036
1011
|
// 用 any 比较:type 是泛型构造签名,和具体类之间 TS 认为没有重叠
|
|
1037
1012
|
const ctor = type;
|
|
@@ -1077,8 +1052,8 @@ class Bundle {
|
|
|
1077
1052
|
async _readDir(dir, type) {
|
|
1078
1053
|
if (!this.localRoot)
|
|
1079
1054
|
throw this._noSourceError("loadDir", dir);
|
|
1080
|
-
const fs = await Promise.resolve().then(() =>
|
|
1081
|
-
const pathMod = await Promise.resolve().then(() =>
|
|
1055
|
+
const fs = await Promise.resolve().then(() => require("node:fs/promises"));
|
|
1056
|
+
const pathMod = await Promise.resolve().then(() => require("node:path"));
|
|
1082
1057
|
const ctor = type;
|
|
1083
1058
|
const exts = ctor === JsonAsset ? [".json"] : (ctor === TextAsset ? [".txt"] : null);
|
|
1084
1059
|
const entries = await fs.readdir(pathMod.join(this.localRoot, dir), { withFileTypes: true });
|
|
@@ -1167,19 +1142,19 @@ exports.resources = exports.assetManager.getBundle("resources");
|
|
|
1167
1142
|
/* - cc.Vec3 === math.Vec3(同一个类对象,instanceof / 装饰器检查都安全) */
|
|
1168
1143
|
/* - Vec3 既能当值用(new / instanceof),也能当类型用(let v: Vec3) */
|
|
1169
1144
|
/* -------------------------------------------------------------------------- */
|
|
1170
|
-
exports.Vec2 =
|
|
1171
|
-
exports.Vec3 =
|
|
1172
|
-
exports.EPSILON =
|
|
1173
|
-
exports.PI =
|
|
1174
|
-
exports.HALF_PI =
|
|
1175
|
-
exports.TWO_PI =
|
|
1176
|
-
exports.RAD =
|
|
1177
|
-
exports.DEG =
|
|
1178
|
-
exports.lerp =
|
|
1179
|
-
exports.clamp =
|
|
1180
|
-
exports.clamp01 =
|
|
1181
|
-
exports.toRadian =
|
|
1182
|
-
exports.toDegree =
|
|
1183
|
-
exports.randomRange =
|
|
1184
|
-
exports.randomRangeInt =
|
|
1185
|
-
exports.sign =
|
|
1145
|
+
exports.Vec2 = math.Vec2;
|
|
1146
|
+
exports.Vec3 = math.Vec3;
|
|
1147
|
+
exports.EPSILON = math.EPSILON;
|
|
1148
|
+
exports.PI = math.PI;
|
|
1149
|
+
exports.HALF_PI = math.HALF_PI;
|
|
1150
|
+
exports.TWO_PI = math.TWO_PI;
|
|
1151
|
+
exports.RAD = math.RAD;
|
|
1152
|
+
exports.DEG = math.DEG;
|
|
1153
|
+
exports.lerp = math.lerp;
|
|
1154
|
+
exports.clamp = math.clamp;
|
|
1155
|
+
exports.clamp01 = math.clamp01;
|
|
1156
|
+
exports.toRadian = math.toRadian;
|
|
1157
|
+
exports.toDegree = math.toDegree;
|
|
1158
|
+
exports.randomRange = math.randomRange;
|
|
1159
|
+
exports.randomRangeInt = math.randomRangeInt;
|
|
1160
|
+
exports.sign = math.sign;
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import "./register-all";
|
|
|
10
10
|
* CAPTAINBATTLE_CONFIG 环境变量 → 包内 resources/config/GameJsonCfg.bin
|
|
11
11
|
*/
|
|
12
12
|
export declare function initCfg(file?: string): void;
|
|
13
|
+
export declare function initJsonCfg(obj: any): void;
|
|
13
14
|
export { EGameModule };
|
|
14
15
|
export interface IGameParam {
|
|
15
16
|
seed: number;
|
|
@@ -27,6 +28,9 @@ export interface IGameParam {
|
|
|
27
28
|
*/
|
|
28
29
|
forcePass?: boolean;
|
|
29
30
|
}
|
|
31
|
+
export interface IGuildGameParam extends IGameParam {
|
|
32
|
+
cheerLayer: number;
|
|
33
|
+
}
|
|
30
34
|
/**
|
|
31
35
|
* 开始战斗验证
|
|
32
36
|
* @param type 游戏模块
|
|
@@ -37,7 +41,7 @@ export interface IGameParam {
|
|
|
37
41
|
export declare function startBattleVerify(type: EGameModule, battlePlayer: PlayerProto.IBattlePlayer, param: IGameParam, callback?: (game: Game) => void): boolean;
|
|
38
42
|
export declare function startStageVerify(battlePlayer: PlayerProto.IBattlePlayer, param: IGameParam): boolean;
|
|
39
43
|
export declare function startRelicDungeonVerify(battlePlayer: PlayerProto.IBattlePlayer, param: IGameParam): boolean;
|
|
40
|
-
export declare function startGuildVerify(battlePlayer: PlayerProto.IBattlePlayer, param:
|
|
44
|
+
export declare function startGuildVerify(battlePlayer: PlayerProto.IBattlePlayer, param: IGuildGameParam): {
|
|
41
45
|
killHpCount: number;
|
|
42
46
|
damage: number;
|
|
43
47
|
};
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.EGameModule = void 0;
|
|
7
7
|
exports.initCfg = initCfg;
|
|
8
|
+
exports.initJsonCfg = initJsonCfg;
|
|
8
9
|
exports.startBattleVerify = startBattleVerify;
|
|
9
10
|
exports.startStageVerify = startStageVerify;
|
|
10
11
|
exports.startRelicDungeonVerify = startRelicDungeonVerify;
|
|
@@ -18,11 +19,13 @@ const node_zlib_1 = __importDefault(require("node:zlib"));
|
|
|
18
19
|
require("./adb-url-resolver");
|
|
19
20
|
const Cfg_1 = require("./core/config/Cfg");
|
|
20
21
|
const Const_1 = require("./core/config/Const");
|
|
22
|
+
const GuildBossConfigCfg_1 = require("./core/config/GuildBossConfigCfg");
|
|
21
23
|
const battle_interface_1 = require("./core/module/battle/battle.interface");
|
|
22
24
|
Object.defineProperty(exports, "EGameModule", { enumerable: true, get: function () { return battle_interface_1.EGameModule; } });
|
|
23
25
|
const Game_1 = __importDefault(require("./core/module/battle/Game"));
|
|
24
26
|
const BattleInputCodec_1 = __importDefault(require("./core/module/battle/util/BattleInputCodec"));
|
|
25
27
|
const BattleUtils_1 = require("./core/module/battle/util/BattleUtils");
|
|
28
|
+
const Property_1 = require("./core/module/property/Property");
|
|
26
29
|
require("./register-all");
|
|
27
30
|
/** 包内配置的相对路径。源码跑时 __dirname 是仓库根,产物跑时是 dist/ */
|
|
28
31
|
const CFG_RELATIVE = node_path_1.default.join("resources", "config", "GameJsonCfg.bin");
|
|
@@ -57,6 +60,10 @@ function initCfg(file) {
|
|
|
57
60
|
Cfg_1.Cfg.initByConfig(cfg);
|
|
58
61
|
cfgReady = true;
|
|
59
62
|
}
|
|
63
|
+
function initJsonCfg(obj) {
|
|
64
|
+
cfgReady = true;
|
|
65
|
+
Cfg_1.Cfg.initByConfig(obj);
|
|
66
|
+
}
|
|
60
67
|
function makeFileName(prefix) {
|
|
61
68
|
const d = new Date();
|
|
62
69
|
const p = (n) => String(n).padStart(2, "0");
|
|
@@ -182,6 +189,17 @@ function startBattleVerify(type, battlePlayer, param, callback) {
|
|
|
182
189
|
enemyData = BattleUtils_1.BattleUtils.getBornInfoByWavesId(relicDungeon.lvMould, 2, param.seed);
|
|
183
190
|
}
|
|
184
191
|
}
|
|
192
|
+
else if (type === battle_interface_1.EGameModule.GuildBoss) {
|
|
193
|
+
const guildParam = param;
|
|
194
|
+
const cheerLayer = guildParam.cheerLayer ?? 0;
|
|
195
|
+
const cheerBuffs = Cfg_1.Cfg.GuildBossConfig.get(GuildBossConfigCfg_1.GuildBossConfigDefine.boss_support_buff)?.value2 || [];
|
|
196
|
+
for (let i = 0; i < myFightDatas.length; i++) {
|
|
197
|
+
const myRoleData = myFightDatas[i];
|
|
198
|
+
for (const element of cheerBuffs) {
|
|
199
|
+
Property_1.PropertyHelper.addPropertyByKeyValue(myRoleData.property, element[0], element[1] * cheerLayer);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
185
203
|
let isWin = false;
|
|
186
204
|
let inputs = [];
|
|
187
205
|
if (param.inputs && param.inputs.length) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* cc —— Cocos Creator 引擎 API 在 Node 侧的替身实现
|
|
3
4
|
*
|
|
@@ -19,6 +20,11 @@
|
|
|
19
20
|
* 放在单文件里是有意的:编译产物是 ESM,一旦拆成多个文件,相对 import 就得带
|
|
20
21
|
* `.js` 后缀 Node 才解析得了;这里没有相对 import,省掉这个坑。
|
|
21
22
|
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.sign = exports.randomRangeInt = exports.randomRange = exports.toDegree = exports.toRadian = exports.clamp01 = exports.clamp = exports.lerp = exports.DEG = exports.RAD = exports.TWO_PI = exports.HALF_PI = exports.PI = exports.EPSILON = exports.Vec3 = exports.Vec2 = exports.resources = exports.assetManager = exports.Bundle = exports.BufferAsset = exports.TextAsset = exports.JsonAsset = exports.Asset = exports.ProgressBar = exports.Label = exports.Node = exports.Component = exports._decorator = exports.CCString = exports.CCBoolean = exports.CCFloat = exports.CCInteger = exports.director = exports.Scheduler = exports.EventTarget = exports.math = exports.js = void 0;
|
|
25
|
+
exports.log = log;
|
|
26
|
+
exports.warn = warn;
|
|
27
|
+
exports.error = error;
|
|
22
28
|
/* -------------------------------------------------------------------------- */
|
|
23
29
|
/* 日志:log / warn / error */
|
|
24
30
|
/* -------------------------------------------------------------------------- */
|
|
@@ -28,13 +34,13 @@
|
|
|
28
34
|
* Node 的 console 是同一套规则,所以这里直接转发,不做二次格式化——
|
|
29
35
|
* 自己实现反而会在 "%s" 和普通 "%" 混用时和引擎对不上。
|
|
30
36
|
*/
|
|
31
|
-
|
|
37
|
+
function log(...args) {
|
|
32
38
|
console.log(...args);
|
|
33
39
|
}
|
|
34
|
-
|
|
40
|
+
function warn(...args) {
|
|
35
41
|
console.warn(...args);
|
|
36
42
|
}
|
|
37
|
-
|
|
43
|
+
function error(...args) {
|
|
38
44
|
console.error(...args);
|
|
39
45
|
}
|
|
40
46
|
/* -------------------------------------------------------------------------- */
|
|
@@ -42,7 +48,7 @@ export function error(...args) {
|
|
|
42
48
|
/* -------------------------------------------------------------------------- */
|
|
43
49
|
const _classByName = new Map();
|
|
44
50
|
const _classById = new Map();
|
|
45
|
-
|
|
51
|
+
var js;
|
|
46
52
|
(function (js) {
|
|
47
53
|
/**
|
|
48
54
|
* 建一个纯字典对象。
|
|
@@ -220,14 +226,14 @@ export var js;
|
|
|
220
226
|
_classByName.set(getClassName(constructor), constructor);
|
|
221
227
|
}
|
|
222
228
|
js.registerClass = registerClass;
|
|
223
|
-
})(js || (js = {}));
|
|
229
|
+
})(js || (exports.js = js = {}));
|
|
224
230
|
/* -------------------------------------------------------------------------- */
|
|
225
231
|
/* math 命名空间 */
|
|
226
232
|
/* */
|
|
227
233
|
/* Vec2/Vec3 定义在命名空间里,再桥到顶层导出(见文件末尾)。这样 cc.Vec3 和 */
|
|
228
234
|
/* math.Vec3 拿到的是同一个类对象,instanceof / 装饰器检查都安全。 */
|
|
229
235
|
/* -------------------------------------------------------------------------- */
|
|
230
|
-
|
|
236
|
+
var math;
|
|
231
237
|
(function (math) {
|
|
232
238
|
math.EPSILON = 0.000001;
|
|
233
239
|
math.PI = Math.PI;
|
|
@@ -513,9 +519,9 @@ export var math;
|
|
|
513
519
|
return value < 0 ? -1 : (value > 0 ? 1 : 0);
|
|
514
520
|
}
|
|
515
521
|
math.sign = sign;
|
|
516
|
-
})(math || (math = {}));
|
|
522
|
+
})(math || (exports.math = math = {}));
|
|
517
523
|
/** 引擎的 EventTarget。Node / director 都靠它做 on/off/emit */
|
|
518
|
-
|
|
524
|
+
class EventTarget {
|
|
519
525
|
_listeners = null;
|
|
520
526
|
on(type, callback, target) {
|
|
521
527
|
this._addListener(type, callback, target, false);
|
|
@@ -596,6 +602,7 @@ export class EventTarget {
|
|
|
596
602
|
this._listeners.delete(type);
|
|
597
603
|
}
|
|
598
604
|
}
|
|
605
|
+
exports.EventTarget = EventTarget;
|
|
599
606
|
/* -------------------------------------------------------------------------- */
|
|
600
607
|
/* director + Scheduler */
|
|
601
608
|
/* -------------------------------------------------------------------------- */
|
|
@@ -606,7 +613,7 @@ export class EventTarget {
|
|
|
606
613
|
*
|
|
607
614
|
* 定时器那部分不走这里:core 里由 Time.ts 自己的 Watcher 实现。
|
|
608
615
|
*/
|
|
609
|
-
|
|
616
|
+
class Scheduler {
|
|
610
617
|
_timeScale = 1;
|
|
611
618
|
_paused = false;
|
|
612
619
|
setTimeScale(scale) {
|
|
@@ -619,6 +626,7 @@ export class Scheduler {
|
|
|
619
626
|
resume() { this._paused = false; }
|
|
620
627
|
isPaused() { return this._paused; }
|
|
621
628
|
}
|
|
629
|
+
exports.Scheduler = Scheduler;
|
|
622
630
|
/** 引擎的全局单例 director */
|
|
623
631
|
class Director extends EventTarget {
|
|
624
632
|
static EVENT_BEFORE_UPDATE = "director_before_update";
|
|
@@ -655,34 +663,38 @@ class Director extends EventTarget {
|
|
|
655
663
|
this.emit(Director.EVENT_AFTER_UPDATE, dt);
|
|
656
664
|
}
|
|
657
665
|
}
|
|
658
|
-
|
|
666
|
+
exports.director = new Director();
|
|
659
667
|
/* -------------------------------------------------------------------------- */
|
|
660
668
|
/* _decorator + 属性类型标记 */
|
|
661
669
|
/* -------------------------------------------------------------------------- */
|
|
662
|
-
|
|
670
|
+
class CCInteger {
|
|
663
671
|
value;
|
|
664
672
|
constructor(value) {
|
|
665
673
|
this.value = value;
|
|
666
674
|
}
|
|
667
675
|
}
|
|
668
|
-
|
|
676
|
+
exports.CCInteger = CCInteger;
|
|
677
|
+
class CCFloat {
|
|
669
678
|
value;
|
|
670
679
|
constructor(value) {
|
|
671
680
|
this.value = value;
|
|
672
681
|
}
|
|
673
682
|
}
|
|
674
|
-
|
|
683
|
+
exports.CCFloat = CCFloat;
|
|
684
|
+
class CCBoolean {
|
|
675
685
|
value;
|
|
676
686
|
constructor(value) {
|
|
677
687
|
this.value = value;
|
|
678
688
|
}
|
|
679
689
|
}
|
|
680
|
-
|
|
690
|
+
exports.CCBoolean = CCBoolean;
|
|
691
|
+
class CCString {
|
|
681
692
|
value;
|
|
682
693
|
constructor(value) {
|
|
683
694
|
this.value = value;
|
|
684
695
|
}
|
|
685
696
|
}
|
|
697
|
+
exports.CCString = CCString;
|
|
686
698
|
/** 把属性装饰器的各种写法(@property / @property(Vec3) / @property({...}))归一成 options */
|
|
687
699
|
function normalizePropertyArgs(args) {
|
|
688
700
|
const options = {};
|
|
@@ -703,7 +715,7 @@ function normalizePropertyArgs(args) {
|
|
|
703
715
|
* Node 下没有编辑器序列化,装饰器退化成"打标记 + 记类名":类名要记,
|
|
704
716
|
* 因为 js.getClassName / getClassByName 和日志都依赖它。
|
|
705
717
|
*/
|
|
706
|
-
|
|
718
|
+
exports._decorator = {
|
|
707
719
|
ccclass(nameOrTarget) {
|
|
708
720
|
return (target) => {
|
|
709
721
|
target.__isCCClass__ = true;
|
|
@@ -753,7 +765,7 @@ export const _decorator = {
|
|
|
753
765
|
/* Component / Node */
|
|
754
766
|
/* -------------------------------------------------------------------------- */
|
|
755
767
|
/** 引擎的 Component 基类 */
|
|
756
|
-
|
|
768
|
+
class Component extends EventTarget {
|
|
757
769
|
node = null;
|
|
758
770
|
enabled = true;
|
|
759
771
|
get name() { return js.getClassName(this.constructor); }
|
|
@@ -767,6 +779,7 @@ export class Component extends EventTarget {
|
|
|
767
779
|
this.enabled = false;
|
|
768
780
|
}
|
|
769
781
|
}
|
|
782
|
+
exports.Component = Component;
|
|
770
783
|
/**
|
|
771
784
|
* 引擎的 Node。
|
|
772
785
|
*
|
|
@@ -776,7 +789,7 @@ export class Component extends EventTarget {
|
|
|
776
789
|
* 有意的取舍:不跑 onLoad/onEnable/update 这些生命周期——Node 下没有主循环去驱动它们,
|
|
777
790
|
* 与其假装调了,不如让它们根本不触发。
|
|
778
791
|
*/
|
|
779
|
-
|
|
792
|
+
class Node extends EventTarget {
|
|
780
793
|
_name;
|
|
781
794
|
_active = true;
|
|
782
795
|
_parent = null;
|
|
@@ -870,27 +883,30 @@ export class Node extends EventTarget {
|
|
|
870
883
|
}
|
|
871
884
|
toString() { return `<Node ${this._name}>`; }
|
|
872
885
|
}
|
|
886
|
+
exports.Node = Node;
|
|
873
887
|
/* -------------------------------------------------------------------------- */
|
|
874
888
|
/* 渲染组件(占位) */
|
|
875
889
|
/* */
|
|
876
890
|
/* 只是让 Cfg.ts 里 `test?: Label` / `pro?: ProgressBar` 这类签名有类型,并且真 */
|
|
877
891
|
/* new 出来不会崩。它们不接任何渲染后端,属性怎么写都不会画到屏幕上。 */
|
|
878
892
|
/* -------------------------------------------------------------------------- */
|
|
879
|
-
|
|
893
|
+
class Label extends Component {
|
|
880
894
|
string = "";
|
|
881
895
|
fontSize = 40;
|
|
882
896
|
lineHeight = 40;
|
|
883
897
|
enableWrapText = true;
|
|
884
898
|
}
|
|
885
|
-
|
|
899
|
+
exports.Label = Label;
|
|
900
|
+
class ProgressBar extends Component {
|
|
886
901
|
/** 0 ~ 1 */
|
|
887
902
|
progress = 0;
|
|
888
903
|
totalLength = 100;
|
|
889
904
|
}
|
|
905
|
+
exports.ProgressBar = ProgressBar;
|
|
890
906
|
/* -------------------------------------------------------------------------- */
|
|
891
907
|
/* 资源 */
|
|
892
908
|
/* -------------------------------------------------------------------------- */
|
|
893
|
-
|
|
909
|
+
class Asset {
|
|
894
910
|
name = "";
|
|
895
911
|
_uuid = "";
|
|
896
912
|
nativeUrl = "";
|
|
@@ -912,20 +928,24 @@ export class Asset {
|
|
|
912
928
|
return true;
|
|
913
929
|
}
|
|
914
930
|
}
|
|
915
|
-
|
|
931
|
+
exports.Asset = Asset;
|
|
932
|
+
class JsonAsset extends Asset {
|
|
916
933
|
json = null;
|
|
917
934
|
}
|
|
918
|
-
|
|
935
|
+
exports.JsonAsset = JsonAsset;
|
|
936
|
+
class TextAsset extends Asset {
|
|
919
937
|
text = "";
|
|
920
938
|
}
|
|
939
|
+
exports.TextAsset = TextAsset;
|
|
921
940
|
/** 二进制资源。引擎里 _file 还可能是 Blob,Node 侧只会是 ArrayBuffer。 */
|
|
922
|
-
|
|
941
|
+
class BufferAsset extends Asset {
|
|
923
942
|
_file = null;
|
|
924
943
|
/** 引擎语义:返回二进制数据 */
|
|
925
944
|
buffer() {
|
|
926
945
|
return this._file;
|
|
927
946
|
}
|
|
928
947
|
}
|
|
948
|
+
exports.BufferAsset = BufferAsset;
|
|
929
949
|
/**
|
|
930
950
|
* 资源包。
|
|
931
951
|
*
|
|
@@ -939,7 +959,7 @@ export class BufferAsset extends Asset {
|
|
|
939
959
|
* BufferAsset → <root>/<path>,按二进制读(Cfg 的 gzip 配置用)
|
|
940
960
|
* asset.name → 文件名去掉扩展名,和引擎里 element.name 的取值口径对齐
|
|
941
961
|
*/
|
|
942
|
-
|
|
962
|
+
class Bundle {
|
|
943
963
|
name;
|
|
944
964
|
/** 非 cc API:磁盘目录。设了它 load/loadDir 才真读得到东西 */
|
|
945
965
|
localRoot = null;
|
|
@@ -985,8 +1005,8 @@ export class Bundle {
|
|
|
985
1005
|
async _readOne(path, type) {
|
|
986
1006
|
if (!this.localRoot)
|
|
987
1007
|
throw this._noSourceError("load", path);
|
|
988
|
-
const fs = await
|
|
989
|
-
const pathMod = await
|
|
1008
|
+
const fs = await Promise.resolve().then(() => require("node:fs/promises"));
|
|
1009
|
+
const pathMod = await Promise.resolve().then(() => require("node:path"));
|
|
990
1010
|
const base = pathMod.join(this.localRoot, path);
|
|
991
1011
|
// 用 any 比较:type 是泛型构造签名,和具体类之间 TS 认为没有重叠
|
|
992
1012
|
const ctor = type;
|
|
@@ -1032,8 +1052,8 @@ export class Bundle {
|
|
|
1032
1052
|
async _readDir(dir, type) {
|
|
1033
1053
|
if (!this.localRoot)
|
|
1034
1054
|
throw this._noSourceError("loadDir", dir);
|
|
1035
|
-
const fs = await
|
|
1036
|
-
const pathMod = await
|
|
1055
|
+
const fs = await Promise.resolve().then(() => require("node:fs/promises"));
|
|
1056
|
+
const pathMod = await Promise.resolve().then(() => require("node:path"));
|
|
1037
1057
|
const ctor = type;
|
|
1038
1058
|
const exts = ctor === JsonAsset ? [".json"] : (ctor === TextAsset ? [".txt"] : null);
|
|
1039
1059
|
const entries = await fs.readdir(pathMod.join(this.localRoot, dir), { withFileTypes: true });
|
|
@@ -1054,6 +1074,7 @@ export class Bundle {
|
|
|
1054
1074
|
+ `Node 下没有 asset-db,需要先把 bundle.localRoot 指向磁盘目录`);
|
|
1055
1075
|
}
|
|
1056
1076
|
}
|
|
1077
|
+
exports.Bundle = Bundle;
|
|
1057
1078
|
class AssetManager {
|
|
1058
1079
|
_bundles = new Map();
|
|
1059
1080
|
constructor() {
|
|
@@ -1110,9 +1131,9 @@ class AssetManager {
|
|
|
1110
1131
|
}, (e) => finish(e, null));
|
|
1111
1132
|
}
|
|
1112
1133
|
}
|
|
1113
|
-
|
|
1134
|
+
exports.assetManager = new AssetManager();
|
|
1114
1135
|
/** 引擎内置的 resources bundle。Cfg.ts 从这里读 config/*.json */
|
|
1115
|
-
|
|
1136
|
+
exports.resources = exports.assetManager.getBundle("resources");
|
|
1116
1137
|
/* -------------------------------------------------------------------------- */
|
|
1117
1138
|
/* 顶层桥接 */
|
|
1118
1139
|
/* */
|
|
@@ -1121,19 +1142,19 @@ export const resources = assetManager.getBundle("resources");
|
|
|
1121
1142
|
/* - cc.Vec3 === math.Vec3(同一个类对象,instanceof / 装饰器检查都安全) */
|
|
1122
1143
|
/* - Vec3 既能当值用(new / instanceof),也能当类型用(let v: Vec3) */
|
|
1123
1144
|
/* -------------------------------------------------------------------------- */
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1145
|
+
exports.Vec2 = math.Vec2;
|
|
1146
|
+
exports.Vec3 = math.Vec3;
|
|
1147
|
+
exports.EPSILON = math.EPSILON;
|
|
1148
|
+
exports.PI = math.PI;
|
|
1149
|
+
exports.HALF_PI = math.HALF_PI;
|
|
1150
|
+
exports.TWO_PI = math.TWO_PI;
|
|
1151
|
+
exports.RAD = math.RAD;
|
|
1152
|
+
exports.DEG = math.DEG;
|
|
1153
|
+
exports.lerp = math.lerp;
|
|
1154
|
+
exports.clamp = math.clamp;
|
|
1155
|
+
exports.clamp01 = math.clamp01;
|
|
1156
|
+
exports.toRadian = math.toRadian;
|
|
1157
|
+
exports.toDegree = math.toDegree;
|
|
1158
|
+
exports.randomRange = math.randomRange;
|
|
1159
|
+
exports.randomRangeInt = math.randomRangeInt;
|
|
1160
|
+
exports.sign = math.sign;
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
"version": "3.8.0-node",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Cocos Creator 引擎 API 在 Node 侧的替身实现(只覆盖本项目用到的子集)",
|
|
6
|
-
"type": "
|
|
6
|
+
"type": "commonjs",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
|
+
"require": "./dist/index.js",
|
|
12
13
|
"import": "./dist/index.js",
|
|
13
14
|
"default": "./dist/index.js"
|
|
14
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "captainbattle",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "水上大乱斗后端战斗模拟",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -20,10 +20,6 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"gen": "node scripts/gen-registry.mjs",
|
|
22
22
|
"gen:check": "node scripts/gen-registry.mjs --check",
|
|
23
|
-
"prestart": "npm run gen",
|
|
24
|
-
"start": "tsx cli.ts",
|
|
25
|
-
"start:dist": "node dist/cli.js",
|
|
26
|
-
"dev": "tsx watch cli.ts",
|
|
27
23
|
"prebuild": "npm run gen",
|
|
28
24
|
"build": "npm run build:cc && tsc -p tsconfig.json && node scripts/copy-proto-dts.mjs",
|
|
29
25
|
"build:cc": "tsc -p cc/tsconfig.json",
|
package/dist/cli.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/cli.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* 本地冒烟入口:加载配置后退出,验证包能正常初始化。
|
|
5
|
-
* 库的正式用法见 index.ts 的导出(initCfg / startBattleVerify 等)。
|
|
6
|
-
*/
|
|
7
|
-
const index_1 = require("./index");
|
|
8
|
-
(0, index_1.initCfg)();
|
|
9
|
-
console.log("[captainbattle] 配置加载完成");
|