예제 #1
0
    private bool CheckIfCanShowOption(DialogueOption option)
    {
        if (option.excludedReactions.Count > 0)
        {
            List <NpcReaction> excluded = option.excludedReactions.FindAll(r => r == npc.reaction);
            if (excluded.Count > 0)
            {
                return(false);
            }
        }

        if (option.getQuestId() != -1)
        {
            int questId = option.getQuestId();
            if (option.questStatus == npc.quests[questId].status)
            {
                if (option.questStatus == QuestStatus.IN_PROGRESS)
                {
                    return(npc.quests[questId].IsFinnished());
                }

                return(true);
            }

            return(false);
        }

        if (option.reactionTrigger == NpcReaction.Any)
        {
            return(true);
        }

        if (option.reactionTrigger == npc.reaction)
        {
            return(true);
        }

        return(false);
    }