Added some personality characteristics

This commit is contained in:
Mark Wolfman
2018-03-27 00:01:57 -05:00
parent bbfc8ff295
commit b1dedaddb2
4 changed files with 32 additions and 0 deletions
+5
View File
@@ -52,6 +52,11 @@ class Character():
sleight_of_hand = Skill(ability='dexterity')
stealth = Skill(ability='dexterity')
survival = Skill(ability='wisdom')
# Characteristics
personality_traits = ""
ideals = ""
bonds = ""
flaws = ""
# Inventory
cp = 0
sp = 0
+13
View File
@@ -13,6 +13,14 @@ from dungeonsheets.stats import mod_str
"""Program to take character definitions and build a PDF of the
character sheet."""
def text_box(string):
"""Format a string for displaying in a text box."""
# Remove line breaks
new_string = string.replace('\n', ' ').replace('\r', ' ')
# Remove multiple whitespace
new_string = ' '.join(new_string.split())
return new_string
def load_character_file(filename):
"""Create a character object from the given definition file.
@@ -101,6 +109,11 @@ def create_fdf(character, fdfname):
# Hit points
('HDTotal', character.hit_dice),
('HPMax', character.hp_max),
# Personality traits
('PersonalityTraits ', text_box(character.personality_traits)),
('Ideals', text_box(character.ideals)),
('Bonds', text_box(character.bonds)),
('Flaws', text_box(character.flaws)),
# Inventory
('CP', character.cp),
('SP', character.sp),