Exemplo n.º 1
0
    public PickeableBuff PickBuff(int team)
    {
        PickeableBuff buffToReturn = currentBuff;

        if (currentBuff != PickeableBuff.None)
        {
            if (buff.activeInHierarchy)
            {
                buff.SetActive(false);
                buffCharge = 0;
                buffCoutner0.SetActive(false);
                buffCoutner1.SetActive(false);
                buffCoutner2.SetActive(false);
                buffCoutner3.SetActive(false);
            }

            if (currentBuff == PickeableBuff.semiHeal)
            {
                if (teamOfDeadHeal == team)
                {
                    return(PickeableBuff.None);
                }
                playerDeadHeal.SetActive(false);
            }
            currentBuff = PickeableBuff.None;
        }
        return(buffToReturn);
    }
Exemplo n.º 2
0
 public void SpawnPlayerDeadHeal(int team, bool isEnemy)
 {
     currentBuff    = PickeableBuff.semiHeal;
     teamOfDeadHeal = team;
     playerDeadHeal.SetActive(true);
     if (isEnemy)
     {
         playerDeadHeal.GetComponent <Renderer>().material.color = buffHealColor;
     }
     else
     {
         playerDeadHeal.GetComponent <Renderer>().material.color = fogColor;
     }
 }
Exemplo n.º 3
0
    public void SetBuffSpawner(CellType buffType)
    {
        isABuffSpawner = true;
        buffSpawner.SetActive(true);
        buffCharge = 2;
        Color currentBuffColor = buffHealColor;

        switch (buffType)
        {
        case CellType.BuffEnergize:
            currentBuffColor = buffEnergizeColor;
            buffToSpawn      = PickeableBuff.Energize;
            break;

        case CellType.BuffHeal:
            currentBuffColor = buffHealColor;
            buffToSpawn      = PickeableBuff.Heal;
            break;

        case CellType.BuffHaste:
            currentBuffColor = buffHasteColor;
            buffToSpawn      = PickeableBuff.Haste;
            break;

        case CellType.BuffMight:
            currentBuffColor = buffMightColor;
            buffToSpawn      = PickeableBuff.Might;
            break;
        }
        buff.GetComponent <Renderer>().material.color      = currentBuffColor;
        buffCoutner0.GetComponent <SpriteRenderer>().color = currentBuffColor;
        buffCoutner1.GetComponent <SpriteRenderer>().color = currentBuffColor;
        buffCoutner2.GetComponent <SpriteRenderer>().color = currentBuffColor;
        buffCoutner3.GetComponent <SpriteRenderer>().color = currentBuffColor;
        buffCoutner0.SetActive(true);
        buffCoutner1.SetActive(true);
    }
Exemplo n.º 4
0
    private void TickBuffSpawn()
    {
        buffCharge++;
        switch (buffCharge)
        {
        case 1:
            buffCoutner0.SetActive(true);
            break;

        case 2:
            buffCoutner1.SetActive(true);
            break;

        case 3:
            buffCoutner2.SetActive(true);
            break;

        case 4:
            buffCoutner3.SetActive(true);
            buff.SetActive(true);
            currentBuff = buffToSpawn;
            break;
        }
    }