forked from jrmansel/guardsmen-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RandomGuardsmen.py
387 lines (364 loc) · 10.7 KB
/
RandomGuardsmen.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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
import random as rd
import names as nm
import datetime
#Internal parameters
m2f = 0.5 #Fraction of men in regiment
#Guardsmen object
class Guardsman:
sex = None
name = None
age = None
rank = None
squad = None
personality = None
background = None
skill = []
flaw = []
ambition = None
friends = []
rivals = []
confirmed_kills = 0
awards = []
battles = 0
remarks = []
#Generate basics
def basics(g):
g.sex = 'male' if rd.random() < m2f else 'female'
g.name = nm.get_full_name(gender = g.sex)
g.age = rd.randint(18,28)
g.rank = 'Guardsman'
g.remarks = ['Deployed '+str(datetime.date.today())]
return g
#Generate demeanor
def demeanor(g):
demeanors = [
'Affable',
'Backwater',
'Heroic',
'Spiteful',
'Boisterous',
'Braggart',
'Condescending',
'Cocky',
'Pragmatic',
'Dissenter',
'Dreamer',
'Gambler',
'Naive',
'Incompetent',
'Jaded',
'Joker',
'Loner',
'Loose cannon',
'Loyal',
'Mentor',
'Leech',
'Never bathes',
'Nihilist',
'Numb',
'Awkward',
'Obsessive',
'Old',
'Optimist',
'Pessimist',
'Pious',
'Psychotic',
'Quiet',
'Reckless',
'Sarcastic',
'Sensible',
'Slacker',
'Smooth',
'Steely',
'Strict',
'Superstitious',
'Talkative',
'Thief',
'Edgy',
'Narcissist',
'Old',
'Naive',
'Drunkard'
]
g.personality = rd.choice(demeanors)
if g.personality == 'Old':
g.age = rd.randint(29,65)
g.personality = rd.choice(demeanors)
elif g.personality == 'Naive':
g.age = rd.randint(16,18)
g.personality = rd.choice([rd.choice(demeanors), 'Naive'])
g.rank = 'Cadet'
return g
#Generate background
def gen_background(g, caste = 'low'):
#These shouldn't be homeworld's per-se, but roles in society
#that would exist on any world
low_born_backgrounds = [
'Ganger',
'Scavenger',
'Hiver',
'Voidborn',
'Administratum menial',
'Outcast',
'Forge worker',
'Agri worker',
'Planetary defence',
'Slave'
]
high_born_backgrounds = [
'Child of the creed',
'Savant',
'Vaunted wealth',
'Disgraced',
'Merchant house',
'Dilettante',
'Arbiter',
'Militarum',
'Bastard child'
]
if caste == 'low':
bg = rd.choice(low_born_backgrounds)
else:
bg = rd.choice(high_born_backgrounds)
g.background = bg
#Token skills, flaws, and personalities
token_skill_chance = 0.25
token_flaw_chance = 0.25
token_personality_chance = 0.25
if bg == 'Ganger':
token_skills = ['Street fighter','Lightning reflexes','Quick draw']
token_flaws = ['Old wound','Addict','Poor discipline']
token_personality = ['Thief','Dissenter','Gambler','Loyal']
elif bg == 'Scavenger':
token_skills = ['Survivalist','Handyman','Tough as nails']
token_flaws = ['Tainted','Poor health','Illiterate']
token_personality = ['Loner','Spiteful','Backwater']
elif bg == 'Hiver':
token_skills = ['Unremarkable','Technical knock','Cautious']
token_flaws = ['Hive bound','Weak','Ignorant']
token_personality = ['Dreamer','Affable','Talkative','Joker','Sarcastic']
elif bg == 'Voidborn':
token_skills = ['Lucky','Strong willed','Technical knock']
token_flaws = ['Fragile','Tainted','Ship bound','Mistrusted']
token_personality = ['Superstitious','Awkward','Steely']
# elif bg == 'Ministorum servant':
# token_skills = ['Zealous','Unshakeable faith','Brave']
# token_flaws = ['Ignorant','Oblivious','Short temper']
# token_personality = ['Pious','Strict','Loose cannon']
elif bg == 'Administratum menial':
token_skills = ['Bookworm','Patient','Foresight']
token_flaws = ['Bad eyesight','Bad back','Slow','Ugly']
token_personality = ['Strict','Quiet','Awkward']
elif bg == 'Outcast':
token_skills = ['Silent move','Hardy','Survivalist','Quick draw']
token_flaws = ['Tainted','Old wound','Mistrusted','Deranged']
token_personality = ['Loner','Edgy','Psychotic','Jaded','Thief']
elif bg == 'Forge worker':
token_skills = ['Technical knock','Bionic arm','Bionic eye','Bionic leg','Tinkerer','Tireless']
token_flaws = ['Hive bound','Ignorant','Flat footed']
token_personality = ['Obsessive','Steely','Awkward']
elif bg == 'Agri worker':
token_skills = ['Tireless','Good sense of direction','Trustworthy']
token_flaws = ['Oblivious','Ignorant','Illiterate']
token_personality = ['Naive','Dreamer','Sensible']
elif bg == 'Planetary defence':
token_skills = ['Rapid reload','Crack shot','Combat master','Nerves of steel']
token_flaws = ['Poor initiative','Flashbacks']
token_personality = ['Loyal','Mentor','Strict','Cocky']
if g.rank is not 'Cadet' and rd.random() < 0.5:
g.rank = 'Corporal'
# elif bg == 'Enforcer':
# token_skills = ['Observant','Unarmed warrior']
# token_flaws = ['']
# token_personality = ['Steely','Strict','']
elif bg == 'Slave':
token_skills = ['Unremarkable','Tireless','Hardy']
token_flaws = ['Illiterate','Unlucky','Mistrusted']
token_personality = ['Dreamer','Thief','Spiteful']
#Highborn backgrounds
elif bg == 'Child of the creed':
token_skills = ['Zealous','Unshakeable faith','Brave']
token_flaws = ['Ignorant','Oblivious','Short temper']
token_personality = ['Pious','Strict','Loose cannon']
elif bg == 'Savant':
token_skills = ['Bookworm','Foresight','Lateral thinker']
token_flaws = ['Hesistant','Pacifist','Absent minded','Gullible']
token_personality = ['Sensible','Curious','Quiet','Awkward']
elif bg == 'Vaunted wealth':
token_skills = ['Duelist','Good looking','Unshakeable pride']
token_flaws = ['Coward','Addict','Tainted','Fragile','Weak','Gluttonous']
token_personality = ['Slacker','Condescending','Narcissist','Smooth','Naive','Incompetent']
elif bg == 'Disgraced':
token_skills = ['Cautious','Die hard','Lightning reflexes']
token_flaws = ['Unlucky','Flashbacks','Unbearable guilt']
token_personality = ['Spiteful','Loner','Jaded']
elif bg == 'Merchant house':
token_skills = ['Sound judgement','Foresight','Cautious']
token_flaws = ['Pacifist','Dishonest','Gluttonous']
token_personality = ['Affable','Gambler','Optimist']
elif bg == 'Dilettante':
token_skills = ['Musician','Lateral thinker','Observant']
token_flaws = ['Poor discipline','Careless','Clumsy','Smart-ass']
token_personality = ['Smooth','Cocky','Naive','Slacker','Dissenter','Reckless']
elif bg == 'Arbiter':
token_skills = ['Observant','Sound judgement','Trustworthy']
token_flaws = ['Poor initiative','Slow','Cruel']
token_personality = ['Strict','Sensible','Steely']
elif bg == 'Militarum':
token_skills = ['Zealous','Tactical genius','Born leader','Unshakeable pride']
token_flaws = ['Overconfident','Short temper','Self-righteous']
token_personality = ['Loyal','Strict','Heroic','Mentor']
elif bg == 'Bastard child':
token_skills = ['Lucky','Brave','Unremarkable','Good looking']
token_flaws = ['Mistrusted','Unlucky','Oblivious','Ignorant']
token_personality = ['Backwater','Loyal','Loose cannon','Mentor','Loner','Dreamer']
if rd.random() < token_skill_chance:
g.skill.append(rd.choice(token_skills))
if rd.random() < token_flaw_chance:
g.flaw.append(rd.choice(token_flaws))
if rd.random() < token_personality_chance:
g.personality = rd.choice(token_personality)
return g
#Generate ambition
def ambition(g):
ambitions = [
'marry a distant paramour',
'start a business',
'get promoted',
'travel the galaxy',
'earn the respect of their comrades',
'earn the respect of their superiors',
'make a difference',
'bring honor to their family',
'make it home',
'start a family',
'become rich',
'become famous',
'acquire knowledge',
'meet someone famous',
'learn to fly',
'redeem themselves',
'transfer to a different regiment',
'protect a friend',
'get laid',
'write a book',
'own their own house',
'set a record',
'serve up a cold plate of vengeance',
'kill heretics',
'kill xenos',
'impress the commissar',
'sleep in',
'set foot on Terra',
'eat like a king',
'be remembered',
'die for the Emperor',
'get back to the good old days',
'desert at the first opportunity'
]
if rd.random() < 0.1:
g.ambition = 'survive'
else:
g.ambition = rd.choice(ambitions)
return g
#Generate flaws and boons
def traits(g):
nflaws = rd.randint(0,2)
nskills = rd.randint(0,2)
if g.personality == 'Incompetent':
nflaws = nflaws + 1
elif g.personality == 'Heroic':
nskills = nskills + 1
skills = [
'Nerves of steel',
'Tinkerer',
'Lucky',
'Cook',
'Crack shot',
'Combat master',
'Street fighter',
'Lateral thinker',
'Lightning reflexes',
'Rapid reload',
'Bulging biceps',
'Heightened senses',
'Tough as nails',
'Unshakeable faith',
'Foresight',
'Ambidextrous',
'Duelist',
'Tireless',
'Bookworm',
'Observant',
'Handyman',
'Bionic arm',
'Bionic leg',
'Bionic eye',
'Quick draw',
'Hardy',
'Born leader',
'Unarmed warrior',
'Unremarkable',
'Silent move',
'Good sense of direction',
'Sound judgement',
'Survivalist',
'Athlete',
'Good looking',
'Unshakeable pride',
'Patient',
'Musician',
'Awesome scar',
'Trustworthy',
'Hard target',
'Die hard',
'Cautious',
'Zealous',
'Mustache',
'Beard',
'Bald',
'Brave'
]
flaws = [
'Clumsy',
'Unlucky',
'Fragile',
'Hesitant',
'Careless',
'Pacifist',
'Death-wish',
'Coward',
'Paranoid',
'Addict',
'Slow',
'Gullible',
'Oblivious',
'Poor discipline',
'Bad back',
'Allergies',
'Ugly',
'Poor health',
'Weak',
'Overweight',
'Unbearable guilt',
'Tainted',
'Poor aim',
'Insomniac',
'Old wound',
'Bad eyesight',
'Dyslexic',
'Short temper',
'Asthma',
'Absent minded',
'Flat footed',
'Cruel',
'Dishonest',
'Ignorant',
'Twitchy',
'Impulsive',
]
for s in range(0,nskills):
g.skill.append(rd.choice(skills))
for s in range(0,nflaws):
g.flaw.append(rd.choice(flaws))
return g