コード例 #1
0
ファイル: Player.cs プロジェクト: CamuiChan/ACSE
        //Town Identifier is: 0x30 0x??
        //Player Identifier is: 0xF0 0x??
        //Villager Model Identifier is: 0xD0 ??
        //Villager Identifier is: 0xE0 0x??
        //Can Look up resetti values, if wanted.
        //Documented ones: 0x250C | 0xAE8A | 0x85A6

        public void Read()
        {
            int offset = 0x20 + Index * Player_Length;

            Name                 = DataConverter.ReadString(offset + 0, 8).Trim();
            Town_Name            = DataConverter.ReadString(offset + 0x8, 8).Trim();
            Identifier           = DataConverter.ReadUInt(offset + 0x10); //First two are player identifier bytes. Second two bytes are town identifier bytes.
            Gender               = DataConverter.ReadData(offset + 0x14, 1)[0];
            Face                 = DataConverter.ReadData(offset + 0x15, 1)[0];
            Inventory            = new Inventory(DataConverter.ReadUShortArray(offset + 0x68, 0x1E / 2));
            Bells                = DataConverter.ReadUInt(offset + 0x8C);
            Debt                 = DataConverter.ReadUInt(offset + 0x90);
            Held_Item            = new Item(DataConverter.ReadUShort(offset + 0x4A4));
            Inventory_Background = new Item(DataConverter.ReadUShort(offset + 0x1084));
            Shirt                = new Item(DataConverter.ReadUShort(offset + 0x1089 + 1)); //Research Patterns used as shirt.
            Reset                = DataConverter.ReadUInt(offset + 0x10F4) > 0;
            Savings              = DataConverter.ReadUInt(offset + 0x122C);
            Exists               = Identifier != 0xFFFFFFFF;

            for (int i = 0; i < 8; i++)
            {
                Patterns[i] = new Pattern(offset + 0x1240 + i * 0x220);
            }
            if (Exists)
            {
                House_Number     = GetHouse();
                House            = new House(0x9CE8 + (House_Number - 1) * 0x26B0);
                Last_Played_Date = new ACDate(Exists ? DataConverter.ReadDataRaw(House.Offset + 0x2640, 8) : new byte[8]);
            }
        }
コード例 #2
0
 public Messageboard_Post(int offset)
 {
     Post        = DataConverter.ReadString(offset, 0xC0);
     Post_String = Post.Clean();
     Post_Date   = new ACDate(DataConverter.ReadDataRaw(offset + 0xC0, 8));
     //MessageBox.Show(string.Format("{0}\n\nPosted at:\n{1}", Post_String, Post_Date.Date_Time_String));
 }
コード例 #3
0
        public House(int offset)
        {
            Offset             = offset;
            Owning_Player_Name = DataConverter.ReadString(offset, 8).Trim();
            Town_Name          = DataConverter.ReadString(offset + 8, 8).Trim();
            Player_ID          = DataConverter.ReadUInt(offset + 0x10);
            Last_Entry_Date    = new ACDate(DataConverter.ReadDataRaw(offset + 0x1C, 4));
            Last_Upgrade_Date  = new ACDate(DataConverter.ReadDataRaw(offset + 0x26, 4), true);
            //Garbage here
            House_Number = (byte)((offset - 0x9CE8) / 0x26B0);
            for (int i = 0; i < 3; i++)
            {
                Rooms[i] = new Room(DataConverter.ReadUShortArray(offset + 0x38 + i * 0x8A8, 0x454), i);
            }
            for (int i = 0; i < 10; i++)
            {
                Mailbox[i] = new Mail(offset + 0x1A30 + i * 0x12A);
            }
            for (int i = 0; i < 4; i++)
            {
                int local_Offset = offset + 0x25D4 + i * 0x8;
                Gyroid_Storage[i] = new Gyroid_Item(DataConverter.ReadUShort(local_Offset), DataConverter.ReadUInt(local_Offset + 4), DataConverter.ReadByte(local_Offset + 3));
            }

            Gyroid_Message  = DataConverter.ReadString(offset + 0x25F4, 0x80);
            Cockroach_Count = DataConverter.ReadByte(offset + 0x2648);
            //MessageBox.Show(Gyroid_Message.Clean());
        }
コード例 #4
0
ファイル: PlayerRelation.cs プロジェクト: Slattz/ACSE
        public ACPlayerRelation(Save SaveFile, Villager Villager, int DataOffset)
        {
            this.SaveFile = SaveFile;
            this.Villager = Villager;
            Offset        = DataOffset;

            PlayerName     = SaveFile.ReadString(Offset, 8);
            PlayerTownName = SaveFile.ReadString(Offset + 8, 8);
            PlayerId       = SaveFile.ReadUInt16(Offset + 0x10, true);
            PlayerTownId   = SaveFile.ReadUInt16(Offset + 0x12, true);
            MetDate        = new ACDate(SaveFile.ReadByteArray(Offset + 0x14, 8));
            MetTownName    = SaveFile.ReadString(Offset + 0x1C, 8);
            MetTownId      = SaveFile.ReadUInt16(Offset + 0x24, true);
            Unknown1       = SaveFile.ReadByteArray(Offset + 0x26, 0x0A);
            Friendship     = SaveFile.ReadByte(Offset + 0x30);
            Flags          = SaveFile.ReadByte(Offset + 0x31);
            // Mail Bytes? 0x5
            // Mail Body: 0xF8

            Exists = PlayerId != 0xFFFF;
        }
コード例 #5
0
ファイル: VillagerData.cs プロジェクト: CamuiChan/ACSE
        public Mail Saved_Letter;            //Going to have to change this to a custom class, as it strips most mail header data (Length is 0x100? Message part is still 0xF8)
        //

        public Villager_Player_Entry(byte[] entryData, int offset)
        {
            Exists = true;
            Offset = offset;
            byte[] playerNameBytes = new byte[8], playerTownName = new byte[8], metTownName = new byte[8], metDate = new byte[8], playerId = new byte[4], metTownId = new byte[2];
            Buffer.BlockCopy(entryData, 0, playerNameBytes, 0, 8);
            Buffer.BlockCopy(entryData, 8, playerTownName, 0, 8);
            Buffer.BlockCopy(entryData, 0x1C, metTownName, 0, 8);
            Buffer.BlockCopy(entryData, 0x10, playerId, 0, 4);
            Buffer.BlockCopy(entryData, 0x14, metDate, 0, 8);
            Buffer.BlockCopy(entryData, 0x24, metTownId, 0, 2);
            Array.Reverse(playerId);
            Array.Reverse(metTownId);

            Player_Name      = new ACString(playerNameBytes).Trim();
            Player_Town_Name = new ACString(playerTownName).Trim();
            Met_Town_Name    = new ACString(metTownName).Trim();
            Met_Date         = new ACDate(metDate);
            Player_ID        = BitConverter.ToUInt32(playerId, 0);
            Met_Town_ID      = BitConverter.ToUInt16(metTownId, 0);
            Friendship       = (sbyte)entryData[0x30];
        }