User:4e696e6a6f795844/Sandbox3

Luck is an invisible statistic that influences the random nature of various activities in Terraria. There are various ways to increase and decrease this statistic, ranging from Buff potions to Torch placement.

For many random chances in the game, the chance is represented in the code in a 1/x format. When this is combined with luck, there are two possibilities for players with non-zero luck:
 * If the player's luck is > 0, there is a luck/1 chance that 1/x will become 1/(x/2); i.e. the rate doubles.
 * If the player's luck is < 0, there is a -luck/1 chance that 1/x will become 1/(x*2); i.e. the rate halves.

Players can max out their luck at 1, but their luck cannot go below -.7.

Influence
Luck is impacted by Ladybugs, the placement of Torches, Lucky (buff), Lantern Nights, and Garden Gnomes.

Ladybug Luck
The player has a ladybug luck timer which always decreases to 0. It mostly relates to interactions with, as well as a few other NPCs.
 * If the player touches a ladybug that has been released by a player (intersecting hitboxes), then they will receive "good ladybug luck" for 12 minutes. This is doubled for golden ladybugs.
 * If the player touches the ladybug from more than 30 pixels away, it is possible that the number will be slightly reduced, but the difference is barely noticeable.
 * If a player kills a ladybug, they will receive "bad ladybug luck" for 3 minutes. This is doubled to 6 minutes if the ladybug was golden.
 * Regardless of whether it is golden or not, there is also an increased chance of rain for the next 30 seconds.
 * If the player kills the Guide, their "good ladybug luck" is active for the next 12 minutes. Conversely, killing any other Town NPC (except for the Clothier) will activate bad ladybug luck for the next 3 minutes.
 * There is no counter stopping players from swapping their luck back and forth, so as long as the player releases and touches a ladybug after killing one, their luck will become good again.

luck = GetLadyBugLuck * 0.2f + torchLuck * 0.2f; luck += (float)(int)luckPotion * 0.1f; if (LanternNight.LanternsUp) {				luck += 0.3f; }			if (HasGardenGnomeNearby) {				luck += 0.2f; }

Impact
all foodstuffs

Ale, Bowl of Soup, Pumpkin Pie, Christmas Pudding, Eggnog, Sugar Cookie, Gingerbread Cookie, Sake, Pad Thai, Pho, Cooked Fish, Cooked Shrimp, Sashimi, Grub Soup, Bacon (major ?m), Apple, Apple Pie Slice, Apple Pie, Banana Split, BBQ Ribs, Bunny Stew, Burger, Chicken Nugget, Chocolate Chip Cookie, Cream Soda, Escargot, Fried Egg, Fries, Golden Delight, Grapes, Grilled Squirrel, Hotdog, Ice Cream, Milkshake, Nachos, Pizza, Potato Chips, Roasted Bird, Roasted Duck, Sauteed Frog Legs, Seafood Dinner, Shrimp Po' Boy, Spaghetti, Steak, Marshmallow, Cooked Marshmallow, Apricot, Banana, Blackcurrant, Blood Orange, Cherry, Coconut, Dragon Fruit, Elderberry, Grapefruit, Lemon, Mango, Peach, Pineapple, Plum, Rambutan, Star Fruit, Lobster Tail, Shucked Oyster, Apple Juice, Grape Juice, Lemonade, Frozen Banana Daiquiri, Peach Sangria, Pina Colada, Tropical Smoothie, Bloody Moscato, Smoothie of Darkness, Prismatic Punch, Fruit Juice, Fruit Salad, Teacup, Coffee, Carton of Milk

looks like

are unimplemented