@rpgjs/client 5.0.0-alpha.9 → 5.0.0-beta.1
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/Game/AnimationManager.d.ts +8 -0
- package/dist/Game/AnimationManager.js +26 -0
- package/dist/Game/AnimationManager.js.map +1 -0
- package/dist/Game/Event.d.ts +1 -1
- package/dist/Game/Event.js +12 -0
- package/dist/Game/Event.js.map +1 -0
- package/dist/Game/Map.d.ts +23 -2
- package/dist/Game/Map.js +80 -0
- package/dist/Game/Map.js.map +1 -0
- package/dist/Game/Object.d.ts +157 -0
- package/dist/Game/Object.js +211 -0
- package/dist/Game/Object.js.map +1 -0
- package/dist/Game/Player.d.ts +1 -1
- package/dist/Game/Player.js +12 -0
- package/dist/Game/Player.js.map +1 -0
- package/dist/Gui/Gui.d.ts +177 -5
- package/dist/Gui/Gui.js +445 -0
- package/dist/Gui/Gui.js.map +1 -0
- package/dist/Gui/NotificationManager.d.ts +23 -0
- package/dist/Gui/NotificationManager.js +49 -0
- package/dist/Gui/NotificationManager.js.map +1 -0
- package/dist/Resource.d.ts +97 -0
- package/dist/Resource.js +133 -0
- package/dist/Resource.js.map +1 -0
- package/dist/RpgClient.d.ts +238 -11
- package/dist/RpgClientEngine.d.ts +615 -14
- package/dist/RpgClientEngine.js +1334 -0
- package/dist/RpgClientEngine.js.map +1 -0
- package/dist/Sound.d.ts +199 -0
- package/dist/Sound.js +167 -0
- package/dist/Sound.js.map +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js +9 -0
- package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js +6 -0
- package/dist/components/animations/animation.ce.js +24 -0
- package/dist/components/animations/animation.ce.js.map +1 -0
- package/dist/components/animations/hit.ce.js +70 -0
- package/dist/components/animations/hit.ce.js.map +1 -0
- package/dist/components/animations/index.d.ts +4 -0
- package/dist/components/animations/index.js +11 -0
- package/dist/components/animations/index.js.map +1 -0
- package/dist/components/character.ce.js +392 -0
- package/dist/components/character.ce.js.map +1 -0
- package/dist/components/dynamics/parse-value.d.ts +1 -0
- package/dist/components/dynamics/parse-value.js +44 -0
- package/dist/components/dynamics/parse-value.js.map +1 -0
- package/dist/components/dynamics/text.ce.js +73 -0
- package/dist/components/dynamics/text.ce.js.map +1 -0
- package/dist/components/gui/box.ce.js +28 -0
- package/dist/components/gui/box.ce.js.map +1 -0
- package/dist/components/gui/dialogbox/index.ce.js +205 -0
- package/dist/components/gui/dialogbox/index.ce.js.map +1 -0
- package/dist/components/gui/gameover.ce.js +193 -0
- package/dist/components/gui/gameover.ce.js.map +1 -0
- package/dist/components/gui/hud/hud.ce.js +92 -0
- package/dist/components/gui/hud/hud.ce.js.map +1 -0
- package/dist/components/gui/index.d.ts +15 -3
- package/dist/components/gui/index.js +14 -0
- package/dist/components/gui/menu/equip-menu.ce.js +481 -0
- package/dist/components/gui/menu/equip-menu.ce.js.map +1 -0
- package/dist/components/gui/menu/exit-menu.ce.js +54 -0
- package/dist/components/gui/menu/exit-menu.ce.js.map +1 -0
- package/dist/components/gui/menu/items-menu.ce.js +344 -0
- package/dist/components/gui/menu/items-menu.ce.js.map +1 -0
- package/dist/components/gui/menu/main-menu.ce.js +417 -0
- package/dist/components/gui/menu/main-menu.ce.js.map +1 -0
- package/dist/components/gui/menu/options-menu.ce.js +48 -0
- package/dist/components/gui/menu/options-menu.ce.js.map +1 -0
- package/dist/components/gui/menu/skills-menu.ce.js +107 -0
- package/dist/components/gui/menu/skills-menu.ce.js.map +1 -0
- package/dist/components/gui/mobile/index.d.ts +8 -0
- package/dist/components/gui/mobile/index.js +21 -0
- package/dist/components/gui/mobile/index.js.map +1 -0
- package/dist/components/gui/mobile/mobile.ce.js +78 -0
- package/dist/components/gui/mobile/mobile.ce.js.map +1 -0
- package/dist/components/gui/notification/notification.ce.js +64 -0
- package/dist/components/gui/notification/notification.ce.js.map +1 -0
- package/dist/components/gui/save-load.ce.js +389 -0
- package/dist/components/gui/save-load.ce.js.map +1 -0
- package/dist/components/gui/shop/shop.ce.js +652 -0
- package/dist/components/gui/shop/shop.ce.js.map +1 -0
- package/dist/components/gui/title-screen.ce.js +190 -0
- package/dist/components/gui/title-screen.ce.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +4 -0
- package/dist/components/prebuilt/hp-bar.ce.js +116 -0
- package/dist/components/prebuilt/hp-bar.ce.js.map +1 -0
- package/dist/components/prebuilt/index.d.ts +19 -0
- package/dist/components/prebuilt/index.js +2 -0
- package/dist/components/prebuilt/light-halo.ce.js +94 -0
- package/dist/components/prebuilt/light-halo.ce.js.map +1 -0
- package/dist/components/scenes/canvas.ce.js +60 -0
- package/dist/components/scenes/canvas.ce.js.map +1 -0
- package/dist/components/scenes/draw-map.ce.js +89 -0
- package/dist/components/scenes/draw-map.ce.js.map +1 -0
- package/dist/components/scenes/event-layer.ce.js +28 -0
- package/dist/components/scenes/event-layer.ce.js.map +1 -0
- package/dist/core/inject.js +18 -0
- package/dist/core/inject.js.map +1 -0
- package/dist/core/setup.js +16 -0
- package/dist/core/setup.js.map +1 -0
- package/dist/index.d.ts +15 -1
- package/dist/index.js +44 -14
- package/dist/module.d.ts +43 -4
- package/dist/module.js +176 -0
- package/dist/module.js.map +1 -0
- package/dist/node_modules/.pnpm/@signe_di@2.9.0/node_modules/@signe/di/dist/index.js +277 -0
- package/dist/node_modules/.pnpm/@signe_di@2.9.0/node_modules/@signe/di/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@signe_reactive@2.8.3/node_modules/@signe/reactive/dist/index.js +457 -0
- package/dist/node_modules/.pnpm/@signe_reactive@2.8.3/node_modules/@signe/reactive/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@signe_reactive@2.9.0/node_modules/@signe/reactive/dist/index.js +463 -0
- package/dist/node_modules/.pnpm/@signe_reactive@2.9.0/node_modules/@signe/reactive/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@signe_room@2.9.0/node_modules/@signe/room/dist/index.js +2191 -0
- package/dist/node_modules/.pnpm/@signe_room@2.9.0/node_modules/@signe/room/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/chunk-7QVYU63E.js +10 -0
- package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/chunk-7QVYU63E.js.map +1 -0
- package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/client/index.js +91 -0
- package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/client/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/index.js +325 -0
- package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/dset@3.1.4/node_modules/dset/dist/index.js +14 -0
- package/dist/node_modules/.pnpm/dset@3.1.4/node_modules/dset/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-HAC622V3.js +115 -0
- package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-HAC622V3.js.map +1 -0
- package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-S74YV6PU.js +401 -0
- package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-S74YV6PU.js.map +1 -0
- package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/index.js +2 -0
- package/dist/node_modules/.pnpm/zod@3.24.2/node_modules/zod/lib/index.js +3756 -0
- package/dist/node_modules/.pnpm/zod@3.24.2/node_modules/zod/lib/index.js.map +1 -0
- package/dist/presets/animation.d.ts +31 -0
- package/dist/presets/animation.js +39 -0
- package/dist/presets/animation.js.map +1 -0
- package/dist/presets/faceset.d.ts +30 -0
- package/dist/presets/faceset.js +51 -0
- package/dist/presets/faceset.js.map +1 -0
- package/dist/presets/icon.d.ts +20 -0
- package/dist/presets/icon.js +15 -0
- package/dist/presets/icon.js.map +1 -0
- package/dist/presets/index.d.ts +123 -0
- package/dist/presets/index.js +17 -0
- package/dist/presets/index.js.map +1 -0
- package/dist/presets/lpc.d.ts +89 -0
- package/dist/presets/lpc.js +98 -0
- package/dist/presets/lpc.js.map +1 -0
- package/dist/presets/rmspritesheet.js +42 -0
- package/dist/presets/rmspritesheet.js.map +1 -0
- package/dist/services/AbstractSocket.d.ts +9 -5
- package/dist/services/AbstractSocket.js +11 -0
- package/dist/services/AbstractSocket.js.map +1 -0
- package/dist/services/keyboardControls.d.ts +15 -0
- package/dist/services/keyboardControls.js +23 -0
- package/dist/services/keyboardControls.js.map +1 -0
- package/dist/services/loadMap.js +123 -0
- package/dist/services/loadMap.js.map +1 -0
- package/dist/services/mmorpg.d.ts +21 -9
- package/dist/services/mmorpg.js +131 -0
- package/dist/services/mmorpg.js.map +1 -0
- package/dist/services/save.d.ts +19 -0
- package/dist/services/save.js +77 -0
- package/dist/services/save.js.map +1 -0
- package/dist/services/standalone.d.ts +67 -7
- package/dist/services/standalone.js +168 -0
- package/dist/services/standalone.js.map +1 -0
- package/dist/utils/getEntityProp.d.ts +39 -0
- package/dist/utils/getEntityProp.js +52 -0
- package/dist/utils/getEntityProp.js.map +1 -0
- package/package.json +13 -9
- package/src/Game/{EffectManager.ts → AnimationManager.ts} +3 -2
- package/src/Game/Event.ts +1 -1
- package/src/Game/Map.ts +95 -3
- package/src/Game/Object.ts +330 -14
- package/src/Game/Player.ts +1 -1
- package/src/Gui/Gui.ts +506 -18
- package/src/Gui/NotificationManager.ts +69 -0
- package/src/Resource.ts +150 -0
- package/src/RpgClient.ts +246 -12
- package/src/RpgClientEngine.ts +1641 -62
- package/src/Sound.ts +253 -0
- package/src/components/{effects → animations}/animation.ce +3 -6
- package/src/components/{effects → animations}/index.ts +1 -1
- package/src/components/character.ce +387 -52
- package/src/components/dynamics/parse-value.ts +80 -0
- package/src/components/dynamics/text.ce +183 -0
- package/src/components/gui/box.ce +17 -0
- package/src/components/gui/dialogbox/index.ce +204 -187
- package/src/components/gui/gameover.ce +158 -0
- package/src/components/gui/hud/hud.ce +61 -0
- package/src/components/gui/index.ts +30 -4
- package/src/components/gui/menu/equip-menu.ce +410 -0
- package/src/components/gui/menu/exit-menu.ce +41 -0
- package/src/components/gui/menu/items-menu.ce +317 -0
- package/src/components/gui/menu/main-menu.ce +294 -0
- package/src/components/gui/menu/options-menu.ce +35 -0
- package/src/components/gui/menu/skills-menu.ce +83 -0
- package/src/components/gui/mobile/index.ts +24 -0
- package/src/components/gui/mobile/mobile.ce +80 -0
- package/src/components/gui/notification/notification.ce +51 -0
- package/src/components/gui/save-load.ce +208 -0
- package/src/components/gui/shop/shop.ce +493 -0
- package/src/components/gui/title-screen.ce +163 -0
- package/src/components/index.ts +3 -0
- package/src/components/prebuilt/hp-bar.ce +255 -0
- package/src/components/prebuilt/index.ts +24 -0
- package/src/components/prebuilt/light-halo.ce +148 -0
- package/src/components/scenes/canvas.ce +20 -15
- package/src/components/scenes/draw-map.ce +60 -13
- package/src/components/scenes/event-layer.ce +7 -0
- package/src/components/scenes/transition.ce +60 -0
- package/src/index.ts +16 -2
- package/src/module.ts +127 -9
- package/src/presets/animation.ts +46 -0
- package/src/presets/faceset.ts +60 -0
- package/src/presets/icon.ts +17 -0
- package/src/presets/index.ts +9 -1
- package/src/presets/lpc.ts +108 -0
- package/src/services/AbstractSocket.ts +10 -2
- package/src/services/keyboardControls.ts +20 -0
- package/src/services/loadMap.ts +1 -1
- package/src/services/mmorpg.ts +100 -12
- package/src/services/save.ts +103 -0
- package/src/services/standalone.ts +110 -18
- package/src/utils/getEntityProp.ts +87 -0
- package/vite.config.ts +4 -2
- package/dist/Game/EffectManager.d.ts +0 -5
- package/dist/components/effects/index.d.ts +0 -4
- package/dist/index.js.map +0 -1
- package/dist/index10.js +0 -8
- package/dist/index10.js.map +0 -1
- package/dist/index11.js +0 -10
- package/dist/index11.js.map +0 -1
- package/dist/index12.js +0 -8
- package/dist/index12.js.map +0 -1
- package/dist/index13.js +0 -17
- package/dist/index13.js.map +0 -1
- package/dist/index14.js +0 -107
- package/dist/index14.js.map +0 -1
- package/dist/index15.js +0 -50
- package/dist/index15.js.map +0 -1
- package/dist/index16.js +0 -191
- package/dist/index16.js.map +0 -1
- package/dist/index17.js +0 -9
- package/dist/index17.js.map +0 -1
- package/dist/index18.js +0 -387
- package/dist/index18.js.map +0 -1
- package/dist/index19.js +0 -31
- package/dist/index19.js.map +0 -1
- package/dist/index2.js +0 -181
- package/dist/index2.js.map +0 -1
- package/dist/index20.js +0 -24
- package/dist/index20.js.map +0 -1
- package/dist/index21.js +0 -2421
- package/dist/index21.js.map +0 -1
- package/dist/index22.js +0 -114
- package/dist/index22.js.map +0 -1
- package/dist/index23.js +0 -109
- package/dist/index23.js.map +0 -1
- package/dist/index24.js +0 -71
- package/dist/index24.js.map +0 -1
- package/dist/index25.js +0 -21
- package/dist/index25.js.map +0 -1
- package/dist/index26.js +0 -41
- package/dist/index26.js.map +0 -1
- package/dist/index27.js +0 -5
- package/dist/index27.js.map +0 -1
- package/dist/index28.js +0 -322
- package/dist/index28.js.map +0 -1
- package/dist/index29.js +0 -27
- package/dist/index29.js.map +0 -1
- package/dist/index3.js +0 -87
- package/dist/index3.js.map +0 -1
- package/dist/index30.js +0 -11
- package/dist/index30.js.map +0 -1
- package/dist/index31.js +0 -11
- package/dist/index31.js.map +0 -1
- package/dist/index32.js +0 -174
- package/dist/index32.js.map +0 -1
- package/dist/index33.js +0 -501
- package/dist/index33.js.map +0 -1
- package/dist/index34.js +0 -12
- package/dist/index34.js.map +0 -1
- package/dist/index35.js +0 -4403
- package/dist/index35.js.map +0 -1
- package/dist/index36.js +0 -316
- package/dist/index36.js.map +0 -1
- package/dist/index37.js +0 -61
- package/dist/index37.js.map +0 -1
- package/dist/index38.js +0 -20
- package/dist/index38.js.map +0 -1
- package/dist/index39.js +0 -20
- package/dist/index39.js.map +0 -1
- package/dist/index4.js +0 -67
- package/dist/index4.js.map +0 -1
- package/dist/index5.js +0 -16
- package/dist/index5.js.map +0 -1
- package/dist/index6.js +0 -17
- package/dist/index6.js.map +0 -1
- package/dist/index7.js +0 -39
- package/dist/index7.js.map +0 -1
- package/dist/index8.js +0 -108
- package/dist/index8.js.map +0 -1
- package/dist/index9.js +0 -76
- package/dist/index9.js.map +0 -1
- package/src/components/gui/dialogbox/itemMenu.ce +0 -23
- package/src/components/gui/dialogbox/selection.ce +0 -67
- /package/src/components/{effects → animations}/hit.ce +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { signal } from "canvasengine";
|
|
2
|
+
import { generateUID } from "@rpgjs/common";
|
|
3
|
+
//#region src/Game/AnimationManager.ts
|
|
4
|
+
var AnimationManager = class {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.current = signal([]);
|
|
7
|
+
}
|
|
8
|
+
displayEffect(params, player) {
|
|
9
|
+
const id = generateUID();
|
|
10
|
+
this.current().push({
|
|
11
|
+
...params,
|
|
12
|
+
id,
|
|
13
|
+
x: player.x,
|
|
14
|
+
y: player.y,
|
|
15
|
+
object: player,
|
|
16
|
+
onFinish: () => {
|
|
17
|
+
const index = this.current().findIndex((value) => value.id === id);
|
|
18
|
+
this.current().splice(index, 1);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { AnimationManager };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=AnimationManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimationManager.js","names":[],"sources":["../../src/Game/AnimationManager.ts"],"sourcesContent":["import { generateUID, RpgCommonPlayer } from \"@rpgjs/common\";\nimport { signal } from \"canvasengine\";\n\nexport class AnimationManager {\n current = signal<any[]>([]);\n\n displayEffect(params: any, player: RpgCommonPlayer | { x: number, y: number }) {\n const id = generateUID();\n this.current().push({\n ...params,\n id,\n x: player.x,\n y: player.y,\n object: player,\n onFinish: () => {\n const index = this.current().findIndex((value) => value.id === id);\n this.current().splice(index, 1);\n },\n });\n }\n}\n"],"mappings":";;;AAGA,IAAa,mBAAb,MAA8B;;iBAClB,OAAc,EAAE,CAAC;;CAE3B,cAAc,QAAa,QAAoD;EAC7E,MAAM,KAAK,aAAa;AACxB,OAAK,SAAS,CAAC,KAAK;GAClB,GAAG;GACH;GACA,GAAG,OAAO;GACV,GAAG,OAAO;GACV,QAAQ;GACR,gBAAgB;IACd,MAAM,QAAQ,KAAK,SAAS,CAAC,WAAW,UAAU,MAAM,OAAO,GAAG;AAClE,SAAK,SAAS,CAAC,OAAO,OAAO,EAAE;;GAElC,CAAC"}
|
package/dist/Game/Event.d.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RpgClientObject } from "./Object.js";
|
|
2
|
+
//#region src/Game/Event.ts
|
|
3
|
+
var RpgClientEvent = class extends RpgClientObject {
|
|
4
|
+
constructor(..._args) {
|
|
5
|
+
super(..._args);
|
|
6
|
+
this._type = "event";
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { RpgClientEvent };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=Event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Event.js","names":[],"sources":["../../src/Game/Event.ts"],"sourcesContent":["import { RpgClientObject } from \"./Object\"; \n\nexport class RpgClientEvent extends RpgClientObject {\n _type = 'event'\n} "],"mappings":";;AAEA,IAAa,iBAAb,cAAoC,gBAAgB;;;eACxC"}
|
package/dist/Game/Map.d.ts
CHANGED
|
@@ -1,7 +1,28 @@
|
|
|
1
|
-
import { RpgCommonMap } from '@rpgjs/common';
|
|
1
|
+
import { RpgCommonMap, WeatherState, MapPhysicsInitContext, MapPhysicsEntityContext } from '@rpgjs/common';
|
|
2
2
|
import { RpgClientPlayer } from './Player';
|
|
3
3
|
import { RpgClientEvent } from './Event';
|
|
4
|
-
|
|
4
|
+
import { RpgClientEngine } from '../RpgClientEngine';
|
|
5
|
+
export declare class RpgClientMap extends RpgCommonMap<any> {
|
|
6
|
+
engine: RpgClientEngine;
|
|
5
7
|
players: import('canvasengine').WritableObjectSignal<Record<string, RpgClientPlayer>>;
|
|
6
8
|
events: import('canvasengine').WritableObjectSignal<Record<string, RpgClientEvent>>;
|
|
9
|
+
currentPlayer: import('canvasengine').ComputedSignal<RpgClientPlayer>;
|
|
10
|
+
weatherState: import('canvasengine').WritableSignal<WeatherState | null>;
|
|
11
|
+
localWeatherOverride: import('canvasengine').WritableSignal<WeatherState | null>;
|
|
12
|
+
weather: import('canvasengine').ComputedSignal<WeatherState | null>;
|
|
13
|
+
private manualClientPhysicsTick;
|
|
14
|
+
private readonly isTestEnvironment;
|
|
15
|
+
constructor();
|
|
16
|
+
configureClientPrediction(enabled: boolean): void;
|
|
17
|
+
getCurrentPlayer(): RpgClientPlayer;
|
|
18
|
+
reset(force?: boolean): void;
|
|
19
|
+
getWeather(): WeatherState | null;
|
|
20
|
+
setLocalWeather(next: WeatherState | null): void;
|
|
21
|
+
clearLocalWeather(): void;
|
|
22
|
+
stepClientPhysics(deltaMs: number): number;
|
|
23
|
+
stepPredictionTick(): void;
|
|
24
|
+
protected emitPhysicsInit(context: MapPhysicsInitContext): void;
|
|
25
|
+
protected emitPhysicsEntityAdd(context: MapPhysicsEntityContext): void;
|
|
26
|
+
protected emitPhysicsEntityRemove(context: MapPhysicsEntityContext): void;
|
|
27
|
+
protected emitPhysicsReset(): void;
|
|
7
28
|
}
|
package/dist/Game/Map.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { inject } from "../core/inject.js";
|
|
2
|
+
import { sync, users } from "../node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/index.js";
|
|
3
|
+
import { RpgClientPlayer } from "./Player.js";
|
|
4
|
+
import { RpgClientEvent } from "./Event.js";
|
|
5
|
+
import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
6
|
+
import { __decorate } from "../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
7
|
+
import { RpgClientEngine } from "../RpgClientEngine.js";
|
|
8
|
+
import { computed, signal } from "canvasengine";
|
|
9
|
+
import { RpgCommonMap } from "@rpgjs/common";
|
|
10
|
+
//#region src/Game/Map.ts
|
|
11
|
+
var RpgClientMap = class extends RpgCommonMap {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.engine = inject(RpgClientEngine);
|
|
15
|
+
this.players = signal({});
|
|
16
|
+
this.events = signal({});
|
|
17
|
+
this.currentPlayer = computed(() => this.players()[this.engine.playerIdSignal()]);
|
|
18
|
+
this.weatherState = signal(null);
|
|
19
|
+
this.localWeatherOverride = signal(null);
|
|
20
|
+
this.weather = computed(() => {
|
|
21
|
+
const local = this.localWeatherOverride();
|
|
22
|
+
const state = this.weatherState();
|
|
23
|
+
return local ?? state;
|
|
24
|
+
});
|
|
25
|
+
this.manualClientPhysicsTick = false;
|
|
26
|
+
const isTest = typeof process !== "undefined" && process.env?.TEST === "true" || typeof window !== "undefined" && window.__RPGJS_TEST__ === true;
|
|
27
|
+
this.isTestEnvironment = isTest;
|
|
28
|
+
if (isTest) this.autoTickEnabled = false;
|
|
29
|
+
}
|
|
30
|
+
configureClientPrediction(enabled) {
|
|
31
|
+
this.manualClientPhysicsTick = enabled;
|
|
32
|
+
this.autoTickEnabled = enabled ? false : !this.isTestEnvironment;
|
|
33
|
+
}
|
|
34
|
+
getCurrentPlayer() {
|
|
35
|
+
return this.currentPlayer();
|
|
36
|
+
}
|
|
37
|
+
reset(force = false) {
|
|
38
|
+
const currentPlayerId = this.engine.playerIdSignal();
|
|
39
|
+
const currentPlayer = !force && currentPlayerId ? this.players()[currentPlayerId] : void 0;
|
|
40
|
+
this.players.set(currentPlayerId && currentPlayer ? { [currentPlayerId]: currentPlayer } : {});
|
|
41
|
+
this.events.set({});
|
|
42
|
+
this.weatherState.set(null);
|
|
43
|
+
this.localWeatherOverride.set(null);
|
|
44
|
+
this.clearPhysic();
|
|
45
|
+
}
|
|
46
|
+
getWeather() {
|
|
47
|
+
return this.weather();
|
|
48
|
+
}
|
|
49
|
+
setLocalWeather(next) {
|
|
50
|
+
this.localWeatherOverride.set(next);
|
|
51
|
+
}
|
|
52
|
+
clearLocalWeather() {
|
|
53
|
+
this.localWeatherOverride.set(null);
|
|
54
|
+
}
|
|
55
|
+
stepClientPhysics(deltaMs) {
|
|
56
|
+
if (!this.manualClientPhysicsTick) return 0;
|
|
57
|
+
return this.nextTick(deltaMs);
|
|
58
|
+
}
|
|
59
|
+
stepPredictionTick() {
|
|
60
|
+
this.forceSingleTick();
|
|
61
|
+
}
|
|
62
|
+
emitPhysicsInit(context) {
|
|
63
|
+
this.engine?.emitSceneMapHook?.("onPhysicsInit", this, context);
|
|
64
|
+
}
|
|
65
|
+
emitPhysicsEntityAdd(context) {
|
|
66
|
+
this.engine?.emitSceneMapHook?.("onPhysicsEntityAdd", this, context);
|
|
67
|
+
}
|
|
68
|
+
emitPhysicsEntityRemove(context) {
|
|
69
|
+
this.engine?.emitSceneMapHook?.("onPhysicsEntityRemove", this, context);
|
|
70
|
+
}
|
|
71
|
+
emitPhysicsReset() {
|
|
72
|
+
this.engine?.emitSceneMapHook?.("onPhysicsReset", this);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
__decorate([users(RpgClientPlayer), __decorateMetadata("design:type", Object)], RpgClientMap.prototype, "players", void 0);
|
|
76
|
+
__decorate([sync(RpgClientEvent), __decorateMetadata("design:type", Object)], RpgClientMap.prototype, "events", void 0);
|
|
77
|
+
//#endregion
|
|
78
|
+
export { RpgClientMap };
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=Map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Map.js","names":[],"sources":["../../src/Game/Map.ts"],"sourcesContent":["import {\n RpgCommonMap,\n type WeatherState,\n type MapPhysicsInitContext,\n type MapPhysicsEntityContext,\n} from \"@rpgjs/common\";\nimport { sync, users } from \"@signe/sync\";\nimport { RpgClientPlayer } from \"./Player\";\nimport { Signal, signal, computed, effect } from \"canvasengine\";\nimport { RpgClientEvent } from \"./Event\";\nimport { RpgClientEngine } from \"../RpgClientEngine\";\nimport { inject } from \"../core/inject\";\n\nexport class RpgClientMap extends RpgCommonMap<any> {\n engine: RpgClientEngine = inject(RpgClientEngine)\n @users(RpgClientPlayer) players = signal<Record<string, RpgClientPlayer>>({});\n @sync(RpgClientEvent) events = signal<Record<string, RpgClientEvent>>({});\n currentPlayer = computed(() => this.players()[this.engine.playerIdSignal()!])\n weatherState = signal<WeatherState | null>(null);\n localWeatherOverride = signal<WeatherState | null>(null);\n weather = computed<WeatherState | null>(() => {\n const local = this.localWeatherOverride() \n const state = this.weatherState()\n return local ?? state\n });\n private manualClientPhysicsTick = false;\n private readonly isTestEnvironment: boolean;\n\n constructor() {\n super();\n // Détecter l'environnement de test\n const isTest = (typeof process !== 'undefined' && process.env?.TEST === 'true')\n || (typeof window !== 'undefined' && (window as any).__RPGJS_TEST__ === true);\n this.isTestEnvironment = isTest;\n if (isTest) {\n this.autoTickEnabled = false;\n }\n }\n\n configureClientPrediction(enabled: boolean): void {\n this.manualClientPhysicsTick = enabled;\n this.autoTickEnabled = enabled ? false : !this.isTestEnvironment;\n }\n\n getCurrentPlayer() {\n return this.currentPlayer()\n }\n\n reset(force = false) {\n const currentPlayerId = this.engine.playerIdSignal();\n const currentPlayer = !force && currentPlayerId\n ? this.players()[currentPlayerId]\n : undefined;\n\n this.players.set(\n currentPlayerId && currentPlayer ? { [currentPlayerId]: currentPlayer } : {}\n );\n this.events.set({})\n this.weatherState.set(null);\n this.localWeatherOverride.set(null);\n this.clearPhysic()\n }\n\n getWeather(): WeatherState | null {\n return this.weather();\n }\n\n setLocalWeather(next: WeatherState | null): void {\n this.localWeatherOverride.set(next);\n }\n\n clearLocalWeather(): void {\n this.localWeatherOverride.set(null);\n }\n\n stepClientPhysics(deltaMs: number): number {\n if (!this.manualClientPhysicsTick) {\n return 0;\n }\n return this.nextTick(deltaMs);\n }\n\n stepPredictionTick(): void {\n this.forceSingleTick();\n }\n\n protected emitPhysicsInit(context: MapPhysicsInitContext): void {\n this.engine?.emitSceneMapHook?.(\"onPhysicsInit\", this, context);\n }\n\n protected emitPhysicsEntityAdd(context: MapPhysicsEntityContext): void {\n this.engine?.emitSceneMapHook?.(\"onPhysicsEntityAdd\", this, context);\n }\n\n protected emitPhysicsEntityRemove(context: MapPhysicsEntityContext): void {\n this.engine?.emitSceneMapHook?.(\"onPhysicsEntityRemove\", this, context);\n }\n\n protected emitPhysicsReset(): void {\n this.engine?.emitSceneMapHook?.(\"onPhysicsReset\", this);\n }\n}\n"],"mappings":";;;;;;;;;;AAaA,IAAa,eAAb,cAAkC,aAAkB;CAelD,cAAc;AACZ,SAAO;gBAfiB,OAAO,gBAAgB;iBACf,OAAwC,EAAE,CAAC;gBAC9C,OAAuC,EAAE,CAAC;uBACzD,eAAe,KAAK,SAAS,CAAC,KAAK,OAAO,gBAAgB,EAAG;sBAC9D,OAA4B,KAAK;8BACzB,OAA4B,KAAK;iBAC9C,eAAoC;GAC5C,MAAM,QAAQ,KAAK,sBAAsB;GACzC,MAAM,QAAQ,KAAK,cAAc;AACjC,UAAO,SAAS;IAChB;iCACgC;EAMhC,MAAM,SAAU,OAAO,YAAY,eAAe,QAAQ,KAAK,SAAS,UAClE,OAAO,WAAW,eAAgB,OAAe,mBAAmB;AAC1E,OAAK,oBAAoB;AACzB,MAAI,OACF,MAAK,kBAAkB;;CAI3B,0BAA0B,SAAwB;AAChD,OAAK,0BAA0B;AAC/B,OAAK,kBAAkB,UAAU,QAAQ,CAAC,KAAK;;CAGjD,mBAAmB;AACjB,SAAO,KAAK,eAAe;;CAG7B,MAAM,QAAQ,OAAO;EACnB,MAAM,kBAAkB,KAAK,OAAO,gBAAgB;EACpD,MAAM,gBAAgB,CAAC,SAAS,kBAC5B,KAAK,SAAS,CAAC,mBACf,KAAA;AAEJ,OAAK,QAAQ,IACX,mBAAmB,gBAAgB,GAAG,kBAAkB,eAAe,GAAG,EAAE,CAC7E;AACD,OAAK,OAAO,IAAI,EAAE,CAAC;AACnB,OAAK,aAAa,IAAI,KAAK;AAC3B,OAAK,qBAAqB,IAAI,KAAK;AACnC,OAAK,aAAa;;CAGpB,aAAkC;AAChC,SAAO,KAAK,SAAS;;CAGvB,gBAAgB,MAAiC;AAC/C,OAAK,qBAAqB,IAAI,KAAK;;CAGrC,oBAA0B;AACxB,OAAK,qBAAqB,IAAI,KAAK;;CAGrC,kBAAkB,SAAyB;AACzC,MAAI,CAAC,KAAK,wBACR,QAAO;AAET,SAAO,KAAK,SAAS,QAAQ;;CAG/B,qBAA2B;AACzB,OAAK,iBAAiB;;CAGxB,gBAA0B,SAAsC;AAC9D,OAAK,QAAQ,mBAAmB,iBAAiB,MAAM,QAAQ;;CAGjE,qBAA+B,SAAwC;AACrE,OAAK,QAAQ,mBAAmB,sBAAsB,MAAM,QAAQ;;CAGtE,wBAAkC,SAAwC;AACxE,OAAK,QAAQ,mBAAmB,yBAAyB,MAAM,QAAQ;;CAGzE,mBAAmC;AACjC,OAAK,QAAQ,mBAAmB,kBAAkB,KAAK;;;YApFxD,MAAM,gBAAgB,EAAA,mBAAA,eAAA,OAAA,CAAA,EAAA,aAAA,WAAA,WAAA,KAAA,EAAA;YACtB,KAAK,eAAe,EAAA,mBAAA,eAAA,OAAA,CAAA,EAAA,aAAA,WAAA,UAAA,KAAA,EAAA"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { Hooks, RpgCommonPlayer } from '@rpgjs/common';
|
|
2
|
+
import { RpgClientEngine } from '../RpgClientEngine';
|
|
3
|
+
type Frame = {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
ts: number;
|
|
7
|
+
};
|
|
8
|
+
export declare abstract class RpgClientObject extends RpgCommonPlayer {
|
|
9
|
+
abstract _type: string;
|
|
10
|
+
emitParticleTrigger: import('canvasengine').Trigger<any>;
|
|
11
|
+
particleName: import('canvasengine').WritableSignal<string>;
|
|
12
|
+
animationCurrentIndex: import('canvasengine').WritableSignal<number>;
|
|
13
|
+
animationIsPlaying: import('canvasengine').WritableSignal<boolean>;
|
|
14
|
+
_param: import('canvasengine').WritableObjectSignal<{}>;
|
|
15
|
+
frames: Frame[];
|
|
16
|
+
graphicsSignals: import('canvasengine').WritableArraySignal<any[]>;
|
|
17
|
+
_component: {};
|
|
18
|
+
flashTrigger: import('canvasengine').Trigger<any>;
|
|
19
|
+
constructor();
|
|
20
|
+
/**
|
|
21
|
+
* Access the shared client hook registry.
|
|
22
|
+
*
|
|
23
|
+
* @returns The hook service used to register and trigger client-side hooks.
|
|
24
|
+
*/
|
|
25
|
+
get hooks(): Hooks;
|
|
26
|
+
/**
|
|
27
|
+
* Access the current client engine instance.
|
|
28
|
+
*
|
|
29
|
+
* @returns The active {@link RpgClientEngine} instance.
|
|
30
|
+
*/
|
|
31
|
+
get engine(): RpgClientEngine<unknown>;
|
|
32
|
+
private animationSubscription?;
|
|
33
|
+
/**
|
|
34
|
+
* Trigger a flash animation on this sprite
|
|
35
|
+
*
|
|
36
|
+
* This method triggers a flash effect using CanvasEngine's flash directive.
|
|
37
|
+
* The flash can be configured with various options including type (alpha, tint, or both),
|
|
38
|
+
* duration, cycles, and color.
|
|
39
|
+
*
|
|
40
|
+
* ## Design
|
|
41
|
+
*
|
|
42
|
+
* The flash uses a trigger system that is connected to the flash directive in the
|
|
43
|
+
* character component. This allows for flexible configuration and can be triggered
|
|
44
|
+
* from both server events and client-side code.
|
|
45
|
+
*
|
|
46
|
+
* @param options - Flash configuration options
|
|
47
|
+
* @param options.type - Type of flash effect: 'alpha' (opacity), 'tint' (color), or 'both' (default: 'alpha')
|
|
48
|
+
* @param options.duration - Duration of the flash animation in milliseconds (default: 300)
|
|
49
|
+
* @param options.cycles - Number of flash cycles (flash on/off) (default: 1)
|
|
50
|
+
* @param options.alpha - Alpha value when flashing, from 0 to 1 (default: 0.3)
|
|
51
|
+
* @param options.tint - Tint color when flashing as hex value or color name (default: 0xffffff - white)
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* // Simple flash with default settings (alpha flash)
|
|
56
|
+
* player.flash();
|
|
57
|
+
*
|
|
58
|
+
* // Flash with red tint
|
|
59
|
+
* player.flash({ type: 'tint', tint: 0xff0000 });
|
|
60
|
+
*
|
|
61
|
+
* // Flash with both alpha and tint
|
|
62
|
+
* player.flash({
|
|
63
|
+
* type: 'both',
|
|
64
|
+
* alpha: 0.5,
|
|
65
|
+
* tint: 0xff0000,
|
|
66
|
+
* duration: 200,
|
|
67
|
+
* cycles: 2
|
|
68
|
+
* });
|
|
69
|
+
*
|
|
70
|
+
* // Quick damage flash
|
|
71
|
+
* player.flash({
|
|
72
|
+
* type: 'tint',
|
|
73
|
+
* tint: 0xff0000,
|
|
74
|
+
* duration: 150,
|
|
75
|
+
* cycles: 1
|
|
76
|
+
* });
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
flash(options?: {
|
|
80
|
+
type?: 'alpha' | 'tint' | 'both';
|
|
81
|
+
duration?: number;
|
|
82
|
+
cycles?: number;
|
|
83
|
+
alpha?: number;
|
|
84
|
+
tint?: number | string;
|
|
85
|
+
}): void;
|
|
86
|
+
/**
|
|
87
|
+
* Reset animation state when animation changes externally
|
|
88
|
+
*
|
|
89
|
+
* This method should be called when the animation changes due to movement
|
|
90
|
+
* or other external factors to ensure the animation system doesn't get stuck
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* // Reset when player starts moving
|
|
95
|
+
* player.resetAnimationState();
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
resetAnimationState(): void;
|
|
99
|
+
/**
|
|
100
|
+
* Set a custom animation for a specific number of times
|
|
101
|
+
*
|
|
102
|
+
* Plays a custom animation for the specified number of repetitions.
|
|
103
|
+
* The animation system prevents overlapping animations and automatically
|
|
104
|
+
* returns to the previous animation when complete.
|
|
105
|
+
*
|
|
106
|
+
* @param animationName - Name of the animation to play
|
|
107
|
+
* @param nbTimes - Number of times to repeat the animation (default: Infinity for continuous)
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* // Play attack animation 3 times
|
|
112
|
+
* player.setAnimation('attack', 3);
|
|
113
|
+
*
|
|
114
|
+
* // Play continuous spell animation
|
|
115
|
+
* player.setAnimation('spell');
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
setAnimation(animationName: string, nbTimes?: number): void;
|
|
119
|
+
/**
|
|
120
|
+
* Set a custom animation with temporary graphic change
|
|
121
|
+
*
|
|
122
|
+
* Plays a custom animation for the specified number of repetitions and temporarily
|
|
123
|
+
* changes the player's graphic (sprite sheet) during the animation. The graphic
|
|
124
|
+
* is automatically reset when the animation finishes.
|
|
125
|
+
*
|
|
126
|
+
* @param animationName - Name of the animation to play
|
|
127
|
+
* @param graphic - The graphic(s) to temporarily use during the animation
|
|
128
|
+
* @param nbTimes - Number of times to repeat the animation (default: Infinity for continuous)
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```ts
|
|
132
|
+
* // Play attack animation with temporary graphic change
|
|
133
|
+
* player.setAnimation('attack', 'hero_attack', 3);
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
setAnimation(animationName: string, graphic?: string | string[], nbTimes?: number): void;
|
|
137
|
+
/**
|
|
138
|
+
* Display a registered component animation effect on this object.
|
|
139
|
+
*
|
|
140
|
+
* @param id - Identifier of the component animation to play.
|
|
141
|
+
* @param params - Parameters forwarded to the animation effect.
|
|
142
|
+
*/
|
|
143
|
+
showComponentAnimation(id: string, params: any): void;
|
|
144
|
+
/**
|
|
145
|
+
* Check whether this client object represents an event.
|
|
146
|
+
*
|
|
147
|
+
* @returns `true` if the object type is `event`, otherwise `false`.
|
|
148
|
+
*/
|
|
149
|
+
isEvent(): boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Check whether this client object represents a player.
|
|
152
|
+
*
|
|
153
|
+
* @returns `true` if the object type is `player`, otherwise `false`.
|
|
154
|
+
*/
|
|
155
|
+
isPlayer(): boolean;
|
|
156
|
+
}
|
|
157
|
+
export {};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { inject } from "../core/inject.js";
|
|
2
|
+
import component from "../components/dynamics/text.ce.js";
|
|
3
|
+
import { RpgClientEngine } from "../RpgClientEngine.js";
|
|
4
|
+
import { signal, trigger } from "canvasengine";
|
|
5
|
+
import { ModulesToken, RpgCommonPlayer } from "@rpgjs/common";
|
|
6
|
+
import { filter, from, map, switchMap } from "rxjs";
|
|
7
|
+
//#region src/Game/Object.ts
|
|
8
|
+
var DYNAMIC_COMPONENTS = { text: component };
|
|
9
|
+
var RpgClientObject = class extends RpgCommonPlayer {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.emitParticleTrigger = trigger();
|
|
13
|
+
this.particleName = signal("");
|
|
14
|
+
this.animationCurrentIndex = signal(0);
|
|
15
|
+
this.animationIsPlaying = signal(false);
|
|
16
|
+
this._param = signal({});
|
|
17
|
+
this.frames = [];
|
|
18
|
+
this.graphicsSignals = signal([]);
|
|
19
|
+
this._component = {};
|
|
20
|
+
this.flashTrigger = trigger();
|
|
21
|
+
this.hooks.callHooks("client-sprite-onInit", this).subscribe();
|
|
22
|
+
this._frames.observable.subscribe(({ items }) => {
|
|
23
|
+
if (!this.id) return;
|
|
24
|
+
const nextFrames = items.flatMap((item) => Array.isArray(item) ? item : [item]);
|
|
25
|
+
this.frames = [...this.frames, ...nextFrames];
|
|
26
|
+
});
|
|
27
|
+
this.graphics.observable.pipe(map(({ items }) => items), filter((graphics) => graphics.length > 0), switchMap((graphics) => from(Promise.all(graphics.map((graphic) => this.engine.getSpriteSheet(graphic)))))).subscribe((sheets) => {
|
|
28
|
+
this.graphicsSignals.set(sheets);
|
|
29
|
+
});
|
|
30
|
+
this.componentsTop.observable.pipe(filter((value) => value !== null && value !== void 0), map((value) => typeof value === "string" ? JSON.parse(value) : value)).subscribe(({ components }) => {
|
|
31
|
+
for (const component of components) for (const [key, value] of Object.entries(component)) {
|
|
32
|
+
this._component = value;
|
|
33
|
+
console.log(value);
|
|
34
|
+
const type = value.type;
|
|
35
|
+
if (DYNAMIC_COMPONENTS[type]) this.engine.addSpriteComponentInFront(DYNAMIC_COMPONENTS[type]);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
this.engine.tick.pipe().subscribe(() => {
|
|
39
|
+
const frame = this.frames.shift();
|
|
40
|
+
if (frame) {
|
|
41
|
+
if (typeof frame.x !== "number" || typeof frame.y !== "number") return;
|
|
42
|
+
this.engine.scene.setBodyPosition(this.id, frame.x, frame.y, "top-left");
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Access the shared client hook registry.
|
|
48
|
+
*
|
|
49
|
+
* @returns The hook service used to register and trigger client-side hooks.
|
|
50
|
+
*/
|
|
51
|
+
get hooks() {
|
|
52
|
+
return inject(ModulesToken);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Access the current client engine instance.
|
|
56
|
+
*
|
|
57
|
+
* @returns The active {@link RpgClientEngine} instance.
|
|
58
|
+
*/
|
|
59
|
+
get engine() {
|
|
60
|
+
return inject(RpgClientEngine);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Trigger a flash animation on this sprite
|
|
64
|
+
*
|
|
65
|
+
* This method triggers a flash effect using CanvasEngine's flash directive.
|
|
66
|
+
* The flash can be configured with various options including type (alpha, tint, or both),
|
|
67
|
+
* duration, cycles, and color.
|
|
68
|
+
*
|
|
69
|
+
* ## Design
|
|
70
|
+
*
|
|
71
|
+
* The flash uses a trigger system that is connected to the flash directive in the
|
|
72
|
+
* character component. This allows for flexible configuration and can be triggered
|
|
73
|
+
* from both server events and client-side code.
|
|
74
|
+
*
|
|
75
|
+
* @param options - Flash configuration options
|
|
76
|
+
* @param options.type - Type of flash effect: 'alpha' (opacity), 'tint' (color), or 'both' (default: 'alpha')
|
|
77
|
+
* @param options.duration - Duration of the flash animation in milliseconds (default: 300)
|
|
78
|
+
* @param options.cycles - Number of flash cycles (flash on/off) (default: 1)
|
|
79
|
+
* @param options.alpha - Alpha value when flashing, from 0 to 1 (default: 0.3)
|
|
80
|
+
* @param options.tint - Tint color when flashing as hex value or color name (default: 0xffffff - white)
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* // Simple flash with default settings (alpha flash)
|
|
85
|
+
* player.flash();
|
|
86
|
+
*
|
|
87
|
+
* // Flash with red tint
|
|
88
|
+
* player.flash({ type: 'tint', tint: 0xff0000 });
|
|
89
|
+
*
|
|
90
|
+
* // Flash with both alpha and tint
|
|
91
|
+
* player.flash({
|
|
92
|
+
* type: 'both',
|
|
93
|
+
* alpha: 0.5,
|
|
94
|
+
* tint: 0xff0000,
|
|
95
|
+
* duration: 200,
|
|
96
|
+
* cycles: 2
|
|
97
|
+
* });
|
|
98
|
+
*
|
|
99
|
+
* // Quick damage flash
|
|
100
|
+
* player.flash({
|
|
101
|
+
* type: 'tint',
|
|
102
|
+
* tint: 0xff0000,
|
|
103
|
+
* duration: 150,
|
|
104
|
+
* cycles: 1
|
|
105
|
+
* });
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
flash(options) {
|
|
109
|
+
const flashOptions = {
|
|
110
|
+
type: options?.type || "alpha",
|
|
111
|
+
duration: options?.duration ?? 300,
|
|
112
|
+
cycles: options?.cycles ?? 1,
|
|
113
|
+
alpha: options?.alpha ?? .3,
|
|
114
|
+
tint: options?.tint ?? 16777215
|
|
115
|
+
};
|
|
116
|
+
let tintValue = flashOptions.tint;
|
|
117
|
+
if (typeof tintValue === "string") tintValue = {
|
|
118
|
+
"white": 16777215,
|
|
119
|
+
"red": 16711680,
|
|
120
|
+
"green": 65280,
|
|
121
|
+
"blue": 255,
|
|
122
|
+
"yellow": 16776960,
|
|
123
|
+
"cyan": 65535,
|
|
124
|
+
"magenta": 16711935,
|
|
125
|
+
"black": 0
|
|
126
|
+
}[tintValue.toLowerCase()] ?? 16777215;
|
|
127
|
+
this.flashTrigger.start({
|
|
128
|
+
...flashOptions,
|
|
129
|
+
tint: tintValue
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Reset animation state when animation changes externally
|
|
134
|
+
*
|
|
135
|
+
* This method should be called when the animation changes due to movement
|
|
136
|
+
* or other external factors to ensure the animation system doesn't get stuck
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```ts
|
|
140
|
+
* // Reset when player starts moving
|
|
141
|
+
* player.resetAnimationState();
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
resetAnimationState() {
|
|
145
|
+
this.animationIsPlaying.set(false);
|
|
146
|
+
this.animationCurrentIndex.set(0);
|
|
147
|
+
if (this.animationSubscription) {
|
|
148
|
+
this.animationSubscription.unsubscribe();
|
|
149
|
+
this.animationSubscription = void 0;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
setAnimation(animationName, graphicOrNbTimes, nbTimes) {
|
|
153
|
+
if (this.animationIsPlaying()) return;
|
|
154
|
+
this.animationIsPlaying.set(true);
|
|
155
|
+
const previousAnimationName = this.animationName();
|
|
156
|
+
const previousGraphics = this.graphics();
|
|
157
|
+
this.animationCurrentIndex.set(0);
|
|
158
|
+
let graphic;
|
|
159
|
+
let finalNbTimes = Infinity;
|
|
160
|
+
if (typeof graphicOrNbTimes === "number") finalNbTimes = graphicOrNbTimes;
|
|
161
|
+
else if (graphicOrNbTimes !== void 0) {
|
|
162
|
+
graphic = graphicOrNbTimes;
|
|
163
|
+
finalNbTimes = nbTimes ?? Infinity;
|
|
164
|
+
} else finalNbTimes = Infinity;
|
|
165
|
+
if (graphic !== void 0) if (Array.isArray(graphic)) this.graphics.set(graphic);
|
|
166
|
+
else this.graphics.set([graphic]);
|
|
167
|
+
if (this.animationSubscription) this.animationSubscription.unsubscribe();
|
|
168
|
+
this.animationSubscription = this.animationCurrentIndex.observable.subscribe((index) => {
|
|
169
|
+
if (index >= finalNbTimes) {
|
|
170
|
+
this.animationCurrentIndex.set(0);
|
|
171
|
+
this.animationName.set(previousAnimationName);
|
|
172
|
+
if (graphic !== void 0) this.graphics.set(previousGraphics);
|
|
173
|
+
this.animationIsPlaying.set(false);
|
|
174
|
+
if (this.animationSubscription) {
|
|
175
|
+
this.animationSubscription.unsubscribe();
|
|
176
|
+
this.animationSubscription = void 0;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
this.animationName.set(animationName);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Display a registered component animation effect on this object.
|
|
184
|
+
*
|
|
185
|
+
* @param id - Identifier of the component animation to play.
|
|
186
|
+
* @param params - Parameters forwarded to the animation effect.
|
|
187
|
+
*/
|
|
188
|
+
showComponentAnimation(id, params) {
|
|
189
|
+
inject(RpgClientEngine).getComponentAnimation(id).displayEffect(params, this);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Check whether this client object represents an event.
|
|
193
|
+
*
|
|
194
|
+
* @returns `true` if the object type is `event`, otherwise `false`.
|
|
195
|
+
*/
|
|
196
|
+
isEvent() {
|
|
197
|
+
return this._type === "event";
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Check whether this client object represents a player.
|
|
201
|
+
*
|
|
202
|
+
* @returns `true` if the object type is `player`, otherwise `false`.
|
|
203
|
+
*/
|
|
204
|
+
isPlayer() {
|
|
205
|
+
return this._type === "player";
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
//#endregion
|
|
209
|
+
export { RpgClientObject };
|
|
210
|
+
|
|
211
|
+
//# sourceMappingURL=Object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Object.js","names":[],"sources":["../../src/Game/Object.ts"],"sourcesContent":["import { Hooks, ModulesToken, RpgCommonPlayer } from \"@rpgjs/common\";\nimport { trigger, signal, effect } from \"canvasengine\";\nimport { filter, from, map, Subscription, switchMap } from \"rxjs\";\nimport { inject } from \"../core/inject\";\nimport { RpgClientEngine } from \"../RpgClientEngine\";\nimport TextComponent from \"../components/dynamics/text.ce\";\n\nconst DYNAMIC_COMPONENTS = {\n text: TextComponent,\n}\n\ntype Frame = { x: number; y: number; ts: number };\n\nexport abstract class RpgClientObject extends RpgCommonPlayer {\n abstract _type: string;\n emitParticleTrigger = trigger();\n particleName = signal(\"\");\n animationCurrentIndex = signal(0);\n animationIsPlaying = signal(false);\n _param = signal({});\n frames: Frame[] = [];\n graphicsSignals = signal<any[]>([]);\n _component = {} // temporary component memory\n flashTrigger = trigger();\n\n constructor() {\n super();\n this.hooks.callHooks(\"client-sprite-onInit\", this).subscribe();\n\n this._frames.observable.subscribe(({ items }) => {\n if (!this.id) return;\n //if (this.id == this.engine.playerIdSignal()!) return;\n const nextFrames = items.flatMap((item): Frame[] =>\n Array.isArray(item) ? item : [item]\n );\n this.frames = [...this.frames, ...nextFrames];\n });\n\n this.graphics.observable\n .pipe(\n map(({ items }) => items),\n filter(graphics => graphics.length > 0),\n switchMap(graphics => from(Promise.all(graphics.map(graphic => this.engine.getSpriteSheet(graphic)))))\n )\n .subscribe((sheets) => { \n this.graphicsSignals.set(sheets);\n });\n\n this.componentsTop.observable\n .pipe(\n filter(value => value !== null && value !== undefined),\n map((value) => typeof value === 'string' ? JSON.parse(value) : value),\n )\n .subscribe(({components}) => {\n for (const component of components) {\n for (const [key, value] of Object.entries(component)) {\n this._component = value as any; // temporary component memory\n console.log(value)\n const type = (value as any).type as keyof typeof DYNAMIC_COMPONENTS;\n if (DYNAMIC_COMPONENTS[type]) {\n this.engine.addSpriteComponentInFront(DYNAMIC_COMPONENTS[type]);\n }\n }\n }\n });\n\n this.engine.tick\n .pipe\n //throttleTime(10)\n ()\n .subscribe(() => {\n const frame = this.frames.shift();\n if (frame) {\n if (typeof frame.x !== \"number\" || typeof frame.y !== \"number\") return;\n this.engine.scene.setBodyPosition(\n this.id,\n frame.x,\n frame.y,\n \"top-left\"\n );\n }\n });\n }\n\n /**\n * Access the shared client hook registry.\n *\n * @returns The hook service used to register and trigger client-side hooks.\n */\n get hooks() {\n return inject<Hooks>(ModulesToken);\n }\n\n /**\n * Access the current client engine instance.\n *\n * @returns The active {@link RpgClientEngine} instance.\n */\n get engine() {\n return inject(RpgClientEngine);\n }\n\n private animationSubscription?: Subscription;\n\n /**\n * Trigger a flash animation on this sprite\n * \n * This method triggers a flash effect using CanvasEngine's flash directive.\n * The flash can be configured with various options including type (alpha, tint, or both),\n * duration, cycles, and color.\n * \n * ## Design\n * \n * The flash uses a trigger system that is connected to the flash directive in the\n * character component. This allows for flexible configuration and can be triggered\n * from both server events and client-side code.\n * \n * @param options - Flash configuration options\n * @param options.type - Type of flash effect: 'alpha' (opacity), 'tint' (color), or 'both' (default: 'alpha')\n * @param options.duration - Duration of the flash animation in milliseconds (default: 300)\n * @param options.cycles - Number of flash cycles (flash on/off) (default: 1)\n * @param options.alpha - Alpha value when flashing, from 0 to 1 (default: 0.3)\n * @param options.tint - Tint color when flashing as hex value or color name (default: 0xffffff - white)\n * \n * @example\n * ```ts\n * // Simple flash with default settings (alpha flash)\n * player.flash();\n * \n * // Flash with red tint\n * player.flash({ type: 'tint', tint: 0xff0000 });\n * \n * // Flash with both alpha and tint\n * player.flash({ \n * type: 'both', \n * alpha: 0.5, \n * tint: 0xff0000,\n * duration: 200,\n * cycles: 2\n * });\n * \n * // Quick damage flash\n * player.flash({ \n * type: 'tint', \n * tint: 0xff0000, \n * duration: 150,\n * cycles: 1\n * });\n * ```\n */\n flash(options?: {\n type?: 'alpha' | 'tint' | 'both';\n duration?: number;\n cycles?: number;\n alpha?: number;\n tint?: number | string;\n }): void {\n const flashOptions = {\n type: options?.type || 'alpha',\n duration: options?.duration ?? 300,\n cycles: options?.cycles ?? 1,\n alpha: options?.alpha ?? 0.3,\n tint: options?.tint ?? 0xffffff,\n };\n \n // Convert color name to hex if needed\n let tintValue = flashOptions.tint;\n if (typeof tintValue === 'string') {\n // Common color name to hex mapping\n const colorMap: Record<string, number> = {\n 'white': 0xffffff,\n 'red': 0xff0000,\n 'green': 0x00ff00,\n 'blue': 0x0000ff,\n 'yellow': 0xffff00,\n 'cyan': 0x00ffff,\n 'magenta': 0xff00ff,\n 'black': 0x000000,\n };\n tintValue = colorMap[tintValue.toLowerCase()] ?? 0xffffff;\n }\n \n this.flashTrigger.start({\n ...flashOptions,\n tint: tintValue,\n });\n }\n\n /**\n * Reset animation state when animation changes externally\n *\n * This method should be called when the animation changes due to movement\n * or other external factors to ensure the animation system doesn't get stuck\n *\n * @example\n * ```ts\n * // Reset when player starts moving\n * player.resetAnimationState();\n * ```\n */\n resetAnimationState() {\n this.animationIsPlaying.set(false);\n this.animationCurrentIndex.set(0);\n if (this.animationSubscription) {\n this.animationSubscription.unsubscribe();\n this.animationSubscription = undefined;\n }\n }\n\n /**\n * Set a custom animation for a specific number of times\n *\n * Plays a custom animation for the specified number of repetitions.\n * The animation system prevents overlapping animations and automatically\n * returns to the previous animation when complete.\n *\n * @param animationName - Name of the animation to play\n * @param nbTimes - Number of times to repeat the animation (default: Infinity for continuous)\n *\n * @example\n * ```ts\n * // Play attack animation 3 times\n * player.setAnimation('attack', 3);\n *\n * // Play continuous spell animation\n * player.setAnimation('spell');\n * ```\n */\n setAnimation(animationName: string, nbTimes?: number): void;\n /**\n * Set a custom animation with temporary graphic change\n *\n * Plays a custom animation for the specified number of repetitions and temporarily\n * changes the player's graphic (sprite sheet) during the animation. The graphic\n * is automatically reset when the animation finishes.\n *\n * @param animationName - Name of the animation to play\n * @param graphic - The graphic(s) to temporarily use during the animation\n * @param nbTimes - Number of times to repeat the animation (default: Infinity for continuous)\n *\n * @example\n * ```ts\n * // Play attack animation with temporary graphic change\n * player.setAnimation('attack', 'hero_attack', 3);\n * ```\n */\n setAnimation(animationName: string, graphic?: string | string[], nbTimes?: number): void;\n setAnimation(animationName: string, graphicOrNbTimes?: string | string[] | number, nbTimes?: number): void {\n if (this.animationIsPlaying()) return;\n this.animationIsPlaying.set(true);\n const previousAnimationName = this.animationName();\n const previousGraphics = this.graphics();\n this.animationCurrentIndex.set(0);\n\n let graphic: string | string[] | undefined;\n let finalNbTimes: number = Infinity;\n\n // Handle overloads\n if (typeof graphicOrNbTimes === 'number') {\n // setAnimation(animationName, nbTimes)\n finalNbTimes = graphicOrNbTimes;\n } else if (graphicOrNbTimes !== undefined) {\n // setAnimation(animationName, graphic, nbTimes)\n graphic = graphicOrNbTimes;\n finalNbTimes = nbTimes ?? Infinity;\n } else {\n // setAnimation(animationName) - nbTimes remains Infinity\n finalNbTimes = Infinity;\n }\n\n // Temporarily change graphic if provided\n if (graphic !== undefined) {\n if (Array.isArray(graphic)) {\n this.graphics.set(graphic);\n } else {\n this.graphics.set([graphic]);\n }\n }\n\n // Clean up any existing subscription\n if (this.animationSubscription) {\n this.animationSubscription.unsubscribe();\n }\n\n this.animationSubscription =\n this.animationCurrentIndex.observable.subscribe((index) => {\n if (index >= finalNbTimes) {\n this.animationCurrentIndex.set(0);\n this.animationName.set(previousAnimationName);\n // Reset graphic to previous value if it was changed\n if (graphic !== undefined) {\n this.graphics.set(previousGraphics);\n }\n this.animationIsPlaying.set(false);\n if (this.animationSubscription) {\n this.animationSubscription.unsubscribe();\n this.animationSubscription = undefined;\n }\n }\n });\n this.animationName.set(animationName);\n }\n\n /**\n * Display a registered component animation effect on this object.\n *\n * @param id - Identifier of the component animation to play.\n * @param params - Parameters forwarded to the animation effect.\n */\n showComponentAnimation(id: string, params: any) {\n const engine = inject(RpgClientEngine);\n engine.getComponentAnimation(id).displayEffect(params, this);\n }\n \n /**\n * Check whether this client object represents an event.\n *\n * @returns `true` if the object type is `event`, otherwise `false`.\n */\n isEvent(): boolean {\n return this._type === 'event';\n }\n\n /**\n * Check whether this client object represents a player.\n *\n * @returns `true` if the object type is `player`, otherwise `false`.\n */\n isPlayer(): boolean {\n return this._type === 'player';\n }\n}\n"],"mappings":"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"}
|
package/dist/Game/Player.d.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RpgClientObject } from "./Object.js";
|
|
2
|
+
//#region src/Game/Player.ts
|
|
3
|
+
var RpgClientPlayer = class extends RpgClientObject {
|
|
4
|
+
constructor(..._args) {
|
|
5
|
+
super(..._args);
|
|
6
|
+
this._type = "player";
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { RpgClientPlayer };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=Player.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Player.js","names":[],"sources":["../../src/Game/Player.ts"],"sourcesContent":["import { RpgClientObject } from \"./Object\";\n\nexport class RpgClientPlayer extends RpgClientObject {\n _type = 'player'\n} "],"mappings":";;AAEA,IAAa,kBAAb,cAAqC,gBAAgB;;;eACzC"}
|