Дерево/Потрясывание/row

It automatically calculates the correct chance from a given input taking into consideration all previous chances. This is necessary because it is not correct to claim that the line else if (genRand.Next(35) == 0) somewhere inside the if-else tree in ShakeTree() is identical to a flat 1/35 chance. (Instead, one must take into consideration all previous if and else if checks.) Typically, there are also other conditions aside from just the chance, such as Halloween being active or that it is daytime. This subpage is capable of recognizing that and printing differentiated chances.

Pass the tree drop as the parameter item, the chance as in the source code as the parameter chance, the tree type as the parameter treetypes, and the condition as the parameter conditions. The chance must be in a <numerator>/<denominator> format, e.g. 1/35 or 2/7. Valid values for tree types and conditions are forest, boreal, jungle, corrupt, crimson, hallowed, palm, corrupt palm, crimson palm, hallowed palm, ash, mushroom and day, night, halloween, notoasis, underworld, respectively; separate multiple with a comma.

For debugging, set $debug to on/off.


В статьи использованы материалы сайта terraria-game.fandom.com, в соответствии с условиями лицензии CC-BY-SA.
Бонди

Игровые новости, вики • 2025—2026