-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvillain.ts
329 lines (319 loc) · 7.46 KB
/
villain.ts
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
// tslint:disable:no-console
export class Villain {
public name: string = "Villain";
constructor(public form: string, public scheme: string, public method: string, public weakness: string) {}
public format(): string {
return "**" + this.name + "** - *" + this.form + "*\n" +
"*Scheme:* " + this.scheme + "\n" +
"*Method:* " + this.method + "\n" +
"*Weakness:* " + this.weakness;
}
public print(): void {
console.log(this.format());
}
}
export class VillainGenerator {
private static forms: string[] = [
"Beast or monstrosity with no particular agenda",
"Aberration bent on corruption or domination",
"Fiend bent on corruption or destruction",
"Dragon bent on domination and plunder",
"Giant bent on plunder",
"Undead with any agenda",
"Undead with any agenda",
"Fey with a mysterious goal",
"Humanoid cultist",
"Humanoid cultist",
"Humanoid conqueror",
"Humanoid conqueror",
"Humanoid seeking revenge",
"Humanoid schemer seeking to rule",
"Humanoid schemer seeking to rule",
"Humanoid criminal mastermind",
"Humanoid raider or ravager",
"Humanoid raider or ravager",
"Humanoid under a curse",
"Misguided humanoid zealot",
];
private static schemes: Array<any> = [
{
how: [
"Acquire a legendary item to prolong life",
"Ascend to godhood",
"Become undead or obtain a younger body",
"Steal a planar creature's essence",
],
scheme: "Immortality",
},
{
how: [
"Seize a position of power or title",
"Win a contest or tournament",
"Win favor with a powerful individual",
"Place a pawn in a position of power",
],
scheme: "Influence",
},
{
how: [
"Obtain an ancient artifact",
"Build a construct or magical device",
"Carry out a deity's wishes",
"Offer sacrifices to a deity",
"Contact a lost deity or power",
"Open a gate to another world",
],
scheme: "Magic",
},
{
how: [
"Fulfill an apoca lyptic prophecy",
"Enact the vengeful will of a god or patron",
"Spread a vile contagion",
"Overthrow a government",
"Trigger a natural disaster",
"Utterly destroy a bloodline or clan",
],
scheme: "Mayhem",
},
{
how: [
"Prolong the life of a loved one",
"Prove worthy of another person's love",
"Raise or restore a dead loved one",
"Destroy rivals for another person's affection",
],
scheme: "Passion",
},
{
how: [
"Conquer a region or incite a rebellion",
"Seize control of an army",
"Become the power behind the throne",
"Gain the favor of a ruler",
],
scheme: "Power",
},
{
how: [
"Avenge a past humiliation or insult",
"Avenge a past imprisonment or injury",
"Avenge the death of a loved one",
"Retrieve stolen property and punish the thief",
],
scheme: "Revenge",
},
{
how: [
"Control natural resources or trade",
"Marry into wealth",
"Plunder ancient ruins",
"Steal land, goods, or money",
],
scheme: "Wealth",
},
];
private static methods: Array<any> = [
{
how: [
"Blight",
"Crop failure",
"Drought",
"Famine",
],
method: "Agricultural Devastation",
},
{
method: "Assault or Beatings",
},
{
method: "Bounty Hunting or Assassination",
},
{
how: [
"Bribery",
"Enticement",
"Eviction",
"Imprisonment",
"Kidnapping",
"Legal intimidation",
"Press gangs",
"Shackling",
"Slavery",
"Threats or harassment",
],
method: "Captivity or Coercion",
},
{
how: [
"Breach of contract",
"Cheating",
"Fast talking",
"Fine print",
"Fraud or swindling",
"Quackery or tricks",
],
method: "Confidence Scams",
},
{
how: [
"Conquer a region or incite a rebellion",
"Seize control of an army",
"Become the power behind the throne",
"Gain the favour of a ruler",
],
method: "Defamation",
},
{
method: "Dueling",
},
{
how: [
"Beheading",
"Burning at the stake",
"Burying alive",
"Crucifixion",
"Drawing and Quartering",
"Hanging",
"Impalement",
"Sacrifice (living)",
],
method: "Execution",
},
{
method: "Impersonation or disguise",
},
{
method: "Lying or perjury",
},
{
how: [
"Hauntings",
"Illusions",
"Infernal bargains",
"Mind control",
"Petrification",
"Raising or animating the dead",
"Summoning monsters",
"Weather control",
],
method: "Magical Mayhem",
},
{
how: [
"Assassination",
"Cannibalism",
"Dismemberment",
"Drowning",
"Electrocution",
"Euthanasia (involuntary)",
"Disease",
"Poisoning",
"Stabbing",
"Strangulation or suffocation",
],
method: "Murder",
},
{
method: "Neglect",
},
{
how: [
"Betrayal or treason",
"Conspiracy",
"Espionage or spying",
"Genocide",
"Oppression",
"Raising taxes",
],
method: "Politics",
},
{
how: [
"Curses",
"Desecration",
"False gods",
"Heresy or cults",
],
method: "Religion",
},
{
method: "Stalking",
},
{
how: [
"Arson",
"Blackmail or extortion",
"Burglary",
"Counterfeiting",
"Highway robbery",
"Looting",
"Mugging",
"Poaching",
"Seizing property",
"Smuggling",
],
method: "Theft or Property Crime",
},
{
how: [
"Acid",
"Blinding",
"Branding",
"Racking",
"Thumbscrews",
"Whipping",
],
method: "Torture",
},
{
how: [
"Adultery",
"Drugs or alcohol",
"Gambling",
"Seduction",
],
method: "Vice",
},
{
how: [
"Ambush",
"Invasion",
"Massacre",
"Mercenaries",
"Rebellion",
"Terrorism",
],
method: "Warfare",
},
];
private static weaknesses: string[] = [
"A hidden object holds the villain's soul.",
"The villain's power is broken if the death of its true love is avenged",
"The villain is weakened in the presence of a particular artifact",
"A special weapon deals extra damage when used against the villain",
"The villain is destroyed if it speaks its true name",
"An ancient prophecy or riddle reveals how the villain can be overthrown",
"The villain falls when an ancient enemy forgives its past actions",
"The villain loses its power if a mystic bargain it struck long ago is completed.",
];
public static generate() {
let schemeObj: any = VillainGenerator.schemes[Math.floor(Math.random() * VillainGenerator.schemes.length)];
let scheme = "";
if (schemeObj.how) {
scheme = schemeObj.scheme + " - " + schemeObj.how[Math.floor(Math.random() * schemeObj.how.length)];
} else {
scheme = schemeObj.scheme;
}
let methodObj = VillainGenerator.methods[Math.floor(Math.random() * VillainGenerator.methods.length)];
let method = "";
if (methodObj.how) {
method = methodObj.method + " - " + methodObj.how[Math.floor(Math.random() * methodObj.how.length)];
} else {
method = methodObj.method;
}
const form: string = VillainGenerator.forms[Math.floor(Math.random() * VillainGenerator.forms.length)];
const weakness: string = VillainGenerator.weaknesses[Math.floor(Math.random() * VillainGenerator.weaknesses.length)];
return new Villain(form, scheme, method, weakness);
}
}