-
Notifications
You must be signed in to change notification settings - Fork 12
05. Helper Functions
Use these functions while writing definitions.
Returns scoring information about a set of cards. You can get the full precalculated hand using JokerDisplay.current_hand.
-
Optional parameters:
-
cards: Cards to calculate. Defaults to current precalculated handJokerDisplay.current_hand. -
count_facedownsIftrue, counts cards facing back.
-
-
Returns:
-
text: Scoring poker hand's non-localized text. "Unknown" if there's a card facedown or if selected cards are not valid. -
poker_hands: Poker hands contained in the scoring hand. -
scoring_hand: Scoring cards in hand.
-
Returns what Joker the current Blueprint-like card is copying. See get_blueprint_joker.
-
Required parameters:
-
card: Blueprint-like card to calculate copy for.
-
-
Returns:
-
copied_joker: Copied Joker card. -
is_debuffed: If the copied card (or any in the chain) is debuffed.
-
Copies an in-play Joker's display. Use with JokerDisplay.calculate_blueprint_copy, see Blueprint's definition for more details.
-
Required parameters:
-
card: Card that is copying.
-
-
Optional parameters:
-
copied_joker: Joker being copied. Initializes default display if nil. -
is_debuffed: If Joker is debuffed by other means. -
bypass_debuff: Bypass debuff. -
stop_func_copy: Don't copy other functions such as mod_function, retrigger_function, etc.
-
Returns all held instances of certain Joker, including Blueprint copies.
-
Required parameters:
-
key: Key of the Joker to find.
-
-
Optional parameters:
-
count_debuffed: Iftruealso returns debuffed cards.
-
-
Returns:
- All Jokers found, including Jokers with copy abilities.
Sort cards from left to right.
-
Required parameters:
-
cards: Cards to sort.
-
-
Returns:
- Sorted cards.
Returns the leftmost card in a set of cards.
-
Required parameters:
-
cards: Cards to calculate.
-
-
Returns:
- Leftmost card in hand if any.
Returns the rightmost card in a set of cards.
-
Required parameters:
-
cards: Cards to calculate.
-
-
Returns:
- Rightmost card in hand if any.
Returns how many times the scoring card would be triggered for scoring if played.
-
Required parameters:
-
card: Card to calculate.
-
-
Optional parameters:
-
scoring_hand: Scoring hand. -
held_in_hand:trueif the card is held in hand and not a scoring card.
-
-
Returns:
- Times the card would trigger. (0 if debuffed)
Returns what modifiers the other Jokers in play add to the this Joker card.
-
Required parameters:
-
card: Joker to calculate.
-
-
Returns:
- Modifiers table.
Returns if hand triggers (boss) blind. See blind definition docs.
-
Required parameters:
-
blind: Blind to calculate. -
textScoring poker hand's non-localized text. "Unknown" if there's a card facedown or if selected cards are not valid. -
poker_handsPoker hands contained in the scoring hand. -
scoring_handScoring cards in hand. -
full_handFull hand.
-
-
Returns:
-
trueif it triggers the blind,falseotherwise.nilif unknown (blind is not defined).
-
Returns how many times the Joker would be triggered if activated. See "retrigger_type" field and retrigger_joker_function.
-
Required parameters:
-
card: Joker to calculate.
-
-
Returns:
- Times the card would trigger. (0 if debuffed)
Creates an object with JokerDisplay configurations.
-
Required parameters:
-
card: Reference card. -
display_config: Node configuration. See Joker definition docs.
-
-
Optional parameters:
-
defaults_config: Defaults for all text objects.
-
-
Returns:
- Display object.
Formats number.
-
Required parameters:
-
num: Number to format. Accepts Talisman's bignum/omeganum.
-
-
Optional parameters:
-
e_switch_point: Number from where to switch to scientic notation. Defaults to 1000000. -
places: Maximum decimal places. Defaults to 2.
-
-
Returns:
- The formatted string or
numif it's not a number.
- The formatted string or
Splits text by a separator.
-
Required parameters:
-
str: String to split.
-
-
Optional parameters:
-
sep: Separator. Defaults to whitespace.
-
-
Returns:
-
split_text: Table with the split substrings.
-
Deep copies a table. (Not recursive).
-
Required parameters:
-
orig: Table to copy.
-
-
Returns:
-
copy: Copied table.
-