EP Olson
January 8th, 2025, 19:58
Not sure if this helps you or anyone else. This code seems to work for me and looks complete.
power_prepared_adjustment = {
"Black Dragonborn Breath Weapon": [{'value': 'profbonus'}],
"Blue Dragonborn Breath Weapon": [{'value': 'profbonus'}],
"Brass Dragonborn Breath Weapon": [{'value':'profbonus'}],
"Bronze Dragonborn Breath Weapon": [{'value':'profbonus'}],
"Copper Dragonborn Breath Weapon": [{'value':'profbonus'}],
"Gold Dragonborn Breath Weapon": [{'value':'profbonus'}],
"Green Dragonborn Breath Weapon": [{'value':'profbonus'}],
"Red Dragonborn Breath Weapon": [{'value':'profbonus'}],
"Silver Dragonborn Breath Weapon": [{'value':'profbonus'}],
"White Dragonborn Breath Weapon": [{'value':'profbonus'}],
'Stonecunning': [{'value':'profbonus'}],
# "Speak with Animals": [{'value':profbonus}, # not unique to gnome, already ritual?
"Cloud's Jaunt": [{'value':'profbonus'}],
"Fire's Burn": [{'value':'profbonus'}],
"Frost's Chill": [{'value':'profbonus'}],
"Hill's Tumble": [{'value':'profbonus'}],
"Stone's Endurance": [{'value':'profbonus'}],
"Storm's Thunder": [{'value':'profbonus'}],
"Adrenaline Rush": [{'value':'profbonus'}],
'Lucky': [{'value':'profbonus'}],
'Bardic Inspiration': [{'value': 'abilities_charisma_bonus'}],
'Warding Flare': [{'value': 'abilities_wisdom_bonus'}],
'Corona of Light': [{'value': 'abilities_wisdom_bonus'}],
'War Priest': [{'value': 'abilities_wisdom_bonus'}],
'Moonlight Step': [{'value': 'abilities_wisdom_bonus'}],
'Star Map': [{'value': 'abilities_wisdom_bonus'}],
'Cosmic Omen': [{'value': 'abilities_wisdom_bonus'}],
'Wholeness of Body': [{'value': 'abilities_wisdom_bonus'}],
"Glorious Defense": [{'value': 'abilities_charisma_bonus'}], #?
"Nature's Veil": [{'value': 'abilities_wisdom_bonus'}], #?
'Misty Wanderer': [{'value': 'abilities_wisdom_bonus'}], #?
'Dread Ambusher': [{'value': 'abilities_wisdom_bonus'}], #?
"Restore Balance": [{'value': 'abilities_charisma_bonus'}],
"Steps of the Fey": [{'value': 'abilities_charisma_bonus'}], #?
"Dark One's Own Luck": [{'value': 'abilities_charisma_bonus'}], #?
# --- class level powers --- by level: [0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0]
'Rage': [{'class': 'Barbarian', 'class_table': [0, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6]}],
'Channel Divinity': [
{'class': 'Cleric', 'class_table': [0, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4]},
{'class': 'Paladin', 'class_table': [0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]}],
'Wild Shape': [{'class': 'Druid', 'class_table': [0, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4]}],
'Second Wind': [
{'class': 'Fighter', 'class_table': [0, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4]}],
'Action Surge': [
{'class': 'Fighter', 'class_table': [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2]}],
'Superiority Dice': [
{'class': 'Fighter', 'class_table': [0, 0, 0, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6]}],
'Psionic Energy': [
{'class': 'Fighter', 'class_table': [0, 0, 0, 4, 4, 6, 6, 6, 6, 8, 8, 8, 8, 10, 10, 10, 10, 12, 12, 12, 12]},
{'class': 'Rogue', 'class_table': [0, 0, 0, 4, 4, 6, 6, 6, 6, 8, 8, 8, 8, 10, 10, 10, 10, 12, 12, 12, 12]}],
'Focus': [{'class': 'Monk', 'class_table': [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2]}],
'Favored Enemy': [
{'class': 'Ranger', 'class_table': [0, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6]}],
'Sorcery Points': [{'class': 'Sorcerer',
'class_table': [0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]}]
}
For reference, this my python function to read the adjusted power's 'prepared' value:
def power_prepared_adjust(pc, power_name):
"""return the adjusted 'prepared' value for pc's power_name power
pc - dictionary class populated from xml with hierarchy flattened with underscores
and lists turned into lists
"""
power_data = pc.get_list_property('powers', name=power_name)
prepared = 0
if power_name in power_prepared_adjustment:
for adj in power_prepared_adjustment[power_name]:
if 'value' in adj:
if adj['value'] in pc:
prepared += max(1,pc[adj['value']])
else:
print(f"Error - PC value POWER {power_name}: {adj['value']} not in pc")
elif 'class' in adj:
class_data = pc.get_list_property('classes', name=adj['class'])
if class_data:
pc_class_level = class_data['level']
prepared += adj['class_table'][pc_class_level]
else:
prepared = power_data['prepared']
print(f"Debug - power adj: '{power_name}': {power_data['name']} prepared={power_data['prepared']} => {prepared}")
return prepared
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.