public static Vendor GetVendor()
        {
            Vendor vendor = new Vendor("Bobby");

            var itemID1 = RandomNumberGenerator.NumberBetween(1, World.Items.Count);
            var itemID2 = RandomNumberGenerator.NumberBetween(1, World.Items.Count);

            vendor.AddItemToInventory(World.ItemByID(itemID1), 5);
            vendor.AddItemToInventory(World.ItemByID(itemID2), 5);

            return(vendor);
        }
Esempio n. 2
0
        private static void PopulateLocations()
        {
            // Create each location
            Location home = new Location(LOCATION_ID_HOME, "Home", "Your house. You really need to clean up the place.");

            Location townSquare = new Location(LOCATION_ID_TOWN_SQUARE, "Town square", "You see a fountain.");

            Vendor bobTheRatCatcher = new Vendor("Bob the Rat-Catcher");

            bobTheRatCatcher.AddItemToInventory(ItemByID(ITEM_ID_RUSTY_SWORD), 1);
            bobTheRatCatcher.AddItemToInventory(ItemByID(ITEM_ID_PIECE_OF_FUR), 5);
            bobTheRatCatcher.AddItemToInventory(ItemByID(ITEM_ID_RAT_TAIL), 3);

            townSquare.VendorWorkingHere = bobTheRatCatcher;

            Location alchemistHut = new Location(LOCATION_ID_ALCHEMIST_HUT, "Alchemist's hut", "There are many strange plants on the shelves.");

            alchemistHut.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_ALCHEMIST_GARDEN);

            Location alchemistsGarden = new Location(LOCATION_ID_ALCHEMISTS_GARDEN, "Alchemist's garden", "Many plants are growing here.");

            alchemistsGarden.AddMonster(MONSTER_ID_RAT, 100);

            Location farmhouse = new Location(LOCATION_ID_FARMHOUSE, "Farmhouse", "There is a small farmhouse, with a farmer in front.");

            farmhouse.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_FARMERS_FIELD);

            Location farmersField = new Location(LOCATION_ID_FARM_FIELD, "Farmer's field", "You see rows of vegetables growing here.");

            farmersField.AddMonster(MONSTER_ID_SNAKE, 100);

            Location guardPost = new Location(LOCATION_ID_GUARD_POST, "Guard post", "There is a large, tough-looking guard here.", ItemByID(ITEM_ID_ADVENTURER_PASS));

            Location bridge = new Location(LOCATION_ID_BRIDGE, "Bridge", "A stone bridge crosses a wide river.");

            bridge.AddMonster(MONSTER_ID_BANDIT, 100);

            Location spiderField = new Location(LOCATION_ID_SPIDER_FIELD, "Forest", "You see spider webs covering covering the trees in this forest.");

            spiderField.AddMonster(MONSTER_ID_GIANT_SPIDER, 100);

            // Link the locations together
            home.LocationToNorth = townSquare;

            townSquare.LocationToNorth = alchemistHut;
            townSquare.LocationToSouth = home;
            townSquare.LocationToEast  = guardPost;
            townSquare.LocationToWest  = farmhouse;

            farmhouse.LocationToEast = townSquare;
            farmhouse.LocationToWest = farmersField;

            farmersField.LocationToEast = farmhouse;

            alchemistHut.LocationToSouth = townSquare;
            alchemistHut.LocationToNorth = alchemistsGarden;

            alchemistsGarden.LocationToSouth = alchemistHut;

            guardPost.LocationToEast = bridge;
            guardPost.LocationToWest = townSquare;

            bridge.LocationToWest = guardPost;
            bridge.LocationToEast = spiderField;

            spiderField.LocationToWest = bridge;

            // Add the locations to the static list
            _locations.Add(home);
            _locations.Add(townSquare);
            _locations.Add(guardPost);
            _locations.Add(alchemistHut);
            _locations.Add(alchemistsGarden);
            _locations.Add(farmhouse);
            _locations.Add(farmersField);
            _locations.Add(bridge);
            _locations.Add(spiderField);
        }
Esempio n. 3
0
        private static void PopulateLocations()
        {
            // Create each location
            var home = new Location(LOCATION_ID_HOME, "Дом", "Ваш дом. Вы сожалеете, что снова оказались здесь.");

            var shepherdsHouse = new Location(LOCATION_ID_SHEPHERDS_HOUSE, "Лачуга пастуха",
                                              "Вы видите пастуха. У него беспокойный вид.");

            shepherdsHouse.QuestsAvailableHere.Add(QuestByID(QUEST_ID_BRING_A_SHOVEL));
            shepherdsHouse.QuestsAvailableHere.Add(QuestByID(QUEST_ID_HELP_WITH_SNAKES));

            var skiff = new Location(LOCATION_ID_SKIFF, "Предлесок",
                                     "Пугающий вой пронизывает вас насквозь. Кровь застывает в жилах. Вы чувствуете, что вы попали в окружение волков.");

            skiff.AddMonster(MONSTER_ID_WOLF, 85);
            skiff.AddMonster(MONSTER_ID_BEAR, 15);

            var forestersHut = new Location(LOCATION_ID_FORESTERS_HUT, "Хата лесника",
                                            "Вы видите необычного лесника. У вас складывается ощущение, что он сыграет важную роль в вашем приключении.");

            forestersHut.QuestsAvailableHere.Add(QuestByID(QUEST_ID_PURGE_THE_WOLVES));
            forestersHut.QuestsAvailableHere.Add(QuestByID(QUEST_ID_PURGE_THE_BEARS));
            forestersHut.QuestsAvailableHere.Add(QuestByID(QUEST_ID_PURGE_THE_DANGER_OF_THE_ANCIENT_FOREST));

            var village = new Location(LOCATION_ID_VILLAGE, "Деревня",
                                       "Вы приходите в деревню. Лица жители максимально отстранены. Кажется вам есть чем тут заняться.");

            village.QuestsAvailableHere.Add(QuestByID(QUEST_ID_HELP_SHEPHERD_WITH_SNAKES));

            var field = new Location(LOCATION_ID_FIELD, "Поле",
                                     "Вы пришли на заросшее поле, похоже этот год тоже будет голодным...");

            var forest = new Location(LOCATION_ID_FOREST, "Лес",
                                      "По мере вашего приближения количество окружающих Вас ягод и пчелиных ульев увеличивалось. Вы уже поняли кого вы здесь встретите.");

            forest.AddMonster(MONSTER_ID_WOLF, 10);
            forest.AddMonster(MONSTER_ID_BEAR, 85);
            forest.AddMonster(MONSTER_ID_TRENT, 5);

            var ancientForest = new Location(LOCATION_ID_ANCIENT_FOREST, "Древний лес",
                                             "Вы входите в глубокий лес, деревья здесь совершенно необычайной формы. Похоже, что именно здесь и началось заражение леса. Пора остановить порчу.");

            ancientForest.AddMonster(MONSTER_ID_WOLF, 5);
            ancientForest.AddMonster(MONSTER_ID_BEAR, 10);
            ancientForest.AddMonster(MONSTER_ID_TRENT, 85);

            var roadToTheCity = new Location(LOCATION_ID_ROAD_TO_THE_CITY, "Дорога в город",
                                             "Сельские стражники согласны пускать селян в город только по письменному заверению старосты.");

            var swarmOfPoisonousSnakes = new Location(LOCATION_ID_SWARM_OF_POISONOUS_SNAKES,
                                                      "Рой ядовитых змей", "Шипение множествав змей застилает ужасом ваш разум.");

            swarmOfPoisonousSnakes.AddMonster(MONSTER_ID_SNAKE, 95);
            swarmOfPoisonousSnakes.AddMonster(MONSTER_ID_GIANT_SNAKE, 5);

            var scaryCave = new Location(LOCATION_ID_SCARY_CAVE, "Страшная пещера",
                                         "Вы чувствуете, что что-то смотрит на Вас.\"Движение - смерть\" - слышите Вы в своей голове");

            scaryCave.AddMonster(MONSTER_ID_SNAKE, 30);
            scaryCave.AddMonster(MONSTER_ID_GIANT_SNAKE, 70);

            var hydrasLair = new Location(LOCATION_ID_HYDRAS_LAIR, "Логово гидры",
                                          "Отсюда можно выйти либо победителем, либо фаршем.");

            hydrasLair.AddMonster(MONSTER_ID_HYDRA, 90);
            hydrasLair.AddMonster(MONSTER_ID_GIANT_SNAKE, 10);

            var outskirts = new Location(LOCATION_ID_OUTSKIRTS, "Окраины города",
                                         "Бедное население бродит вдоль улочек. Незнакомцы поздываю к себе.", ItemByID(ITEM_ID_HEADMAN_PERMISSION_PASS));

            outskirts.AddMonster(MONSTER_ID_ROUGE, 75);
            outskirts.AddMonster(MONSTER_ID_ROUGE_LEADER, 25);

            var prison = new Location(LOCATION_ID_PRISON, "Тюрьма",
                                      "Вы проходите в тюрьму. Здесь стоит всего несколько стражников на бесконечные залы клеток с заключёнными. Похоже здесь действительно безопасно гулять.");

            prison.QuestsAvailableHere.Add(QuestByID(QUEST_ID_SEARCH_FOR_A_BEST_FRIEND));

            var sewage = new Location(LOCATION_ID_SEWAGE, "Канализационные стоки", "Миф Голливуда стоит перед вами.", ItemByID(ITEM_ID_SEWAGE_KEY));

            sewage.AddMonster(MONSTER_ID_CROCODILE, 100);

            var trollCave = new Location(LOCATION_ID_TROLL_CAVE, "Пещера троллей",
                                         "Куча разбросанных ботинок привела вас в пещеру трёх троллей. Их зовут ОГГ, ПОГГ И РОГГ.");

            trollCave.AddMonster(MONSTER_ID_TROLL, 100);

            var townSquare = new Location(LOCATION_ID_TOWN_SQUARE, "Городская площадь",
                                          "На площади достаточно людно. Сложно представить почему центр настолько разительно отличается от закоулок, в которых Вы недавно были.");

            var gate = new Location(LOCATION_ID_GATE, "Ворота",
                                    "Похоже здесь стоит почти вся стража города. Стражники отчётливо дают вам понять, что для того чтобы пройти дальше, вам нужно личное разрешение Короля Давида Сказачного.");

            var hordeOfZombies = new Location(LOCATION_ID_HORDE_OF_ZOMBIES, "Орда зомби",
                                              "Похоже, что всё былое население мира предстало здесь перед вами в виде оживших мертвецов, пройти куда-то дальше получится только смекалкой.");

            hordeOfZombies.AddMonster(MONSTER_ID_ZOMBIE, 100);

            var graveyardOfBones = new Location(LOCATION_ID_GRAVEYARD_OF_BONES, "Кладбище костей",
                                                "Вам в детстве говорили, что живых драконов не бывает. Это оказалось правдой лишь отчасти. Находящийся здесь дракон жив, хотя и состоит лишь из костей. Вам очень повезло, что мимо него можно тихо пройти.");

            graveyardOfBones.AddMonster(MONSTER_ID_BONE_DRAGON, 100);

            var kingsPalace = new Location(LOCATION_ID_KINGS_PALACE, "Дворец короля",
                                           "Двроец Давида Сказачного. Смотря на него Вам становится не по себе.");

            kingsPalace.QuestsAvailableHere.Add(QuestByID(QUEST_ID_REMOVE_THE_CURSE_FROM_THE_KING));
            kingsPalace.QuestsAvailableHere.Add(QuestByID(QUEST_ID_BRING_BACK_THE_HOLY_CORE));
            kingsPalace.QuestsAvailableHere.Add(QuestByID(QUEST_ID_PUNISH_THE_TROLLS));
            kingsPalace.QuestsAvailableHere.Add(QuestByID(QUEST_ID_DISASSEMBLE_THE_DRAGON_ON_THE_BONES));
            kingsPalace.QuestsAvailableHere.Add(QuestByID(QUEST_ID_FINISH_THIS_STORY));
            kingsPalace.QuestsAvailableHere.Add(QuestByID(QUEST_ID_TAKE_YOUR_DESTINY));

            var familyCrypt = new Location(LOCATION_ID_FAMILY_CRYPT, "Семейный склеп",
                                           "Семейный склеп Давида Сказачного. Пора успокоить взбунтовавшихся призраков.");

            familyCrypt.AddMonster(MONSTER_ID_GHOST, 100);

            var moundOfDeath = new Location(LOCATION_ID_MOUND_OF_DEATH, "Курган смерти",
                                            "Пора остановить производство зомби. Проблему с существующими это хоть и не решит, но новым лучше всё-таки не появляться.", ItemByID(ITEM_ID_QUINTESSENCE_OF_PURITY));

            moundOfDeath.AddMonster(MONSTER_ID_ZOMBIE, 75);
            moundOfDeath.AddMonster(MONSTER_ID_FLESH_GATHERER, 25);

            var scaryNecromancerCastle = new Location(LOCATION_ID_SCARY_NECROMANCER_CASTLE, "Замок страшного некроманта",
                                                      "Все Ваши десткие и студенческие страхи воплотились перед Вами. \n ПОБЕДА ИЛИ СМЕРТЬ! \n ЛОК'ТАР ОГАР, ДРУГ!");

            scaryNecromancerCastle.AddMonster(MONSTER_ID_NECROMANCER, 100);

            // Vendors, working in locations
            var bigBob = new Vendor("Большой Боб");

            bigBob.AddItemToInventory(ItemByID(ITEM_ID_SHOVEL), 5);
            bigBob.AddItemToInventory(ItemByID(ITEM_ID_SIMPLE_HEALING_POTION), 50);
            bigBob.AddItemToInventory(ItemByID(ITEM_ID_HEALING_POTION), 10);
            village.VendorWorkingHere = bigBob;

            var traderJim = new Vendor("Торговец Джим");

            traderJim.AddItemToInventory(ItemByID(ITEM_ID_HEALING_POTION), 5);
            traderJim.AddItemToInventory(ItemByID(ITEM_ID_BIG_HEALING_POTION), 50);
            traderJim.AddItemToInventory(ItemByID(ITEM_ID_GREAT_HEALING_POTION), 10);
            traderJim.AddItemToInventory(ItemByID(ITEM_ID_POISON_DAGGER), 10);
            traderJim.AddItemToInventory(ItemByID(ITEM_ID_POTION_OF_ETERNAL_LIFE), 10);
            townSquare.VendorWorkingHere = traderJim;


            // Link the locations together
            home.LocationToSouth = shepherdsHouse;
            home.LocationToEast  = village;

            shepherdsHouse.LocationToNorth = home;
            shepherdsHouse.LocationToEast  = field;
            shepherdsHouse.LocationToSouth = skiff;

            skiff.LocationToNorth = shepherdsHouse;
            skiff.LocationToEast  = forest;
            skiff.LocationToSouth = forestersHut;

            forestersHut.LocationToNorth = skiff;

            village.LocationToWest  = home;
            village.LocationToEast  = roadToTheCity;
            village.LocationToSouth = field;

            field.LocationToNorth = village;
            field.LocationToEast  = swarmOfPoisonousSnakes;
            field.LocationToSouth = forest;
            field.LocationToWest  = shepherdsHouse;

            forest.LocationToNorth = field;
            forest.LocationToSouth = ancientForest;
            forest.LocationToWest  = skiff;

            ancientForest.LocationToNorth = forest;

            roadToTheCity.LocationToEast = outskirts;
            roadToTheCity.LocationToWest = village;

            swarmOfPoisonousSnakes.LocationToSouth = scaryCave;
            swarmOfPoisonousSnakes.LocationToWest  = field;

            scaryCave.LocationToNorth = swarmOfPoisonousSnakes;
            scaryCave.LocationToSouth = hydrasLair;

            hydrasLair.LocationToNorth = scaryCave;

            outskirts.LocationToEast  = townSquare;
            outskirts.LocationToSouth = prison;
            outskirts.LocationToWest  = roadToTheCity;

            prison.LocationToNorth = outskirts;
            prison.LocationToSouth = sewage;

            sewage.LocationToNorth = prison;

            trollCave.LocationToEast = graveyardOfBones;

            townSquare.LocationToEast  = kingsPalace;
            townSquare.LocationToSouth = gate;
            townSquare.LocationToWest  = outskirts;

            gate.LocationToNorth = townSquare;
            gate.LocationToSouth = hordeOfZombies;

            hordeOfZombies.LocationToNorth = gate;
            hordeOfZombies.LocationToEast  = moundOfDeath;
            hordeOfZombies.LocationToSouth = graveyardOfBones;

            graveyardOfBones.LocationToNorth = hordeOfZombies;
            graveyardOfBones.LocationToEast  = scaryNecromancerCastle;
            graveyardOfBones.LocationToWest  = trollCave;

            kingsPalace.LocationToSouth = familyCrypt;
            kingsPalace.LocationToWest  = townSquare;

            familyCrypt.LocationToNorth = kingsPalace;

            moundOfDeath.LocationToWest = hordeOfZombies;

            scaryNecromancerCastle.LocationToWest = graveyardOfBones;

            // Add the locations to the static list
            _locations.Add(home);
            _locations.Add(shepherdsHouse);
            _locations.Add(skiff);
            _locations.Add(forestersHut);
            _locations.Add(village);
            _locations.Add(field);
            _locations.Add(forest);
            _locations.Add(ancientForest);
            _locations.Add(roadToTheCity);
            _locations.Add(swarmOfPoisonousSnakes);
            _locations.Add(scaryCave);
            _locations.Add(hydrasLair);
            _locations.Add(outskirts);
            _locations.Add(prison);
            _locations.Add(sewage);
            _locations.Add(trollCave);
            _locations.Add(townSquare);
            _locations.Add(gate);
            _locations.Add(hordeOfZombies);
            _locations.Add(graveyardOfBones);
            _locations.Add(kingsPalace);
            _locations.Add(familyCrypt);
            _locations.Add(moundOfDeath);
            _locations.Add(scaryNecromancerCastle);
        }
Esempio n. 4
0
        public bool LoadWorld()
        {
            try
            {
                XmlDocument worldData = new XmlDocument();

                worldData.LoadXml(this._xmlWorld);

                RaiseMessage(MessageTypes.LoadingItems);
                #region Populate Items
                _items = new List <Item>();
                foreach (XmlNode node in worldData.SelectNodes("/World/items/item"))
                {
                    int    Id         = Convert.ToInt32(node.SelectSingleNode("Id").InnerText);
                    string Name       = node.SelectSingleNode("Name").InnerText;
                    string NamePlural = node.SelectSingleNode("NamePlural").InnerText;
                    int    Price      = Convert.ToInt32(node.SelectSingleNode("Price").InnerText);

                    _items.Add(new Item(Id, Name, NamePlural, Price));
                }
                #endregion

                #region Populate Weapons
                foreach (XmlNode node in worldData.SelectNodes("/World/items/weapon"))
                {
                    int    Id            = Convert.ToInt32(node.SelectSingleNode("Id").InnerText);
                    string Name          = node.SelectSingleNode("Name").InnerText;
                    string NamePlural    = node.SelectSingleNode("NamePlural").InnerText;
                    int    Price         = Convert.ToInt32(node.SelectSingleNode("Price").InnerText);
                    int    MinimumDamage = Convert.ToInt32(node.SelectSingleNode("MinimumDamage").InnerText);
                    int    MaximumDamage = Convert.ToInt32(node.SelectSingleNode("MaximumDamage").InnerText);

                    _items.Add(new Weapon(Id, Name, NamePlural, MinimumDamage, MaximumDamage, Price));
                }
                #endregion

                #region Populate Healing Potions
                foreach (XmlNode node in worldData.SelectNodes("/World/items/healingPotion"))
                {
                    int    Id           = Convert.ToInt32(node.SelectSingleNode("Id").InnerText);
                    string Name         = node.SelectSingleNode("Name").InnerText;
                    string NamePlural   = node.SelectSingleNode("NamePlural").InnerText;
                    int    Price        = Convert.ToInt32(node.SelectSingleNode("Price").InnerText);
                    int    AmountToHeal = Convert.ToInt32(node.SelectSingleNode("AmountToHeal").InnerText);

                    _items.Add(new HealingPotion(Id, Name, NamePlural, AmountToHeal, Price));
                }
                #endregion

                RaiseMessage(MessageTypes.LoadingMonsters);
                #region Populate Monsters
                _monsters = new List <Monster>();
                foreach (XmlNode node in worldData.SelectNodes("/World/Monsters/Monster"))
                {
                    int    Id                     = Convert.ToInt32(node.SelectSingleNode("Id").InnerText);
                    string Name                   = node.SelectSingleNode("Name").InnerText;
                    int    MaximumDamage          = Convert.ToInt32(node.SelectSingleNode("MaximumDamage").InnerText);
                    int    RewardExperiencePoints = Convert.ToInt32(node.SelectSingleNode("RewardExperiencePoints").InnerText);
                    int    RewardGold             = Convert.ToInt32(node.SelectSingleNode("RewardGold").InnerText);
                    int    CurrentHitPoints       = Convert.ToInt32(node.SelectSingleNode("CurrentHitPoints").InnerText);
                    int    MaximumHitPoints       = Convert.ToInt32(node.SelectSingleNode("MaximumHitPoints").InnerText);

                    Monster monster = new Monster(Id, Name, MaximumDamage, RewardExperiencePoints, RewardGold, CurrentHitPoints, MaximumHitPoints);

                    foreach (XmlNode nodechild in node.SelectNodes("LootTable/LootItem"))
                    {
                        int  IdItem         = Convert.ToInt32(nodechild.SelectSingleNode("IdItem").InnerText);
                        int  DropPercentage = Convert.ToInt32(nodechild.SelectSingleNode("DropPercentage").InnerText);
                        bool IsDefaultItem  = Convert.ToBoolean(nodechild.SelectSingleNode("IsDefaultItem").InnerText);

                        monster.LootTable.Add(new LootItem(ItemByID(IdItem), DropPercentage, IsDefaultItem));
                    }

                    _monsters.Add(monster);
                }
                #endregion

                RaiseMessage(MessageTypes.LoadingQuests);
                #region Populate Quests
                _quests = new List <Quest>();
                foreach (XmlNode node in worldData.SelectNodes("/World/Quests/Quest"))
                {
                    int    Id                     = Convert.ToInt32(node.SelectSingleNode("Id").InnerText);
                    string Name                   = node.SelectSingleNode("Name").InnerText;
                    string Description            = node.SelectSingleNode("Description").InnerText;
                    int    RewardExperiencePoints = Convert.ToInt32(node.SelectSingleNode("RewardExperiencePoints").InnerText);
                    int    RewardGold             = Convert.ToInt32(node.SelectSingleNode("RewardGold").InnerText);

                    Quest quest = new Quest(Id, Name, Description, RewardExperiencePoints, RewardGold);

                    foreach (XmlNode nodechild in node.SelectNodes("QuestCompletionItems/QuestCompletionItem"))
                    {
                        int IdItem   = Convert.ToInt32(nodechild.SelectSingleNode("IdItem").InnerText);
                        int Quantity = Convert.ToInt32(nodechild.SelectSingleNode("Quantity").InnerText);

                        quest.QuestCompletionItems.Add(new QuestCompletionItem(ItemByID(IdItem), Quantity));
                    }



                    int RewardItemId = Convert.ToInt32(node.SelectSingleNode("RewardItem/IdItem").InnerText);

                    quest.RewardItem = ItemByID(RewardItemId);

                    _quests.Add(quest);
                }
                #endregion

                RaiseMessage(MessageTypes.LoadingVendors);
                #region Populate Vendors
                _vendors = new List <Vendor>();
                foreach (XmlNode node in worldData.SelectNodes("/World/Vendors/Vendor"))
                {
                    int    Id   = Convert.ToInt32(node.SelectSingleNode("Id").InnerText);
                    string Name = node.SelectSingleNode("Name").InnerText;

                    Vendor vendor = new Vendor(Id, Name);

                    foreach (XmlNode nodechild in node.SelectNodes("Inventory/Item"))
                    {
                        int IdItem   = Convert.ToInt32(nodechild.SelectSingleNode("IdItem").InnerText);
                        int Quantity = Convert.ToInt32(nodechild.SelectSingleNode("Quantity").InnerText);

                        vendor.AddItemToInventory(ItemByID(IdItem), Quantity);
                    }

                    _vendors.Add(vendor);
                }
                #endregion

                RaiseMessage(MessageTypes.LoadingLocations);
                #region Populate Locations
                _locations = new List <Location>();
                foreach (XmlNode node in worldData.SelectNodes("/World/Locations/Location"))
                {
                    int    Id          = Convert.ToInt32(node.SelectSingleNode("Id").InnerText);
                    string Name        = node.SelectSingleNode("Name").InnerText;
                    string Description = node.SelectSingleNode("Description").InnerText;

                    Location location = new Location(Id, Name, Description);

                    if (node.SelectSingleNode("Picture") != null)
                    {
                        string Picture = node.SelectSingleNode("Picture").InnerText;
                        location.Picture = Picture;
                    }



                    if (node.SelectSingleNode("ItemRequiredToEnter") != null)
                    {
                        location.ItemRequiredToEnter = ItemByID(Convert.ToInt32(node.SelectSingleNode("ItemRequiredToEnter").InnerText));
                    }

                    if (node.SelectSingleNode("QuestAvailableHere") != null)
                    {
                        location.QuestAvailableHere = QuestByID(Convert.ToInt32(node.SelectSingleNode("QuestAvailableHere").InnerText));
                    }

                    if (node.SelectSingleNode("VendorWorkingHere") != null)
                    {
                        location.VendorWorkingHere = VendorByID(Convert.ToInt32(node.SelectSingleNode("VendorWorkingHere").InnerText));
                    }

                    if (node.SelectSingleNode("Monsters") != null)
                    {
                        foreach (XmlNode nodechild in node.SelectNodes("Monsters/Monster"))
                        {
                            int IdMonster = Convert.ToInt32(nodechild.SelectSingleNode("IdMonster").InnerText);
                            int PercentageOfAppearance = Convert.ToInt32(nodechild.SelectSingleNode("PercentageOfAppearance").InnerText);

                            location.AddMonster(IdMonster, PercentageOfAppearance);
                        }
                    }

                    _locations.Add(location);
                }
                #endregion

                #region Populate Neighborhood
                foreach (XmlNode node in worldData.SelectNodes("/World/Neighborhood/Neighbor"))
                {
                    int      IdLocation = Convert.ToInt32(node.SelectSingleNode("IdLocation").InnerText);
                    Location location   = LocationByID(IdLocation);

                    if (node.SelectSingleNode("North") != null)
                    {
                        location.LocationToNorth = LocationByID(Convert.ToInt32(node.SelectSingleNode("North").InnerText));
                    }

                    if (node.SelectSingleNode("South") != null)
                    {
                        location.LocationToSouth = LocationByID(Convert.ToInt32(node.SelectSingleNode("South").InnerText));
                    }

                    if (node.SelectSingleNode("East") != null)
                    {
                        location.LocationToEast = LocationByID(Convert.ToInt32(node.SelectSingleNode("East").InnerText));
                    }

                    if (node.SelectSingleNode("West") != null)
                    {
                        location.LocationToWest = LocationByID(Convert.ToInt32(node.SelectSingleNode("West").InnerText));
                    }
                }

                #endregion

                return(true);
            }
            catch (Exception ex)
            {
                //throw new Exception("Error mientras se estaba " + pasos, ex);
                return(false);
            }
        }
Esempio n. 5
0
        private static void PopulateLocations()
        {
            // Create each location
            Location home = new Location(LOCATION_ID_HOME, "Home", "Your house. You really need to clean up the place.");

            Location townSquare = new Location(LOCATION_ID_TOWN_SQUARE, "Town square", "You see a fountain.");

            Vendor bobTheRatCatcher = new Vendor("Bob the Rat-Catcher");

            bobTheRatCatcher.AddItemToInventory(ItemByID(ITEM_ID_PIECE_OF_FUR), 5);
            bobTheRatCatcher.AddItemToInventory(ItemByID(ITEM_ID_RAT_TAIL), 3);

            townSquare.VendorWorkingHere = bobTheRatCatcher;

            Location alchemistHut = new Location(LOCATION_ID_ALCHEMIST_HUT, "Alchemist's hut", "There are many strange plants on the shelves.");

            alchemistHut.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_ALCHEMIST_GARDEN);

            Vendor igorTheAlchemist = new Vendor("Igor the Alchemist");

            igorTheAlchemist.AddItemToInventory(ItemByID(ITEM_ID_HEALING_POTION), 999);
            igorTheAlchemist.AddItemToInventory(ItemByID(ITEM_ID_SUPER_HEALING_POTION), 999);
            igorTheAlchemist.AddItemToInventory(ItemByID(ITEM_ID_MAX_HEALING_POTION), 999);

            alchemistHut.VendorWorkingHere = igorTheAlchemist;

            Location alchemistsGarden = new Location(LOCATION_ID_ALCHEMISTS_GARDEN, "Alchemist's garden", "Many plants are growing here.");

            alchemistsGarden.MonsterLivingHere = MonsterByID(MONSTER_ID_RAT);

            Location farmhouse = new Location(LOCATION_ID_FARMHOUSE, "Farmhouse", "There is a small farmhouse, with a farmer in front.");

            farmhouse.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_FARMERS_FIELD);

            Location farmersField = new Location(LOCATION_ID_FARM_FIELD, "Farmer's field", "You see rows of vegetables growing here.");

            farmersField.MonsterLivingHere = MonsterByID(MONSTER_ID_SNAKE);

            Location guardPost = new Location(LOCATION_ID_GUARD_POST, "Guard post", "There is a large, tough-looking guard here.", ItemByID(ITEM_ID_ADVENTURER_PASS));

            Location bridge = new Location(LOCATION_ID_BRIDGE, "Bridge", "A stone bridge crosses a wide river.");

            Location spiderField = new Location(LOCATION_ID_SPIDER_FIELD, "Forest", "You see spider webs covering covering the trees in this forest.");

            spiderField.MonsterLivingHere = MonsterByID(MONSTER_ID_GIANT_SPIDER);

            Location campsite = new Location(LOCATION_ID_CAMPSITE, "Campsite", "There are some rough looking mercenaries here.");

            campsite.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_CAMPSITE_DANGER);

            Vendor krokovTheMercenary = new Vendor("Krokov the Mercenary");

            krokovTheMercenary.AddItemToInventory(ItemByID(ITEM_ID_SUPER_HEALING_POTION), 999);
            krokovTheMercenary.AddItemToInventory(ItemByID(ITEM_ID_RUNITE_SWORD), 1);

            campsite.VendorWorkingHere = krokovTheMercenary;

            Location graveyard = new Location(LOCATION_ID_GRAVEYARD, "Graveyard", "You see many Ghosts here.");

            graveyard.MonsterLivingHere = MonsterByID(MONSTER_ID_GHOST);

            Location ruins = new Location(LOCATION_ID_RUINS, "Ruins", "Spooky, there seems to be nothing here... BANSHEE!!!");

            ruins.MonsterLivingHere = MonsterByID(MONSTER_ID_BANSHEE);

            Location castleRuins = new Location(LOCATION_ID_CASTLE_RUINS, "Caslte Ruins", "Looks like a typical horror castle, wait a minute... is that a Vampire?");

            castleRuins.MonsterLivingHere = MonsterByID(MONSTER_ID_DRACULA);

            Location largeField = new Location(LOCATION_ID_LARGE_FIELD, "Large Field", "So beautiful, so much green... also some green snakes.");

            largeField.MonsterLivingHere = MonsterByID(MONSTER_ID_SNAKE);

            Location capitalOfOzangura = new Location(LOCATION_ID_CAPITAL_OF_OZANGURA_ENTRANCE, "Capital of Ozangura Entrance", "Such a huge city and so shiny... the gate isn't exactly small either.", ItemByID(ITEM_ID_DRACULAS_HEAD));

            Location centerOfCapital = new Location(LOCATION_ID_CENTRAL_OF_THE_CAPITAL, "Capital Central", "So much to see in this large city.");

            Location shoppingDistrict = new Location(LOCATION_ID_SHOPPING_DISTRICT, "Shopping District", "I wonder what kinds of shops there are here.");

            Vendor shadyCharacter = new Vendor("Shady Character");

            shadyCharacter.AddItemToInventory(ItemByID(ITEM_ID_SUPER_HEALING_POTION), 999);
            shadyCharacter.AddItemToInventory(ItemByID(ITEM_ID_MAX_HEALING_POTION), 999);
            shadyCharacter.AddItemToInventory(ItemByID(ITEM_ID_UNIVERSE_CONQUEROR), 1);
            shadyCharacter.AddItemToInventory(ItemByID(ITEM_ID_THORS_HAMMER), 1);

            shoppingDistrict.VendorWorkingHere = shadyCharacter;

            Location livingDistrict = new Location(LOCATION_ID_LIVING_DISTRICT, "Living District", "So many huge houses, maybe one day, I can buy one myself.");

            Location churchDistrict = new Location(LOCATION_ID_CHURCH_DISTRICT, "Church District", "The only god we should count on is Thor.");

            Location mainCastle = new Location(LOCATION_ID_CATLE_OF_THE_CAPITAL, "Castle of the Capital", "There is a huge statue of Thor here, I like that.");

            mainCastle.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_GOBLIN_ATTACK_ON_THE_CAPITAL);

            Location backGatesOfCapital = new Location(LOCATION_ID_BACK_GATE_OF_THE_CAPITAL, "Back Gates of the Capital", "Another huge set of gates, that lead to a very dark and evil place.");

            Location goblinWoods = new Location(LOCATION_ID_GOBLIN_WOODS, "Goblin Woods", "I feel something very evil lurking in these woods.");

            goblinWoods.MonsterLivingHere = MonsterByID(MONSTER_ID_GOBLIN);

            Location goblinCave = new Location(LOCATION_ID_GOBLIN_CAVE, "Goblin Caves", "That was a nasty monster, but now there is a whole group of them!");

            goblinCave.MonsterLivingHere = MonsterByID(MONSTER_ID_GOBLIN_HORD);

            Location goblinCaveDiningHall = new Location(LOCATION_ID_GOBLIN_CAVE_DINING_HALL, "Goblin Cave Dining Hall", "That was the toughest fight yet! That goblin looks pretty scarry, I wonder if he'll share his food with me.");

            goblinCaveDiningHall.MonsterLivingHere = MonsterByID(MONSTER_ID_GOBLIN_WARCHIEF);

            Location goblinCaveMainQuarters = new Location(LOCATION_ID_GOBLIN_CAVE_MAIN_QUARTERS, "Goblin Cave Main Quarters", "WOW, that goblin was about as tough as the whole hord that attacked me... well not time to sleep yet, there is another mean looking goblin in front of me...");

            goblinCaveMainQuarters.MonsterLivingHere = MonsterByID(MONSTER_ID_GOBLIN_BOSS);

            Location goblinCaveExit = new Location(LOCATION_ID_GOBLIN_CAVE_EXIT, "Goblin Cave Exit", "I'm happy I slept after that fight... is that light? Finally an exit! Nevermind there is a huge... wait no GIGANTIC goblin in front of me.");

            goblinCaveExit.MonsterLivingHere = MonsterByID(MONSTER_ID_GIANT_GOBLIN);

            // Link the locations together
            home.LocationToNorth = townSquare;

            townSquare.LocationToNorth = alchemistHut;
            townSquare.LocationToSouth = home;
            townSquare.LocationToEast  = guardPost;
            townSquare.LocationToWest  = farmhouse;

            farmhouse.LocationToEast = townSquare;
            farmhouse.LocationToWest = farmersField;

            farmersField.LocationToEast = farmhouse;

            alchemistHut.LocationToSouth = townSquare;
            alchemistHut.LocationToNorth = alchemistsGarden;

            alchemistsGarden.LocationToSouth = alchemistHut;

            guardPost.LocationToEast = bridge;
            guardPost.LocationToWest = townSquare;

            bridge.LocationToWest = guardPost;
            bridge.LocationToEast = spiderField;

            spiderField.LocationToWest  = bridge;
            spiderField.LocationToNorth = campsite;

            campsite.LocationToNorth = graveyard;
            campsite.LocationToEast  = largeField;
            campsite.LocationToSouth = spiderField;

            graveyard.LocationToNorth = ruins;
            graveyard.LocationToSouth = campsite;

            ruins.LocationToNorth = castleRuins;
            ruins.LocationToSouth = graveyard;

            castleRuins.LocationToSouth = ruins;

            largeField.LocationToEast = capitalOfOzangura;
            largeField.LocationToWest = campsite;

            capitalOfOzangura.LocationToEast = centerOfCapital;
            capitalOfOzangura.LocationToWest = largeField;

            centerOfCapital.LocationToNorth = churchDistrict;
            centerOfCapital.LocationToEast  = livingDistrict;
            centerOfCapital.LocationToWest  = capitalOfOzangura;
            centerOfCapital.LocationToSouth = shoppingDistrict;

            livingDistrict.LocationToWest = centerOfCapital;

            shoppingDistrict.LocationToNorth = centerOfCapital;

            churchDistrict.LocationToSouth = centerOfCapital;
            churchDistrict.LocationToNorth = mainCastle;

            mainCastle.LocationToSouth = churchDistrict;
            mainCastle.LocationToNorth = backGatesOfCapital;

            backGatesOfCapital.LocationToSouth = mainCastle;
            backGatesOfCapital.LocationToEast  = goblinWoods;

            goblinWoods.LocationToWest  = backGatesOfCapital;
            goblinWoods.LocationToNorth = goblinCave;

            goblinCave.LocationToSouth = goblinWoods;
            goblinCave.LocationToNorth = goblinCaveDiningHall;

            goblinCaveDiningHall.LocationToSouth = goblinCave;
            goblinCaveDiningHall.LocationToNorth = goblinCaveMainQuarters;

            goblinCaveMainQuarters.LocationToSouth = goblinCaveDiningHall;
            goblinCaveMainQuarters.LocationToNorth = goblinCaveExit;

            goblinCaveExit.LocationToSouth = goblinCaveMainQuarters;

            // Add the locations to the static list
            Locations.Add(home);
            Locations.Add(townSquare);
            Locations.Add(guardPost);
            Locations.Add(alchemistHut);
            Locations.Add(alchemistsGarden);
            Locations.Add(farmhouse);
            Locations.Add(farmersField);
            Locations.Add(bridge);
            Locations.Add(spiderField);
            Locations.Add(campsite);
            Locations.Add(graveyard);
            Locations.Add(ruins);
            Locations.Add(castleRuins);
            Locations.Add(largeField);
            Locations.Add(capitalOfOzangura);
            Locations.Add(centerOfCapital);
            Locations.Add(shoppingDistrict);
            Locations.Add(livingDistrict);
            Locations.Add(churchDistrict);
            Locations.Add(mainCastle);
            Locations.Add(backGatesOfCapital);
            Locations.Add(goblinWoods);
            Locations.Add(goblinCave);
            Locations.Add(goblinCaveDiningHall);
            Locations.Add(goblinCaveMainQuarters);
            Locations.Add(goblinCaveExit);
        }
Esempio n. 6
0
        private static void PopulateLocations()
        {
            // Create each location
            Location home = new Location(LOCATION_ID_HOME, "Home", "Your eyes shoot open as mutter to yourself.... Damn that was strange.....");

            Location pathToTown = new Location(LOCATION_ID_PATH_TO_TOWN, "Path to town", "You step out of your door and see the path heading north toward town");

            Location townSquare = new Location(LOCATION_ID_TOWN_SQUARE, "Town square", "Circling the fountian as you enter, you see paths leading in all directions.");

            Location alchemistHut = new Location(LOCATION_ID_ALCHEMIST_HUT, "Alchemist's hut", "There are many strange plants on the shelves.");

            alchemistHut.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_ALCHEMIST_GARDEN);

            Location alchemistsGarden = new Location(LOCATION_ID_ALCHEMISTS_GARDEN, "Alchemist's garden", "Many plants are growing here.");

            alchemistsGarden.AddMonster(MONSTER_ID_RAT, 80);
            alchemistsGarden.AddMonster(MONSTER_ID_SNAKE, 20);

            Location farmhouse = new Location(LOCATION_ID_FARMHOUSE, "Farmhouse", "There is a small farmhouse, with a farmer in front.");

            farmhouse.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_FARMERS_FIELD);

            Location farmersField = new Location(LOCATION_ID_FARM_FIELD, "Farmer's field", "You see rows of vegetables growing here.");

            farmersField.AddMonster(MONSTER_ID_SNAKE, 100);

            Location guardPost = new Location(LOCATION_ID_GUARD_POST, "Guard post", "There is a large, tough-looking guard here.", ItemByID(ITEM_ID_ADVENTURER_PASS));

            Location bridge = new Location(LOCATION_ID_BRIDGE, "Bridge", "A stone bridge crosses a wide river.");

            Location spiderField = new Location(LOCATION_ID_SPIDER_FIELD, "Forest", "You see spider webs covering covering the trees in this forest.");

            spiderField.AddMonster(MONSTER_ID_GIANT_SPIDER, 100);

            Vendor townMerchant = new Vendor("Alwyin: General Goods");

            townMerchant.AddItemToInventory(ItemByID(ITEM_ID_PIECE_OF_FUR), 5);
            townMerchant.AddItemToInventory(ItemByID(ITEM_ID_RAT_TAIL), 3);
            townMerchant.AddItemToInventory(ItemByID(ITEM_ID_SPIDER_KILLER), 1);

            townSquare.VendorWorkingHere = townMerchant;

            // Link the locations together
            home.LocationToNorth = pathToTown;

            pathToTown.LocationToNorth = townSquare;
            pathToTown.LocationToSouth = home;

            townSquare.LocationToNorth = alchemistHut;
            townSquare.LocationToSouth = pathToTown;
            townSquare.LocationToEast  = guardPost;
            townSquare.LocationToWest  = farmhouse;

            farmhouse.LocationToEast = townSquare;
            farmhouse.LocationToWest = farmersField;

            farmersField.LocationToEast = farmhouse;

            alchemistHut.LocationToSouth = townSquare;
            alchemistHut.LocationToNorth = alchemistsGarden;

            alchemistsGarden.LocationToSouth = alchemistHut;

            guardPost.LocationToEast = bridge;
            guardPost.LocationToWest = townSquare;

            bridge.LocationToWest = guardPost;
            bridge.LocationToEast = spiderField;

            spiderField.LocationToWest = bridge;

            // Add the locations to the static list
            _locations.Add(home);
            _locations.Add(pathToTown);
            _locations.Add(townSquare);
            _locations.Add(guardPost);
            _locations.Add(alchemistHut);
            _locations.Add(alchemistsGarden);
            _locations.Add(farmhouse);
            _locations.Add(farmersField);
            _locations.Add(bridge);
            _locations.Add(spiderField);
        }
Esempio n. 7
0
        private static void PopulateLocations()
        {
            // Create each location
            Location campsite = new Location(LOCATION_ID_CAMPSITE, "Campsite",
                                             "The Nayb campsite. A place of magical happenings and 'bro time'. You can go SOUTH to get to the MAIN ROAD");

            Location mainRoad = new Location(LOCATION_ID_MAIN_ROAD,
                                             "Main road", "The main road. Go WEST to get to the DAM; EAST to get to the CREEK LET IN; or SOUTH to go to the LONG ROAD.");

            Location dam = new Location(LOCATION_ID_DAM,
                                        "Earthy Dam", "You can see the old camping spot at the end of the dam.  To the NORTH is the LAKE; To EAST is the MAIN ROAD.");

            Location lake = new Location(LOCATION_ID_LAKE,
                                         "Lake", "Big ol' concrete thing in it. Great for jumping off. You see some CANOES for the taking. Go back SOUTH for the DAM.", ItemByID(ITEM_ID_CANOE));

            lake.MonsterLivingHere = MonsterByID(MONSTER_ID_FISH);

            Location openField = new Location(LOCATION_ID_OPEN_FIELD, "Open Field", "Big open field in between two hills. Full of varment. NORTH will take you back to the DAM.");

            openField.MonsterLivingHere = MonsterByID(MONSTER_ID_RACCOON);

            Location creekLetIn = new Location(LOCATION_ID_CREEK_LET_IN,
                                               "Creek Let-In", "Access to the creek is here. EAST is the MAIN ROAD. Go NORTH to get into the creek (need a canoe).");

            creekLetIn.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_OPEN_FIELD);

            Location neCreek = new Location(LOCATION_ID_NE_CREEK,
                                            "Northeast Creek", "Finally on the creek.  Watch for snakes! Go through the rapids to the WEST to get to the NORTH CREEK. Go SOUTH to exit the creek to the CREEK LET-IN.",
                                            ItemByID(ITEM_ID_CANOE));

            neCreek.MonsterLivingHere = MonsterByID(MONSTER_ID_SNAKE);

            Location northCreek = new Location(LOCATION_ID_NORTH_CREEK,
                                               "North Creek", "A relaxing ride down a wide part of the creek. Go SOUTH to get back to the CAMPSITE. A hard paddle back EAST will get you to the NE CREEK.",
                                               ItemByID(ITEM_ID_CANOE));

            Location longRoad = new Location(LOCATION_ID_LONG_ROAD, "Long Road",
                                             "No telling what you will find at the end of this long road. Go back NORTH for the MAIN ROAD.");

            Location creepyBus = new Location(LOCATION_ID_CREEPY_BUS,
                                              "Creepy Bus", "You see a creepy bus off to the side of the road. As you approach you hear a noise within .. It's Charlie the Hobo! Here to sell you his goods. (Click the trade button down by the directional buttons)");

            creepyBus.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_CREEK);

            Vendor charlieTheHobo = new Vendor("Charlie the Hobo");

            charlieTheHobo.AddItemToInventory(ItemByID(ITEM_ID_PIECE_OF_FUR), 5);
            charlieTheHobo.AddItemToInventory(ItemByID(ITEM_ID_FISH_SCALE), 3);
            charlieTheHobo.AddItemToInventory(ItemByID(ITEM_ID_OXY), 1);
            charlieTheHobo.AddItemToInventory(ItemByID(ITEM_ID_HORSE_STIM), 1);

            creepyBus.VendorWorkingHere = charlieTheHobo;



            // Link the locations together
            campsite.LocationToSouth = mainRoad;
            campsite.LocationToNorth = northCreek;

            mainRoad.LocationToNorth = campsite;
            mainRoad.LocationToSouth = longRoad;
            mainRoad.LocationToEast  = creekLetIn;
            mainRoad.LocationToWest  = dam;

            dam.LocationToNorth = lake;
            dam.LocationToEast  = mainRoad;
            dam.LocationToSouth = openField;

            openField.LocationToNorth = dam;

            lake.LocationToSouth = dam;

            creekLetIn.LocationToNorth = neCreek;
            creekLetIn.LocationToWest  = mainRoad;

            neCreek.LocationToSouth = creekLetIn;
            neCreek.LocationToWest  = northCreek;

            northCreek.LocationToSouth = campsite;
            northCreek.LocationToEast  = neCreek;

            longRoad.LocationToNorth = mainRoad;
            longRoad.LocationToSouth = creepyBus;

            creepyBus.LocationToNorth = longRoad;

            // Add the locations to the static list
            Locations.Add(campsite);
            Locations.Add(mainRoad);
            Locations.Add(dam);
            Locations.Add(lake);
            Locations.Add(openField);
            Locations.Add(creepyBus);
            //Locations.Add(bigCable);
            Locations.Add(creekLetIn);
            Locations.Add(neCreek);
            Locations.Add(northCreek);
        }
Esempio n. 8
0
        private static void PopulateLocations()
        {
            // Create each location
            Location home = new Location(LOCATION_ID_HOME, "Facility", "A Cryo Facility. At least that is what it says on the wall in front of you as you stand up on the slippery wet floor. behind you is the broken pod where you used to be. You deside to go outside");

            Location townSquare = new Location(LOCATION_ID_TOWN_SQUARE, "Town square", "You see a small collection of huts and makeshift houses all surrounding a small, run down fountain. Off to the side you see a man in a long tunic trying to sell different things made of presumably rat fur, due to the small size and shape of the pelts attached to his belt.");

            Vendor bobTheRatCatcher = new Vendor("Rat-Catcher");

            bobTheRatCatcher.AddItemToInventory(ItemByID(ITEM_ID_PIECE_OF_FUR), 5);
            bobTheRatCatcher.AddItemToInventory(ItemByID(ITEM_ID_RAT_TAIL), 3);

            townSquare.VendorWorkingHere = bobTheRatCatcher;

            Location alchemistHut = new Location(LOCATION_ID_ALCHEMIST_HUT, "Alchemist's hut", "You see a medium sized wooden hut that looks a bit more comfortable than the other huts in town. Through the open door you see that there are many strange plants on the shelves.");

            alchemistHut.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_ALCHEMIST_GARDEN);

            Location alchemistsGarden = new Location(LOCATION_ID_ALCHEMISTS_GARDEN, "Alchemist's garden", "Past the Alchemist's hut you see a large field with many plants growing there.");

            alchemistsGarden.MonsterLivingHere = MonsterByID(MONSTER_ID_RAT);

            Location farmhouse = new Location(LOCATION_ID_FARMHOUSE, "Farmhouse", "There is a small farmhouse, shakily constructed, with a farmer in front looking visably shaken and distressed.");

            farmhouse.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_FARMERS_FIELD);

            Location farmersField = new Location(LOCATION_ID_FARM_FIELD, "Farmer's field", "Past the farm house you see a small field with rows of vegetables.");

            farmersField.MonsterLivingHere = MonsterByID(MONSTER_ID_SNAKE);

            Location guardPost = new Location(LOCATION_ID_GUARD_POST, "Guard post", "There is a large, tough-looking guard with a metalic sheen showing from under his loosely fitting robe. He blocks your path and tells you to hand him the Adventurer pass", ItemByID(ITEM_ID_ADVENTURER_PASS));

            Location bridge = new Location(LOCATION_ID_BRIDGE, "Bridge", "A stone bridge that is falling apart. It crosses a wide river with angry and sickly looking fish jumping out of the water.");

            Location strangeBuilding = new Location(LOCATION_ID_STRANGE_BUILDING, "Strange Building", "You see a strange building disturbingly white in its cleanliness, you want up to the doors as the slide open for you. As you step inside you see spider webs covering covering the walls before you hear a blood curtling screech.");

            strangeBuilding.MonsterLivingHere = MonsterByID(MONSTER_ID_AUGMENTED_SPIDER);

            // Link the locations together
            home.LocationToNorth = townSquare;

            townSquare.LocationToNorth = alchemistHut;
            townSquare.LocationToSouth = home;
            townSquare.LocationToEast  = guardPost;
            townSquare.LocationToWest  = farmhouse;

            farmhouse.LocationToEast = townSquare;
            farmhouse.LocationToWest = farmersField;

            farmersField.LocationToEast = farmhouse;

            alchemistHut.LocationToSouth = townSquare;
            alchemistHut.LocationToNorth = alchemistsGarden;

            alchemistsGarden.LocationToSouth = alchemistHut;

            guardPost.LocationToEast = bridge;
            guardPost.LocationToWest = townSquare;

            bridge.LocationToWest = guardPost;
            bridge.LocationToEast = strangeBuilding;

            strangeBuilding.LocationToWest = bridge;

            // Add the locations to the static list
            _locations.Add(home);
            _locations.Add(townSquare);
            _locations.Add(guardPost);
            _locations.Add(alchemistHut);
            _locations.Add(alchemistsGarden);
            _locations.Add(farmhouse);
            _locations.Add(farmersField);
            _locations.Add(bridge);
            _locations.Add(strangeBuilding);
        }
Esempio n. 9
0
        //Populates locations by giving names, descriptions, null/true/false values for bools. Can be populated with a quest via QuestAvailableHere, a monster
        //via MonsterLivingHere, or a vendor via VendorWorkingHere. ItemRequiredToEnter bars the player from entering without a specific item.
        private static void PopulateLocations()
        {
            Location home = new Location(LOCATION_ID_HOME, "Home", "Your house. You really need to clean up the place." + Environment.NewLine + "To the north, you see the cobbled path leading to Town Square.", null, null, null, null, false);

            Location townSquare = new Location(LOCATION_ID_TOWN_SQUARE, "Town Square", "In the center of the plaza, you see a nice fountain with various coins in the bottom." + Environment.NewLine + "There are few fellow villagers about today.", null, null, null, null, false);

            Location alchemistHut = new Location(LOCATION_ID_ALCHEMIST_HUT, "Alchemist's Hut", "There is a variety of strange, colorful plants on the shelves." + Environment.NewLine + "The alchemist, a friend, raves on about the terrible rats in his garden while mixing all sorts of strange potions." + Environment.NewLine + "Perhaps you could help?", null, null, null, null, false);

            alchemistHut.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_ALCHEMIST_GARDEN);

            Location alchemistGarden = new Location(LOCATION_ID_ALCHEMIST_GARDEN, "Alchemist's Garden", "Many plants and flowers are growing here." + Environment.NewLine + "Sure enough, a few rats gnaw on the roots of the previously flourishing herbs." + Environment.NewLine + "Before you get a chance to take in the beauty of the garden, a rat attacks you!", null, null, null, null, false);

            alchemistGarden.MonsterLivingHere = MonsterByID(MONSTER_ID_RAT);

            Location farmhouse = new Location(LOCATION_ID_FARMHOUSE, "The Farmhouse", "A small farmhouse on the edge of a field." + Environment.NewLine + "You don't know the farmer very well, but he's been struggling lately with an assortment of pests attacking his crops." + Environment.NewLine + "Perhaps he's willing to offer a reward if you help take care of his problem?", null, null, null, null, false);

            farmhouse.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_FARMERS_FIELD);

            Location field1 = new Location(LOCATION_ID_FARM_FIELD_1, "Northern Farm Field", "Fruit trees and grapevines cover this field, and the ripened berries dots the ground. Large, black ravens peck on them." + Environment.NewLine + "As you approach, they screech at you before diving in with sharp claws!", null, null, null, null, false);

            field1.MonsterLivingHere = MonsterByID(MONSTER_ID_VICIOUS_RAVEN);

            Location field2 = new Location(LOCATION_ID_FARM_FIELD_2, "The Farmer's Field", "You see rows of growing vegetables here, including corn." + Environment.NewLine + "You notice a nest of vile snakes lounging in the plants!", null, null, null, null, false);

            field2.MonsterLivingHere = MonsterByID(MONSTER_ID_SNAKE);

            Location field3 = new Location(LOCATION_ID_FARM_FIELD_3, "Southern Farm Field", "Vines of squash, watermelon, and pumpkins-to-be cover this field." + Environment.NewLine + "Clouds of insects swarm around the unripe melons and squashes, destroying patches of vines. They'll destroy the entire field if nothing stops them!", null, null, null, null, false);

            field3.MonsterLivingHere = MonsterByID(MONSTER_ID_CRICKET_HOARD);

            Location guardPost = new Location(LOCATION_ID_GUARD_POST, "Guard Post", "A tough-looking, stern guard protects the bridge." + Environment.NewLine + "It doesn't seem like he'll let you by without some sort of pass...", null, null, null, null, false);

            Location bridge = new Location(LOCATION_ID_BRIDGE, "Bridge", "A wide bridge made of stone, which crosses the town's river.", null, null, null, null, false);

            bridge.ItemRequiredToEnter = ItemByID(ITEM_ID_BRIDGE_PASS);

            Location spiderField = new Location(LOCATION_ID_SPIDER_FIELD, "Forest", "You see thick webs covering the trees..." + Environment.NewLine + "And hear the scratching and scraping of giant spiders crawling throughout the forest!", null, null, null, null, false);

            spiderField.MonsterLivingHere = MonsterByID(MONSTER_ID_GIANT_SPIDER);

            Location deepWoods = new Location(LOCATION_ID_DEEP_WOODS, "The Deep Woods", "The shade of the trees here darken your surroundings." + Environment.NewLine + "It's eerily quiet...", null, null, null, null, false);

            Location scribesTower = new Location(LOCATION_ID_DEEP_WOODS, "Scribe's Tower", "The forest opens up to another miniscule clearing, in the center of which stands a mysterious tower." + Environment.NewLine + "As you examine the area, you suddenly find yourself surrounded by giant, fiery scorpions, who seem to have made their home here!", null, null, null, null, false);

            scribesTower.MonsterLivingHere = MonsterByID(MONSTER_ID_FIERY_SCORPION);

            Location scribesRoom = new Location(LOCATION_ID_SCRIBES_ROOM, "Scribe's Room", "Having defeated the guarding scorpions, you enter the front room of the tower to see an older scribe hunched over his work." + Environment.NewLine + "He seems upset about something, and has a request for you, if you're willing to venture out.", null, null, null, null, false);

            scribesRoom.QuestAvailableHere = QuestByID(QUEST_ID_RETRIEVE_SCRIBES_PEN);

            Location batCave = new Location(LOCATION_ID_BAT_CAVE, "Bat Cave", "As you make your way south, you notice a wide, rocky opening. Entering the cave, you hear screeching and fluttering echoing off of the walls!", null, null, null, null, false);

            batCave.MonsterLivingHere = MonsterByID(MONSTER_ID_BAT);

            Location forestClearing = new Location(LOCATION_ID_FOREST_CLEARING, "Forest Clearing", "Here, the forest briefly clears into a small, circular meadow." + Environment.NewLine + "It's peaceful and rather barren, aside from a resting traveler merchant, who sees you and offers his wares.", null, null, null, null, true);

            Vendor travellingMerchant = new Vendor("Travelling Merchant");

            travellingMerchant.AddItemToInventory(ItemByID(ITEM_ID_TRAVEL_COOKIES));
            travellingMerchant.AddItemToInventory(ItemByID(ITEM_ID_LIGHTNING_SPELLTOME));
            travellingMerchant.AddItemToInventory(ItemByID(ITEM_ID_BUNCH_OF_FLOWERS));

            forestClearing.VendorWorkingHere = travellingMerchant;

            Location rockyPath = new Location(LOCATION_ID_ROCKY_PATH, "Rocky Path", "The woods end at the start of a craggly, worn path that steadily leads up the mountain." + Environment.NewLine + "It's a serene climb.", null, null, null, null, false);

            Location mountainGate = new Location(LOCATION_ID_MOUNTAIN_GATE, "Mountain Gate", "The path ends abruptly at a large, powerful-looking gate that blocks your progress." + Environment.NewLine + "It looks like you'll need some sort of key to get by...", null, null, null, null, false);

            mountainGate.QuestAvailableHere = QuestByID(QUEST_ID_REPAIR_KEY);

            Location rockySummit = new Location(LOCATION_ID_ROCKY_SUMMIT, "Mountain Summit", "When the gate opens, you're able to reach the very top of the mountain." + Environment.NewLine + "On the far side of the area, a giant wyrm lays in rest, stirring as you enter." + Environment.NewLine + "It quickly awakens and bristles its scales, baring its viscious teeth and preparing to strike." + Environment.NewLine + "Get ready for a fight!", null, null, null, null, false);

            rockySummit.MonsterLivingHere   = MonsterByID(MONSTER_ID_WYRM);
            rockySummit.ItemRequiredToEnter = ItemByID(ITEM_ID_KEYSHARD_MANTLE);

            Location marketStreet1 = new Location(LOCATION_ID_STREET_MARKET_1, "The Street Market", "Various stores and shops line the streets, with many different merchants offering their goods." + Environment.NewLine + "For a price.", null, null, null, null, false);

            Location marketStreet2 = new Location(LOCATION_ID_STREET_MARKET_2, "The Street Market (cont.)", "Various stores and shops line the streets, with many different merchants offering their goods." + Environment.NewLine + "For a price.", null, null, null, null, false);

            Location clothier = new Location(LOCATION_ID_CLOTHIER, "The Clothier", "A clothier has set up shop here. He's surprised to see an adventurer like you enter." + Environment.NewLine + "He takes you aside and makes a request, in exchange for a reward.", null, null, null, null, false);

            //
            //CLOTHES/BAGS WILL BE ADDED IN THE FUTURE
            //

            /* Vendor clothierV = new Vendor("The Clothier");
             *
             * clothierV.AddItemToInventory(ItemByID(ITEM_ID_LEATHER_SATCHEL));
             * clothierV.AddItemToInventory(ItemByID(ITEM_ID_TRAVEL_BOOTS));
             * clothierV.AddItemToInventory(ItemByID(ITEM_ID_COOL_LOOKING_CAPE));
             *
             * clothier.VendorWorkingHere = clothierV; */

            clothier.QuestAvailableHere = QuestByID(QUEST_ID_SPIDER_SILKS);

            Location chef  = new Location(LOCATION_ID_CHEF, "The Chef", "To the left, a chef boasts about his various exotic oils and salts. The dish he was most excited to create, however, is missing a vital ingredient." + Environment.NewLine + "He offers a reward to the crowd for anyone that can retrieve a few special ingredients.", null, null, null, null, true);
            Vendor   chefV = new Vendor("The Chef");

            chefV.AddItemToInventory(ItemByID(ITEM_ID_RAT_JERKY));
            chefV.AddItemToInventory(ItemByID(ITEM_ID_HOT_COCOA));
            chefV.AddItemToInventory(ItemByID(ITEM_ID_BERRY_PASTRY));

            chef.VendorWorkingHere = chefV;

            chef.QuestAvailableHere = QuestByID(QUEST_ID_FLAMING_STINGERS);

            Location mage  = new Location(LOCATION_ID_MAGE, "The Mage", "The next store is owned by a mysterious mage. She's preforming an assortment of party tricks and juggles balls of fire for an onlooking crowd." + Environment.NewLine + "An 'Item Wanted' poster displays next to her performance stand, depicting a request for a bottle of rare Glacious Poison.", null, null, null, null, true);
            Vendor   mageV = new Vendor("The Mage");

            mageV.AddItemToInventory(ItemByID(ITEM_ID_HEALING_POTION));
            mageV.AddItemToInventory(ItemByID(ITEM_ID_BURNING_POISON));

            mage.VendorWorkingHere = mageV;

            mage.QuestAvailableHere = QuestByID(QUEST_ID_GLACIOUS_POISON);

            //ARMORER, WARRIOR, JEWELER, CLOTHIER SHOPS TO BE ADDED W/ NEW SYSTEMS

            Location warrior = new Location(LOCATION_ID_WARRIOR, "The Warrior", "A warrior is set up here, displaying an assortment of their hand-crafted battlegoods." + Environment.NewLine + "They notice you examining the shining blades, and offer a challlenge.", null, null, null, null, false);

            warrior.QuestAvailableHere = QuestByID(QUEST_ID_PYTHONS_BOARS);

            Location jeweler = new Location(LOCATION_ID_JEWELER, "The Jeweler", "An elderly woman has a neat, organized display of assorted accessories." + Environment.NewLine + "Next to the polished jewelry sits a display box of various gems, but the center display is empty...", null, null, null, null, false);

            jeweler.QuestAvailableHere = QuestByID(QUEST_ID_MOUNTAIN_DIAMOND);

            Location armorer = new Location(LOCATION_ID_ARMORER, "The Armorer", "The final vendor is an armorer, who you catch oogling the distant clothier." + Environment.NewLine + "He asks you for a personal favor.", null, null, null, null, false);

            armorer.QuestAvailableHere = QuestByID(QUEST_ID_FLOWERS);

            //

            Location oceansideDunes = new Location(LOCATION_ID_OCEANSIDE_DUNES, "Oceanside Dunes", "The chattering and lights of the market fade as you walk towards the sandy dunes." + Environment.NewLine + "You face the beach and the wide, infinite ocean.", null, null, null, null, false);

            Location beach = new Location(LOCATION_ID_BEACH, "The Beach", "Travelling down the dunes, you make it to the wide stretch of beach." + Environment.NewLine + "You hear creatures chittering about in the sand!", null, null, null, null, false);

            beach.MonsterLivingHere = MonsterByID(MONSTER_ID_BRUTAL_CRABBY);

            Location jetty = new Location(LOCATION_ID_JETTY, "The Jetty", "The beach abruptly ends at a rocky jetty holding calm water. Small, shimmering fish swim about." + Environment.NewLine + "Seagulls, which were once searching for food in the water, spot you and seem annoyed by your presence, and fly in to fight you away!", null, null, null, null, false);

            jetty.MonsterLivingHere = MonsterByID(MONSTER_ID_ANGRY_SEAGULL);

            Location tidePools = new Location(LOCATION_ID_TIDE_POOLS, "Tide Pools", "With the sea being far out, the craggly tide pools are filled to the brim with strange creatures." + Environment.NewLine + "You stick your hand into the water to search for shellfish...", null, null, null, null, false);

            tidePools.MonsterLivingHere = MonsterByID(MONSTER_ID_POISONOUS_SEA_URCHIN);

            Location shallowReef = new Location(LOCATION_ID_SHALLOW_REEF, "Shallow Reef", "You wade into the warm seawater to explore the small coral reef, searching for shells." + Environment.NewLine + "As you do, you feel something bite down on your thumb!", null, null, null, null, false);

            shallowReef.MonsterLivingHere = MonsterByID(MONSTER_ID_EEL);

            Location deepCave = new Location(LOCATION_ID_DEEP_CAVE, "Deeper in the Cave", "The screeching of nested bats fades as you jouney deeper into the cave." + Environment.NewLine + "The air grows humid here, and your footsteps echo on. You use your small lantern to light the way, which casts funky shadows on the walls.", null, null, null, null, false);

            Location darkZone = new Location(LOCATION_ID_DARK_ZONE, "The Dark Zone", "The air is cold here, and your lantern becomes the only source of light. How deep does this go?" + Environment.NewLine + "As you ponder, you hear something slither against the stone...", null, null, null, null, false);

            darkZone.MonsterLivingHere = MonsterByID(MONSTER_ID_ROCK_PYTHON);

            Location wetlands = new Location(LOCATION_ID_WETLANDS, "The Wetlands", "This is the first section of the wetlands, and currently the only area you can get to without some work." + Environment.NewLine + "The grassy mud beneath your boots is squishy and tough to navigate.", null, null, null, null, false);

            wetlands.MonsterLivingHere = MonsterByID(MONSTER_ID_WINGED_BOAR);

            Location spiderNest = new Location(LOCATION_ID_SPIDER_NEST, "Spider Nest", "As you enter the next area, you find it filled with even more webs." + Environment.NewLine + "Giant spiders are crawling all over the place!", null, null, null, null, false);

            spiderNest.MonsterLivingHere = MonsterByID(MONSTER_ID_GREATER_SPIDER);

            //Actually adds locations to the map. Locations to the north of the player's current location are labeled LocationToNorth, etc.
            home.LocationToNorth = townSquare;
            home.LocationToSouth = marketStreet1;

            townSquare.LocationToNorth = alchemistHut;
            townSquare.LocationToSouth = home;
            townSquare.LocationToEast  = guardPost;
            townSquare.LocationToWest  = farmhouse;

            farmhouse.LocationToEast = townSquare;
            farmhouse.LocationToWest = field2;

            field1.LocationToSouth = field2;

            field2.LocationToEast  = farmhouse;
            field2.LocationToNorth = field1;
            field2.LocationToSouth = field3;

            field3.LocationToNorth = field2;

            alchemistHut.LocationToSouth = townSquare;
            alchemistHut.LocationToNorth = alchemistGarden;

            alchemistGarden.LocationToSouth = alchemistHut;

            guardPost.LocationToEast = bridge;
            guardPost.LocationToWest = townSquare;

            bridge.LocationToWest = guardPost;
            bridge.LocationToEast = spiderField;

            spiderField.LocationToWest  = bridge;
            spiderField.LocationToEast  = forestClearing;
            spiderField.LocationToNorth = spiderNest;

            spiderNest.LocationToSouth = spiderField;

            forestClearing.LocationToWest  = spiderField;
            forestClearing.LocationToEast  = deepWoods;
            forestClearing.LocationToNorth = wetlands;

            wetlands.LocationToSouth = forestClearing;

            deepWoods.LocationToWest  = forestClearing;
            deepWoods.LocationToNorth = scribesTower;
            deepWoods.LocationToEast  = rockyPath;
            deepWoods.LocationToSouth = batCave;

            scribesTower.LocationToSouth = deepWoods;
            scribesTower.LocationToNorth = scribesRoom;

            scribesRoom.LocationToSouth = scribesTower;

            rockyPath.LocationToWest = deepWoods;
            rockyPath.LocationToEast = mountainGate;

            mountainGate.LocationToWest = rockyPath;
            mountainGate.LocationToEast = rockySummit;

            rockySummit.LocationToWest = mountainGate;

            batCave.LocationToNorth = deepWoods;
            batCave.LocationToEast  = deepCave;

            deepCave.LocationToEast = darkZone;
            deepCave.LocationToWest = batCave;

            darkZone.LocationToWest = deepCave;

            marketStreet1.LocationToNorth = home;
            marketStreet1.LocationToEast  = chef;
            marketStreet1.LocationToWest  = clothier;
            marketStreet1.LocationToSouth = marketStreet2;

            chef.LocationToWest = marketStreet1;

            clothier.LocationToEast = marketStreet1;

            marketStreet2.LocationToNorth = marketStreet1;
            marketStreet2.LocationToWest  = warrior;
            marketStreet2.LocationToEast  = mage;
            marketStreet2.LocationToSouth = oceansideDunes;

            warrior.LocationToEast = marketStreet2;

            mage.LocationToWest = marketStreet2;

            oceansideDunes.LocationToNorth = marketStreet2;
            oceansideDunes.LocationToSouth = beach;
            oceansideDunes.LocationToEast  = armorer;
            oceansideDunes.LocationToWest  = jeweler;

            jeweler.LocationToEast = oceansideDunes;

            armorer.LocationToWest = oceansideDunes;

            beach.LocationToNorth = oceansideDunes;
            beach.LocationToEast  = tidePools;
            beach.LocationToSouth = shallowReef;
            beach.LocationToWest  = jetty;

            tidePools.LocationToWest = beach;

            jetty.LocationToEast = beach;

            shallowReef.LocationToNorth = beach;

            //And finally, adds locations to the world.
            Locations.Add(home);
            Locations.Add(townSquare);
            Locations.Add(guardPost);
            Locations.Add(alchemistHut);
            Locations.Add(alchemistGarden);
            Locations.Add(farmhouse);
            Locations.Add(field1);
            Locations.Add(field2);
            Locations.Add(field3);
            Locations.Add(bridge);
            Locations.Add(spiderField);
            Locations.Add(spiderNest);
            Locations.Add(deepWoods);
            Locations.Add(scribesTower);
            Locations.Add(scribesRoom);
            Locations.Add(batCave);
            Locations.Add(deepCave);
            Locations.Add(darkZone);
            Locations.Add(rockyPath);
            Locations.Add(mountainGate);
            Locations.Add(rockySummit);
            Locations.Add(forestClearing);
            Locations.Add(wetlands);
            Locations.Add(marketStreet1);
            Locations.Add(marketStreet2);
            Locations.Add(clothier);
            Locations.Add(chef);
            Locations.Add(warrior);
            Locations.Add(mage);
            Locations.Add(jeweler);
            Locations.Add(armorer);
            Locations.Add(oceansideDunes);
            Locations.Add(beach);
            Locations.Add(jetty);
            Locations.Add(tidePools);
            Locations.Add(shallowReef);
        }
Esempio n. 10
0
        private static void PopulateLocations()
        {
            Location home = new Location(LOCATION_ID_HOME, "Home", "Your house. You really need to clean up the place.");

            Location townSquare = new Location(LOCATION_ID_TOWN_SQUARE, "Town square", "You see a fountain. You see Bob the Rat-Catcher showing you his wares.");

            Vendor bobTheRatCatcher = new Vendor("Bob the Rat-Catcher");

            bobTheRatCatcher.AddItemToInventory(ItemByID(ITEM_ID_PIECE_OF_FUR), 5);
            bobTheRatCatcher.AddItemToInventory(ItemByID(ITEM_ID_RAT_TAIL), 3);
            bobTheRatCatcher.AddItemToInventory(ItemByID(ITEM_ID_ENCHANTED_SWORD), 1);
            bobTheRatCatcher.AddItemToInventory(ItemByID(ITEM_ID_LEATHER_ARMOR), 1);

            townSquare.VendorWorkingHere = bobTheRatCatcher;

            Vendor zmoalaAlchimistu = new Vendor("Zmoala alchemistu'");

            zmoalaAlchimistu.AddItemToInventory(ItemByID(ITEM_ID_HEALING_POTION), 20);

            Location alchemistHut = new Location(LOCATION_ID_ALCHEMIST_HUT, "Alchemist's hut", "There are many strange plants on the shelves. There's also an alchemist willing to trade");

            alchemistHut.VendorWorkingHere  = zmoalaAlchimistu;
            alchemistHut.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_ALCHEMIST_GARDEN);

            Location alchemistsGarden = new Location(LOCATION_ID_ALCHEMISTS_GARDEN, "Alchemist's garden", "Many plants growing here");

            alchemistsGarden.MonsterLivingHere = MonsterByID(MONSTER_ID_RAT);

            Vendor taranuMirel = new Vendor("Taranu Mirel");

            taranuMirel.AddItemToInventory(ItemByID(ITEM_ID_KNIGHTS_ARMOR), 20);

            Location farmhouse = new Location(LOCATION_ID_FARMHOUSE, "Farmhouse", "Small farmhouse, with a rough, scarred farmer upfront, he looks willing to trade.");

            farmhouse.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_FARMERS_FIELD);
            farmhouse.VendorWorkingHere  = taranuMirel;

            Location farmersField = new Location(LOCATION_ID_FARM_FIELD, "Farmer's field", "You see rows of vegetables growing here");

            farmersField.MonsterLivingHere = MonsterByID(MONSTER_ID_SNAKE);

            Location guardPost = new Location(LOCATION_ID_GUARD_POST, "Guard post", "There is a large, tough-looking guard here", ItemByID(ITEM_ID_ADVENTURER_PASS));

            Location bridge = new Location(LOCATION_ID_BRIDGE, "Bridge", "A stone bridge crosses a wide river");

            bridge.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_FOREST);

            Location spiderField = new Location(LOCATION_ID_SPIDER_FIELD, "Forest", "You see spider webs covering the tree in this forest. You feel a strange power coming from one of the spiders.");

            spiderField.MonsterLivingHere = MonsterByID(MONSTER_ID_GIANT_SPIDER);

            home.LocationToNorth = townSquare;

            townSquare.LocationToNorth = alchemistHut;
            townSquare.LocationToSouth = home;
            townSquare.LocationToEast  = guardPost;
            townSquare.LocationToWest  = farmhouse;

            farmhouse.LocationToEast = townSquare;
            farmhouse.LocationToWest = farmersField;

            farmersField.LocationToEast = farmhouse;

            alchemistHut.LocationToSouth = townSquare;
            alchemistHut.LocationToNorth = alchemistsGarden;

            alchemistsGarden.LocationToSouth = alchemistHut;

            guardPost.LocationToEast = bridge;
            guardPost.LocationToWest = townSquare;

            bridge.LocationToWest = guardPost;
            bridge.LocationToEast = spiderField;

            spiderField.LocationToWest = bridge;

            Locations.Add(home);
            Locations.Add(townSquare);
            Locations.Add(guardPost);
            Locations.Add(alchemistHut);
            Locations.Add(alchemistsGarden);
            Locations.Add(farmhouse);
            Locations.Add(farmersField);
            Locations.Add(bridge);
            Locations.Add(spiderField);
        }
Esempio n. 11
0
        private static void PopulateLocations()
        {
            //create each location
            Location home = new Location(LOCATION_ID_HOME, "Home", "Your house. Your place is as tidy as ever.");

            Location townSquare = new Location(LOCATION_ID_TOWN_SQUARE, "Town square", "There is a fountain slowly trickling water out of the only spout that isn't clogged.\nThe town square is dead as usual.");
            Vendor   ratBoy     = new Vendor("Rat-Boy");

            ratBoy.AddItemToInventory(ItemByID(ITEM_ID_PIECE_OF_FUR), 5);
            ratBoy.AddItemToInventory(ItemByID(ITEM_ID_RAT_TAIL), 3);
            ratBoy.AddItemToInventory(ItemByID(ITEM_ID_HEALING_POTION), 3);
            townSquare.VendorWorkingHere = ratBoy;

            Location alchemistHut = new Location(LOCATION_ID_ALCHEMIST_HUT, "Alchemist hut", "You see a few strange and glowing plants sit perilously on the shelves in the spartan hut.");

            alchemistHut.QuestAvailableHere = QuestById(QUEST_ID_CLEAR_ALCHEMIST_GARDEN);

            Location alchemistGarden = new Location(LOCATION_ID_ALCHEMIST_GARDEN, "Alchemist garden", "You see more strange, glowing plants that almost seem to reach out to you.");

            alchemistGarden.EnemyLivingHere = EnemyById(ENEMY_ID_RAT);

            Location farmhouse = new Location(LOCATION_ID_FARMHOUSE, "Farmhouse", "This is a small farm with a big red barn. You can smell the fresh manure.");

            farmhouse.QuestAvailableHere = QuestById(QUEST_ID_CLEAR_FARMERS_FIELD);

            Location farmField = new Location(LOCATION_ID_FARM_FIELD, "Farmer's field", "Just past the barn, you see rows of vegetables growing. Be careful not to step in any patties.");

            farmField.EnemyLivingHere = EnemyById(ENEMY_ID_SNAKE);

            Location guardPost = new Location(LOCATION_ID_GUARD_POST, "Guard post", "Two small, strange looking guards stand at either side of the gate.", ItemByID(ITEM_ID_ADVENTURER_PASS));

            Location bridge = new Location(LOCATION_ID_BRIDGE, "Bridge", "A wooden bridge spans the fast flowing river. You wonder how they raised the bridge.");

            Location spiderField = new Location(LOCATION_ID_SPIDER_FIELD, "Forest", "You see spider webs covering the trees of this forest.");

            spiderField.EnemyLivingHere = EnemyById(ENEMY_ID_GIANT_SPIDER);

            //link locations
            home.LocationToNorth = townSquare;

            townSquare.LocationToNorth = alchemistHut;
            townSquare.LocationToEast  = guardPost;
            townSquare.LocationToSouth = home;
            townSquare.LocationToWest  = farmhouse;

            farmhouse.LocationToEast = townSquare;
            farmhouse.LocationToWest = farmField;

            farmField.LocationToEast = farmhouse;

            alchemistHut.LocationToSouth = townSquare;
            alchemistHut.LocationToNorth = alchemistGarden;

            alchemistGarden.LocationToSouth = alchemistHut;

            guardPost.LocationToEast = bridge;
            guardPost.LocationToWest = townSquare;

            bridge.LocationToWest = guardPost;
            bridge.LocationToEast = spiderField;

            spiderField.LocationToWest = bridge;

            //add locations to static list
            Locations.Add(home);
            Locations.Add(townSquare);
            Locations.Add(guardPost);
            Locations.Add(alchemistHut);
            Locations.Add(alchemistGarden);
            Locations.Add(farmhouse);
            Locations.Add(farmField);
            Locations.Add(bridge);
            Locations.Add(spiderField);
        }
Esempio n. 12
0
        private static void PopulateLocations()
        {
            //vendors
            Vendor bobTheRatCatcher = new Vendor("Bob the Rat-Catcher");

            bobTheRatCatcher.AddItemToInventory(ItemByID(ITEM_ID_PIECE_OF_FUR), 5);
            bobTheRatCatcher.AddItemToInventory(ItemByID(ITEM_ID_RAT_TAIL), 3);
            bobTheRatCatcher.AddItemToInventory(ItemByID(ITEM_ID_HEALING_POTION), 1);

            //Creats each location
            Location home = new Location(LOCATION_ID_HOME, "Home:", narrative.HomeDetail);

            Location townSquare = new Location(LOCATION_ID_TOWN_SQUARE, "Town square:", narrative.TownSqrDetail);

            Location alchemistHut = new Location(LOCATION_ID_ALCHEMIST_HUT, "Alchemist's hut:", narrative.AlchemistHutDetail);

            Location alchemistsGarden = new Location(LOCATION_ID_ALCHEMISTS_GARDEN, "Alchemist's garden:", narrative.AlchemistGardenDetail);

            Location farmhouse = new Location(LOCATION_ID_FARMHOUSE, "Farmhouse:", narrative.FarmhouseDetail);

            Location farmersField = new Location(LOCATION_ID_FARM_FIELD, "Farmer's field:", narrative.FarmerFieldDetail);

            Location guardPost = new Location(LOCATION_ID_GUARD_POST, "Guard post:", narrative.GaurdPostDetail, ItemByID(ITEM_ID_ADVENTURER_PASS));

            Location bridge = new Location(LOCATION_ID_BRIDGE, "Bridge:", narrative.BridgeDetail);

            Location spiderField = new Location(LOCATION_ID_SPIDER_FIELD, "Forest:", narrative.ForrestDetail);


            //Adds Quests to loactaions
            alchemistHut.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_ALCHEMIST_GARDEN);
            farmhouse.QuestAvailableHere    = QuestByID(QUEST_ID_CLEAR_FARMERS_FIELD);


            //Adds Monsters (NAME, % chance of appearing)
            alchemistsGarden.AddMonster(MONSTER_ID_RAT, 34);
            alchemistsGarden.AddMonster(MONSTER_ID_SNAKE, 33);
            alchemistsGarden.AddMonster(MONSTER_ID_GIANT_SPIDER, 33);

            farmersField.AddMonster(MONSTER_ID_SNAKE, 75);

            spiderField.AddMonster(MONSTER_ID_GIANT_SPIDER, 75);

            // Link the locations together
            home.LocationToNorth = townSquare;

            townSquare.LocationToNorth   = alchemistHut;
            townSquare.LocationToSouth   = home;
            townSquare.LocationToEast    = guardPost;
            townSquare.LocationToWest    = farmhouse;
            townSquare.VendorWorkingHere = bobTheRatCatcher; //vendor

            farmhouse.LocationToEast = townSquare;
            farmhouse.LocationToWest = farmersField;

            farmersField.LocationToEast = farmhouse;

            alchemistHut.LocationToSouth = townSquare;
            alchemistHut.LocationToNorth = alchemistsGarden;

            alchemistsGarden.LocationToSouth = alchemistHut;

            guardPost.LocationToEast = bridge;
            guardPost.LocationToWest = townSquare;

            bridge.LocationToWest    = guardPost;
            bridge.LocationToEast    = spiderField;
            bridge.VendorWorkingHere = bobTheRatCatcher; //vendor

            spiderField.LocationToWest = bridge;

            // Add the locations to the list
            _locations.Add(home);
            _locations.Add(townSquare);
            _locations.Add(guardPost);
            _locations.Add(alchemistHut);
            _locations.Add(alchemistsGarden);
            _locations.Add(farmhouse);
            _locations.Add(farmersField);
            _locations.Add(bridge);
            _locations.Add(spiderField);
        }
Esempio n. 13
0
        private static void PopulateLocations()
        {
            // Create each location
            Location home = new Location(LOCATION_ID_HOME, "Home", "No place like home.");

            Location townSquare = new Location(LOCATION_ID_TOWN_SQUARE, "Town square", "You see a fountain and a rusty sword in the gudder.");

            Vendor bobTheRatCatcher = new Vendor("Bob the Rat-Catcher");

            bobTheRatCatcher.AddItemToInventory(ItemByID(ITEM_ID_PIECE_OF_FUR), 5);
            bobTheRatCatcher.AddItemToInventory(ItemByID(ITEM_ID_RAT_TAIL), 3);

            townSquare.VendorWorkingHere = bobTheRatCatcher;

            Location alchemistHut = new Location(LOCATION_ID_ALCHEMIST_HUT, "Alchemist's hut", "There are many strange plants on the shelves.");

            alchemistHut.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_ALCHEMIST_GARDEN);

            Location alchemistsGarden = new Location(LOCATION_ID_ALCHEMISTS_GARDEN, "Alchemist's garden", "Many plants are growing here.");

            alchemistsGarden.MonsterLivingHere = MonsterByID(MONSTER_ID_RAT);

            Location farmhouse = new Location(LOCATION_ID_FARMHOUSE, "Farmhouse", "There is a small farmhouse, with a farmer in front.");

            farmhouse.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_FARMERS_FIELD);

            Location farmersField = new Location(LOCATION_ID_FARM_FIELD, "Farmer's field", "You see rows of vegetables growing here.");

            farmersField.MonsterLivingHere = MonsterByID(MONSTER_ID_SNAKE);

            Location guardPost = new Location(LOCATION_ID_GUARD_POST, "Guard post", "There is a large, tough-looking guard here.", ItemByID(ITEM_ID_ADVENTURER_PASS));

            Location bridge = new Location(LOCATION_ID_BRIDGE, "Bridge", "A stone bridge crosses a wide river.");

            Location spiderField = new Location(LOCATION_ID_SPIDER_FIELD, "Forest", "You see spider webs covering the trees in this forest.");

            spiderField.MonsterLivingHere = MonsterByID(MONSTER_ID_GIANT_SPIDER);

            Location deadForest = new Location(LOCATION_ID_Dead_Forest, "Dead Forest", "You see nothing but mist and dead flora");

            Location brokenBridge = new Location(LOCATION_ID_Broken_Bridge, "Broken Bridge", "An old broken bridge crosses a dried out river");

            Location mysticTempleYard = new Location(LOCATION_ID_Mystic_Temple_Yard, "Mystic Temple yard", "You see the entrance to an old ruind mystic temple");

            mysticTempleYard.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_MYSTIC_TEMPLE);

            Location mysticTemple = new Location(LOCATION_ID_Mystic_Temple, "Mystic Temple", "You see glowing eyes in the darkness");

            mysticTemple.MonsterLivingHere = MonsterByID(MONSTER_ID_SKELLATON);

            Location swamp = new Location(LOCATION_ID_SWAMP, "Swamp", "Your feet are wet and you see an entrance to a cave to the north");

            swamp.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_DARK_CAVE);

            Location darkCave = new Location(LOCATION_ID_DARK_CAVE, "Dark Cave", "Utter darkness and eckoing shriek's");

            darkCave.MonsterLivingHere = MonsterByID(MONSTER_ID_GOBLIN);

            Location darkNarrowRoad = new Location(LOCATION_ID_DARK_NARROW_ROAD, "Dark Narrow Road", "A dark narrow road heading north covered in dead trees");

            // Link the locations together
            home.LocationToNorth = townSquare;

            townSquare.LocationToNorth = alchemistHut;
            townSquare.LocationToSouth = home;
            townSquare.LocationToEast  = guardPost;
            townSquare.LocationToWest  = farmhouse;

            farmhouse.LocationToEast = townSquare;
            farmhouse.LocationToWest = farmersField;

            farmersField.LocationToEast = farmhouse;

            alchemistHut.LocationToSouth = townSquare;
            alchemistHut.LocationToNorth = alchemistsGarden;

            alchemistsGarden.LocationToSouth = alchemistHut;
            alchemistsGarden.LocationToNorth = deadForest;

            deadForest.LocationToSouth = alchemistsGarden;
            deadForest.LocationToWest  = brokenBridge;
            deadForest.LocationToEast  = swamp;
            deadForest.LocationToNorth = darkNarrowRoad;

            darkNarrowRoad.LocationToSouth = deadForest;

            brokenBridge.LocationToEast = deadForest;
            brokenBridge.LocationToWest = mysticTempleYard;

            mysticTempleYard.LocationToEast  = brokenBridge;
            mysticTempleYard.LocationToNorth = mysticTemple;

            mysticTemple.LocationToSouth = mysticTempleYard;

            swamp.LocationToWest  = deadForest;
            swamp.LocationToNorth = darkCave;

            darkCave.LocationToSouth = swamp;

            guardPost.LocationToEast = bridge;
            guardPost.LocationToWest = townSquare;

            bridge.LocationToWest = guardPost;
            bridge.LocationToEast = spiderField;

            spiderField.LocationToWest = bridge;

            // Add the locations to the static list
            Locations.Add(home);
            Locations.Add(townSquare);
            Locations.Add(guardPost);
            Locations.Add(alchemistHut);
            Locations.Add(alchemistsGarden);
            Locations.Add(deadForest);
            Locations.Add(brokenBridge);
            Locations.Add(mysticTempleYard);
            Locations.Add(mysticTemple);
            Locations.Add(farmhouse);
            Locations.Add(farmersField);
            Locations.Add(bridge);
            Locations.Add(spiderField);
            Locations.Add(swamp);
            Locations.Add(darkCave);
            Locations.Add(darkNarrowRoad);
        }