Example #1
0
def print_power_info_light(power, pc):
    vs = ""
    if power.ability is not None and power.defence is not None:
        ability = power.ability
        if isinstance(power.ability, dict):
            ability = "{"
            for range_type in sorted(power.ability):
                ability += str(range_type) + ": " + str(power.ability[range_type]) + ", "
            ability += "}"
        vs = str(ability) + " против " + str(power.defence)

    for attack_type in sorted(power.attack_types):
        vs = ""
        if isinstance(power.ability, dict):
            vs = str(power.ability[attack_type]) + " против " + str(power.defence)
        else:
            vs = str(power.ability) + " против " + str(power.defence)

        print(
            "{:<17s}{:<32s}{:<29s}{:<29s}{:<12s}{:s}".format(
                str(power.power_frequency),
                power.name,
                vs,
                str(attack_type),
                str(rolls.attack_roll(pc, power, attack_type)),
                str(rolls.damage_roll(pc, power, attack_type)),
            )
        )
Example #2
0
def print_power_info(power, pc):
    print(power.name + " {")
    print("    " + str(power.power_frequency) + " ✦ " + str(power.keywords))
    print("    " + str(power.action_type) + "   " + str(power.attack_types))
    print("    цель: " + str(power.target))
    if power.ability is not None and power.defence is not None:
        ability = power.ability
        if isinstance(power.ability, dict):
            ability = "{"
            for range_type in sorted(power.ability):
                ability += str(range_type) + ": " + str(power.ability[range_type]) + ", "
            ability += "}"
        print("    атака: " + str(ability) + " против " + str(power.defence))
    if power.ability is not None:
        if len(power.attack_types) > 1:
            for attack_type in sorted(power.attack_types):
                print("    бросок атаки (" + str(attack_type) + "): " + str(rolls.attack_roll(pc, power, attack_type)))
                print("    бросок урона (" + str(attack_type) + "): " + str(rolls.damage_roll(pc, power, attack_type)))
        else:
            print("    бросок атаки: " + str(rolls.attack_roll(pc, power)))
            print("    бросок урона: " + str(rolls.damage_roll(pc, power)))
    print("}")