def guardiansTable754(cuMod): rand = randint(1,20) if rand <= 5: return random_choice(relativesTable753) elif rand <= 8: return 'raised in an orphanage' elif rand <= 10: global charAdopted charAdopted = True familyTable106a(cuMod) elif rand <= 11: return 'raised by priests or monks of ' + deitiesTable864(cuMod) elif rand <= 12: return 'raised by ' + random_choice(nonhumansTable751) elif rand <= 13: return 'sold into slavery ' + enslavedTable539() elif rand <= 14: return 'raised on the street by beggars and prostitutes' elif rand <= 15: return "raised by a thieves' guild" #table534 here elif rand <= 16: return 'raised by different relatives, passed between them until coming of age' elif rand <= 17: return 'raised by an adventurer: ' #table757 elif rand <= 18: return 'character mysteriously disappeared for ' + str(randint(1,10)) + ' years' elif rand <= 19: return 'raised by beasts in the wild' elif rand <= 20: return 'raised by ' #table 756
def socialTable103(cuMod, tiMod, charCulture): rand = randint(1,100) + cuMod + tiMod if rand <= 12: return('Destitute', -3, '', 0) elif rand <= 40: return('Poor', -1, '', 0) elif rand <=84: return('Comfortable', 0, '', 0) elif rand == 85: socialTable103(0, tiMod, charCulture) elif rand <= 96: return('Well-to-do', 2, '', 0) elif rand <= 98: rand = randint(1,100) if rand <= tiMod + 1: return('Extremely Wealthy', 8, '', 0) else: return('Wealthy', 4, '', 0) elif rand >= 99: if charCulture == 'Primitive': nobleTitle = random_choice(nobleTable758prim) elif charCulture == 'Nomad': nobleTitle = random_choice(nobleTable758nomad) elif charCulture == 'Barbarian': nobleTitle = random_choice(nobleTable758barb) else: nobleTitle = random_choice(nobleTable758civil) tiMod = nobleTable758tiMod(nobleTitle) # 103a is exactly like 103 but iterates at 99+ rands. Not necessary, but slightly cleaner on debug printing. Otherwise I could just keep iterating through 103 until it didn't roll into circles. return socialTable103a(cuMod, tiMod, charCulture, nobleTitle) else: raise ValueError("You shouldn't ever be able to see this error on socialTable103.")
def giftsTable863(): rand = randint(1,20) if rand <= 1: return random_choice(giftsTable863a) elif rand <= 2: return 'guardianship of a young ward. Use table 761' elif rand <= 3: return 'unusual pet. Use table 760' elif rand <= 4: return random_choice(giftsTable863b) elif rand <= 5: return 'a tapestry' elif rand <= 6: return 'an anachronistic device' elif rand <= 7: return 'a key' elif rand <= 8: return 'a locked or sealed book' elif rand <= 9: return 'a shield' elif rand <= 10: return 'a sealed bottle' elif rand <= 11: return 'a tarnished old helmet' elif rand <= 12: return 'a bound wooden staff' elif rand <= 13: return 'a riding animal' elif rand <= 14: return 'a deed to ' + random_choice(giftsTable863c) elif rand <= 15: return 'a musical instrument' elif rand <= 16: return random_choice(giftsTable863d) elif rand <= 17: return 'a pouch of papers containing ' + random_choice(giftsTable863e) elif rand <= 18: return 'a sealed trunk' elif rand <= 19: return 'a chainmail hauberk' elif rand <= 20: return 'roll again shenanigans'
def companionTable761a(): rand = randint(1,9) #easily able to add 10 to this for the re-roll once everything is set up if rand == 1: return 'childhood friend' elif rand == 2: return 'a family member, ' + random_choice(relativesTable753) elif rand == 3: return 'a nonhuman, ' + random_choice(nonhumansTable751) elif rand == 4: return 'a stranger, ' #table 750 go hurr elif rand == 5: return 'an intelligent, articulate inanimate object' elif rand == 6: return 'a kid aged ' + str(randint(7,13)) elif rand == 7: rand = randint(1,2) if rand == 1: return 'an older sibling' else: return 'a younger sibling' elif rand == 8: return 'an adventurer, ' #table 757 elif rand == 9: return 'a former enemy or rival, ' #table 762 go hurr
def enslavedTable539(): rand = randint(1,20) if rand <= 1: # Escape rand = randint(1,8) if rand == 1: return 'character escaped slavery, a reward of ' + str(randint(1,10)*100) + ' gold is offered for their capture' elif rand == 2: return str(randint(1,6)) + ' slaves accompanied the character in their escape from slavery' elif rand == 3: return 'the government is offering a bounty on the escaped slave' elif rand == 4: return "the owner's " + random_choice(relativesTable753) + "helped the character escape from slavery" elif rand == 5: return 'while escaping from slavery, the character killed their owner' elif rand == 6: return 'while escaping slavery, the character stole ' + giftsTable863() elif rand == 7: return 'the character, owned by a slaverunner, was set free by the owner who is in love with them' elif rand == 8: return 're-roll on table shit, ugh.' elif rand <= 2: #owner decides to free character rand = randint(1,10) if rand == 1: rand = randint(1,8) if rand <= 4: return 'character is freed from slavery by owner, who is a good friend' elif rand <= 7: return "character is freed from slavery by owner, who becomes the character's patron" # table 543 here elif rand <= 8: return "character is freed from slavery by owner, who becomes the character's companion" # table 761 here elif rand <= 2: return 'character is freed from slavery by owner due to religious conversion, character is paid ' + str(randint(2,20)) + ' gold coins in reparations' elif rand <= 4: return 'character is reunired with relatives after being freed from slavery' elif rand <= 5: return 'owner dies and their will specifies that slaves are to be freed' elif rand <= 7: return ' the slave is unable to be used for work and enlists in the military' #go to table 535 elif rand <= 8: return 'the character escapes slavery with the help of another, who becomes their companion' #go to table 863 elif rand <= 9: return "while in slavery, the character saves their owner's life. the owner gives the character their freedom and " + giftsTable863 elif rand <= 10: return '3x re-roll, will set up later' elif rand <= 3: return 'the ruler of the land declares slavery illegal and the player is given ' + str(randint(1,100)) + ' gold as reparations' elif rand <= 4: return 'the character is freed of slavery by saving money and buying their own freedom' elif rand <= 5: return 'owner dies' #there will be a bunch more rolls here elif rand <= 7: return 'character improves their occupational skill rating by one while in slavery' elif rand <= 8: return 'character improves their occupational skill rating by ' + str(randint(2,4)) + ' while in slavery' elif rand <= 9: return 'while in slavery, the character is often beaten by their owner' elif rand <= 10: return 'character learns an additional skill at rank 1 while enslaved' elif rand <= 11: return 'as a slave, the character is a sexual plaything of the owner and has no other duties.' elif rand <= 12: return 'character participates in a slave revolt' #more rolls will go here elif rand <= 13: return 'while enslaved, a character is promoted to a position of authority' elif rand <= 14: return "while enslaved, the character is the owner's favorite and becomes the senior slave. one of the other slaves becomes the character's rival" #roll table 762 here elif rand <= 15: return 'character is used as breeding stock. if male, produces ' + str(randint(1,10)) + ' kids per year. if female, one per year' elif rand <= 16: return 'character is resold ' + str(randint(1,3)) + ' times during their enslavement' elif rand <= 17: return 'character is branded on their ' + bodyLocationTable867 elif rand <= 18: return 'the character attempts to escape from slavery, fails, and is branded on their ' + bodyLocationTable867 + '. they are also beaten more often' elif rand <= 20: return 'an exotic event occurs that causes the character to be freed' #roll on table 544 here