示例#1
0
def trip_attempt(char_stats, target_name, attack_bonus, damage_bonus, damage_doubling=1):
    can_trip = raw_input('Enemy bigger than huge? (y|n) ')
    if can_trip.lower().startswith('n'):
        general_dc_roll(char_stats, "Touch attack", char_stats['StrMod'] + char_stats['BAB'])
        print colorz.YELLOW
        touch_success = raw_input('Did touch attack succeeed? (y|n) ')

        if touch_success.lower().startswith('y'):
            #+4 for Improved Trip
            trip_str_mod = char_stats['StrMod'] + char_stats['StrSizeMod'] + 4
            trip_str_check = general_dc_roll(char_stats, "Strength check", trip_str_mod)
            print "\nStrength check to beat: %d" % trip_str_check
            tripped = raw_input('Did you trip it? (y|n) ')

            if tripped.lower().startswith('y'):
                print "\n++Free attack!++"
                #+4 because they're prone
                throw_away, multiplier = attack_roll(char_stats, attack_bonus + 4)
                print colorz.YELLOW
                hit = raw_input('Did it hit? (y|n) ')
                if hit.lower().startswith('y'):
                    damage_dice = {
                        'num_of_dice': 2,
                        'num_of_sides': 6,
                        'total_mod': damage_bonus,
                        'multiplier': multiplier,
                        'damage_doubling': damage_doubling
                    }
                    total_damage = damage_roll(char_stats, damage_dice)
                    return total_damage
    return 0
示例#2
0
def knockback(char_stats):
    print "\n%s++Knockback++" % colorz.BLUE
    print "Bull rush check roll:"
    #+4 for Improved Bull Rush
    bull_rush_mod = char_stats['StrSizeMod'] + char_stats['StrMod'] + 4
    bull_rush_check = general_dc_roll(char_stats, "Bull rush", bull_rush_mod)
    knockback_distance = 0
    print colorz.BLUE
    opposing_bull_rush_check = int(raw_input("Opposing bull rush check? "))
    if bull_rush_check > opposing_bull_rush_check:
        knockback_distance += 5
        br_check_diff = bull_rush_check - opposing_bull_rush_check
        while br_check_diff > 5:
            knockback_distance += 5
            br_check_diff -= 5

    print "\nTarget knocked back %d feet%s" \
        % (knockback_distance, colorz.GREEN)
    if knockback_distance > 0:
        hit = raw_input("Did target hit a wall/solid object? (y|n) ")
        if hit.lower().startswith('y'):
            damage_dice = {
                'num_of_dice': 4,
                'num_of_sides': 6,
                'total_mod': char_stats['StrMod'] * 2,
            }
            total_damage = damage_roll(char_stats, damage_dice)
            return total_damage
    return 0
        'Spot': 1,
    },
    'Moonflower': {
        'Listen': 10,
        'Spot': 10,
        'Search': 10
    }
}
options = {
    'AutoRoll': True
}

parser = argparse.ArgumentParser()
parser.add_argument('-n', action='store_true', default=False, dest='ninja_mode',
                    help='Silent roll/ninja mode?')
parser.add_argument('-A', action='store_true', default=False, dest='no_auto_roll',
                    help='Deactivates auto roll')

args = parser.parse_args()
if args.no_auto_roll:
    options['AutoRoll'] = False

for char in characters:
    print "\t%s%s: " % (colorz.BLUE, char)
    for skill in characters[char]:
        dice_rolling.general_dc_roll(options, skill.ljust(6), characters[char][skill])
    print ""

if not args.ninja_mode:
    rolling_sound()
示例#4
0
        if attack.lower() == 'shield':
            total_damage['shield'], cleave_damage['shield'] \
                = shield_attack(char_stats)

        elif attack.lower() == 'gore':
            total_damage['gore'], cleave_damage['gore'] \
                = gore_attack(char_stats)

        elif attack.lower() == 'boulder':
            if char_stats['Charging']:
                print "%sCan't throw boulder while charging.\n" % colorz.RED
            else:
                total_damage['boulder'] = throw_boulder(char_stats)

        elif attack.lower() == 'death move':
            str_roll = general_dc_roll("STR check", total_mod=char_stats['StrMod'])
            if str_roll > char_stats['StrMod'] + 1:
                print "%sDeath move successful!%s" % (colorz.RED, colorz.YELLOW)
                if char_stats['MoraleAttack'] < 1:
                    char_stats['MoraleAttack'] = 1
                if char_stats['MoraleDmg'] < 1:
                    char_stats['MoraleDmg'] = 1

        elif attack.lower() == 'none':
            break

        print colorz.YELLOW
        again = raw_input('\nAnother attack? (y|n) ')
        if again.lower().startswith('n'):
            break