@rpgjs/action-battle 5.0.0-beta.1 → 5.0.0-beta.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/LICENSE +19 -0
- package/README.md +94 -0
- package/dist/ai.server.d.ts +31 -27
- package/dist/animations.d.ts +16 -0
- package/dist/client/index.js +15 -31
- package/dist/client/index10.js +376 -0
- package/dist/client/index2.js +63 -46
- package/dist/client/index3.js +50 -1287
- package/dist/client/index4.js +301 -331
- package/dist/client/index5.js +36 -291
- package/dist/client/index6.js +99 -95
- package/dist/client/index7.js +33 -60
- package/dist/client/index8.js +39 -53
- package/dist/client/index9.js +1167 -27
- package/dist/client.d.ts +3 -2
- package/dist/config.d.ts +2 -0
- package/dist/index.d.ts +5 -5
- package/dist/server/index.js +14 -31
- package/dist/server/index2.js +39 -332
- package/dist/server/index3.js +62 -1287
- package/dist/server/index4.js +1167 -53
- package/dist/server/index5.js +35 -28
- package/dist/server/index6.js +376 -0
- package/dist/server.d.ts +3 -3
- package/dist/ui/state.d.ts +3 -3
- package/package.json +5 -5
- package/src/ai.server.ts +79 -28
- package/src/animations.ts +110 -0
- package/src/config.ts +16 -0
- package/src/index.ts +7 -1
- package/src/server.ts +16 -3
- package/src/types.ts +47 -0
package/dist/client/index2.js
CHANGED
|
@@ -1,47 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const engine = inject(RpgClientEngine);
|
|
26
|
-
return [engine.scene.currentPlayer];
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
] : [],
|
|
30
|
-
sprite: {
|
|
31
|
-
componentsInFront: targetingEnabled ? [component] : []
|
|
32
|
-
},
|
|
33
|
-
sceneMap: {
|
|
34
|
-
onAfterLoading() {
|
|
35
|
-
if (actionBarEnabled && normalized.ui?.actionBar?.autoOpen) {
|
|
36
|
-
const gui = inject(RpgGui);
|
|
37
|
-
gui.display("action-battle-action-bar");
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
const client = createActionBattleClient();
|
|
44
|
-
export {
|
|
45
|
-
createActionBattleClient,
|
|
46
|
-
client as default
|
|
1
|
+
//#region src/config.ts
|
|
2
|
+
var DEFAULT_ACTION_BATTLE_OPTIONS = {
|
|
3
|
+
ui: {
|
|
4
|
+
actionBar: {
|
|
5
|
+
enabled: false,
|
|
6
|
+
autoOpen: false,
|
|
7
|
+
mode: "both"
|
|
8
|
+
},
|
|
9
|
+
targeting: {
|
|
10
|
+
enabled: true,
|
|
11
|
+
showGrid: true,
|
|
12
|
+
colors: {
|
|
13
|
+
area: 3120887,
|
|
14
|
+
edge: 1796760,
|
|
15
|
+
cursor: 16765286
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
skills: { defaultAoeMask: ["#"] },
|
|
20
|
+
targeting: {
|
|
21
|
+
affects: "events",
|
|
22
|
+
allowEmptyTarget: true
|
|
23
|
+
},
|
|
24
|
+
animations: {}
|
|
47
25
|
};
|
|
26
|
+
var currentActionBattleOptions = DEFAULT_ACTION_BATTLE_OPTIONS;
|
|
27
|
+
function normalizeActionBattleOptions(options = {}) {
|
|
28
|
+
return {
|
|
29
|
+
ui: {
|
|
30
|
+
actionBar: {
|
|
31
|
+
...DEFAULT_ACTION_BATTLE_OPTIONS.ui?.actionBar,
|
|
32
|
+
...options.ui?.actionBar
|
|
33
|
+
},
|
|
34
|
+
targeting: {
|
|
35
|
+
...DEFAULT_ACTION_BATTLE_OPTIONS.ui?.targeting,
|
|
36
|
+
...options.ui?.targeting,
|
|
37
|
+
colors: {
|
|
38
|
+
...DEFAULT_ACTION_BATTLE_OPTIONS.ui?.targeting?.colors,
|
|
39
|
+
...options.ui?.targeting?.colors
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
skills: {
|
|
44
|
+
...DEFAULT_ACTION_BATTLE_OPTIONS.skills,
|
|
45
|
+
...options.skills
|
|
46
|
+
},
|
|
47
|
+
targeting: {
|
|
48
|
+
...DEFAULT_ACTION_BATTLE_OPTIONS.targeting,
|
|
49
|
+
...options.targeting
|
|
50
|
+
},
|
|
51
|
+
animations: {
|
|
52
|
+
...DEFAULT_ACTION_BATTLE_OPTIONS.animations,
|
|
53
|
+
...options.animations
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function setActionBattleOptions(options) {
|
|
58
|
+
currentActionBattleOptions = options;
|
|
59
|
+
}
|
|
60
|
+
function getActionBattleOptions() {
|
|
61
|
+
return currentActionBattleOptions;
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
export { DEFAULT_ACTION_BATTLE_OPTIONS, getActionBattleOptions, normalizeActionBattleOptions, setActionBattleOptions };
|