pf2e-sage-stats 0.4.6 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.d.ts +1 -1
- package/dist/app.js +3 -3
- package/dist/index.js +5 -3
- package/package.json +1 -1
package/dist/app.d.ts
CHANGED
|
@@ -718,7 +718,7 @@ export declare const parseStatblock: (name: string | null, _statblock: string, a
|
|
|
718
718
|
export declare const flatten: (stats: Schema, secretDC?: boolean, defaultSkills?: boolean) => Record<string, string | number>;
|
|
719
719
|
export declare const formatTSV: (stats: Schema, secretDC?: boolean, defaultSkills?: boolean) => string;
|
|
720
720
|
export declare const formatCommand: (stats: Schema, secretDC?: boolean, defaultSkills?: boolean) => string;
|
|
721
|
-
export declare const formatTable: (table: string, season: string, scenario: string, _name: string, gm: string, players: string) => string;
|
|
721
|
+
export declare const formatTable: (table: string, season: string, scenario: string, _name: string, gm: string, players: string, category: string, gmCharName?: string) => string;
|
|
722
722
|
export declare const formatHP: (arg: string) => string;
|
|
723
723
|
export declare const newtracker: (status: string, desc: {
|
|
724
724
|
title?: string;
|
package/dist/app.js
CHANGED
|
@@ -589,16 +589,16 @@ const formatTSV = (stats, secretDC = false, defaultSkills = false) => (tsv_1.TSV
|
|
|
589
589
|
exports.formatTSV = formatTSV;
|
|
590
590
|
const formatCommand = (stats, secretDC = false, defaultSkills = false) => (Object.entries((0, exports.flatten)(stats, secretDC, defaultSkills)).map(([k, v]) => `${k}="${v}"`).join(' '));
|
|
591
591
|
exports.formatCommand = formatCommand;
|
|
592
|
-
const formatTable = (table, season, scenario, _name, gm, players) => {
|
|
592
|
+
const formatTable = (table, season, scenario, _name, gm, players, category, gmCharName) => {
|
|
593
593
|
const name = _name.replace(/[\s-_]/g, ' ').replace(/[^a-zA-Z0-9 ]/g, '');
|
|
594
594
|
const gameName = `PF2 T${table} S${season} ${String(scenario).padStart(2, '0')} ${name}`;
|
|
595
595
|
const tableName = `pf2-t${table}-s${season}${String(scenario).padStart(2, '0')}-${(0, lodash_1.kebabCase)(name)}`;
|
|
596
596
|
return (0, dedent_js_1.default) `
|
|
597
597
|
\`\`\`
|
|
598
|
-
@TableBot create "${gameName}" --gm ${gm} --players ${players} --table-name ${tableName} --ooc-table-name ooc-${tableName} --category
|
|
598
|
+
@TableBot create "${gameName}" --gm ${gm} --players ${players} --table-name ${tableName} --ooc-table-name ooc-${tableName} --category ${category}
|
|
599
599
|
\`\`\`
|
|
600
600
|
\`\`\`
|
|
601
|
-
sage! game create name="${gameName}" gameSystem="pf2e" ic=" #${tableName} " ooc=" #ooc-${tableName} " gms=" ${gm} " players=" @${gameName} " dialogPost="post" diceSecret="gm" diceCrit="timestwo" diceOutput=L gmCharName="
|
|
601
|
+
sage! game create name="${gameName}" gameSystem="pf2e" ic=" #${tableName} " ooc=" #ooc-${tableName} " gms=" ${gm} " players=" @${gameName} " dialogPost="post" diceSecret="gm" diceCrit="timestwo" diceOutput=L${gmCharName ? ` gmCharName="${gmCharName}"` : ''}
|
|
602
602
|
\`\`\`
|
|
603
603
|
`;
|
|
604
604
|
};
|
package/dist/index.js
CHANGED
|
@@ -35,14 +35,16 @@ program.command('table')
|
|
|
35
35
|
.option('-s, --season <string>', 'season')
|
|
36
36
|
.option('-c, --scenario <string>', 'scenario')
|
|
37
37
|
.option('-g, --gm <string>', 'gm')
|
|
38
|
+
.option('-m, --gmname <string>', 'gm character')
|
|
39
|
+
.option('-d, --category <string>', 'category')
|
|
38
40
|
.option('-p, --players <string>', 'players')
|
|
39
41
|
.action(async (argument, option) => {
|
|
40
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
42
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
41
43
|
if (option.output) {
|
|
42
|
-
await promises_1.default.writeFile(option.output, (0, app_1.formatTable)((_a = option.table) !== null && _a !== void 0 ? _a : '1', (_b = option.season) !== null && _b !== void 0 ? _b : '1', (_c = option.scenario) !== null && _c !== void 0 ? _c : '1', argument, (_d = option.gm) !== null && _d !== void 0 ? _d : '@lammonaaf', (_e = option.players) !== null && _e !== void 0 ? _e : '<players>'), { encoding: 'utf-8' });
|
|
44
|
+
await promises_1.default.writeFile(option.output, (0, app_1.formatTable)((_a = option.table) !== null && _a !== void 0 ? _a : '1', (_b = option.season) !== null && _b !== void 0 ? _b : '1', (_c = option.scenario) !== null && _c !== void 0 ? _c : '1', argument, (_d = option.gm) !== null && _d !== void 0 ? _d : '@lammonaaf', (_e = option.players) !== null && _e !== void 0 ? _e : '<players>', (_f = option.category) !== null && _f !== void 0 ? _f : 'Game Tables', option.gmname), { encoding: 'utf-8' });
|
|
43
45
|
}
|
|
44
46
|
else {
|
|
45
|
-
console.log((0, app_1.formatTable)((
|
|
47
|
+
console.log((0, app_1.formatTable)((_g = option.table) !== null && _g !== void 0 ? _g : '1', (_h = option.season) !== null && _h !== void 0 ? _h : '1', (_j = option.scenario) !== null && _j !== void 0 ? _j : '1', argument, (_k = option.gm) !== null && _k !== void 0 ? _k : '@lammonaaf', (_l = option.players) !== null && _l !== void 0 ? _l : '<players>', (_m = option.category) !== null && _m !== void 0 ? _m : 'Game Tables', option.gmname));
|
|
46
48
|
}
|
|
47
49
|
});
|
|
48
50
|
program.command('hp')
|