示例#1
0
        public override int Serialize(byte[] codeplugContents, int address)
        {
            var contents = new byte[CONTENTS_LENGTH + (HasExtraByte ? 1 : 0)].AsSpan();

            Unknown1.CopyTo(contents.Slice(UNKNOWN1, 13));
            Unknown2.CopyTo(contents.Slice(UNKNOWN2, 9));
            contents[RSSI] = (byte)(RssiAlignment & 0b01111111);
            Unknown3.CopyTo(contents.Slice(UNKNOWN3, 2));
            contents[MIC_GAIN]  = (byte)((InternalMicPreAmpGain & 0b111) << 5);
            contents[MIC_GAIN] |= (byte)((ExternalMicPreAmpGain & 0b111) << 2);
            contents[MIC_GAIN] |= (byte)(UnknownMicBits & 0b11);
            Unknown4.CopyTo(contents.Slice(UNKNOWN4, 9));
            Unknown5.CopyTo(contents.Slice(UNKNOWN5, 4));
            if (HasExtraByte)
            {
                contents[UNKNOWNEXTRABYTE] = UnknownExtraByte;
            }

            var nextAddress = address + contents.Length + BlockSizeAdjustment;

            nextAddress = SerializeChild(Block06, BLOCK_06_VECTOR, codeplugContents, nextAddress, contents);
            nextAddress = SerializeChild(Block03, BLOCK_03_VECTOR, codeplugContents, nextAddress, contents);
            nextAddress = SerializeChild(Block0C, BLOCK_0C_VECTOR, codeplugContents, nextAddress, contents);
            nextAddress = SerializeChild(Block0F, BLOCK_0F_VECTOR, codeplugContents, nextAddress, contents);
            nextAddress = SerializeChild(Block11, BLOCK_11_VECTOR, codeplugContents, nextAddress, contents);
            Serializer(codeplugContents, address, contents);
            return(nextAddress);
        }
示例#2
0
            /// <summary>
            /// Writes the data element into the given buffer (at its current position).
            /// </summary>
            /// <param name="buffer">The buffer where the data element should be deserialized into.</param>
            public void WriteData(RAMBuffer buffer)
            {
                buffer.WriteUShort((ushort)PlayerName.Length);
                buffer.WriteString(PlayerName);
                buffer.WriteFloat(InitialCameraX);
                buffer.WriteFloat(InitialCameraY);
                buffer.WriteShort(UnknownX);
                buffer.WriteShort(UnknownY);
                buffer.WriteByte(AlliedVictory);

                ScenarioDataElementTools.AssertTrue(Diplomacy1.Count == Diplomacy2.Count);
                buffer.WriteUShort((ushort)Diplomacy1.Count);
                Diplomacy1.ForEach(d => buffer.WriteByte((byte)d));
                Diplomacy2.ForEach(d => buffer.WriteUInteger((uint)d));

                buffer.WriteUInteger(Color);
                buffer.WriteFloat(Unknown1);
                buffer.WriteUShort(Unknown3Count);

                if (Unknown1 == 2)
                {
                    ScenarioDataElementTools.AssertListLength(Unknown2, 8);
                    Unknown2.ForEach(b => buffer.WriteByte(b));
                }

                ScenarioDataElementTools.AssertListLength(Unknown3, Unknown3Count * 44);
                Unknown3.ForEach(b => buffer.WriteByte(b));

                ScenarioDataElementTools.AssertListLength(Unknown4, 7);
                Unknown4.ForEach(b => buffer.WriteByte(b));

                buffer.WriteInteger(Unknown5);
            }
示例#3
0
 public void ImportData()
 {
     BrakeParts.Import();
     BrakeControllerParts.Import();
     SteerParts.Import();
     ChassisParts.Import();
     LightweightParts.Import();
     RacingModifyParts.Import();
     EngineParts.Import();
     PortPolishParts.Import();
     EngineBalanceParts.Import();
     DisplacementParts.Import();
     ComputerParts.Import();
     NATuneParts.Import();
     TurbineKitParts.Import();
     DrivetrainParts.Import();
     FlywheelParts.Import();
     ClutchParts.Import();
     PropellerShaftParts.Import();
     GearParts.Import();
     SuspensionParts.Import();
     IntercoolerParts.Import();
     MufflerParts.Import();
     LSDParts.Import();
     TiresFrontParts.Import();
     TiresRearParts.Import();
     Unknown1.Import();
     Unknown2.Import();
     Unknown3.Import();
     Unknown4.Import();
     Unknown5.Import();
     Unknown6.Import();
     Unknown7.Import();
     Cars.Import();
 }
示例#4
0
 public void Serialize(BitWriter bw, UInt32 netVersion)
 {
     bw.Write(Unknown1);
     bw.Write(Unknown2);
     bw.Write(Unknown3);
     Unknown4.Serialize(bw, netVersion);
     bw.Write(Unknown5);
     bw.Write(Unknown6);
 }
 public void Serialize(BitWriter bw)
 {
     bw.Write(Unknown1);
     bw.Write(Unknown2);
     bw.Write(Unknown3);
     Unknown4.Serialize(bw);
     bw.Write(Unknown5);
     bw.Write(Unknown6);
     bw.Write(Unknown2);
 }
示例#6
0
        public void ReadData(string filename)
        {
            using (FileStream file = new FileStream(filename, FileMode.Open, FileAccess.Read))
            {
                var blocks = new List <DataBlock>();

                for (int i = 1; i <= 34; i++)
                {
                    file.Position = 8 * i;
                    uint blockStart = file.ReadUInt();
                    uint blockSize  = file.ReadUInt();
                    blocks.Add(new DataBlock {
                        BlockStart = blockStart, BlockSize = blockSize
                    });
                }

                BrakeParts.Read(file, blocks[0].BlockStart, blocks[0].BlockSize);
                BrakeControllerParts.Read(file, blocks[1].BlockStart, blocks[1].BlockSize);
                SteerParts.Read(file, blocks[2].BlockStart, blocks[2].BlockSize);
                ChassisParts.Read(file, blocks[3].BlockStart, blocks[3].BlockSize);
                LightweightParts.Read(file, blocks[4].BlockStart, blocks[4].BlockSize);
                RacingModifyParts.Read(file, blocks[5].BlockStart, blocks[5].BlockSize);
                EngineParts.Read(file, blocks[6].BlockStart, blocks[6].BlockSize);
                PortPolishParts.Read(file, blocks[7].BlockStart, blocks[7].BlockSize);
                EngineBalanceParts.Read(file, blocks[8].BlockStart, blocks[8].BlockSize);
                DisplacementParts.Read(file, blocks[9].BlockStart, blocks[9].BlockSize);
                ComputerParts.Read(file, blocks[10].BlockStart, blocks[10].BlockSize);
                NATuneParts.Read(file, blocks[11].BlockStart, blocks[11].BlockSize);
                TurbineKitParts.Read(file, blocks[12].BlockStart, blocks[12].BlockSize);
                DrivetrainParts.Read(file, blocks[13].BlockStart, blocks[13].BlockSize);
                FlywheelParts.Read(file, blocks[14].BlockStart, blocks[14].BlockSize);
                ClutchParts.Read(file, blocks[15].BlockStart, blocks[15].BlockSize);
                PropellerShaftParts.Read(file, blocks[16].BlockStart, blocks[16].BlockSize);
                GearParts.Read(file, blocks[17].BlockStart, blocks[17].BlockSize);
                SuspensionParts.Read(file, blocks[18].BlockStart, blocks[18].BlockSize);
                IntercoolerParts.Read(file, blocks[19].BlockStart, blocks[19].BlockSize);
                MufflerParts.Read(file, blocks[20].BlockStart, blocks[20].BlockSize);
                LSDParts.Read(file, blocks[21].BlockStart, blocks[21].BlockSize);
                TiresFrontParts.Read(file, blocks[22].BlockStart, blocks[22].BlockSize);
                TiresRearParts.Read(file, blocks[23].BlockStart, blocks[23].BlockSize);
                Unknown1.Read(file, blocks[24].BlockStart, blocks[24].BlockSize);
                Unknown2.Read(file, blocks[25].BlockStart, blocks[25].BlockSize);
                Unknown3.Read(file, blocks[26].BlockStart, blocks[26].BlockSize);
                Unknown4.Read(file, blocks[27].BlockStart, blocks[27].BlockSize);
                Unknown5.Read(file, blocks[28].BlockStart, blocks[28].BlockSize);
                Unknown6.Read(file, blocks[29].BlockStart, blocks[29].BlockSize);
                Events.Read(file, blocks[30].BlockStart, blocks[30].BlockSize);
                EnemyCars.Read(file, blocks[31].BlockStart, blocks[31].BlockSize);
                Cars.Read(file, blocks[32].BlockStart, blocks[32].BlockSize);
                CarsSports.Read(file, blocks[33].BlockStart, blocks[33].BlockSize);

                uint stringTableStart = blocks[33].BlockStart + blocks[33].BlockSize;
                RaceStringTable.Read(file, stringTableStart, (uint)file.Length - stringTableStart);
            }
        }
示例#7
0
        public void WriteData(string filename)
        {
            using (FileStream file = new FileStream(filename, FileMode.Create, FileAccess.ReadWrite))
            {
                file.Write(new byte[] { 0x47, 0x54, 0x44, 0x54, 0x6C, 0x00, 0x3E, 0x00 }, 0, 8); // The 0x3E is the number of indices

                file.Position = (0x3E * 8) + 7;
                file.WriteByte(0x00); // Data starts at 0x1F8 so position EOF

                uint i = 1;
                BrakeParts.Write(file, 8 * i++);
                BrakeControllerParts.Write(file, 8 * i++);
                SteerParts.Write(file, 8 * i++);
                ChassisParts.Write(file, 8 * i++);
                LightweightParts.Write(file, 8 * i++);
                RacingModifyParts.Write(file, 8 * i++);
                EngineParts.Write(file, 8 * i++);
                PortPolishParts.Write(file, 8 * i++);
                EngineBalanceParts.Write(file, 8 * i++);
                DisplacementParts.Write(file, 8 * i++);
                ComputerParts.Write(file, 8 * i++);
                NATuneParts.Write(file, 8 * i++);
                TurbineKitParts.Write(file, 8 * i++);
                DrivetrainParts.Write(file, 8 * i++);
                FlywheelParts.Write(file, 8 * i++);
                ClutchParts.Write(file, 8 * i++);
                PropellerShaftParts.Write(file, 8 * i++);
                GearParts.Write(file, 8 * i++);
                SuspensionParts.Write(file, 8 * i++);
                IntercoolerParts.Write(file, 8 * i++);
                MufflerParts.Write(file, 8 * i++);
                LSDParts.Write(file, 8 * i++);
                TiresFrontParts.Write(file, 8 * i++);
                TiresRearParts.Write(file, 8 * i++);
                Unknown1.Write(file, 8 * i++);
                Unknown2.Write(file, 8 * i++);
                Unknown3.Write(file, 8 * i++);
                Unknown4.Write(file, 8 * i++);
                Unknown5.Write(file, 8 * i++);
                Unknown6.Write(file, 8 * i++);
                Unknown7.Write(file, 8 * i++);
                Cars.Write(file, 8 * i++);

                file.Position = 0;
                using (FileStream zipFile = new FileStream(filename + ".gz", FileMode.Create, FileAccess.Write))
                {
                    using (GZipStream zip = new GZipStream(zipFile, CompressionMode.Compress))
                    {
                        file.CopyTo(zip);
                    }
                }
            }
        }
示例#8
0
        public override void SetListBytes(ref List <byte> listBytes)
        {
            sectionIdentifier = Section.LEDR;

            int previousSize = listBytes.Count;

            if (LevelLabel.Length > 64)
            {
                LevelLabel = new string(LevelLabel.Take(64).ToArray());
            }
            foreach (char c in LevelLabel)
            {
                listBytes.Add((byte)c);
            }
            for (int i = LevelLabel.Length; i < 64; i++)
            {
                listBytes.Add(0);
            }

            listBytes.AddRange(GameProgress.Reverse());
            listBytes.AddRange(Unknown1.Reverse());
            listBytes.AddRange(Unknown2.Reverse());
            listBytes.AddRange(Unknown3.Reverse());

            if (ThumbnailIcon != ThumbIcon.None)
            {
                listBytes.Add((byte)ThumbnailIcon);
                listBytes.Add(0);
                listBytes.Add(0);
                listBytes.Add(0);
            }

            listBytes.AddRange(Unknown4.Reverse());

            if (UnknownText.Length > 0xA8)
            {
                UnknownText = new string(UnknownText.Take(0xA8).ToArray());
            }
            foreach (char c in UnknownText)
            {
                listBytes.Add((byte)c);
            }

            bytesUsed = listBytes.Count - previousSize;

            for (int i = bytesUsed; i < 0x100; i++)
            {
                listBytes.Add(0xBF);
            }

            blockSize = listBytes.Count - previousSize;
        }
示例#9
0
        public bool Equals(PedType other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Flag.Equals(other.Flag) &&
                   Unknown0.Equals(other.Unknown0) &&
                   Unknown1.Equals(other.Unknown1) &&
                   Unknown2.Equals(other.Unknown2) &&
                   Unknown3.Equals(other.Unknown3) &&
                   Unknown4.Equals(other.Unknown4) &&
                   Threats.Equals(other.Threats) &&
                   Avoid.Equals(other.Avoid));
        }
示例#10
0
        public string ToStruct()
        {
            StringBuilder result = new StringBuilder("{ ");

            result.Append(Unknown1.ToCHex());
            result.Append(", ");
            result.Append(Unknown2.ToC());
            result.Append(", ");
            result.Append(Unknown3.ToC());
            result.Append(", ");
            result.Append(Model != null ? "&" + Model.Name : "NULL");
            result.Append(", ");
            result.Append(Animation != null ? "&" + ActionName : "NULL");
            result.Append(", (NJS_TEXLIST *)");
            result.Append(Unknown4.ToCHex());
            result.Append(" }");
            return(result.ToString());
        }
示例#11
0
        public void Deserialize(SaveStream input)
        {
            this.Name     = input.ReadString();
            this.Unknown1 = input.ReadValueU32();
            this.Unknown2 = input.ReadValueU32();
            this.Unknown3 = input.ReadValueU32();

            // States
            {
                uint count = input.ReadValueU32();
                this.Unknown4s.Clear();
                for (uint i = 0; i < count; i++)
                {
                    Unknown4 unknown3 = new Unknown4();
                    unknown3.Deserialize(input);
                    this.Unknown4s.Add(unknown3);
                }
            }
        }
示例#12
0
        public xxSubmesh Clone()
        {
            xxSubmesh submesh = new xxSubmesh();

            submesh.Unknown1      = (byte[])Unknown1.Clone();
            submesh.MaterialIndex = MaterialIndex;
            submesh.FaceList      = new List <xxFace>(FaceList.Count);
            for (int i = 0; i < FaceList.Count; i++)
            {
                submesh.FaceList.Add(FaceList[i].Clone());
            }
            submesh.VertexList = new List <xxVertex>(VertexList.Count);
            for (int i = 0; i < VertexList.Count; i++)
            {
                submesh.VertexList.Add(VertexList[i].Clone());
            }

            submesh.Unknown2 = Unknown2.CloneIfNotNull();

            if (Vector2Lists != null)
            {
                submesh.Vector2Lists = new List <List <Vector2> >(Vector2Lists.Count);
                for (int i = 0; i < Vector2Lists.Count; i++)
                {
                    List <Vector2> vectorList = new List <Vector2>(Vector2Lists[i].Count);
                    submesh.Vector2Lists.Add(vectorList);
                    for (int j = 0; j < Vector2Lists[i].Count; j++)
                    {
                        vectorList.Add(Vector2Lists[i][j]);
                    }
                }
            }

            submesh.Unknown3 = Unknown3.CloneIfNotNull();
            submesh.Unknown4 = Unknown4.CloneIfNotNull();
            submesh.Unknown5 = Unknown5.CloneIfNotNull();
            submesh.Unknown6 = Unknown6.CloneIfNotNull();

            return(submesh);
        }
示例#13
0
        public odfFrame Clone(bool mesh, List <ObjectID> meshIDs, bool childFrames)
        {
            odfFrame frame = new odfFrame(new ObjectName(Name.Name, Name.Info), new ObjectID(Id), Count);

            frame.Parent       = Parent;
            frame.ParentId     = new ObjectID(ParentId);
            frame.Matrix       = Matrix;
            frame.AlwaysZero1  = (byte[])AlwaysZero1.Clone();
            frame.AlwaysZero2  = (byte[])AlwaysZero2.Clone();
            frame.Unknown3     = Unknown3;
            frame.Unknown4     = (float[])Unknown4.Clone();
            frame.Unknown5     = Unknown5;
            frame.Unknown6     = Unknown6;
            frame.AlwaysZero7  = (byte[])AlwaysZero7.Clone();
            frame.Unknown8     = Unknown8;
            frame.AlwaysZero9  = (byte[])AlwaysZero9.Clone();
            frame.Unknown10    = Unknown10;
            frame.AlwaysZero11 = (byte[])AlwaysZero11.Clone();
            frame.Unknown12    = Unknown12;

            if (mesh && (int)MeshId != 0)
            {
                frame.MeshId = new ObjectID(MeshId);
                meshIDs.Add(MeshId);
            }
            else
            {
                frame.MeshId = ObjectID.INVALID;
            }

            if (childFrames)
            {
                for (int i = 0; i < children.Count; i++)
                {
                    frame.AddChild(children[i].Clone(mesh, meshIDs, true));
                }
            }
            return(frame);
        }
示例#14
0
 public void AsText(StringBuilder b, int pad)
 {
     b.Append(' ', pad);
     b.AppendLine("SceneSpecification:");
     b.Append(' ', pad++);
     b.AppendLine("{");
     b.Append(' ', pad);
     b.AppendLine("CellZ: 0x" + CellZ.ToString("X8") + " (" + CellZ + ")");
     Cell.AsText(b, pad);
     b.Append(' ', pad);
     b.AppendLine("arSnoLevelAreas:");
     b.Append(' ', pad);
     b.AppendLine("{");
     for (int i = 0; i < SNOLevelAreas.Length;)
     {
         b.Append(' ', pad + 1);
         for (int j = 0; j < 8 && i < SNOLevelAreas.Length; j++, i++)
         {
             b.Append("0x" + SNOLevelAreas[i].ToString("X8") + ", ");
         }
         b.AppendLine();
     }
     b.Append(' ', pad);
     b.AppendLine("}");
     b.AppendLine();
     b.Append(' ', pad);
     b.AppendLine("snoPrevWorld: 0x" + SNOPrevWorld.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("Unknown1: 0x" + Unknown1.ToString("X8") + " (" + Unknown1 + ")");
     b.Append(' ', pad);
     b.AppendLine("snoPrevLevelArea: 0x" + SNOPrevLevelArea.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("snoNextWorld: 0x" + SNONextWorld.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("Unknown2: 0x" + Unknown2.ToString("X8") + " (" + Unknown2 + ")");
     b.Append(' ', pad);
     b.AppendLine("snoNextLevelArea: 0x" + SNONextLevelArea.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("snoMusic: 0x" + SNOMusic.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("snoCombatMusic: 0x" + SNOCombatMusic.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("snoAmbient: 0x" + SNOAmbient.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("snoReverb: 0x" + SNOReverb.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("snoWeather: 0x" + SNOWeather.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("snoPresetWorld: 0x" + SNOPresetWorld.ToString("X8"));
     b.Append(' ', pad);
     b.AppendLine("Unknown3: 0x" + Unknown3.ToString("X8") + " (" + Unknown3 + ")");
     b.Append(' ', pad);
     b.AppendLine("Unknown4: 0x" + Unknown4.ToString("X8") + " (" + Unknown4 + ")");
     b.Append(' ', pad);
     b.AppendLine("Unknown5: 0x" + Unknown5.ToString("X8") + " (" + Unknown5 + ")");
     b.Append(' ', pad);
     b.AppendLine("ClusterId: 0x" + ClusterID.ToString("X8") + " (" + ClusterID + ")");
     SceneCachedValues.AsText(b, pad);
     b.Append(' ', --pad);
     b.AppendLine("}");
 }
示例#15
0
 /* Autogenerated by R# */
 public bool Equals(AdventurePhysics other) => HangTime == other.HangTime && FloorGrip.Equals(other.FloorGrip) && HorizontalSpeedCap.Equals(other.HorizontalSpeedCap) && VerticalSpeedCap.Equals(other.VerticalSpeedCap) && UnknownAccelRelated.Equals(other.UnknownAccelRelated) && Unknown1.Equals(other.Unknown1) && InitialJumpSpeed.Equals(other.InitialJumpSpeed) && SpringControl.Equals(other.SpringControl) && Unknown2.Equals(other.Unknown2) && RollingMinimumSpeed.Equals(other.RollingMinimumSpeed) && RollingEndSpeed.Equals(other.RollingEndSpeed) && Action1Speed.Equals(other.Action1Speed) && MinWallHitKnockbackSpeed.Equals(other.MinWallHitKnockbackSpeed) && Action2Speed.Equals(other.Action2Speed) && JumpHoldAddSpeed.Equals(other.JumpHoldAddSpeed) && GroundStartingAcceleration.Equals(other.GroundStartingAcceleration) && AirAcceleration.Equals(other.AirAcceleration) && GroundDeceleration.Equals(other.GroundDeceleration) && BrakeSpeed.Equals(other.BrakeSpeed) && AirBrakeSpeed.Equals(other.AirBrakeSpeed) && AirDeceleration.Equals(other.AirDeceleration) && RollingDeceleration.Equals(other.RollingDeceleration) && GravityOffsetSpeed.Equals(other.GravityOffsetSpeed) && MidAirSwerveAcceleration.Equals(other.MidAirSwerveAcceleration) && MinSpeedBeforeStopping.Equals(other.MinSpeedBeforeStopping) && ConstantSpeedOffset.Equals(other.ConstantSpeedOffset) && UnknownOffRoad.Equals(other.UnknownOffRoad) && Unknown3.Equals(other.Unknown3) && Unknown4.Equals(other.Unknown4) && CollisionSize.Equals(other.CollisionSize) && GravitationalPull.Equals(other.GravitationalPull) && YOffsetCamera.Equals(other.YOffsetCamera) && YOffset.Equals(other.YOffset);
示例#16
0
 public override string ToString()
 {
     return($"{{{nameof(Offset)}={Offset.ToString("X")}, {nameof(Unknown0)}={Unknown0.ToString("X")}, {nameof(Unknown1)}={Unknown1.ToString("X")}, {nameof(Unknown2)}={Unknown2.ToString("X")}, {nameof(Unknown3)}={Unknown3.ToString("X")}, {nameof(Unknown4)}={Unknown4.ToString("X")}, {nameof(Unknown5)}={Unknown5.ToString("X")}, {nameof(Unknown6)}={Unknown6.ToString("X")}, {nameof(Unknown7)}={Unknown7.ToString("X")}}}");
 }
        public override void Load(ExtendedBinaryReader fileReader, bool keepOpen = false)
        {
            // Read STSC
            base.Load(fileReader);

            StreamBlock block;

            // System text
            block = GetStreamBlockAndJump(0, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                SystemText.Add(fileReader.ReadStringElsewhere());
            }

            // CGs
            block = GetStreamBlockAndJump(1, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                CGs.Add(fileReader.ReadStruct <CGEntry>());
            }

            // Movies
            block = GetStreamBlockAndJump(2, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                Movies.Add(fileReader.ReadStruct <MovieEntry>());
            }

            // Memories
            block = GetStreamBlockAndJump(3, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                Memories.Add(fileReader.ReadStruct <MemoryEntry>());
            }

            // Characters
            block = GetStreamBlockAndJump(4, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                Characters.Add(fileReader.ReadStruct <CharacterEntry>());
            }

            // Unknown2
            block = GetStreamBlockAndJump(5, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                Unknown2.Add(fileReader.ReadStruct <Unknown2Entry>());
            }

            // Unknown3
            block = GetStreamBlockAndJump(6, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                Unknown3.Add(fileReader.ReadStruct <Unknown3Entry>());
            }

            // Voices
            block = GetStreamBlockAndJump(7, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                Voices.Add(fileReader.ReadStruct <VoiceEntry>());
            }

            // Unknown4
            block = GetStreamBlockAndJump(8, fileReader);
            while (!EndOfBlock(fileReader, block))
            {
                Unknown4.Add(fileReader.ReadStruct <Unknown4Entry>());
            }

            // Older versions may not include art books and drama CDs
            if (Version == 7)
            {
                // Art Book Page
                block = GetStreamBlockAndJump(9, fileReader);
                while (!EndOfBlock(fileReader, block))
                {
                    ArtBookPages.Add(fileReader.ReadStruct <ArtBookPageEntry>());
                }

                // DramaCDs
                block = GetStreamBlockAndJump(10, fileReader);
                while (!EndOfBlock(fileReader, block))
                {
                    DramaCDs.Add(fileReader.ReadStruct <DramaCDEntry>());
                }
            }
        }
        protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            ele.TryPathTo("AnimationType", true, out subEle);
            subEle.Value = AnimationType.ToString();

            ele.TryPathTo("AnimationMultiplier", true, out subEle);
            subEle.Value = AnimationMultiplier.ToString("G15");

            ele.TryPathTo("Reach", true, out subEle);
            subEle.Value = Reach.ToString("G15");

            ele.TryPathTo("Flags1", true, out subEle);
            subEle.Value = Flags1.ToString();

            ele.TryPathTo("GripAnimation", true, out subEle);
            subEle.Value = GripAnimation.ToString();

            ele.TryPathTo("AmmoUse", true, out subEle);
            subEle.Value = AmmoUse.ToString();

            ele.TryPathTo("ReloadAnimation", true, out subEle);
            subEle.Value = ReloadAnimation.ToString();

            ele.TryPathTo("MinSpread", true, out subEle);
            subEle.Value = MinSpread.ToString("G15");

            ele.TryPathTo("Spread", true, out subEle);
            subEle.Value = Spread.ToString("G15");

            ele.TryPathTo("Unknown", true, out subEle);
            subEle.Value = Unknown.ToHex();

            ele.TryPathTo("SightFOV", true, out subEle);
            subEle.Value = SightFOV.ToString("G15");

            ele.TryPathTo("Unknown2", true, out subEle);
            subEle.Value = Unknown2.ToString("G15");

            ele.TryPathTo("Projectile", true, out subEle);
            Projectile.WriteXML(subEle, master);

            ele.TryPathTo("BaseVATSToHitChance", true, out subEle);
            subEle.Value = BaseVATSToHitChance.ToString();

            ele.TryPathTo("AttackAnimation", true, out subEle);
            subEle.Value = AttackAnimation.ToString();

            ele.TryPathTo("ProjectileCount", true, out subEle);
            subEle.Value = ProjectileCount.ToString();

            ele.TryPathTo("EmbeddedWeaponActorValue", true, out subEle);
            subEle.Value = EmbeddedWeaponActorValue.ToString();

            ele.TryPathTo("Range/Min", true, out subEle);
            subEle.Value = MinRange.ToString("G15");

            ele.TryPathTo("Range/Max", true, out subEle);
            subEle.Value = MaxRange.ToString("G15");

            ele.TryPathTo("LimbKillBehavior", true, out subEle);
            subEle.Value = LimbKillBehavior.ToString();

            ele.TryPathTo("Flags2", true, out subEle);
            subEle.Value = Flags2.ToString();

            ele.TryPathTo("AttackAnimationMultiplier", true, out subEle);
            subEle.Value = AttackAnimationMultiplier.ToString("G15");

            ele.TryPathTo("FireRate", true, out subEle);
            subEle.Value = FireRate.ToString("G15");

            ele.TryPathTo("ActionPointCost", true, out subEle);
            subEle.Value = ActionPointCost.ToString("G15");

            ele.TryPathTo("Rumble/LeftMotorStrength", true, out subEle);
            subEle.Value = RumbleLeftMotorStrength.ToString("G15");

            ele.TryPathTo("Rumble/RightMotorStrength", true, out subEle);
            subEle.Value = RumbleRightMotorStrength.ToString("G15");

            ele.TryPathTo("Rumble/Duration", true, out subEle);
            subEle.Value = RumbleDuration.ToString("G15");

            ele.TryPathTo("DamageToWeaponMult", true, out subEle);
            subEle.Value = DamageToWeaponMult.ToString("G15");

            ele.TryPathTo("AttackShotsPerSecond", true, out subEle);
            subEle.Value = AttackShotsPerSecond.ToString("G15");

            ele.TryPathTo("ReloadTime", true, out subEle);
            subEle.Value = ReloadTime.ToString("G15");

            ele.TryPathTo("JamTime", true, out subEle);
            subEle.Value = JamTime.ToString("G15");

            ele.TryPathTo("AimArc", true, out subEle);
            subEle.Value = AimArc.ToString("G15");

            ele.TryPathTo("Skill", true, out subEle);
            subEle.Value = Skill.ToString();

            ele.TryPathTo("Rumble/Pattern", true, out subEle);
            subEle.Value = RumblePattern.ToString();

            ele.TryPathTo("Rumble/Wavelength", true, out subEle);
            subEle.Value = RumbleWavelength.ToString("G15");

            ele.TryPathTo("LimbDamageMult", true, out subEle);
            subEle.Value = LimbDamageMult.ToString("G15");

            ele.TryPathTo("ResistanceType", true, out subEle);
            subEle.Value = ResistanceType.ToString();

            ele.TryPathTo("SightUsage", true, out subEle);
            subEle.Value = SightUsage.ToString("G15");

            ele.TryPathTo("SemiAutomaticFireDelay/Min", true, out subEle);
            subEle.Value = SemiAutomaticFireDelayMin.ToString("G15");

            ele.TryPathTo("SemiAutomaticFireDelay/Max", true, out subEle);
            subEle.Value = SemiAutomaticFireDelayMax.ToString("G15");

            ele.TryPathTo("Unknown3", true, out subEle);
            subEle.Value = Unknown3.ToString("G15");

            ele.TryPathTo("Mods/Mod1/Effect", true, out subEle);
            subEle.Value = Mod1Effect.ToString();

            ele.TryPathTo("Mods/Mod2/Effect", true, out subEle);
            subEle.Value = Mod2Effect.ToString();

            ele.TryPathTo("Mods/Mod3/Effect", true, out subEle);
            subEle.Value = Mod3Effect.ToString();

            ele.TryPathTo("Mods/Mod1/ValueA", true, out subEle);
            subEle.Value = Mod1ValueA.ToString("G15");

            ele.TryPathTo("Mods/Mod2/ValueA", true, out subEle);
            subEle.Value = Mod2ValueA.ToString("G15");

            ele.TryPathTo("Mods/Mod3/ValueA", true, out subEle);
            subEle.Value = Mod3ValueA.ToString("G15");

            ele.TryPathTo("PowerAttackAnimation", true, out subEle);
            subEle.Value = PowerAttackAnimation.ToString();

            ele.TryPathTo("StrengthRequirement", true, out subEle);
            subEle.Value = StrengthRequirement.ToString();

            ele.TryPathTo("Unknown4", true, out subEle);
            subEle.Value = Unknown4.ToString();

            ele.TryPathTo("Mods/Mod1/ReloadAnimation", true, out subEle);
            subEle.Value = Mod1ReloadAnimation.ToString();

            ele.TryPathTo("Unknown5", true, out subEle);
            subEle.Value = Unknown5.ToHex();

            ele.TryPathTo("AmmoRegenRate", true, out subEle);
            subEle.Value = AmmoRegenRate.ToString("G15");

            ele.TryPathTo("KillImpulse", true, out subEle);
            subEle.Value = KillImpulse.ToString("G15");

            ele.TryPathTo("Mods/Mod1/ValueB", true, out subEle);
            subEle.Value = Mod1ValueB.ToString("G15");

            ele.TryPathTo("Mods/Mod2/ValueB", true, out subEle);
            subEle.Value = Mod2ValueB.ToString("G15");

            ele.TryPathTo("Mods/Mod3/ValueB", true, out subEle);
            subEle.Value = Mod3ValueB.ToString("G15");

            ele.TryPathTo("ImpulseDistance", true, out subEle);
            subEle.Value = ImpulseDistance.ToString("G15");

            ele.TryPathTo("SkillRequirement", true, out subEle);
            subEle.Value = SkillRequirement.ToString();
        }
 public override void UpdateData()
 {
     Data = Unknown1.ToString() + ", " + Unknown2.ToString() + ", " + Unknown3.ToString() + ", " + Unknown4.ToString() + ", " + Unknown5.ToString();
 }