Beispiel #1
0
    public void talk()
    {
        for (int i = dialogues.Length - 1; i >= 0; i--)
        {
            bool skipFirst = false;
            foreach (Quest q in dialogues[i].questsToAcess)
            {
                Debug.Log("FIRST_DIALOGUE: " + dialogues[i].dialogues[0] + " | " + q.getStatus() + " | " + q.getId());
                Quest playerq = player.lookupQuest(q.getId());
                if (playerq != null)
                {
                    if (playerq.getStatus() != e_QuestStatus.TURNED_IN)
                    {
                        skipFirst = true;
                        continue;
                    }
                }
                if (q.getStatus() == e_QuestStatus.NOT_STARTED)
                {
                    //skipFirst = true;
                    //continue;
                }
                else
                {
                    if (playerq != null)
                    {
                        if (playerq.getStatus() != q.getStatus())
                        {
                            skipFirst = true;
                            continue;
                        }
                    }
                    else
                    {
                        skipFirst = true;
                        continue;
                    }
                }
            }
            if (skipFirst)
            {
                continue;
            }

            currentDialoguePlaying = dialogues[i];
            currentDialoguePlaying.setId(i);
            canTalk   = false;
            isTalking = true;
            Debug.Log("REAL_DIALOGUE: " + dialogues[i].dialogues[0] + " | " + currentDialoguePlaying);
            return;
        }
    }