Ejemplo n.º 1
0
    /*
     * Hit
     * @param Puck puck
     */
    public bool Hit(Puck puck)
    {
        if(!hitTimer.running)
        {
            //	We're an ordered target, check with headquarters that there are none in higher priority at play
            if(priority > 0)
            {
                if(!LowestPriority())
                {
                    return false;
                }
            }

            else if(reinforced)
            {
                UnReinforce();
                puck.validHit = true;
                return false;
            }
            else if(hazardous)
            {
                puck.HitHazard();
                GetComponent<Animator>().SetTrigger("Hit");
                GetHit();
                return false;
            }

            GetComponent<Animator>().SetTrigger("Hit");
            GetHit();
            return true;
        }
        return false;
    }