예제 #1
0
 public NPCMenu(ContentManager newcontent, int height, int width)
 {
     _content = newcontent;
     _height = height;
     _width = width;
     _asker = null;
 }
예제 #2
0
 public void DrawMessage(NPC asker, SpriteBatch spriteBatch)
 {
     _asker = asker;
     spriteBatch.Draw(messagebase, new Rectangle(0, 0, _width, 3*messagebase.Height), Color.White);
     Vector2 textCenter = combatfontsmall.MeasureString(_asker.message) * .5f;
     spriteBatch.DrawString(combatfontsmall, _asker.message, new Vector2(_width / 2 - textCenter.X, messagebase.Height / 2 - textCenter.Y/3), Color.White);
 }
예제 #3
0
 public NPCMenu(ContentManager newcontent, int height, int width, NPC asker)
 {
     _content = newcontent;
     _height = height;
     _width = width;
     _asker = asker;
 }
예제 #4
0
        private void CreateOverWorld()
        {
            //Eric's code start

              OW = ContentRepository.getMap(3, this);
              //OWlist = new List<OverWorld>();
              //OWlist.Add(OW);
              graphics.PreferredBackBufferWidth = 800;
              graphics.PreferredBackBufferHeight = 600;

              TileMap tempTileMap = ContentRepository.getMap(4);
              TileMap tempTileMap2 = ContentRepository.getMap(5);
              TileMap tempTileMap3 = ContentRepository.getMap(8);
              TileMap tempTileMap4 = ContentRepository.getMap(7);
              OW.mapList.Add(tempTileMap);
              OW.mapList.Add(tempTileMap2);
              OW.mapList.Add(tempTileMap3);
              OW.mapList.Add(tempTileMap4);

              #region Enemy Creation

              Entity enemy1 = new Enemy(OW, tempTileMap.getTile(3, 4), 0,
            new int[] { 2, 2, 3, 3, 0, 0, 0, 0, 1, 1, 1, 1 , 2, 2, 3, 3 } , "Blue Spider");
              enemy1.setAvatarFileString("EnemySprites/BlueCreatureRight", "EnemySprites/BlueCreatureRight",
            "EnemySprites/BlueCreatureLeft", "EnemySprites/BlueCreatureLeft");
              tempTileMap.EntityList.Add(enemy1);

              Entity enemy2 = new Enemy(OW, tempTileMap.getTile(8, 11), 0,
            new int[] { 0,0,1,1,2,2,2,2,3,3,3,3,0,0,1,1 }, "Blue Spider");
              enemy2.setAvatarFileString("EnemySprites/BlueCreatureRight", "EnemySprites/BlueCreatureRight",
            "EnemySprites/BlueCreatureLeft", "EnemySprites/BlueCreatureLeft");
              tempTileMap.EntityList.Add(enemy2);

              Entity enemy3 = new Enemy(OW, tempTileMap2.getTile(2, 12), 0,
            new int[] { 1, 1, 3, 3, 3, 3, 1, 1 },
            "Purple Spider");
              enemy3.setAvatarFileString("EnemySprites/PurpleSpiderRight", "EnemySprites/PurpleSpiderRight",
            "EnemySprites/PurpleSpiderLeft", "EnemySprites/PurpleSpiderLeft");
              tempTileMap2.EntityList.Add(enemy3);

              Entity enemy4 = new Enemy(OW, tempTileMap2.getTile(1, 2), 0,
              new int[] {3,2,2,1,2,2,3,2,2,1,0,0,3,0,0,1,0,0},
              "Purple Spider");
              enemy4.setAvatarFileString("EnemySprites/PurpleSpiderRight", "EnemySprites/PurpleSpiderRight",
            "EnemySprites/PurpleSpiderLeft", "EnemySprites/PurpleSpiderLeft");
              tempTileMap2.EntityList.Add(enemy4);

              Entity enemy5 = new Enemy(OW, tempTileMap3.getTile(1, 3), 0,
            new int[] {2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3},
            "Purple Monster");
              enemy5.setAvatarFileString("EnemySprites/PurpleMonsterRight", "EnemySprites/PurpleMonsterRight",
            "EnemySprites/PurpleMonsterLeft", "EnemySprites/PurpleMonsterLeft");
              tempTileMap3.EntityList.Add(enemy5);

              Entity enemy6 = new Enemy(OW, tempTileMap3.getTile(8, 3), 0,
            new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2 },
            "Purple Monster");
              enemy6.setAvatarFileString("EnemySprites/PurpleMonsterRight", "EnemySprites/PurpleMonsterRight",
            "EnemySprites/PurpleMonsterLeft", "EnemySprites/PurpleMonsterLeft");
              tempTileMap3.EntityList.Add(enemy6);

              Entity enemy7 = new Enemy(OW, tempTileMap3.getTile(8, 14), 0,
            new int[] { 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
            "Purple Monster");
              enemy7.setAvatarFileString("EnemySprites/PurpleMonsterRight", "EnemySprites/PurpleMonsterRight",
            "EnemySprites/PurpleMonsterLeft", "EnemySprites/PurpleMonsterLeft");
              tempTileMap3.EntityList.Add(enemy7);

              Entity enemy8 = new Enemy(OW, tempTileMap3.getTile(1, 14), 0,
            new int[] { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1  ,0, 0, 0, 0, 0, 0, 0},
            "Purple Monster");
              enemy8.setAvatarFileString("EnemySprites/PurpleMonsterRight", "EnemySprites/PurpleMonsterRight",
            "EnemySprites/PurpleMonsterLeft", "EnemySprites/PurpleMonsterLeft");
              tempTileMap3.EntityList.Add(enemy8);

              Entity enemy9 = new Enemy(OW, tempTileMap3.getTile(3, 11), 0,
            new int[] { 2,2,2,3,3,3,3,3,0,0,0,1,1,1,1,1 },
            "Purple Monster");
              enemy9.setAvatarFileString("EnemySprites/PurpleMonsterRight", "EnemySprites/PurpleMonsterRight",
            "EnemySprites/PurpleMonsterLeft", "EnemySprites/PurpleMonsterLeft");
              tempTileMap3.EntityList.Add(enemy9);

              Entity enemy10 = new Enemy(OW, tempTileMap3.getTile(6, 6), 0,
            new int[] { 0,0,0,1,1,1,1,1,2,2,2,3,3,3,3,3 },
            "Purple Monster");
              enemy10.setAvatarFileString("EnemySprites/PurpleMonsterRight", "EnemySprites/PurpleMonsterRight",
            "EnemySprites/PurpleMonsterLeft", "EnemySprites/PurpleMonsterLeft");
              tempTileMap3.EntityList.Add(enemy10);
              #endregion

              #region Map Creation (includes doors)

              Entity temp;

              temp = new LockedDoor(OW, OW.OWmap.getTile(2, 7), 3, tempTileMap, null, 777);
              temp.setAvatarFileString("EntityAvatar/Door/Door_0", "EntityAvatar/Door/Door_1",
              "EntityAvatar/Door/Door_2", "EntityAvatar/Door/Door_3");
              Door tempSister = new Door(OW, tempTileMap.getTile(1, 0), 1, OW.OWmap, (Door)temp);
              tempSister.setAvatarFileString("EntityAvatar/Door/Door_0", "EntityAvatar/Door/Door_1",
              "EntityAvatar/Door/Door_2", "EntityAvatar/Door/Door_3");
              ((Door)temp).sister = tempSister;
              OW.EntityList.Add(temp);
              tempTileMap.EntityList.Add(tempSister);
              //end

              Entity temp2 = new Door(OW, tempTileMap.getTile(10, 15), 3, tempTileMap2, null);//10 15
              temp2.setAvatarFileString("EntityAvatar/Door/Door_0", "EntityAvatar/Door/Door_1",
             "EntityAvatar/Door/Door_2", "EntityAvatar/Door/Door_3");

              Door tempSister2 = new Door(OW, tempTileMap2.getTile(10, 0), 1, tempTileMap, (Door)temp2);
              tempSister2.setAvatarFileString("EntityAvatar/Door/Door_0", "EntityAvatar/Door/Door_1",
              "EntityAvatar/Door/Door_2", "EntityAvatar/Door/Door_3");
              ((Door)temp2).sister = tempSister2;
              tempTileMap.EntityList.Add(temp2);
              tempTileMap2.EntityList.Add(tempSister2);

              Entity temp3 = new Door(OW, tempTileMap2.getTile(0, 8), 2, tempTileMap3, null);//10 15
              temp3.setAvatarFileString("EntityAvatar/Door/Door_0", "EntityAvatar/Door/Door_1",
             "EntityAvatar/Door/Door_2", "EntityAvatar/Door/Door_3");

              Door tempSister3 = new Door(OW, tempTileMap3.getTile(11, 7), 0, tempTileMap2, (Door)temp3);
              tempSister3.setAvatarFileString("EntityAvatar/Door/Door_0", "EntityAvatar/Door/Door_1",
              "EntityAvatar/Door/Door_2", "EntityAvatar/Door/Door_3");
              ((Door)temp3).sister = tempSister3;
              tempTileMap2.EntityList.Add(temp3);
              tempTileMap3.EntityList.Add(tempSister3);

              Entity temp4 = new Door(OW, tempTileMap3.getTile(6, 0), 1, tempTileMap4, null);//10 15
              temp4.setAvatarFileString("EntityAvatar/Door/Door_0", "EntityAvatar/Door/Door_1",
             "EntityAvatar/Door/Door_2", "EntityAvatar/Door/Door_3");

              Door tempSister4 = new Door(OW, tempTileMap4.getTile(6, 15), 3, tempTileMap3, (Door)temp4);
              tempSister4.setAvatarFileString("EntityAvatar/Door/Door_0", "EntityAvatar/Door/Door_1",
              "EntityAvatar/Door/Door_2", "EntityAvatar/Door/Door_3");
              ((Door)temp4).sister = tempSister4;
              tempTileMap3.EntityList.Add(temp4);
              tempTileMap4.EntityList.Add(tempSister4);

              #endregion

              #region Chest ceation

              List<Item> temp_chest_items = new List<Item>();
              temp_chest_items.Add(new Key("Test Chest Key", 1));
              Chest tempChest = new Chest(OW, OW.OWmap.getTile(1, 5), 100, temp_chest_items);
              tempChest.setAvatarFileString("EntityAvatar/Chest/Chest_Only_HeatherLeeHarvey", "EntityAvatar/Chest/Chest_Only_HeatherLeeHarvey",
              "EntityAvatar/Chest/Chest_Only_HeatherLeeHarvey", "EntityAvatar/Chest/Chest_Only_HeatherLeeHarvey");
              OW.OWmap.EntityList.Add(tempChest);

              temp_chest_items = new List<Item>();
              temp_chest_items.Add(new Key("Door Key", 777));
              //temp_chest_items.Add(new Item("Rat-Tail"));
              //temp_chest_items.Add(new Item("MacGuffin"));
              //temp_chest_items.Add(new Item("Red Potion"));
              //temp_chest_items.Add(new Item("Katana"));
              tempChest = new LockedChest(OW, OW.OWmap.getTile(1, 3), 100, temp_chest_items, 1);
              tempChest.setAvatarFileString("EntityAvatar/Chest/Chest_Only_HeatherLeeHarvey", "EntityAvatar/Chest/Chest_Only_HeatherLeeHarvey",
              "EntityAvatar/Chest/Chest_Only_HeatherLeeHarvey", "EntityAvatar/Chest/Chest_Only_HeatherLeeHarvey");
              OW.OWmap.EntityList.Add(tempChest);

              #endregion

              NPC doc = new NPC(OW, tempTileMap.getTile(8, 8), NPC_Type.Doctor);
              doc.setAvatarFileString("EntityAvatar/NPC/NPC_Doctor_Bot", "EntityAvatar/NPC/NPC_Doctor_Bot",
              "EntityAvatar/NPC/NPC_Doctor_Bot", "EntityAvatar/NPC/NPC_Doctor_Bot");
              tempTileMap.EntityList.Add(doc);
        }