ThenThereWereThings

5eGenerator Standardised

Apr 16th, 2016
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.35 KB | None | 0 0
  1. from random import randint, choice
  2.  
  3.  
  4. class fifthEdCharacterGenerator:
  5. def dice(self):
  6. """This function rolls dice for the second function"""
  7. X = [randint(1, 6) for n in range(4)]
  8. X.sort
  9. X = X[1:]
  10. return sum(X)
  11.  
  12. def character(self):
  13. """This function actually makes a goddamned character"""
  14. x_arr = [self.dice() for n in range(6)]
  15. x_arr = sorted(x_arr)
  16. char = randint(1, 13)
  17. if char == 1:
  18. char_class = "Bard"
  19. x = randint(1, 4)
  20. if x == 1:
  21. sub_class = "College of Valor"
  22. elif x == 2:
  23. sub_class = "College of Lore"
  24. elif x == 3:
  25. sub_class = "College of Swords"
  26. else:
  27. sub_class = "College of Satire"
  28. Cha = x_arr[5]
  29. Dex = x_arr[4]
  30. Con = x_arr[3]
  31. Wis = x_arr[2]
  32. Int = x_arr[1]
  33. Str = x_arr[0]
  34. elif char == 2:
  35. char_class = "Barbarian"
  36. x = randint(1, 3)
  37. if x == 1:
  38. sub_class = "Berserker"
  39. elif x == 2:
  40. sub_class = "Totem Barbarian"
  41. else:
  42. sub_class = "Battlerager"
  43. Str = x_arr[5]
  44. Con = x_arr[4]
  45. Dex = x_arr[3]
  46. Wis = x_arr[2]
  47. Cha = x_arr[1]
  48. Int = x_arr[0]
  49. elif char == 3:
  50. char_class = "Cleric"
  51. x = randint(1, 8)
  52. if x == 1:
  53. sub_class = "Life Domain"
  54. elif x == 2:
  55. sub_class = "Knowledge Domain"
  56. elif x == 3:
  57. sub_class = "Light Domain"
  58. elif x == 4:
  59. sub_class = "Nature Domain"
  60. elif x == 5:
  61. sub_class = "Tempest Domain"
  62. elif x == 6:
  63. sub_class = "Trickery Domain"
  64. elif x == 7:
  65. sub_class = "War Domain"
  66. else:
  67. sub_class = "Arcane Domain"
  68. Wis = x_arr[5]
  69. Con = x_arr[4]
  70. Str = x_arr[3]
  71. Cha = x_arr[2]
  72. Int = x_arr[1]
  73. Dex = x_arr[0]
  74. elif char == 4:
  75. char_class = "Druid"
  76. x = randint(1, 2)
  77. if x == 1:
  78. sub_class = "Circle of the Land"
  79. else:
  80. sub_class = "Circle of the Moon"
  81. Wis = x_arr[5]
  82. Con = x_arr[4]
  83. Int = x_arr[3]
  84. Cha = x_arr[2]
  85. Str = x_arr[1]
  86. Dex = x_arr[0]
  87. elif char == 5:
  88. char_class = "Fighter"
  89. Str = x_arr[5]
  90. Con = x_arr[4]
  91. x = randint(1, 2)
  92. if x == 1:
  93. x = randint(1, 5)
  94. if x == 1:
  95. sub_class = "Champion"
  96. elif x == 2:
  97. sub_class = "Battlemaster"
  98. elif x == 3:
  99. sub_class = "Cavalier"
  100. elif x == 4:
  101. sub_class = "Scout"
  102. else:
  103. sub_class = "Monster Hunter"
  104. Dex = x_arr[3]
  105. Wis = x_arr[2]
  106. Int = x_arr[1]
  107. else:
  108. x = randint(1, 6)
  109. if x == 1:
  110. sub_class = "Champion"
  111. elif x == 2:
  112. sub_class = "Battlemaster"
  113. elif x == 3:
  114. sub_class = "Cavalier"
  115. elif x == 4:
  116. sub_class = "Scout"
  117. elif x == 4:
  118. sub_class = "Eldritch Knight"
  119. else:
  120. sub_class = "Monster Hunter"
  121. Int = x_arr[4]
  122. Dex = x_arr[3]
  123. Wis = x_arr[2]
  124. Cha = x_arr[0]
  125. elif char == 6:
  126. char_class = "Monk"
  127. x = randint(1, 5)
  128. if x == 1:
  129. sub_class = "Way of the Open Palm"
  130. elif x == 2:
  131. sub_class = "Way of the Shadow"
  132. elif x == 3:
  133. sub_class = "Way of the Four Elements"
  134. elif x == 4:
  135. sub_class = "Way of the Long Death"
  136. else:
  137. sub_class = "Way of the Sun Soul"
  138. Dex = x_arr[5]
  139. Con = x_arr[4]
  140. Wis = x_arr[3]
  141. Str = x_arr[2]
  142. Cha = x_arr[1]
  143. Int = x_arr[0]
  144. elif char == 7:
  145. char_class = "Paladin"
  146. x = randint(1, 4)
  147. if x == 1:
  148. sub_class = "Oath of Devotion"
  149. elif x == 2:
  150. sub_class = "Oath of the Ancients"
  151. elif x == 3:
  152. sub_class = "Oath of Vengeance"
  153. else:
  154. sub_class = "Oath of the Crown"
  155. Str = x_arr[5]
  156. Cha = x_arr[4]
  157. Con = x_arr[3]
  158. Wis = x_arr[2]
  159. Int = x_arr[1]
  160. Dex = x_arr[0]
  161. elif char == 8:
  162. x = randint(1, 2)
  163. if x == 1:
  164. char_class = "Ranger (Base)"
  165. x = randint(1, 3)
  166. if x == 1:
  167. sub_class = "Hunter"
  168. elif x == 2:
  169. sub_class = "Beastmaster"
  170. else:
  171. sub_class = "Deep Stalker"
  172. else:
  173. char_class = "Ranger (Variant)"
  174. x = randint(1, 3)
  175. if x == 1:
  176. sub_class = "Guardian"
  177. elif x == 2:
  178. sub_class = "Seeker"
  179. else:
  180. sub_class = "Stalker"
  181. Dex = x_arr[5]
  182. Wis = x_arr[4]
  183. Con = x_arr[3]
  184. Str = x_arr[2]
  185. Cha = x_arr[1]
  186. Int = x_arr[0]
  187. elif char == 9:
  188. char_class = "Rogue"
  189. Dex = x_arr[5]
  190. x = randint(1, 2)
  191. if x == 1:
  192. x = randint(1, 4)
  193. if x == 1:
  194. sub_class = "Thief"
  195. elif x == 2:
  196. sub_class = "Assassin"
  197. elif x == 3:
  198. sub_class = "Mastermind"
  199. else:
  200. sub_class = "Swashbuckler"
  201. Cha = x_arr[4]
  202. Con = x_arr[3]
  203. Int = x_arr[2]
  204. else:
  205. x = randint(1, 4)
  206. if x == 1:
  207. sub_class = "Thief"
  208. elif x == 2:
  209. sub_class = "Assassin"
  210. elif x == 3:
  211. sub_class = "Mastermind"
  212. else:
  213. sub_class = "Arcane Trickster"
  214. Int = x_arr[4]
  215. Cha = x_arr[3]
  216. Con = x_arr[2]
  217. Wis = x_arr[1]
  218. Str = x_arr[0]
  219. elif char == 10:
  220. char_class = "Sorcerer"
  221. x = randint(1, 5)
  222. if x == 1:
  223. sub_class = "Dragon Ancestry"
  224. sub_select = randint(1, 10)
  225. if sub_select == 1:
  226. sub_class = "Dragon Ancestry (Black)"
  227. elif sub_select == 2:
  228. sub_class = "Dragon Ancestry (Blue)"
  229. elif sub_select == 3:
  230. sub_class = "Dragon Ancestry (Brass)"
  231. elif sub_select == 4:
  232. sub_class = "Dragon Ancestry (Bronze)"
  233. elif sub_select == 5:
  234. sub_class = "Dragon Ancestry (Copper)"
  235. elif sub_select == 6:
  236. sub_class = "Dragon Ancestry (Gold)"
  237. elif sub_select == 7:
  238. sub_class = "Dragon Ancestry (Green)"
  239. elif sub_select == 8:
  240. sub_class = "Dragon Ancestry(Red)"
  241. elif sub_select == 9:
  242. sub_class = "Dragon Ancestry (Silver)"
  243. else:
  244. sub_class = "Dragon Ancestry (White)"
  245. elif x == 2:
  246. sub_class = "Wild Magic"
  247. elif x == 3:
  248. sub_class = "Favoured Soul"
  249. elif x == 4:
  250. sub_class = "Storm Bloodline"
  251. else:
  252. sub_class = "Shadow Bloodline"
  253. Cha = x_arr[5]
  254. Con = x_arr[4]
  255. Dex = x_arr[3]
  256. Wis = x_arr[2]
  257. Int = x_arr[1]
  258. Str = x_arr[0]
  259. elif char == 11:
  260. char_class = "Warlock"
  261. x = randint(1, 3)
  262. if x == 1:
  263. pact = "Blade"
  264. elif x == 2:
  265. pact = "Book"
  266. else:
  267. pact = "Chain"
  268. x = randint(1, 5)
  269. if x == 1:
  270. sub_class = "Fiend, with the Pact of the " + pact
  271. elif x == 2:
  272. sub_class = "Archfey, with the Pact of the " + pact
  273. elif x == 3:
  274. sub_class = "Great Old One, with the Pact of the " + pact
  275. elif x == 4:
  276. sub_class = "Undying, with the Pact of the " + pact
  277. else:
  278. sub_class = "Undying Light, with the Pact of the " + pact
  279. Cha = x_arr[5]
  280. Con = x_arr[4]
  281. Dex = x_arr[3]
  282. Wis = x_arr[2]
  283. Int = x_arr[1]
  284. Str = x_arr[0]
  285. elif char == 12:
  286. char_class = "Wizard"
  287. x = randint(1, 10)
  288. if x == 1:
  289. sub_class = "School of Abjuration"
  290. elif x == 2:
  291. sub_class = "School of Conjuration"
  292. elif x == 3:
  293. sub_class = "School of Divination"
  294. elif x == 4:
  295. sub_class = "School of Enchantment"
  296. elif x == 5:
  297. sub_class = "School of Evocation"
  298. elif x == 6:
  299. sub_class = "School of Illusion"
  300. elif x == 7:
  301. sub_class = "School of Necromancy"
  302. elif x == 8:
  303. sub_class = "School of Transmutation"
  304. elif x == 9:
  305. sub_class = "School of Artificery"
  306. else:
  307. sub_class = "Bladesinger"
  308. Int = x_arr[5]
  309. Con = x_arr[4]
  310. Dex = x_arr[3]
  311. Wis = x_arr[2]
  312. Cha = x_arr[1]
  313. Str = x_arr[0]
  314. else:
  315. char_class = "Mystic"
  316. x = randint(1, 2)
  317. if x == 1:
  318. sub_class = "Order of the Awakened"
  319. else:
  320. sub_class = "Order of the Immortal"
  321. Int = x_arr[5]
  322. Con = x_arr[4]
  323. Dex = x_arr[3]
  324. Wis = x_arr[2]
  325. Cha = x_arr[1]
  326. Str = x_arr[0]
  327.  
  328. gender = choice(["Female", "Male"])
  329.  
  330. race_select = randint(1, 17)
  331. if race_select == 1:
  332. race = "Aasimar" # no fucken Revenant 4u
  333. Cha = Cha + 2
  334. Wis = Wis + 1
  335. elif race_select == 2:
  336. race = "Dragonborn"
  337. Str = Str + 2
  338. Cha = Cha + 1
  339. sub_select = randint(1, 11)
  340. if sub_select == 1:
  341. race = "Dragonborn (Black)"
  342. elif sub_select == 2:
  343. race = "Dragonborn (Blue)"
  344. elif sub_select == 3:
  345. race = "Dragonborn (Brass)"
  346. elif sub_select == 4:
  347. race = "Dragonborn (Bronze)"
  348. elif sub_select == 5:
  349. race = "Dragonborn (Copper)"
  350. elif sub_select == 6:
  351. race = "Dragonborn (Gold)"
  352. elif sub_select == 7:
  353. race = "Dragonborn (Green)"
  354. elif sub_select == 8:
  355. race = "Dragonborn (Red)"
  356. elif sub_select == 9:
  357. race = "Dragonborn (Silver)"
  358. elif sub_select == 10:
  359. race = "Dragonborn (White)"
  360. else:
  361. race = "Dragonborn (Revenant)"
  362. Con = Con + 1
  363. Str = Str - 1
  364. elif race_select == 3:
  365. Con = Con + 2
  366. sub_select = randint(1, 4)
  367. if sub_select == 1:
  368. race = "Dwarf (Hill)"
  369. Wis = Wis + 1
  370. elif sub_select == 2:
  371. race = "Dwarf (Mountain)"
  372. Str = Str + 2
  373. elif sub_select == 3:
  374. race = "Dwarf (Duergar)"
  375. Str = Str + 1
  376. else:
  377. race = "Dwarf (Revenant)"
  378. Con = Con + 1
  379. elif race_select == 4:
  380. Dex = Dex + 2
  381. sub_select = randint(1, 5)
  382. if sub_select == 1:
  383. race = "Elf (High)"
  384. Int = Int + 1
  385. elif sub_select == 2:
  386. race = "Elf (Wood)"
  387. Wis = Wis + 1
  388. elif sub_select == 3:
  389. race = "Elf (Drow)"
  390. Cha = Cha + 1
  391. elif sub_select == 4:
  392. race = "Elf (Eladrin)"
  393. Int = Int + 1
  394. else:
  395. race = "Elf (Revenant)"
  396. Con = Con + 1
  397. elif race_select == 5:
  398. Int = Int + 2
  399. sub_select = randint(1, 4)
  400. if sub_select == 1:
  401. race = "Gnome (Forest)"
  402. Dex = Dex + 1
  403. elif sub_select == 2:
  404. race = "Gnome (Rock)"
  405. Con = Con + 1
  406. elif sub_select == 3:
  407. race = "Gnome (Revenant)"
  408. Con = Con + 1
  409. else:
  410. race = "Gnome (Deep)"
  411. Dex = Dex + 1
  412. elif race_select == 6:
  413. Cha = Cha + 2
  414. sub_select = randint(1, 5)
  415. if sub_select == 1:
  416. race = "Half-Elf (High)"
  417. elif sub_select == 2:
  418. race = "Half-Elf (Wood)"
  419. elif sub_select == 3:
  420. race = "Half-Elf (Drow)"
  421. elif sub_select == 4:
  422. race = "Half-Elf (Aquatic)"
  423. else:
  424. race = "Half-Elf (Revenant)"
  425. Con = Con + 1
  426. elif race_select == 7:
  427. race = "Half-Orc" # no fucken Revenant 4u
  428. Con = Con + 1
  429. Str = Str + 2
  430. elif race_select == 8:
  431. Dex = Dex + 2
  432. sub_select = randint(1, 4)
  433. if sub_select == 1:
  434. race = "Halfling (Lightfoot)"
  435. Cha = Cha + 1
  436. elif sub_select == 2:
  437. race = "Halfling (Stout)"
  438. Con = Con + 1
  439. elif sub_select == 3:
  440. race = "Halfling (Ghostwise)"
  441. Wis = Wis + 1
  442. else:
  443. race = "Halfling (Revenant)"
  444. Con = Con + 1
  445. elif race_select == 9:
  446. race = "Human"
  447. sub_select = randint(1, 3)
  448. if sub_select == 1:
  449. race = "Human (Standard)"
  450. Str = Str + 1
  451. Dex = Dex + 1
  452. Con = Con + 1
  453. Int = Int + 1
  454. Wis = Wis + 1
  455. Cha = Cha + 1
  456. elif sub_select == 2:
  457. race = "Human (Variant)"
  458. if char == 1:
  459. Cha = Cha + 1
  460. Dex = Dex + 1
  461. elif char == 2:
  462. Str = Str + 1
  463. Con = Con + 1
  464. elif char == 3:
  465. Wis = Wis + 1
  466. Con = Con + 1
  467. elif char == 4:
  468. Wis = Wis + 1
  469. Con = Con + 1
  470. elif char == 5:
  471. Str = Str + 1
  472. Con = Con + 1
  473. elif char == 6:
  474. Dex = Dex + 1
  475. Con = Con + 1
  476. elif char == 7:
  477. Str = Str + 1
  478. Cha = Cha + 1
  479. elif char == 8:
  480. Dex = Dex + 1
  481. Wis = Wis + 1
  482. elif char == 9:
  483. Dex = Dex + 1
  484. if x == 1:
  485. Cha = Cha + 1
  486. else:
  487. Int = Int + 1
  488. elif char == 10:
  489. Cha = Cha + 1
  490. Con = Con + 1
  491. elif char == 11:
  492. Cha = Cha + 1
  493. Con = Con + 1
  494. else:
  495. Int = Int + 1
  496. Con = Con + 1
  497. else:
  498. race = "Human (Revenant)"
  499. Con = Con + 1
  500. if char == 1:
  501. Cha = Cha + 1
  502. Dex = Dex + 1
  503. elif char == 2:
  504. Str = Str + 1
  505. Con = Con + 1
  506. elif char == 3:
  507. Wis = Wis + 1
  508. Con = Con + 1
  509. elif char == 4:
  510. Wis = Wis + 1
  511. Con = Con + 1
  512. elif char == 5:
  513. Str = Str + 1
  514. Con = Con + 1
  515. elif char == 6:
  516. Dex = Dex + 1
  517. Con = Con + 1
  518. elif char == 7:
  519. Str = Str + 1
  520. Cha = Cha + 1
  521. elif char == 8:
  522. Dex = Dex + 1
  523. Wis = Wis + 1
  524. elif char == 9:
  525. Dex = Dex + 1
  526. if x == 1:
  527. Cha = Cha + 1
  528. else:
  529. Int = Int + 1
  530. elif char == 10:
  531. Cha = Cha + 1
  532. Con = Con + 1
  533. elif char == 11:
  534. Cha = Cha + 1
  535. Con = Con + 1
  536. else:
  537. Int = Int + 1
  538. Con = Con + 1
  539. elif race_select == 10:
  540. race = "Tiefling"
  541. if Dex > Cha:
  542. Dex = Dex + 2
  543. else:
  544. Cha = Cha + 2
  545. sub_select = randint(1, 3)
  546. if sub_select == 1:
  547. race = "Tiefling (Infernal)"
  548. Int = Int + 1
  549. elif sub_select == 2:
  550. race = "Tiefling (Abyssal)"
  551. Con = Con + 1
  552. else:
  553. race = "Tiefling (Revenant)"
  554. Con = Con + 1
  555. elif race_select == 11:
  556. race = "Changeling" # no fucken Revenant 4u
  557. Dex = Dex + 1
  558. Cha = Cha + 1
  559. elif race_select == 12:
  560. race = "Shifter"
  561. Dex = Dex + 1
  562. sub_select = randint(1, 7)
  563. if sub_select == 1:
  564. race = "Shifter (Beasthide)"
  565. Con = Con + 1
  566. elif sub_select == 2:
  567. race = "Shifter (Cliffwalk)"
  568. Dex = Dex + 1
  569. elif sub_select == 3:
  570. race = "Shifter (Longstride)"
  571. Dex = Dex + 1
  572. elif sub_select == 4:
  573. race = "Shifter (Longtooth)"
  574. Str = Str + 1
  575. elif sub_select == 5:
  576. race = "Shifter (Razorclaw)"
  577. Dex = Dex + 1
  578. elif sub_select == 6:
  579. race = "Shifter (Wildhunt)"
  580. Wis = Wis + 1
  581. else:
  582. race = "Shifter (Revenant)"
  583. Con = Con + 1
  584. elif race_select == 13:
  585. race = "Warforged" # no fucken Revenant 4u
  586. Str = Str + 1
  587. Con = Con + 1
  588. elif race_select == 14:
  589. race = "Genasi"
  590. Con = Con + 2
  591. sub_select = randint(1, 5)
  592. if sub_select == 1:
  593. race = "Genasi (Air)"
  594. Dex = Dex + 1
  595. elif sub_select == 2:
  596. race = "Genasi (Earth)"
  597. Str = Str + 1
  598. elif sub_select == 3:
  599. race = "Genasi (Fire)"
  600. Int = Int + 1
  601. elif sub_select == 4:
  602. race = "Genasi (Water)"
  603. Wis = Wis + 1
  604. else:
  605. race = "Genasi (Revenant)"
  606. Con = Con + 1
  607. elif race_select == 15: # no fucken Revenant 4u
  608. race = "Goliath"
  609. Str = Str + 2
  610. Con = Con + 1
  611. elif race_select == 16:
  612. race = "Aarakocra" # no fucken Revenant 4u
  613. Dex + Dex + 2
  614. Wis = Wis + 1
  615. else:
  616. race = "Minotaur" # no fucken Revenant 4u
  617. Str = Str + 1
  618. if 2*Str > Int + Wis:
  619. Str = Str + 1
  620. elif 2*Int > Str + Wis:
  621. Int = Int + 1
  622. else:
  623. Wis = Wis + 1
  624.  
  625. result = ["Your gender is ", gender,
  626. "\nYour race is ", race,
  627. "\nYour class is ", char_class,
  628. "\nYour sub-class is ", sub_class,
  629. "\nYour STR is ", Str,
  630. "\nYour DEX is ", Dex,
  631. "\nYour CON is ", Con,
  632. "\nYour INT is ", Int,
  633. "\nYour WIS is ", Wis,
  634. "\nYour CHA is ", Cha]
  635.  
  636. return ''.join(str(n) for n in result)
  637.  
  638. gen = fifthEdCharacterGenerator()
  639. print(gen.character())
Advertisement
Add Comment
Please, Sign In to add comment