コード例 #1
0
        static private void ReadObstaclesObject(BTBReader reader, Battle battle)
        {
            uint length = reader.ReadObjectHeader(0x3);

            int  unknownCount  = reader.ReadIntTupleProperty(8, 1)[0];
            uint obstacleCount = (length - 12u) / 80u;

            for (int obstacleNum = 0; obstacleNum < obstacleCount; obstacleNum++)
            {
                reader.ReadPropertyHeader(501, 72);
                int           flags = reader.ReadIntTupleProperty(5, 1)[0];
                int           x     = reader.ReadIntTupleProperty(1, 1)[0];
                int           y     = reader.ReadIntTupleProperty(2, 1)[0];
                int           z     = reader.ReadIntTupleProperty(4, 1)[0];
                int           rad   = reader.ReadIntTupleProperty(6, 1)[0];
                int           dir   = reader.ReadIntTupleProperty(7, 1)[0];
                Obstacle.PROP P     = (Obstacle.PROP)flags;
                battle.Obstacles.Add(new Obstacle(P, x, y, z, (uint)rad, dir));
            }
        }
コード例 #2
0
        static private void ReadNodes(BTBReader reader, Battle battle)
        {
            reader.ReadObjectHeader(0x5);
            uint nodeCount = (uint)reader.ReadIntTupleProperty(8, 1)[0];

            for (int nodeNum = 0; nodeNum < nodeCount; nodeNum++)
            {
                reader.ReadPropertyHeader(503, 96);
                int  flags    = reader.ReadIntTupleProperty(5, 1)[0];
                int  x        = reader.ReadIntTupleProperty(1, 1)[0];
                int  y        = reader.ReadIntTupleProperty(2, 1)[0];
                uint rad      = (uint)reader.ReadIntTupleProperty(6, 1)[0];
                int  dir      = reader.ReadIntTupleProperty(7, 1)[0];
                uint nodeid   = (uint)reader.ReadIntTupleProperty(11, 1)[0];
                uint uuid     = (uint)reader.ReadIntTupleProperty(12, 1)[0];
                uint scriptid = (uint)reader.ReadIntTupleProperty(13, 1)[0];

                Node N = new Node(x, y, rad, dir, nodeid, uuid, scriptid, (Node.USAGE)flags);

                battle.Nodes.Add(N);
            }
        }