Esempio n. 1
0
    public void SelectAbility(int abilityID)
    {
        currentAbility = abilityID;

        //set info text
        Libraries.Ability ability    = game.libraries.abilities[abilityID];
        string            infoString = ability.name + ": " + ability.description + '\n';

        infoString          += ability.redCost + " red, " + ability.greenCost + " green, " + ability.blueCost + " blue";
        abilityInfoText.text = infoString;
    }
Esempio n. 2
0
    public void CastAbility(int targetID, float powerModifier)
    {
        if (currentAbility != 0) //make sure an ability is selected
        {
            Libraries.Ability ability = abilities[currentAbility];
            if (CheckPlasmids()) //check costs
            {
                //subtract costs
                plasmids[0] -= ability.redCost;
                plasmids[1] -= ability.greenCost;
                plasmids[2] -= ability.blueCost;

                game.CastAbility(targetID, currentAbility, powerModifier); //cast ability

                UpdatePlasmidText();
            }
        }
    }
Esempio n. 3
0
 public bool CheckPlasmids()
 {
     Libraries.Ability ability = abilities[currentAbility];
     return(plasmids[0] >= ability.redCost && plasmids[1] >= ability.greenCost && plasmids[2] >= ability.blueCost);
 }