public InventorySystem(Vector2 position, TabManager tabManager) { this.position = position; this.tabManager = tabManager; xNumberOfSlots = 6; yNumberOfSlots = 11; totalInventorySlots = xNumberOfSlots * yNumberOfSlots; invSlot = new InventorySlot[xNumberOfSlots, yNumberOfSlots]; inventory = new List <Item>(); itemInHand = null; ItemInHand = false; CreateInventorySlots(); inPlayerHand = new InventorySlot(-1, -1, -1, -1); }
public CharacterSystem(Vector2 position, TabManager tabManager) { this.position = position; this.tabManager = tabManager; equipmentSlots = new InventorySlot[9]; equipmentSlots[0] = new InventorySlot(0, 0, (int)position.X + 191, (int)position.Y + 384); // Head equipmentSlots[1] = new InventorySlot(0, 0, (int)position.X + 191, (int)position.Y + 480); // Chest equipmentSlots[2] = new InventorySlot(0, 0, (int)position.X + 191, (int)position.Y + 576); // Legs equipmentSlots[3] = new InventorySlot(0, 0, (int)position.X + 191, (int)position.Y + 672); // Feet equipmentSlots[4] = new InventorySlot(0, 0, (int)position.X + 287, (int)position.Y + 416); // Neck equipmentSlots[5] = new InventorySlot(0, 0, (int)position.X + 287, (int)position.Y + 512); // Finger equipmentSlots[6] = new InventorySlot(0, 0, (int)position.X + 95, (int)position.Y + 512); // Hands equipmentSlots[7] = new InventorySlot(0, 0, (int)position.X + 95, (int)position.Y + 608); // Main Hand equipmentSlots[8] = new InventorySlot(0, 0, (int)position.X + 287, (int)position.Y + 608); // Off Hand }
public Map() { entityList = new List <Entity>(); tabManager = new TabManager(this); }
public InventoryTab(Vector2 position, TabManager tabManager) { destinationRectangle = new Rectangle((int)position.X, (int)position.Y, 448, 1080); sourceRectangle = new Rectangle(896, 0, 448, 1080); inventorySystem = new InventorySystem(position, tabManager); }
protected override void Update(GameTime gameTime) { KeyMouseReader.Update(); if (KeyMouseReader.KeyPressed(Keybinds.binds["toggleFullscreen"])) { graphics.IsFullScreen = !graphics.IsFullScreen; graphics.ApplyChanges(); } switch (currentGameState) { case (GameState.Menus): startMenu.Update(); if (KeyMouseReader.KeyPressed(Keybinds.binds["back"])) { this.Exit(); } break; case (GameState.World): map.Update(gameTime); string previousZoneName = map.zoneName; PortalEntity temporaryPortal = map.ZoneSwitch(); if (temporaryPortal != null) { fileName = temporaryPortal.zoneName; Player tempPlayer = map.player; TabManager tab = map.tabManager; map = FileReader.ReadMap(fileName); map.player = tempPlayer; map.player.position = temporaryPortal.spawnPosition; map.player.map = map; map.tabManager = tab; if (map.zoneName != previousZoneName) { MediaPlayer.Play(Archive.songDictionary[map.zoneName]); } } if (map.EngageCombatBool(ref combat) == true) { currentGameState = GameState.Combat; } if (KeyMouseReader.KeyPressed(Keys.Escape)) { currentGameState = GameState.Menus; MediaPlayer.Stop(); } break; case (GameState.Combat): combat.Update(gameTime); if (!combat.active && !combat.fadingOut) { MediaPlayer.Play(Archive.songDictionary[map.zoneName]); currentGameState = GameState.World; foreach (Quest q in map.tabManager.questTab.questSystem.quests) { foreach (Objective o in q.objectives) { if (o is KillObjective) { KillObjective oKill = (KillObjective)o; oKill.CompareTeam(combat.enemyID); } } } if (combat.winnerTeam == 2) { Initialize(); } else { map.player.team.characters[0].Heal((int)(map.player.team.characters[0].maxHealth * 0.2f)); } } if (KeyMouseReader.KeyPressed(Keybinds.binds["back"])) { this.Exit(); } break; case (GameState.WorldEditor): mapEditor.Update(); if (KeyMouseReader.KeyPressed(Keybinds.binds["back"])) { currentGameState = GameState.Menus; } break; } base.Update(gameTime); }
public CharacterTab(Vector2 position, TabManager tabManager) { destinationRectangle = new Rectangle((int)position.X, (int)position.Y, 448, 1080); sourceRectangle = new Rectangle(448, 0, 448, 1080); characterSystem = new CharacterSystem(position, tabManager); }