Esempio n. 1
0
def get_impact(k: int):
    return conv_syms.ConvertSymbols(
        conversion_policy=conv_pol.get_conversion_policy_attack(
            convertible_symbols=(sym.Hit, ),
            conversion_target=sym.Crit(),
        ),
        conversion_limit=k,
    )
Esempio n. 2
0
def get_pierce(k: int):
    return conv_syms.ConvertSymbols(
        conversion_policy=conv_pol.get_conversion_policy_defence(
            convertible_symbols=(sym.Block, ),
            conversion_target=sym.Blank(),
        ),
        conversion_limit=k,
    )
Esempio n. 3
0
def block_hits(k: Optional[int]):
    return conv_syms.ConvertSymbols(
        conversion_policy=conv_pol.get_conversion_policy_attack(
            convertible_symbols=(sym.Hit, ),
            conversion_target=sym.Blank(),
        ),
        conversion_limit=k,
    )
def test_convert_symbols__conversion_order__symbols(n_converts, symbols,
                                                    symbols_target):
    conversion = conv_syms.ConvertSymbols(
        conversion_policy=conv_pol.ConversionPolicyAttackAnyToCrit(),
        conversion_limit=n_converts,
    )
    assert conversion.on(syms.Symbols.from_symbols_list(
        symbols)) == syms.Symbols.from_symbols_list(symbols_target)
def test_convert_symbols__conversion_order__rolled_dice_pool(
    conversion_policy,
    n_converts,
    rolled_dice,
    rolled_dice_target,
):
    conversion = conv_syms.ConvertSymbols(
        conversion_policy=conversion_policy,
        conversion_limit=n_converts,
    )
    assert conversion.on(
        dce.RolledDicePool.from_rolled_dice_list(rolled_dice)
    ) == dce.RolledDicePool.from_rolled_dice_list(rolled_dice_target)
Esempio n. 6
0
from typing import Optional

from legion_dice_probs.events import convert_symbols as conv_syms
from legion_dice_probs.events import convert_surge_with_tokens as conv_srge_wtok
from legion_dice_probs.events import count_symbols as count_syms
from legion_dice_probs.events import roll as rll
from legion_dice_probs.events import aim_reroll as aim_rerll
from legion_dice_probs.events.tools import conversion_policy as conv_pol
from legion_dice_probs.events.tools import roll_policy as rll_pol
from legion_dice_probs.stochastic_states import symbol as sym

convert_all_surges_to_hit = conv_syms.ConvertSymbols(
    conversion_policy=conv_pol.get_conversion_policy_attack(
        convertible_symbols=(sym.Surge, ),
        conversion_target=sym.Hit(),
    ))

convert_all_surges_to_crit = conv_syms.ConvertSymbols(
    conversion_policy=conv_pol.get_conversion_policy_attack(
        convertible_symbols=(sym.Surge, ),
        conversion_target=sym.Crit(),
    ))

convert_all_surges_to_block = conv_syms.ConvertSymbols(
    conversion_policy=conv_pol.get_conversion_policy_defence(
        convertible_symbols=(sym.Surge, ),
        conversion_target=sym.Block(),
    ))


def get_use_surge_tokens_attack(k: Optional[int] = None):