コード例 #1
0
ファイル: Check.cs プロジェクト: Winterpaw22/SlimeQuest2.0
        /// <summary>
        /// Checks for plants
        /// </summary>
        /// <param name="universe"></param>
        /// <param name="adventurer"></param>
        public static void CheckForFoiliage(Universe universe, Adventurer adventurer)
        {
            foreach (Foiliage plant in universe.FoiliageList)
            {
                if (plant.Location == adventurer.MapLocation)
                {
                    switch (plant.Plant)
                    {
                    case Foiliage.plantType.Tree:
                        DisplayMap.DisplayTree(plant.XPos, plant.YPos);
                        break;

                    case Foiliage.plantType.Grass:
                        DisplayMap.DisplayPlantBasic(plant.XPos, plant.YPos, plant.CharIcon);
                        break;

                    case Foiliage.plantType.Flower:
                        break;

                    case Foiliage.plantType.Field:
                        DisplayMap.DisplayPlantGrass(plant.XPos, plant.XEnd, plant.YPos, plant.YEnd, plant.CharIcon);
                        break;

                    case Foiliage.plantType.Fountain:
                        TextDrawings.DisplayFountain(plant.XPos, plant.YPos);
                        break;

                    default:
                        break;
                    }
                }
            }
        }
コード例 #2
0
        public static void CheckPosition(Adventurer adventurer, Universe universe)
        {
            //checks for current quest and if you complete the quest or not
            Check.CheckPlayerQuest(universe, adventurer);

            //Checks what map you are on and then Draws the correct entities to the screen
            Check.CheckPlayerPosition(universe, adventurer);

            //checks whether to draw house stuff or not
            if (!adventurer.InaHouse)
            {
                DisplayMapObjects(adventurer, universe);
            }
            else if (adventurer.InaHouse)
            {
                foreach (var house in universe.HouseList)
                {
                    if (house.PlayerInside)
                    {
                        DisplayMap.DisplayHouseInside(universe);
                        Check.CheckNPCMap(universe, adventurer.InHouseName);
                        DisplayMap.DisplayNPC(universe);
                        Check.CheckAndDisplayItemMap(universe, adventurer);
                        //Handles all objects in the "rooms"

                        //NEW IDEA, Hows bout thats annoying and no
                        Check.CheckandDisplayRoomObjects(universe, adventurer);
                    }
                }
            }
        }
コード例 #3
0
ファイル: Check.cs プロジェクト: Winterpaw22/SlimeQuest2.0
        public static void CheckAndPickupItem(Universe universe, Adventurer adventurer)
        {
            int checkx = adventurer.Xpos;
            int checky = adventurer.Ypos;

            switch (adventurer.LookDirection)
            {
            case Humanoid.Direction.LEFT:
                checkx--;
                break;

            case Humanoid.Direction.RIGHT:
                checkx++;
                break;

            case Humanoid.Direction.UP:
                checky--;
                break;

            case Humanoid.Direction.DOWN:
                checky++;
                break;

            default:
                break;
            }

            foreach (var item in universe.ItemList)
            {
                if ((item.houseLoc != House.houseName.None) && (item.houseLoc == adventurer.InHouseName))
                {
                    if (!item.itemTaken)
                    {
                        if ((item.XPos == checkx) && (item.YPos == checky))
                        {
                            item.itemTaken = true;
                            adventurer.ItemsDictionary[item.ItemType] += 1;
                            DisplayMap.DisplayItemToPickup(item.XPos, item.YPos, item.itemTaken);
                            TextBoxViews.WriteToMessageBox(universe, "You picked up a " + item.ItemType.ToString());
                        }
                    }
                }
                else if (item.worldLoc == adventurer.MapLocation)
                {
                    if (!item.itemTaken)
                    {
                        //matches locations
                        if ((item.XPos == checkx) && (item.YPos == checky))
                        {
                            item.itemTaken = true;
                            adventurer.ItemsDictionary[item.ItemType] += 1;
                            DisplayMap.DisplayItemToPickup(item.XPos, item.YPos, item.itemTaken);
                            TextBoxViews.WriteToMessageBox(universe, "You picked up a " + item.ItemType.ToString());
                        }
                    }
                }
            }
        }//End of last Method
コード例 #4
0
ファイル: Check.cs プロジェクト: Winterpaw22/SlimeQuest2.0
 /// <summary>
 /// Checks for Furniture then displays it in the room you are in.
 /// </summary>
 /// <param name="universe"></param>
 /// <param name="adventurer"></param>
 public static void CheckandDisplayRoomObjects(Universe universe, Adventurer adventurer)
 {
     foreach (var furniture in universe.FurnitureList)
     {
         if (furniture.House == adventurer.InHouseName)
         {
             DisplayMap.DisplayHouseObjects(furniture.Xpos, furniture.Ypos, furniture.FurnituretOb);
         }
     }
 }
コード例 #5
0
        public static void DisplayMapObjects(Adventurer adventurer, Universe universe)
        {
            switch (adventurer.MapLocation)
            {
            case Humanoid.Location.MainWorld:
                Check.CheckNPCMap(universe, Humanoid.Location.MainWorld);
                DisplayMap.DisplayTowns(universe, adventurer);
                Check.CheckForFoiliage(universe, adventurer);
                Check.CheckAndDisplayItemMap(universe, adventurer);
                break;

            case Humanoid.Location.TutTown:
                Check.CheckNPCMap(universe, Humanoid.Location.TutTown);
                DisplayMap.DisplayNPC(universe);
                DisplayMap.DisplayHouses(universe, adventurer);
                Check.CheckForFoiliage(universe, adventurer);
                Check.CheckAndDisplayItemMap(universe, adventurer);

                break;

            case Humanoid.Location.CherryGrove:
                Check.CheckNPCMap(universe, Humanoid.Location.CherryGrove);
                DisplayMap.DisplayNPC(universe);
                DisplayMap.DisplayHouses(universe, adventurer);
                Check.CheckForFoiliage(universe, adventurer);
                Check.CheckAndDisplayItemMap(universe, adventurer);
                break;

            case Humanoid.Location.Cave:
                Check.CheckNPCMap(universe, Humanoid.Location.Cave);
                DisplayMap.DisplayNPC(universe);
                Check.CheckAndDisplayItemMap(universe, adventurer);
                Check.CheckandDisplayCaveEnemies(universe);
                break;

            default:
                break;
            }
        }
コード例 #6
0
ファイル: Check.cs プロジェクト: Winterpaw22/SlimeQuest2.0
        /// <summary>
        /// Checks for it3ems then displays them onto the current map you are on
        /// </summary>
        /// <param name="universe"></param>
        /// <param name="adventurer"></param>
        public static void CheckAndDisplayItemMap(Universe universe, Adventurer adventurer)
        {
            bool noMapItems = false;

            foreach (var item in universe.ItemList)
            {
                if ((item.houseLoc != House.houseName.None) && (item.houseLoc == adventurer.InHouseName))
                {
                    if (!item.itemTaken)
                    {
                        DisplayMap.DisplayItemToPickup(item.XPos, item.YPos);
                        noMapItems = true;
                    }
                }
                else if (item.worldLoc == adventurer.MapLocation && !noMapItems)
                {
                    if (!item.itemTaken)
                    {
                        DisplayMap.DisplayItemToPickup(item.XPos, item.YPos);
                    }
                }
            }
        }