EFHIII / balatro-calculator

A tool for calculating the score of a hand in Balatro
MIT License
70 stars 11 forks source link

Where did you find the formula for hand levels? #53

Closed geajack closed 6 months ago

geajack commented 6 months ago

Hi, I'm just wondering where you found the formula and the constants that give you the chips/mult for each hand, for each hand level:

function incrementLevel(inc, handIndex)
{
    const hand = hands[handIndex];
    const div = document.getElementById(hand.id);
    hand.level += inc;
    if(hand.level < 0) hand.level = 0;
    hand.mult = Math.max(1, hand.s_mult + (hand.level-1) * hand.l_mult);
    hand.chips = Math.max(0, hand.s_chips + (hand.level-1) * hand.l_chips);
    div.children[2].innerText = 'lvl.'+hand.level;
    div.children[2].style.backgroundColor = hand.level === 1 ? handColors[0] : handColors[((Math.ceil(Math.abs(hand.level)/6)*6+hand.level+4)%6)+1];
    div.children[4].children[0].innerText = numberWithCommas(hand.chips);
    div.children[4].children[1].innerText = numberWithCommas(hand.mult);

    redrawPlayfield();
}

Thanks!

kletellier commented 6 months ago

Probably by opening the exe (rename it 7z instead of exe extension, and open the archive you can read all the source code in LUA)

EFHIII commented 6 months ago

It's lines 1948-1961 of game.lua (as of 1.0.0L; I'm looking at a slightly outdated version) using 7zip on the game executable (like kletellier mentioned) is one way to get the source files. You don't need to rename it though; you can just right click & extract.

image