示例#1
0
    /// <summary>
    /// starts the quest by calling an ActivateQuestEventInfo;
    /// </summary>
    public void StartTheQuest()
    {
        if (lampRenderer == null)
        {
            lampRenderer = lamp.GetComponent <Renderer>();
        }
        ActivateQuestEventInfo aqei = new ActivateQuestEventInfo {
            eventQuestID = questID
        };

        EventHandeler.Current.FireEvent(EventHandeler.EVENT_TYPE.ActivateQuest, aqei);
        started = true;
        lampRenderer.material = activeQuest;
    }
示例#2
0
    /// <summary>
    /// Called when the QuestComponent is reacting to a callback event that activates a quest;
    /// If the activated quest is an escort quest, its progress will be filled with cows already captured;
    /// </summary>
    /// <param name="eventInfo">ActivateQuestEventInfo;</param>
    private static void ActivateQuest(EventInfo eventInfo)
    {
        ActivateQuestEventInfo activate = (ActivateQuestEventInfo)eventInfo;

        if (quests.ContainsKey(activate.eventQuestID))
        {
            quests[activate.eventQuestID].SetActiveQuest();
            questLog.Add(activate.eventQuestID, quests[activate.eventQuestID]);
            if (questLog[activate.eventQuestID].QuestType.TypeOfGoal.Equals(GoalType.Escort))
            {
                questLog[activate.eventQuestID].QuestType.AddCollectedCows(collectedCows - 1);
                questLog[activate.eventQuestID].IncreaseQuestProgress();
            }
        }
    }
示例#3
0
    /// <summary>
    /// Reacts to a ActivateQuestEvent callback;
    /// Adds a quest name to the UI questLog so the player can see it;
    /// </summary>
    /// <param name="eventInfo">ActivateQuestEvent</param>
    private void ActivateQuest(EventInfo eventInfo)
    {
        ActivateQuestEventInfo aqei = (ActivateQuestEventInfo)eventInfo;

        questIndex.Add(aqei.eventQuestID);
    }