Luck

Luck increases the quality of rewards you receive on average from chests, shrines, Moai statues, level-up rewards, and Shady Guys.
 
For all of these except the Shady Guy, rewards are rolled at the moment you interact with them. This means the outcome depends on your current Luck at the time you open a chest, charge a shrine, or interact with a Moai statue.
 
The Shady Guy works differently. Their "inventory" is fixed as soon as you enter the stage. As a result, the items they sell are rolled based on your Luck at stage entry and do not change afterward even if you increase your luck.

Explanation and numbers

How lucks work behind the scene is that you are less likely to gain common items and more likely to gain more rare items. Below is a graph that showcases your chances of getting a legendary item from a chest depending on your luck up to 10 000% luck:
 Pasted image 
Here is a table that showcases your approximate chances of getting a legendary vs a common for different luck percentages.
 
Luck %Common %Rare %Epic %Legendary %
075.68%16.22%6.49%1.62%
2571.94%17.66%8.09%2.32%
5068.52%18.79%9.62%3.08%
10062.43%20.39%12.43%4.74%
25048.47%22.25%19.07%10.21%
50033.80%21.54%25.62%19.04%
100019.20%17.69%30.42%32.69%
25006.56%10.20%29.59%53.66%
50002.41%5.64%24.64%67.32%
100000.80%2.83%18.75%77.62%
250000.17%1.05%12.04%86.74%
500000.05%0.47%8.31%91.16%
1000000.01%0.21%5.64%94.14%
You will never quite reach a 100% chance to get legendaries. You will have a 99% chance for getting legendaries when you have ~1,886,388% luck.
 

Moai Luck modes

Moai statues can roll using a scaled version of your Luck (and in one mode, Luck is ignored).
You might know that you can get a special "legendary" Moai, where no matter how many time you refresh, you will only get legendary rewards from. But there are actually 4 total different "modes" of Moai statues.
 
Mode 0: This is a moai you only get 2 options from instead of the usual 3. For these statues, your luck is only half as effective. MoaiLuck = Luck * 0.5
Mode 1: MoaiLuck = Luck * 1 (normal moais, scales 1:1 with luck)
Mode 2: MoaiLuck = Luck * 1.5 (slightly more lucky rewards)
Mode 3: Luck is ignored, and every reward is always a legendary, no matter how much you refresh.
 
There is no way in game to know if you have a mode 1 or 2 Moai. You can tell you have a mode 0 if there is only 2 rewards. And you can obviously tell if you have a mode 3 if you have all legendaries. (Although with very high luck you can get 3 legendaries from a moai without it being a mode 3. This is quite unusual and highly improbable without a very high luck%)
 

Math formula

How Luck reshapes rarity is done with a weighted random roll. Mathematically it can be explained like this:
 
Base weights (at minimum Luck):
Common $W_0^{base}=70$,
Rare $W_1^{base}=15$,
Epic $W_2^{base}=6$,
Legendary $W_3^{base}=1.5$.
 
Luck strength (log scale, causes diminishing returns):
 
 
$$S = \ln\left(\frac{Luck}{100} + 1\right) \cdot 1.5$$
 
 
Adjusted weight for rarity $i$ (0 = Common, 3 = Legendary), with $A=1.5$:
 
 
$$W_i = W_i^{base} \cdot A^{-(3-i) \cdot S}$$
 
 
Common ($i=0$) is reduced the most; Legendary ($i=3$) is not reduced. Weights are then turned into probabilities:
 
 
$$P_i = \frac{W_i}{\sum_j W_j}$$
 
 
 $P_i$ is the chance to roll that rarity in game.
 

Credits for the contribution

The majority of the research in this article was conducted by Adorise.