Example #1
0
 private void OpenDamageShape(DamageShape shape)
 {
     damageShapeGroup.Visible       = true;
     damageShapeXUpDown.Value       = (Decimal)shape.x;
     damageShapeYUpDown.Value       = (Decimal)shape.y;
     damageShapeZUpDown.Value       = (Decimal)shape.z;
     damageShapeX2UpDown.Value      = (Decimal)shape.dx;
     damageShapeY2UpDown.Value      = (Decimal)shape.dy;
     damageShapeZ2UpDown.Value      = (Decimal)shape.dz;
     damageShapeRadiusUpDown.Value  = (Decimal)shape.radius;
     damageShapeUnknownUpDown.Value = (Decimal)shape.unk;
 }
Example #2
0
        public static void DrawShape(DamageShape s)
        {
            GL.LineWidth(2);
            GL.Color4(Color.FromArgb(128, Color.Yellow));

            Vector3 sPos = s.useStartPos ? s.startPos : new Vector3(0, 0, 0);
            Vector3 pos  = new Vector3(s.x, s.y, s.z);
            Vector3 posd = new Vector3(s.dx, s.dy, s.dz);

            if (s.type == 2)
            {
                RenderTools.drawSphere(sPos + pos, s.radius, 24);
            }
            if (s.type == 3)
            {
                RenderTools.drawCylinder(sPos + pos, sPos + pos + posd, s.radius);
            }
        }
Example #3
0
        private void damageShape_ValueChanged(object sender, EventArgs e)
        {
            DamageShape shape = (DamageShape)currentEntry;

            if (sender == damageShapeXUpDown)
            {
                shape.x = (float)damageShapeXUpDown.Value;
            }
            if (sender == damageShapeYUpDown)
            {
                shape.y = (float)damageShapeYUpDown.Value;
            }
            if (sender == damageShapeZUpDown)
            {
                shape.z = (float)damageShapeZUpDown.Value;
            }
            if (sender == damageShapeX2UpDown)
            {
                shape.dx = (float)damageShapeX2UpDown.Value;
            }
            if (sender == damageShapeY2UpDown)
            {
                shape.dy = (float)damageShapeY2UpDown.Value;
            }
            if (sender == damageShapeZ2UpDown)
            {
                shape.dz = (float)damageShapeZ2UpDown.Value;
            }
            if (sender == damageShapeRadiusUpDown)
            {
                shape.radius = (float)damageShapeRadiusUpDown.Value;
            }
            if (sender == damageShapeUnknown1UpDown)
            {
                shape.dsUnk1 = (byte)damageShapeUnknown1UpDown.Value;
            }
            if (sender == damageShapeUnknown2UpDown)
            {
                shape.dsUnk2 = (int)damageShapeUnknown2UpDown.Value;
            }
        }
Example #4
0
        private void OpenLvdEntry(LVDEntry entry, TreeNode entryTree)
        {
            lvdEntryGroup.Visible = true;
            currentEntry          = entry;
            currentTreeNode       = entryTree;

            nameTB.Text           = currentEntry.name;
            subnameTB.Text        = currentEntry.subname;
            xStartPosUpDown.Value = (decimal)currentEntry.startPos[0];
            yStartPosUpDown.Value = (decimal)currentEntry.startPos[1];
            zStartPosUpDown.Value = (decimal)currentEntry.startPos[2];
            useStartPosCB.Checked = currentEntry.useStartPos;
            string boneNameRigging = currentEntry.boneName;

            if (boneNameRigging.Length == 0)
            {
                boneNameRigging = "None";
            }
            boneRigSelectButton.Text = boneNameRigging;

            if (entry is Collision)
            {
                Collision col = (Collision)entry;
                OpenCollision(col);
            }
            else if (entry is CollisionCliff)
            {
                CollisionCliff cliff = (CollisionCliff)entry;
                OpenCliff(cliff);
            }
            else if (entry is Spawn)
            {
                OpenSpawn(entry);
            }
            else if (entry is Bounds)
            {
                OpenBounds(entry);
            }
            else if (entry is ItemSpawner)
            {
                OpenItemSpawner(entry);
            }
            else if (entry is GeneralPoint)
            {
                GeneralPoint generalPoint = (GeneralPoint)entry;
                OpenGeneralPoint(generalPoint);
            }
            else if (entry is GeneralShape)
            {
                GeneralShape s = (GeneralShape)entry;
                OpenGeneralShape(s);
            }
            else if (entry is DamageShape)
            {
                DamageShape s = (DamageShape)entry;
                OpenDamageShape(s);
            }
            else if (entry is DAT.COLL_DATA)
            {
                OpenDatCollData(entry);
            }
        }
Example #5
0
        /*type 1  - collisions
         * type 2  - spawns
         * type 3  - respawns
         * type 4  - camera bounds
         * type 5  - death boundaries
         * type 6  - ???
         * type 7  - ITEMPT_transform
         * type 8  - enemyGenerator
         * type 9  - ITEMPT
         * type 10 - fsAreaCam (and other fsArea's ? )
         * type 11 - fsCamLimit
         * type 12 - damageShapes (damage sphere and damage capsule are the only ones I've seen, type 2 and 3 respectively)
         * type 13 - item spawners
         * type 14 - general shapes (general rect, general path, etc.)
         * type 15 - general points
         * type 16 - ???
         * type 17 - FsStartPoint
         * type 18 - ???
         * type 19 - ???*/

        public override void Read(string filename)
        {
            FileData f = new FileData(filename);

            f.skip(0xA);//It's magic

            f.skip(1);
            int collisionCount = f.readInt();

            for (int i = 0; i < collisionCount; i++)
            {
                Collision temp = new Collision();
                temp.read(f);
                collisions.Add(temp);
            }

            f.skip(1);
            int spawnCount = f.readInt();

            for (int i = 0; i < spawnCount; i++)
            {
                Spawn temp = new Spawn();
                temp.read(f);
                spawns.Add(temp);
            }

            f.skip(1);
            int respawnCount = f.readInt();

            for (int i = 0; i < respawnCount; i++)
            {
                Spawn temp = new Spawn();
                temp.read(f);
                respawns.Add(temp);
            }

            f.skip(1);
            int cameraCount = f.readInt();

            for (int i = 0; i < cameraCount; i++)
            {
                Bounds temp = new Bounds();
                temp.read(f);
                cameraBounds.Add(temp);
            }

            f.skip(1);
            int blastzoneCount = f.readInt();

            for (int i = 0; i < blastzoneCount; i++)
            {
                Bounds temp = new Bounds();
                temp.read(f);
                blastzones.Add(temp);
            }

            f.skip(1);
            if (f.readInt() != 0) //6
            {
                return;
            }

            f.skip(1);
            if (f.readInt() != 0) //7
            {
                return;
            }

            f.skip(1);
            int enemyGeneratorCount = f.readInt();

            if (enemyGeneratorCount != 0) //Can these be read in the same way as item spawners?
            {
                return;
            }

            f.skip(1);
            if (f.readInt() != 0) //9
            {
                return;
            }

            f.skip(1);
            int fsAreaCamCount = f.readInt();

            if (fsAreaCamCount != 0)
            {
                return;
            }

            f.skip(1);
            int fsCamLimitCount = f.readInt();

            if (fsCamLimitCount != 0)
            {
                return;
            }

            f.skip(1);
            int damageShapeCount = f.readInt();

            for (int i = 0; i < damageShapeCount; i++)
            {
                DamageShape temp = new DamageShape();
                temp.read(f);
                damageShapes.Add(temp);
            }

            f.skip(1);
            int itemCount = f.readInt();

            for (int i = 0; i < itemCount; i++)
            {
                ItemSpawner temp = new ItemSpawner();
                temp.read(f);
                items.Add(temp);
            }

            f.skip(1);
            int generalShapeCount = f.readInt();

            for (int i = 0; i < generalShapeCount; i++)
            {
                GeneralShape temp = new GeneralShape();
                temp.read(f);
                generalShapes.Add(temp);
            }

            f.skip(1);
            int generalPointCount = f.readInt();

            for (int i = 0; i < generalPointCount; i++)
            {
                GeneralPoint temp = new GeneralPoint();
                temp.read(f);
                generalPoints.Add(temp);
            }

            f.skip(1);
            if (f.readInt() != 0) //16
            {
                return;           //no clue how to be consistent in reading these so...
            }
            f.skip(1);
            if (f.readInt() != 0) //17
            {
                return;           //no clue how to be consistent in reading these so...
            }
            f.skip(1);
            if (f.readInt() != 0) //18
            {
                return;           //no clue how to be consistent in reading these so...
            }
            f.skip(1);
            if (f.readInt() != 0) //19
            {
                return;           //no clue how to be consistent in reading these so...
            }
            //LVD doesn't end here and neither does my confusion, will update this part later
        }