adding support for dicts of lists

This commit is contained in:
evilchili
2023-12-08 14:28:07 -08:00
parent 845dbe1f7a
commit 3fbcb57aca
2 changed files with 36 additions and 9 deletions
+5 -1
View File
@@ -134,7 +134,11 @@ class RollTable:
if not ds.data[option]:
values.append([option])
continue
choice = random.choice(ds.data[option])
if hasattr(ds.data[option], 'keys'):
rand_key = random.choice(list(ds.data[option].keys()))
choice = [rand_key, *ds.data[option][rand_key]]
else:
choice = random.choice(ds.data[option])
if hasattr(choice, 'keys'):
c = [option]
for (k, v) in choice.items():