Exemple #1
0
        public static bool IntersectsWithTile(Engine.ICollisionable collisionAble1, Engine.Location location, out int maxY)
        {
            Engine.TileData data = location.getTile();
            Tile            tile = location.World.Level.TileSet[data.ID];
            Rectangle       rect = tile.CollisionArea, coll = collisionAble1.CollisionArea;

            rect.Offset(location.getTileX() * Tile.STANDARD_GTILE_WIDTH, location.getTileY() * Tile.STANDARD_GTILE_HEIGHT);

            return(IntersectPixels(coll, collisionAble1.Mask, rect, tile.Mask, false, data.Flipped, out maxY));
        }
        public static void PopulateLocations()
        {
            Location home         = new Location(LOCATION_ID_HOME, "Home", "A Place Where He is");
            Location townSquare   = new Engine.Location(LOCATION_ID_TOWN_SQUARE, "Town Square", "You See a Fountain Sprinkling Water");
            Location alchemistHut = new Location(LOCATION_ID_ALCHEMIST_HUT, "Alchemist's Hut, Place to Make Potions", "There are Many Strange Plants here!");

            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 covering the trees in this forest.");

            spiderField.MonsterLivingHere = MonsterByID(MONSTER_ID_GIANT_SPIDER);

            //Link the Locations together!

            home.LocationToNorth       = alchemistHut;
            townSquare.LocationToNorth = home;
            townSquare.LocationToSouth = 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
            Location.Add(home);
            Location.Add(townSquare);
            Location.Add(guardPost);
            Location.Add(guardPost);
            Location.Add(alchemistHut);
            Location.Add(alchemistsGarden);
            Location.Add(farmhouse);
            Location.Add(farmersField);
            Location.Add(bridge);
            Location.Add(spiderField);
        }
Exemple #3
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);
        }