CONTRACTS: Proposal for Contract Progression System (#2230)

This commit is contained in:
gmcew
2025-07-10 22:25:36 +01:00
committed by GitHub
parent c5799616ce
commit 3fc65a2de4
9 changed files with 21 additions and 16 deletions
+1 -1
View File
@@ -92,7 +92,6 @@ export function NetscriptCodingContract(): InternalAPI<ICodingContract> {
const filename = helpers.string(ctx, "filename", _filename);
const host = _host ? helpers.string(ctx, "host", _host) : ctx.workerScript.hostname;
const contract = getCodingContract(ctx, host, filename);
return structuredClone(contract.getData());
},
getContract: (ctx) => (_filename, _host?) => {
@@ -109,6 +108,7 @@ export function NetscriptCodingContract(): InternalAPI<ICodingContract> {
return attemptContract(ctx, server, contract, answer);
},
description: contract.getDescription(),
difficulty: contract.getDifficulty(),
numTriesRemaining: () => {
helpers.checkEnvFlags(ctx);
return contract.getMaxNumTries() - contract.tries;