Skip to content

Commit cffcbab

Browse files
committed
chore: update max ap
1 parent faa4fdb commit cffcbab

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/ap-calc/commandHelp.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ const textGlobals = `Global options:
33
-h,--help Print this help text and exit
44
-s,--show-all Always show all runs, even if already possible with current AP`;
55

6-
const textCalc = `calculate:
6+
const textCalc = (max: number) => `calculate:
77
ap-calc [-vs] [--max <num>] [--node <num>] [--target <num>] <current-ap> [<current-timer>]
88
99
Options:
10-
-m,--max Override for Max AP (Default: 144)
10+
-m,--max Override for Max AP (Default: ${max})
1111
-n,--node Node Cost (shows all possible (future) runs; optional)
1212
-t,--target Sets target AP (optional)
1313
@@ -34,13 +34,13 @@ const textPrev = `prev:
3434
3535
Alias for running the script as "history prev"`;
3636

37-
export function commandHelp(positionals: string[]) {
37+
export function commandHelp(positionals: string[], max: number) {
3838
let text = `AP Calculator\n\n${textGlobals}`;
3939
const param = positionals.find(str => str != "help");
4040

4141
switch (param) {
4242
case "calculate":
43-
text += `\n\n${textCalc}`;
43+
text += `\n\n${textCalc(max)}`;
4444
break;
4545
case "history":
4646
text += `\n\n${textHistory}`;

src/ap-calc/script.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { join } from "path";
77
import { ScriptHistory } from "./ScriptHistory";
88
import { commandHelp } from "./commandHelp";
99

10+
const MAX_AP = 148;
11+
1012
const timer = createTimer();
1113
const globalOpts = {
1214
verbose: { type: "boolean", short: "v", default: false },
@@ -55,7 +57,7 @@ function commandCalculate() {
5557
args: process.argv.slice(2),
5658
options: {
5759
...globalOpts,
58-
max: { type: "string", short: "m", default: "144" },
60+
max: { type: "string", short: "m", default: MAX_AP.toString() },
5961
target: { type: "string", short: "t" },
6062
node: { type: "string", short: "n" }
6163
},
@@ -68,7 +70,7 @@ function commandCalculate() {
6870
value: args.values.max,
6971
name: "--max",
7072
min: 20,
71-
fallback: 144
73+
fallback: MAX_AP
7274
});
7375
const nodeCost = parseNumericArg({
7476
value: args.values.node,
@@ -126,7 +128,7 @@ async function main() {
126128

127129
// handle help command
128130
if (argsInit.values.help || firstPositional == "help") {
129-
commandHelp(argsInit.positionals);
131+
commandHelp(argsInit.positionals, MAX_AP);
130132
return;
131133
}
132134

0 commit comments

Comments
 (0)