//------------------------------ENEMY FIRING------------------------------



    public void EnemyTurn()
    {
        //	Debug.Log ("Enemyturn function in battlecontroller activated");
        float probability = Time.deltaTime * shotsPerSeconds;

        if (enemyattackpoints > 1)
        {
            if (Random.value < probability)
            {
                //Debug.Log("EnemyRPGFire enemyturn - enemy attack points are greater than 1 active");
                //Debug.Log("Enemy RPG Fire enemyattack points inside enemyturn function is " + enemyattackpoints);
                enemyFire();
                enemyattackpoints = enemyattackpoints - 50;
            }
        }
        else
        {
            enemyattackpoints = 100f;

            playercontroller.evade = PlayerPrefs.GetFloat("EVADE");

            playercontroller.playerAnimator.SetBool("Evade", false);

            playercontroller.playerAnimator.SetBool("Evade2", false);

            playercontroller.playerAnimator.SetBool("Evade3", false);

            battlecontroller.EndTurn();

            playercontroller.evadeOn = false;
        }
    }
    //------------------------------ENEMY FIRING------------------------------



    public void EnemyTurn()
    {
        //	Debug.Log ("Enemyturn function in battlecontroller activated");
        float probability = Time.deltaTime * shotsPerSeconds;

        if (Random.value < probability)
        {
            if (enemyattackpoints > 1)
            {
                //Debug.Log("EnemyRPGFire enemyturn - enemy attack points are greater than 1 active");
                //Debug.Log("Enemy RPG Fire enemyattack points inside enemyturn function is " + enemyattackpoints);
                enemyFire();
                enemyattackpoints = enemyattackpoints - 50;
            }
            else
            {
                enemyattackpoints = 100f;
                battlecontroller.EndTurn();
            }
        }
    }
示例#3
0
    //-------------------END TURN DO ATTACKS

    public void EndTurnDoAttacks()
    {
        if (battlecontroller.playerTurn)
        {
            if (Move1.text == "Firing Primary Weapon")
            {
                FirePrimaryAtTurnEnd();
                //Invoke ("FirePrimaryAtTurnEnd", 1);
            }
            if (Move1.text == "Firing Plasma Weapon")
            {
                FirePlasmaAtTurnEnd();
            }


            if (Move2.text == "Firing Primary Weapon")
            {
                Invoke("FirePrimaryAtTurnEnd", 1.5f);
            }
            if (Move2.text == "Firing Plasma Weapon")
            {
                Debug.Log("MOVe1 is equal to plasma fire");
                Invoke("FirePlasmaAtTurnEnd", 1.5f);
            }



            if (Move3.text == "Firing Primary Weapon")
            {
                Invoke("FirePrimaryAtTurnEnd", 2);
            }
            if (Move3.text == "Firing Plasma Weapon")
            {
                Invoke("FirePlasmaAtTurnEnd", 2f);
            }



            if (Move4.text == "Firing Primary Weapon")
            {
                Invoke("FirePrimaryAtTurnEnd", 3);
            }
            if (Move4.text == "Firing Plasma Weapon")
            {
                Invoke("FirePlasmaAtTurnEnd", 3f);
            }



            if (Move5.text == "Firing Primary Weapon")
            {
                Invoke("FirePrimaryAtTurnEnd", 4);
            }
            if (Move5.text == "Firing Plasma Weapon")
            {
                Invoke("FirePlasmaAtTurnEnd", 4f);
            }



            if (Move6.text == "Firing Primary Weapon")
            {
                Invoke("FirePrimaryAtTurnEnd", 5);
            }
            if (Move6.text == "Firing Plasma Weapon")
            {
                Invoke("FirePlasmaAtTurnEnd", 5f);
            }
            battlecontroller.EndTurn();
        }
    }