Advertisement
Guest User

biome generator

a guest
May 24th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.97 KB | None | 0 0
  1. # -*- coding: cp1252 -*-
  2. import random
  3.  
  4.  
  5. ADJECTIVES = ['SACRED', 'BRAIN', 'MERCURY', 'BOG', 'SHRIEKING', 'VIOLET',
  6. 'LOGIC', 'CANNIBAL', 'WITCH', 'SKIN', 'ANGLER', 'BRASS',
  7. 'ABYSSAL', 'FLAYED', 'SKY', 'PRISMATIC', 'HOOK', 'BONE', 'LOBE',
  8. 'UMBER', 'PHASE', 'PROBLEM', 'GREY', 'SPECTRAL', 'RAZOR',
  9. 'HALF-', 'ELDER', 'CELESTIAL', 'THUNDER', 'PYRAMID', 'FLESH',
  10. 'MARROW', 'PALE', 'FIRE', 'TRUE', 'JUPITER', 'FALSE', 'PSEUDO-',
  11. 'TUFTED', 'SINGING', 'CARRION', 'ROYAL', 'THORN', 'MIRROR',
  12. 'HISSING', 'WERE-', 'QUASI-', 'MACHINE', 'CLOAKED', 'WHITE',
  13. 'VAMPIRE', 'CYCLOPEAN', 'IMAGINARY', 'TWO-HEADED', 'DIRE',
  14. 'MANTICORE', 'RIGHTEOUS', 'MOON', 'GELATINOUS', 'DWARF',
  15. 'MAN-', 'BLIND', 'CAVE', 'FOREST', 'DESERT', 'BRIMSTONE',
  16. 'BROKEN', 'GHOST', 'ROT', 'HOWLING', 'CURSE', 'TOTEM', 'GILDED',
  17. 'QUESTING', 'FLAIL', 'BLUE', 'PIRATE', 'ASH', 'PIT', 'HOLLOW',
  18. 'SKULL', 'ASTRAL', 'SALT', 'WEEPING', 'OCHRE', 'SUN', 'NIGHT',
  19. 'VILE', 'SILVER', 'SEA', 'WAR', 'SHIELD', 'GRINNING', 'FUNGAL',
  20. 'TOMB', 'CIRCULAR', 'ANTI-', 'PARASITE', 'RUST', 'BLACK',
  21. 'SIEGE', 'RIVER', 'CRIMSON', 'WOODEN', 'STONE', 'SAND', 'IRON',
  22. 'FAERIE', 'CLOUD', 'DUSK', 'UMBRAL', 'HEADLESS', 'DOUBLE',
  23. 'PRIMAL', 'CLAY', 'ICE', 'CANOPTIC', 'BLESSED', 'STAR', 'SORROW']
  24.  
  25. PLANTS = ['CACTUS', 'NETTLE', 'APPLE', 'ROSE', 'PLUM', 'VINE', 'BRAMBLE',
  26. 'FRUIT', 'GRASS', 'LOTUS', 'LILY', 'NECTAR', 'POLLEN', 'PINE',
  27. 'BERRIES', 'MOSS', 'MEMBRANE', 'ORCHID', 'WEED', 'BLOSSOM']
  28.  
  29. HERBIVORES = ['DRYAD', 'APE', 'OX', 'WASP', 'SHAMBLER', 'BOAR', 'GOAT',
  30. 'TURTLE', 'MARE', 'ELF', 'ORYX', 'STAG', 'RHINO', 'STOMPER',
  31. 'LIZARD', 'FOLK', 'SATYR', 'MONKEY', 'SLOTH', 'BAT']
  32.  
  33. CARNIVORES = ['FOX', 'GOBLIN', 'ORC', 'KOBOLD', 'SCORPION', 'STALKER', 'EEL',
  34. 'RAY', 'SPIDER', 'RAPTOR', 'PIERCER', 'BOA', 'OWL', 'LYNX',
  35. 'WOLF', 'COBRA', 'TOAD', 'FALCON', 'HOUND', 'WYVERN']
  36.  
  37. APEXPREDATORS = ['WYRM', 'EAGLE', 'YETI', 'DRAGON', 'CROCODILE', 'SHARK',
  38. 'PHOENIX', 'GIANT', 'TIGER', 'BEAR', 'SERPENT', 'SPHINX',
  39. 'OGRE', 'GRYPHON', 'GORGON', 'FLAYER', 'BEAST', 'COLOSSUS',
  40. 'HAG', 'TROLL']
  41.  
  42. SCAVENGERS = ['WORM', 'FUNGUS', 'LARVAE', 'GRUB', 'URCHIN', 'JELLY', 'RAT',
  43. 'ROACH', 'SLIME', 'GHOUL', 'VULTURE', 'JACKAL', 'CRAB', 'SNAIL',
  44. 'SCARAB', 'PUDDING', 'GULL', 'MAGGOT', 'SPORE', 'SWARM']
  45.  
  46. WEIRDTHINGS = ['SERVANT', 'CHILD', 'ORB', 'CUBE', 'SERAPH', 'JUDGE', 'GOLEM',
  47. 'QUEEN', 'IDOL', 'DEVIL', 'ENGINE', 'FIEND', 'PHANTOM',
  48. 'KNIGHT', 'PREACHER', 'IMP', 'EMPEROR', 'MIMIC', 'WIDOW',
  49. 'HORROR']
  50.  
  51. ENCOUNTERS = ['A partially-eaten grove of PLANT2.',
  52. 'HERBIVORE1 is peacefully munching on a grove of PLANT2.',
  53. 'HERBIVORE2 is peacefully munching on a grove of PLANT1. Several CARNIVORE1 lurk just out of sight, waiting to attack.',
  54. 'A migrating band of HERBIVORE1, the adults keeping watch. Several CARNIVORE1 lurk just out of sight, waiting to attack.',
  55. 'A CARNIVORE2 is worrying at a slowly dying HERBIVORE2.',
  56. 'Several CARNIVORE2 are chasing a couple of CARNIVORE1 away from a fresh-killed HERBIVORE1.',
  57. 'A slowly dying CARNIVORE2. Its flank bears the unmistakable marks of an APEXPREDATOR. A couple of SCAVENGER1 are already beginning to pick at it.',
  58. 'A band of CARNIVORE1 that hasn\'t eaten in a couple of days.',
  59. 'An unrecognizable mass that used to be a HERBIVORE2. It\'s being torn to shreds by a dozen SCAVENGER2.',
  60. 'A small cave which a couple of small CARNIVORE1 are making a den in.',
  61. 'An enormous SCAVENGER1 that follows the PCs from afar.',
  62. 'A SCAVENGER2 nesting site. Contains a couple of adults, a number of babies and bones.',
  63. 'A band of CARNIVORE2 fleeing an APEXPREDATOR, which will arrive in a couple of rounds.',
  64. 'An APEXPREDATOR that hasn\'t eaten in a couple of days.',
  65. 'A panicked HERBIVORE1 trapped in a grove of PLANT1. An APEXPREDATOR is somewhere in the area and the HERBIVORE1 can sense it.',
  66. 'A slowly dying APEXPREDATOR, taken down by a maddened band of HERBIVORE2. A number of SCAVENGER2 are waiting for it to die properly before they approach it.',
  67. 'A WEIRDTHING performing cruel and mysterious experiments on a HERBIVORE1. It will take no notice of the PCs.',
  68. 'A WEIRDTHING standing perfectly still and silent. If the PCs get within 10\', it will attack.',
  69. 'A curious band of CARNIVORE1 sniffing at a WEIRDTHING, which pays them no heed. The CARNIVORE1s will see the PCs as easier prey. The WEIRDTHING will watch with interest. It may intervene on either side.',
  70. 'A WEIRDTHING collecting samples of PLANT2. It will assume the PCs are also plants and try to collect them as well.']
  71.  
  72. LANDMARKADJS = ['PHARAOH\'S', 'PIRATE\'S', 'HUNTER\'S', 'WIDOW\'S',
  73. 'QUEEN\'S', 'WIZARD\'S', 'WITCH\'S', 'DEMON\'S',
  74. 'BUTCHER\'S', 'BAKER\'S', 'BISHOP\'S', 'TEACHER\'S',
  75. 'DEAD MAN\'S', 'CAPTAIN\'S', 'SAILOR\'S',
  76. 'SOLDIER\'S', 'SMUGGLER\'S', 'SHIPWRECK', 'SCARECROW',
  77. 'DRAGON', 'FIDDLER\'S', 'SMITH\'S', 'ORPHAN\'S',
  78. 'SKULL', 'CANDLE', 'ELEPHANT', 'RAINBOW', 'SAPPHIRE',
  79. 'METEOR', 'NOMAD', 'TITAN', 'CACTUS', 'SHIELD', 'HAMMER',
  80. 'TREASURE', 'CAULDRON', 'DESPAIR', 'HARVEST', 'ANVIL',
  81. 'FLOWER', 'HISSING', 'HOWLING', 'WHISPERING', 'CRAWLING',
  82. 'BURNING', 'LIVING', 'SINGING', 'BLACK', 'WHITE', 'GREEN',
  83. 'CRIMSON', 'SILVER', 'FORGOTTEN', 'PESTILENT', 'HALLOWED',
  84. 'BLASTED', 'BITTER', 'HIGH', 'SAVAGE', 'HIDDEN', 'FORBIDDEN',
  85. 'LONELY', 'SINKING', 'FLOATING', 'DESOLATE', 'SACRED',
  86. 'HAUNTED', 'HUNGRY', 'MOLTEN', 'CRYSTAL', 'SALT', 'GRANITE',
  87. 'GLASS', 'PETRIFIED', 'FROZEN', 'SCORCHED', 'ANCIENT',
  88. 'ARCANE', 'BOREAL', 'BLEAK', 'BRASS', 'GHOSTS', 'THORNS',
  89. 'SNAKES', 'SHADOWS', 'WOLVES', 'TRAITORS', 'WISDOM', 'HONOUR',
  90. 'PROMISE', 'ROOTS', 'BLOOD', 'COWARDS', 'DUST', 'SILENCE',
  91. 'BONES', 'KINGS', 'RUST', 'MOSS', 'TEARS', 'FLAMES',
  92. 'FORTUNE', 'EELS', 'SCORPIONS', 'ASH', 'SLAVES', 'THIEVES',
  93. 'PROPHECY', 'STATUES', 'HOPE', 'WORMS', 'FOG', 'NIGHT',
  94. 'STEEL', 'THE STARS', 'THE MOON', 'THE SUN', 'THE DEAD',
  95. 'THE LOST', 'THE GODS']
  96.  
  97. LANDMARKS = ['MOOR', 'MARSH', 'SWAMP', 'MIRE', 'BOG', 'BAYOU', 'WELL',
  98. 'DEPTHS', 'POOL', 'POND', 'LAKE', 'CREEK', 'RIVER', 'BROOK',
  99. 'DELTA', 'LAGOON', 'GEYSER', 'OASIS', 'GLACIER', 'SPRING',
  100. 'BEACH', 'BAY', 'COVE', 'GULF', 'SHORE', 'CAPE', 'ISLAND',
  101. 'ATOLL', 'FOREST', 'JUNGLE', 'WOOD(S)', 'THICKET', 'GROVE',
  102. 'GLADE', 'HEATH', 'CLEARING', 'MEADOW(S)', 'FALL(S)', 'RAPID(S)',
  103. 'STRAND', 'PLAINS', 'STEPPE', 'TUNDRA', 'DESERT', 'SAND(S)',
  104. 'WASTE(S)', 'RIDGE', 'RISE', 'BLUFF', 'GORGE', 'GULCH', 'RAVINE',
  105. 'CANYON', 'CLIFF', 'HILL', 'MOUNTAIN', 'PEAK', 'SUMMIT', 'CAVE',
  106. 'CAVERN', 'HOLE', 'PIT', 'BURROW', 'FLAT(S)', 'PLATEAU', 'MESA',
  107. 'PILLAR', 'NEEDLE', 'CRATER', 'TUNNEL', 'WILDS', 'RIFT', 'ROCK',
  108. 'STONE', 'MONOLITH', 'VALLEY', 'BARREN(S)', 'FIELD(S)', 'CREST',
  109. 'SPIRE(S)', 'VILLAGE', 'TOWN', 'CITY', 'TOMB', 'CRYPT', 'PYRAMID',
  110. 'ZIGGURAT', 'CASTLE', 'PALACE', 'FORTRESS', 'CITADEL', 'TOWER',
  111. 'ROAD', 'PATH', 'CHURCH', 'HARBOUR', 'TEMPLE', 'SHRINE',
  112. 'RUIN(S)', 'ARENA', 'MAZE', 'MINE', 'HALL', 'CAIRN', 'QUARTER',
  113. 'CHURCH', 'ZONE', 'FOUNTAIN', 'CANAL', 'GARDEN', 'ORCHARD',
  114. 'DEN', 'LAIR', 'GATE', 'NEST', 'EYRIE', 'OBELISK', 'BAZAAR',
  115. 'WALL(S)', 'QUARRY']
  116.  
  117. LANDMARKENC = ['A small cottage, crumbling and almost entirely overgrown with PLANT1. It would take some doing to get inside. Probably a day\'s labour for a human w/ a sword but no machete.',
  118. 'A grove of PLANT2 with primitive human faces carved into or woven from it. There are coins in the mouths of the faces. The WEIRDTHING can track the coins and will stalk their holders.',
  119. 'Party of botanists from local college gathering samples of PLANT1. Unprepared for dangers of wilderness. Being stalked by WEIRDTHING. Refuse to believe that WEIRDTHING exists.',
  120. 'Several HERBIVORE2 engaging in an elaborate mating ritual which must not be disturbed at any cost. They may be dueling in pairs until one or the other is significantly injured.',
  121. 'A HERBIVORE2 graveyard. The bones of thousands of HERBIVORE2, accumulated over centuries. Several dying HERBIVORE2. SCAVENGER1 is out in force, worrying at bits of carcass and eying the dying creatures - and you - thoughtfully.',
  122. 'Resting place of a gypsy caravan and their tame herd of HERBIVORE1 (unless they themselves are HERBIVORE1). Have codes of hospitality but take them less seriously than they pretend.',
  123. 'The lair of a large band of CARNIVORE1. They know all the best hiding places and will conceal themselves until you are in their midst. Contains treasure from people they\'ve killed.',
  124. 'A lone traveller, trapped in a high or otherwise defensible place by a band of CARNIVORE2. She has been there for days and is very hungry. Will reward you for rescuing her, as for escort back to civilization. Is evil.',
  125. 'Site of a recent epic battle between a band of CARNIVORE1 and a slightly larger band of CARNIVORE2, who were the winners. Several corpses of both species litter the landscape, attracting SCAVENGER2 in great numbers. A bunch of CARNIVORE2 are off licking their wounds but will return shortly to bury, eat their dead.',
  126. 'Home of a solitude-crazed ranger, her only companion a mostly-domesticated CARNIVORE1. Hasn\'t seen another sapient creature in months. Veers between \x93friendly\x94 and \x93homicidal\x94.',
  127. 'The lair of an APEXPREDATOR. The APEXPREDATOR is currently out hunting. It will return in two hours dragging the carcass of a large HERBIVORE1. If the cave is explored the PCs will be ambushed by a group of SCAVENGER2 who live off the scraps.',
  128. 'The nest of an APEXPREDATOR. It is currently feeding its babies, who are small and vulnerable but could still probably kill you. If not alerted to your presence it will leave them briefly to hunt in half an hour. Might have a mate, you\'re not sure.',
  129. 'The corpse of an APEXPREDATOR. Converted into a flesh fortress by a band of SCAVENGER1, who will wait until the PCs get close before exploding out of its side.',
  130. 'Campsite of a rich, eccentric huntsman who refuses to return home until she\'s killed an APEXPREDATOR, plus her sardonic manservant and jaded retainers. Will offer a sizeable bounty to anyone who can help her take it but insists on doing the killing herself.',
  131. 'Hermit\'s hut. Isolated, surrounded by elaborate series of ditches, pit traps with colony of SCAVENGER1 lurking at bottom. Hermit regularly feeds them, is a wizard maybe',
  132. 'Enormous, ant-hill-like burrow complex built by colony of SCAVENGER2, possibly their parastically dominated host slaves if that\'s the kind of thing they would do. Treasure within.',
  133. 'Dungeon lair of WEIRDTHING. Architecture clearly not natural in origin. Treasure within.',
  134. 'Village of cultists that worship WEIRDTHING. Will pretend to be completely normal until moment they try to sacrifice you. WEIRDTHING no more, less likely to kill them than it is to kill anyone else.',
  135. 'Paladin on quest to kill WEIRDTHING. Domesticated HERBIVORE1 her trustworthy sidekick/mount. Completely legitimate in own right, but no matter what they do, will not trust the party any further than she could throw them (possibly literally? has involved paladin code)',
  136. 'Rival adventuring party.']
  137.  
  138.  
  139. def critter(table):
  140. adj = random.choice(ADJECTIVES)
  141. if adj[-1] == '-':
  142. return adj + random.choice(table)
  143. else:
  144. return adj + ' ' + random.choice(table)
  145.  
  146.  
  147. def landmark():
  148. adj = random.choice(list(enumerate(LANDMARKADJS)))
  149. if adj[0] < 40:
  150. return adj[1] + ' ' + random.choice(LANDMARKS)
  151. elif adj[0] < 80:
  152. return 'THE ' + adj[1] + ' ' + random.choice(LANDMARKS)
  153. else:
  154. return 'THE ' + random.choice(LANDMARKS) + ' OF ' + adj[1]
  155.  
  156.  
  157. def encounter_table(encounters):
  158. encTable = []
  159.  
  160. for x in encounters:
  161. out = ''
  162. enc = x.split(' ')
  163. for c in enc:
  164. if c in biome:
  165. out += biome[c] + ' '
  166. elif c[:-1] in biome:
  167. out += biome[c[:-1]] + c[-1] + ' '
  168. elif c[:-2] in biome:
  169. out += biome[c[:-2]] + c[-2:] + ' '
  170. else:
  171. out += c + ' '
  172. encTable.append(out)
  173. return encTable
  174.  
  175.  
  176. def disp_biome(biome):
  177. print 'P1: ' + biome['PLANT1']
  178. print 'P1: ' + biome['PLANT2']
  179. print 'H1: ' + biome['HERBIVORE1']
  180. print 'H2: ' + biome['HERBIVORE2']
  181. print 'C1: ' + biome['CARNIVORE1']
  182. print 'C2: ' + biome['CARNIVORE2']
  183. print 'AP: ' + biome['APEXPREDATOR']
  184. print 'S1: ' + biome['SCAVENGER1']
  185. print 'S2: ' + biome['SCAVENGER2']
  186. print 'WT: ' + biome['WEIRDTHING']
  187.  
  188.  
  189. ##########################################################
  190. ############################ Actually generate things now.
  191.  
  192.  
  193. random.seed()
  194.  
  195. ## CRITTERS
  196. print 'CRITTERS:'
  197. biome = {}
  198.  
  199. biome['PLANT1'] = critter(PLANTS)
  200. biome['PLANT2'] = critter(PLANTS)
  201.  
  202. biome['HERBIVORE1'] = critter(HERBIVORES)
  203. biome['HERBIVORE2'] = critter(HERBIVORES)
  204.  
  205. biome['CARNIVORE1'] = critter(CARNIVORES)
  206. biome['CARNIVORE2'] = critter(CARNIVORES)
  207.  
  208. biome['APEXPREDATOR'] = critter(APEXPREDATORS)
  209.  
  210. biome['SCAVENGER1'] = critter(SCAVENGERS)
  211. biome['SCAVENGER2'] = critter(SCAVENGERS)
  212.  
  213. biome['WEIRDTHING'] = critter(WEIRDTHINGS)
  214.  
  215. disp_biome(biome)
  216. print '<br>'
  217.  
  218.  
  219. ## ENCOUNTER TABLE
  220. print 'ENCOUNTERS:'
  221. encTable = encounter_table(ENCOUNTERS)
  222. for i in range(0, len(encTable)):
  223. print str(i+1) + '. ' + encTable[i]
  224.  
  225. print '<br>'
  226.  
  227.  
  228. ## LANDMARKS
  229. print 'LANDMARKS & ENCOUNTERS:'
  230. landmarks = [landmark(), landmark(), landmark(), landmark()]
  231. encTable = encounter_table(LANDMARKENC)
  232.  
  233. landmarkEncNums = []
  234. while len(landmarkEncNums) < len(landmarks):
  235. num = random.randrange(0,len(LANDMARKENC))
  236. if num not in landmarkEncNums:
  237. landmarkEncNums.append(num)
  238.  
  239. for i, x in enumerate(landmarks):
  240. print x
  241. print " " + encTable[landmarkEncNums[i]] + '<br>'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement