From 274f34fe88234c63658cb7ec74985b8987bfa67d Mon Sep 17 00:00:00 2001 From: Ben Cook Date: Mon, 17 Dec 2018 16:47:58 -0500 Subject: [PATCH] added Aasimar, updated background languages, and corrected a few other issues --- dungeonsheets/__init__.py | 2 + dungeonsheets/background.py | 2 +- dungeonsheets/create_character.py | 1 + dungeonsheets/make_sheets.py | 14 +++-- dungeonsheets/race.py | 18 +++++- dungeonsheets/spells.py | 3 +- dungeonsheets/weapons.py | 94 ++++++++++++++++++------------- setup.py | 3 +- 8 files changed, 89 insertions(+), 48 deletions(-) diff --git a/dungeonsheets/__init__.py b/dungeonsheets/__init__.py index da21429..d76456f 100644 --- a/dungeonsheets/__init__.py +++ b/dungeonsheets/__init__.py @@ -1 +1,3 @@ from . import weapons, character + +__VERSION__ = "0.6.1" diff --git a/dungeonsheets/background.py b/dungeonsheets/background.py index 8720671..e86025a 100644 --- a/dungeonsheets/background.py +++ b/dungeonsheets/background.py @@ -51,7 +51,7 @@ class GuildMerchant(GuildArtisan): class Hermit(Background): name = "Hermit" skill_proficiencies = ("medicine", "religion") - languages = ("[choose one]") + languages = ("[choose one]", ) class Noble(Background): diff --git a/dungeonsheets/create_character.py b/dungeonsheets/create_character.py index 8690cb0..84e5385 100755 --- a/dungeonsheets/create_character.py +++ b/dungeonsheets/create_character.py @@ -54,6 +54,7 @@ races = { 'Half-Elf': race.HalfElf, 'Half-Orc': race.HalfOrc, 'Tiefling': race.Tiefling, + 'Fallen Aasimar': race.FallenAasimar, } diff --git a/dungeonsheets/make_sheets.py b/dungeonsheets/make_sheets.py index 84f39ab..157025e 100644 --- a/dungeonsheets/make_sheets.py +++ b/dungeonsheets/make_sheets.py @@ -55,12 +55,15 @@ CHECKBOX_ON = 'Yes' CHECKBOX_OFF = 'Off' PDFTK_CMD = 'pdftk' + def text_box(string): """Format a string for displaying in a text box.""" # Remove line breaks - new_string = string.replace('\n', ' ').replace('\r', ' ') + # new_string = string.replace('\n', ' ').replace('\r', ' ') + new_string = string # Remove multiple whitespace - new_string = ' '.join(new_string.split()) + # new_string = ' '.join(new_string.split()) + new_string = new_string return new_string @@ -328,8 +331,8 @@ def create_character_pdf(character, basename, flatten=False): for _fields, weapon in zip(weapon_fields, character.weapons): name_field, atk_field, dmg_field = _fields fields[name_field] = weapon.name - fields[atk_field] = str(weapon.attack_bonus) - fields[dmg_field] = f'{weapon.damage} {weapon.damage_type}' + fields[atk_field] = '{:+d}'.format(weapon.attack_bonus) + fields[dmg_field] = f'{weapon.damage}/{weapon.damage_type}' # Other attack information attack_str = f'Armor: {character.armor}' attack_str += '\n\r' @@ -460,7 +463,8 @@ def make_sheet(character_file, flatten=False): char_base = os.path.splitext(character_file)[0] + '_char' sheets = [char_base + '.pdf'] pages = [] - char_pdf = create_character_pdf(character=char, basename=char_base, flatten=flatten) + char_pdf = create_character_pdf(character=char, basename=char_base, + flatten=flatten) pages.append(char_pdf) if char.is_spellcaster: # Create spell sheet diff --git a/dungeonsheets/race.py b/dungeonsheets/race.py index c9cf880..5438a57 100644 --- a/dungeonsheets/race.py +++ b/dungeonsheets/race.py @@ -4,7 +4,8 @@ from . import weapons __all__ = ('Dwarf', 'HillDwarf', 'MountainDwarf', 'Elf', 'HighElf', 'WoodElf', 'DarkElf', 'Halfling', 'LightfootHalfling', 'StoutHalfling', 'Human', 'Dragonborn', 'Gnome', 'ForestGnome', - 'RockGnome', 'HalfElf', 'HalfOrc', 'Tiefling') + 'RockGnome', 'HalfElf', 'HalfOrc', 'Tiefling', 'Aasimar', + 'FallenAasimar') class Race(): @@ -176,3 +177,18 @@ class Tiefling(Race): intelligence_bonus = 1 charisma_bonus = 2 languages = ("Common", "Infernal") + + +# Aassimar +class Aasimar(Race): + name = 'Aasimar' + size = 'medium' + speed = 30 + charisma_bonus = 2 + languages = ("Common", "Celestial") + + +# Fallen Aasimar +class FallenAasimar(Aasimar): + name = "Fallen Aasimar" + strength_bonus = 1 diff --git a/dungeonsheets/spells.py b/dungeonsheets/spells.py index b5e363f..d17c14d 100644 --- a/dungeonsheets/spells.py +++ b/dungeonsheets/spells.py @@ -17,6 +17,7 @@ def create_spell(**params): NewSpell = type('UnknownSpell', (Spell,), params) return NewSpell + class Spell(): """A magical spell castable by a player character.""" level = 0 @@ -2078,7 +2079,7 @@ class EldritchBlast(Spell): """ name = 'Eldritch Blast' - level = 3 + level = 0 casting_time = "1 action" casting_range = "120 feet" components = ('V', 'S') diff --git a/dungeonsheets/weapons.py b/dungeonsheets/weapons.py index 30d53f5..5983485 100644 --- a/dungeonsheets/weapons.py +++ b/dungeonsheets/weapons.py @@ -5,7 +5,7 @@ class Weapon(): cost = "0 gp" base_damage = "1d4" bonus_damage = 0 - damage_type = "piercing" + damage_type = "p" attack_bonus = 0 weight = 1 # In lbs properties = "Light" @@ -16,7 +16,7 @@ class Weapon(): def damage(self): dam_str = str(self.base_damage) if self.bonus_damage != 0: - dam_str += ' ' + mod_str(self.bonus_damage) + dam_str += '' + mod_str(self.bonus_damage) return dam_str @@ -24,7 +24,7 @@ class Club(Weapon): name = "Club" cost = "1 sp" base_damage = "1d4" - damage_type = "bludgeoning" + damage_type = "b" weight = 2 properties = "Light" ability = 'strength' @@ -34,7 +34,7 @@ class Dagger(Weapon): name = "Dagger" cost = "2 gp" base_damage = "1d4" - damage_type = "piercing" + damage_type = "p" weight = 1 properties = "Finesse, light, thrown (range 20/60)" is_finesse = True @@ -45,7 +45,7 @@ class Greatclub(Weapon): name = "Greatclub" cost = "2 sp" base_damage = "1d8" - damage_type = "bludgeoning" + damage_type = "b" weight = 10 properties = "Two-handed" ability = 'strength' @@ -55,7 +55,7 @@ class Handaxe(Weapon): name = "Handaxe" cost = "5 gp" base_damage = "1d6" - damage_type = "slashing" + damage_type = "s" weight = 2 properties = "Light, thrown (range 20/60)" ability = 'strength' @@ -65,7 +65,7 @@ class Javelin(Weapon): name = "Javelin" cost = "5 sp" base_damage = "1d6" - damage_type = "piercing" + damage_type = "p" weight = 2 properties = "Thrown (range 30/120)" ability = 'strength' @@ -75,7 +75,7 @@ class LightHammer(Weapon): name = "Light hammer" cost = "2 gp" base_damage = "1d4" - damage_type = "bludgeoning" + damage_type = "b" weight = 2 properties = "Light, thrown (range 20/60)" ability = 'strength' @@ -85,7 +85,7 @@ class Mace(Weapon): name = "Mace" cost = "5 gp" base_damage = "1d6" - damage_type = "bludgeoning" + damage_type = "b" weight = 4 properties = "" ability = 'strength' @@ -95,7 +95,7 @@ class Quarterstaff(Weapon): name = "Quarterstaff" cost = "2 sp" base_damage = "1d6" - damage_type = "bludgeoning" + damage_type = "b" weight = 4 properties = "Versatile (1d8)" ability = 'strength' @@ -105,7 +105,7 @@ class Sickle(Weapon): name = "Sickle" cost = "1 gp" base_damage = "1d4" - damage_type = "slashing" + damage_type = "s" weight = 2 properties = "Light" ability = 'strength' @@ -115,7 +115,7 @@ class Spear(Weapon): name = "Spear" cost = "1 gp" base_damage = "1d6" - damage_type = "piercing" + damage_type = "p" weight = 3 properties = "Thrown (range 20/60), versatile (1d8)" ability = 'strength' @@ -125,7 +125,7 @@ class LightCrossbow(Weapon): name = "Light crossbow" cost = "25 gp" base_damage = "1d8" - damage_type = "piercing" + damage_type = "p" weight = 5 properties = "Ammunition (range 80/320, loading, two-handed" ability = 'dexterity' @@ -135,7 +135,7 @@ class Dart(Weapon): name = "Dart" cost = "5 cp" base_damage = "1d4" - damage_type = "piercing" + damage_type = "p" weight = 0.25 properties = "Finesse, thrown (range 20/60)" is_finesse = True @@ -146,7 +146,7 @@ class Shortbow(Weapon): name = "Shortbow" cost = "25 gp" base_damage = "1d6" - damage_type = "piercing" + damage_type = "p" weight = 2 properties = "Ammunition (range 80/320), two-handed" ability = 'dexterity' @@ -156,7 +156,7 @@ class Sling(Weapon): name = "Sling" cost = "1 sp" base_damage = "1d4" - damage_type = "bludgeoning" + damage_type = "b" weight = 0 properties = "Ammunition (range 30/120)" ability = 'dexterity' @@ -166,7 +166,7 @@ class Battleaxe(Weapon): name = "Battleaxe" cost = "10 gp" base_damage = "1d8" - damage_type = "slashing" + damage_type = "s" weight = 4 properties = "Versatile (1d10)" ability = 'strength' @@ -176,7 +176,7 @@ class Flail(Weapon): name = "Flail" cost = "10gp" base_damage = "1d8" - damage_type = "bludgeoning" + damage_type = "b" weight = 2 properties = "" ability = 'strength' @@ -186,7 +186,7 @@ class Glaive(Weapon): name = "Glaive" cost = "20 gp" base_damage = "1d10" - damage_type = "slashing" + damage_type = "s" weight = 6 properties = "Heavy, reach, two-handed" ability = 'strength' @@ -196,7 +196,7 @@ class Greataxe(Weapon): name = "Greataxe" cost = "30 gp" base_damage = "1d12" - damage_type = "slashing" + damage_type = "s" weight = 7 properties = "Heavy, two-handed" ability = 'strength' @@ -206,7 +206,7 @@ class Greatsword(Weapon): name = "Greatsword" cost = "50 gp" base_damage = "2d6" - damage_type = "slashing" + damage_type = "s" weight = 6 properties = "Heavy, two-handed" ability = 'strength' @@ -216,7 +216,7 @@ class Halberd(Weapon): name = "Halberd" cost = "20 gp" base_damage = "1d10" - damage_type = "slashing" + damage_type = "s" weight = 6 properties = "Heavy, reach, two-handed" ability = 'strength' @@ -226,7 +226,7 @@ class Lance(Weapon): name = "Lance" cost = "10gp" base_damage = "1d12" - damage_type = "piercing" + damage_type = "p" weight = 6 properties = "Reach, special" ability = 'strength' @@ -236,7 +236,7 @@ class Longsword(Weapon): name = "Longsword" cost = "15 gp" base_damage = "1d8" - damage_type = "slashing" + damage_type = "s" weight = 3 properties = "Versatile (1d10)" ability = 'strength' @@ -246,7 +246,7 @@ class Maul(Weapon): name = "Maul" cost = "10 gp" base_damage = "2d6" - damage_type = "bludgeoning" + damage_type = "b" weight = 10 properties = "Heavy, two-handed" ability = 'strength' @@ -256,7 +256,7 @@ class Morningstar(Weapon): name = "Morningstar" cost = "15 gp" base_damage = "1d8" - damage_type = "piercing" + damage_type = "p" weight = 4 properties = "" ability = 'strength' @@ -266,7 +266,7 @@ class Pike(Weapon): name = "Pike" cost = "5 gp" base_damage = "1d10" - damage_type = "piercing" + damage_type = "p" weight = 18 properties = "Heavy, reach, two-handed" ability = 'strength' @@ -276,7 +276,7 @@ class Rapier(Weapon): name = "Rapier" cost = "25 gp" base_damage = "1d8" - damage_type = "piercing" + damage_type = "p" weight = 2 properties = "Finesse" is_finesse = True @@ -287,7 +287,7 @@ class Scimitar(Weapon): name = "Scimitar" cost = "25 gp" base_damage = "1d6" - damage_type = "slashing" + damage_type = "s" weight = 3 properties = "Finesse, light" is_finesse = True @@ -298,7 +298,7 @@ class Shortsword(Weapon): name = "Shortsword" cost = "10 gp" base_damage = "1d6" - damage_type = "piercing" + damage_type = "p" weight = 0 properties = "Finesse, light" is_finesse = True @@ -309,7 +309,7 @@ class ThrowingHammer(Weapon): name = "Throwing Hammer" cost = "15 gp" base_damage = '1d6' - damage_type = "bludgeoning" + damage_type = "b" weight = 4 properties = "Thrown (range 60/120)" ability = "strength" @@ -319,7 +319,7 @@ class Trident(Weapon): name = "Trident" cost = "5 gp" base_damage = "1d6" - damage_type = "piercing" + damage_type = "p" weight = 4 properties = "Thrown (range 20/60), versatile (1d8)" ability = 'strength' @@ -329,7 +329,7 @@ class WarPick(Weapon): name = "War pick" cost = "5 gp" base_damage = "1d8" - damage_type = "piercing" + damage_type = "p" weight = 2 properties = "" ability = 'strength' @@ -339,7 +339,7 @@ class Warhammer(Weapon): name = "Warhammer" cost = "15 gp" base_damage = "1d8" - damage_type = "bludgeoning" + damage_type = "b" weight = 2 properties = "Versatile (1d10)" ability = 'strength' @@ -349,7 +349,7 @@ class Whip(Weapon): name = "Whip" cost = "2 gp" base_damage = "1d4" - damage_type = "slashing" + damage_type = "s" weight = 3 properties = "Finesse, reach" is_finesse = True @@ -360,7 +360,7 @@ class Blowgun(Weapon): name = "Blowgun" cost = "10 gp" base_damage = "1" - damage_type = "piercing" + damage_type = "p" weight = 1 properties = "Ammunition (range 25/100), loading" ability = 'dexterity' @@ -370,7 +370,7 @@ class HandCrossbow(Weapon): name = "Crossbow, hand" cost = "75 gp" base_damage = "1d6" - damage_type = "piercing" + damage_type = "p" weight = 3 properties = "Ammunition (range 30/120), light, loading" ability = 'dexterity' @@ -380,7 +380,7 @@ class HeavyCrossbow(Weapon): name = "Crossbow, heavy" cost = "50 gp" base_damage = "1d10" - damage_type = "piercing" + damage_type = "p" weight = 18 properties = "Ammunition (range 100/400), heaving, loading, two-handed" ability = 'strength' @@ -390,7 +390,7 @@ class Longbow(Weapon): name = "Longbow" cost = "50 gp" base_damage = "1d8" - damage_type = "piercing" + damage_type = "p" weight = 2 properties = "Ammunition (range 150/600), heavy, two-handed" ability = 'strength' @@ -405,6 +405,22 @@ class Net(Weapon): properties = "Special, thrown (range 5/15)" ability = 'strength' + +class Unarmed(Weapon): + name = "Unarmed" + cost = "0 gp" + base_damage = "1" + damage_type = "b" + weight = 0 + properties = "" + ability = "strength" + + +class SotaFist(Unarmed): + name = "Sota Fist" + base_damage = "1d4" + bonus_damage = 2 + # Some lists of weapons for easy proficiency resolution simple_melee_weapons = (Club, Dagger, Greatclub, Handaxe, Javelin, diff --git a/setup.py b/setup.py index dec4975..a8ff037 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,8 @@ setup(name='dungeonsheets', packages=['dungeonsheets'], package_data={ 'dungeonsheets': ['blank-character-sheet-default.pdf', 'blank-spell-sheet-default.pdf', - 'spellbook_template.tex'] + 'spellbook_template.tex', '../VERSION', + 'character_template.txt'] }, install_requires=[ 'fdfgen', 'npyscreen', 'jinja2', 'pdfrw',