Skip to content

Instantly share code, notes, and snippets.

@m-allen-hall
Last active August 15, 2022 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m-allen-hall/826fd24c71aedbb864ba47ad64e11bf7 to your computer and use it in GitHub Desktop.
Save m-allen-hall/826fd24c71aedbb864ba47ad64e11bf7 to your computer and use it in GitHub Desktop.
Character generator for MorkBorg characters that do not use the optional classes. Runs with a simple GUI.
#classlessSCVM v0.1 with GUI
#classless character generator for MÖRK BORG
#classlessSCVM is an independent production by M. Allen Hall
#and is not affiliated with Ockult Örtmästare Games or Stockholm
#Kartell. It is published under the MÖRK BORG Third Party License.
#MÖRK BORG is copyright Ockult Örtmästare Games and Stockholm Kartell.
#random tables as lists
name_list = ['Lars', 'Torleif', 'Aesir', 'Arne', 'Aric', 'Arkyn', 'Bragi', 'Espen',
'Frey', 'Frode', 'Gisli', 'Hrafen', 'Ivar', 'Njord', 'Rune', 'Sindri',
'Tor', 'Tyr', 'Ulfar', 'Ulrik', 'Vidar', 'Ove', 'Mads', 'Øivind', 'Tiril',
'Brinter', 'Domen', 'Nal', 'Rook', 'Otmar', 'Tej', 'Meho', 'Rudi', 'Pralf',
'Fafnek', 'Hyerr', 'Skesruk', 'Brodr', 'Jorben', 'Bhili']
bag_list = [0,'your own two hands (if you are lucky).',
'a stick with a sack on the end on it for 3 normal-sized items.',
'a sling for 4 normal-sized items.',
'a haversack for 8 normal-sized items.',
'a small cart with nothing to pull it.',
'a mule. Maybe you know someone with a cart that needs pulling.']
item1_list = [0, 'silk cord 50 feet',
'Presence + 8 caltrops in a wooden box (d2 damage)',
'bulls-eye lamp with oil for Presence + 6 hours',
'bag with 30 marbles',
'random unclean scroll',
'silver hand mirror',
'cane which conceals a short blade (d4 damage)',
'glass-cutter, handled',
'climbing spikes',
'empty leather book with pen and ink',
'a bottle of yellow poison (d4 doses, DR14 Toughness or d8 damage)',
'leather tool roll with chisels, gouges, and a small mallet']
item2_list = [0, 'a bottle of metal-eating acid (d4 + 1 doses, will corrode a hinge or lock in 3d6 minutes)',
'random sacred scroll',
'd4 bundles of healing herbs, cures infection and heals d4 HP',
'wooden fife with which you are a half-decent performer',
'smoking pipe with a pouch of fine tobacco',
'bottle of napalm (d10 damage to up to 3 adjacent creatures)',
'spool of metal wire',
'trepanation set with auger, hammer, and awls',
'shield (-1 HP damage or have the shield break to ignore one attack)',
'a wooden box with a variety of spices',
'fishing tackle',
'tame falcon (it might share its food with you if you are desperate)']
weapon_list = [0, 'Walking Stick d4', 'Dagger d4', 'Sling d4', 'Hatchet d4', 'Axe d6', 'Mace d6', 'Shortbow d6, with Presence +10 arrows',
'Axe d8', 'Longbow d8, with Presence +10 bolts', 'Scythe d10']
armor_list = [0, 'no armor (tier 0)',
'light armor (−d2 damage, tier 1)',
'medium armor (−d4 damage, tier 2)',
'heavy armor (−d6 damage, tier 3)']
unclean_list = [0, 'Palms Open the Southern Gate', 'Tongue of Eris', 'Te-le-kin-esis', 'Lucy-fires Levitation', 'Daemon of Capillaries',
'Nine Violet Signs Unknot the Storm', 'Metzhuotl Blind Your Eye', 'Foul Psychopomp', 'Eyelid Blinds the Mind', 'DEATH']
sacred_list = [0, 'Grace of a Dead Saint', 'Grace for a Sinner', 'Whispers Pass the Gate', 'Aegis of Sorrow',
'Unmet Fate', 'Bestial Speech', "False Dawn/Night's Chariot", 'Hermetic Sleep', "Roskoe's Consuming Glare",
'Enochian Syntax']
import random
def new_char():
#roll stats function
def roll_stat():
stat_mod = [0,-3,-3,-3,-3,-2,-2,-1,-1,0,0,0,0,1,1,2,2,3,3]
fourd6_roll = [random.randint(1,6) for i in range (0,4)]
fourd6_roll.sort()
fourd6_d1sum = sum(fourd6_roll[1:4])
mod_final = stat_mod[fourd6_d1sum]
return mod_final
str_mod = roll_stat()
agi_mod = roll_stat()
pre_mod = roll_stat()
tou_mod = roll_stat()
#name
name_picked = random.choice(name_list)
window['-ML-'+sg.WRITE_ONLY_KEY].print(name_picked, 'is your name.')
#silver and food
s_roll = random.randint(1,6) + random.randint (1,6)
silver = s_roll*10
food_roll = random.randint(1,4)
window['-ML-'+sg.WRITE_ONLY_KEY].print('Possessions:', silver, 'silver, a waterskin, and', food_roll, 'day(s) worth of food.')
#roll on first three lists
bag_roll = random.randint(1,6)
item1_roll = random.randint(1,12)
item2_roll = random.randint(1,12)
#roll for armor and weapon
if item1_roll == 5 or item2_roll == 2:
weapon_roll = random.randint(1,6)
armor_roll = random.randint(1,2)
else:
weapon_roll = random.randint(1,10)
armor_roll = random.randint(1,4)
#print out gear
window['-ML-'+sg.WRITE_ONLY_KEY].print('For carrying your gear you have', bag_list[bag_roll])
if item1_roll == 5:
window['-ML-'+sg.WRITE_ONLY_KEY].print('Unclean Scroll:', unclean_list[random.randint(1,10)])
elif item1_roll == 2:
window['-ML-'+sg.WRITE_ONLY_KEY].print('Item:', pre_mod + 8, 'caltrops in a wooden box, d2 damage')
elif item1_roll == 3:
window['-ML-'+sg.WRITE_ONLY_KEY].print('Item: bulls-eye lamp with oil for', pre_mod + 6, 'hours')
elif item1_roll == 11:
window['-ML-'+sg.WRITE_ONLY_KEY].print('Item: a bottle of yellow poison,', random.randint(2,5), 'doses, Toughness DR14 or d8 damage')
else:
window['-ML-'+sg.WRITE_ONLY_KEY].print('Item:', item1_list[item1_roll])
if item2_roll == 2:
window['-ML-'+sg.WRITE_ONLY_KEY].print('Sacred Scroll:', sacred_list[random.randint(1,10)])
elif item2_roll == 1:
window['-ML-'+sg.WRITE_ONLY_KEY].print('Item: a bottle of metal-eating acid,', random.randint(1,4), 'dose(s), will corrode a hinge or lock in 3d6 minutes')
elif item2_roll == 3:
window['-ML-'+sg.WRITE_ONLY_KEY].print('Item:', random.randint(1,4), 'bundle(s) of healing herbs, cures infection and heals d4 HP')
else:
window['-ML-'+sg.WRITE_ONLY_KEY].print('Item:', item2_list[item2_roll])
if weapon_roll == 7:
window['-ML-'+sg.WRITE_ONLY_KEY].print('Weapon: Shortbow d6, with', pre_mod + 10, 'arrows')
elif weapon_roll == 3:
window['-ML-'+sg.WRITE_ONLY_KEY].print('Weapon: Sling d4, with', pre_mod + 8, 'smooth, round stones')
elif weapon_roll == 9:
window['-ML-'+sg.WRITE_ONLY_KEY].print('Weapon: Longbow d8, with', pre_mod + 10, 'arrows')
else:
window['-ML-'+sg.WRITE_ONLY_KEY].print('Weapon:', weapon_list[weapon_roll])
window['-ML-'+sg.WRITE_ONLY_KEY].print('Armor:', armor_list[armor_roll])
window['-ML-'+sg.WRITE_ONLY_KEY].print('-')
#print mods
window['-ML-'+sg.WRITE_ONLY_KEY].print('Strength', str_mod)
window['-ML-'+sg.WRITE_ONLY_KEY].print('Agility', agi_mod)
window['-ML-'+sg.WRITE_ONLY_KEY].print('Presence', pre_mod)
window['-ML-'+sg.WRITE_ONLY_KEY].print('Toughness', tou_mod)
window['-ML-'+sg.WRITE_ONLY_KEY].print('-')
#roll for HP
hp_roll = random.randint(1,8)
hp = hp_roll + tou_mod
if hp <= 0:
window['-ML-'+sg.WRITE_ONLY_KEY].print('HP 1')
else:
window['-ML-'+sg.WRITE_ONLY_KEY].print('HP', hp)
#omens
window['-ML-'+sg.WRITE_ONLY_KEY].print('Omens:', random.randint(1,2))
window['-ML-'+sg.WRITE_ONLY_KEY].print('-')
window['-ML-'+sg.WRITE_ONLY_KEY].print("Don't die.")
import PySimpleGUI as sg
sg.theme('Black') # Add a touch of color
MLINE_KEY = '-ML-'+sg.WRITE_ONLY_KEY # multiline element's key. Indicate it's an output only element
output_key = MLINE_KEY
# All the stuff inside your window.
layout = [ [sg.Button('Generate SCVM')],
[sg.Multiline('All Praise Yetsabu-Nech\n', size=(80,27), key=MLINE_KEY)],
[sg.Text('classlessSCVM is an independent production by M. Allen Hall')],
[sg.Text('and is not affiliated with Ockult Örtmästare Games or Stockholm')],
[sg.Text('Kartell. It is published under the MÖRK BORG Third Party License.')],
[sg.Text('MÖRK BORG is copyright Ockult Örtmästare Games and Stockholm Kartell.')]
]
# Create the Window
window = sg.Window('classlessSCVM v0.1', layout)
# Event Loop to process "events" and get the "values" of the inputs
while True:
event, values = window.read()
if event == sg.WIN_CLOSED: # if user closes window or clicks cancel
break
if event == 'Generate SCVM':
new_char()
window['-ML-'+sg.WRITE_ONLY_KEY].print('---------------------------')
window['-ML-'+sg.WRITE_ONLY_KEY].print('---------------------------')
window.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment