Ejemplo n.º 1
0
    public virtual void EnemyAttack(GameObject bully)
    {
        bullyBaseClass_ = bully.GetComponent <EnemyBaseClass>();

        int attackSelector = Random.Range(0, 100);

        bullyBaseClass_.EnemyStopMotion(bully);

        //	m_EnemyInMotion = false; //prevent continued motion of the bully
        if (attackSelector <= m_AttackPunchOdds)      //If attack selector is less than the odds of punching
        {
            bullyBaseClass_.EnemyAttackPunch(bully);  //PAWNCH
        }
        else if (attackSelector <= m_AttackKickOdds)  //not less than Punch odds, so check if less than kick odds
        {
            bullyBaseClass_.EnemyAttackKick(bully);   //Kick
        }
        else if (attackSelector >= m_AttackKickOdds)  //must be greater than kick odds by now so Unique Attack is called
        {
            bullyBaseClass_.EnemyAttackUnique(bully); //
        }

        else if (attackSelector >= m_AttackKickOdds)  //must be greater than kick odds by now so Unique Attack is called
        {
            bullyBaseClass_.EnemyAttackUnique(bully); //
        }
    }