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

Fixed Bugs with Badge Points Which were Breaking Auto Upgrades #341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions autoPlay.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,23 +354,31 @@
var badgePoints = w.g_Minigame.CurrentScene().m_rgPlayerTechTree.badge_points;

// Determine how many other things to buy
var buy_count = (w.g_steamID % 10) + 1;
var buy_count = Math.min((w.g_steamID % 10) + 1, Math.floor(badgePoints / 200));

// Buy some
w.g_Minigame.CurrentScene().TrySpendBadgePoints( w.$J("<a data-type='25' data-cost='200'></a>"), buy_count );
if (buy_count > 0) {
w.g_Minigame.CurrentScene().TrySpendBadgePoints( w.$J("<a data-type='25' data-cost='200'></a>"), buy_count );
}
badgePoints -= buy_count*200;

// How many WH/LN do we buy too?
var purchaseCount = Math.floor(badgePoints / 200);

// Buy mostly WH
w.g_Minigame.CurrentScene().TrySpendBadgePoints( w.$J("<a data-type='26' data-cost='100'></a>"), purchaseCount );
if (purchaseCount > 0) {
w.g_Minigame.CurrentScene().TrySpendBadgePoints( w.$J("<a data-type='26' data-cost='100'></a>"), purchaseCount );
}

// Buy a few LN
w.g_Minigame.CurrentScene().TrySpendBadgePoints( w.$J("<a data-type='27' data-cost='100'></a>"), purchaseCount );
if (purchaseCount > 0) {
w.g_Minigame.CurrentScene().TrySpendBadgePoints( w.$J("<a data-type='27' data-cost='100'></a>"), purchaseCount );
}

//Rest is Pumped Up
w.g_Minigame.CurrentScene().TrySpendBadgePoints(w.$J("<a data-type='19' data-cost='1'></a>"), badgePoints % 100 );
if ((badgePoints % 100) > 0) {
w.g_Minigame.CurrentScene().TrySpendBadgePoints(w.$J("<a data-type='19' data-cost='1'></a>"), badgePoints % 100 );
}
}

function updateLaneData() {
Expand Down