Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_mod_str(self):
self.assertEqual(stats.mod_str(-3), '-3')
self.assertEqual(stats.mod_str(0), '+0')
self.assertEqual(stats.mod_str(2), '+2')
def test_mod_str(self):
self.assertEqual(stats.mod_str(-3), '-3')
self.assertEqual(stats.mod_str(0), '+0')
self.assertEqual(stats.mod_str(2), '+2')
'Passive': 10 + character.perception,
# Saving throws (proficiencies handled later)
'ST Strength': mod_str(character.strength.saving_throw),
'ST Dexterity': mod_str(character.dexterity.saving_throw),
'ST Constitution': mod_str(character.constitution.saving_throw),
'ST Intelligence': mod_str(character.intelligence.saving_throw),
'ST Wisdom': mod_str(character.wisdom.saving_throw),
'ST Charisma': mod_str(character.charisma.saving_throw),
# Skills (proficiencies handled below)
'Acrobatics': mod_str(character.acrobatics),
'Animal': mod_str(character.animal_handling),
'Arcana': mod_str(character.arcana),
'Athletics': mod_str(character.athletics),
'Deception ': mod_str(character.deception),
'History ': mod_str(character.history),
'Insight': mod_str(character.insight),
'Intimidation': mod_str(character.intimidation),
'Investigation ': mod_str(character.investigation),
'Medicine': mod_str(character.medicine),
'Nature': mod_str(character.nature),
'Perception ': mod_str(character.perception),
'Performance': mod_str(character.performance),
'Persuasion': mod_str(character.persuasion),
'Religion': mod_str(character.religion),
'SleightofHand': mod_str(character.sleight_of_hand),
'Stealth ': mod_str(character.stealth),
'Survival': mod_str(character.survival),
# Hit points
'HDTotal': character.hit_dice,
'HPMax': str(character.hp_max),
# Personality traits and other features
'PersonalityTraits ': text_box(character.personality_traits),
'AC': str(character.armor_class),
'Initiative': str(character.initiative),
'Speed': str(character.speed),
'Passive': 10 + character.perception,
# Saving throws (proficiencies handled later)
'ST Strength': mod_str(character.strength.saving_throw),
'ST Dexterity': mod_str(character.dexterity.saving_throw),
'ST Constitution': mod_str(character.constitution.saving_throw),
'ST Intelligence': mod_str(character.intelligence.saving_throw),
'ST Wisdom': mod_str(character.wisdom.saving_throw),
'ST Charisma': mod_str(character.charisma.saving_throw),
# Skills (proficiencies handled below)
'Acrobatics': mod_str(character.acrobatics),
'Animal': mod_str(character.animal_handling),
'Arcana': mod_str(character.arcana),
'Athletics': mod_str(character.athletics),
'Deception ': mod_str(character.deception),
'History ': mod_str(character.history),
'Insight': mod_str(character.insight),
'Intimidation': mod_str(character.intimidation),
'Investigation ': mod_str(character.investigation),
'Medicine': mod_str(character.medicine),
'Nature': mod_str(character.nature),
'Perception ': mod_str(character.perception),
'Performance': mod_str(character.performance),
'Persuasion': mod_str(character.persuasion),
'Religion': mod_str(character.religion),
'SleightofHand': mod_str(character.sleight_of_hand),
'Stealth ': mod_str(character.stealth),
'Survival': mod_str(character.survival),
# Hit points
'HDTotal': character.hit_dice,
'XP': str(character.xp),
'Inspiration': str('Yes' if character.inspiration else 'No'),
# Abilities
'ProfBonus': mod_str(character.proficiency_bonus),
'STRmod': str(character.strength.value),
'STR': mod_str(character.strength.modifier),
'DEXmod ': str(character.dexterity.value),
'DEX': mod_str(character.dexterity.modifier),
'CONmod': str(character.constitution.value),
'CON': mod_str(character.constitution.modifier),
'INTmod': str(character.intelligence.value),
'INT': mod_str(character.intelligence.modifier),
'WISmod': str(character.wisdom.value),
'WIS': mod_str(character.wisdom.modifier),
'CHamod': str(character.charisma.value),
'CHA': mod_str(character.charisma.modifier),
'AC': str(character.armor_class),
'Initiative': str(character.initiative),
'Speed': str(character.speed),
'Passive': 10 + character.perception,
# Saving throws (proficiencies handled later)
'ST Strength': mod_str(character.strength.saving_throw),
'ST Dexterity': mod_str(character.dexterity.saving_throw),
'ST Constitution': mod_str(character.constitution.saving_throw),
'ST Intelligence': mod_str(character.intelligence.saving_throw),
'ST Wisdom': mod_str(character.wisdom.saving_throw),
'ST Charisma': mod_str(character.charisma.saving_throw),
# Skills (proficiencies handled below)
'Acrobatics': mod_str(character.acrobatics),
'Animal': mod_str(character.animal_handling),
'Arcana': mod_str(character.arcana),
'Athletics': mod_str(character.athletics),
'Arcana': mod_str(character.arcana),
'Athletics': mod_str(character.athletics),
'Deception ': mod_str(character.deception),
'History ': mod_str(character.history),
'Insight': mod_str(character.insight),
'Intimidation': mod_str(character.intimidation),
'Investigation ': mod_str(character.investigation),
'Medicine': mod_str(character.medicine),
'Nature': mod_str(character.nature),
'Perception ': mod_str(character.perception),
'Performance': mod_str(character.performance),
'Persuasion': mod_str(character.persuasion),
'Religion': mod_str(character.religion),
'SleightofHand': mod_str(character.sleight_of_hand),
'Stealth ': mod_str(character.stealth),
'Survival': mod_str(character.survival),
# Hit points
'HDTotal': character.hit_dice,
'HPMax': str(character.hp_max),
# Personality traits and other features
'PersonalityTraits ': text_box(character.personality_traits),
'Ideals': text_box(character.ideals),
'Bonds': text_box(character.bonds),
'Flaws': text_box(character.flaws),
'Features and Traits': text_box(character.features_text + character.features_and_traits),
# Inventory
'CP': character.cp,
'SP': character.sp,
'EP': character.ep,
'GP': character.gp,
'PP': character.pp,
'Equipment': text_box(character.magic_items_text + character.equipment),
# Skills (proficiencies handled below)
'Acrobatics': mod_str(character.acrobatics),
'Animal': mod_str(character.animal_handling),
'Arcana': mod_str(character.arcana),
'Athletics': mod_str(character.athletics),
'Deception ': mod_str(character.deception),
'History ': mod_str(character.history),
'Insight': mod_str(character.insight),
'Intimidation': mod_str(character.intimidation),
'Investigation ': mod_str(character.investigation),
'Medicine': mod_str(character.medicine),
'Nature': mod_str(character.nature),
'Perception ': mod_str(character.perception),
'Performance': mod_str(character.performance),
'Persuasion': mod_str(character.persuasion),
'Religion': mod_str(character.religion),
'SleightofHand': mod_str(character.sleight_of_hand),
'Stealth ': mod_str(character.stealth),
'Survival': mod_str(character.survival),
# Hit points
'HDTotal': character.hit_dice,
'HPMax': str(character.hp_max),
# Personality traits and other features
'PersonalityTraits ': text_box(character.personality_traits),
'Ideals': text_box(character.ideals),
'Bonds': text_box(character.bonds),
'Flaws': text_box(character.flaws),
'Features and Traits': text_box(character.features_text + character.features_and_traits),
# Inventory
'CP': character.cp,
'SP': character.sp,
'EP': character.ep,
'WIS': mod_str(character.wisdom.modifier),
'CHamod': str(character.charisma.value),
'CHA': mod_str(character.charisma.modifier),
'AC': str(character.armor_class),
'Initiative': str(character.initiative),
'Speed': str(character.speed),
'Passive': 10 + character.perception,
# Saving throws (proficiencies handled later)
'ST Strength': mod_str(character.strength.saving_throw),
'ST Dexterity': mod_str(character.dexterity.saving_throw),
'ST Constitution': mod_str(character.constitution.saving_throw),
'ST Intelligence': mod_str(character.intelligence.saving_throw),
'ST Wisdom': mod_str(character.wisdom.saving_throw),
'ST Charisma': mod_str(character.charisma.saving_throw),
# Skills (proficiencies handled below)
'Acrobatics': mod_str(character.acrobatics),
'Animal': mod_str(character.animal_handling),
'Arcana': mod_str(character.arcana),
'Athletics': mod_str(character.athletics),
'Deception ': mod_str(character.deception),
'History ': mod_str(character.history),
'Insight': mod_str(character.insight),
'Intimidation': mod_str(character.intimidation),
'Investigation ': mod_str(character.investigation),
'Medicine': mod_str(character.medicine),
'Nature': mod_str(character.nature),
'Perception ': mod_str(character.perception),
'Performance': mod_str(character.performance),
'Persuasion': mod_str(character.persuasion),
'Religion': mod_str(character.religion),
'SleightofHand': mod_str(character.sleight_of_hand),
'Stealth ': mod_str(character.stealth),
'ST Strength': mod_str(character.strength.saving_throw),
'ST Dexterity': mod_str(character.dexterity.saving_throw),
'ST Constitution': mod_str(character.constitution.saving_throw),
'ST Intelligence': mod_str(character.intelligence.saving_throw),
'ST Wisdom': mod_str(character.wisdom.saving_throw),
'ST Charisma': mod_str(character.charisma.saving_throw),
# Skills (proficiencies handled below)
'Acrobatics': mod_str(character.acrobatics),
'Animal': mod_str(character.animal_handling),
'Arcana': mod_str(character.arcana),
'Athletics': mod_str(character.athletics),
'Deception ': mod_str(character.deception),
'History ': mod_str(character.history),
'Insight': mod_str(character.insight),
'Intimidation': mod_str(character.intimidation),
'Investigation ': mod_str(character.investigation),
'Medicine': mod_str(character.medicine),
'Nature': mod_str(character.nature),
'Perception ': mod_str(character.perception),
'Performance': mod_str(character.performance),
'Persuasion': mod_str(character.persuasion),
'Religion': mod_str(character.religion),
'SleightofHand': mod_str(character.sleight_of_hand),
'Stealth ': mod_str(character.stealth),
'Survival': mod_str(character.survival),
# Hit points
'HDTotal': character.hit_dice,
'HPMax': str(character.hp_max),
# Personality traits and other features
'PersonalityTraits ': text_box(character.personality_traits),
'Ideals': text_box(character.ideals),
'Bonds': text_box(character.bonds),