Exemplo n.º 1
0
 /// <summary>
 /// when you click on the potion you pick it up and whoever you click on next recieves it reduces charges by 1
 /// if you reclick the potion with a potion in hand it will put it back down increasing the charges by 1
 /// </summary>
 public void HoldingPotion()
 {
     //if you aren't holding the potion you will pick it up
     if (_isHolding == false && PersistantController.GetPotCharges() != 0)
     {
         _isHolding = true;
     }
     //if you are already holding the potion and reclick the potion icon it puts it back
     else if (_isHolding == true)
     {
         _isHolding = false;
     }
 }
Exemplo n.º 2
0
    private void LateUpdate()
    {
        //updates the charges whenever it is changed
        _chargesText.text = PersistantController.GetPotCharges().ToString();

        //updates potion image to follow mouse
        if (_isHolding == true)
        {
            _potionImage.transform.position = Input.mousePosition;
        }
        //returns potion to default position
        else if (_isHolding == false)
        {
            _potionImage.transform.position = _defaultPos;
        }
    }
Exemplo n.º 3
0
    // Gets character selected using the event and changes allyIndex to match the character selected character
    private void CharacterToHeal(MoveAttack charMA)
    {
        if (charMA.WhatAmI == CharacterType.Ally && _isHolding == true)
        {
            // reduces the charges
            PersistantController.SetPotCharges(PersistantController.GetPotCharges() - 1);

            _allyToHeal = charMA.GetComponent <AllyHealth>();
            if (_allyToHeal == null)
            {
                Debug.LogError("No AllyHealth attached to " + _allyToHeal.name);
            }

            HealCharacter();
            _isHolding = false;
        }
    }
 public PersistantFloorData(PersistantController persistCont)
 {
     _nextFloor     = persistCont.GetNextFloorNum();
     _nextFloorDiff = persistCont.GetNextFloorDifficulty();
     _potCharges    = PersistantController.GetPotCharges();
 }