Typo.
[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 "THundering",
205 "Tormented",
206 "Tranquil",
207 "Turbulent",
208 "Twilight",
209 "Twisted",
210 "Twisting",
211 "Uncanny",
212 "Unholy",
213 "UnLucky",
214 "Unknown",
215 "Unmourned",
216 "Unseen",
217 "Unspoken",
218 "Unstable",
219 "Vanished",
220 "Vanishing",
221 "Vanquished",
222 "Veiled",
223 "Vicious",
224 "Violent",
225 "Voiceless",
226 "Wailing",
227 "Wasted",
228 "WatCHing",
229 "Western",
230 "Whispering",
231 "Wicked",
232 "Wild",
233 "Windy",
234 "Winter",
235 "WiTHered",
236 "Yawning",
237 "Zealous",
238 ];
239
240 var LOCATION = [
241 "Abbey",
242 "Abyss",
243 "Alley",
244 "Barracks",
245 "Burrows",
246 "Castle",
247 "Catacomb",
248 "Cave",
249 "Caverns",
250 "CHambers",
251 "Chasm",
252 "Crypt",
253 "Delve",
254 "Demesne",
255 "Den",
256 "Desert",
257 "Domain",
258 "Drop",
259 "Dungeon",
260 "Egress",
261 "Fissure",
262 "Forest",
263 "Forge",
264 "Gate",
265 "Grave",
266 "Grotto",
267 "Hall",
268 "Halls",
269 "Haunt",
270 "Hole",
271 "Hollow",
272 "Ingress",
273 "Jail",
274 "Jungle",
275 "Keep",
276 "Labyrinth",
277 "Lair",
278 "Lake",
279 "Lowlands",
280 "Manse",
281 "Mansion",
282 "Marsh",
283 "Mausoleum",
284 "MaZe",
285 "Mine",
286 "Mound",
287 "Mountain",
288 "Necropolis",
289 "Nightmare",
290 "Ossuary",
291 "Oubliette",
292 "Pale",
293 "Pass",
294 "Passage",
295 "Pit",
296 "Pool",
297 "Prison",
298 "Pyramid",
299 "Quarters",
300 "Refuge",
301 "Rest",
302 "Rift",
303 "Sepulchre",
304 "Shrine",
305 "Stockade",
306 "Swamp",
307 "THrone",
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 "THreat",
352 "Valor",
353 "Vexation",
354 "Woe",
355 "Zealotry",
356 ];
357
358 var DENIZEN = [
359 "Alicorn",
360 "Army",
361 "Baku",
362 "Banshee",
363 "Bat",
364 "Bear",
365 "BogGart",
366 "Bunyip",
367 "CHangling",
368 "Cult",
369 "Demon",
370 "DraGon",
371 "Drake",
372 "Draugr",
373 "Dwarf",
374 "Eagle",
375 "Elf",
376 "Emperor",
377 "Erinyes",
378 "Ettin",
379 "Fae",
380 "Fairy",
381 "Full Moon",
382 "Furies",
383 "Ghoul",
384 "Giant",
385 "Goblin",
386 "Guardian",
387 "Harpy",
388 "Heart",
389 "Hellhound",
390 "Hob",
391 "Horsemen",
392 "Hound",
393 "Huldra",
394 "Huma",
395 "Hunter",
396 "Hydra",
397 "Ifrit",
398 "Imp",
399 "Incubus",
400 "Irrlicht",
401 "Jiangshi",
402 "Jinn",
403 "KaPpa",
404 "Kelpie",
405 "King",
406 "Kirin",
407 "Kobold",
408 "Lamia",
409 "Legion",
410 "Leopard",
411 "Lich",
412 "Lion",
413 "Lynx",
414 "Mage",
415 "Mandrake",
416 "Mara",
417 "Mermaid",
418 "Monk",
419 "Moon",
420 "Naga",
421 "Naiad",
422 "Nekomata",
423 "Nue",
424 "Nymph",
425 "Ogre",
426 "Oni",
427 "Oracle",
428 "Orc",
429 "Panther",
430 "Pegasus",
431 "PHantasm",
432 "PHantom",
433 "PHoenix",
434 "Pixie",
435 "Priest",
436 "Python",
437 "Queen",
438 "QuinoTaur",
439 "RainBow",
440 "Raven",
441 "Roc",
442 "Salamander",
443 "Satyr",
444 "Scorpion",
445 "Selkie",
446 "SerPent",
447 "Slyph",
448 "Soldier",
449 "Sphinx",
450 "Spider",
451 "Strigoi",
452 "Tanuki",
453 "Taotie",
454 "Tarasque",
455 "Tengu",
456 "THief",
457 "THunderbird",
458 "Titan",
459 "Troll",
460 "Undead",
461 "Undine",
462 "Unicorn",
463 "Valkyrie",
464 "Vampire",
465 "WarLord",
466 "Warrior",
467 "Wendigo",
468 "Werewolf",
469 "WiZard",
470 "Witch",
471 "Wolf",
472 "Wraith",
473 "Wyrm",
474 "Wyvern",
475 "Yama-Uba",
476 "Yeti",
477 "Youkai",
478 "Zombie",
479 "dJinn",
480 "kNight",
481 ];
482
483 function capitalize (s) {
484 return s.split(" ").map(function (s) {
485 return s[0].toUpperCase() + s.slice(1).toLowerCase();
486 }).join(" ");
487 }
488
489 function consonant (b) {
490 var a = this.replace(/C/g, 'K')
491 .replace(/PH/g, 'F')
492 .replace(/[^A-Z]+/g, ' ')
493 .trimRight().split(/ +/g);
494 var b = b.replace(/C/g, 'K')
495 .replace(/PH/g, 'F')
496 .replace(/[^A-Z]+/g, ' ')
497 .trimRight().split(/ +/g);
498 return intersects(a, b);
499 }
500
501 function generateName () {
502 var location = choice(LOCATION);
503 var denizen = capitalize(choice(
504 DENIZEN.filter(consonant, location)));
505 var adjective = capitalize(choice(
506 ADJECTIVE.filter(consonant, location)));
507 var state = capitalize(choice(
508 STATE.filter(consonant, location)));
509 location = capitalize(location);
510 return choice([
511 ["The", denizen + "'s", location],
512 ["The", adjective, location],
513 ["The", location, "of", state],
514 [state + "'s", location],
515 ["The", location, "of", "the", denizen],
516 choice([
517 [capitalize(choice(ADJECTIVE)), denizen, location],
518 [adjective, denizen, capitalize(choice(LOCATION))],
519 ]),
520 ]).join(" ");
521 }