Exemplo n.º 1
0
    /// <summary>
    /// Author: Nate hales
    /// Stuns the genbu. Use this for the Steampipes to stun Genbu
    /// </summary>
    /// <returns>The genbu.</returns>
    /// <param name="stunTime">Stun time.</param>
    public IEnumerator StunGenbu(GameObject toDestroy, float stunTime)
    {
        ThighBlaster tB = GetComponent <ThighBlaster>();

        if (tB.LFrontDamaged && !tB.LFrontBroken)
        {
            tB.LFrontBroken = true;
        }

        if (tB.RFrontDamaged && !tB.RFrontBroken)
        {
            tB.RFrontBroken = true;
        }

        if (tB.LBackDamaged && !tB.LBackBroken)
        {
            tB.LBackBroken = true;
        }

        if (tB.RBackDamaged && !tB.RBackBroken)
        {
            tB.RBackBroken = true;
        }

        nav.isStopped = true;
        nav.speed     = 0;

        stunned = true;

        yield return(new WaitForSeconds(stunTime));

        Destroy(toDestroy);

        nav.isStopped = false;
        nav.speed     = moveSpeed;

        //
        //Return back to Original Animation
        //

        stunned    = false;
        stopMoving = false;

        aggro = true;

        moveSpeed -= speedDecreaseWhenDamaged;         //Lost a leg slow down

        yield return(null);
    }
Exemplo n.º 2
0
    /// <summary>
    /// Author: nate hales
    /// USE this to destory the legs when sondra attack from the inside. Also Checks to see if Phase 3 needs to Begin
    /// Hides the legs.
    /// </summary>
    /// <param name="LegIndex">Leg index.</param>
    ///

    /*
     *  public void HideLegs(int LegIndex)
     * {
     *          Legs [LegIndex].SetActive (false);
     *          int brokenLegNum = 0;
     *          foreach (GameObject leg in Legs) {
     *                  if(leg.activeSelf == false){brokenLegNum++;}
     *          }
     *          if (brokenLegNum == Legs.Length) {
     *          //TODO: Begin Phase 3 and Turn this Genbu_AI Off.
     *          }
     * }
     */

    // YOU CAN CALL THIS IN OTHER SCRIPTS WITH '' GetComponent<Genbu_AI>().WeakPointHit(whoHitMe, shieldNo); ''
    // Preferably the script that deals with the Crossbow
    public IEnumerator WeakPointHit(string whoHitMe, GameObject obj, int legID) //Case sensitive, '' Wolf '' OR '' Sondra ''
    {
        ThighBlaster tB = GetComponent <ThighBlaster>();

        // Objective system leg was shot by crossbow
        for (int x = 0; x < _objectivesystem._Objectives.Count; x++)
        {
            if (_objectivesystem._Objectives [x].name == "Puncture legs")
            {
                _objectivesystem._Objectives [x].currentCount++;                 //Decrement
                if (_objectivesystem._Objectives [x].currentCount == _objectivesystem._Objectives [x].total)
                {
                    _objectivesystem._Objectives [x].bIsCompleted = true;
                }                                                                                                                                                                   //Check to see if the goal is finished
            }
        }

        if (legID == 0)
        {
            tB.LFrontDamaged = true;
            tB.LFrontBroken  = true;
        }

        else if (legID == 1)
        {
            tB.RFrontDamaged = true;
            tB.RFrontBroken  = true;
        }

        else if (legID == 2)
        {
            tB.LBackDamaged = true;
            tB.LBackBroken  = true;
        }

        else if (legID == 3)
        {
            tB.RBackDamaged = true;
            tB.RBackBroken  = true;
        }

        else
        {
            Debug.LogError("Wtf? I thought Genbu only has 4 legs?");
        }

        nav.isStopped = true;
        nav.speed     = 0;
        if (!stunnedWhenDamaged)
        {
            stopMoving = true;
        }

        else if (stunnedWhenDamaged)
        {
            stunned = true;
        }

        //
        //Run an animation
        //

        yield return(new WaitForSeconds(damageStun));

        nav.isStopped = false;
        nav.speed     = moveSpeed;

        moveSpeed -= speedDecreaseWhenDamaged; //Lost a leg slow down

        //
        //Return back to Original Animation
        //

        stopMoving = false;
        stunned    = false;
        aggro      = true;


        if (whoHitMe == "Wolf")
        {
            wolfRageIntensity = sondraRageIntensity + wolfRageAdder;
            if (wolfRageIntensity > sondraRageIntensity)
            {
                sondraRageIntensity = sondraRageIntensity / 2;
            }
        }

        else if (whoHitMe == "Sondra")
        {
            sondraRageIntensity = wolfRageIntensity + sondraRageAdder;
            if (sondraRageIntensity > wolfRageIntensity)
            {
                wolfRageIntensity = wolfRageIntensity / 2;
            }
        }

        else
        {
            Debug.LogError("Remember, case sensitive. Genbu doesn't recognize: " + whoHitMe);
        }
        yield return(null);
    }
Exemplo n.º 3
0
    /*too much of a hassle just hard code this
     *[Header("0 = genbu, 1 = snake genbu, 2 = Forgemaster, 3 = Disir")]
     * public string[] nameOfVictoryScenes;*/

    /// <summary>
    /// Runs through all avalible objectives and updates weather or not they are completed.
    /// </summary>
    public void UpdateObjectives()
    {
        int numCompleted = 0; //Talles for checking if all objectives are finished

        for (int x = 0; x < _Objectives.Count; x++)
        {
            //Set the toggel to the same as the objectives complete bool.
            objectiveDisplay[x].isOn = _Objectives[x].bIsCompleted;

            //storage string
            string displayText;

            if (_Objectives[x].total > 0)
            {
                //Display the count and total.
                displayText = _Objectives[x].description + _Objectives[x].currentCount + "/" + _Objectives[x].total;
            }
            else
            {
                //Just show the objective.
                displayText = _Objectives[x].description;
            }

            //Assign the Display string for all to read.
            objectiveDisplay[x].GetComponentInChildren <Text>().text = displayText;
        }

        if (currentBoss == _Boss.Genbu)
        {
            //Talk to Objective system plate has fallen off
            for (int x = 0; x < _Objectives.Count; x++)
            {
                if (_Objectives[x].name == "broken legs")
                {
                    ThighBlaster _blaster = GameObject.FindObjectOfType <ThighBlaster>();
                    _Objectives[x].currentCount = _blaster.numBroken; //set the count to that of the number of broken legs.

                    // print("Numbroken: " + _Objectives[x].currentCount);
                    if (_Objectives[x].currentCount == _Objectives[x].total)
                    {
                        _Objectives[x].bIsCompleted = true;
                    }                                                                                                //Check to see if the goal is finished
                }
                else if (_Objectives[x].name == "armoured plating")
                {
                    if (_Objectives[x].currentCount == _Objectives[x].total)
                    {
                        _Objectives[x].bIsCompleted = true;
                    }                                                                                                    //Check to see if the goal is finished
                }
            }
        }

        if (currentBoss == _Boss.Snake_Genbu)
        {
            //find the snake boss's health class
            Boss_Health _HP = FindObjectOfType <Boss_Health>();
            //If the snake is dead set the objective completion to true
            if (_HP.health <= 0f)
            {
                _Objectives[0].bIsCompleted = true;
            }
        }



        foreach (ObjectiveData objective in _Objectives)
        {
            if (objective.bIsCompleted == true)
            {
                numCompleted++;     //add a tick
            }
        }

        //when all the obectives are complete.
        if (numCompleted >= _Objectives.Count)
        {
            //load the next scene.
            //UnityEngine.SceneManagement.SceneManager.LoadScene(GetNextScene());
            GameManager.GM.PlayerWon(currentBoss);
        }
    }