Example #1
0
    // Use this for initialization
    void Start()
    {
        QuestGenerator qg = QuestGenerator.Instance();

        Quest example;
        int   questType = Random.Range(0, 3);         // Example quest type

        if (questType == 0)
        {
            // Generate a knowledge quest
            example = qg.GetQuest("knowledge", 8);
        }
        else if (questType == 1)
        {
            // Generate a comfort quest
            example = qg.GetQuest("comfort", 8);
        }
        else
        {
            // Generate a justice quest
            example = qg.GetQuest("justice", 8);
        }

        // Render the quest nodes to the UI
        QuestRender qr = GetComponent <QuestRender> ();

        qr.DisplayQuest(example);

        // Read the quest and display the step
        QuestReader qReader = GetComponent <QuestReader> ();

        qReader.ReadQuest(example);
    }
Example #2
0
    public void Initialize(ItemData item)
    {
        QuestGenerator qg = QuestGenerator.Instance();

        List <List <string> > patterns = new List <List <string> > ();

        patterns.Add(new List <string> {
        });
        patterns.Add(new List <string> {
            "kill", "loot"
        });


        foreach (string act in patterns[Random.Range(0, patterns.Count)])
        {
            if (act == "goto")
            {
                subActions.Add(new Goto(qg.GetLocation()));
            }
            else if (act == "loot")
            {
                subActions.Add(new Loot(item));
            }
            else if (act == "kill")
            {
                subActions.Add(new Kill(qg.GetEnemy(item)));
            }
        }
    }
    public void Initialize(ItemData item, EnemyData enemy)
    {
        QuestGenerator qg = QuestGenerator.Instance();

        List <List <string> > patterns = new List <List <string> > ();

        patterns.Add(new List <string> {
            "goto"
        });
        patterns.Add(new List <string> {
        });

        foreach (string act in patterns[Random.Range(0, patterns.Count)])
        {
            if (act == "goto")
            {
                subActions.Add(new Goto(enemy.location));
            }
        }
    }
Example #4
0
    public void Initialize(EnemyData enemy)
    {
        QuestGenerator qg = QuestGenerator.Instance();

        List <List <string> > patterns = new List <List <string> > ();

        patterns.Add(new List <string> {
            "listen"
        });
        patterns.Add(new List <string> {
        });

        foreach (string act in patterns[Random.Range(0, patterns.Count)])
        {
            if (act == "listen")
            {
                subActions.Add(new Listen(enemy));
            }
        }
    }
    public void Initialize(LocationData about)
    {
        QuestGenerator qg = QuestGenerator.Instance();

        List <List <string> > patterns = new List <List <string> > ();

        patterns.Add(new List <string> {
            "kill", "loot", "use"
        });
        patterns.Add(new List <string> {
            "get", "use"
        });
        patterns.Add(new List <string> {
            "listen"
        });

        List <string> pattern = patterns [Random.Range(0, patterns.Count)];

        this.subActions = qg.assignActions(pattern);
    }