mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-26 19:14:32 +02:00
API: Add donationForRep() to Formulas (#1141)
This commit is contained in:
@@ -37,7 +37,7 @@ import {
|
||||
calculateAscensionPointsGain,
|
||||
} from "../Gang/formulas/formulas";
|
||||
import { favorToRep as calculateFavorToRep, repToFavor as calculateRepToFavor } from "../Faction/formulas/favor";
|
||||
import { repFromDonation } from "../Faction/formulas/donation";
|
||||
import { repFromDonation, donationForRep } from "../Faction/formulas/donation";
|
||||
import { InternalAPI, NetscriptContext, setRemovedFunctions } from "../Netscript/APIWrapper";
|
||||
import { helpers } from "../Netscript/NetscriptHelpers";
|
||||
import { calculateCrimeWorkStats } from "../Work/Formulas";
|
||||
@@ -128,6 +128,12 @@ export function NetscriptFormulas(): InternalAPI<IFormulas> {
|
||||
checkFormulasAccess(ctx);
|
||||
return repFromDonation(amount, person);
|
||||
},
|
||||
donationForRep: (ctx) => (_reputation, _player) => {
|
||||
const reputation = helpers.number(ctx, "reputation", _reputation);
|
||||
const person = helpers.person(ctx, _player);
|
||||
checkFormulasAccess(ctx);
|
||||
return donationForRep(reputation, person);
|
||||
},
|
||||
},
|
||||
skills: {
|
||||
calculateSkill:
|
||||
|
||||
Reference in New Issue
Block a user