@rpgjs/client 5.0.0-alpha.2 → 5.0.0-alpha.20
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/Map.d.ts +7 -1
- package/dist/Gui/Gui.d.ts +128 -5
- package/dist/RpgClient.d.ts +217 -59
- package/dist/RpgClientEngine.d.ts +345 -6
- package/dist/Sound.d.ts +199 -0
- package/dist/components/animations/index.d.ts +4 -0
- package/dist/components/dynamics/parse-value.d.ts +1 -0
- package/dist/components/gui/index.d.ts +3 -3
- package/dist/components/index.d.ts +3 -1
- package/dist/components/prebuilt/index.d.ts +18 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/index10.js +149 -4
- package/dist/index10.js.map +1 -1
- package/dist/index11.js +21 -7
- package/dist/index11.js.map +1 -1
- package/dist/index12.js +6 -4
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +11 -14
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +8 -40
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +187 -180
- package/dist/index15.js.map +1 -1
- package/dist/index16.js +104 -7
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +82 -372
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +361 -26
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +46 -20
- package/dist/index19.js.map +1 -1
- package/dist/index2.js +683 -32
- package/dist/index2.js.map +1 -1
- package/dist/index20.js +5 -2417
- package/dist/index20.js.map +1 -1
- package/dist/index21.js +383 -97
- package/dist/index21.js.map +1 -1
- package/dist/index22.js +41 -104
- package/dist/index22.js.map +1 -1
- package/dist/index23.js +21 -67
- package/dist/index23.js.map +1 -1
- package/dist/index24.js +2632 -20
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +107 -34
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +69 -3
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +17 -318
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +24 -22
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +92 -8
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +68 -8
- package/dist/index3.js.map +1 -1
- package/dist/index30.js +37 -7
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +18 -168
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +3 -499
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +332 -9
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +24 -4400
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +6 -311
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +8 -88
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +182 -56
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +500 -16
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +10 -18
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +23 -5
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +7 -0
- package/dist/index40.js.map +1 -0
- package/dist/index41.js +3690 -0
- package/dist/index41.js.map +1 -0
- package/dist/index42.js +77 -0
- package/dist/index42.js.map +1 -0
- package/dist/index43.js +6 -0
- package/dist/index43.js.map +1 -0
- package/dist/index44.js +20 -0
- package/dist/index44.js.map +1 -0
- package/dist/index45.js +146 -0
- package/dist/index45.js.map +1 -0
- package/dist/index46.js +12 -0
- package/dist/index46.js.map +1 -0
- package/dist/index47.js +113 -0
- package/dist/index47.js.map +1 -0
- package/dist/index48.js +136 -0
- package/dist/index48.js.map +1 -0
- package/dist/index49.js +137 -0
- package/dist/index49.js.map +1 -0
- package/dist/index5.js +2 -1
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +112 -0
- package/dist/index50.js.map +1 -0
- package/dist/index51.js +141 -0
- package/dist/index51.js.map +1 -0
- package/dist/index52.js +9 -0
- package/dist/index52.js.map +1 -0
- package/dist/index53.js +54 -0
- package/dist/index53.js.map +1 -0
- package/dist/index6.js +1 -1
- package/dist/index6.js.map +1 -1
- package/dist/index7.js +11 -3
- package/dist/index7.js.map +1 -1
- package/dist/index8.js +68 -7
- package/dist/index8.js.map +1 -1
- package/dist/index9.js +230 -15
- package/dist/index9.js.map +1 -1
- package/dist/presets/animation.d.ts +31 -0
- package/dist/presets/faceset.d.ts +30 -0
- package/dist/presets/index.d.ts +103 -0
- package/dist/presets/lpc.d.ts +89 -0
- package/dist/services/loadMap.d.ts +123 -2
- package/dist/services/mmorpg.d.ts +9 -4
- package/dist/services/standalone.d.ts +51 -2
- package/package.json +22 -18
- package/src/Game/{EffectManager.ts → AnimationManager.ts} +3 -2
- package/src/Game/Map.ts +20 -2
- package/src/Game/Object.ts +163 -9
- package/src/Gui/Gui.ts +300 -17
- package/src/RpgClient.ts +222 -58
- package/src/RpgClientEngine.ts +804 -36
- 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 +165 -37
- 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 +73 -35
- package/src/components/gui/dialogbox/selection.ce +16 -1
- package/src/components/gui/index.ts +3 -4
- package/src/components/index.ts +5 -1
- package/src/components/prebuilt/hp-bar.ce +255 -0
- package/src/components/prebuilt/index.ts +21 -0
- package/src/components/scenes/draw-map.ce +6 -23
- package/src/components/scenes/event-layer.ce +9 -3
- package/src/core/setup.ts +2 -0
- package/src/index.ts +5 -2
- package/src/module.ts +72 -6
- package/src/presets/animation.ts +46 -0
- package/src/presets/faceset.ts +60 -0
- package/src/presets/index.ts +7 -1
- package/src/presets/lpc.ts +108 -0
- package/src/services/loadMap.ts +132 -3
- package/src/services/mmorpg.ts +27 -5
- package/src/services/standalone.ts +68 -6
- package/tsconfig.json +1 -1
- package/vite.config.ts +1 -1
- package/dist/Game/EffectManager.d.ts +0 -5
- package/dist/components/effects/index.d.ts +0 -4
- package/src/components/scenes/element-map.ce +0 -23
- /package/src/components/{effects → animations}/hit.ce +0 -0
package/dist/index35.js
CHANGED
|
@@ -1,316 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RpgClientObject } from './index45.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
__name(this, "ArraySubject");
|
|
3
|
+
class RpgClientPlayer extends RpgClientObject {
|
|
4
|
+
constructor() {
|
|
5
|
+
super(...arguments);
|
|
6
|
+
this.type = "player";
|
|
8
7
|
}
|
|
9
|
-
_items = [];
|
|
10
|
-
constructor(items = []) {
|
|
11
|
-
super({
|
|
12
|
-
type: "init",
|
|
13
|
-
items
|
|
14
|
-
});
|
|
15
|
-
this.createProxy(items);
|
|
16
|
-
}
|
|
17
|
-
createProxy(items) {
|
|
18
|
-
this._items = new Proxy(items, {
|
|
19
|
-
get: /* @__PURE__ */ __name((target, prop, receiver) => {
|
|
20
|
-
const origMethod = target[prop];
|
|
21
|
-
if (typeof origMethod === "function") {
|
|
22
|
-
return (...args) => {
|
|
23
|
-
let changeType = "update";
|
|
24
|
-
let index = void 0;
|
|
25
|
-
let isMutateFn = false;
|
|
26
|
-
let itemsToEmit = [];
|
|
27
|
-
let changeSplice = true;
|
|
28
|
-
switch (prop) {
|
|
29
|
-
case "push":
|
|
30
|
-
index = target.length;
|
|
31
|
-
changeType = "add";
|
|
32
|
-
isMutateFn = true;
|
|
33
|
-
break;
|
|
34
|
-
case "pop":
|
|
35
|
-
index = target.length - 1;
|
|
36
|
-
changeType = "remove";
|
|
37
|
-
isMutateFn = true;
|
|
38
|
-
break;
|
|
39
|
-
case "unshift":
|
|
40
|
-
index = 0;
|
|
41
|
-
changeType = "add";
|
|
42
|
-
isMutateFn = true;
|
|
43
|
-
break;
|
|
44
|
-
case "shift":
|
|
45
|
-
index = 0;
|
|
46
|
-
changeType = "remove";
|
|
47
|
-
isMutateFn = true;
|
|
48
|
-
break;
|
|
49
|
-
case "splice":
|
|
50
|
-
index = args[0];
|
|
51
|
-
const deleteCount = args[1];
|
|
52
|
-
const newItems = args.slice(2);
|
|
53
|
-
itemsToEmit = newItems;
|
|
54
|
-
if (deleteCount > 0 && newItems.length === 0) {
|
|
55
|
-
changeType = "remove";
|
|
56
|
-
} else if (deleteCount === 0 && newItems.length > 0) {
|
|
57
|
-
changeType = "add";
|
|
58
|
-
} else if (deleteCount === 0 && newItems.length === 0) {
|
|
59
|
-
changeSplice = false;
|
|
60
|
-
} else {
|
|
61
|
-
changeType = "update";
|
|
62
|
-
}
|
|
63
|
-
isMutateFn = true;
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
const result = origMethod.apply(target, args);
|
|
67
|
-
if (isMutateFn && changeSplice) {
|
|
68
|
-
if (prop === "splice") {
|
|
69
|
-
this.next({
|
|
70
|
-
type: changeType,
|
|
71
|
-
index,
|
|
72
|
-
items: itemsToEmit
|
|
73
|
-
});
|
|
74
|
-
} else {
|
|
75
|
-
this.next({
|
|
76
|
-
type: changeType,
|
|
77
|
-
index,
|
|
78
|
-
items: args
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return result;
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
return Reflect.get(target, prop, receiver);
|
|
86
|
-
}, "get"),
|
|
87
|
-
set: /* @__PURE__ */ __name((target, prop, value) => {
|
|
88
|
-
const index = !isNaN(Number(prop)) ? Number(prop) : void 0;
|
|
89
|
-
target[prop] = value;
|
|
90
|
-
this.next({
|
|
91
|
-
type: "update",
|
|
92
|
-
index,
|
|
93
|
-
items: [
|
|
94
|
-
value
|
|
95
|
-
]
|
|
96
|
-
});
|
|
97
|
-
return true;
|
|
98
|
-
}, "set")
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
get items() {
|
|
102
|
-
return this._items;
|
|
103
|
-
}
|
|
104
|
-
set items(newItems) {
|
|
105
|
-
this.createProxy(newItems);
|
|
106
|
-
this.next({
|
|
107
|
-
type: "reset",
|
|
108
|
-
items: newItems
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
var ObjectSubject = class extends BehaviorSubject {
|
|
113
|
-
static {
|
|
114
|
-
__name(this, "ObjectSubject");
|
|
115
|
-
}
|
|
116
|
-
_obj;
|
|
117
|
-
constructor(obj = {}) {
|
|
118
|
-
super({
|
|
119
|
-
type: "init",
|
|
120
|
-
value: obj
|
|
121
|
-
});
|
|
122
|
-
this.createProxy(obj);
|
|
123
|
-
}
|
|
124
|
-
createProxy(obj) {
|
|
125
|
-
this._obj = new Proxy(obj, {
|
|
126
|
-
get: /* @__PURE__ */ __name((target, prop, receiver) => {
|
|
127
|
-
return Reflect.get(target, prop, receiver);
|
|
128
|
-
}, "get"),
|
|
129
|
-
set: /* @__PURE__ */ __name((target, prop, value, receiver) => {
|
|
130
|
-
const key = prop;
|
|
131
|
-
const changeType = key in target ? "update" : "add";
|
|
132
|
-
target[key] = value;
|
|
133
|
-
this.next({
|
|
134
|
-
type: changeType,
|
|
135
|
-
key,
|
|
136
|
-
value
|
|
137
|
-
});
|
|
138
|
-
return true;
|
|
139
|
-
}, "set"),
|
|
140
|
-
deleteProperty: /* @__PURE__ */ __name((target, prop) => {
|
|
141
|
-
const key = prop;
|
|
142
|
-
if (key in target) {
|
|
143
|
-
const value = target[key];
|
|
144
|
-
delete target[key];
|
|
145
|
-
this.next({
|
|
146
|
-
type: "remove",
|
|
147
|
-
key,
|
|
148
|
-
value
|
|
149
|
-
});
|
|
150
|
-
return true;
|
|
151
|
-
}
|
|
152
|
-
return false;
|
|
153
|
-
}, "deleteProperty")
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
get obj() {
|
|
157
|
-
return this._obj;
|
|
158
|
-
}
|
|
159
|
-
set obj(newObj) {
|
|
160
|
-
this.createProxy(newObj);
|
|
161
|
-
this.next({
|
|
162
|
-
type: "reset",
|
|
163
|
-
value: newObj
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
var getGlobalReactiveStore = /* @__PURE__ */ __name(() => {
|
|
168
|
-
const globalKey = "__REACTIVE_STORE__";
|
|
169
|
-
if (typeof globalThis !== "undefined") {
|
|
170
|
-
if (!globalThis[globalKey]) {
|
|
171
|
-
globalThis[globalKey] = {
|
|
172
|
-
currentDependencyTracker: null,
|
|
173
|
-
currentSubscriptionsTracker: null
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
return globalThis[globalKey];
|
|
177
|
-
}
|
|
178
|
-
let globalObj;
|
|
179
|
-
if (typeof window !== "undefined") {
|
|
180
|
-
globalObj = window;
|
|
181
|
-
} else if (typeof process !== "undefined" && process.versions && process.versions.node) {
|
|
182
|
-
globalObj = Function("return this")();
|
|
183
|
-
} else if (typeof self !== "undefined") {
|
|
184
|
-
globalObj = self;
|
|
185
|
-
} else {
|
|
186
|
-
console.warn("Unable to find global object, using local instance");
|
|
187
|
-
return {
|
|
188
|
-
currentDependencyTracker: null,
|
|
189
|
-
currentSubscriptionsTracker: null
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
if (!globalObj[globalKey]) {
|
|
193
|
-
globalObj[globalKey] = {
|
|
194
|
-
currentDependencyTracker: null,
|
|
195
|
-
currentSubscriptionsTracker: null
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
return globalObj[globalKey];
|
|
199
|
-
}, "getGlobalReactiveStore");
|
|
200
|
-
var reactiveStore = getGlobalReactiveStore();
|
|
201
|
-
var trackDependency = /* @__PURE__ */ __name((signal2) => {
|
|
202
|
-
if (reactiveStore.currentDependencyTracker) {
|
|
203
|
-
reactiveStore.currentDependencyTracker(signal2);
|
|
204
|
-
}
|
|
205
|
-
}, "trackDependency");
|
|
206
|
-
function signal(defaultValue) {
|
|
207
|
-
let subject;
|
|
208
|
-
if (Array.isArray(defaultValue)) {
|
|
209
|
-
subject = new ArraySubject(defaultValue);
|
|
210
|
-
} else if (typeof defaultValue === "object" && defaultValue !== null) {
|
|
211
|
-
subject = new ObjectSubject(defaultValue);
|
|
212
|
-
} else {
|
|
213
|
-
subject = new BehaviorSubject(defaultValue);
|
|
214
|
-
}
|
|
215
|
-
const getValue = /* @__PURE__ */ __name(() => {
|
|
216
|
-
if (subject instanceof ArraySubject) {
|
|
217
|
-
return subject.items;
|
|
218
|
-
} else if (subject instanceof ObjectSubject) {
|
|
219
|
-
return subject.obj;
|
|
220
|
-
}
|
|
221
|
-
return subject.value;
|
|
222
|
-
}, "getValue");
|
|
223
|
-
const fn = /* @__PURE__ */ __name(function() {
|
|
224
|
-
trackDependency(fn);
|
|
225
|
-
return getValue();
|
|
226
|
-
}, "fn");
|
|
227
|
-
fn.set = (value) => {
|
|
228
|
-
if (subject instanceof ArraySubject) {
|
|
229
|
-
subject.items = value;
|
|
230
|
-
} else if (subject instanceof ObjectSubject) {
|
|
231
|
-
subject.obj = value;
|
|
232
|
-
} else {
|
|
233
|
-
subject.next(value);
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
fn._isFrozen = false;
|
|
237
|
-
fn.freeze = () => {
|
|
238
|
-
fn._isFrozen = true;
|
|
239
|
-
};
|
|
240
|
-
fn.unfreeze = () => {
|
|
241
|
-
fn._isFrozen = false;
|
|
242
|
-
if (subject instanceof ArraySubject) {
|
|
243
|
-
subject.next({
|
|
244
|
-
type: "init",
|
|
245
|
-
items: subject.items
|
|
246
|
-
});
|
|
247
|
-
} else if (subject instanceof ObjectSubject) {
|
|
248
|
-
subject.next({
|
|
249
|
-
type: "init",
|
|
250
|
-
value: subject.obj
|
|
251
|
-
});
|
|
252
|
-
} else {
|
|
253
|
-
subject.next(subject.value);
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
fn.mutate = (mutateFn) => {
|
|
257
|
-
const value = getValue();
|
|
258
|
-
mutateFn(value);
|
|
259
|
-
};
|
|
260
|
-
fn.update = (updateFn) => {
|
|
261
|
-
const updatedValue = updateFn(getValue());
|
|
262
|
-
fn.set(updatedValue);
|
|
263
|
-
};
|
|
264
|
-
fn.observable = subject.asObservable().pipe(filter(() => !fn._isFrozen));
|
|
265
|
-
fn._subject = subject;
|
|
266
|
-
return fn;
|
|
267
|
-
}
|
|
268
|
-
__name(signal, "signal");
|
|
269
|
-
function isSignal(value) {
|
|
270
|
-
return !!(value && value.observable);
|
|
271
|
-
}
|
|
272
|
-
__name(isSignal, "isSignal");
|
|
273
|
-
function isComputed(value) {
|
|
274
|
-
return isSignal(value) && !!value.dependencies;
|
|
275
|
-
}
|
|
276
|
-
__name(isComputed, "isComputed");
|
|
277
|
-
function computed(computeFunction, disposableFn) {
|
|
278
|
-
const dependencies = /* @__PURE__ */ new Set();
|
|
279
|
-
let init = true;
|
|
280
|
-
let lastComputedValue;
|
|
281
|
-
const previousTracker = reactiveStore.currentDependencyTracker;
|
|
282
|
-
reactiveStore.currentDependencyTracker = (signal2) => {
|
|
283
|
-
dependencies.add(signal2);
|
|
284
|
-
};
|
|
285
|
-
lastComputedValue = computeFunction();
|
|
286
|
-
if (computeFunction["isEffect"]) {
|
|
287
|
-
disposableFn = lastComputedValue;
|
|
288
|
-
}
|
|
289
|
-
reactiveStore.currentDependencyTracker = previousTracker;
|
|
290
|
-
const computedObservable = combineLatest([
|
|
291
|
-
...dependencies
|
|
292
|
-
].map((signal2) => signal2.observable)).pipe(filter(() => !init), map(() => computeFunction()), finalize(() => disposableFn?.()));
|
|
293
|
-
const fn = /* @__PURE__ */ __name(function() {
|
|
294
|
-
trackDependency(fn);
|
|
295
|
-
return lastComputedValue;
|
|
296
|
-
}, "fn");
|
|
297
|
-
fn.observable = computedObservable;
|
|
298
|
-
fn.subscription = computedObservable.subscribe((value) => {
|
|
299
|
-
lastComputedValue = value;
|
|
300
|
-
});
|
|
301
|
-
fn.dependencies = dependencies;
|
|
302
|
-
reactiveStore.currentSubscriptionsTracker?.(fn.subscription);
|
|
303
|
-
init = false;
|
|
304
|
-
return fn;
|
|
305
|
-
}
|
|
306
|
-
__name(computed, "computed");
|
|
307
|
-
|
|
308
|
-
// src/effect.ts
|
|
309
|
-
function effect(fn) {
|
|
310
|
-
fn["isEffect"] = true;
|
|
311
|
-
return computed(fn);
|
|
312
8
|
}
|
|
313
|
-
__name(effect, "effect");
|
|
314
9
|
|
|
315
|
-
export {
|
|
10
|
+
export { RpgClientPlayer };
|
|
316
11
|
//# sourceMappingURL=index35.js.map
|
package/dist/index35.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index35.js","sources":["../../../node_modules/.pnpm/@signe+reactive@2.3.1/node_modules/@signe/reactive/dist/index.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/ArraySubject.ts\nimport { BehaviorSubject } from \"rxjs\";\nvar ArraySubject = class extends BehaviorSubject {\n static {\n __name(this, \"ArraySubject\");\n }\n _items = [];\n constructor(items = []) {\n super({\n type: \"init\",\n items\n });\n this.createProxy(items);\n }\n createProxy(items) {\n this._items = new Proxy(items, {\n get: /* @__PURE__ */ __name((target, prop, receiver) => {\n const origMethod = target[prop];\n if (typeof origMethod === \"function\") {\n return (...args) => {\n let changeType = \"update\";\n let index = void 0;\n let isMutateFn = false;\n let itemsToEmit = [];\n let changeSplice = true;\n switch (prop) {\n case \"push\":\n index = target.length;\n changeType = \"add\";\n isMutateFn = true;\n break;\n case \"pop\":\n index = target.length - 1;\n changeType = \"remove\";\n isMutateFn = true;\n break;\n case \"unshift\":\n index = 0;\n changeType = \"add\";\n isMutateFn = true;\n break;\n case \"shift\":\n index = 0;\n changeType = \"remove\";\n isMutateFn = true;\n break;\n case \"splice\":\n index = args[0];\n const deleteCount = args[1];\n const newItems = args.slice(2);\n itemsToEmit = newItems;\n if (deleteCount > 0 && newItems.length === 0) {\n changeType = \"remove\";\n } else if (deleteCount === 0 && newItems.length > 0) {\n changeType = \"add\";\n } else if (deleteCount === 0 && newItems.length === 0) {\n changeSplice = false;\n } else {\n changeType = \"update\";\n }\n isMutateFn = true;\n break;\n }\n const result = origMethod.apply(target, args);\n if (isMutateFn && changeSplice) {\n if (prop === \"splice\") {\n this.next({\n type: changeType,\n index,\n items: itemsToEmit\n });\n } else {\n this.next({\n type: changeType,\n index,\n items: args\n });\n }\n }\n return result;\n };\n }\n return Reflect.get(target, prop, receiver);\n }, \"get\"),\n set: /* @__PURE__ */ __name((target, prop, value) => {\n const index = !isNaN(Number(prop)) ? Number(prop) : void 0;\n target[prop] = value;\n this.next({\n type: \"update\",\n index,\n items: [\n value\n ]\n });\n return true;\n }, \"set\")\n });\n }\n get items() {\n return this._items;\n }\n set items(newItems) {\n this.createProxy(newItems);\n this.next({\n type: \"reset\",\n items: newItems\n });\n }\n};\nvar isArraySubject = /* @__PURE__ */ __name((value) => {\n return \"_items\" in value;\n}, \"isArraySubject\");\n\n// src/ObjectSubject.ts\nimport { BehaviorSubject as BehaviorSubject2 } from \"rxjs\";\nvar ObjectSubject = class extends BehaviorSubject2 {\n static {\n __name(this, \"ObjectSubject\");\n }\n _obj;\n constructor(obj = {}) {\n super({\n type: \"init\",\n value: obj\n });\n this.createProxy(obj);\n }\n createProxy(obj) {\n this._obj = new Proxy(obj, {\n get: /* @__PURE__ */ __name((target, prop, receiver) => {\n return Reflect.get(target, prop, receiver);\n }, \"get\"),\n set: /* @__PURE__ */ __name((target, prop, value, receiver) => {\n const key = prop;\n const changeType = key in target ? \"update\" : \"add\";\n target[key] = value;\n this.next({\n type: changeType,\n key,\n value\n });\n return true;\n }, \"set\"),\n deleteProperty: /* @__PURE__ */ __name((target, prop) => {\n const key = prop;\n if (key in target) {\n const value = target[key];\n delete target[key];\n this.next({\n type: \"remove\",\n key,\n value\n });\n return true;\n }\n return false;\n }, \"deleteProperty\")\n });\n }\n get obj() {\n return this._obj;\n }\n set obj(newObj) {\n this.createProxy(newObj);\n this.next({\n type: \"reset\",\n value: newObj\n });\n }\n};\nvar isObjectSubject = /* @__PURE__ */ __name((value) => {\n return \"_obj\" in value;\n}, \"isObjectSubject\");\n\n// src/signal.ts\nimport { BehaviorSubject as BehaviorSubject3, combineLatest, filter, finalize, map } from \"rxjs\";\nvar getGlobalReactiveStore = /* @__PURE__ */ __name(() => {\n const globalKey = \"__REACTIVE_STORE__\";\n if (typeof globalThis !== \"undefined\") {\n if (!globalThis[globalKey]) {\n globalThis[globalKey] = {\n currentDependencyTracker: null,\n currentSubscriptionsTracker: null\n };\n }\n return globalThis[globalKey];\n }\n let globalObj;\n if (typeof window !== \"undefined\") {\n globalObj = window;\n } else if (typeof process !== \"undefined\" && process.versions && process.versions.node) {\n globalObj = Function(\"return this\")();\n } else if (typeof self !== \"undefined\") {\n globalObj = self;\n } else {\n console.warn(\"Unable to find global object, using local instance\");\n return {\n currentDependencyTracker: null,\n currentSubscriptionsTracker: null\n };\n }\n if (!globalObj[globalKey]) {\n globalObj[globalKey] = {\n currentDependencyTracker: null,\n currentSubscriptionsTracker: null\n };\n }\n return globalObj[globalKey];\n}, \"getGlobalReactiveStore\");\nvar reactiveStore = getGlobalReactiveStore();\nvar trackDependency = /* @__PURE__ */ __name((signal2) => {\n if (reactiveStore.currentDependencyTracker) {\n reactiveStore.currentDependencyTracker(signal2);\n }\n}, \"trackDependency\");\nfunction signal(defaultValue) {\n let subject;\n if (Array.isArray(defaultValue)) {\n subject = new ArraySubject(defaultValue);\n } else if (typeof defaultValue === \"object\" && defaultValue !== null) {\n subject = new ObjectSubject(defaultValue);\n } else {\n subject = new BehaviorSubject3(defaultValue);\n }\n const getValue = /* @__PURE__ */ __name(() => {\n if (subject instanceof ArraySubject) {\n return subject.items;\n } else if (subject instanceof ObjectSubject) {\n return subject.obj;\n }\n return subject.value;\n }, \"getValue\");\n const fn = /* @__PURE__ */ __name(function() {\n trackDependency(fn);\n return getValue();\n }, \"fn\");\n fn.set = (value) => {\n if (subject instanceof ArraySubject) {\n subject.items = value;\n } else if (subject instanceof ObjectSubject) {\n subject.obj = value;\n } else {\n subject.next(value);\n }\n };\n fn._isFrozen = false;\n fn.freeze = () => {\n fn._isFrozen = true;\n };\n fn.unfreeze = () => {\n fn._isFrozen = false;\n if (subject instanceof ArraySubject) {\n subject.next({\n type: \"init\",\n items: subject.items\n });\n } else if (subject instanceof ObjectSubject) {\n subject.next({\n type: \"init\",\n value: subject.obj\n });\n } else {\n subject.next(subject.value);\n }\n };\n fn.mutate = (mutateFn) => {\n const value = getValue();\n mutateFn(value);\n };\n fn.update = (updateFn) => {\n const updatedValue = updateFn(getValue());\n fn.set(updatedValue);\n };\n fn.observable = subject.asObservable().pipe(filter(() => !fn._isFrozen));\n fn._subject = subject;\n return fn;\n}\n__name(signal, \"signal\");\nfunction isSignal(value) {\n return !!(value && value.observable);\n}\n__name(isSignal, \"isSignal\");\nfunction isComputed(value) {\n return isSignal(value) && !!value.dependencies;\n}\n__name(isComputed, \"isComputed\");\nfunction computed(computeFunction, disposableFn) {\n const dependencies = /* @__PURE__ */ new Set();\n let init = true;\n let lastComputedValue;\n const previousTracker = reactiveStore.currentDependencyTracker;\n reactiveStore.currentDependencyTracker = (signal2) => {\n dependencies.add(signal2);\n };\n lastComputedValue = computeFunction();\n if (computeFunction[\"isEffect\"]) {\n disposableFn = lastComputedValue;\n }\n reactiveStore.currentDependencyTracker = previousTracker;\n const computedObservable = combineLatest([\n ...dependencies\n ].map((signal2) => signal2.observable)).pipe(filter(() => !init), map(() => computeFunction()), finalize(() => disposableFn?.()));\n const fn = /* @__PURE__ */ __name(function() {\n trackDependency(fn);\n return lastComputedValue;\n }, \"fn\");\n fn.observable = computedObservable;\n fn.subscription = computedObservable.subscribe((value) => {\n lastComputedValue = value;\n });\n fn.dependencies = dependencies;\n reactiveStore.currentSubscriptionsTracker?.(fn.subscription);\n init = false;\n return fn;\n}\n__name(computed, \"computed\");\n\n// src/effect.ts\nfunction effect(fn) {\n fn[\"isEffect\"] = true;\n return computed(fn);\n}\n__name(effect, \"effect\");\nexport {\n ArraySubject,\n ObjectSubject,\n computed,\n effect,\n isArraySubject,\n isComputed,\n isObjectSubject,\n isSignal,\n signal\n};\n//# sourceMappingURL=index.js.map"],"names":["BehaviorSubject2","BehaviorSubject3"],"mappings":";;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc;AACrC,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,KAAK,KAAK,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;AAIrF,IAAC,YAAY,GAAG,cAAc,eAAe,CAAC;AACjD,EAAE;AACF,IAAI,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC;AAChC;AACA,EAAE,MAAM,GAAG,EAAE;AACb,EAAE,WAAW,CAAC,KAAK,GAAG,EAAE,EAAE;AAC1B,IAAI,KAAK,CAAC;AACV,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM;AACN,KAAK,CAAC;AACN,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC3B;AACA,EAAE,WAAW,CAAC,KAAK,EAAE;AACrB,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,KAAK,CAAC,KAAK,EAAE;AACnC,MAAM,GAAG,kBAAkB,MAAM,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,KAAK;AAC9D,QAAQ,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;AACvC,QAAQ,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;AAC9C,UAAU,OAAO,CAAC,GAAG,IAAI,KAAK;AAC9B,YAAY,IAAI,UAAU,GAAG,QAAQ;AACrC,YAAY,IAAI,KAAK,GAAG,MAAM;AAC9B,YAAY,IAAI,UAAU,GAAG,KAAK;AAClC,YAAY,IAAI,WAAW,GAAG,EAAE;AAChC,YAAY,IAAI,YAAY,GAAG,IAAI;AACnC,YAAY,QAAQ,IAAI;AACxB,cAAc,KAAK,MAAM;AACzB,gBAAgB,KAAK,GAAG,MAAM,CA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E,CAAC;AACrB;AACA,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index35.js","sources":["../src/Game/Player.ts"],"sourcesContent":["import { RpgClientObject } from \"./Object\";\n\nexport class RpgClientPlayer extends RpgClientObject {\n type = 'player'\n} "],"names":[],"mappings":";;AAEO,MAAM,wBAAwB,eAAA,CAAgB;AAAA,EAA9C,WAAA,GAAA;AAAA,IAAA,KAAA,CAAA,GAAA,SAAA,CAAA;AACH,IAAA,IAAA,CAAA,IAAA,GAAO,QAAA;AAAA,EAAA;AACX;;;;"}
|
package/dist/index36.js
CHANGED
|
@@ -1,91 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Particle } from '@canvasengine/presets';
|
|
3
|
-
import { RpgClientEngine } from './index2.js';
|
|
4
|
-
import { inject } from './index6.js';
|
|
5
|
-
import { Direction } from '@rpgjs/common';
|
|
1
|
+
import { RpgClientObject } from './index45.js';
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var x = object.x;
|
|
14
|
-
var y = object.y;
|
|
15
|
-
var tint = object.tint;
|
|
16
|
-
var direction = object.direction;
|
|
17
|
-
var animationName = object.animationName;
|
|
18
|
-
var emitParticleTrigger = object.emitParticleTrigger;
|
|
19
|
-
var particleSettings = client.particleSettings;
|
|
20
|
-
var particleName = object.particleName;
|
|
21
|
-
var graphics = object.graphics;
|
|
22
|
-
var hitbox = object.hitbox;
|
|
23
|
-
var widthShadow = 10;
|
|
24
|
-
computed(function () { return ({
|
|
25
|
-
x: hitbox().w / 2,
|
|
26
|
-
y: hitbox().h - (hitbox().h / 2),
|
|
27
|
-
width: hitbox().w + widthShadow,
|
|
28
|
-
height: hitbox().h,
|
|
29
|
-
}); });
|
|
30
|
-
var canControls = function () { return isMe() && object.canMove(); };
|
|
31
|
-
var keyboardControls = client.globalConfig.keyboardControls;
|
|
32
|
-
var controls = signal({
|
|
33
|
-
down: {
|
|
34
|
-
repeat: true,
|
|
35
|
-
bind: keyboardControls.down,
|
|
36
|
-
keyDown: function () {
|
|
37
|
-
if (canControls())
|
|
38
|
-
client.processInput({ input: Direction.Down });
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
up: {
|
|
42
|
-
repeat: true,
|
|
43
|
-
bind: keyboardControls.up,
|
|
44
|
-
keyDown: function () {
|
|
45
|
-
if (canControls())
|
|
46
|
-
client.processInput({ input: Direction.Up });
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
left: {
|
|
50
|
-
repeat: true,
|
|
51
|
-
bind: keyboardControls.left,
|
|
52
|
-
keyDown: function () {
|
|
53
|
-
if (canControls())
|
|
54
|
-
client.processInput({ input: Direction.Left });
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
right: {
|
|
58
|
-
repeat: true,
|
|
59
|
-
bind: keyboardControls.right,
|
|
60
|
-
keyDown: function () {
|
|
61
|
-
if (canControls())
|
|
62
|
-
client.processInput({ input: Direction.Right });
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
action: {
|
|
66
|
-
bind: keyboardControls.action,
|
|
67
|
-
keyDown: function () {
|
|
68
|
-
if (canControls()) {
|
|
69
|
-
client.processAction({ action: 'action' });
|
|
70
|
-
// particleName.set('hit')
|
|
71
|
-
// emitParticleTrigger.start()
|
|
72
|
-
// object.flash('red')
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
});
|
|
77
|
-
var sheet = function (graphicId) {
|
|
78
|
-
return {
|
|
79
|
-
definition: spritesheets.get(graphicId),
|
|
80
|
-
playing: animationName,
|
|
81
|
-
params: {
|
|
82
|
-
direction: direction
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
let $this = h(Container, { x, y, zIndex: y, viewportFollow: isMe, controls }, [h(Particle, { emit: emitParticleTrigger, settings: particleSettings, zIndex: 1000, name: particleName }), loop(graphics, graphicId => h(Sprite, { sheet: sheet(graphicId), direction, tint }))]);
|
|
87
|
-
return $this
|
|
88
|
-
}
|
|
3
|
+
class RpgClientEvent extends RpgClientObject {
|
|
4
|
+
constructor() {
|
|
5
|
+
super(...arguments);
|
|
6
|
+
this.type = "event";
|
|
7
|
+
}
|
|
8
|
+
}
|
|
89
9
|
|
|
90
|
-
export {
|
|
10
|
+
export { RpgClientEvent };
|
|
91
11
|
//# sourceMappingURL=index36.js.map
|
package/dist/index36.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index36.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index36.js","sources":["../src/Game/Event.ts"],"sourcesContent":["import { RpgClientObject } from \"./Object\"; \n\nexport class RpgClientEvent extends RpgClientObject {\n type = 'event'\n} "],"names":[],"mappings":";;AAEO,MAAM,uBAAuB,eAAA,CAAgB;AAAA,EAA7C,WAAA,GAAA;AAAA,IAAA,KAAA,CAAA,GAAA,SAAA,CAAA;AACH,IAAA,IAAA,CAAA,IAAA,GAAO,OAAA;AAAA,EAAA;AACX;;;;"}
|