Fixed small bugs with big effects

Fixed the character_potrait variable in make_sheets. Tested OK with .json files in example.
This commit is contained in:
bw-mutley
2022-03-30 01:07:25 -03:00
committed by GitHub
parent 313b580e3f
commit 94655735e3
4 changed files with 22 additions and 2 deletions
+2 -1
View File
@@ -765,7 +765,8 @@ class Character(Creature):
weight = equipment_weight_parser(self.equipment,
self.equipment_weight_dict)
weight += sum([w.weight for w in self.weapons])
weight += self.armor.weight
if self.armor:
weight += self.armor.weight
if self.shield:
weight += 6
weight += sum([self.cp, self.sp, self.ep, self.gp, self.pp])/50
+17
View File
@@ -13,8 +13,12 @@ from dungeonsheets.armor import all_armors
all_weapons = simple_weapons + martial_weapons + firearms
item_reader = re.compile(r"(\d*)(\s*)(.+)")
gear_weight = {"abacus":2,
"alms box":3,
"vial of acid":1,
"flask of alchemist's fire":1,
"flasks of alchemist's fire":1,
"flask of oil":1,
"flasks of oil":1,
"arrows":1/20,
"arrow":1/20,
"bowgun needles": 1/50,
@@ -34,14 +38,20 @@ gear_weight = {"abacus":2,
"bell":0,
"blanket":3,
"block and tackle":5,
"block of incense":1/20,
"blocks of incense":1/20,
"censer":1/25,
"book":5,
"book of lore":5,
"glass bottle":2,
"bucket":2,
"caltrops":2/20,
"candle":0,
"candles":0,
"crosbow bolt case":1,
"scroll case":1,
"map case":1,
"cases for maps and scrolls":1,
"feet of chain":1,
"feet chain":1,
"chalk":0,
@@ -49,6 +59,7 @@ gear_weight = {"abacus":2,
"climber's kit":12,
"common clothes":3,
"costume":4,
"costumes":4,
"fine clothes":6,
"traveler's clothes":4,
"component pouch":2,
@@ -63,6 +74,7 @@ gear_weight = {"abacus":2,
"grappling hook":4,
"hammer":3,
"knife":1,
"small knife":1,
"sacrificial knife":1,
"sledge hammer":10,
"healer's kit":3,
@@ -88,6 +100,7 @@ gear_weight = {"abacus":2,
"flask of oil":1,
"paper sheet":0,
"parchment":0,
"sheets of parchment":0,
"vial of perfume":0,
"miner's pick":10,
"piton":0.25,
@@ -97,6 +110,7 @@ gear_weight = {"abacus":2,
"iron pot":10,
"potion of healing":0.5,
"pouch":1,
"little bag of sand":1,
"quiver":1,
"portable ram":35,
"days of rations":2,
@@ -105,6 +119,7 @@ gear_weight = {"abacus":2,
"feet of hempen rope":10/50,
"feet hempen rope":10/50,
"feet of silk rope":5/50,
"feet of string":1/50,
"feet silk rope":5/50,
"sack":0.5,
"merchant's scale":3,
@@ -121,6 +136,7 @@ gear_weight = {"abacus":2,
"torch":1,
"torches":1,
"vial":0,
"vestments":3,
"waterskin":5,
"wheatstone":1}
@@ -162,6 +178,7 @@ tools_weight = {"alchemist's supplies":8,
"navigator's tools":2,
"poisoner's kit":2,
"thieves' tools":1}
gear_weight.update(tools_weight)
gear_weight.update({armor.name.lower():armor.weight for armor in all_armors})
gear_weight.update({w.name.lower():w.weight for w in all_weapons})
+2
View File
@@ -501,6 +501,8 @@ def make_character_sheet(
portrait_file = character.portrait
if portrait_file is True:
portrait_file=char_file.stem + ".jpeg"
elif portrait_file is False:
portrait_file=""
# Set the fields in the FDF
basename = char_file.stem
char_base = basename + "_char"
+1 -1
View File
@@ -385,7 +385,7 @@ class Shortsword(MartialWeapon, MeleeWeapon):
cost = "10 gp"
base_damage = "1d6"
damage_type = "p"
weight = 0
weight = 2
properties = "Finesse, light"
is_finesse = True
ability = "strength"