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

Clean up multibuy a bit & add an autobuy button to the badge item welcome panel #278

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Prommah
Copy link

@Prommah Prommah commented Jun 18, 2015

With multibuy, there's no need to add the old TrySpendBadgePoints function back onto the scene object to be able to access 'this', you just have to call it with trt_oldbuy.call instead, which seems cleaner.

Also added a third parameter to the replacement of TrySpendBadgePoints which will skip the multibuy popup logic. Without that, any purchase of a single item from the autobuy script will cause a popup as if the user clicked the item themselves.

With that in place, added an autobuy button which will buy 1 Like New for every 10 Wormholes, then Raining Gold, then Treasure, and one Pumped Up if there's a point left over. It does this efficiently without looping until there are no points left. Instead, it just buys each item in a single batch. It also works off of the prices given on the welcome panel instead of hard-coded values (just in case they change or something).

@Prommah Prommah changed the title Clean up the footprint of multibuy a little bit Clean up multibuy a bit & add an autobuy button to the badge item welcome panel Jun 18, 2015
@wchill
Copy link
Owner

wchill commented Jun 18, 2015

tested?

@Prommah
Copy link
Author

Prommah commented Jun 18, 2015

I tested it at the time out of the game and then in-game with a few thousand badge points and it worked great. Just tested my changes in-game now with 4.8.2 and >830k points, they appear to still work without any problems. (7546 Wormholes and 754 Like New purchased)

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.

2 participants