Merge pull request #3193 from t-wolfeadam/feature/corp-api-bonustime

Implement getBonusTime in Corporation API
This commit is contained in:
hydroflame 2022-03-20 14:13:35 -04:00 committed by GitHub
commit 7e3a5e76c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

@ -846,5 +846,9 @@ export function NetscriptCorporation(
const amountShares = helper.number("bribe", "amountShares", aamountShares); const amountShares = helper.number("bribe", "amountShares", aamountShares);
return bribe(factionName, amountCash, amountShares); return bribe(factionName, amountCash, amountShares);
}, },
getBonusTime: function (): number {
checkAccess("getBonusTime");
return Math.round(getCorporation().storedCycles / 5) * 1000;
}
}; };
} }

@ -6665,6 +6665,17 @@ export interface Corporation extends WarehouseAPI, OfficeAPI {
* *
*/ */
sellShares(amount: number): void; sellShares(amount: number): void;
/**
* Get bonus time.
*
* Bonus time is accumulated when the game is offline or if the game is inactive in the browser.
*
* Bonus time makes the game progress faster.
*
* @returns Bonus time for the Corporation mechanic in milliseconds.
*/
getBonusTime(): number;
} }
/** /**