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
def throw_boulder(char_stats): total_damage = 0 boulder_attack_bonus = char_stats['BAB'] + char_stats['StrMod'] + char_stats['AttackSizeMod'] boulder_attack_bonus += char_stats['MoraleAttack'] #Range mod distance = int(raw_input('\n\nHow far away is the target? (in feet) ')) if distance >= char_stats['BoulderRange'] * 5: print "Target too far away" return total_damage range_penalty = 0 while distance >= char_stats['BoulderRange']: distance -= char_stats['BoulderRange'] range_penalty += 1 #Attack roll total_attack_roll, multiplier = attack_roll(char_stats, boulder_attack_bonus, range_penalty) hit = raw_input('Did it hit? (y|n) ') if hit.lower().startswith('n'): return total_damage #Damage roll damage_mod = char_stats['StrMod'] + char_stats['MoraleDmg'] damage_dice = { 'num_of_dice': 2, 'num_of_sides': 8, 'total_mod': damage_mod, 'multiplier': multiplier } total_damage = damage_roll(char_stats, damage_dice) return total_damage
def gore_attack(char_stats, cleave=False): total_damage = 0 cleave_damage = 0 ####Attack roll#### gore_attack_bonus = char_stats['BAB'] + char_stats['StrMod'] + char_stats['AttackSizeMod'] gore_attack_bonus -= 5 # Natural off hand weapon penalty gore_attack_bonus -= char_stats['PowerAttack'] # Power attack penalty gore_attack_bonus += char_stats['MoraleAttack'] if char_stats['Charging']: gore_attack_bonus += 2 total_attack_roll, multiplier = attack_roll(char_stats, gore_attack_bonus) hit = raw_input('Did it hit? (y|n) ') if hit.lower().startswith('n'): if cleave: return cleave_damage return total_damage, cleave_damage ####Damage roll#### damage_mod = char_stats['StrMod'] // 2 + char_stats['PowerAttack'] + char_stats['MoraleDmg'] damage_dice = { 'num_of_dice': 1, 'num_of_sides': 8, 'total_mod': damage_mod, 'multiplier': multiplier } total_damage = damage_roll(char_stats, damage_dice) #Dealing with cleave if cleave: return total_damage print colorz.YELLOW cleave = raw_input("Did it cleave? (y|n) ") if cleave.lower().startswith('y'): print "%sCleaving....\n%s" % (colorz.PURPLE, colorz.GREEN) cleave_damage += gore_attack(True) return total_damage, cleave_damage
def throw_boulder(char_stats): total_damage = 0 boulder_attack_bonus = char_stats['BAB'] + char_stats[ 'StrMod'] + char_stats['AttackSizeMod'] boulder_attack_bonus += char_stats['MoraleAttack'] #Range mod distance = int(raw_input('\n\nHow far away is the target? (in feet) ')) if distance >= char_stats['BoulderRange'] * 5: print "Target too far away" return total_damage range_penalty = 0 while distance >= char_stats['BoulderRange']: distance -= char_stats['BoulderRange'] range_penalty += 1 #Attack roll total_attack_roll, multiplier = attack_roll(char_stats, boulder_attack_bonus, range_penalty) hit = raw_input('Did it hit? (y|n) ') if hit.lower().startswith('n'): return total_damage #Damage roll damage_mod = char_stats['StrMod'] + char_stats['MoraleDmg'] damage_dice = { 'num_of_dice': 2, 'num_of_sides': 8, 'total_mod': damage_mod, 'multiplier': multiplier } total_damage = damage_roll(char_stats, damage_dice) return total_damage
def shield_attack(char_stats, cleave=False): cleave_targets = {} targets = {} damage_doubling = 1 print '\nMighty swing used. Please pick 3 adjacent squares.' raw_input('(Press enter to continue)') ####Attack roll#### shield_attack_bonus = char_stats['BAB'] + char_stats['StrMod'] + char_stats['AttackSizeMod'] shield_attack_bonus += char_stats['ShieldEnchance'] shield_attack_bonus -= char_stats['PowerAttack'] # Power attack penalty shield_attack_bonus += char_stats['MoraleAttack'] if char_stats['Charging']: shield_attack_bonus += 2 damage_doubling += 1 total_attack_roll, multiplier = attack_roll(char_stats, shield_attack_bonus) hits = int(raw_input('How many things were hit? ')) if hits == 0: if cleave: return cleave_targets return targets, cleave_targets # Damage roll with mighty swing, shield charge, # shield slam, knockback... yay for fun times damage_mod = char_stats['StrMod'] * 1.5 + char_stats['PowerAttack'] * 2 + char_stats['ShieldEnchance'] damage_mod += char_stats['MoraleDmg'] for target in range(1, hits + 1): target_name = 'Target %d' % target print "\n####%s####" % target_name damage_dice = { 'num_of_dice': 2, 'num_of_sides': 6, 'total_mod': damage_mod, 'multiplier': multiplier, 'damage_doubling': damage_doubling } total_damage = damage_roll(char_stats, damage_dice) if char_stats['Charging']: #Free Trip attempt print "\n%s++Free Trip attempt++" % colorz.YELLOW total_damage += trip_attempt(char_stats, target_name, shield_attack_bonus, damage_mod, damage_doubling) #Shield daze shield_daze(char_stats, target_name) #Knockback with bull rush check if char_stats['PowerAttack']: total_damage += knockback(char_stats) targets[target_name] = total_damage if cleave: return targets print colorz.RED for target in targets.keys(): print "Total damage for %s: %d" % (target, targets[target]) print colorz.YELLOW cleave = raw_input("\n\nDid it cleave? (y|n) ") if cleave.lower().startswith('y'): print "%sCleaving....\n%s" % (colorz.PURPLE, colorz.GREEN) cleave_targets = shield_attack(char_stats, True) return targets, cleave_targets
def shield_attack(char_stats, cleave=False): cleave_targets = {} targets = {} damage_doubling = 1 print '\nMighty swing used. Please pick 3 adjacent squares.' raw_input('(Press enter to continue)') ####Attack roll#### shield_attack_bonus = char_stats['BAB'] + char_stats[ 'StrMod'] + char_stats['AttackSizeMod'] shield_attack_bonus += char_stats['ShieldEnchance'] shield_attack_bonus -= char_stats['PowerAttack'] # Power attack penalty shield_attack_bonus += char_stats['MoraleAttack'] if char_stats['Charging']: shield_attack_bonus += 2 damage_doubling += 1 total_attack_roll, multiplier = attack_roll(char_stats, shield_attack_bonus) hits = int(raw_input('How many things were hit? ')) if hits == 0: if cleave: return cleave_targets return targets, cleave_targets # Damage roll with mighty swing, shield charge, # shield slam, knockback... yay for fun times damage_mod = char_stats['StrMod'] * 1.5 + char_stats[ 'PowerAttack'] * 2 + char_stats['ShieldEnchance'] damage_mod += char_stats['MoraleDmg'] for target in range(1, hits + 1): target_name = 'Target %d' % target print "\n####%s####" % target_name damage_dice = { 'num_of_dice': 2, 'num_of_sides': 6, 'total_mod': damage_mod, 'multiplier': multiplier, 'damage_doubling': damage_doubling } total_damage = damage_roll(char_stats, damage_dice) if char_stats['Charging']: #Free Trip attempt print "\n%s++Free Trip attempt++" % colorz.YELLOW total_damage += trip_attempt(char_stats, target_name, shield_attack_bonus, damage_mod, damage_doubling) #Shield daze shield_daze(char_stats, target_name) #Knockback with bull rush check if char_stats['PowerAttack']: total_damage += knockback(char_stats) targets[target_name] = total_damage if cleave: return targets print colorz.RED for target in targets.keys(): print "Total damage for %s: %d" % (target, targets[target]) print colorz.YELLOW cleave = raw_input("\n\nDid it cleave? (y|n) ") if cleave.lower().startswith('y'): print "%sCleaving....\n%s" % (colorz.PURPLE, colorz.GREEN) cleave_targets = shield_attack(char_stats, True) return targets, cleave_targets