Exemplo n.º 1
0
    public static List <SimpleEncounterData> Parse(string path)
    {
        var res = new List <SimpleEncounterData>();

        using (BinaryReader b = new BinaryReader(File.Open(path, FileMode.Open)))
        {
            while (b.BaseStream.Position != b.BaseStream.Length)
            {
                var m = new SimpleEncounterData();
                for (int i = 0; i < 4; ++i)
                {
                    var codes = new short[8];
                    for (int j = 0; j < 8; ++j)
                    {
                        codes[j] = Convert.ToInt16(b.ReadByte());
                    }
                    m.ChoiceCodes[i] = codes;
                }
                ;

                for (int i = 0; i < 4; ++i)
                {
                    var args = new short[8];
                    for (int j = 0; j < 8; ++j)
                    {
                        args[j] = b.ReadInt16().SwapBytes();
                    }
                    m.ChoiceArgs[i] = args;
                }

                for (int i = 0; i < 4; ++i)
                {
                    m.ChoiceResultIndex[i] = Convert.ToInt16(b.ReadByte());
                }

                m.CanBackout = b.ReadByte();
                m.MaxTimes   = b.ReadByte();
                m.Unknown    = b.ReadInt16().SwapBytes();
                m.Prompt     = b.ReadInt16().SwapBytes();

                for (int i = 0; i < 4; ++i)
                {
                    m.OptionTexts[i] = RawText.Parse(b, 79).ToString();
                }

                res.Add(m);
            }
        }



        return(res);
    }
Exemplo n.º 2
0
    public static List <string> Parse(string path)
    {
        using (BinaryReader b = new BinaryReader(File.Open(path, FileMode.Open)))
        {
            var res = new List <string>();
            while (b.BaseStream.Position != b.BaseStream.Length)
            {
                res.Add(RawText.Parse(b, 255).ToString());
            }

            return(res);
        }
    }