コード例 #1
0
ファイル: World.cs プロジェクト: artnirak/SuperAdventureIM
        private static void PopulateLocations()
        {
            // Create each location
            Location home = new Location(LOCATION_ID_HOME, "Casa", "O teu quarto está muito desarrumado...");

            Location townSquare  = new Location(LOCATION_ID_TOWN_SQUARE, "Praça da cidade", "Vês uma fonte de água.");
            Vendor   hobbitWares = new Engine.Vendor("Hobbit mercante", 50);

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

            townSquare.VendorWorkingHere = hobbitWares;

            Location alchemistHut = new Location(LOCATION_ID_ALCHEMIST_HUT, "Cabana do Alquimista", "Tem umas plantas estranhas nas prateleiras.");

            alchemistHut.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_ALCHEMIST_GARDEN);

            Location alchemistsGarden = new Location(LOCATION_ID_ALCHEMISTS_GARDEN, "Jardim do Alquimista", "Muitas flores e frutos crescem aqui.");

            alchemistsGarden.AddMonster(MONSTER_ID_RAT, 100);

            Location farmhouse = new Location(LOCATION_ID_FARMHOUSE, "Rancho", "Uma casa na quinta. O agricultor parece ocupado.");

            farmhouse.QuestAvailableHere = QuestByID(QUEST_ID_CLEAR_FARMERS_FIELD);

            Location farmersField = new Location(LOCATION_ID_FARM_FIELD, "Campo do Agricultor", "Linhas de vegetais crescem aqui.");

            farmersField.AddMonster(MONSTER_ID_SNAKE_BLACK, 70);
            farmersField.AddMonster(MONSTER_ID_SNAKE_COPPERHEAD, 30);

            Location guardPost = new Location(LOCATION_ID_GUARD_POST, "Posto de Guarda", "O guarda é intimidante.", ItemByID(ITEM_ID_ADVENTURER_PASS));

            Location bridge = new Location(LOCATION_ID_BRIDGE, "Ponte", "Uma ponte de pedra sobre um rio largo.");

            Location spiderField = new Location(LOCATION_ID_SPIDER_FIELD, "Floresta Obscura", "Teias de aranhas cobrem as árvores nesta floresta.");

            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);
        }
コード例 #2
0
        private static void populateLocations()
        {
            Location home            = new Engine.Location(LOCATION_ID_HOME, "Home", "Your house. Mi casa e su casa");
            Location townSquare      = new Location(LOCATION_ID_TOWN_SQUARE, "Town Square", "Town square. You see a famous person");
            Location guardPost       = new Location(LOCATION_ID_GUARD_POST, "Guard Post", "Some next level bodyguard is here. LETS START SOME BEEF BRO", itemByID(ITEM_ID_ADVENTURER_PASS));
            Location alchemistHut    = new Location(LOCATION_ID_ALCHEMIST_HUT, "Alchemist Hut", "There are many strange potions here dawg. watch your back bro");
            Location alchemistGarden = new Location(LOCATION_ID_ALCHEMIST_GARDEN, "Alchemist Garden", "This place looks like shit. Theres a bunch of rat shit here bro watch your step i dont want to get my suede couch all rat shitty");
            Location farmhouse       = new Location(LOCATION_ID_FARMHOUSE, "Farm House", "Theres a small farmhouse with a farmer out front");
            Location farmField       = new Location(LOCATION_ID_FARM_FIELD, "Farm Field", "Theres some plants bro. big deal", null, 5);
            Location bridge          = new Location(LOCATION_ID_BRIDGE, "Bridge", "its a f****n bridge bro. u trust bridges? u trust me? i dont trust bridges, so dont trust me bro");
            Location spiderField     = new Location(LOCATION_ID_SPIDER_FIELD, "Spider Field", "WTF u doin here bro? Theres no spiderman here bro. Ur gunna get killed bro. sliced and diced bro. like my moms risotto bro", null, 10);

            alchemistHut.questAvailableHere   = questByID(QUEST_ID_CLEAR_ALCHEMIST_GARDEN);
            farmhouse.questAvailableHere      = questByID(QUEST_ID_CLEAR_FARMERS_FIELD);
            alchemistGarden.monsterLivingHere = monsterByID(MONSTER_ID_RAT);
            farmField.monsterLivingHere       = monsterByID(MONSTER_ID_SNAKE);
            spiderField.monsterLivingHere     = monsterByID(MONSTER_ID_GIANT_SPIDER);

            home.locationNorth = townSquare;

            townSquare.locationNorth = alchemistHut;
            townSquare.locationEast  = guardPost;
            townSquare.locationWest  = farmhouse;
            townSquare.locationSouth = home;

            farmhouse.locationWest = farmField;
            farmhouse.locationEast = townSquare;

            farmField.locationEast = farmhouse;

            alchemistHut.locationNorth = alchemistGarden;
            alchemistHut.locationSouth = townSquare;

            alchemistGarden.locationSouth = alchemistHut;

            guardPost.locationWest = townSquare;
            guardPost.locationEast = bridge;

            bridge.locationEast = spiderField;
            bridge.locationWest = guardPost;

            spiderField.locationWest = bridge;

            Vendor bobTheRat = new Engine.Vendor("Bob the Rat");

            bobTheRat.addItemtoInventory(itemByID(ITEM_ID_RAT_TAIL), 5);
            bobTheRat.addItemtoInventory(itemByID(ITEM_ID_FUR), 10);
            townSquare.vendorWorkingHere = bobTheRat;

            Vendor stanTheSnake = new Vendor("Stan the Snake");

            stanTheSnake.addItemtoInventory(itemByID(ITEM_ID_SNAKESKIN), 10);
            stanTheSnake.addItemtoInventory(itemByID(ITEM_ID_SNAKE_FANG), 10);
            bridge.vendorWorkingHere = stanTheSnake;


            locations.Add(home);
            locations.Add(townSquare);
            locations.Add(guardPost);
            locations.Add(bridge);
            locations.Add(spiderField);
            locations.Add(farmField);
            locations.Add(farmhouse);
            locations.Add(alchemistGarden);
            locations.Add(alchemistHut);
        }