public FightThread(StoryThread pre, Narration[] fightScript, StoryThread win, StoryThread loss) :
     base(fightScript)
 {
     preFight   = pre;
     winScript  = win;
     lossScript = loss;
 }
Esempio n. 2
0
 public static void newNarration(StoryThread n)
 {
     instance.activeThread    = n;
     instance.activeNarration = instance.activeThread.GetNext();
     midLoad = true;
     instance.updateUI();
 }
Esempio n. 3
0
        // Populates the SceneLibrary with new StoryThreads from the CSV
        public static void ParseScenes(string resourcePath)
        {
            List <List <string> > csv = ParseCSV(resourcePath);
            StoryThread           pre;   // pre-scene in fights/flashbacks
            StoryThread           post1; // post-scene in fights (win)/flashbacks
            StoryThread           post2; // post-scene for lost fights
            List <Narration>      builder = new List <Narration>();

            for (int i = 0; i < csv.Count; i++)
            {
                if (csv[i][0] == "NULL")
                {
                    Debug.Log("We found a null!");
                }
                else
                {
                    switch (csv[i][1])
                    {
                    // Simple Story Thread
                    case "S":
                    case "s":
                        for (int j = 2; j < csv[1].Count; j += 2)
                        {
                            switch (csv[i][j])
                            {
                            case "Q":
                            case "q":
                                builder.Add(QuestionLibrary[csv[i][j + 1]]);
                                break;

                            case "D":
                            case "d":
                                builder.Add(DialogueLibrary[csv[i][j + 1]]);
                                break;
                            }
                        }
                        SceneLibrary.Add(csv[i][0], new StoryThread(builder.ToArray()));
                        builder = new List <Narration>();
                        break;

                    // Fight Story Thread
                    case "F":
                    case "f":
                        try
                        {
                            pre = SceneLibrary[csv[i][3]];
                        }
                        catch (Exception e)
                        {
                            pre = new StoryThread(new Narration[0]);
                        }

                        try
                        {
                            post1 = SceneLibrary[csv[i][7]];
                        }
                        catch (Exception e)
                        {
                            post1 = new StoryThread(new Narration[0]);
                        }

                        try
                        {
                            post2 = SceneLibrary[csv[i][9]];
                        }
                        catch (Exception e)
                        {
                            post2 = new StoryThread(new Narration[0]);
                        }

                        SceneLibrary.Add(csv[i][0], new FightThread(pre, SceneLibrary[csv[i][5]].thread, post1, post2));
                        break;

                    // Flashback Story Thread
                    case "M":
                    case "m":
                        try
                        {
                            pre = SceneLibrary[csv[i][3]];
                        }
                        catch (Exception e)
                        {
                            pre = new StoryThread(new Narration[0]);
                        }

                        try
                        {
                            post1 = SceneLibrary[csv[i][7]];
                        }
                        catch (Exception e)
                        {
                            post1 = new StoryThread(new Narration[0]);
                        }

                        SceneLibrary.Add(csv[i][0], new FlashbackThread(pre, SceneLibrary[csv[i][5]].thread, csv[i][4], post1));
                        break;
                    }
                }
            }
        }
    private int state; // 0 - pre memory, 1 - in memory, 2 - post memory

    public FlashbackThread(StoryThread pre, Narration[] mem, string scene, StoryThread post) : base(mem)
    {
        preMemory  = pre;
        this.scene = scene;
        postMemory = post;
    }