Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: Add donationForRep() to Formulas #1141

Merged
merged 5 commits into from
Feb 12, 2025

Conversation

LJNeon
Copy link
Contributor

@LJNeon LJNeon commented Mar 6, 2024

This was motivated by a player asking if there was a formulas method to calculate the donation needed to gain an amount of reputation, noting that one existed to calculate the reputation gained from a donation.

With that in mind, these methods simply implement the formulas shown in the faction UI:

ns.formulas.reputation.calculateRepToFavor();
ns.formulas.reputation.repFromDonation();

And there's already an inverse method for the first one:

ns.formulas.reputation.calculateFavorToRep();

But there was no inverse method for the second one, which is why this PR is adding this:

ns.formulas.reputation.donationForRep();

@d0sboots
Copy link
Collaborator

d0sboots commented Mar 7, 2024

Seems good.

@jjclark1982
Copy link
Contributor

related to #976

@LJNeon
Copy link
Contributor Author

LJNeon commented Feb 11, 2025

Did some basic testing and the new formulas method appears to work as intended.

@d0sboots d0sboots merged commit 30075f3 into bitburner-official:dev Feb 12, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants