Skip to content

Contexts

RattlingSnow353 edited this page Jan 5, 2026 · 6 revisions

Contexts

Detailed here is a list of all contexts that are sent to calculate functions by this mod, as well as a unique identifier to use to reference them. As each context is sent to different areas, use the following logic statement to make sure you are calculating in the intended area.

if context.aij_before_before and context.scoring_name == 'High Card' then -- Triggers before evaluating played hand and check if it would've been 'High Card'

Main Scoring Loop

This context is used right before the poker hand is set, mainly used to make changes to said poker hand.

if context.aij_before_before then 
{ 
    full_hand = G.play.cards,
    scoring_hand = fake_scoring_hand, 
    scoring_name = fake_text, 
    poker_hands = fake_poker_hands,
    aij_before_before = true,
}

This context is used right before the scores are set, can be used to change or reset total_chips, chips, or mult.

if context.all_in_jest and context.all_in_jest.before_after then 
{ -- these are outside of all_in_jest so just have context come before ex: 'context.full_hand'
    full_hand = G.play.cards,
    scoring_hand = scoring_hand, 
    scoring_name = text, 
    poker_hands = poker_hands,
    total_chips = math.floor(hand_chips*mult),
    all_in_jest = {
        before_after = true,
    }
}

This context triggers right before an edition triggers.

if context.all_in_jest and context.all_in_jest.calculating_edition then 
{
    area = card.area,
    edition = card.edition,  
    other_card = card,
    calculating_edition = true,
}

This context is used right after cards would have been drawn, this is triggered regardless of weather cards were actually drawn.

if context.all_in_jest and context.all_in_jest.drew_cards then 
{
    drew_cards = true,
}

Other Contexts

This context is triggered whenever a joker with an ability is used.

if context.all_in_jest and context.all_in_jest.using_ability then 
{
    area = card.from_area,
    card = card,
    using_ability = true,
}

This context is used for modifying cards from a booster pack when opening them.

if context.all_in_jest and context.all_in_jest.modify_booster_cards then 
{
    modify_booster_cards = true,
    card = self, -- The Booster Pack
    using_ability = true, -- Check if true if you're modifying the cards before they appear
    pack_cards = pack_cards, -- Cards in pack
    before_added = true -- There is a separate context call with this being true and false (nil) this call before the cards are added and after
}

This context is used for modifying or changing cards from a booster pack before they are created.

if context.all_in_jest and context.all_in_jest.before_create_booster_cards then 
{
    before_create_booster_cards = true,
    card = self, -- The Booster Pack
    pack_card = card, -- Cards in pack (call for each card in the pack)
}

This context triggers right before using a consumable.

if context.all_in_jest and context.all_in_jest.before_using_consumeable then 
{
    area = area,
    consumeable = self, 
    before_using_consumeable = true,
}

This context is triggered whenever a joker is destroyed or sold.

if context.jest_destroying_or_selling_joker then 
{
    jest_destroyed_joker = self,
    jest_destroying_or_selling_joker = true,
}

This context is triggered whenever a joker is destroyed and not sold.

if context.jest_destroying_card then 
{
    jest_destroyed_joker = self,
    jest_destroying_card = true,
}

This context is called right before the items in shop are actually rerolled, instead of after.

if context.all_in_jest and context.all_in_jest.before_reroll_shop then 
{
    before_reroll_shop = true,
    cost = reroll_cost, -- Self explanatory
}


This context is used whenever shop starts, usually used for adding stuff or changing initial stuff in shop.

if context.entering_shop then 
{
    entering_shop = true,
}

This context is used whenever cashing out.

if context.cashing_out then 
{
    cashing_out = true,
}

Clone this wiki locally