Example #1
0
/*--------------------------------------------------------------------------------------*/
/*																						*/
/*	SteerConversationTimer: Player steers conversation for x seconds					*/
/*		param: float seconds - how many seconds the function waits for                  */
/*																						*/
/*--------------------------------------------------------------------------------------*/
    IEnumerator SteerConversationTimer(float seconds)
    {
        //	Makes the player keep click until the number of seconds is done
        yield return(new WaitForSeconds(seconds));

        //	Checks if conversation steerer reached 0 [This can change easily]
        if (conversation.GetComponent <Conversation>().conversationSteerer.value == 0)
        {
            //	If the conversatin takes a bad turn a friend's suspicion is raised
            m_FriendReference.RaiseSuspicion();

            //	We are done with the conversation steering slider so we hide it
            conversation.transform.localScale = m_Hide;

            //	We no longer want the slider to move
            conversation.GetComponent <Conversation>().startSlider = false;

            //	We are no longer attempting to steer a conversation
            steerConversation = false;

            //	Sets a new starting comfort level in the case of a failure
            conversation.GetComponent <Conversation> ().SetComfortlevel(0.5f);

            //	These are put in place to make the movement from the failure state appear seemless
            if (conversationPasses[2])
            {
                currentLine = 32;
            }
            else if (conversationPasses[1])
            {
                currentLine = 24;
            }
            else if (conversationPasses[0])
            {
                currentLine = 10;
            }
        }

        /*-------------------This happens if we succeed---------------------------------*/

        //	We are done with the conversation steering slider so we hide it
        conversation.transform.localScale = m_Hide;

        //	We no longer want the slider to move
        conversation.GetComponent <Conversation>().startSlider = false;

        //	Rewards the player for perfroming well. The next conversation will be 50% easier based on how they perfromed
        comfortLevelReference = comfortLevelReference * 1.5f;

        //	We are no longer attempting to steer a conversation
        steerConversation = false;
    }