GANG: Clarify install behavior & add getInstallResult() (#1119)

New function returns post-install ascension ratios.

* Add ascension penalty to Gang constants
* Improve wording of Gang install message
* Add GangMember#getInstallResults()
* Update prestiging to use getInstallResults()
* Add ns.gang.getInstallResults(memberName)
* Update definitions
* Add ram cost for ns.gang.getInstallResult()
* Fix typo
* More specific wording in documentation
* Fix another typo
* Run prettier
* Rename getInstallResults to getPostInstallPoints
* Update Prestige.ts
* Update Gang.ts
This commit is contained in:
LJ
2024-02-23 13:58:22 -07:00
committed by GitHub
parent d00fad472e
commit f6871f0911
7 changed files with 69 additions and 9 deletions
+16
View File
@@ -297,6 +297,22 @@ export function NetscriptGang(): InternalAPI<IGang> {
...member.getAscensionResults(),
};
},
getInstallResult: (ctx) => (_memberName) => {
const memberName = helpers.string(ctx, "memberName", _memberName);
getGang(ctx);
const member = getGangMember(ctx, memberName);
if (!member.canAscend()) return;
const preInstall = member.getCurrentAscensionMults();
const postInstall = member.getPostInstallPoints();
return {
hack: member.calculateAscensionMult(postInstall.hack) / preInstall.hack,
str: member.calculateAscensionMult(postInstall.str) / preInstall.str,
def: member.calculateAscensionMult(postInstall.def) / preInstall.def,
dex: member.calculateAscensionMult(postInstall.dex) / preInstall.dex,
agi: member.calculateAscensionMult(postInstall.agi) / preInstall.agi,
cha: member.calculateAscensionMult(postInstall.cha) / preInstall.cha,
};
},
setTerritoryWarfare: (ctx) => (_engage) => {
const engage = !!_engage;
const gang = getGang(ctx);