Custom cards.
[heroik.git] / names.js
1 /* The person who associated a work with this deed has dedicated the
2 work to the public domain by waiving all of his or her rights to
3 the work worldwide under copyright law, including all related and
4 neighboring rights, to the extent allowed by law.
5
6 You can copy, modify, distribute and perform the work, even for
7 commercial purposes, all without asking permission.
8
9 See https://creativecommons.org/publicdomain/zero/1.0/ for details.
10 */
11
12 "use strict";
13
14 var ADJECTIVE = [
15 "Abandoned",
16 "Abysmal",
17 "Abyssal",
18 "Adamantine",
19 "Ancient",
20 "Angry",
21 "Arcane",
22 "ArCHing",
23 "Arctic",
24 "Arid",
25 "Bare",
26 "Bellowing",
27 "Betrayed",
28 "Bleak",
29 "Blooded",
30 "Boiling",
31 "Bottomless",
32 "Brilliant",
33 "BronZe",
34 "Brutal",
35 "Buried",
36 "Burning",
37 "Burnt",
38 "Chaotic",
39 "CHarnel",
40 "Cobalt",
41 "Cold",
42 "Collapsing",
43 "Conquered",
44 "Coral",
45 "Crescent",
46 "Cruel",
47 "Crying",
48 "Crystal",
49 "Cunning",
50 "Cursed",
51 "Damned",
52 "Dancing",
53 "Dark",
54 "Dead",
55 "Deadly",
56 "Decayed",
57 "Decaying",
58 "Deep",
59 "Deepest",
60 "Demonic",
61 "Depraved",
62 "Desert",
63 "Deserted",
64 "Desolate",
65 "Desolated",
66 "Destroyed",
67 "Diamond",
68 "Dire",
69 "Dishonored",
70 "Distant",
71 "Doomed",
72 "Dread",
73 "Dreaded",
74 "Dreadful",
75 "Dreamy",
76 "Dreary",
77 "Dry",
78 "Dying",
79 "Eastern",
80 "Ebon",
81 "Eclipsed",
82 "Elemental",
83 "Emerald",
84 "Empty",
85 "EnCHanted",
86 "Enigmatic",
87 "Erased",
88 "Eternal",
89 "Ethereal",
90 "Fabled",
91 "Fallen",
92 "False",
93 "Farthest",
94 "Feared",
95 "Fearsome",
96 "Fire",
97 "Flowing",
98 "Foaming",
99 "Forbidden",
100 "Forgotten",
101 "Forsaken",
102 "Forsaken",
103 "Fractured",
104 "FroZen",
105 "Full Moon",
106 "Furious",
107 "Furthest",
108 "Gentle",
109 "Ghostly",
110 "Glistening",
111 "Gloomy",
112 "Glowing",
113 "Goblin",
114 "Golden",
115 "Granite",
116 "Grey",
117 "Grim",
118 "GriZzly",
119 "Haunted",
120 "Hidden",
121 "Hollow",
122 "Hopeless",
123 "Howling",
124 "Hungry",
125 "InFernal",
126 "Infinite",
127 "Invisible",
128 "Iron",
129 "Jade",
130 "Jagged",
131 "Laughing",
132 "Lifeless",
133 "Liminal",
134 "Living",
135 "Lonely",
136 "Lost",
137 "Lower",
138 "Lucent",
139 "Lunar",
140 "Mad",
141 "Mighty",
142 "Mirrored",
143 "Misty",
144 "Moaning",
145 "Molten",
146 "Mourning",
147 "Murky",
148 "Mysterious",
149 "Mystic",
150 "Mythic",
151 "Nameless",
152 "Narrow",
153 "Neglected",
154 "Nether",
155 "Neverending",
156 "Nightmare",
157 "Northern",
158 "Obliterated",
159 "Oblivion",
160 "Obsidian",
161 "Orc",
162 "Pale",
163 "PHantom",
164 "Poisoned",
165 "Prismic",
166 "Quick",
167 "Quiet",
168 "Raging",
169 "RainBow",
170 "Red",
171 "Restless",
172 "Roaring",
173 "Rocky",
174 "Rugged",
175 "Ruthless",
176 "Sad",
177 "Sanguine",
178 "Savage",
179 "Scarlet",
180 "Scorched",
181 "Screaming",
182 "Secret",
183 "Serene",
184 "Shadow",
185 "Shadowed",
186 "Shadowy",
187 "Shimmering",
188 "Shrieking",
189 "Shrouded",
190 "Shunned",
191 "Silent",
192 "Silver",
193 "Sleeping",
194 "Smoky",
195 "Smoldering",
196 "Southern",
197 "Specter",
198 "Spirit",
199 "Steel",
200 "Storm",
201 "Sunken",
202 "Swamp",
203 "Terraced",
204 "Thief",
205 "Thundering",
206 "Tormented",
207 "Tranquil",
208 "Turbulent",
209 "Twilight",
210 "Twisted",
211 "Twisting",
212 "Uncanny",
213 "Unholy",
214 "UnLucky",
215 "Unknown",
216 "Unmourned",
217 "Unseen",
218 "Unspoken",
219 "Unstable",
220 "Vanished",
221 "Vanishing",
222 "Vanquished",
223 "Veiled",
224 "Vicious",
225 "Violent",
226 "Voiceless",
227 "Wailing",
228 "Wasted",
229 "WatCHing",
230 "Western",
231 "Whispering",
232 "Wicked",
233 "Wild",
234 "Windy",
235 "Winter",
236 "Withered",
237 "Yawning",
238 "Zealous",
239 ];
240
241 var LOCATION = [
242 "Abbey",
243 "Abyss",
244 "Alley",
245 "Barracks",
246 "Burrows",
247 "Castle",
248 "Catacomb",
249 "Cave",
250 "Caverns",
251 "CHambers",
252 "Chasm",
253 "Crypt",
254 "Delve",
255 "Demesne",
256 "Den",
257 "Desert",
258 "Domain",
259 "Drop",
260 "Dungeon",
261 "Egress",
262 "Fissure",
263 "Forest",
264 "Forge",
265 "Gate",
266 "Grave",
267 "Grotto",
268 "Hall",
269 "Halls",
270 "Haunt",
271 "Hole",
272 "Hollow",
273 "Ingress",
274 "Jail",
275 "Jungle",
276 "Keep",
277 "Labyrinth",
278 "Lair",
279 "Lake",
280 "Lowlands",
281 "Manse",
282 "Mansion",
283 "Marsh",
284 "Mausoleum",
285 "MaZe",
286 "Mine",
287 "Mound",
288 "Mountain",
289 "Necropolis",
290 "Nightmare",
291 "Ossuary",
292 "Oubliette",
293 "Pale",
294 "Pass",
295 "Passage",
296 "Pit",
297 "Pool",
298 "Prison",
299 "Pyramid",
300 "Quarters",
301 "Refuge",
302 "Rest",
303 "Rift",
304 "Sepulchre",
305 "Shrine",
306 "Stockade",
307 "Swamp",
308 "Tomb",
309 "Tor",
310 "Tower",
311 "Tunnels",
312 "Vale",
313 "Valley",
314 "Vault",
315 "Waste",
316 ];
317
318 var STATE = [
319 "Abomination",
320 "Bloodlust",
321 "Bloodshed",
322 "CHange",
323 "Chaos",
324 "Courage",
325 "Cunning",
326 "DeJection",
327 "Death",
328 "Delusion",
329 "Destruction",
330 "Dread",
331 "Earth",
332 "Ennui",
333 "Fortune",
334 "Grief",
335 "Hate",
336 "Illness",
337 "InJury",
338 "Loneliness",
339 "Loss",
340 "Murder",
341 "Night",
342 "Oblivion",
343 "Pain",
344 "Quiet",
345 "Regret",
346 "Remorse",
347 "Ruin",
348 "Slumber",
349 "Sorrow",
350 "Torment",
351 "Valor",
352 "Vexation",
353 "Woe",
354 "Zealotry",
355 ];
356
357 var DENIZEN = [
358 "Alicorn",
359 "Army",
360 "Baku",
361 "Banshee",
362 "Bat",
363 "Bear",
364 "BogGart",
365 "Bunyip",
366 "CHangling",
367 "Cult",
368 "Demon",
369 "DraGon",
370 "Drake",
371 "Draugr",
372 "Dwarf",
373 "Eagle",
374 "Elf",
375 "Emperor",
376 "Erinyes",
377 "Ettin",
378 "Fae",
379 "Fairy",
380 "Full Moon",
381 "Furies",
382 "Ghoul",
383 "Giant",
384 "Goblin",
385 "Guardian",
386 "Harpy",
387 "Heart",
388 "Hellhound",
389 "Hob",
390 "Horsemen",
391 "Hound",
392 "Huldra",
393 "Huma",
394 "Hunter",
395 "Hydra",
396 "Ifrit",
397 "Imp",
398 "Incubus",
399 "Irrlicht",
400 "Jiangshi",
401 "Jinn",
402 "KaPpa",
403 "Kelpie",
404 "King",
405 "Kirin",
406 "Kobold",
407 "Lamia",
408 "Legion",
409 "Leopard",
410 "Lich",
411 "Lion",
412 "Lynx",
413 "Mage",
414 "Mandrake",
415 "Mara",
416 "Mermaid",
417 "Monk",
418 "Moon",
419 "Naga",
420 "Naiad",
421 "Nekomata",
422 "Nue",
423 "Nymph",
424 "Ogre",
425 "Oni",
426 "Oracle",
427 "Orc",
428 "Panther",
429 "Pegasus",
430 "PHantasm",
431 "PHantom",
432 "PHoenix",
433 "Pixie",
434 "Priest",
435 "Python",
436 "Queen",
437 "QuinoTaur",
438 "RainBow",
439 "Raven",
440 "Roc",
441 "Salamander",
442 "Satyr",
443 "Scorpion",
444 "Selkie",
445 "SerPent",
446 "Slyph",
447 "Soldier",
448 "Sphinx",
449 "Spider",
450 "Strigoi",
451 "Tanuki",
452 "Taotie",
453 "Tarasque",
454 "Tengu",
455 "Titan",
456 "Troll",
457 "Undead",
458 "Undine",
459 "Unicorn",
460 "Valkyrie",
461 "Vampire",
462 "WarLord",
463 "Warrior",
464 "Wendigo",
465 "Werewolf",
466 "WiZard",
467 "Witch",
468 "Wolf",
469 "Wraith",
470 "Wyrm",
471 "Wyvern",
472 "Yama-Uba",
473 "Yeti",
474 "Youkai",
475 "Zombie",
476 "dJinn",
477 "kNight",
478 ];
479
480 function capitalize (s) {
481 return s.split(" ").map(function (s) {
482 return s[0].toUpperCase() + s.slice(1).toLowerCase();
483 }).join(" ");
484 }
485
486 function consonant (b) {
487 var a = this.replace(/C/g, 'K')
488 .replace(/PH/g, 'F')
489 .replace(/[^A-Z]+/g, ' ')
490 .trimRight().split(/ +/g);
491 var b = b.replace(/C/g, 'K')
492 .replace(/PH/g, 'F')
493 .replace(/[^A-Z]+/g, ' ')
494 .trimRight().split(/ +/g);
495 return intersects(a, b);
496 }
497
498 function generateName () {
499 var location = choice(LOCATION);
500 var denizen = capitalize(choice(
501 DENIZEN.filter(consonant, location)));
502 var adjective = capitalize(choice(
503 ADJECTIVE.filter(consonant, location)));
504 var state = capitalize(choice(
505 STATE.filter(consonant, location)));
506 location = capitalize(location);
507 return choice([
508 ["The", denizen + "'s", location],
509 ["The", adjective, location],
510 ["The", location, "of", state],
511 [state + "'s", location],
512 ["The", location, "of", "the", denizen],
513 choice([
514 [capitalize(choice(ADJECTIVE)), denizen, location],
515 [adjective, denizen, capitalize(choice(LOCATION))],
516 ]),
517 ]).join(" ");
518 }