npcs.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #!/usr/bin/env python3
  2. import random
  3. def d(n):
  4. return random.randint(1, n)
  5. STAT_OUTCOMES = [
  6. [4,3,2,2],
  7. [4,3,3,2],
  8. [4,4,3,2],
  9. [5,4,3,2],
  10. [5,5,3,2],
  11. [4,4,4,3],
  12. [5,4,4,3],
  13. [5,5,4,3],
  14. [6,5,4,3],
  15. [6,5,5,4],
  16. ]
  17. STATS = ['Acuity', 'Body', 'Heart', 'Will']
  18. TRAIT_OUTCOMES = [
  19. '2d4',
  20. 'd4',
  21. 'd6',
  22. 'd8',
  23. 'd10',
  24. '2d6',
  25. '2d8',
  26. '2d10',
  27. ]
  28. REL_OUTCOMES = [
  29. '2d4',
  30. '1d4',
  31. '1d6',
  32. '1d8',
  33. '1d10',
  34. '2d6',
  35. '2d8',
  36. '2d10',
  37. '3d6',
  38. '3d8',
  39. ]
  40. FREE_DICE = [
  41. '2d4',
  42. '2d6',
  43. '4d6',
  44. '1d8',
  45. '2d8',
  46. '1d10',
  47. ]
  48. def main():
  49. print('Name ' + '_'*12)
  50. outcomes = random.choice(STAT_OUTCOMES)
  51. random.shuffle(outcomes)
  52. print(end=' ')
  53. for (stat, value) in zip(outcomes, STATS):
  54. print('{0} {1} '.format(stat, value), end='')
  55. print('\nTraits')
  56. for _ in range(4):
  57. print(' - {0}: ________'.format(random.choice(TRAIT_OUTCOMES)))
  58. print('Relationships')
  59. print(' - 1d6: blood')
  60. for _ in range(4):
  61. print(' - {0}: ________'.format(random.choice(REL_OUTCOMES)))
  62. print('Free dice')
  63. for _ in range(3):
  64. print(' - {0}: ________'.format(random.choice(FREE_DICE)))
  65. if __name__ == '__main__':
  66. main()