def __init__(self, name, description, greetings): """ Initializes Minas Morgul. @param name: The name of the UniquePlace. @param description: A description of the UniquePlace. @param greetings: The greetings the user gets as he enters. """ #Call parent class init function UniquePlace.__init__(self, name, description, greetings) self._wave = [] self._wave2 = [] self._wave3 = [] #Create monster wave #1 for monster in range(13): monster = Orc_II(constants.MONSTER_STATS[Orc_II]) self._wave.append(monster) for monster in range(8): monster = OrcArcher_II(constants.MONSTER_STATS[OrcArcher_II]) self._wave.append(monster) for monster in range(7): monster = Troll_II(constants.MONSTER_STATS[Troll_II]) self._wave.append(monster) #Create monster wave #2 for monster in range(8): monster = Nazgul_III(constants.MONSTER_STATS[Nazgul_III]) self._wave2.append(monster) monster = WitchKing(constants.MONSTER_STATS[WitchKing]) self._wave2.append(monster) #Create monster wave #3 for monster in range(7): monster = Orc_II(constants.MONSTER_STATS[Orc_II]) self._wave3.append(monster) for monster in range(3): monster = OrcArcher_II(constants.MONSTER_STATS[OrcArcher_II]) self._wave3.append(monster) for monster in range(4): monster = Nazgul_III(constants.MONSTER_STATS[Nazgul_III]) self._wave3.append(monster) #Create loot description = "Seems to have a mind of its own" weapon = Weapon("Morgul Blade", description, 6, 32, 18) description = "Rusted over" weapon2 = Weapon("Morgul Blade", description, 6, 18 ,16) description = "Completely useless" armor = Armor("Rotting Shield", description, 4, 6, 12) description = "Too small for a human" armor2 = Armor("Travel Boots", description, 4, 4, 1) description = "Strange ingredients" potion = Potion("Orcish Tea", description, 2, 0, -15) description = "Questionable health value" potion2 = Potion("Orcish Tea", description, 2, 0, -20) description = "Potential resale value" item = Item("Orcish Banister", description, 5, 42) self._loot = [weapon, weapon2, armor, armor2, potion, potion2, item]
def __init__(self, name, description, greetings): """ Initialize Tower of Cirith Ungol. @param name: The name of the UniquePlace. @param description: A description of the UniquePlace. @param greetings: The greetings the user gets as he enters. """ #Call parent class init function UniquePlace.__init__(self, name, description, greetings) self._wave = [] self._wave2 = [] #Create monster wave #1 monster = Shelob(constants.MONSTER_STATS[Shelob]) self._wave.append(monster) #Create monster wave #2 for monster in range(15): monster = Orc_II(constants.MONSTER_STATS[Orc_II]) self._wave2.append(monster) for monster in range(6): monster = OrcArcher_II(constants.MONSTER_STATS[OrcArcher_II]) self._wave2.append(monster)
def __init__(self, name, description, greetings): """ Initializes Tharbad. @param name: The name of the UniquePlace. @param description: A description of the UniquePlace. @param greetings: The greetings the user gets as he enters. """ #Call parent class init function UniquePlace.__init__(self, name, description, greetings) #Generates list of Nazgul that user may fight self._monsters = [] numberNazgul = random.randrange(1, 5) for monster in range(numberNazgul): nazgul = Nazgul_II(constants.MONSTER_STATS[Nazgul_II]) self._monsters.append(nazgul) #Generate loot description = "Ancient runes and symbols" scroll = Item("Ancient Scroll", description, 1, 32) description = "Looks like it can break at any second" weapon = Weapon("Rotting Staff", description, 6, 3, 4) description = "Maybe one or two hits and it's through" armor = Armor("Rotting Shield", description, 4, 2, 1) self._loot = [scroll, weapon, armor]
def __init__(self, name, description, greetings): """ Initializes Dol Guldur. @param name: The name of the UniquePlace. @param description: A description of the UniquePlace. @param greetings: The greetings the user gets as he enters. """ #Call parent class init function UniquePlace.__init__(self, name, description, greetings) self._wave = [] self._wave2 = [] self._wave3 = [] #Create monster wave #1 for monster in range(11): monster = Orc(constants.MONSTER_STATS[Orc]) self._wave.append(monster) for monster in range(10): monster = OrcArcher(constants.MONSTER_STATS[OrcArcher]) self._wave.append(monster) for monster in range(7): monster = Troll(constants.MONSTER_STATS[Troll]) self._wave.append(monster) #Create monster wave #2 numberNazgul = random.randrange(0, 8) for monster in range(numberNazgul): nazgul = Nazgul_II(constants.MONSTER_STATS[Nazgul_II]) self._wave2.append(nazgul) if random.random() < constants.DOL_GULDUR_WITCH_KING_PROB: witchKing = WitchKing(constants.MONSTER_STATS[WitchKing]) self._wave2.append(witchKing) for monster in range(8): monster = BlackNumernorian(constants.MONSTER_STATS[BlackNumernorian]) self._wave2.append(monster) #Create monster wave #3 numberNazgul = random.randrange(0, 8) for monster in range(numberNazgul): nazgul = Nazgul_II(constants.MONSTER_STATS[Nazgul_II]) self._wave3.append(nazgul) for monster in range(6): monster = BlackNumernorian(constants.MONSTER_STATS[BlackNumernorian]) self._wave3.append(monster) self._wave3.append(monster) #Create loot weapon = Weapon("Cursed Sword", "Fills you with fear", 5, 18, 18) weapon2 = Weapon("Cursed Axe", "You lose confidence holding this", 5, 22, 16) armor = Armor("Cursed Shield", "Gaping holes", 5, 12, 1) potion = Potion("Cursed Elixir", "An unknown substance", 2, 0, -10) item = Item("Cursed Mirror", "Odd distortions and shadows", 6, 18) item2 = Item("Cursed Books", "Grimoires", 4, 72) self._loot = [weapon, weapon2, armor, potion, item, item2]
def __init__(self, name, description, greetings): """ Initializes Argonath. @param name: The name of the UniquePlace. @param description: A description of the UniquePlace. @param greetings: The greetings the user gets as he enters. """ #Call parent class init function UniquePlace.__init__(self, name, description, greetings)
def __init__(self, name, description, greetings): """ Initializes Isenmouthe. @param name: The name of the UniquePlace. @param description: A description of the UniquePlace. @param greetings: The greetings the user gets as he enters. """ #Call parent class init function UniquePlace.__init__(self, name, description, greetings) self._wave = [] self._wave2 = [] #Create monster wave #1 for monster in range(14): monster = Orc_II(constants.MONSTER_STATS[Orc_II]) self._wave.append(monster) for monster in range(7): monster = OrcArcher_II(constants.MONSTER_STATS[OrcArcher_II]) self._wave.append(monster) for monster in range(6): monster = Troll_II(constants.MONSTER_STATS[Troll_II]) self._wave.append(monster) for monster in range(3): monster = BlackNumernorian_II(constants.MONSTER_STATS[BlackNumernorian_II]) self._wave.append(monster) #Create monster wave #2 for monster in range(5): monster = Orc_II(constants.MONSTER_STATS[Orc_II]) self._wave2.append(monster) for monster in range(4): monster = OrcArcher_II(constants.MONSTER_STATS[OrcArcher_II]) self._wave2.append(monster) for monster in range(2): monster = Troll_II(constants.MONSTER_STATS[Troll_II]) self._wave2.append(monster) for monster in range(5): monster = BlackNumernorian_II(constants.MONSTER_STATS[BlackNumernorian_II]) self._wave2.append(monster) for monster in range(4): monster = Nazgul_III(constants.MONSTER_STATS[Nazgul_III]) self._wave2.append(monster) monster = MouthOfSauron(constants.MONSTER_STATS[MouthOfSauron]) self._wave2.append(monster) #Create loot weapon = Weapon("Troll Hammer", "Enormous and unwieldy", 18, 42, 20) armor = Armor("Troll Shield", "Enormous and unwieldy", 14, 36, 2) potion = Potion("Orc Draught", "Disgusting", 2, 0, -15) potion2 = Potion("Orc Draught", "Potentially toxic", 2, 0, -20) item = Item("Orcish Banister", "Potential resale value", 5, 14) item2 = Item("Screw and bolts", "Useless", 2, 4) self._loot = [weapon, armor, potion, potion2, item, item2]
def __init__(self, name, description, greetings): """ Initializes Isenguard. @param name: The name of the UniquePlace. @param description: A description of the UniquePlace. @param greetings: The greetings the user gets as he enters. """ #Call parent class init function UniquePlace.__init__(self, name, description, greetings) #Create three waves of monsters self._wave = [] self._wave2 = [] self._wave3 = [] #Create monster wave #1 for monster in range(6): urukHai = UrukHai(constants.MONSTER_STATS[UrukHai]) self._wave.append(urukHai) for monster in range(3): urukHaiArcher = UrukHaiArcher(constants.MONSTER_STATS[UrukHaiArcher]) self._wave.append(urukHaiArcher) #Create monster wave #2 for monster in range(10): eliteUrukHai = EliteUrukHai(constants.MONSTER_STATS[EliteUrukHai]) self._wave2.append(eliteUrukHai) for monster in range(4): urukHaiArcher = UrukHaiArcher(constants.MONSTER_STATS[UrukHaiArcher]) self._wave2.append(urukHaiArcher) #Create monster wave #3 - elite Uruk Hai have increased stats BONUS = 3 increasedStats = [] for stat in constants.MONSTER_STATS[EliteUrukHai]: increasedStats.append(stat * BONUS) for monster in range(2): eliteUrukHai = EliteUrukHai(increasedStats) self._wave3.append(eliteUrukHai) #Create Sauroman sauroman = Sauroman(constants.MONSTER_STATS[Sauroman]) self._wave3.append(sauroman) #Spawn loot description = ("Two gigantic black keys needed to gain entry to the" " Tower of Orthanc") keysOfOrthanc = Item("Keys to Orthanc", description, 1, 104) palatir = Item("Palatir", "Stones of Seeing", 6, 112) self._loot = [keysOfOrthanc, palatir]
def __init__(self, name, description, greetings): """ Initializes Tom Bombadil's House. @param name: The name of the UniquePlace. @param description: A description of the UniquePlace. @param greetings: The greetings the user gets as he enters. """ #Call parent class init function UniquePlace.__init__(self, name, description, greetings) #Spawn loot description = "Has a secret, sharpened edge" weapon = Weapon("Walking Cane", description, 4, 2, 2) description = "Contains rare herbs" potion = Potion("Forest Tonic", description, 1, 4, 6) self._gift = [weapon, potion]
def __init__(self, name, description, greetings): """ Initializes Weathertop. @param name: The name of the UniquePlace. @param description: A description of the UniquePlace. @param greetings: The greetings the user gets as he enters. """ # Call parent class init function UniquePlace.__init__(self, name, description, greetings) # Generates Nazgul wave self._monsters = [] numberNazgul = random.randrange(1, 8) for monster in range(numberNazgul): nazgul = Nazgul(constants.MONSTER_STATS[Nazgul]) self._monsters.append(nazgul)
def __init__(self, name, description, greetings): """ Initializes Derningle. @param name: The name of the UniquePlace. @param description: A description of the UniquePlace. @param greetings: The greetings the user gets as he enters. """ #Call parent class init function UniquePlace.__init__(self, name, description, greetings) #Create gift self._gift = [] description = ("A mysterious elixir with extremely powerful" " nourishing properties") for potion in range(3): potion = Potion("Ent Draught", description, 2, 42, 100) self._gift.append(potion)
def __init__(self, name, description, greetings): """ Initializes GoblinTown. @param name: The name of the UniquePlace. @param description: A description of the UniquePlace. @param greetings: The greetings the user gets as he enters. """ #Call parent class init function UniquePlace.__init__(self, name, description, greetings) #Spawn loot description = "Good for goblins, terrible for humans" weapon = Weapon("Goblin Blade", description, 3, 5, 6) description = "Stolen from Erebor" weapon2 = Weapon("Dwarven Axe", description, 4, 8, 12) description = "Looks Gondorian... represents stolen goods" weapon3 = Weapon("Poleaxe", description, 6, 12, 14) self._loot = [weapon, weapon2, weapon3] #Create three monster waves self._wave = [] self._wave2 = [] self._wave3 = [] #Create monster wave #1 for monster in range(2): monster = Goblin(constants.MONSTER_STATS[Goblin]) self._wave.append(monster) #Create monster wave #2 for monster in range(8): monster = Goblin(constants.MONSTER_STATS[Goblin]) self._wave2.append(monster) #Create monster wave #3 for monster in range(4): monster = Goblin(constants.MONSTER_STATS[Goblin]) self._wave3.append(monster) monster = GreatGoblin(constants.MONSTER_STATS[GreatGoblin]) self._wave3.append(monster) #Create monster wave #4 self._wave4 = self._wave + self._wave2 + self._wave3
def testInit(self): from player import Player from space import Space from unique_place import UniquePlace testuniqueplace = UniquePlace("Chris' unique testing room", "Come test here") space = Space("Shire", "Home of the Hobbits.", uniquePlaces=[testuniqueplace]) player = Player("Frodo", space) #if the code gets here, then it hasn't crashed yet; test something arbitrary here, like player's money. self.assertEqual(player._money, 20, "Why does player's money not equal 20?")
def getWorld(): #Hobbiton - The Shire #Inn description = "A place for strangers." greeting = "Welcome to our inn! I'm Sally of the Tokinsville Baggins Clan." sallyInn = Inn("Sally's Inn", description, greeting, 2) #Shop description = "Exotic selection by hobbit standards." greeting = "We have strange wares." sallyShop = Shop("Sally's Shop", description, greeting, 4, 3) #Square description = "Lots of hobbits, mostly gossip." greeting = "Did you hear the latest news on Lobelia Baggins?" talk = {"Lobelia Baggins": "Get lost!", "Naftel Took": "News has broken out that Lobelia is making an attempt on Bag End....", "Amaranth Brandybuck": "Nice weather isn't it?", "Balbo Baggins": "The word on the street is that Lobelia is trying to acquire the Baggins estate!", "Ferdinand Took": "I wonder when Gandalf will visit?"} hobbitonSquare = Square("Hobbiton Square", description, greeting, talk) tombombadilhouse = UniquePlace("Tom Bombadil's House", "Tom lives here.") #City description = """Hobbiton is a village in the central regions of the Shire within the borders of the Westfarthing. Hobbiton is located on both sides of the Water approximately a mile northwest of the neighboring village of Bywater. """ hobbiton = City("Hobbiton", description, "Did you hear the latest news?", [sallyInn, sallyShop, hobbitonSquare]) #The Shire description = """ The Shire is divided into four farthings, North, South, East and West; its chief town is Michel Delving on the White Downs in the Westfarthing. The Mayor of Michel Delving is the most important of the Shire-hobbits. The Shire is largely dependent on agriculture and its land is well-suited for farming. One of its chief products is Shire Leaf, grown especially in the warmer regions of the Southfarthing. """ shire = Space("Shire", description, city = hobbiton, uniquePlaces = [tombombadilhouse])) #tomBombadil = Place #The Old Forest description = """ The Old Forest is one of the few surviving primordial forests which covered most of Eriador before the Second Age. The Old Forest has been known to play tricks on travelers in response to its massive deforestation. """ oldForest = Space("Old Forest", description) #weathertop = Place #The Weather Hills description = """ Weather Hills was the name among Men for the north-south range of hills that lay in central Eriador and in ancient times marked part of the border between the lands of Arthedain and Rhudaur. Weathertop, or Amon Sûl, lays at the southern end of this range. """ weatherHills = Space("Weather Hills", description) #Trollshaws description = """ Trollshaws are the upland woods that lay to the west of Rivendell and the Rivers Hoarwell and Loudwater. They were the haunt of Trolls, three of which waylaid Bilbo and his companions during the Quest of Erebor. """ trollshaws = Space("Trollshaws", description) #Misty Mountains - Rivendell #Inn description = "A relaxing stay in the scenic Misty Mountains!" greeting = "Welcome to Misty Mountain Inn! Let us host you tonight...." mistyInn = Inn("Misty Mountain Inn", description, greeting, 5) #Shop description = "New Elvenware! Look like your favorite elf!" greeting = "Welcome to ElvenWares! Here we have the latest in elven gadgetry." elvenWares = Shop("ElvenWares", description, greeting, 4, 6) #Square description = "Hotshots only." greeting = "We've been waiting for your arrival...." talk = {"Elrond": "Don't you think about marrying my daughter....", "Legolas": "What do you think about my hair?", "Aragorn": "Check out these knife tricks!", "Gimli": "I bet I can eat more hotdogs than you.", "Gandalf": "Did you know I have the Ring of Fire?"} councilOfElrond = Square("Council of Elrond", description, greeting, talk) #City description = """ Rivendell, also known as Imladris, is an Elven outpost in Middle-earth. It is also referred to as "The Last Homely House East of the Sea", a reference to Valinor, which is west of the Great Sea in Aman. """ greeting = "Welcome to Rivendell! Glad the Nazgul didn't get you." rivendell = City("Rivendell", description, greeting, [mistyInn, elvenWares, councilOfElrond]) #Misty Mountains description = """The Misty Mountains or Mountains of Mist is a great mountain range that lies between Eriador in the west and the Great River Anduin in the east. It runs 795 miles (1,280 kilometers) from Mount Gundabad in the far north to Methedras in the south. """ mistyMountains = Space("Misty Mountains", description, city = rivendell) #High Pass - GoblinTown description = """Goblin-town is a Goblin dwelling which lies under the High Pass in the Misty Mountains and is ruled by the Great Goblin. Gullum's cave is deep beneath Goblin-town and is connected to the Goblins' tunnels. """ greeting = "" goblinTown = City("Goblin Town", description, greeting) #High Pass description = """The High Pass is a pass over the Misty Mountains. On its western end is the refuge of Rivendell and from there the Great East Road climbs into the mountains until it reaches Goblin-town. """ highPass = Space("High Pass", description, city = goblinTown) #Mirkwood - Elvenking's Halls #Inn description = "A woodland experience...." greeting = "Welcome to Elvenking's Inn!" elvenkingsInn = Inn("Elvenking's Inn", description, greeting, 5) #Shop description = "Your local ElvenWares!" greeting = "Great variety of elven gadgetry available!" elvenWares = Shop("ElvenWares", description, greeting, 7, 10) #Square description = "Drinks on Thrandruil!" greeting = "You can't outdrink an elf!" talk = {"Cananthir": "Gaaalaaaagh....", "Curufin": "Don't mind Canathir, he's had a rough life", "Daeron": "Let's drink away our sorrows", "Ecthelion": "Glaaaaaaack....", "Earwen": "[Ignores you]"} elvenkingsTavern = Square("Elvenking's Tavern", description, greeting, talk) #Square description = "Thrandruil's throne room." greeting = "What makes you think that you belong here?" talk = {"Thranduil": "Hmmph! I'm elvenking!", "Angrod": "Much gnashing of teeth here. You probably won't find what you're looking for.", "Aredhel": "Hmmph! Humans!", "Argon": "Hmmph! Didn't you know that you're wearing yesterday's ElvenWare?", "Beleg": "Hmmph! Dress in better ElvenWare!"} elvenkingsThrone = Square("Elvenking's Throne", description, greeting, talk) #City description = """The Elvenking's Halls is the cave system in northern Mirkwood in which King Thranduil and many of the Elves of Mirkwood live. """ greeting = "Welcome to Elvenking's Halls! Thranduil resides here." elvenkingsHalls = City("Elvenking's Halls", description, greeting, [elvenkingsInn, elvenWares, elvenkingsTavern, elvenkingsThrone]) #Mirkwood description = """Mirkwood or the Forest of Great Fear is a great forest in Rhovanion. Mirkwood is once called Greenwood the Great and later became the Wood of Greenleaves.""" mirkwood = Space("Mirkwood", description, city = elvenkingsHalls) #Barrow Downs - Bree #Inn description = "A quiet inn, tucked away in the outskirts of Bree." greeting = "Hi I'm Linda, the innkeeper." lindasInn = Inn("Linda's Inn", description, greeting, 5) #Shop description = "COME GET YOUR ORC-KILLING GEAR HERE!" greeting = "HI I'M HANK!!! KILL ORCS!!!!!" hanksBattleGear = Shop("Hank's Battle Gear", description, greeting, 10, 4) #Square description = "A noisy hole in the wall known for quarrels." greeting = "[You are greeted with silence. Two people stare at you briefly \n before turning back to their drinks.]" talk = {"Bill Ferny": "I hear there's been Nazgul in these parts.", "Harry Goatleaf": "The entire town is scared of Nazgul....", "Henry Thistlewool": "The shadow has descended upon these parts.", "Dudo Baggins": "What am I even doing here?", "Estella Brandybuck": "Time to go home I think...."} fourCorners = Square("Four Corners", description, greeting, talk) #City description = """Bree was settled in the early Third Age, in the realm Cardolan. Though the Princes of Cardolan claimed it, Bree continued to thrive without any central authority or government for many centuries. """ greeting = "Nazgul have been visiting the area at night!" bree = City("Bree", description, greeting, [lindasInn, hanksBattleGear, fourCorners]) #Barrow Downs description = """Barrow-downs or Tyrn Gorthad is a series of low hills east of the Shire, behind the Old Forest and west of the village of Bree. Many of the hills are crowned with megaliths and barrows, whence its name. """ barrowDowns = Space("Barrow Downs", description, city = bree) #Bruinen description = """Bruinen or Loudwater is a river in eastern Eriador. It began with two tributaries flowing from the western slopes of the Misty Mountains. """ bruinen = Space("Bruinen", description) #tharbad = Place #Mitheithel description = """Mitheithel is the long river that rises in a place in the icy north of Middle-earth known by Men as Hoarwell. """ mitheithel = Space("Mitheithel", description) #ostInEdhil = Place #Swanfleet description = """The Swanfleet or Nin-in-Eilph is a marshy area in eastern Eriador where the lower reaches of the Glanduin flows before it joins Mitheithel. Swanfleet is an inland delta. """ swanfleet = Space("Swanfleet", description) #Dunland description = """Dunland is the land of the Dunlendings. Dunland means Hill Land in the language of neighbouring Rohan, whose people named it after arriving in nearby Calenardhon in the later Third Age. It is a land of the wild men. """ dunland = Space("Mitheithel", description) #chamberOfMazarbul = Place #Moria - The Seventh Level description = """The Seventh Level of Moria or Khazad-dum is a level of chambers, corridors and rooms, being six levels above the Great Gates. The term level or levels in the ancient Dwarven kingdom generally refer to the eastern area of Moria, nearest the eastern gate which was most populated when Khazad-dum was a mighty city of the Dwarves. """ greeting = "" theSeventhLevel = City("The Seventh Level", description, greeting) #Moria description = """Khazad-dum, (also known as Moria, The Black Chasm, The Black Pit, Dwarrowdelf, Hadhodrond, Casarrondo, and and Phurunargian) is the grandest and most famous of the mansions of the Dwarves. There, for many thousands of years, a thriving Dwarvish community created the greatest city ever known. """ moria = Space("Moria", description, city = theSeventhLevel) #Lorien - Caras Galadhon #Inn description = "Nested between the rivers Anduin and Silverlode." greeting = "I hope you enjoy your stay at ElvenWaters." elvenWaters = Inn("ElvenWaters Inn", description, greeting, 5) #Shop description = "ElvenWares! Lots of great elven gear!" greeting = "Welcome to ElvenWares! We have lots of rare collectibles!" elvenWares = Shop("ElvenWares", description, greeting, 11, 6) #Square description = "For prophesy as well as plain old fashioned vanity." greeting = "I've been waiting for you...." talk = {"Galadriel": "Check out this new ElvenWare! How do you think I look?"} galadrielsMirror = Square("Galadriel's Mirror", description, greeting, talk) #City description = """Caras Galadhon is a city located in Lorien. Its inhabitants dwell in large flets in the trees, reached by white ladders. On the top of the hill in the greatest of trees, are the house of Celeborn and Galadriel. """ greeting = "Welcome to Caras Galdhon! Celeborn and Galadriel reside here." carasGaladhon = City("Caras Galadhon", description, greeting, [elvenWaters, elvenWares, galadrielsMirror]) #Lorien description = """Lothlorien is a kingdom of Silvan Elves on the eastern side of the Hithaeglir. It is considered one of the most beautiful places in Middle-earth and has the only mallorn-trees east of the sea. """ lorien = Space("Lorien", description, city = carasGaladhon) #entmoot = Place #Fangorn description = """Fangorn Forest is a deep, dark woodland that grew beneath the southern tips of the Misty Mountains under the eastern flanks of that range. It gains notoriety for its Ents. The forest, known as Entwood in Rohan, was named after the oldest Ent, Fangorn. """ fangorn = Space("Fangorn", description) #The Wold description = """The Wold is the northernmost and least populated part of Rohan, lying between Fangorn Forest and the Anduin, bordered to the north by the Limlight. Its main inhabitants were nomadic Men of Rohan who use the land to graze cattle. In recent years, these men have fled in response to frequent attacks by orcish raiders. """ theWold = Space("The Wold", description) #Field of Celebrant description = """The Field of Celebrant lies between the Rivers Anduin and Limlight and southeast of Lothlorien. In T.A. 2510, the decisive Battle of the Field of Celebrant at which Eorl the Young rode from the north to the aid of Gondor occurred. """ fieldOfCelebrant = Space("Field of Celebrant", description) #Calendardhon - Isenguard description = """Isengard ("Iron Fortress" or Angrenost in Sindarin) is a great fortress located within a valley at the southern end of the Misty Mountains near the Gap of Rohan. In the centre of the Ring of Isengard stands the stone tower of Orthanc. """ greetings = "" isenguard = City("Isenguard", description, greetings) #Calenardhon description = """Calenardhon contains Isengard, a great fortress located within a valley at the southern end of the Misty Mountains near the Gap of Rohan. """ calenardhon = Space("Calenardhon", description) #Westfold - Helm's Deep #Inn description = "Where people go to sober up." greeting = "[No one is there to greet you.]" sobrietyRoom = Inn("Sobriety Room", description, greeting, 0) #Shop description = "The Armory [read: booze shop]." greeting = "We got every poison under the sun...." theArmory = Shop("The Armory", description, greeting, 10, 8) #Square description = "Mass drunkenness." greeting = "[Everyone is passed out.]" talk = {"Erkenbrand": "Ughhhhhhh....", "Gambling the Old": "Merrrrrrrrrrrrr...."} helmsDeepCommons = Square("Helms Deep Commons", description, greeting, talk) #City description = """Helm's Deep is a large valley gorge in northwestern Ered Nimrais below the Thrihyrne. It is the name of the whole defensive system including its major defensive structure, the Hornburg. """ greeting = "Welcome to Helm's Deep! WHOOO!!! PARTY!." helmsDeep = City("Helm's Deep", description, greeting) #Westfold description = """The Westfold is the western part of Rohan, close to the White Mountains and situated between the river Isen and the Folde. The North-South Road runs through the Westfold from the Fords of Isen to Edoras. Its strongpoint is Helm's Deep. """ westfold = Space("Westfold", description, city = helmsDeep) #Westemnet description = """The Eastemnet is part of Rohan. It is an area of wide, grassy plains found east of the river Entwash. """ westemnet = Space("West Emmet", description) #Eastemnet description = """The Eastemnet is part of Rohan. It contains wide, grassy plains and is east of the river Entwash and west of the Great River, Anduin. """ eastemnet = Space("East Emmet", description) #Emyn Muil description = """Emyn Muil is a range of hills south of the Brown Lands and north of the Nindalf. The Anduin cuts through the hills and then pools in Nen Hithoel. """ emynMuil = Space("Emyn Muil", description) #Eastfold - Edoras """ #Inn description = "" greeting = "" = Inn("", description, greeting, 5) #Shop description = "" greeting = "" = Shop("", description, greeting, 5, 4) #Square description = "" greeting = "" talk = {} = Square("", description, greeting, talk) """ #City description = """Rohan's first capital was at Aldburg in the Folde until Eorl the Young's son Brego built Edoras. It is Rohan's only real city and holds the Golden Hall of Meduseld. """ greeting = "" edoras = City("Edoras", description, greeting) #Eastfold - Aldburg """ #Inn description = "" greeting = "" = Inn("", description, greeting, 5) #Shop description = "" greeting = "" = Shop("", description, greeting, 5, 4) #Square description = "" greeting = "" talk = {} = Square("", description, greeting, talk) """ #City description = """Aldburg was built by Eorl in the region known as the Folde, east of Edoras. The Kings of Rohan moved to Edoras after Brego, son of Eorl, completed the Golden Hall, but many centuries later there were still nobles living at Aldburg, including Eomer, son of Eomund. """ greeting = "" aldburg = City("Aldburg", description, greeting) #Eastfold description = """Eastfold is a part of the realm of Rohan. Bounded by the Mering Stream and Snowbourn River, it contains the city of Edoras. """ eastfold = Space("Eastfold", description, city = edoras) #Nindalf description = """The swamps of Nindalf or Wetwang lie to the south of Emyn Muil and east of the Great River Anduin and are fed by the great inland delta of Entwash. The Dead Marshes lie further east and may be an extension of Nindalf. """ nindalf = Space("Nimdalf", description) #Valley of Udun - Dead Marshes description = """The Black Gate of Mordor is a gate built by Sauron to prevent invasion through the Pass of Cirith Gorgor, the gap between the Ered Lithui and the Ephel Duath. """ greetings = "" morannon = City("Morannon", description, greetings) #Dead Marshes description = """The Dead Marshes are an area of swampland east by the Dagorlad plain, site of the ancient Battle of Dagorlad during the Last Alliance of Elves and Men. """ deadMarshes = Space("Dead Marshes", description, city = morannon) #Valley of Udun - Isenmouthe description = """Isenmouthe or Carach Angren is a pass in the northeastern part of Mordor and guards the southern end of the valley, Udun. The pass is heavily guarded with Fortresses and watchtowers. """ greetings = "" isenmouthe = City("Isenmouthe", description, greeting) #Valley of Udun description = """Udun is a depressed valley in northwestern Mordor. It lies between Cirith Gorgor and the Isenmouthe and is traversed by large armies of Sauron in times of war. """ udun = Space("Udun", description, city = isenmouthe) #Cair Andros description = """Cair Andros, meaning "Ship of the Long-Foam," is an island in the river Anduin, resting nearly forty miles to the north of Osgiliath. It is of paramount importance to Gondor because it prevents the enemy from crossing the river and entering into Anorien. """ cairAndros = Space("Cair Andros", description, greeting) #Orodruin description = """Mount Doom, also known as Orodruin and Amon Amarth, is the volcano in Mordor where the One Ring was forged. It is the only place that the One Ring may be destroyed. """ orodruin = Space("orodruin", description) #Anorien - Minas Tirith #Inn description = "Home of elite Gondorian healers." greeting = "Welcome to the Houses of Healing. What can I do for you?" housesOfHealing = Inn("Houses of Healing", description, greeting, 5) #Shop description = "An elite armory, used by Gondorian royalty." greeting = "Welcome to the Smithy of Kings! We have forged legendary blades...." smithyOfKings = Shop("Smithy of Kings", description, greeting, 15, 12) #Square description = "Minas Tirith commons." greeting = "Welcome to our square. This place used to be a lot more lively." talk = {"Calmacil": "Would you like to buy some fruit?", "Castamir": "Everyone is afriad.", "Ciryandil": "Orcish raids have been increasing in the outlying lands....", "Minalcar": "I wonder what we can do with Mordor....", "Narmacil": "I wonder if the king will return", "Tarondor": "I hope Rohan will bring aid.", "Atanatar": "Word has it that Mordor is preparing to attack."} citySquare = Square("Market Square", description, greeting, talk) #Square description = "Home to Gondorian royalty." greeting = "Denethor would like to see you...." talk = {"Denethor": "What do you think Sauron will do next?", "Faramir": "The lands recently stolen by Sauron should be retaken....", "Boromir": "Nice ring. Give it to me!", "Prince Imrahil": "Sauron plans on moving soon....", "Swan Knight": "The men are afraid. The land is covered in shadow...."} towerOfEcthelion = Square("Tower of Ecthelion", description, greeting, talk) #City description = """Minas Tirith is a city of Gondor originally called Minas Anor. From T.A. 1640 onwards it became the capital of the South-kingdom and the seat of its Kings and ruling Stewards. """ greeting = "Welcome to the last stronghold of the West, Minas Tirith." minasTirith = City("Minas Tirith", description, greeting, [housesOfHealing, citySquare, towerOfEcthelion, smithyOfKings]) #Anorien description = """Anorien is the fiefdom of Gondor containing Minas Tirith, the capital of Gondor. Originally known as Minas Anor, it replaced the Osgiliath as capital of Gondor as Osgiliath was overun. """ anorien = Space("Anorien", description, city = minasTirith) #argonath = Place #Anduin - Osgiliath """ #Inn description = "" greeting = "" = Inn("", description, greeting, 5) #Shop description = "" greeting = "" = Shop("", description, greeting, 5, 4) #Square description = "" greeting = "" talk = {} = Square("", description, greeting, talk) """ #City description = """Osgiliath was the ancient capital of the Kingdom of Gondor. Depopulated during the Third Age, it gradually fell into ruin. Osgiliath has strategic importance as a crossing point over the Anduin. """ greeting = "" osgiliath = City("Osgiliath", description, greeting) #Anduin description = """Anduin is a river that crosses most of Middle-earth east of the Misty Mountains. Passing through many lands, it has many names: Langflood by the ancestors of the Rohirrim, the Great River of Wilderland in the Westron of Rivendell and the Shire, and simply the Great River in Gondor. """ anduin = Space("Anduin", description, city = osgiliath) #Ephel Duath - Minas Morgul #City description = """Minas Morgul is a city-fortress in Mordor. Originally created as a Gondorian outpost and the sister city to Minas Anor, Minas Ithil safeguarded the eastern borders of the Kingdom of Gondor and the capital Osgiliath from the forces of Mordor during the early part of the Third Age. Minas Morgul is now home to the Nazgul and Cirith Ungol, a secret pass into Mordor. """ greeting = "" minasMorgul = City("Minas Morgul", description, greeting) #Ephel Duath description = """The Ephel Dúath, or the Mountains of Shadow, are a range of mountains that guard Mordor's western and southern borders. """ ephelDuath = Space("Ephel Duath", description, city = minasMorgul) #Cirith Ungol - Tower of Cirith Ungol description = """Gondor occupied the fortress until T.A. 1636 when the Great Plague killed large parts of Gondor's population. After the plague, Gondor never again manned the Tower of Cirith Ungol and evil was allowed to return to Mordor. Similar fates suffered the mountain fortress of Durthang in northwestern Mordor and the Towers of the Teeth at the Morannon. """ greeting = "" towerOfCirithUngol = City("Tower of Cirith Ungol", description, greeting) #Cirith Ungol description = """Cirith Ungol is the pass through the western mountains of Mordor and the only way towards the land from the west. It is guarded by the Tower of Cirith Ungol, built by the Men of Gondor after the War of the Last Alliance of Elves and Men. """ cirithUngol = Space("Cirith Ungol", description, city = towerOfCirithUngol) #Barad Dur description = """Barad-dur is the Dark Lord Sauron's sanctuary fortress in Mordor and serves as his base of operations. Over 1400 meters high and held together by dark magic, it is the largest fortress in Middle-earth. """ greeting = "" baradDur = City("Barad Dur", description, greeting) #Plateau of Gorgoth description = """Plateau of Gorgoroth is a region in the northwestern region of Mordor. Gorgoroth is the location of the mines and forges which supplied Mordor's armies with weapons and armor. """ plateauOfGorgoth = Space("Plateau of Gorgoth", description, city = baradDur) #Lossamarch - Pelargir #Inn description = "Beach resort along Gondor's finest coast!" greeting = "Hey bro! Welcome to Sunnyside Inn!" sunnysideInn = Inn("Sunnyside Inn", description, greeting, 5) #Shop description = "Beach accessories and paraphernalia." greeting = "Hey dude, let's hit the beach later!" palmTreeHut = Shop("Palm Tree Hut", description, greeting, 14, 6) #Square description = "Class-three waves and hot chicks!" greeting = "Bro, did you see those waves?" talk = {"Gondorian bro #1": "Bro, let's hit the beach!", "Gondorian bro #2": "Bro! Let's just chill for awhile... bro?", "Gondorian bro #3": "Bro! I hear there's going to be a party later tonight.", "Gondorian chick #1": "Bro, I have a boyfriend....", "Gondorian chick #2": "Bro, what are you doing later?"} beach = Square("Pelargir Beach", description, greeting, talk) #City description = """One of the oldest cities in Middle Earth, Pelargir served as chief haven of the faithful as Numenorians migrated to Middle Earth to escape persecution. In later years, Pelargir served as chief port of Gondor. """ greeting = "Enjoy a relaxing stay at Pelargir, port city of Gondor." pelargir = City("Pelargir", description, greeting) #Lossamarch description = """Lossarnach is a region and fiefdom in Southern Gondor. Known as the Vale of flowers, it is a fertile region lying south of the White Mountains. """ lossamarch = Space("Lossamarch", description, city = pelargir) #Ithilien description = """Ithilien was the region and fiefdom of Gondor bordering Mordor. """ ithilien = Space("Ithilien", description) #Connections: East-West shire.createExit("east", oldForest, outgoingOnly = False) oldForest.createExit("east", weatherHills, outgoingOnly = False) weatherHills.createExit("east", trollshaws, outgoingOnly = False) trollshaws.createExit("east", mistyMountains, outgoingOnly = False) mistyMountains.createExit("east", highPass, outgoingOnly = False) barrowDowns.createExit("east", bruinen, outgoingOnly = False) swanfleet.createExit("east", moria, outgoingOnly = False) moria.createExit("east", lorien, outgoingOnly = False) calenardhon.createExit("east", fangorn, outgoingOnly = False) fangorn.createExit("east", fieldOfCelebrant, outgoingOnly = False) fangorn.createExit("east", theWold, outgoingOnly = False) westfold.createExit("east", westemnet, outgoingOnly = False) westemnet.createExit("east", eastemnet, outgoingOnly = False) eastemnet.createExit("east", emynMuil, outgoingOnly = False) eastfold.createExit("east", nindalf, outgoingOnly = False) nindalf.createExit("east", deadMarshes, outgoingOnly = False) deadMarshes.createExit("east", udun, outgoingOnly = False) anorien.createExit("east", anduin, outgoingOnly = False) anduin.createExit("east", ephelDuath, outgoingOnly = False) lossamarch.createExit("east", ithilien, outgoingOnly = False) ephelDuath.createExit("east", plateauOfGorgoth, outgoingOnly = False) cirithUngol.createExit("east", plateauOfGorgoth, outgoingOnly = False) orodruin.createExit("east", plateauOfGorgoth, outgoingOnly = False) #Connections: North-South oldForest.createExit("south", barrowDowns, outgoingOnly = False) weatherHills.createExit("south", barrowDowns, outgoingOnly = False) trollshaws.createExit("south", bruinen, outgoingOnly = False) bruinen.createExit("south", mitheithel, outgoingOnly = False) highPass.createExit("south", mirkwood, outgoingOnly = False) mitheithel.createExit("south", swanfleet, outgoingOnly = False) swanfleet.createExit("south", dunland, outgoingOnly = False) dunland.createExit("south", calenardhon, outgoingOnly = False) mirkwood.createExit("south", lorien, outgoingOnly = False) lorien.createExit("south", fieldOfCelebrant, outgoingOnly = False) fieldOfCelebrant.createExit("south", theWold, outgoingOnly = False) calenardhon.createExit("south", westfold, outgoingOnly = False) fangorn.createExit("south", westemnet, outgoingOnly = False) theWold.createExit("south", eastemnet, outgoingOnly = False) westemnet.createExit("south", eastfold, outgoingOnly = False) eastemnet.createExit("south", nindalf, outgoingOnly = False) nindalf.createExit("south", cairAndros, outgoingOnly = False) emynMuil.createExit("south", deadMarshes, outgoingOnly = False) udun.createExit("south", plateauOfGorgoth, outgoingOnly = False) cairAndros.createExit("south", anduin, outgoingOnly = False) cirithUngol.createExit("south", ephelDuath, outgoingOnly = False) anorien.createExit("south", lossamarch, outgoingOnly = False) anduin.createExit("south", ithilien, outgoingOnly = False) return shire
def __init__(self, name, description, greetings): """ Initializes Moria. @param name: The name of the UniquePlace. @param description: A description of the UniquePlace. @param greetings: The greetings the user gets as he enters. """ #Call parent class init function UniquePlace.__init__(self, name, description, greetings) #Initializing danger tracker self._danger = 0 #Strings for low-risk activity self._sneakString = [("You continue through narrow halls," " seeking to avoid detection...."), "You creep by an rotting library....", "You creep down a mine shaft....", "You sneak through some ancient tunnels....", "You creep through a maze of machinery....", "You sneak past a series of corpses....", "You sneak past some strange glyphs...."] #Strings for neutral activity self._neutralString = [("You find the staircase littered with the" " corpses of dwarven warriors."), "You pass an enormous mine shaft.", "You appear to be lost and turn back around.", "You find yourself in an enormous hall, ending an a winding staircase.", "You pass by what used to be a meeting place.", "You trust your gut in making a series of turns.", "You find yourself trapped and needing to turn around."] #Strings for battle encounter self._encounterString = ["You hear some footsteps....", "You think you see some shadows moving....", "You hear a series of agitated grunting....", "You see shadows darting along in the distance....", "You hear whispers in the darkness...."] #Strings if player is running from monsters self._runString = ["You run over some rotting corpses!", "You run past an spiral staircase!", "You dart along some minecarts!", "You dash along a hall of columns!", "You dash along a large mine shaft!", "You dart past some ancient tombs!", "You climb over a pile of rubble!"] #Spawn loot description = "Taken from a slain dwarven warrior" weapon = Weapon("Rusty Axe", description, 6, 8, 12) description = "Worker's mallet" weapon2 = Weapon("Dwarven Hammer", description, 10, 12, 16) description = "Steeped in history" weapon3 = Weapon("Aeowyln", description, 8, 22, 18) description = "Historical significance" weapon4 = Weapon("Durnhelm", description, 4, 18, 3) description = "Old but still effective" armor = Armor("Iron Cap", description, 3, 4, 1) description = "May increase magic find" armor2 = Armor("Boots of Travel", description, 2, 8, 2) description = "One of Middle Earth's rarest metals" item = Item("Mithril", description, 0, 84) description = "Magical properties?" item2 = Item("Ancient Runes", description, 2, 42) self._loot = [weapon, weapon2, weapon3, weapon4, armor, armor2, item, item2]
def __init__(self, name, description, greetings): """ Initialize Barad Dur. @param name: The name of the UniquePlace. @param description: A description of the UniquePlace. @param greetings: The greetings the user gets as he enters. """ #Call parent class init function UniquePlace.__init__(self, name, description, greetings) self._wave = [] self._wave2 = [] self._wave3 = [] self._wave4 = [] self._wave5 = [] #Create monster wave #1 for monster in range(12): monster = Orc_II(constants.MONSTER_STATS[Orc_II]) self._wave.append(monster) for monster in range(7): monster = OrcArcher_II(constants.MONSTER_STATS[OrcArcher_II]) self._wave.append(monster) for monster in range(5): monster = Troll_II(constants.MONSTER_STATS[Troll_II]) self._wave.append(monster) for monster in range(3): monster = BlackNumernorian_II(constants.MONSTER_STATS[BlackNumernorian_II]) self._wave.append(monster) #Create monster wave #2 for monster in range(15): monster = Orc_II(constants.MONSTER_STATS[Orc_II]) self._wave2.append(monster) for monster in range(6): monster = OrcArcher_II(constants.MONSTER_STATS[OrcArcher_II]) self._wave2.append(monster) for monster in range(10): monster = Troll_II(constants.MONSTER_STATS[Troll_II]) self._wave2.append(monster) for monster in range(4): monster = BlackNumernorian_II(constants.MONSTER_STATS[BlackNumernorian_II]) self._wave2.append(monster) #Create monster wave #3 for monster in range(5): monster = BlackNumernorian_II(constants.MONSTER_STATS[BlackNumernorian_II]) self._wave3.append(monster) monster = MouthOfSauron(constants.MONSTER_STATS[MouthOfSauron]) self._wave3.append(monster) #Create monster wave #4 for monster in range(8): monster = Nazgul_III(constants.MONSTER_STATS[Nazgul_III]) self._wave4.append(monster) monster = WitchKing(constants.MONSTER_STATS[WitchKing]) self._wave4.append(monster) #Create monster wave #5 for monster in range(14): monster = DragonOfMordor(constants.MONSTER_STATS[DragonOfMordor]) self._wave5.append(monster) #Create loot potion = Potion("Hyper Potion", "Extreme healing qualities", 2, 112, 500) potion2 = Potion("Super Potion", "Medium healing qualities", 2, 76, 350) potion3 = Potion("Dragon Milk", "Healing qualities", 2, 142, 1000) item = Item("Masterball", "Can catch any Pokemon", 4, 272) item2 = Item("Moonstone", "Evolves normal Pokemon", 6, 196) item3 = Item("Nugget", "High resale value", 12, 5000) self._loot = [potion, potion2, potion3, item, item2, item3]
def __init__(self, name, description, greetings): """ Initialize UniquePlace object. @param name: The name of the UniquePlace. @param description: A description of the UniquePlace. @param greetings: The greetings the user gets as he enters. """ #Call parent class init function UniquePlace.__init__(self, name, description, greetings) self._wave = [] self._wave2 = [] self._wave3 = [] self._wave4 = [] #Create monster wave #1 for monster in range(11): monster = Orc_II(constants.MONSTER_STATS[Orc_II]) self._wave.append(monster) for monster in range(6): monster = OrcArcher_II(constants.MONSTER_STATS[OrcArcher_II]) self._wave.append(monster) for monster in range(6): monster = Troll_II(constants.MONSTER_STATS[Troll_II]) self._wave.append(monster) for monster in range(2): monster = BlackNumernorian_II(constants.MONSTER_STATS[BlackNumernorian_II]) self._wave.append(monster) #Create monster wave #2 for monster in range(12): monster = Orc_II(constants.MONSTER_STATS[Orc_II]) self._wave2.append(monster) for monster in range(6): monster = OrcArcher_II(constants.MONSTER_STATS[OrcArcher_II]) self._wave2.append(monster) for monster in range(8): monster = Troll_II(constants.MONSTER_STATS[Troll_II]) self._wave2.append(monster) for monster in range(4): monster = BlackNumernorian_II(constants.MONSTER_STATS[BlackNumernorian_II]) self._wave2.append(monster) for monster in range(9): monster = Nazgul_III(constants.MONSTER_STATS[Nazgul_III]) self._wave2.append(monster) #Create monster wave #3 for monster in range(6): monster = BlackNumernorian_II(constants.MONSTER_STATS[BlackNumernorian_II]) self._wave3.append(monster) monster = MouthOfSauron(constants.MONSTER_STATS[MouthOfSauron]) self._wave3.append(monster) #Create monster wave #4 for monster in range(8): monster = Orc_II(constants.MONSTER_STATS[Orc_II]) self._wave4.append(monster) for monster in range(5): monster = OrcArcher_II(constants.MONSTER_STATS[OrcArcher_II]) self._wave4.append(monster) for monster in range(3): monster = Troll_II(constants.MONSTER_STATS[Troll_II]) self._wave4.append(monster) for monster in range(4): monster = BlackNumernorian_II(constants.MONSTER_STATS[BlackNumernorian_II]) self._wave4.append(monster) #Create loot weapon = Weapon("Orcish Knife", "Jagged and old", 4, 12, 8) armor = Armor("Rotting Boots", "Completely useless", 4, 0, 0) potion = Potion("Orc Draught", "May contain human flesh", 2, 0, -15) potion2 = Potion("Orc Draught", "Basically the orcish version of Gatorade", 2, 0, -10) item = Item("Orcish Pillow", "Basically, a rock", 3, 0) item2 = Item("Orcish Blankets", "For slumber parties", 4, 2) self._loot = [weapon, armor, potion, potion2, item, item2]