示例#1
0
    private void PresentLine(DialogueText text)
    {
        UpdateAdvanceLockout();

        SpeakerName.Text = text.SpeakerName;
        SpeakerText.Text = text.SpeakerText;

        if (text.BGMOverride != null)
        {
            _maestro.ChangeTunes(text.BGMOverride);
        }

        if (text.OneShotClip != null)
        {
            _maestro.PlaySoundEffect(text.OneShotClip, 1.0f);
        }

        if (!string.IsNullOrEmpty(text.ConversationEvent))
        {
            if (DebugMode)
            {
                Debug.Log("Sending message " + text.ConversationEvent + " to own scripts...");
            }

            gameObject.SendMessage(text.ConversationEvent, SendMessageOptions.RequireReceiver);
        }

        if (!string.IsNullOrEmpty(text.ConversationGift))
        {
            _ambassador.GainItem(text.ConversationGift);
        }

        if (text.AltersProgression)
        {
            _ambassador.UpdateThread(
                text.QuestThreadName,
                text.ResultingQuestThreadPhase,
                text.ThreadQuestTitle,
                text.ThreadQuestDetails
                );

            gameObject.SendMessage("RefreshQuestDetails", SendMessageOptions.DontRequireReceiver);
        }

        if (text.CausesSelfDestruct)
        {
            if (DebugMode)
            {
                Debug.Log("Destroying current object, reverting flags, and re-acquiring list of text sources.");
            }

            Destroy(_currentThread.CallingGameObject);
            DialogueAvailable = false;
            GUIShowing        = false;

            _textProviders = (EntityText[])FindObjectsOfType(typeof(EntityText));
        }
    }
示例#2
0
    private void GiveSkillToFinder()
    {
        if (DebugMode)
        {
            Debug.Log("The player will learn " + SkillName);
        }

        _ambassador.GainItem(SkillName);
    }
示例#3
0
    private bool SetupObtainedItems(string itemLine)
    {
        string[] mainParts = itemLine.Split(':');
        if (mainParts.Length != 2 ||
            mainParts[0] != "Items")
        {
            return(false);
        }

        _ambassador.ItemList = new List <ObtainableItem>();

        string[] itemParts = mainParts[1].Split('|');
        foreach (string current in itemParts)
        {
            _ambassador.GainItem(current);
        }

        return(true);
    }