public int getRequiredValue(InventoryController.colourNames colour)
 {
     if (colour == InventoryController.colourNames.Red)
     {
         return(redRequired);
     }
     else if (colour == InventoryController.colourNames.Orange)
     {
         return(orangeRequired);
     }
     else if (colour == InventoryController.colourNames.Yellow)
     {
         return(yellowRequired);
     }
     else if (colour == InventoryController.colourNames.Green)
     {
         return(greenRequired);
     }
     else if (colour == InventoryController.colourNames.Blue)
     {
         return(blueRequired);
     }
     else
     {
         return(0);
     }
 }
Exemple #2
0
    public bool checkRequirements(InventoryController.colourNames colour)
    {
        PotionInfo colour_reqs       = potion_data[colour];
        bool       meetsRequirements = true;

        foreach (InventoryController.colourNames shade in Enum.GetValues(typeof(InventoryController.colourNames)))
        {
            int required = colour_reqs.getRequiredValue(shade);
            int holding  = inventory.getColourValue(shade);
            if (holding < required)
            {
                meetsRequirements = false; continue;
            }
        }
        return(meetsRequirements);
    }
Exemple #3
0
 public void makePotion(InventoryController.colourNames colour)
 {
     if (!checkRequirements(colour))
     {
         Debug.Log(colour.ToString() + "Potion making failed!");
     }
     else
     {
         PotionInfo colour_reqs = potion_data[colour];
         foreach (InventoryController.colourNames shade in Enum.GetValues(typeof(InventoryController.colourNames)))
         {
             int required = colour_reqs.getRequiredValue(shade);
             inventory.removeCards(shade, required);
         }
         //Create Potion
     }
 }
 public void makePotion(InventoryController.colourNames colour)
 {
     Instantiate(potion_lookup[colour]);
     Cat.GetComponent <Animator>().SetTrigger("Match");
 }