@doodle-engine/core 0.0.20 → 0.0.21
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 +99 -24
- 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;IAC1B,oDAAoD;IACpD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/assets/loader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,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,CACN,KAAK,EAAE,MAAM,EAAE,EACf,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,GACpE,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;CACxB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,MAAY,GAAG,WAAW,CAiGpE"}
|
|
@@ -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,
|
|
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,CAC/B,QAAQ,EAAE,eAAe,EACzB,MAAM,EAAE,UAAU,GACjB;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,
|
|
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,CAC/B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,GACf,OAAO,CAwET;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,SAAS,EAAE,EACvB,KAAK,EAAE,SAAS,GACf,OAAO,CAET"}
|
package/dist/core.js
CHANGED
|
@@ -111,21 +111,41 @@ function R(n, e) {
|
|
|
111
111
|
case "variableEquals":
|
|
112
112
|
return F(n.variable, n.value, e);
|
|
113
113
|
case "variableGreaterThan":
|
|
114
|
-
return q(
|
|
114
|
+
return q(
|
|
115
|
+
n.variable,
|
|
116
|
+
n.value,
|
|
117
|
+
e
|
|
118
|
+
);
|
|
115
119
|
case "variableLessThan":
|
|
116
|
-
return P(
|
|
120
|
+
return P(
|
|
121
|
+
n.variable,
|
|
122
|
+
n.value,
|
|
123
|
+
e
|
|
124
|
+
);
|
|
117
125
|
case "atLocation":
|
|
118
126
|
return M(n.locationId, e);
|
|
119
127
|
case "questAtStage":
|
|
120
128
|
return W(n.questId, n.stageId, e);
|
|
121
129
|
case "characterAt":
|
|
122
|
-
return j(
|
|
130
|
+
return j(
|
|
131
|
+
n.characterId,
|
|
132
|
+
n.locationId,
|
|
133
|
+
e
|
|
134
|
+
);
|
|
123
135
|
case "characterInParty":
|
|
124
136
|
return G(n.characterId, e);
|
|
125
137
|
case "relationshipAbove":
|
|
126
|
-
return H(
|
|
138
|
+
return H(
|
|
139
|
+
n.characterId,
|
|
140
|
+
n.value,
|
|
141
|
+
e
|
|
142
|
+
);
|
|
127
143
|
case "relationshipBelow":
|
|
128
|
-
return Q(
|
|
144
|
+
return Q(
|
|
145
|
+
n.characterId,
|
|
146
|
+
n.value,
|
|
147
|
+
e
|
|
148
|
+
);
|
|
129
149
|
case "timeIs":
|
|
130
150
|
return J(n.startHour, n.endHour, e);
|
|
131
151
|
case "itemAt":
|
|
@@ -220,7 +240,11 @@ function _(n, e) {
|
|
|
220
240
|
case "endDialogue":
|
|
221
241
|
return se(e);
|
|
222
242
|
case "setCharacterLocation":
|
|
223
|
-
return le(
|
|
243
|
+
return le(
|
|
244
|
+
n.characterId,
|
|
245
|
+
n.locationId,
|
|
246
|
+
e
|
|
247
|
+
);
|
|
224
248
|
case "addToParty":
|
|
225
249
|
return ce(n.characterId, e);
|
|
226
250
|
case "removeFromParty":
|
|
@@ -230,9 +254,19 @@ function _(n, e) {
|
|
|
230
254
|
case "addRelationship":
|
|
231
255
|
return he(n.characterId, n.value, e);
|
|
232
256
|
case "setCharacterStat":
|
|
233
|
-
return pe(
|
|
257
|
+
return pe(
|
|
258
|
+
n.characterId,
|
|
259
|
+
n.stat,
|
|
260
|
+
n.value,
|
|
261
|
+
e
|
|
262
|
+
);
|
|
234
263
|
case "addCharacterStat":
|
|
235
|
-
return fe(
|
|
264
|
+
return fe(
|
|
265
|
+
n.characterId,
|
|
266
|
+
n.stat,
|
|
267
|
+
n.value,
|
|
268
|
+
e
|
|
269
|
+
);
|
|
236
270
|
case "setMapEnabled":
|
|
237
271
|
return ge(n.enabled, e);
|
|
238
272
|
case "playMusic":
|
|
@@ -252,7 +286,10 @@ function _(n, e) {
|
|
|
252
286
|
}
|
|
253
287
|
}
|
|
254
288
|
function v(n, e) {
|
|
255
|
-
return n.reduce(
|
|
289
|
+
return n.reduce(
|
|
290
|
+
(t, r) => _(r, t),
|
|
291
|
+
e
|
|
292
|
+
);
|
|
256
293
|
}
|
|
257
294
|
function z(n, e) {
|
|
258
295
|
return {
|
|
@@ -522,7 +559,11 @@ function Me(n, e) {
|
|
|
522
559
|
return (t) => L(t, n, e);
|
|
523
560
|
}
|
|
524
561
|
function Ie(n, e) {
|
|
525
|
-
const t = e.locales[n.currentLocale] ?? {}, r = (m) => L(m, t, n.variables), a = Te(
|
|
562
|
+
const t = e.locales[n.currentLocale] ?? {}, r = (m) => L(m, t, n.variables), a = Te(
|
|
563
|
+
n.currentLocation,
|
|
564
|
+
e,
|
|
565
|
+
r
|
|
566
|
+
), o = we(n, e, r), i = Ne(n, e, r), { dialogue: s, choices: l } = Ee(n, e, r), 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;
|
|
526
567
|
let A = null;
|
|
527
568
|
if (n.pendingInterlude) {
|
|
528
569
|
const m = e.interludes[n.pendingInterlude];
|
|
@@ -575,7 +616,9 @@ function Te(n, e, t) {
|
|
|
575
616
|
}
|
|
576
617
|
function we(n, e, t) {
|
|
577
618
|
const r = [];
|
|
578
|
-
for (const [a, o] of Object.entries(
|
|
619
|
+
for (const [a, o] of Object.entries(
|
|
620
|
+
n.characterState
|
|
621
|
+
))
|
|
579
622
|
if (o.location === n.currentLocation) {
|
|
580
623
|
const i = e.characters[a];
|
|
581
624
|
i && r.push({
|
|
@@ -634,7 +677,9 @@ function Ee(n, e, t) {
|
|
|
634
677
|
}
|
|
635
678
|
function Ae(n, e, t) {
|
|
636
679
|
const r = [];
|
|
637
|
-
for (const [a, o] of Object.entries(
|
|
680
|
+
for (const [a, o] of Object.entries(
|
|
681
|
+
n.characterState
|
|
682
|
+
))
|
|
638
683
|
if (o.inParty) {
|
|
639
684
|
const i = e.characters[a];
|
|
640
685
|
i && r.push({
|
|
@@ -810,10 +855,12 @@ class We {
|
|
|
810
855
|
const t = this.registry.dialogues[this.state.dialogueState.dialogueId];
|
|
811
856
|
if (!t)
|
|
812
857
|
return this.buildSnapshotAndClearTransients();
|
|
813
|
-
const r = t.nodes.find(
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
858
|
+
const r = t.nodes.find(
|
|
859
|
+
(s) => {
|
|
860
|
+
var l;
|
|
861
|
+
return s.id === ((l = this.state.dialogueState) == null ? void 0 : l.nodeId);
|
|
862
|
+
}
|
|
863
|
+
);
|
|
817
864
|
if (!r)
|
|
818
865
|
return this.buildSnapshotAndClearTransients();
|
|
819
866
|
const a = r.choices.find((s) => s.id === e);
|
|
@@ -927,7 +974,9 @@ class We {
|
|
|
927
974
|
const r = this.registry.maps[t[0]];
|
|
928
975
|
if (!r)
|
|
929
976
|
return this.buildSnapshotAndClearTransients();
|
|
930
|
-
const a = r.locations.find(
|
|
977
|
+
const a = r.locations.find(
|
|
978
|
+
(g) => g.id === this.state.currentLocation
|
|
979
|
+
), o = r.locations.find((g) => g.id === e);
|
|
931
980
|
if (!a || !o)
|
|
932
981
|
return this.buildSnapshotAndClearTransients();
|
|
933
982
|
const i = Math.sqrt(
|
|
@@ -1170,11 +1219,20 @@ function N(n) {
|
|
|
1170
1219
|
value: Number(e[2])
|
|
1171
1220
|
};
|
|
1172
1221
|
case "timeIs":
|
|
1173
|
-
return {
|
|
1222
|
+
return {
|
|
1223
|
+
type: "timeIs",
|
|
1224
|
+
startHour: Number(e[1]),
|
|
1225
|
+
endHour: Number(e[2])
|
|
1226
|
+
};
|
|
1174
1227
|
case "itemAt":
|
|
1175
1228
|
return { type: "itemAt", itemId: e[1], locationId: e[2] };
|
|
1176
1229
|
case "roll":
|
|
1177
|
-
return {
|
|
1230
|
+
return {
|
|
1231
|
+
type: "roll",
|
|
1232
|
+
min: Number(e[1]),
|
|
1233
|
+
max: Number(e[2]),
|
|
1234
|
+
threshold: Number(e[3])
|
|
1235
|
+
};
|
|
1178
1236
|
default:
|
|
1179
1237
|
throw new Error(`Unknown condition type: ${t}`);
|
|
1180
1238
|
}
|
|
@@ -1193,7 +1251,12 @@ function E(n) {
|
|
|
1193
1251
|
return { type: "showInterlude", interludeId: e.substring(10).trim() };
|
|
1194
1252
|
if (e.startsWith("ROLL ")) {
|
|
1195
1253
|
const a = e.split(/\s+/);
|
|
1196
|
-
return {
|
|
1254
|
+
return {
|
|
1255
|
+
type: "roll",
|
|
1256
|
+
variable: a[1],
|
|
1257
|
+
min: Number(a[2]),
|
|
1258
|
+
max: Number(a[3])
|
|
1259
|
+
};
|
|
1197
1260
|
}
|
|
1198
1261
|
const t = e.split(/\s+/), r = t[0];
|
|
1199
1262
|
switch (r) {
|
|
@@ -1406,7 +1469,9 @@ function je(n, e) {
|
|
|
1406
1469
|
const c = Ve(t, s);
|
|
1407
1470
|
o.push(c.node), i || (i = c.node.id), s = c.nextIndex;
|
|
1408
1471
|
} else
|
|
1409
|
-
throw new Error(
|
|
1472
|
+
throw new Error(
|
|
1473
|
+
`Unexpected token at line ${l.lineNumber}: ${l.line}`
|
|
1474
|
+
);
|
|
1410
1475
|
}
|
|
1411
1476
|
return {
|
|
1412
1477
|
id: e,
|
|
@@ -1445,7 +1510,9 @@ function Ge(n, e) {
|
|
|
1445
1510
|
console.error(`🐾 Dialogue not found: ${r}`);
|
|
1446
1511
|
return;
|
|
1447
1512
|
}
|
|
1448
|
-
const o = a.nodes.find(
|
|
1513
|
+
const o = a.nodes.find(
|
|
1514
|
+
(i) => i.id === a.startNode
|
|
1515
|
+
);
|
|
1449
1516
|
if (!o) {
|
|
1450
1517
|
console.error(`🐾 Start node not found for dialogue: ${r}`);
|
|
1451
1518
|
return;
|
|
@@ -1470,7 +1537,13 @@ function Ge(n, e) {
|
|
|
1470
1537
|
// Inspection
|
|
1471
1538
|
inspect() {
|
|
1472
1539
|
const r = n.getSnapshot();
|
|
1473
|
-
console.log("🐾 DOODLE ENGINE INSPECTOR 🐾"), console.log(""), console.log("Current Location:", r.location.name), console.log(
|
|
1540
|
+
console.log("🐾 DOODLE ENGINE INSPECTOR 🐾"), console.log(""), console.log("Current Location:", r.location.name), console.log(
|
|
1541
|
+
"Current Time:",
|
|
1542
|
+
`Day ${r.time.day}, Hour ${r.time.hour}`
|
|
1543
|
+
), console.log("Flags:", Object.keys(t.state.flags)), console.log("Variables:", t.state.variables), console.log(
|
|
1544
|
+
"Inventory:",
|
|
1545
|
+
r.inventory.map((a) => a.name)
|
|
1546
|
+
), console.log("Quest Progress:", t.state.questProgress), console.log(""), console.log("Available commands:"), console.log(" doodle.setFlag(flag)"), console.log(" doodle.clearFlag(flag)"), console.log(" doodle.setVariable(variable, value)"), console.log(" doodle.getVariable(variable)"), console.log(" doodle.teleport(locationId)"), console.log(" doodle.triggerDialogue(dialogueId)"), console.log(" doodle.setQuestStage(questId, stageId)"), console.log(" doodle.addItem(itemId)"), console.log(" doodle.removeItem(itemId)"), console.log(" doodle.inspectState()"), console.log(" doodle.inspectRegistry()"), console.log(""), console.log("📚 Docs: https://katbella.com/doodle-engine/");
|
|
1474
1547
|
},
|
|
1475
1548
|
inspectState() {
|
|
1476
1549
|
return console.log("🐾 GAME STATE:", t.state), t.state;
|
|
@@ -1478,7 +1551,9 @@ function Ge(n, e) {
|
|
|
1478
1551
|
inspectRegistry() {
|
|
1479
1552
|
return console.log("🐾 CONTENT REGISTRY:", t.registry), t.registry;
|
|
1480
1553
|
}
|
|
1481
|
-
}, console.log(
|
|
1554
|
+
}, console.log(
|
|
1555
|
+
"🐾 Doodle Engine dev tools enabled! Type `doodle.inspect()` to see available commands.\n📚 You can also check out the docs: https://katbella.com/doodle-engine/"
|
|
1556
|
+
);
|
|
1482
1557
|
}
|
|
1483
1558
|
const He = "0.0.1";
|
|
1484
1559
|
export {
|
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,
|
|
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;IAEvB,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;CAC5B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,CAAC,EAAE,QAAQ,CAAC;KACnB;CACF;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,QA+IlE"}
|
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,
|
|
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,CAwGvE;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,
|
|
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,KAAK,EAAE,UAAU,EAAgB,MAAM,mBAAmB,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAK9C;;;;GAIG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,KAAK,CAAY;IAEzB;;;;;OAKG;gBACS,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,SAAS;IASvD;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,QAAQ;IA+CrC;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ;IAQtC;;;;;;OAMG;IACH,QAAQ,IAAI,QAAQ;IAQpB;;;;;;;OAOG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ;IAkFxC;;;;;;;OAOG;IACH,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ;IAQrC;;;OAGG;IACH,OAAO,CAAC,YAAY;IAiDpB;;;;;;;OAOG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ;IAmBlC;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,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;IAevB;;;;;;;OAOG;IACH,OAAO,CAAC,uBAAuB;IA4D/B;;;;;;;OAOG;IACH,OAAO,CAAC,wBAAwB;CA2BjC"}
|
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
|
|
11
|
-
export type { AssetLoader
|
|
12
|
-
export { createAssetLoader
|
|
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
|
|
18
|
-
export type { ContentRegistry, LocaleData
|
|
19
|
-
export { evaluateCondition, evaluateConditions
|
|
20
|
-
export { applyEffect, applyEffects
|
|
21
|
-
export { resolveText, createResolver
|
|
22
|
-
export { buildSnapshot
|
|
23
|
-
export { Engine
|
|
24
|
-
export { parseDialogue, parseCondition, parseEffect
|
|
25
|
-
export type { DevTools
|
|
26
|
-
export { enableDevTools
|
|
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,
|
|
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,EACV,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,GAAG,EACH,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,KAAK,EACL,UAAU,EACV,YAAY,EACZ,SAAS,EACT,WAAW,EACX,UAAU,GACX,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,UAAU,EACV,aAAa,EACb,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGpE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGpD,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,eAAe,EACf,eAAe,EACf,aAAa,GACd,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EACV,MAAM,EACN,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,0BAA0B,EAC1B,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,UAAU,GACX,MAAM,iBAAiB,CAAC;AAGzB,YAAY,EACV,SAAS,EACT,cAAc,EACd,aAAa,EACb,UAAU,EACV,IAAI,GACL,MAAM,eAAe,CAAC;AAGvB,YAAY,EACV,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,GAClB,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,
|
|
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,CACzB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,UAAU,EACtB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAC1C,MAAM,CAmBR;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,UAAU,EACtB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAC1C,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,
|
|
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;AAsF/C;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,CAuE9D;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CA4JrD;AAiPD;;;;;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,
|
|
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,EACV,QAAQ,EAWT,MAAM,mBAAmB,CAAC;AAI3B;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,eAAe,GACxB,QAAQ,CA8FV"}
|