@maka/maka-cli 5.74.0 → 5.75.0
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/bundle/typescript/package.json +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/backlog.js +4 -4
- package/bundle/typescript/src/commands/game/sideQuest/commands/backlog.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/hack.js +3 -3
- package/bundle/typescript/src/commands/game/sideQuest/commands/hack.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/look.js +12 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/look.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/mark.js +4 -4
- package/bundle/typescript/src/commands/game/sideQuest/commands/mark.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/move.d.ts +42 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/move.js +288 -46
- package/bundle/typescript/src/commands/game/sideQuest/commands/move.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/rest.js +8 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/rest.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/search.js +20 -15
- package/bundle/typescript/src/commands/game/sideQuest/commands/search.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/take.js +10 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/take.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/tap.js +9 -8
- package/bundle/typescript/src/commands/game/sideQuest/commands/tap.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/factories/chargen-factory.d.ts +83 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/chargen-factory.js +253 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/chargen-factory.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/factories/repro-scene.js +116 -3
- package/bundle/typescript/src/commands/game/sideQuest/factories/repro-scene.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/game.d.ts +39 -0
- package/bundle/typescript/src/commands/game/sideQuest/game.js +85 -14
- package/bundle/typescript/src/commands/game/sideQuest/game.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/headless.js +5 -3
- package/bundle/typescript/src/commands/game/sideQuest/headless.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/player.d.ts +35 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/player.js +46 -0
- package/bundle/typescript/src/commands/game/sideQuest/models/player.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/types/repro.d.ts +158 -3
- package/bundle/typescript/src/commands/game/sideQuest/types/repro.js +24 -1
- package/bundle/typescript/src/commands/game/sideQuest/types/repro.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/ar.js +33 -3
- package/bundle/typescript/src/commands/game/sideQuest/utilities/ar.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/backlog-dump.js +2 -2
- package/bundle/typescript/src/commands/game/sideQuest/utilities/backlog-dump.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/backlog-vocab.d.ts +4 -2
- package/bundle/typescript/src/commands/game/sideQuest/utilities/backlog-vocab.js +15 -3
- package/bundle/typescript/src/commands/game/sideQuest/utilities/backlog-vocab.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/backlog.d.ts +6 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/backlog.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/fuzzy-match.d.ts +24 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/fuzzy-match.js +31 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/fuzzy-match.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/grid-names.d.ts +20 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/grid-names.js +21 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/grid-names.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/grid-view.js +4 -3
- package/bundle/typescript/src/commands/game/sideQuest/utilities/grid-view.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/marks.js +2 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/marks.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/room-grid.d.ts +71 -18
- package/bundle/typescript/src/commands/game/sideQuest/utilities/room-grid.js +109 -21
- package/bundle/typescript/src/commands/game/sideQuest/utilities/room-grid.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/room-view.d.ts +38 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/room-view.js +46 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/room-view.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/spots.d.ts +31 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/spots.js +41 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/spots.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/web-character-generator.d.ts +29 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/web-character-generator.js +33 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/web-character-generator.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest-backlog.sub.cmd.js +1 -1
- package/bundle/typescript/src/commands/game/sideQuest-backlog.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js +34 -8
- package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/commands/set/global.sub.cmd.js +1 -20
- package/bundle/typescript/src/commands/set/global.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/generator.js +1 -0
- package/bundle/typescript/src/generator.js.map +1 -1
- package/bundle/typescript/src/templates/meteor/collection/tests.js +1 -1
- package/bundle/typescript/src/templates/meteor/collection/tests.js.ts +1 -1
- package/bundle/typescript/src/templates/react/test/test.js.jsx +31 -29
- package/bundle/typescript/src/templates/react/test/test.js.tsx +31 -29
- package/bundle/typescript/src/tools/browser/open-browser.d.ts +7 -0
- package/bundle/typescript/src/tools/browser/open-browser.js +21 -0
- package/bundle/typescript/src/tools/browser/open-browser.js.map +1 -0
- package/bundle/typescript/src/tools/pkg/pkg.class.js +12 -1
- package/bundle/typescript/src/tools/pkg/pkg.class.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { Command } from './command.js';
|
|
|
2
2
|
import { hint } from '../utilities/hints.js';
|
|
3
3
|
import { planeTintItemName, emphasizeFind, canReachHost, objectiveMark } from '../utilities/planes.js';
|
|
4
4
|
import { rollPool, formatRoll } from '../utilities/dice.js';
|
|
5
|
-
import { canReach, exitSpot, spotsActive, revealWithPerception, theSpot,
|
|
5
|
+
import { canReach, exitSpot, spotsActive, revealWithPerception, theSpot, sealedRouteTo, } from '../utilities/spots.js';
|
|
6
6
|
import { placeName } from '../utilities/log-style.js';
|
|
7
7
|
/**
|
|
8
8
|
* Barrier rendering (2026-08-24 playtest: "I don't see THE THING I'm
|
|
@@ -54,20 +54,16 @@ function describeBarriers(room, actor) {
|
|
|
54
54
|
// seals it and the verb that clears it, in the voice the move
|
|
55
55
|
// already uses (utilities/spots.ts terrainRefusal), rather than
|
|
56
56
|
// sending the player at a wall.
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
//
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
const sealed =
|
|
66
|
-
|
|
67
|
-
: undefined;
|
|
68
|
-
const advice = sealed
|
|
69
|
-
? terrainRefusal(sealed.region, anchor, sealed.device)
|
|
70
|
-
: `Too far to work from here -- "move to ${anchor}" for a proper look.`;
|
|
57
|
+
// THE ORDERING NOW LIVES IN sealedRouteTo, not here. The pathfind
|
|
58
|
+
// comes FIRST and is not optional: blockingRegionFor answers
|
|
59
|
+
// "would clearing this region open a path", never "is the way
|
|
60
|
+
// shut", so it names a region even when the route is already open.
|
|
61
|
+
// The first cut of this fix got that wrong and would have reported
|
|
62
|
+
// a seal on a room you could walk straight across -- which is
|
|
63
|
+
// exactly the kind of thing three sibling copies would each have
|
|
64
|
+
// had to rediscover. One copy, one place to be right.
|
|
65
|
+
const sealed = sealedRouteTo(room, actor, anchor);
|
|
66
|
+
const advice = sealed ?? `Too far to work from here -- "move to ${anchor}" for a proper look.`;
|
|
71
67
|
out += `
|
|
72
68
|
|
|
73
69
|
${header}
|
|
@@ -171,6 +167,15 @@ export class SearchCommand extends Command {
|
|
|
171
167
|
}
|
|
172
168
|
if (elsewhereSpots.length > 0) {
|
|
173
169
|
description += `\nSomething catches your eye over at the ${elsewhereSpots.join(', the ')} -- worth a closer look from there.`;
|
|
170
|
+
// "FROM THERE" HAS TO BE SOMEWHERE YOU CAN GET (2D6uZWqiWn9Mrhunc).
|
|
171
|
+
// The barrier listing above this one was fixed for exactly this and
|
|
172
|
+
// this line was left: it decides with canReach (spot equality) and
|
|
173
|
+
// then recommends a crossing the route may refuse. Only when EVERY
|
|
174
|
+
// named spot is sealed -- one walkable spot makes the advice true.
|
|
175
|
+
const seals = elsewhereSpots.map(s => sealedRouteTo(room, this.actor, s));
|
|
176
|
+
if (seals.length > 0 && seals.every(s => s !== undefined)) {
|
|
177
|
+
description += ` ${seals[0]}`;
|
|
178
|
+
}
|
|
174
179
|
}
|
|
175
180
|
// Casing a room turns up PEOPLE, not just goods: the same roll runs
|
|
176
181
|
// against anyone tucked at a cover-tagged spot, and whoever it beats
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO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,CAAC,EAAE,CAAC;YAC3E,WAAW,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW;gBAC9C,CAAC,CAAC,wGAAwG;gBAC1G,CAAC,CAAC,IAAI,CAAC,8GAA8G,CAAC,CAAC;QAC3H,CAAC;QAED,oEAAoE;QACpE,uDAAuD;QACvD,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,aAAa;eAC5D,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,EAAE,CAAC;YACpE,WAAW,IAAI,0JAA0J,CAAC;QAC5K,CAAC;QAED,qEAAqE;QACrE,iEAAiE;QACjE,kBAAkB;QAClB,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,EAAE,CAAC;YAChG,WAAW,IAAI,IAAI,CAAC,UAAU,KAAK,OAAO;gBACxC,CAAC,CAAC,6DAA6D,IAAI,CAAC,2CAA2C,CAAC,YAAY;gBAC5H,CAAC,CAAC,gGAAgG,IAAI,CAAC,8BAA8B,CAAC,YAAY,CAAC;QACvJ,CAAC;QAED,WAAW,IAAI,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAElD,OAAO,WAAW,CAAC;IACrB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from './command.js';
|
|
2
2
|
import { canReachHost } from '../utilities/planes.js';
|
|
3
|
-
import { canReach, ensureAtSpot } from '../utilities/spots.js';
|
|
3
|
+
import { canReach, ensureAtSpot, sealedRouteTo } from '../utilities/spots.js';
|
|
4
4
|
import { hint } from '../utilities/hints.js';
|
|
5
5
|
export class TakeCommand extends Command {
|
|
6
6
|
static verb = 'take';
|
|
@@ -82,7 +82,15 @@ export class TakeCommand extends Command {
|
|
|
82
82
|
items = items.filter(i => canReach(this.actor, i.atSpot));
|
|
83
83
|
if (items.length === 0 && outOfReach.length > 0) {
|
|
84
84
|
const spotsWith = [...new Set(outOfReach.map(i => i.atSpot))];
|
|
85
|
-
|
|
85
|
+
// ADVERTISE A WALK YOU CAN ACTUALLY TAKE (2D6uZWqiWn9Mrhunc). This
|
|
86
|
+
// line decided with canReach -- spot EQUALITY -- while the walk it
|
|
87
|
+
// suggests is gated by a ROUTE, so goods behind blocking terrain
|
|
88
|
+
// got "move to X" and `move` answered that X was sealed. The
|
|
89
|
+
// listing sent the player at the wall. See sealedRouteTo.
|
|
90
|
+
const sealed = sealedRouteTo(room, this.actor, spotsWith[0]);
|
|
91
|
+
return sealed
|
|
92
|
+
? `Nothing within reach -- the goods are over at the ${spotsWith.join(', the ')}. ${sealed}`
|
|
93
|
+
: `Nothing within reach -- the goods are over at the ${spotsWith.join(', the ')}. ("move to ${spotsWith[0]}")`;
|
|
86
94
|
}
|
|
87
95
|
const lines = [`You sweep ${room.name}:`];
|
|
88
96
|
let tookAnything = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"take.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/take.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"take.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/take.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAw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,CAAC,WAAW,EAAE,CAAC,CAAC;YACrD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,yBAAyB,QAAQ,UAAU,IAAI,CAAC,IAAI,0CAA0C,CAAC,CAAC;YAElH,mEAAmE;YACnE,qEAAqE;YACrE,mEAAmE;YACnE,qEAAqE;YACrE,gEAAgE;YAChE,oEAAoE;YACpE,kEAAkE;YAClE,qEAAqE;YACrE,iCAAiC;YACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC1D,IAAI,QAAQ,EAAE,CAAC;gBACb,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,sBAAsB,QAAQ,GAAG,CAAC,CAAC;YACrD,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBACtD,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC3D,CAAC;YAED,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,sBAAsB,QAAQ,GAAG,CAAC;QAE3D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gCAAgC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACnE,OAAO,aAAa,QAAQ,0BAA0B,CAAC;QACzD,CAAC;IACH,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command } from './command.js';
|
|
2
|
+
import { hostLabel } from '../utilities/grid-names.js';
|
|
2
3
|
import { rollPool, formatRoll } from '../utilities/dice.js';
|
|
3
4
|
import { accrueOverwatch } from '../utilities/overwatch.js';
|
|
4
5
|
import { MAX_MARKS } from '../utilities/marks.js';
|
|
@@ -71,11 +72,11 @@ export class TapCommand extends Command {
|
|
|
71
72
|
return `You get the housing open and find... a wire to a box on the wall. These are dumb recorders -- no host on this site for them to answer to, nothing on the other end of your cable but tape. ${hint(`Whatever they saw, they saw locally.`)}`;
|
|
72
73
|
}
|
|
73
74
|
if (host.hostCracked) {
|
|
74
|
-
return `You could -- but
|
|
75
|
+
return `You could -- but ${hostLabel(host)} is already cracked wide open, and these lenses answer to you through it. Save the cable.${hint(` ("snoop ${room.name}" rides the feeds.)`)}`;
|
|
75
76
|
}
|
|
76
77
|
const held = host.hostMarksBy.get(actor.name) ?? 0;
|
|
77
78
|
if (held >= MAX_MARKS) {
|
|
78
|
-
return `You already hold ${MAX_MARKS} marks on
|
|
79
|
+
return `You already hold ${MAX_MARKS} marks on ${hostLabel(host)} -- it thinks you belong. Another key would not fit on the ring.${hint(` ("hack" walks you in.)`)}`;
|
|
79
80
|
}
|
|
80
81
|
// THE ROLL. The camera defends with its OWN ratings, not the host's
|
|
81
82
|
// (p.233) -- that is what the cable bought -- so the threshold sits
|
|
@@ -110,11 +111,11 @@ export class TapCommand extends Command {
|
|
|
110
111
|
// its master, which is the same alarm hack.ts raises.
|
|
111
112
|
host.hostAlert = true;
|
|
112
113
|
actor.sneaking = false;
|
|
113
|
-
this.scene.addWorldEvent(`Something forced the cameras in ${room.name} --
|
|
114
|
+
this.scene.addWorldEvent(`Something forced the cameras in ${room.name} -- ${hostLabel(host)} flagged an intrusion and its ice is hunting.`);
|
|
114
115
|
this.scene.updateStatus();
|
|
115
116
|
return [
|
|
116
117
|
`The housing's tamper line trips under your fingers.`,
|
|
117
|
-
` The camera reports itself -- and
|
|
118
|
+
` The camera reports itself -- and ${hostLabel(host)} believes it. Walls UP: it holds a mark on your persona now, everything guarding this place knows someone is on the wire, and you are no longer moving unnoticed.`,
|
|
118
119
|
...godLines,
|
|
119
120
|
].join('\n');
|
|
120
121
|
}
|
|
@@ -145,12 +146,12 @@ export class TapCommand extends Command {
|
|
|
145
146
|
host.hostMarksBy.set(actor.name, now);
|
|
146
147
|
if (mode === 'attack') {
|
|
147
148
|
actor.sneaking = false;
|
|
148
|
-
this.scene.addWorldEvent(`${actor.name} forced the cameras in ${room.name} --
|
|
149
|
+
this.scene.addWorldEvent(`${actor.name} forced the cameras in ${room.name} -- ${hostLabel(host)} felt it go.`);
|
|
149
150
|
}
|
|
150
151
|
this.logger.write(`${actor.name} now holds ${now} mark(s) on ${host.name} via the ${room.name} cameras.`);
|
|
151
152
|
const lines = [
|
|
152
153
|
`{cyan-fg}The filament finds the connector and the camera stops being a camera -- it's a device, and it's talking to you.{/cyan-fg}`,
|
|
153
|
-
` {cyan-fg}It never gets to hide behind
|
|
154
|
+
` {cyan-fg}It never gets to hide behind ${hostLabel(host)}: a cable doesn't ask the network for permission, so the lens has to defend itself with what a lens has. It doesn't have much.{/cyan-fg}`,
|
|
154
155
|
` {cyan-fg}MARK PLACED -- and it lands on the host too. The camera answers to ${host.name}, and anything ${host.name} trusts to speak for it just handed you a key. [${now}/${MAX_MARKS}]{/cyan-fg}`,
|
|
155
156
|
];
|
|
156
157
|
if (mode === 'attack') {
|
|
@@ -162,10 +163,10 @@ export class TapCommand extends Command {
|
|
|
162
163
|
if (host === room) {
|
|
163
164
|
lines.push(` {cyan-fg}${now >= MAX_MARKS
|
|
164
165
|
? `The host thinks you belong now -- "hack" walks straight in.`
|
|
165
|
-
:
|
|
166
|
+
: `${hostLabel(host, { capital: true })} cracks easier with every key you hold${hint(` -- "jack in" and "hack", or come back for another lens`)}.`}{/cyan-fg}`);
|
|
166
167
|
}
|
|
167
168
|
else {
|
|
168
|
-
lines.push(` {cyan-fg}These lenses ride the site network, so the key fits
|
|
169
|
+
lines.push(` {cyan-fg}These lenses ride the site network, so the key fits ${hostLabel(host)}${hint(` -- "jack in", "go ${host.name}", "hack"`)}.{/cyan-fg}`);
|
|
169
170
|
}
|
|
170
171
|
// A mark is all canSnoopFeeds ever wanted (surveillance.ts).
|
|
171
172
|
lines.push(` {cyan-fg}And the eyes are half yours already${hint(` -- jacked in, "snoop <room>" rides any feed on this network`)}.{/cyan-fg}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tap.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/tap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACpG,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,OAAO,UAAW,SAAQ,OAAO;IAC3B,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC;IACpB,MAAM,CAAC,WAAW,GAAG,kbAAkb,CAAC;IAEld,KAAK,CAAC,OAAO,CAAC,OAAiB,EAAE;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,MAAM,IAAI,GAAG,KAAK,CAAC,eAAe,CAAC;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QAE/B,yEAAyE;QACzE,MAAM,KAAK,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QACrD,MAAM,IAAI,GAAwB,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,6BAA6B,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;QAE/G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AAC,IAAI,CAAC,CAAC;IAC1B,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Player } from '../models/player.js';
|
|
2
|
+
import type { ISaveFileV1 } from '../types/save-file.js';
|
|
3
|
+
import type { ISceneSeedJson } from '../types/seed/scene-seed.js';
|
|
4
|
+
/**
|
|
5
|
+
* THE ENGINE-SIDE CHARACTER FACTORY -- one payload in, one bootable save
|
|
6
|
+
* out, so the maka-cli.com web generator and the CLI cannot produce
|
|
7
|
+
* different runners from the same description.
|
|
8
|
+
*
|
|
9
|
+
* WHAT THIS IS NOT, because the obvious reading is wrong in two places
|
|
10
|
+
* and both were proposed before the code was read:
|
|
11
|
+
*
|
|
12
|
+
* - It is NOT `Game.buildSaveFile()` parameterised. That is a PRIVATE
|
|
13
|
+
* method on a LIVE game and it serialises contacts, gig pools, rumor
|
|
14
|
+
* indices, sprites and crew. A fresh character has none of that.
|
|
15
|
+
* - It is NOT "the path the CLI's creation walks". ui.ts builds a
|
|
16
|
+
* Player, calls outfitArchetype, and boots a Game; NO SAVE IS WRITTEN
|
|
17
|
+
* AT CREATION. The first save comes later, from a running game. There
|
|
18
|
+
* was no existing path to parameterise.
|
|
19
|
+
*
|
|
20
|
+
* What it IS: the same shape ui.ts uses to build the Player, then
|
|
21
|
+
* `serializePlayer` -- the exported serialiser the live game itself
|
|
22
|
+
* uses (utilities/persistence.ts) -- to write the player block. Sharing
|
|
23
|
+
* that function rather than restating it is the point: a second
|
|
24
|
+
* serialiser is a second thing to drift.
|
|
25
|
+
*
|
|
26
|
+
* DO NOT MODEL A SAVE ON headless-harness.ts's `save()`. It casts
|
|
27
|
+
* through `as unknown as ISaveFileV1` and omits savedAt, reason,
|
|
28
|
+
* summary, hubSeed and hub. It boots in tests and would be unreadable
|
|
29
|
+
* to the launcher's Continue menu.
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* THE PAYLOAD, frozen and co-owned with maka-cli.com. Version it here
|
|
33
|
+
* because the engine is the side that has to honour it -- same
|
|
34
|
+
* discipline as REPRO_SCHEMA_VERSION.
|
|
35
|
+
*
|
|
36
|
+
* BUMPING: MINOR for a new optional field; MAJOR when an existing field
|
|
37
|
+
* changes meaning or stops being honoured.
|
|
38
|
+
*/
|
|
39
|
+
export declare const CHARGEN_FACTORY_VERSION = "1.0.0";
|
|
40
|
+
export type ChargenGender = 'male' | 'female';
|
|
41
|
+
export interface IChargenSkill {
|
|
42
|
+
[engineSkillName: string]: number;
|
|
43
|
+
}
|
|
44
|
+
export interface IChargenPayload {
|
|
45
|
+
playerName: string;
|
|
46
|
+
/** The engine models this as a two-value enum, not free text -- see
|
|
47
|
+
* Player.gender. Validated at runtime as well as typed, because a
|
|
48
|
+
* payload arrives as JSON over a wire where a TS type enforces
|
|
49
|
+
* nothing. */
|
|
50
|
+
gender?: ChargenGender;
|
|
51
|
+
combat: Record<string, unknown> & {
|
|
52
|
+
skills?: IChargenSkill;
|
|
53
|
+
};
|
|
54
|
+
qualities?: string[];
|
|
55
|
+
augmentations?: {
|
|
56
|
+
key: string;
|
|
57
|
+
grade?: string;
|
|
58
|
+
}[];
|
|
59
|
+
/** Catalog slugs, from utilities/catalog-data.ts. */
|
|
60
|
+
gear?: {
|
|
61
|
+
slug: string;
|
|
62
|
+
qty?: number;
|
|
63
|
+
}[];
|
|
64
|
+
/** ADVISORY ONLY -- see the karma/nuyen note below. Supplied so the
|
|
65
|
+
* web generator's arithmetic can be CHECKED, not so it can win. */
|
|
66
|
+
karma?: number;
|
|
67
|
+
nuyen?: number;
|
|
68
|
+
}
|
|
69
|
+
export declare class ChargenPayloadError extends Error {
|
|
70
|
+
constructor(message: string);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Builds the Player a payload describes. Exported separately from the
|
|
74
|
+
* save so a caller that wants the live object (a preview, a dossier)
|
|
75
|
+
* does not have to serialise and re-read one.
|
|
76
|
+
*/
|
|
77
|
+
export declare function buildPlayerFromChargen(payload: IChargenPayload): Player;
|
|
78
|
+
/**
|
|
79
|
+
* The payload's save. `hubSeed` is the SHIPPED scene2 seed by ruling --
|
|
80
|
+
* it is embedded rather than referenced so a resume never depends on
|
|
81
|
+
* scene2.json still existing or still matching.
|
|
82
|
+
*/
|
|
83
|
+
export declare function createNewCharacterSave(payload: IChargenPayload, hubSeed: ISceneSeedJson): ISaveFileV1;
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { Player } from '../models/player.js';
|
|
2
|
+
import { Room } from '../models/room.js';
|
|
3
|
+
import { Item } from '../models/item.js';
|
|
4
|
+
import { Category, Size, Rating } from '../types/shared/item-enum.js';
|
|
5
|
+
import { getAug, getGrade, gradedAug, STANDARD_GRADE } from '../augmentations.js';
|
|
6
|
+
import { getQuality, creationSplit } from '../qualities.js';
|
|
7
|
+
import { findCatalogItem } from '../utilities/catalog.js';
|
|
8
|
+
import { serializePlayer } from '../utilities/persistence.js';
|
|
9
|
+
import { SAVE_VERSION } from '../types/save-file.js';
|
|
10
|
+
/**
|
|
11
|
+
* THE ENGINE-SIDE CHARACTER FACTORY -- one payload in, one bootable save
|
|
12
|
+
* out, so the maka-cli.com web generator and the CLI cannot produce
|
|
13
|
+
* different runners from the same description.
|
|
14
|
+
*
|
|
15
|
+
* WHAT THIS IS NOT, because the obvious reading is wrong in two places
|
|
16
|
+
* and both were proposed before the code was read:
|
|
17
|
+
*
|
|
18
|
+
* - It is NOT `Game.buildSaveFile()` parameterised. That is a PRIVATE
|
|
19
|
+
* method on a LIVE game and it serialises contacts, gig pools, rumor
|
|
20
|
+
* indices, sprites and crew. A fresh character has none of that.
|
|
21
|
+
* - It is NOT "the path the CLI's creation walks". ui.ts builds a
|
|
22
|
+
* Player, calls outfitArchetype, and boots a Game; NO SAVE IS WRITTEN
|
|
23
|
+
* AT CREATION. The first save comes later, from a running game. There
|
|
24
|
+
* was no existing path to parameterise.
|
|
25
|
+
*
|
|
26
|
+
* What it IS: the same shape ui.ts uses to build the Player, then
|
|
27
|
+
* `serializePlayer` -- the exported serialiser the live game itself
|
|
28
|
+
* uses (utilities/persistence.ts) -- to write the player block. Sharing
|
|
29
|
+
* that function rather than restating it is the point: a second
|
|
30
|
+
* serialiser is a second thing to drift.
|
|
31
|
+
*
|
|
32
|
+
* DO NOT MODEL A SAVE ON headless-harness.ts's `save()`. It casts
|
|
33
|
+
* through `as unknown as ISaveFileV1` and omits savedAt, reason,
|
|
34
|
+
* summary, hubSeed and hub. It boots in tests and would be unreadable
|
|
35
|
+
* to the launcher's Continue menu.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* THE PAYLOAD, frozen and co-owned with maka-cli.com. Version it here
|
|
39
|
+
* because the engine is the side that has to honour it -- same
|
|
40
|
+
* discipline as REPRO_SCHEMA_VERSION.
|
|
41
|
+
*
|
|
42
|
+
* BUMPING: MINOR for a new optional field; MAJOR when an existing field
|
|
43
|
+
* changes meaning or stops being honoured.
|
|
44
|
+
*/
|
|
45
|
+
export const CHARGEN_FACTORY_VERSION = '1.0.0';
|
|
46
|
+
export class ChargenPayloadError extends Error {
|
|
47
|
+
constructor(message) {
|
|
48
|
+
super(message);
|
|
49
|
+
this.name = 'ChargenPayloadError';
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** Wearables a runner starts already wearing. Mirrors archetypes.ts's
|
|
53
|
+
* EQUIP_ON_START, which is module-private there; kept in step by a test
|
|
54
|
+
* that compares the two sets rather than by hoping. */
|
|
55
|
+
const EQUIP_ON_START = new Set([
|
|
56
|
+
Category.Weapon, Category.MeleeWeapon, Category.RangedWeapon,
|
|
57
|
+
Category.Armor, Category.BodyArmor, Category.ArmorClothing,
|
|
58
|
+
Category.Helmet, Category.Hat, Category.Gloves, Category.Boots, Category.Commlink,
|
|
59
|
+
Category.Clothing, Category.LegArmor,
|
|
60
|
+
]);
|
|
61
|
+
/**
|
|
62
|
+
* ENUM KEY BACK TO ENUM VALUE -- the trap, in its third costume.
|
|
63
|
+
*
|
|
64
|
+
* headless-harness.ts records enum KEY vs VALUE costing two sessions an
|
|
65
|
+
* hour, and carries `enumKeyFor` for the value->key direction that a
|
|
66
|
+
* SAVED item needs. Catalog rows go the other way: catalog-data.ts
|
|
67
|
+
* declares `size: 'Tiny'` (a KEY) while the Item constructor validates
|
|
68
|
+
* against VALUES ('tiny') and throws outright on a mismatch.
|
|
69
|
+
*
|
|
70
|
+
* This function existing is not incidental -- the first cut of the gear
|
|
71
|
+
* path did not have it and died on "Invalid size value for Gel Rounds:
|
|
72
|
+
* Tiny". Left as a lesson rather than a silent fix, because the same
|
|
73
|
+
* trap will meet whoever wires the next catalog-fed feature.
|
|
74
|
+
*/
|
|
75
|
+
function enumValueFor(enumObj, given) {
|
|
76
|
+
if (given === undefined)
|
|
77
|
+
return undefined;
|
|
78
|
+
// Already a value: nothing to do.
|
|
79
|
+
if (Object.values(enumObj).includes(given))
|
|
80
|
+
return given;
|
|
81
|
+
return enumObj[given] ?? given;
|
|
82
|
+
}
|
|
83
|
+
/** A catalog row is not an Item. The conversion lives here because
|
|
84
|
+
* nothing else in the engine needed it -- `buy` works off shelf stock
|
|
85
|
+
* that is already instantiated. */
|
|
86
|
+
function itemFromSlug(slug) {
|
|
87
|
+
const row = findCatalogItem(slug);
|
|
88
|
+
if (!row) {
|
|
89
|
+
throw new ChargenPayloadError(`No catalog item with slug "${slug}". Slugs come from utilities/catalog-data.ts.`);
|
|
90
|
+
}
|
|
91
|
+
return new Item({
|
|
92
|
+
name: row.name,
|
|
93
|
+
description: row.description,
|
|
94
|
+
category: enumValueFor(Category, row.category),
|
|
95
|
+
size: (enumValueFor(Size, row.size) ?? Size.Small),
|
|
96
|
+
rating: (enumValueFor(Rating, row.rating) ?? Rating.Standard),
|
|
97
|
+
shape: row.shape ?? 'Rectangle',
|
|
98
|
+
color: row.color ?? 'Gray',
|
|
99
|
+
texture: row.texture ?? 'Plain',
|
|
100
|
+
weight: row.weight ?? 0.5,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* CANON OWNS THE CREATION LEDGER (SR5 p.71, p.94/98, via
|
|
105
|
+
* qualities.ts creationSplit): the positives are bought, the negatives
|
|
106
|
+
* refund, at most 7 karma carries into play and up to 10 more converts
|
|
107
|
+
* to nuyen at 2,000 a point.
|
|
108
|
+
*
|
|
109
|
+
* So the payload's karma and nuyen are VALIDATED against the derivation
|
|
110
|
+
* and REJECTED on mismatch -- never silently overridden. Coordinator
|
|
111
|
+
* ruling, and the reason is that a silent correction ships a web
|
|
112
|
+
* character that diverges from its CLI twin while both look fine; a
|
|
113
|
+
* rejection surfaces the generator's bug at the seam, once, with both
|
|
114
|
+
* numbers named.
|
|
115
|
+
*/
|
|
116
|
+
function ledgerFor(payload) {
|
|
117
|
+
const derived = creationSplit(payload.qualities ?? []);
|
|
118
|
+
const claims = [];
|
|
119
|
+
if (payload.karma !== undefined && payload.karma !== derived.karma) {
|
|
120
|
+
claims.push(`karma: payload says ${payload.karma}, canon derives ${derived.karma}`);
|
|
121
|
+
}
|
|
122
|
+
if (payload.nuyen !== undefined && payload.nuyen !== derived.nuyen) {
|
|
123
|
+
claims.push(`nuyen: payload says ${payload.nuyen}, canon derives ${derived.nuyen}`);
|
|
124
|
+
}
|
|
125
|
+
if (claims.length > 0) {
|
|
126
|
+
throw new ChargenPayloadError(`The creation ledger disagrees with canon (SR5 p.71/94/98). ${claims.join('; ')}. `
|
|
127
|
+
+ `Qualities given: ${(payload.qualities ?? []).join(', ') || 'none'}. `
|
|
128
|
+
+ `The engine derives both from the qualities -- fix the generator rather than the engine.`);
|
|
129
|
+
}
|
|
130
|
+
return derived;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Builds the Player a payload describes. Exported separately from the
|
|
134
|
+
* save so a caller that wants the live object (a preview, a dossier)
|
|
135
|
+
* does not have to serialise and re-read one.
|
|
136
|
+
*/
|
|
137
|
+
export function buildPlayerFromChargen(payload) {
|
|
138
|
+
if (!payload.playerName?.trim()) {
|
|
139
|
+
throw new ChargenPayloadError('A character needs a name.');
|
|
140
|
+
}
|
|
141
|
+
// The same nowhere-room ui.ts and buildPlayerFromSave both use: a
|
|
142
|
+
// Player needs somewhere to stand before a scene exists.
|
|
143
|
+
const nexus = new Room({
|
|
144
|
+
name: 'Nexus',
|
|
145
|
+
description: 'A featureless room where lost souls drift.',
|
|
146
|
+
roomType: 'void',
|
|
147
|
+
});
|
|
148
|
+
const { skills, ...attrs } = payload.combat ?? {};
|
|
149
|
+
const player = new Player({
|
|
150
|
+
playerName: payload.playerName,
|
|
151
|
+
startLocation: nexus,
|
|
152
|
+
combat: { ...attrs, skills: skills ?? {} },
|
|
153
|
+
});
|
|
154
|
+
if (payload.gender !== undefined) {
|
|
155
|
+
// Validated as well as typed: a payload crosses a wire as JSON,
|
|
156
|
+
// where a TypeScript union enforces nothing at all.
|
|
157
|
+
if (payload.gender !== 'male' && payload.gender !== 'female') {
|
|
158
|
+
throw new ChargenPayloadError(`Gender is "male" or "female" in this engine; got "${String(payload.gender)}". `
|
|
159
|
+
+ `It is a two-value enum on Player, not free text.`);
|
|
160
|
+
}
|
|
161
|
+
player.gender = payload.gender;
|
|
162
|
+
}
|
|
163
|
+
// QUALITIES FIRST: the ledger is derived from them, and addQuality is
|
|
164
|
+
// what the CLI path uses.
|
|
165
|
+
for (const key of payload.qualities ?? []) {
|
|
166
|
+
if (!getQuality(key)) {
|
|
167
|
+
throw new ChargenPayloadError(`No quality called "${key}" (see qualities.ts QUALITIES).`);
|
|
168
|
+
}
|
|
169
|
+
player.addQuality(key);
|
|
170
|
+
}
|
|
171
|
+
const ledger = ledgerFor(payload);
|
|
172
|
+
player.karma += ledger.karma;
|
|
173
|
+
// Converted karma arrives as a CREDSTICK, never a floating number --
|
|
174
|
+
// currency only counts when a carrier in the pack holds it. Same
|
|
175
|
+
// pattern as outfitArchetype and the job-payment stick.
|
|
176
|
+
if (ledger.nuyen > 0) {
|
|
177
|
+
const stick = new Item({
|
|
178
|
+
name: 'Certified Credstick (gear money)',
|
|
179
|
+
description: 'Whatever was left when the outfitting was done -- certified, anonymous, and spending fast.',
|
|
180
|
+
size: Size.Tiny, category: Category.Credstick,
|
|
181
|
+
shape: 'Rectangle', color: 'Gunmetal', texture: 'Smooth',
|
|
182
|
+
rating: Rating.Standard, weight: 0.05, transferable: true,
|
|
183
|
+
});
|
|
184
|
+
stick.addCurrency(ledger.nuyen);
|
|
185
|
+
player.addInventory(stick);
|
|
186
|
+
stick.owner = player.name;
|
|
187
|
+
}
|
|
188
|
+
// CHROME BEFORE GEAR, as at creation: essence is paid first so the
|
|
189
|
+
// Magic/Resonance burn-down lands before anything reads the totals.
|
|
190
|
+
for (const entry of payload.augmentations ?? []) {
|
|
191
|
+
const aug = getAug(entry.key);
|
|
192
|
+
if (!aug) {
|
|
193
|
+
throw new ChargenPayloadError(`No augmentation with key "${entry.key}" (see augmentations.ts).`);
|
|
194
|
+
}
|
|
195
|
+
if (entry.grade && !getGrade(entry.grade)) {
|
|
196
|
+
throw new ChargenPayloadError(`No ware grade "${entry.grade}" (see WARE_GRADES).`);
|
|
197
|
+
}
|
|
198
|
+
if (!player.hasAug(entry.key)) {
|
|
199
|
+
player.installAug(gradedAug(aug, getGrade(entry.grade) ?? STANDARD_GRADE));
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
for (const entry of payload.gear ?? []) {
|
|
203
|
+
// QTY > 1 CANNOT BE HONOURED, and is refused rather than quietly
|
|
204
|
+
// granted once. Inventory is a Map keyed by lowercased name
|
|
205
|
+
// (models/inventory.ts addItem), so adding a second Gel Rounds
|
|
206
|
+
// REPLACES the first -- a runner can hold exactly one item of any
|
|
207
|
+
// given name. Granting one where three were asked for is the
|
|
208
|
+
// "quietly does less than it says" failure this codebase keeps
|
|
209
|
+
// paying for, and it would be invisible on the payload side.
|
|
210
|
+
if (entry.qty !== undefined && entry.qty > 1) {
|
|
211
|
+
throw new ChargenPayloadError(`"${entry.slug}" was asked for qty ${entry.qty}, and this engine cannot hold it. `
|
|
212
|
+
+ `Inventory is keyed by item NAME, so a second copy replaces the first -- `
|
|
213
|
+
+ `one item per name, always. Emit a single entry, or model stacks as a rating/quantity `
|
|
214
|
+
+ `on the item itself if the catalog ever grows one.`);
|
|
215
|
+
}
|
|
216
|
+
const item = itemFromSlug(entry.slug);
|
|
217
|
+
player.addInventory(item);
|
|
218
|
+
item.owner = player.name;
|
|
219
|
+
if (EQUIP_ON_START.has(item.category)) {
|
|
220
|
+
try {
|
|
221
|
+
player.equip(item);
|
|
222
|
+
}
|
|
223
|
+
catch { /* a second weapon just stays holstered */ }
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return player;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* The payload's save. `hubSeed` is the SHIPPED scene2 seed by ruling --
|
|
230
|
+
* it is embedded rather than referenced so a resume never depends on
|
|
231
|
+
* scene2.json still existing or still matching.
|
|
232
|
+
*/
|
|
233
|
+
export function createNewCharacterSave(payload, hubSeed) {
|
|
234
|
+
const player = buildPlayerFromChargen(payload);
|
|
235
|
+
return {
|
|
236
|
+
version: SAVE_VERSION,
|
|
237
|
+
savedAt: new Date().toISOString(),
|
|
238
|
+
reason: 'creation',
|
|
239
|
+
playerName: player.name,
|
|
240
|
+
summary: {
|
|
241
|
+
archetypeName: player.archetypeName,
|
|
242
|
+
karma: player.karma,
|
|
243
|
+
currency: player.currency,
|
|
244
|
+
lifestyleTier: 'street',
|
|
245
|
+
hubName: hubSeed.name ?? 'the hub',
|
|
246
|
+
},
|
|
247
|
+
hubSeed,
|
|
248
|
+
player: serializePlayer(player),
|
|
249
|
+
game: {},
|
|
250
|
+
hub: {},
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
//# sourceMappingURL=chargen-factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chargen-factory.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/factories/chargen-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAA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