-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeathbringer.py
234 lines (213 loc) · 9.21 KB
/
deathbringer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
#################################
# Deathbringer.py 1.1 #
# By Chris Stoddard, March 2023 #
# Based on the Deathbringer RPG #
# by Professor Dungeon Master #
# This code is licensed under #
# the Creative Commons #
# Attribution-NonCommercial #
# 4.0 License. #
#################################
#################################
# Import needed libraries
import random
#################################
# Define functions
def Spend_Points():
global Build_Points
Spent_Points = input ("? ")
if Build_Points == 0:
Spent_Points = "0"
if int(Spent_Points) > 6:
Spent_Points = "6"
if int(Spent_Points) < 0:
Spent_Points = "0"
if int(Spent_Points) > Build_Points:
Spent_Points = str(Build_Points)
Build_Points = (Build_Points - int(Spent_Points))
print ("You Have " + str(Build_Points) + " build points to spend.")
return (Spent_Points)
#################################
# Print Legal Statement.
print ('------------------------------------------------------------')
print ('Legal Statement: This Deathbringer Character Generator is an')
print ('independent product and is not affiliated with Dan')
print ('"Professor Dungeon Master" Masters. Deathbringer RPG © 2023')
print ('by Dan "Professor Dungeon Master" Masters.')
print ('------------------------------------------------------------')
#################################
# Assign ability scores
print ('\n')
print ("You have 8 build points to distribute between your 6 ability scores.")
print ("Strength, Dexerity, Constitution, Intellegence, Wisdom and Charisma.")
print ("No single ability score can exceed +6")
print ('\n')
Build_Points = 8
print ("You Have " + str(Build_Points) + " build points to spend.")
counter = range(6)
for count in counter:
if count == 0:
print ("How many build points do you want to assign to Strength:")
Strength = Spend_Points()
if count == 1:
print ("How many build points do you want to assign to Dexterity:")
Dexterity = Spend_Points()
if count == 2:
print ("How many build points do you want to assign to Constitution:")
Constitution = Spend_Points()
if count == 3:
print ("How many build points do you want to assign to Intellegence:")
Intellegence = Spend_Points()
if count == 4:
print ("How many build points do you want to assign to Wisdom:")
Wisdom = Spend_Points()
if count == 5:
print ("How many build points do you want to assign to Charisma:")
Charisma = Spend_Points()
#################################
# Print Ability scores to screen
print ('\n')
print ("STR: " + "+" + str(Strength))
print ("DEX: " + "+" + str(Dexterity))
print ("CON: " + "+" + str(Constitution))
print ("INT: " + "+" + str(Intellegence))
print ("WIS: " + "+" + str(Wisdom))
print ("CHR: " + "+" + str(Charisma))
#################################
# Class Section
print ('\n')
print ("Choose a Class for your character:")
print (" 1 Deathbringer")
print (" 2 Grimscribe")
print (" 3 Scoundrel")
print (" 4 Witch Hunter")
print (" 5 Plague Doctor")
Choose_Class = input ("? ")
if Choose_Class == "1":
Class = "Deathbringer"
HITPOINTS = random.randint(1, 10)
ClassFeature1 = "Hit Dice: d10. Use any armor or weapons."
ClassFeature2 = "Spend a Deathbringer Die to make one extra attack."
ClassFeature3 = "Second attack at 5th level."
ClassFeature4 = " "
ClassFeature5 = " "
Equipment_List = "waterskin, doublet, shield, 2 weapons"
if Choose_Class == "2":
Class = "Grimscribe"
HITPOINTS = random.randint(1, 6)
ClassFeature1 = "Hit Dice: d6. Cannot wear armor, simple weapons."
ClassFeature2 = "No spell slots. Roll to cast, DC 10."
ClassFeature3 = "On a roll of Natural 1 gain 1 Corruption and roll on the Miscast Table."
ClassFeature4 = "Gains spells by finding scrolls, spell books, or by having a friendly higher-level magic user teach them to you."
ClassFeature5 = "You are a living grimoire, must tattoo all spells on your skin."
Equipment_List = "waterskin, four cantrips, two first-level spells, dagger"
if Choose_Class == "3":
Class = "Scoundrel"
HITPOINTS = random.randint(1, 8)
ClassFeature1 = "Hit Dice: d8. Light armor only, simple weapons."
ClassFeature2 = "Advantage when attempting stealth, climbing, listening, lockpicking, searching, etc."
ClassFeature3 = "+4 to hit and double damage from behind."
ClassFeature4 = " "
ClassFeature5 = " "
Equipment_List = "waterskin, leather jacket, club or dagger, thieves' tools, rope, grappling hook, lucky charm."
if Choose_Class == "4":
Class = "Witch Hunter"
HITPOINTS = random.randint(1, 8)
ClassFeature1 = "Hit Dice: d8. Light armor, martial and simple weapons."
ClassFeature2 = "Cast Detect Evil and Protection from Evil 1x per day"
ClassFeature3 = "Turn Undead at will."
ClassFeature4 = " "
ClassFeature5 = " "
Equipment_List = "waterskin, leather coat, club, crossbow, holy symbol, 6 torches."
if Choose_Class == "5":
Class = "Plague Doctor"
HITPOINTS = random.randint(1, 6)
ClassFeature1 = "Hit Dice: d6. Leather armor only, simple weapons."
ClassFeature2 = "Cure Wounds once per patient per day, Cure Disease & Cure Poison 1x per day."
ClassFeature3 = "Create 1d4 potions a day (1) acid splash (2) sleep (3) poison spray (4) bomb [d10] (5) healing [d6] (6) hallucinations"
ClassFeature4 = " "
ClassFeature5 = " "
Equipment_List = "waterskin, Leather beak mask and coat, meat cleaver, medical kit, very suspicious diploma"
#################################
# Randomly chooses background
Random_Backgrounds = ["Bounty Hunter", "Courtesan", "Duelist", "Executioner", "Farmer", "Grave Robber", "Leech Collector", "Mercenary", "Minor Noble", "Outlaw", "Performer", "Pit Fighter", "Pirate/Sailor", "Priest/nun/monk", "Rat Catcher", "Servant", "Student/Scholar", "Swineherd", "Soldier", "Urchin"]
Background = random.choice(Random_Backgrounds)
#################################
# Randomly chooses misery
Random_Misery = ["Abandoned at birth", "Banished from home", "Betrayed by a loved one", "Cursed by vengeful witch", "Disinherited or disowned", "Escaped bondage or prison", "Fled a scandal", "Framed for a crime", "Killed someone important", "Left for dead", "Locusts ate your crops", "Owe someone money", "Pursued by the law", "Raised in the streets", "Reduced to poverty", "Rejected by society", "Ruined by vice", "Suffering from amnesia", "Survived a massacre", "Town ravaged by plague"]
Misery = random.choice(Random_Misery)
#################################
# Generate Starting gold and rations
Gold = random.randint(1, 6)
Rations = random.randint(1, 4)
#################################
# Prints out the finished character to the screen
print ('\n')
Character_name = input ("What is your characters name? ")
print ('\n')
print ("Deathbringer Character Sheet 1.1")
print ("------------------------------")
print ("Character Name: " + Character_name)
print ("Background: " + Background)
print ("Misery: " + Misery)
print ("Character Class: " + Class)
print ("XP: _____")
print ("Level: _____")
print ("------------------------------")
print ("STR: " + "+" + str(Strength))
print ("DEX: " + "+" + str(Dexterity))
print ("CON: " + "+" + str(Constitution))
print ("INT: " + "+" + str(Intellegence))
print ("WIS: " + "+" + str(Wisdom))
print ("CHR: " + "+" + str(Charisma))
print ('\n')
print ("Hit Points: " + str(HITPOINTS))
print ('\n')
print ("------------------------------")
print (ClassFeature1)
print (ClassFeature2)
print (ClassFeature3)
print (ClassFeature4)
print (ClassFeature5)
print ("------------------------------")
print ("EQUIPMENT:")
print (str(Gold) + " GP")
print (str(Rations) + " days of rations")
print (Equipment_List)
#################################
# Write character to a text file using the character name
YN = input ("Do you want to save this character to a text file, Y or N? ")
if YN == "N" or YN == "n":
exit()
with open(Character_name + '.txt', 'w') as f:
f.write ('\n')
f.write ("Deathbringer Character Sheet 1.1" +'\n')
f.write ("------------------------------" +'\n')
f.write ("Character Name: " + Character_name +'\n')
f.write ("Background: " + Background +'\n')
f.write ("Misery: " + Misery +'\n')
f.write ("Character Class: " + Class +'\n')
f.write ("XP: _____" +'\n')
f.write ("Level: _____" +'\n')
f.write ("------------------------------" +'\n')
f.write ("STR: " + "+" + str(Strength) +'\n')
f.write ("DEX: " + "+" + str(Dexterity) +'\n')
f.write ("CON: " + "+" + str(Constitution) +'\n')
f.write ("INT: " + "+" + str(Intellegence) +'\n')
f.write ("WIS: " + "+" + str(Wisdom) +'\n')
f.write ("CHR: " + "+" + str(Charisma) +'\n')
f.write ('\n')
f.write ("Hit Points: " + str(HITPOINTS) +'\n')
f.write ('\n')
f.write ("------------------------------" +'\n')
f.write (ClassFeature1 +'\n')
f.write (ClassFeature2 +'\n')
f.write (ClassFeature3 +'\n')
f.write (ClassFeature4 +'\n')
f.write (ClassFeature5 +'\n')
f.write ("------------------------------" +'\n')
f.write ("EQUIPMENT:" +'\n')
f.write (str(Gold) + " GP" +'\n')
f.write (str(Rations) + " days of rations" +'\n')
f.write (Equipment_List +'\n')
exit()