예제 #1
0
        public static Dictionary <string, Object_Data> ScrapeData(string dolfile)
        {
            Dictionary <string, Object_Data> ObjectData = new Dictionary <string, Object_Data>();

            uint[]     addresses = new uint[DATA_TABLE_SIZE];
            FileStream fs        = new FileStream(dolfile, FileMode.Open, FileAccess.Read);

            Data.IsBigEndian = true;
            fs.Seek(DATA_TABLE_POINTER, SeekOrigin.Begin);
            for (int i = 0; i < DATA_TABLE_SIZE; i++)
            {
                addresses[i] = Data.ReadUInt32(fs);
            }

            ObjectData = new Dictionary <string, Object_Data>();
            int c = 1;

            foreach (uint address in addresses)
            {
                fs.Seek(MemoryAddressToDolAddress(address), SeekOrigin.Begin);
                Object_Data cur = ReadData(fs);
                ObjectData.Add(cur.key != null ? cur.key : ("no_data" + (c++)), cur);
            }
            return(ObjectData);
        }
예제 #2
0
    public void Add_Pickup_To_Safety(GameObject i_obj, Vector3 i_pos)
    {
        bool is_object_already_present = false;

        foreach (var data in safe_objects)
        {
            if (data.obj == i_obj)
            {
                is_object_already_present = true;
            }
        }

        if (!is_object_already_present)
        {
            Object_Data temp_data = new Object_Data();
            temp_data.obj = i_obj;
            temp_data.pos = i_pos;

            safe_objects.Add(temp_data);
        }
    }
예제 #3
0
        private static Object_Data ReadData(Stream stream)
        {
            Object_Data od      = new Object_Data();
            uint        keyaddr = Data.ReadUInt32(stream);

            od.flags = Data.ReadUInt16(stream);
            od.id    = Data.ReadUInt16(stream);
            uint manageraddr  = Data.ReadUInt32(stream);
            uint guruaddr     = Data.ReadUInt32(stream);
            uint animaddr     = Data.ReadUInt32(stream);
            uint hitaddr      = Data.ReadUInt32(stream);
            uint coladdr      = Data.ReadUInt32(stream);
            uint soundaddr    = Data.ReadUInt32(stream);
            uint physicaladdr = Data.ReadUInt32(stream);

            stream.Seek(20, SeekOrigin.Current);
            od.flags2 = Data.ReadUInt32(stream);
            od.zero   = Data.ReadUInt32(stream);

            if (MemoryAddressToDolAddress(keyaddr) >= stream.Length)
            {
                if (keyaddr != 0)
                {
                    od.key = GetStringAtAddress(stream, keyaddr - 0x80412d90 + 0x003EB630);
                }
                if (manageraddr != 0)
                {
                    od.manager = GetStringAtAddress(stream, manageraddr - 0x80412d90 + 0x003EB630);
                }
                if (guruaddr != 0)
                {
                    od.guru = GetStringAtAddress(stream, guruaddr - 0x80412d90 + 0x003EB630);
                }
            }
            else
            {
                if (keyaddr != 0)
                {
                    od.key = GetStringAtAddress(stream, MemoryAddressToDolAddress(keyaddr));
                }
                if (manageraddr != 0)
                {
                    od.manager = GetStringAtAddress(stream, MemoryAddressToDolAddress(manageraddr));
                }
                if (guruaddr != 0)
                {
                    od.guru = GetStringAtAddress(stream, MemoryAddressToDolAddress(guruaddr));
                }
            }

            if (animaddr != 0)
            {
                stream.Seek(animaddr - 0x80412d90 + 0x003EB630, SeekOrigin.Begin);
                od.anim = ReadAnimInfo(stream);
            }
            if (hitaddr != 0)
            {
                stream.Seek(coladdr - 0x80412d90 + 0x003EB630, SeekOrigin.Begin);
                od.hit    = new Hit_Info();
                od.hit.u1 = Data.ReadSingle(stream);
                od.hit.u2 = Data.ReadSingle(stream);
                od.hit.u3 = Data.ReadSingle(stream);
                od.hit.u4 = Data.ReadSingle(stream);
            }
            return(od);
        }