Example #1
0
 private void HitMago(PlayerEffects player)
 {
     if (full)
     {
         int ChosenPotionEffect = Random.Range(0, System.Enum.GetValues(typeof(PotionEffect)).Length);//, potionVariants.Length);
         potionType = (PotionEffect)ChosenPotionEffect;
         player.AddEffect(potionType, 3);
         GameController.Instance.AddPoints(25, playerIndex);
     }
 }
Example #2
0
    /*K:
     * HitPlayer: função chamada quando a função deve "quebrar" em cima do player.
     *  - player é o player que deve sofrer os efeitos desta poção
     *
     *  - note que esta pontuação não está decrementando a potionCount
     */
    public void HitPlayer(PlayerEffects player)
    {
        player.AddEffect(potionType, potionDuration);

        //toca som de impacto com o player
        FMODUnity.RuntimeManager.PlayOneShot(impactEventString, transform.position);

        Throw _throw = player.gameObject.GetComponent <Throw>();

        Debug.Assert(_throw != null);
        //se quem arremessou é de outro time de quem foi acertado,
        if (_throw.throwerTeam != this.getThrower())
        {
            //incrementa pontuação:
            GameController.Instance.AddPoints(pointValueOnPlayer, this.getThrower());
            _throw.barFill.fillAmount += 0.2f;
        }

        Destroy(gameObject);
    }