예제 #1
0
 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;
     }
 }
예제 #2
0
        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);
        }
예제 #3
0
 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);
     }
 }
예제 #4
0
        public void CreateWeapon(Vector2 startingPosition, Vector2 direction)
        {
            ProjectileHandler projectileHandler = ProjectileHandler.Instance;

            projectileHandler.CreateSwordWeapon(batch, startingPosition, direction, InventoryUtilities.convertSwordToInt(InventoryManager.Instance.SwordSlot));
        }