@doodle-engine/core 0.0.21 → 0.0.22
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/CHANGELOG.md +6 -0
- package/dist/assets/loader.d.ts.map +1 -1
- package/dist/assets/manifest.d.ts +3 -3
- package/dist/assets/manifest.d.ts.map +1 -1
- package/dist/conditions/index.d.ts +2 -2
- package/dist/conditions/index.d.ts.map +1 -1
- package/dist/core.js +91 -23
- package/dist/devtools.d.ts +1 -1
- package/dist/devtools.d.ts.map +1 -1
- package/dist/effects/index.d.ts +2 -2
- package/dist/effects/index.d.ts.map +1 -1
- package/dist/engine/index.d.ts +5 -5
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/index.d.ts +19 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/localization/index.d.ts +1 -1
- package/dist/localization/index.d.ts.map +1 -1
- package/dist/parser/index.d.ts +3 -3
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/snapshot/index.d.ts +3 -3
- package/dist/snapshot/index.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/assets.d.ts +2 -2
- package/dist/types/assets.d.ts.map +1 -1
- package/dist/types/conditions.d.ts +15 -15
- package/dist/types/conditions.d.ts.map +1 -1
- package/dist/types/effects.d.ts +27 -27
- package/dist/types/effects.d.ts.map +1 -1
- package/dist/types/entities.d.ts +2 -2
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/types/registry.d.ts +1 -1
- package/dist/types/registry.d.ts.map +1 -1
- package/dist/types/save.d.ts +1 -1
- package/dist/types/save.d.ts.map +1 -1
- package/dist/types/snapshot.d.ts +1 -1
- package/dist/types/snapshot.d.ts.map +1 -1
- package/dist/types/state.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/assets/loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;GAEG;AACH,MAAM,WAAW,WAAW;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/assets/loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,oDAAoD;IACpD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE5C,8CAA8C;IAC9C,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC,kDAAkD;IAClD,QAAQ,CACJ,KAAK,EAAE,MAAM,EAAE,EACf,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,GACtE,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB,iFAAiF;IACjF,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAE7B,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAEhC,8BAA8B;IAC9B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,MAAY,GAAG,WAAW,CAyGpE"}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Asset path extraction for manifest generation.
|
|
3
3
|
* Used by CLI at build time.
|
|
4
4
|
*/
|
|
5
|
-
import type { ContentRegistry } from
|
|
6
|
-
import type { GameConfig } from
|
|
5
|
+
import type { ContentRegistry } from '../types/registry';
|
|
6
|
+
import type { GameConfig } from '../types/entities';
|
|
7
7
|
/**
|
|
8
8
|
* Determine asset type from file extension.
|
|
9
9
|
*/
|
|
10
|
-
export declare function getAssetType(path: string):
|
|
10
|
+
export declare function getAssetType(path: string): 'image' | 'audio' | 'video';
|
|
11
11
|
/**
|
|
12
12
|
* Extract all asset paths from a content registry and game config.
|
|
13
13
|
* Shell assets come first (tier 1); game assets are tier 2.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/assets/manifest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAUtE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/assets/manifest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAUtE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC7B,QAAQ,EAAE,eAAe,EACzB,MAAM,EAAE,UAAU,GACnB;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAsFrC"}
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*
|
|
10
10
|
* All evaluators are pure functions with no side effects.
|
|
11
11
|
*/
|
|
12
|
-
import type { Condition } from
|
|
13
|
-
import type { GameState } from
|
|
12
|
+
import type { Condition } from '../types/conditions';
|
|
13
|
+
import type { GameState } from '../types/state';
|
|
14
14
|
/**
|
|
15
15
|
* Evaluate a single condition against the current game state.
|
|
16
16
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conditions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conditions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC7B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,GACjB,OAAO,CA4FT;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAC9B,UAAU,EAAE,SAAS,EAAE,EACvB,KAAK,EAAE,SAAS,GACjB,OAAO,CAET"}
|
package/dist/core.js
CHANGED
|
@@ -56,12 +56,16 @@ function Pe(n = "1") {
|
|
|
56
56
|
}
|
|
57
57
|
const c = await fetch(i);
|
|
58
58
|
if (!c.ok)
|
|
59
|
-
throw new Error(
|
|
59
|
+
throw new Error(
|
|
60
|
+
`Failed to load asset: ${i} (${c.status})`
|
|
61
|
+
);
|
|
60
62
|
await s.put(i, c);
|
|
61
63
|
} else {
|
|
62
64
|
const l = await fetch(i);
|
|
63
65
|
if (!l.ok)
|
|
64
|
-
throw new Error(
|
|
66
|
+
throw new Error(
|
|
67
|
+
`Failed to load asset: ${i} (${l.status})`
|
|
68
|
+
);
|
|
65
69
|
}
|
|
66
70
|
t.add(i);
|
|
67
71
|
}
|
|
@@ -109,7 +113,11 @@ function R(n, e) {
|
|
|
109
113
|
case "hasItem":
|
|
110
114
|
return $(n.itemId, e);
|
|
111
115
|
case "variableEquals":
|
|
112
|
-
return F(
|
|
116
|
+
return F(
|
|
117
|
+
n.variable,
|
|
118
|
+
n.value,
|
|
119
|
+
e
|
|
120
|
+
);
|
|
113
121
|
case "variableGreaterThan":
|
|
114
122
|
return q(
|
|
115
123
|
n.variable,
|
|
@@ -125,7 +133,11 @@ function R(n, e) {
|
|
|
125
133
|
case "atLocation":
|
|
126
134
|
return M(n.locationId, e);
|
|
127
135
|
case "questAtStage":
|
|
128
|
-
return W(
|
|
136
|
+
return W(
|
|
137
|
+
n.questId,
|
|
138
|
+
n.stageId,
|
|
139
|
+
e
|
|
140
|
+
);
|
|
129
141
|
case "characterAt":
|
|
130
142
|
return j(
|
|
131
143
|
n.characterId,
|
|
@@ -147,11 +159,23 @@ function R(n, e) {
|
|
|
147
159
|
e
|
|
148
160
|
);
|
|
149
161
|
case "timeIs":
|
|
150
|
-
return J(
|
|
162
|
+
return J(
|
|
163
|
+
n.startHour,
|
|
164
|
+
n.endHour,
|
|
165
|
+
e
|
|
166
|
+
);
|
|
151
167
|
case "itemAt":
|
|
152
|
-
return U(
|
|
168
|
+
return U(
|
|
169
|
+
n.itemId,
|
|
170
|
+
n.locationId,
|
|
171
|
+
e
|
|
172
|
+
);
|
|
153
173
|
case "roll":
|
|
154
|
-
return B(
|
|
174
|
+
return B(
|
|
175
|
+
n.min,
|
|
176
|
+
n.max,
|
|
177
|
+
n.threshold
|
|
178
|
+
);
|
|
155
179
|
default:
|
|
156
180
|
return !1;
|
|
157
181
|
}
|
|
@@ -250,9 +274,17 @@ function _(n, e) {
|
|
|
250
274
|
case "removeFromParty":
|
|
251
275
|
return ue(n.characterId, e);
|
|
252
276
|
case "setRelationship":
|
|
253
|
-
return de(
|
|
277
|
+
return de(
|
|
278
|
+
n.characterId,
|
|
279
|
+
n.value,
|
|
280
|
+
e
|
|
281
|
+
);
|
|
254
282
|
case "addRelationship":
|
|
255
|
-
return he(
|
|
283
|
+
return he(
|
|
284
|
+
n.characterId,
|
|
285
|
+
n.value,
|
|
286
|
+
e
|
|
287
|
+
);
|
|
256
288
|
case "setCharacterStat":
|
|
257
289
|
return pe(
|
|
258
290
|
n.characterId,
|
|
@@ -563,7 +595,15 @@ function Ie(n, e) {
|
|
|
563
595
|
n.currentLocation,
|
|
564
596
|
e,
|
|
565
597
|
r
|
|
566
|
-
), o = we(
|
|
598
|
+
), o = we(
|
|
599
|
+
n,
|
|
600
|
+
e,
|
|
601
|
+
r
|
|
602
|
+
), i = Ne(n, e, r), { dialogue: s, choices: l } = Ee(
|
|
603
|
+
n,
|
|
604
|
+
e,
|
|
605
|
+
r
|
|
606
|
+
), c = Ae(n, e, r), u = Ce(n, e, r), g = Le(n, e, r), b = xe(n, e, r), d = n.mapEnabled ? ke(n, e, r) : null, f = e.locations[n.currentLocation], h = (f == null ? void 0 : f.music) ?? "", p = (f == null ? void 0 : f.ambient) ?? "", y = n.notifications.map(r), I = [...n.pendingSounds], x = n.pendingVideo;
|
|
567
607
|
let A = null;
|
|
568
608
|
if (n.pendingInterlude) {
|
|
569
609
|
const m = e.interludes[n.pendingInterlude];
|
|
@@ -657,10 +697,12 @@ function Ee(n, e, t) {
|
|
|
657
697
|
const r = e.dialogues[n.dialogueState.dialogueId];
|
|
658
698
|
if (!r)
|
|
659
699
|
return { dialogue: null, choices: [] };
|
|
660
|
-
const a = r.nodes.find(
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
700
|
+
const a = r.nodes.find(
|
|
701
|
+
(u) => {
|
|
702
|
+
var g;
|
|
703
|
+
return u.id === ((g = n.dialogueState) == null ? void 0 : g.nodeId);
|
|
704
|
+
}
|
|
705
|
+
);
|
|
664
706
|
if (!a)
|
|
665
707
|
return { dialogue: null, choices: [] };
|
|
666
708
|
const o = a.speaker ? t(((l = e.characters[a.speaker]) == null ? void 0 : l.name) ?? a.speaker) : "Narrator", i = {
|
|
@@ -783,7 +825,9 @@ class We {
|
|
|
783
825
|
*/
|
|
784
826
|
newGame(e) {
|
|
785
827
|
const t = {};
|
|
786
|
-
for (const [a, o] of Object.entries(
|
|
828
|
+
for (const [a, o] of Object.entries(
|
|
829
|
+
this.registry.characters
|
|
830
|
+
))
|
|
787
831
|
t[a] = {
|
|
788
832
|
location: o.location,
|
|
789
833
|
inParty: !1,
|
|
@@ -915,7 +959,9 @@ class We {
|
|
|
915
959
|
const t = this.registry.dialogues[e];
|
|
916
960
|
if (!t)
|
|
917
961
|
return this.buildSnapshotAndClearTransients();
|
|
918
|
-
const r = t.nodes.find(
|
|
962
|
+
const r = t.nodes.find(
|
|
963
|
+
(a) => a.id === t.startNode
|
|
964
|
+
);
|
|
919
965
|
if (!r)
|
|
920
966
|
return this.buildSnapshotAndClearTransients();
|
|
921
967
|
if (this.state = {
|
|
@@ -1080,7 +1126,10 @@ class We {
|
|
|
1080
1126
|
resolveNextNode(e) {
|
|
1081
1127
|
if (e.conditionalNext && e.conditionalNext.length > 0) {
|
|
1082
1128
|
for (const t of e.conditionalNext)
|
|
1083
|
-
if (S(
|
|
1129
|
+
if (S(
|
|
1130
|
+
[t.condition],
|
|
1131
|
+
this.state
|
|
1132
|
+
))
|
|
1084
1133
|
return t.next;
|
|
1085
1134
|
}
|
|
1086
1135
|
return e.next ?? null;
|
|
@@ -1097,7 +1146,9 @@ class We {
|
|
|
1097
1146
|
for (const e of Object.values(this.registry.dialogues)) {
|
|
1098
1147
|
if (e.triggerLocation !== this.state.currentLocation || e.conditions && !S(e.conditions, this.state))
|
|
1099
1148
|
continue;
|
|
1100
|
-
const t = e.nodes.find(
|
|
1149
|
+
const t = e.nodes.find(
|
|
1150
|
+
(r) => r.id === e.startNode
|
|
1151
|
+
);
|
|
1101
1152
|
if (t) {
|
|
1102
1153
|
if (this.state = {
|
|
1103
1154
|
...this.state,
|
|
@@ -1197,7 +1248,11 @@ function N(n) {
|
|
|
1197
1248
|
case "atLocation":
|
|
1198
1249
|
return { type: "atLocation", locationId: e[1] };
|
|
1199
1250
|
case "questAtStage":
|
|
1200
|
-
return {
|
|
1251
|
+
return {
|
|
1252
|
+
type: "questAtStage",
|
|
1253
|
+
questId: e[1],
|
|
1254
|
+
stageId: e[2]
|
|
1255
|
+
};
|
|
1201
1256
|
case "characterAt":
|
|
1202
1257
|
return {
|
|
1203
1258
|
type: "characterAt",
|
|
@@ -1248,7 +1303,10 @@ function E(n) {
|
|
|
1248
1303
|
if (e.startsWith("VIDEO "))
|
|
1249
1304
|
return { type: "playVideo", file: e.substring(6).trim() };
|
|
1250
1305
|
if (e.startsWith("INTERLUDE "))
|
|
1251
|
-
return {
|
|
1306
|
+
return {
|
|
1307
|
+
type: "showInterlude",
|
|
1308
|
+
interludeId: e.substring(10).trim()
|
|
1309
|
+
};
|
|
1252
1310
|
if (e.startsWith("ROLL ")) {
|
|
1253
1311
|
const a = e.split(/\s+/);
|
|
1254
1312
|
return {
|
|
@@ -1270,7 +1328,11 @@ function E(n) {
|
|
|
1270
1328
|
value: isNaN(Number(t[3])) ? t[3] : Number(t[3])
|
|
1271
1329
|
};
|
|
1272
1330
|
if (t[1] === "questStage")
|
|
1273
|
-
return {
|
|
1331
|
+
return {
|
|
1332
|
+
type: "setQuestStage",
|
|
1333
|
+
questId: t[2],
|
|
1334
|
+
stageId: t[3]
|
|
1335
|
+
};
|
|
1274
1336
|
if (t[1] === "characterLocation")
|
|
1275
1337
|
return {
|
|
1276
1338
|
type: "setCharacterLocation",
|
|
@@ -1332,7 +1394,11 @@ function E(n) {
|
|
|
1332
1394
|
throw new Error(`Unknown REMOVE effect: ${t[1]}`);
|
|
1333
1395
|
case "MOVE":
|
|
1334
1396
|
if (t[1] === "item")
|
|
1335
|
-
return {
|
|
1397
|
+
return {
|
|
1398
|
+
type: "moveItem",
|
|
1399
|
+
itemId: t[2],
|
|
1400
|
+
locationId: t[3]
|
|
1401
|
+
};
|
|
1336
1402
|
throw new Error(`Unknown MOVE effect: ${t[1]}`);
|
|
1337
1403
|
case "GOTO":
|
|
1338
1404
|
if (t[1] === "location")
|
|
@@ -1514,7 +1580,9 @@ function Ge(n, e) {
|
|
|
1514
1580
|
(i) => i.id === a.startNode
|
|
1515
1581
|
);
|
|
1516
1582
|
if (!o) {
|
|
1517
|
-
console.error(
|
|
1583
|
+
console.error(
|
|
1584
|
+
`🐾 Start node not found for dialogue: ${r}`
|
|
1585
|
+
);
|
|
1518
1586
|
return;
|
|
1519
1587
|
}
|
|
1520
1588
|
t.state.dialogueState = {
|
package/dist/devtools.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Exposes window.doodle API for debugging and testing.
|
|
6
6
|
* Only enabled in development mode.
|
|
7
7
|
*/
|
|
8
|
-
import type { Engine } from
|
|
8
|
+
import type { Engine } from './engine';
|
|
9
9
|
export interface DevTools {
|
|
10
10
|
setFlag: (flag: string) => void;
|
|
11
11
|
clearFlag: (flag: string) => void;
|
package/dist/devtools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools.d.ts","sourceRoot":"","sources":["../src/devtools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,WAAW,QAAQ;
|
|
1
|
+
{"version":3,"file":"devtools.d.ts","sourceRoot":"","sources":["../src/devtools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,WAAW,QAAQ;IAErB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAGlC,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAChE,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAG/D,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAGvC,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAG9C,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAG1D,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAGrC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,GAAG,CAAC;IACxB,eAAe,EAAE,MAAM,GAAG,CAAC;CAC9B;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,MAAM,CAAC,EAAE,QAAQ,CAAC;KACrB;CACJ;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,QAiJlE"}
|
package/dist/effects/index.d.ts
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* All effects follow an immutable pattern - they return a new GameState
|
|
11
11
|
* rather than mutating the existing one.
|
|
12
12
|
*/
|
|
13
|
-
import type { Effect } from
|
|
14
|
-
import type { GameState } from
|
|
13
|
+
import type { Effect } from '../types/effects';
|
|
14
|
+
import type { GameState } from '../types/state';
|
|
15
15
|
/**
|
|
16
16
|
* Apply a single effect to the game state.
|
|
17
17
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/effects/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/effects/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,CAgHvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,CAK3E"}
|
package/dist/engine/index.d.ts
CHANGED
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
*
|
|
10
10
|
* One-way data flow: actions in, snapshots out.
|
|
11
11
|
*/
|
|
12
|
-
import type { ContentRegistry } from
|
|
13
|
-
import type { GameState } from
|
|
14
|
-
import type { GameConfig } from
|
|
15
|
-
import type { Snapshot } from
|
|
16
|
-
import type { SaveData } from
|
|
12
|
+
import type { ContentRegistry } from '../types/registry';
|
|
13
|
+
import type { GameState } from '../types/state';
|
|
14
|
+
import type { GameConfig } from '../types/entities';
|
|
15
|
+
import type { Snapshot } from '../types/snapshot';
|
|
16
|
+
import type { SaveData } from '../types/save';
|
|
17
17
|
/**
|
|
18
18
|
* The Doodle Engine.
|
|
19
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/engine/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAChE,OAAO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AAM,GAAG,QAAQ;IAwDtC;;;;;;;;OAQG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ;IAehD;;;;;;;OAOG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ;IASpC;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ;IASnC;;;;;;OAMG;IACH,WAAW,IAAI,QAAQ;IAQvB;;;OAGG;IACH,OAAO,CAAC,+BAA+B;IAevC;;;;;;;;;OASG;IACH,OAAO,CAAC,eAAe;IAoBvB;;;;;;;OAOG;IACH,OAAO,CAAC,uBAAuB;IA8D/B;;;;;;;OAOG;IACH,OAAO,CAAC,wBAAwB;CA2BnC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,23 +5,23 @@
|
|
|
5
5
|
* Framework-agnostic - manages game state, evaluates conditions, processes effects, builds snapshots.
|
|
6
6
|
*/
|
|
7
7
|
export declare const VERSION = "0.0.1";
|
|
8
|
-
export type { Location, Character, Item, Map, MapLocation, Dialogue, DialogueNode, Choice, Quest, QuestStage, JournalEntry, Interlude, ShellConfig, GameConfig, } from
|
|
9
|
-
export type { AssetEntry, AssetManifest, AssetLoadingState, } from
|
|
10
|
-
export { getAssetType, extractAssetPaths } from
|
|
11
|
-
export type { AssetLoader } from
|
|
12
|
-
export { createAssetLoader } from
|
|
13
|
-
export type { Condition, HasFlagCondition, NotFlagCondition, HasItemCondition, VariableEqualsCondition, VariableGreaterThanCondition, VariableLessThanCondition, AtLocationCondition, QuestAtStageCondition, CharacterAtCondition, CharacterInPartyCondition, RelationshipAboveCondition, RelationshipBelowCondition, TimeIsCondition, ItemAtCondition, RollCondition, } from
|
|
14
|
-
export type { Effect, SetFlagEffect, ClearFlagEffect, SetVariableEffect, AddVariableEffect, AddItemEffect, RemoveItemEffect, MoveItemEffect, GoToLocationEffect, AdvanceTimeEffect, SetQuestStageEffect, AddJournalEntryEffect, StartDialogueEffect, EndDialogueEffect, SetCharacterLocationEffect, AddToPartyEffect, RemoveFromPartyEffect, SetRelationshipEffect, AddRelationshipEffect, SetCharacterStatEffect, AddCharacterStatEffect, SetMapEnabledEffect, PlayMusicEffect, PlaySoundEffect, NotifyEffect, PlayVideoEffect, ShowInterludeEffect, RollEffect, } from
|
|
15
|
-
export type { GameState, CharacterState, DialogueState, PlayerNote, Time, } from
|
|
16
|
-
export type { Snapshot, SnapshotLocation, SnapshotCharacter, SnapshotItem, SnapshotChoice, SnapshotDialogue, SnapshotQuest, SnapshotJournalEntry, SnapshotMapLocation, SnapshotMap, SnapshotInterlude, } from
|
|
17
|
-
export type { SaveData } from
|
|
18
|
-
export type { ContentRegistry, LocaleData } from
|
|
19
|
-
export { evaluateCondition, evaluateConditions } from
|
|
20
|
-
export { applyEffect, applyEffects } from
|
|
21
|
-
export { resolveText, createResolver } from
|
|
22
|
-
export { buildSnapshot } from
|
|
23
|
-
export { Engine } from
|
|
24
|
-
export { parseDialogue, parseCondition, parseEffect } from
|
|
25
|
-
export type { DevTools } from
|
|
26
|
-
export { enableDevTools } from
|
|
8
|
+
export type { Location, Character, Item, Map, MapLocation, Dialogue, DialogueNode, Choice, Quest, QuestStage, JournalEntry, Interlude, ShellConfig, GameConfig, } from './types/entities';
|
|
9
|
+
export type { AssetEntry, AssetManifest, AssetLoadingState, } from './types/assets';
|
|
10
|
+
export { getAssetType, extractAssetPaths } from './assets/manifest';
|
|
11
|
+
export type { AssetLoader } from './assets/loader';
|
|
12
|
+
export { createAssetLoader } from './assets/loader';
|
|
13
|
+
export type { Condition, HasFlagCondition, NotFlagCondition, HasItemCondition, VariableEqualsCondition, VariableGreaterThanCondition, VariableLessThanCondition, AtLocationCondition, QuestAtStageCondition, CharacterAtCondition, CharacterInPartyCondition, RelationshipAboveCondition, RelationshipBelowCondition, TimeIsCondition, ItemAtCondition, RollCondition, } from './types/conditions';
|
|
14
|
+
export type { Effect, SetFlagEffect, ClearFlagEffect, SetVariableEffect, AddVariableEffect, AddItemEffect, RemoveItemEffect, MoveItemEffect, GoToLocationEffect, AdvanceTimeEffect, SetQuestStageEffect, AddJournalEntryEffect, StartDialogueEffect, EndDialogueEffect, SetCharacterLocationEffect, AddToPartyEffect, RemoveFromPartyEffect, SetRelationshipEffect, AddRelationshipEffect, SetCharacterStatEffect, AddCharacterStatEffect, SetMapEnabledEffect, PlayMusicEffect, PlaySoundEffect, NotifyEffect, PlayVideoEffect, ShowInterludeEffect, RollEffect, } from './types/effects';
|
|
15
|
+
export type { GameState, CharacterState, DialogueState, PlayerNote, Time, } from './types/state';
|
|
16
|
+
export type { Snapshot, SnapshotLocation, SnapshotCharacter, SnapshotItem, SnapshotChoice, SnapshotDialogue, SnapshotQuest, SnapshotJournalEntry, SnapshotMapLocation, SnapshotMap, SnapshotInterlude, } from './types/snapshot';
|
|
17
|
+
export type { SaveData } from './types/save';
|
|
18
|
+
export type { ContentRegistry, LocaleData } from './types/registry';
|
|
19
|
+
export { evaluateCondition, evaluateConditions } from './conditions';
|
|
20
|
+
export { applyEffect, applyEffects } from './effects';
|
|
21
|
+
export { resolveText, createResolver } from './localization';
|
|
22
|
+
export { buildSnapshot } from './snapshot';
|
|
23
|
+
export { Engine } from './engine';
|
|
24
|
+
export { parseDialogue, parseCondition, parseEffect } from './parser';
|
|
25
|
+
export type { DevTools } from './devtools';
|
|
26
|
+
export { enableDevTools } from './devtools';
|
|
27
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,YAAY,E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iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,GACpB,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAG7C,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGpE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGrE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG7D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGtE,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Handles resolution of @keys to translated strings based on the current locale.
|
|
5
5
|
* Authors use @keys in content files, and the engine resolves them when building snapshots.
|
|
6
6
|
*/
|
|
7
|
-
import type { LocaleData } from
|
|
7
|
+
import type { LocaleData } from '../types/registry';
|
|
8
8
|
/**
|
|
9
9
|
* Resolve a localization key to a translated string.
|
|
10
10
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/localization/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/localization/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CACvB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,UAAU,EACtB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAC5C,MAAM,CAmBR;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAC1B,UAAU,EAAE,UAAU,EACtB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAC5C,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAE1B"}
|
package/dist/parser/index.d.ts
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
* - All 24 effect types
|
|
12
12
|
* - @localization keys and "inline text"
|
|
13
13
|
*/
|
|
14
|
-
import type { Dialogue } from
|
|
15
|
-
import type { Condition } from
|
|
16
|
-
import type { Effect } from
|
|
14
|
+
import type { Dialogue } from '../types/entities';
|
|
15
|
+
import type { Condition } from '../types/conditions';
|
|
16
|
+
import type { Effect } from '../types/effects';
|
|
17
17
|
/**
|
|
18
18
|
* Parse a condition string into a Condition object
|
|
19
19
|
* Examples:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAwB,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAwB,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AA0F/C;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,CA2E9D;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CA2KrD;AAmPD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,QAAQ,CA2CjE"}
|
package/dist/snapshot/index.d.ts
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
*
|
|
10
10
|
* The renderer never sees raw game state or content registry.
|
|
11
11
|
*/
|
|
12
|
-
import type { ContentRegistry } from
|
|
13
|
-
import type { GameState } from
|
|
14
|
-
import type { Snapshot } from
|
|
12
|
+
import type { ContentRegistry } from '../types/registry';
|
|
13
|
+
import type { GameState } from '../types/state';
|
|
14
|
+
import type { Snapshot } from '../types/snapshot';
|
|
15
15
|
/**
|
|
16
16
|
* Build a complete snapshot from current game state.
|
|
17
17
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/snapshot/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAc,MAAM,mBAAmB,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/snapshot/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAc,MAAM,mBAAmB,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EACR,QAAQ,EAWX,MAAM,mBAAmB,CAAC;AAI3B;;;;;;GAMG;AACH,wBAAgB,aAAa,CACzB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,eAAe,GAC1B,QAAQ,CAsGV"}
|