Browse Source

Updated additional proficiencies lists. Added functionality for job instrument and tool proficiencies.

main
suzan 3 weeks ago
parent
commit
b70423cd8c
  1. 66
      backgrounds.json
  2. 53
      creation_engine.py
  3. 232
      jobs.json
  4. 1
      main.py

66
backgrounds.json

@ -5,9 +5,9 @@
"religion"
],
"Additional Proficiencies": {
"Languages": 0,
"Languages": 2,
"Tools": 0,
"Specific Tools": "",
"Additional Tools": [],
"Gaming Set": 0,
"Instrument": 0,
"Artisan's Tool": 0
@ -21,7 +21,7 @@
"Additional Proficiencies": {
"Languages": 0,
"Tools": 0,
"Specific Tools": "",
"Additional Tools": ["Disguise Kit", "Forgery Kit"],
"Gaming Set": 0,
"Instrument": 0,
"Artisan's Tool": 0
@ -34,8 +34,8 @@
],
"Additional Proficiencies": {
"Languages": 0,
"Tools": 0,
"Specific Tools": "",
"Tools": 1,
"Additional Tools": ["Thieves Tools"],
"Gaming Set": 0,
"Instrument": 0,
"Artisan's Tool": 0
@ -49,9 +49,9 @@
"Additional Proficiencies": {
"Languages": 0,
"Tools": 0,
"Specific Tools": "",
"Additional Tools": ["Disguise Kit"],
"Gaming Set": 0,
"Instrument": 0,
"Instrument": 1,
"Artisan's Tool": 0
}
},
@ -62,8 +62,8 @@
],
"Additional Proficiencies": {
"Languages": 0,
"Tools": 0,
"Specific Tools": "",
"Tools": 1,
"Additional Tools": ["Vehicles (Land)"],
"Gaming Set": 0,
"Instrument": 0,
"Artisan's Tool": 0
@ -77,9 +77,9 @@
"Additional Proficiencies": {
"Languages": 0,
"Tools": 0,
"Specific Tools": "",
"Additional Tools": ["Disguise Kit"],
"Gaming Set": 0,
"Instrument": 0,
"Instrument": 1,
"Artisan's Tool": 0
}
},
@ -89,12 +89,12 @@
"persuasion"
],
"Additional Proficiencies": {
"Languages": 0,
"Languages": 1,
"Tools": 0,
"Specific Tools": "",
"Additional Tools": [],
"Gaming Set": 0,
"Instrument": 0,
"Artisan's Tool": 0
"Artisan's Tool": 1
}
},
"Hermit": {
@ -103,9 +103,9 @@
"religion"
],
"Additional Proficiencies": {
"Languages": 0,
"Languages": 1,
"Tools": 0,
"Specific Tools": "",
"Additional Tools": ["Herbalism Kit"],
"Gaming Set": 0,
"Instrument": 0,
"Artisan's Tool": 0
@ -117,10 +117,10 @@
"persuasion"
],
"Additional Proficiencies": {
"Languages": 0,
"Languages": 1,
"Tools": 0,
"Specific Tools": "",
"Gaming Set": 0,
"Additional Tools": [],
"Gaming Set": 1,
"Instrument": 0,
"Artisan's Tool": 0
}
@ -131,10 +131,10 @@
"history"
],
"Additional Proficiencies": {
"Languages": 0,
"Languages": 1,
"Tools": 0,
"Specific Tools": "",
"Gaming Set": 0,
"Additional Tools": [],
"Gaming Set": 1,
"Instrument": 0,
"Artisan's Tool": 0
}
@ -145,11 +145,11 @@
"survival"
],
"Additional Proficiencies": {
"Languages": 0,
"Languages": 1,
"Tools": 0,
"Specific Tools": "",
"Additional Tools": [],
"Gaming Set": 0,
"Instrument": 0,
"Instrument": 1,
"Artisan's Tool": 0
}
},
@ -161,7 +161,7 @@
"Additional Proficiencies": {
"Languages": 0,
"Tools": 0,
"Specific Tools": "",
"Additional Tools": ["Navigator's Tools", "Vehicles (Water)"],
"Gaming Set": 0,
"Instrument": 0,
"Artisan's Tool": 0
@ -173,9 +173,9 @@
"history"
],
"Additional Proficiencies": {
"Languages": 0,
"Languages": 2,
"Tools": 0,
"Specific Tools": "",
"Additional Tools": [],
"Gaming Set": 0,
"Instrument": 0,
"Artisan's Tool": 0
@ -189,7 +189,7 @@
"Additional Proficiencies": {
"Languages": 0,
"Tools": 0,
"Specific Tools": "",
"Additional Tools": ["Navigator's Tools", "Vehicles (Water)"],
"Gaming Set": 0,
"Instrument": 0,
"Artisan's Tool": 0
@ -202,9 +202,9 @@
],
"Additional Proficiencies": {
"Languages": 0,
"Tools": 0,
"Specific Tools": "",
"Gaming Set": 0,
"Tools": 1,
"Additional Tools": ["Vehicles (Land)"],
"Gaming Set": 1,
"Instrument": 0,
"Artisan's Tool": 0
}
@ -217,7 +217,7 @@
"Additional Proficiencies": {
"Languages": 0,
"Tools": 0,
"Specific Tools": "",
"Additional Tools": ["Disguise Kit", "Thieves' Tools"],
"Gaming Set": 0,
"Instrument": 0,
"Artisan's Tool": 0

53
creation_engine.py

@ -23,6 +23,20 @@ BACKGROUND_LIST = ["Acolyte", "Charlatan", "Criminal / Spy", "Entertainer", "Fol
"Guild Artisan / Guild Merchant", "Hermit", "Knight", "Noble", "Outlander", "Pirate", "Sage",
"Sailor", "Soldier", "Urchin",]
INSTRUMENT_LIST = ["Bagpipes", "Birdpipes", "Clarinet", "Drum", "Dulcimer", "Fiddle", "Flute", "Glaur", "Hand Drum",
"Harp", "Horn", "Longhorn", "Lute", "Lyre", "Pan Flute", "Shawm", "Songhorn", "Tantan", "Thelarr",
"Tocken", "Trumpet", "Viol", "Wargong", "Yarting", "Zulkoon"]
LANGUAGES = ["Abyssal", "Celestial", "Deep Speech", "Draconic", "Dwarvish", "Elvish", "Giant", "Gnomish", "Goblin",
"Halfling", "Infernal", "Orc", "Primordial", "Sylvan", "Undercommon"]
GAMING_SETS = ["Bowls", "Darts", "Dice Set", "Dragonchess Set", "Playing Card Set", "Quoits", "Three-Dragon Ante Set"]
ARTISANS_TOOLS = ["Alchemist's Supplies", "Brewer's Supplies", "Calligrapher's Supplies", "Carpenter's Tools",
"Cartographer's Tools", "Cobbler's Tools", "Cook's Utensils", "Glassblower's Tools",
"Jeweler's Tools", "Leatherworker's Tools", "Mason's Tools", "Painter's Supplies", "Potter's Tools",
"Smith's Tools", "Tinker's Tools", "Weaver's Tools", "Woodcarver's Tools"]
class HeroCreation:
def __init__(self):
self.name_generation()
@ -37,6 +51,10 @@ class HeroCreation:
self.article = self.grammar()
self.skill_generation()
self.skill_proficiency()
self.instruments = "None"
self.instrument_proficiencies()
self.artisan_tools = "None"
self.artisan_tool_proficiencies()
self.apply_skill_modifiers("dexterity","initiative")
self.whoami = (f"Your new character is {self.name}, {self.article} {self.race} {self.job}, with the "
f"{self.background} background.\n")
@ -51,7 +69,9 @@ class HeroCreation:
f"\nInvestigation: {self.investigation}\nMedicine: {self.medicine}\nNature: {self.nature}"
f"\nPerception: {self.perception}\nPerformance: {self.performance}\nPersuasion: {self.persuasion}"
f"\nReligion: {self.religion}\nSleight of Hand: {self.sleight_of_hand}"
f"\nStealth: {self.stealth}\nSurvival: {self.survival}")
f"\nStealth: {self.stealth}\nSurvival: {self.survival}\n")
self.other_proficiencies = (f"Additional Proficiencies\n----------\nInstruments: {self.instruments}\n"
f"Artisan's Tools: {self.artisan_tools}")
#Assign the correct a/an article in the 'whoami' attr
def grammar(self):
@ -163,6 +183,7 @@ class HeroCreation:
setattr(self,proficient_skill,f"{new_score} (Prof)")
def job_characteristics(self):
with open('jobs.json') as json_file:
job_data = json.load(json_file)
hit_die_value = job_data[self.job]["Hit Die"]
@ -170,6 +191,36 @@ class HeroCreation:
starting_hp_value = job_data[self.job]["Starting HP"]
setattr(self,"starting_hp",starting_hp_value)
def instrument_proficiencies(self):
with open('jobs.json') as json_file:
job_data = json.load(json_file)
instrument_prof_list = []
try:
for value in range(job_data[self.job]["Instruments"]):
new_instrument = random.choice(INSTRUMENT_LIST)
INSTRUMENT_LIST.remove(new_instrument)
instrument_prof_list.append(new_instrument)
instrument_string = ", ".join(instrument_prof_list)
setattr(self, "instruments", str(instrument_string))
except KeyError:
pass
def artisan_tool_proficiencies(self):
with open('jobs.json') as json_file:
job_data = json.load(json_file)
artisan_prof_list = []
try:
for value in range(job_data[self.job]["Artisan's Tools"]):
new_tool = random.choice(ARTISANS_TOOLS)
ARTISANS_TOOLS.remove(new_tool)
artisan_prof_list.append(new_tool)
artisan_tool_string = ", ".join(artisan_prof_list)
setattr(self, "artisan_tools", str(artisan_tool_string))
except KeyError:
pass
#Used for interactively moving around stats in case of a bad allocation.
#Disabling for now, as this project is intended to be one-command and self-contained
# def stat_moves(self):

232
jobs.json

@ -11,7 +11,24 @@
"sleight_of_hand"
],
"Hit Die": "1d8",
"Starting HP": 8
"Starting HP": 8,
"Artisan's Tools": 1,
"Additional Tools": [
"Thieves' Tools",
"Tinker's Tools"
],
"Armor Proficiency": [
"Light Armor",
"Medium Armor",
"Shields"
],
"Weapon Proficiency": [
"Simple Weapons"
],
"Saving Throws": [
"constitution",
"intelligence"
]
},
"Barbarian": {
"Proficiencies": 2,
@ -24,7 +41,20 @@
"survival"
],
"Hit Die": "1d12",
"Starting HP": 12
"Starting HP": 12,
"Armor Proficiency": [
"Light Armor",
"Medium Armor",
"Shields"
],
"Weapon Proficiency": [
"Simple Weapons",
"Martial Weapons"
],
"Saving Throws": [
"strength",
"constitution"
]
},
"Bard": {
"Proficiencies": 3,
@ -49,7 +79,22 @@
"survival"
],
"Hit Die": "1d8",
"Starting HP": 8
"Starting HP": 8,
"Instruments": 3,
"Armor Proficiency": [
"Light Armor"
],
"Weapon Proficiency": [
"Simple Weapons",
"Hand Crossbows",
"Longswords",
"Rapiers",
"Shortswords"
],
"Saving Throws": [
"dexterity",
"charisma"
]
},
"Cleric": {
"Proficiencies": 2,
@ -61,7 +106,20 @@
"religion"
],
"Hit Die": "1d8",
"Starting HP": 8
"Starting HP": 8,
"Armor Proficiency": [
"Light Armor",
"Medium Armor",
"Shields"
],
"Weapon Proficiency": [
"Simple Weapons"
],
"Saving Throws": [
"wisdom",
"charisma"
],
"Subclass": 1
},
"Druid": {
"Proficiencies": 2,
@ -72,16 +130,37 @@
"medicine",
"nature",
"perception",
"performance",
"persuasion",
"religion",
"survival"
],
"Hit Die": "1d8",
"Starting HP": 8
"Starting HP": 8,
"Additional Tools": [
"Herbalism Kit"
],
"Armor Proficiency": [
"Light Armor",
"Medium Armor",
"Shields"
],
"Weapon Proficiency": [
"Clubs",
"Daggers",
"Darts",
"Javelins",
"Maces",
"Quarterstaffs",
"Scimitars",
"Sickles",
"Slings",
"Spears"
],
"Saving Throws": [
"intelligence",
"wisdom"
]
},
"Fighter": {
"Proficiencies": 2,
"Skills": [
"acrobatics",
@ -94,7 +173,19 @@
"survival"
],
"Hit Die": "1d10",
"Starting HP": 10
"Starting HP": 10,
"Armor Proficiency": [
"All Armor",
"Shields"
],
"Weapon Proficiency": [
"Simple Weapons",
"Martial Weapons"
],
"Saving Throws": [
"strength",
"constitution"
]
},
"Monk": {
"Proficiencies": 2,
@ -106,7 +197,19 @@
"religion"
],
"Hit Die": "1d8",
"Starting HP": 8
"Starting HP": 8,
"Additional Tools": [
"one artisan tool or one musical instrument"
],
"Armor Proficiency": [],
"Weapon Proficiency": [
"Simple Weapons",
"Shortswords"
],
"Saving Throws": [
"strength",
"dexterity"
]
},
"Paladin": {
"Proficiencies": 2,
@ -119,7 +222,19 @@
"religion"
],
"Hit Die": "1d10",
"Starting HP": 10
"Starting HP": 10,
"Armor Proficiency": [
"All Armor",
"Shields"
],
"Weapon Proficiency": [
"Simple Weapons",
"Martial Weapons"
],
"Saving Throws": [
"wisdom",
"charisma"
]
},
"Ranger": {
"Proficiencies": 3,
@ -134,7 +249,20 @@
"survival"
],
"Hit Die": "1d10",
"Starting HP": 10
"Starting HP": 10,
"Armor Proficiency": [
"Light Armor",
"Medium Armor",
"Shields"
],
"Weapon Proficiency": [
"Simple Weapons",
"Martial Weapons"
],
"Saving Throws": [
"strength",
"dexterity"
]
},
"Rogue": {
"Proficiencies": 4,
@ -152,7 +280,25 @@
"stealth"
],
"Hit Die": "1d8",
"Starting HP": 8
"Starting HP": 8,
"Additional Tools": [
"Thieves' Tools"
],
"Armor Proficiency": [
"Light Armor"
],
"Weapon Proficiency": [
"Simple Weapons",
"Hand Crossbows",
"Longswords",
"Rapiers",
"Shortswords"
],
"Saving Throws": [
"dexterity",
"intelligence"
],
"Expertise": 1
},
"Sorcerer": {
"Proficiencies": 2,
@ -165,7 +311,20 @@
"religion"
],
"Hit Die": "1d6",
"Starting HP": 6
"Starting HP": 6,
"Armor Proficiency": [],
"Weapon Proficiency": [
"Daggers",
"Darts",
"Slings",
"Quarterstaffs",
"Light Crossbows"
],
"Saving Throws": [
"constitution",
"charisma"
],
"Subclass": 1
},
"Warlock": {
"Proficiencies": 2,
@ -179,7 +338,18 @@
"religion"
],
"Hit Die": "1d8",
"Starting HP": 8
"Starting HP": 8,
"Armor Proficiency": [
"Light Armor"
],
"Weapon Proficiency": [
"Simple Weapons"
],
"Saving Throws": [
"wisdom",
"charisma"
],
"Subclass": 1
},
"Wizard": {
"Proficiencies": 2,
@ -192,7 +362,19 @@
"religion"
],
"Hit Die": "1d6",
"Starting HP": 6
"Starting HP": 6,
"Armor Proficiency": [],
"Weapon Proficiency": [
"Daggers",
"Darts",
"Slings",
"Quarterstaffs",
"Light Crossbows"
],
"Saving Throws": [
"intelligence",
"wisdom"
]
},
"Blood Hunter": {
"Proficiencies": 3,
@ -207,6 +389,22 @@
"survival"
],
"Hit Die": "1d8",
"Starting HP": 8
"Starting HP": 8,
"Additional Tools": [
"alchemist's supplies"
],
"Armor Proficiency": [
"Light Armor",
"Medium Armor",
"Shields"
],
"Weapon Proficiency": [
"Simple Weapons",
"Martial Weapons"
],
"Saving Throws": [
"dexterity",
"intelligence"
]
}
}

1
main.py

@ -6,5 +6,6 @@ print(hero.whoami)
print(hero.stat_block)
print(hero.additional_stats)
print(hero.skill_bonuses)
print(hero.other_proficiencies)

Loading…
Cancel
Save