def psionic_check(name): print("###############################") print("#Rolling psionics....#") print("###############################") base = 1000 if name.char_abilities['INT'] > 16: for i in range(17, name.char_abilities['INT'] + 1): base -= 25 if name.char_abilities['WIS'] > 16: for i in range(17, name.char_abilities['WIS'] + 1): base -= 15 if name.char_abilities['CHA'] > 16: for i in range(17, name.char_abilities["CHA"] + 1): base -= 5 if name.char_race == "GrayDwarf": base = base * 2 roll = dice.normal(1000, 1) if roll >= base: name.psionic = True print(roll, base) if name.psionic: print("###############################") print("#Holy shit... you're psionic!#") print("#Holy shit... you're psionic!#") print("#Holy shit... you're psionic!#") print("#Holy shit... you're psionic!#") print("###############################") else: print("Nope, not psionic.")
def calculate_jewelry(jewels): dividers = [8, 4, 4, 2 ,2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1] multipliers = [8, 4, 4, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1] if jewels > 0: jewels_base_val = [{'jewels_val': dice.normal(10, 1)*100, 'desc':'Ivory or Wrought Silver'}, {'jewels_val': dice.normal(6, 2)*100, 'desc':'Wrought Silver and Gold'}, {'jewels_val': dice.normal(6, 3)*100, 'desc':'Wrought Gold'}, {'jewels_val': dice.normal(6, 5)*100, 'desc':'Jade, Coral, or Wrought Platinum'}, {'jewels_val': dice.normal(6, 1)*1000, 'desc':'Silver with gems'}, {'jewels_val': dice.normal(4, 2)*1000, 'desc':'Gold with gems'}, {'jewels_val': dice.normal(6, 2)*1000, 'desc':'Platinum with gems'}] jewels_loot = {} for j in range(1, jewels+1): divider = dividers[dice.normal(len(dividers), 1)-1] multi = multipliers[dice.normal(len(multipliers), 1) - 1] jewels_loot[j] = jewels_base_val[dice.normal(len(jewels_base_val), 1)-1] jewels_loot[j] = [round(jewels_loot[j]["jewels_val"] / divider), jewels_loot[j]["desc"]] #print(jewels_loot) for j in jewels_loot: print(j, jewels_loot[j]) else: pass
jewels = 0 magic = "" treasure_type = "A35k" while len(treasure_type) != 1 and not treasure_type.isalpha(): treasure_type = input("Type treasure type letter:") treasure_type = treasure_type.upper() creature_count = "1" while not creature_count.isdigit(): creature_count = input("Number of treasure types to roll:") creature_count = int(creature_count) creature_count += 1 for c in range(1, creature_count): if treasure_type == "A": if dice.normal(100, 1) <= 25: copper += dice.normal(6, 1)*1000 if dice.normal(100, 1) <= 30: silver += dice.normal(6, 1)*1000 if dice.normal(100, 1) <= 35: electrum += dice.normal(6, 1)*1000 if dice.normal(100, 1) <= 40: gold += dice.normal(10, 1)*1000 if dice.normal(100, 1) <= 25: platinum += dice.normal(4, 1)*100 if dice.normal(100, 1) <= 60: gems += dice.normal(4, 10) if dice.normal(100, 1) <= 50: jewels += dice.normal(3, 10) if dice.normal(100, 1) <= 30: magic = "A: Any 3 Magic Items\n"
def calculate_gems(gems): gem_base_val = [{'gem_val': 10, 'gam_size': 'very small', 'gem_type':"", 'amount':gems}, {'gem_val': 50, 'gam_size': 'mall', 'gem_type':"", 'amount':gems}, {'gem_val': 100, 'gam_size': 'large', 'gem_type': "", 'amount':gems}, {'gem_val': 500, 'gam_size': 'average', 'gem_type':"", 'amount':gems}, {'gem_val': 1000, 'gam_size': 'large', 'gem_type':"", 'amount':gems}, {'gem_val': 5000, 'gam_size': 'very large', 'gem_type': "", 'amount':gems}, {'gem_val': 10000, 'gam_size': 'huge', 'gem_type': "", 'amount':gems}, {'gem_val': 25000, 'gam_size': 'huge', 'gem_type': "", 'amount':gems}, {'gem_val': 50000, 'gam_size': 'huge', 'gem_type': "", 'amount':gems}, {'gem_val': 100000, 'gam_size': 'huge', 'gem_type': "", 'amount':gems}, {'gem_val': 250000, 'gam_size': 'huge', 'gem_type': "", 'amount':gems}, {'gem_val': 500000, 'gam_size': 'huge', 'gem_type': "", 'amount':gems}, {'gem_val': 1000000, 'gam_size': 'huge', 'gem_type': "", 'amount':gems}] gem_val_idx = 0 if dice.normal(100, 1) in range(1, 26): gem_val_idx += 0 elif dice.normal(100, 1) in range(25, 52): gem_val_idx += 1 elif dice.normal(100, 1) in range(51, 71): gem_val_idx += 2 elif dice.normal(100, 1) in range(71, 92): gem_val_idx += 3 elif dice.normal(100, 1) in range(91, 100): gem_val_idx += 4 elif dice.normal(100, 1) in range(100, 101): gem_val_idx += 5 if dice.normal(100, 1) in range(1, 11): if dice.normal(100, 1) in range(1, 6): gem_val_idx += 5 elif dice.normal(100, 1) in range(5, 16): gem_val_idx += 4 elif dice.normal(100, 1) in range(15, 31): gem_val_idx += 3 elif dice.normal(100, 1) in range(30, 51): gem_val_idx += 2 elif dice.normal(100, 1) in range(51, 100): gem_val_idx += 1 elif dice.normal(100, 1) in range(100, 101): gem_val_idx += 6 if dice.normal(100, 1) in range(10, 21): gems_loot = gem_base_val[gem_val_idx] gems_loot["gem_val"] = gems_loot["gem_val"]*2 elif dice.normal(10, 1) in range(30, 41): gems_loot = gem_base_val[gem_val_idx] gems_loot["gem_val"] = gems_loot["gem_val"]*dice.normal(6,1) elif dice.normal(10, 1) in range(90, 101): gems_loot = gem_base_val[gem_val_idx] gems_loot["gem_val"] = gems_loot["gem_val"]/2 else: gems_loot = gem_base_val[gem_val_idx] if gem_val_idx == 0: types = ["Azurite", "Banded Agate", "Blue Quartz", "Eye Agate", "Hematite", "Lapis Lazuli", "Malachite", "Moss Agate", "Obsidian", "Rhodocroshite", "Tiger Eye", "Turquoise"] if gem_val_idx == 1: types = ["Bloodstone", "Cernelian", "Chalcedony", "Chrysoprase", "Citrine", "Jasper", "Moonstone", "Onyx", "Rock Crystal", "Sardonyx", "Smoky Quartz", "Star Rose Quartz", "Zircon"] if gem_val_idx == 2 or gem_val_idx == 3: types = ["Amber", "Alexandrite", "Amethyst", "Aquamerine", "Chrysoberyl", "Coral", "Garnet", "Jade", "Jet", "Pearl", "Peridot", "Spinel", "Topaz", "Tourmaline"] if gem_val_idx >= 4: types = ["Black Opal", "Black Sapphire", "Diamond", "Emerald", "Fire Opal", "Jacinth", "Opal", "Oriental Amethyst", "Oriental Emerald", "Oriental Topas", "Ruby", "Sapphire", "Star Ruby", "Star Sapphire"] gems_loot["gem_type"] = types[dice.normal(len(types), 1)-1] return gems_loot
def age(name): if name.self_roll: possible = [str(n) for n in range(1, 1601)] age = "00" while str(age) not in possible: age = input("What is your age roll?") age = int(age) if "Dwarf" in name.char_race: if name.self_roll: name.char_age = age else: for c in name.char_class: ages = [] if "Cleric" in str(c) or "Druid" in str(c): ages.append(250 + dice.normal(20, 2)) elif "Fighter" in str(c) or "Paladin" in str( c) or "Ranger" in str(c): ages.append(40 + dice.normal(4, 5)) elif "Thief" in str(c) or "Assassin" in str(c): ages.append(75 + dice.normal(6, 3)) ages.sort() name.char_age = str(ages[-1]) if int(name.char_age) in range(35, 51): name.char_age_desc = "Young Adult" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 elif int(name.char_age) in range(51, 151): name.char_age_desc = "Mature" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 elif int(name.char_age) in range(151, 251): name.char_age_desc = "Middle Aged" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 elif int(name.char_age) in range(251, 351): name.char_age_desc = "Old" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 name.char_abilities["STR"] -= 2 name.char_abilities["DEX"] -= 2 name.char_abilities["CON"] -= 1 name.char_abilities["WIS"] += 1 elif int(name.char_age) in range(351, 451): name.char_age_desc = "Venerable" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 name.char_abilities["STR"] -= 2 name.char_abilities["DEX"] -= 2 name.char_abilities["CON"] -= 1 name.char_abilities["WIS"] += 1 name.char_abilities["STR"] -= 1 name.char_abilities["DEX"] -= 1 name.char_abilities["CON"] -= 1 name.char_abilities["INT"] += 1 name.char_abilities["WIS"] += 1 elif "Elf" in name.char_race: if name.self_roll: name.char_age = age else: for c in name.char_class: ages = [] if "Cleric" in str(c) or "Druid" in str( c) or "Cavalier" in str(c): ages.append(500 + dice.normal(10, 10)) elif "Fighter" in str(c) or "Paladin" in str( c) or "Ranger" in str(c): ages.append(130 + dice.normal(6, 5)) elif "MagicUser" in str(c) or "Illusionist" in str(c): ages.append(150 + dice.normal(6, 5)) elif "Thief" in str(c) or "Assassin" in str(c): ages.append(100 + dice.normal(6, 5)) ages.sort() name.char_age = str(ages[-1]) if int(name.char_age) in range(100, 176): name.char_age_desc = "Young Adult" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 elif int(name.char_age) in range(177, 551): name.char_age_desc = "Mature" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 elif int(name.char_age) in range(551, 876): name.char_age_desc = "Middle Aged" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 elif int(name.char_age) in range(876, 1201): name.char_age_desc = "Old" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 name.char_abilities["STR"] -= 2 name.char_abilities["DEX"] -= 2 name.char_abilities["CON"] -= 1 name.char_abilities["WIS"] += 1 elif int(name.char_age) in range(1201, 1601): name.char_age_desc = "Venerable" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 name.char_abilities["STR"] -= 2 name.char_abilities["DEX"] -= 2 name.char_abilities["CON"] -= 1 name.char_abilities["WIS"] += 1 name.char_abilities["STR"] -= 1 name.char_abilities["DEX"] -= 1 name.char_abilities["CON"] -= 1 name.char_abilities["INT"] += 1 name.char_abilities["WIS"] += 1 elif "Gnome" in name.char_race: if name.self_roll: name.char_age = age else: for c in name.char_class: ages = [] if "Cleric" in str(c) or "Druid" in str(c): ages.append(300 + dice.normal(12, 3)) elif "Fighter" in str(c) or "Paladin" in str( c) or "Ranger" in str(c): ages.append(60 + dice.normal(4, 5)) elif "MagicUser" in str(c) or "Illusionist" in str(c): ages.append(100 + dice.normal(12, 2)) elif "Thief" in str(c) or "Assassin" in str(c): ages.append(80 + dice.normal(4, 5)) ages.sort() name.char_age = str(ages[-1]) if int(name.char_age) in range(50, 91): name.char_age_desc = "Young Adult" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 elif int(name.char_age) in range(91, 301): name.char_age_desc = "Mature" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 elif int(name.char_age) in range(301, 451): name.char_age_desc = "Middle Aged" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 elif int(name.char_age) in range(451, 601): name.char_age_desc = "Old" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 name.char_abilities["STR"] -= 2 name.char_abilities["DEX"] -= 2 name.char_abilities["CON"] -= 1 name.char_abilities["WIS"] += 1 elif int(name.char_age) in range(601, 751): name.char_age_desc = "Venerable" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 name.char_abilities["STR"] -= 2 name.char_abilities["DEX"] -= 2 name.char_abilities["CON"] -= 1 name.char_abilities["WIS"] += 1 name.char_abilities["STR"] -= 1 name.char_abilities["DEX"] -= 1 name.char_abilities["CON"] -= 1 name.char_abilities["INT"] += 1 name.char_abilities["WIS"] += 1 elif name.char_race == "Half-Elf": if name.self_roll: name.char_age = age else: for c in name.char_class: ages = [] if "Cleric" in str(c) or "Druid" in str( c) or "Cavalier" in str(c): ages.append(40 + dice.normal(4, 2)) elif "Fighter" in str(c) or "Paladin" in str( c) or "Ranger" in str(c): ages.append(22 + dice.normal(4, 3)) elif "MagicUser" in str(c) or "Illusionist" in str(c): ages.append(30 + dice.normal(8, 2)) elif "Thief" in str(c) or "Assassin" in str(c): ages.append(22 + dice.normal(8, 3)) ages.sort() name.char_age = str(ages[-1]) if int(name.char_age) in range(25, 41): name.char_age_desc = "Young Adult" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 elif int(name.char_age) in range(41, 100): name.char_age_desc = "Mature" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 elif int(name.char_age) in range(101, 175): name.char_age_desc = "Middle Aged" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 elif int(name.char_age) in range(176, 251): name.char_age_desc = "Old" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 name.char_abilities["STR"] -= 2 name.char_abilities["DEX"] -= 2 name.char_abilities["CON"] -= 1 name.char_abilities["WIS"] += 1 elif int(name.char_age) in range(251, 325): name.char_age_desc = "Venerable" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 name.char_abilities["STR"] -= 2 name.char_abilities["DEX"] -= 2 name.char_abilities["CON"] -= 1 name.char_abilities["WIS"] += 1 name.char_abilities["STR"] -= 1 name.char_abilities["DEX"] -= 1 name.char_abilities["CON"] -= 1 name.char_abilities["INT"] += 1 name.char_abilities["WIS"] += 1 elif name.char_race == "Halfling": if name.self_roll: name.char_age = age else: for c in name.char_class: ages = [] if "Cleric" in str(c) or "Druid" in str(c): ages.append(30 + dice.normal(4, 3)) elif "Fighter" in str(c) or "Paladin" in str( c) or "Ranger" in str(c): ages.append(20 + dice.normal(4, 3)) elif "Thief" in str(c) or "Assassin" in str(c): ages.append(40 + dice.normal(4, 2)) ages.sort() name.char_age = str(ages[-1]) if int(name.char_age) in range(22, 34): name.char_age_desc = "Young Adult" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 elif int(name.char_age) in range(34, 69): name.char_age_desc = "Mature" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 elif int(name.char_age) in range(69, 102): name.char_age_desc = "Middle Aged" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 elif int(name.char_age) in range(102, 145): name.char_age_desc = "Old" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 name.char_abilities["STR"] -= 2 name.char_abilities["DEX"] -= 2 name.char_abilities["CON"] -= 1 name.char_abilities["WIS"] += 1 elif int(name.char_age) in range(146, 200): name.char_age_desc = "Venerable" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 name.char_abilities["STR"] -= 2 name.char_abilities["DEX"] -= 2 name.char_abilities["CON"] -= 1 name.char_abilities["WIS"] += 1 name.char_abilities["STR"] -= 1 name.char_abilities["DEX"] -= 1 name.char_abilities["CON"] -= 1 name.char_abilities["INT"] += 1 name.char_abilities["WIS"] += 1 elif name.char_race == "Half-Orc": if name.self_roll: name.char_age = age else: for c in name.char_class: ages = [] if "Cleric" in str(c) or "Druid" in str(c): ages.append(20 + dice.normal(4, 1)) elif "Fighter" in str(c) or "Paladin" in str( c) or "Ranger" in str(c): ages.append(13 + dice.normal(4, 1)) elif "Thief" in str(c) or "Assassin" in str(c): ages.append(20 + dice.normal(4, 2)) ages.sort() name.char_age = str(ages[-1]) if int(name.char_age) in range(12, 16): name.char_age_desc = "Young Adult" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 elif int(name.char_age) in range(16, 31): name.char_age_desc = "Mature" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 elif int(name.char_age) in range(31, 46): name.char_age_desc = "Middle Aged" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 elif int(name.char_age) in range(46, 61): name.char_age_desc = "Old" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 name.char_abilities["STR"] -= 2 name.char_abilities["DEX"] -= 2 name.char_abilities["CON"] -= 1 name.char_abilities["WIS"] += 1 elif int(name.char_age) in range(61, 81): name.char_age_desc = "Venerable" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 name.char_abilities["STR"] -= 2 name.char_abilities["DEX"] -= 2 name.char_abilities["CON"] -= 1 name.char_abilities["WIS"] += 1 name.char_abilities["STR"] -= 1 name.char_abilities["DEX"] -= 1 name.char_abilities["CON"] -= 1 name.char_abilities["INT"] += 1 name.char_abilities["WIS"] += 1 elif name.char_race == "Human": if name.self_roll: name.char_age = age else: for c in name.char_class: ages = [] if "Cleric" in str(c) or "Druid" in str(c): ages.append(18 + dice.normal(4, 1)) elif "Fighter" in str(c): ages.append(15 + dice.normal(4, 1)) elif "Paladin" in str(c) or "UAPaladin" in str( c) or "Cavalier" in str(c): ages.append(17 + dice.normal(4, 1)) elif "Ranger" in str(c): ages.append(20 + dice.normal(4, 1)) elif "MagicUser" in str(c): ages.append(24 + dice.normal(8, 2)) elif "Illusionist" in str(c): ages.append(30 + dice.normal(6, 1)) elif "Thief" in str(c): ages.append(18 + dice.normal(4, 1)) elif "Assassin" in str(c): ages.append(20 + dice.normal(4, 1)) elif "Barbarian" in str(c): ages.append(14 + dice.normal(4, 1)) elif "Monk" in str(c): ages.append(21 + dice.normal(4, 1)) ages.sort() name.char_age = str(ages[-1]) if int(name.char_age) in range(14, 21): print("This one") name.char_age_desc = "Young Adult" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 elif int(name.char_age) in range(21, 41): name.char_age_desc = "Mature" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 elif int(name.char_age) in range(41, 61): name.char_age_desc = "Middle Aged" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 elif int(name.char_age) in range(61, 91): name.char_age_desc = "Old" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 name.char_abilities["STR"] -= 2 name.char_abilities["DEX"] -= 2 name.char_abilities["CON"] -= 1 name.char_abilities["WIS"] += 1 elif int(name.char_age) in range(91, 121): name.char_age_desc = "Venerable" name.char_abilities["WIS"] -= 1 name.char_abilities["CON"] += 1 name.char_abilities["STR"] += 1 name.char_abilities["WIS"] += 1 if "EX_STR" in name.char_abilities: name.char_abilities["EX_STR"] = round( name.char_abilities["EX_STR"] / 2) else: name.char_abilities["STR"] -= 1 name.char_abilities["STR"] -= 2 name.char_abilities["DEX"] -= 2 name.char_abilities["CON"] -= 1 name.char_abilities["WIS"] += 1 name.char_abilities["STR"] -= 1 name.char_abilities["DEX"] -= 1 name.char_abilities["CON"] -= 1 name.char_abilities["INT"] += 1 name.char_abilities["WIS"] += 1 return name