public void AddToInventory(ItemType type) { inventory[type] += InventoryUtilities.itemsCollectedPerItem(type); if (inventory[type] > InventoryUtilities.maxItemCount(type)) { inventory[type] = InventoryUtilities.maxItemCount(type); } playItemSounds(type); if (ItemSlot == ItemType.None) { slotB = ItemType.None; foreach (ItemType possibleNext in InventoryUtilities.EquipableItemsList) { if (canEquip(possibleNext)) { slotB = possibleNext; break; } } } if (InventoryUtilities.SwordsList.Contains(type) && InventoryUtilities.convertSwordToInt(type) > InventoryUtilities.convertSwordToInt(slotA)) { slotA = type; } }
public void CreateMagicFireball(Vector2 startingPosition, Vector2 direction) { ProjectileHandler projectileHandler = ProjectileHandler.Instance; projectileHandler.CreateSwordWeapon(batch, startingPosition, direction, InventoryUtilities.convertSwordToInt(InventoryManager.ItemType.MagicalRod)); projectileHandler.CreateMagicFireball(batch, startingPosition, direction); }
public void ChangeWeapon(int index) { InventoryManager.ItemType type = InventoryUtilities.convertIntToSword(index); if (!InventoryUtilities.SwordsList.Contains(type)) { return; } if (InventoryUtilities.convertSwordToInt(InventoryManager.Instance.SwordSlot) < index) { InventoryManager.Instance.SwordSlot = InventoryUtilities.convertIntToSword(index); } }
public void CreateWeapon(Vector2 startingPosition, Vector2 direction) { ProjectileHandler projectileHandler = ProjectileHandler.Instance; projectileHandler.CreateSwordWeapon(batch, startingPosition, direction, InventoryUtilities.convertSwordToInt(InventoryManager.Instance.SwordSlot)); }